fix errors

This commit is contained in:
Sai Naw Wun
2020-10-22 04:14:53 +06:30
parent 2021f74872
commit e5540c5491
32 changed files with 1069 additions and 811 deletions

View File

@@ -1,3 +1,4 @@
import 'package:fcs/domain/entities/fcs_shipment.dart';
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/fcs_shipment/model/fcs_shipment_model.dart';
import 'package:fcs/pages/shipment/model/shipment_model.dart';
@@ -16,10 +17,20 @@ class InvoiceShipmentList extends StatefulWidget {
class _InvoiceShipmentListState extends State<InvoiceShipmentList> {
bool _isLoading = false;
List<FcsShipment> _fcsShipments = [];
@override
void initState() {
super.initState();
_load();
}
_load() async {
FcsShipmentModel fcsShipmentModel =
Provider.of<FcsShipmentModel>(context, listen: false);
var fcsShipments = await fcsShipmentModel.getInvoiceFcsShipments();
setState(() {
_fcsShipments = fcsShipments;
});
}
@override
@@ -29,7 +40,6 @@ class _InvoiceShipmentListState extends State<InvoiceShipmentList> {
@override
Widget build(BuildContext context) {
FcsShipmentModel fcsShipmentModel = Provider.of<FcsShipmentModel>(context);
return LocalProgress(
inAsyncCall: _isLoading,
child: DefaultTabController(
@@ -42,18 +52,8 @@ class _InvoiceShipmentListState extends State<InvoiceShipmentList> {
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,
title: LocalText(context, "shipment",
title: LocalText(context, "invoice.shipment.title",
fontSize: 18, color: Colors.white),
actions: <Widget>[
IconButton(
icon: Icon(
Icons.search,
color: Colors.white,
),
iconSize: 30,
// onPressed: () => showPlacesSearch(context),
),
],
),
body: new ListView.separated(
separatorBuilder: (context, index) => Divider(
@@ -62,10 +62,10 @@ class _InvoiceShipmentListState extends State<InvoiceShipmentList> {
scrollDirection: Axis.vertical,
padding: EdgeInsets.only(top: 15),
shrinkWrap: true,
itemCount: fcsShipmentModel.fcsShipments.length,
itemCount: _fcsShipments.length,
itemBuilder: (BuildContext context, int index) {
return InvoiceShipmentListRow(
fcsShipment: fcsShipmentModel.fcsShipments[index]);
fcsShipment: _fcsShipments[index]);
}),
),
),