fix invoice display

This commit is contained in:
Sai Naw Wun
2020-10-28 06:23:04 +06:30
parent 9f58e7f748
commit bd63e1e161
4 changed files with 54 additions and 46 deletions

View File

@@ -6,26 +6,23 @@ import 'package:fcs/domain/entities/payment.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/invoice/model/invoice_model.dart';
import 'package:fcs/pages/invoice/payment/payment_page_edit.dart';
import 'package:fcs/pages/main/util.dart';
import 'package:fcs/pages/widgets/image_file_picker.dart';
import 'package:fcs/pages/widgets/img_picker.dart';
import 'package:fcs/pages/widgets/input_text.dart';
import 'package:fcs/pages/widgets/local_button.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/local_title.dart';
import 'package:fcs/pages/widgets/progress.dart';
import 'package:fcs/pages/widgets/show_img.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
class PaymentPage extends StatefulWidget {
final Invoice invoice;
PaymentPage({this.invoice});
final bool forCustomer;
PaymentPage({this.invoice, this.forCustomer});
@override
_PaymentPageState createState() => _PaymentPageState();
@@ -164,32 +161,35 @@ class _PaymentPageState extends State<PaymentPage> {
child: Column(
children: [Text('\$ ${p.amount}'), Text('${p.status}')],
))),
Expanded(
flex: 1,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: p.status == payment_pending_status
? [
InkWell(
onTap: () => _confirm(p),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(
Icons.check,
color: primaryColor,
widget.forCustomer
? Container()
: Expanded(
flex: 1,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: p.status == payment_pending_status
? [
InkWell(
onTap: () => _confirm(p),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(
Icons.check,
color: primaryColor,
),
),
),
),
),
InkWell(
onTap: () => _cancel(p),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(Icons.close, color: primaryColor),
),
),
]
: [],
)),
InkWell(
onTap: () => _cancel(p),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(Icons.close,
color: primaryColor),
),
),
]
: [],
)),
],
),
);
@@ -213,11 +213,13 @@ class _PaymentPageState extends State<PaymentPage> {
child: Text('Amount',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey))),
Expanded(
flex: 1,
child: Text('Actions',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey))),
widget.forCustomer
? Container()
: Expanded(
flex: 1,
child: Text('Actions',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.grey))),
],
),
));
@@ -248,10 +250,12 @@ class _PaymentPageState extends State<PaymentPage> {
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 16.0)))),
Expanded(
flex: 1,
child: Container(),
),
widget.forCustomer
? Container()
: Expanded(
flex: 1,
child: Container(),
),
],
),
));