update invoice

This commit is contained in:
PhyoThandar
2020-10-09 19:00:39 +06:30
parent 776ebf52ee
commit 81663b1224
6 changed files with 555 additions and 611 deletions

View File

@@ -1,6 +1,10 @@
import 'package:fcs/domain/entities/package.dart';
import 'package:fcs/domain/entities/user.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/package_search/package_serach.dart';
import 'package:fcs/pages/user_search/user_serach.dart';
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:fcs/pages/widgets/progress.dart';
@@ -31,6 +35,7 @@ class _InvoiceListState extends State<InvoiceList> {
@override
Widget build(BuildContext context) {
var owner = true;
var invoiceModel = Provider.of<InvoiceModel>(context);
return LocalProgress(
inAsyncCall: _isLoading,
@@ -48,21 +53,9 @@ class _InvoiceListState extends State<InvoiceList> {
color: Colors.white, fontSize: 20),
actions: <Widget>[
IconButton(
icon: Icon(
Icons.search,
color: Colors.white,
),
iconSize: 30,
// onPressed: () => showPlacesSearch(context),
),
icon: Icon(Icons.search, color: Colors.white),
onPressed: () {}),
],
bottom: TabBar(
unselectedLabelColor: Colors.grey,
tabs: [
Tab(text: "Pending"),
Tab(text: "Paid"),
],
),
),
floatingActionButton: owner
? FloatingActionButton.extended(
@@ -71,12 +64,27 @@ class _InvoiceListState extends State<InvoiceList> {
},
icon: Icon(Icons.add),
label:
Text(AppTranslations.of(context).text("invoices.add")),
LocalText(context, 'invoices.add', color: Colors.white),
backgroundColor: primaryColor,
)
: null,
body: TabBarView(
children: [_pending(), _paided()],
body: Column(
children: <Widget>[
Expanded(
child: new ListView.separated(
separatorBuilder: (context, index) => Divider(
color: Colors.black,
),
scrollDirection: Axis.vertical,
padding: EdgeInsets.only(top: 15),
shrinkWrap: true,
itemCount: invoiceModel.invoices.length,
itemBuilder: (BuildContext context, int index) {
return InvoiceListRow(
invoice: invoiceModel.invoices[index]);
}),
),
],
)),
),
);