modify FCS shipment
This commit is contained in:
@@ -610,11 +610,26 @@
|
|||||||
"notifications.title":"Notification",
|
"notifications.title":"Notification",
|
||||||
|
|
||||||
|
|
||||||
"shipment.title":"FCS Shipments",
|
"FCSshipment.title":"FCS Shipments",
|
||||||
"shipment.list.title":"FCS SHIPMENTS",
|
"FCSshipment.list.title":"FCS SHIPMENTS",
|
||||||
"shipment.add":"New FCS shipment",
|
"FCSshipment.add":"New FCS shipment",
|
||||||
"shipment.form.title":"FCS SHIPMENT",
|
"FCSshipment.form.title":"FCS SHIPMENT",
|
||||||
"shipment.number":"FCS Shipment Number",
|
"FCSshipment.number":"FCS Shipment Number",
|
||||||
|
"FCSshipment.cutoff_date":"Cutoff Date",
|
||||||
|
"FCSshipment.ETA":"ETA",
|
||||||
|
"FCSshipment.departure_date":"Departure Date",
|
||||||
|
"FCSshipment.shipment_type":"Shipment Type",
|
||||||
|
"FCSshipment.consignee":"Consignee",
|
||||||
|
"FCSshipment.port_of_loading":"Port of Loading",
|
||||||
|
"FCSshipment.final_destination":"Final Destination",
|
||||||
|
"FCSshipment.status":"Status",
|
||||||
|
"FCSshipment.remark":"Remark",
|
||||||
|
"FCSshipment.commercial_invoice":"Download Commercial Invoice",
|
||||||
|
"FCSshipment.packing_list":"Download Packing List",
|
||||||
|
"FCSshipment.dms":"Download DMS",
|
||||||
|
"FCSshipment.cargo_manifest":"Download Cargo Manifest",
|
||||||
|
"FCSshipment.create":"Create FCS Shipment",
|
||||||
|
"FCSshipment.update":"Update FCS Shipment",
|
||||||
|
|
||||||
"pickup": "Shipments",
|
"pickup": "Shipments",
|
||||||
"pickup.title": "SHIPMENTS",
|
"pickup.title": "SHIPMENTS",
|
||||||
|
|||||||
@@ -648,11 +648,26 @@
|
|||||||
|
|
||||||
"notifications.title":"Notifications",
|
"notifications.title":"Notifications",
|
||||||
|
|
||||||
"shipment.title":"FCS တင်ပို့ခြင်းများ",
|
"FCSshipment.title":"FCS တင်ပို့ခြင်းများ",
|
||||||
"shipment.list.title":"FCS တင်ပို့ခြင်းများ",
|
"FCSshipment.list.title":"FCS တင်ပို့ခြင်းများ",
|
||||||
"shipment.add":"New FCS shipment",
|
"FCSshipment.add":"FCS တင်ပို့ခြင်းအသစ်",
|
||||||
"shipment.form.title":"FCS SHIPMENT",
|
"FCSshipment.form.title":"FCS တင်ပို့ခြင်း",
|
||||||
"shipment.number":"FCS Shipment Number",
|
"FCSshipment.number":"FCS တင်ပို့နံပါတ်",
|
||||||
|
"FCSshipment.cutoff_date":"သတ်မှတ်ရက်",
|
||||||
|
"FCSshipment.ETA":"ခန့်မှန်းရောက်ချိန်",
|
||||||
|
"FCSshipment.departure_date":"ထွက်ခွာသည့်ရက်",
|
||||||
|
"FCSshipment.shipment_type":"တင်ပို့မှုအမျိုးအစား",
|
||||||
|
"FCSshipment.consignee":"ပစ္စည်းလက်ခံသူ",
|
||||||
|
"FCSshipment.port_of_loading":"ဆိပ်ကမ်း",
|
||||||
|
"FCSshipment.final_destination":"ဆိုက်ရောက်နေရာ",
|
||||||
|
"FCSshipment.status":"အခြေအနေ",
|
||||||
|
"FCSshipment.remark":"မှတ်ချက်",
|
||||||
|
"FCSshipment.commercial_invoice":"Download Commercial Invoice",
|
||||||
|
"FCSshipment.packing_list":"Download Packing List",
|
||||||
|
"FCSshipment.dms":"Download DMS",
|
||||||
|
"FCSshipment.cargo_manifest":"Download Cargo Manifest",
|
||||||
|
"FCSshipment.create":"FCS တင်ပို့ခြင်းပြုလုပ်ရန်",
|
||||||
|
"FCSshipment.update":"FCS တင်ပို့ခြင်းပြင်ရန်",
|
||||||
|
|
||||||
"pickup": "Shipments",
|
"pickup": "Shipments",
|
||||||
"pickup.title": "SHIPMENTS",
|
"pickup.title": "SHIPMENTS",
|
||||||
|
|||||||
@@ -2,8 +2,13 @@ import 'package:fcs/domain/entities/fcs_shipment.dart';
|
|||||||
import 'package:fcs/helpers/theme.dart';
|
import 'package:fcs/helpers/theme.dart';
|
||||||
import 'package:fcs/localization/app_translations.dart';
|
import 'package:fcs/localization/app_translations.dart';
|
||||||
import 'package:fcs/pages/fcs_shipment/model/fcs_shipment_model.dart';
|
import 'package:fcs/pages/fcs_shipment/model/fcs_shipment_model.dart';
|
||||||
|
import 'package:fcs/pages/main/model/language_model.dart';
|
||||||
import 'package:fcs/pages/main/model/main_model.dart';
|
import 'package:fcs/pages/main/model/main_model.dart';
|
||||||
|
import 'package:fcs/pages/widgets/display_text.dart';
|
||||||
|
import 'package:fcs/pages/widgets/input_text.dart';
|
||||||
import 'package:fcs/pages/widgets/label_widgets.dart';
|
import 'package:fcs/pages/widgets/label_widgets.dart';
|
||||||
|
import 'package:fcs/pages/widgets/local_text.dart';
|
||||||
|
import 'package:fcs/pages/widgets/popupmenu.dart';
|
||||||
import 'package:fcs/pages/widgets/progress.dart';
|
import 'package:fcs/pages/widgets/progress.dart';
|
||||||
import 'package:flutter_icons/flutter_icons.dart';
|
import 'package:flutter_icons/flutter_icons.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
@@ -116,124 +121,36 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var shipmentModel = Provider.of<FcsShipmentModel>(context);
|
var shipmentModel = Provider.of<FcsShipmentModel>(context);
|
||||||
|
var languageModel = Provider.of<LanguageModel>(context);
|
||||||
|
|
||||||
final cargoBtn = Container(
|
final createBtn = fcsButton(
|
||||||
padding: EdgeInsets.only(top: 5),
|
context,
|
||||||
child: Align(
|
getLocalString(context, "FCSshipment.create"),
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: Center(
|
|
||||||
child: Container(
|
|
||||||
width: 250,
|
|
||||||
child: FlatButton(
|
|
||||||
child: Text('Download Cargo Manifest'),
|
|
||||||
color: primaryColor,
|
|
||||||
textColor: Colors.white,
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
))),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
final commercialBtn = Container(
|
final updateBtn = fcsButton(
|
||||||
padding: EdgeInsets.only(top: 20),
|
context,
|
||||||
child: Align(
|
getLocalString(context, "FCSshipment.update"),
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: Center(
|
|
||||||
child: Container(
|
|
||||||
width: 250,
|
|
||||||
child: FlatButton(
|
|
||||||
child: Text('Download Commercial Invoice'),
|
|
||||||
color: primaryColor,
|
|
||||||
textColor: Colors.white,
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
))),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
final packingBtn = Container(
|
|
||||||
padding: EdgeInsets.only(top: 5),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: Center(
|
|
||||||
child: Container(
|
|
||||||
width: 250,
|
|
||||||
child: FlatButton(
|
|
||||||
child: Text('Download Packing List'),
|
|
||||||
color: primaryColor,
|
|
||||||
textColor: Colors.white,
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
))),
|
|
||||||
);
|
|
||||||
|
|
||||||
final dmsBtn = Container(
|
|
||||||
padding: EdgeInsets.only(top: 5),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: Center(
|
|
||||||
child: Container(
|
|
||||||
width: 250,
|
|
||||||
child: FlatButton(
|
|
||||||
child: Text('Download DMS'),
|
|
||||||
color: primaryColor,
|
|
||||||
textColor: Colors.white,
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
))),
|
|
||||||
);
|
|
||||||
|
|
||||||
final createBtn = Container(
|
|
||||||
padding: EdgeInsets.only(top: 20),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: Center(
|
|
||||||
child: Container(
|
|
||||||
width: 250,
|
|
||||||
child: FlatButton(
|
|
||||||
child: Text('Create FCS Shipment'),
|
|
||||||
color: primaryColor,
|
|
||||||
textColor: Colors.white,
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
))),
|
|
||||||
);
|
|
||||||
final updateBtn = Container(
|
|
||||||
padding: EdgeInsets.only(top: 5),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: Center(
|
|
||||||
child: Container(
|
|
||||||
width: 250,
|
|
||||||
child: FlatButton(
|
|
||||||
child: Text('Update FCS Shipment'),
|
|
||||||
color: primaryColor,
|
|
||||||
textColor: Colors.white,
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
))),
|
|
||||||
);
|
|
||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
|
shadowColor: Colors.transparent,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(Icons.close),
|
icon: new Icon(Icons.close, color: primaryColor),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: Colors.white,
|
||||||
title: Text(AppTranslations.of(context).text("shipment.form.title")),
|
title: LocalText(
|
||||||
|
context,
|
||||||
|
"FCSshipment.form.title",
|
||||||
|
color: primaryColor,
|
||||||
|
fontSize: 18,
|
||||||
|
),
|
||||||
|
actions: [menuPopWidget(context)],
|
||||||
),
|
),
|
||||||
body: Card(
|
body: Card(
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -244,51 +161,46 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
|||||||
child: ListView(children: <Widget>[
|
child: ListView(children: <Widget>[
|
||||||
// _showCustomerData(mainModel.customer),
|
// _showCustomerData(mainModel.customer),
|
||||||
widget.shipment == null
|
widget.shipment == null
|
||||||
? fcsInput('FCS Shipment Number', Ionicons.ios_airplane,
|
? InputText(
|
||||||
controller: _shipmentNumberController)
|
labelTextKey: "FCSshipment.number",
|
||||||
: Container(
|
iconData: Ionicons.ios_airplane,
|
||||||
child: TextFormField(
|
|
||||||
controller: _shipmentNumberController,
|
controller: _shipmentNumberController,
|
||||||
readOnly: true,
|
)
|
||||||
decoration: InputDecoration(
|
: DisplayText(
|
||||||
fillColor: Colors.white,
|
iconData: Ionicons.ios_airplane,
|
||||||
labelText: 'FCS Shipment Number',
|
labelText: "FCSshipment.number",
|
||||||
labelStyle:
|
text: _shipmentNumberController.text),
|
||||||
TextStyle(fontSize: 16, color: Colors.grey),
|
|
||||||
filled: true,
|
|
||||||
enabledBorder: InputBorder.none,
|
|
||||||
focusedBorder: InputBorder.none,
|
|
||||||
icon: Icon(
|
|
||||||
Ionicons.ios_airplane,
|
|
||||||
color: primaryColor,
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
widget.shipment == null
|
widget.shipment == null
|
||||||
? Container(
|
? InputText(
|
||||||
padding: EdgeInsets.only(top: 5),
|
labelTextKey: "FCSshipment.cutoff_date",
|
||||||
child: fcsInput('Cutoff Date', Icons.date_range,
|
iconData: Icons.date_range,
|
||||||
controller: _cutoffDateController),
|
controller: _cutoffDateController,
|
||||||
)
|
)
|
||||||
: Container(),
|
: Container(),
|
||||||
Container(
|
|
||||||
padding:
|
InputText(
|
||||||
EdgeInsets.only(top: widget.shipment == null ? 5 : 0),
|
labelTextKey: "FCSshipment.ETA",
|
||||||
child: fcsInput('ETA', Icons.date_range,
|
iconData: Icons.date_range,
|
||||||
controller: _arrivalDateController),
|
controller: _arrivalDateController,
|
||||||
),
|
),
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.only(top: 5),
|
InputText(
|
||||||
child: fcsInput('Departure Date', Icons.date_range,
|
labelTextKey: "FCSshipment.departure_date",
|
||||||
controller: _departureDateControler),
|
iconData: Icons.date_range,
|
||||||
|
controller: _departureDateControler,
|
||||||
),
|
),
|
||||||
widget.shipment == null
|
widget.shipment == null
|
||||||
? Container(
|
? DropdownButtonFormField(
|
||||||
padding: EdgeInsets.only(top: 5),
|
|
||||||
child: DropdownButtonFormField(
|
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
enabledBorder: UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: primaryColor)),
|
||||||
fillColor: Colors.white,
|
fillColor: Colors.white,
|
||||||
labelText: 'FCS Shipment Type',
|
labelStyle: languageModel.isEng
|
||||||
|
? labelStyle
|
||||||
|
: labelStyleMM,
|
||||||
|
labelText: AppTranslations.of(context)
|
||||||
|
.text('FCSshipment.shipment_type'),
|
||||||
icon: Icon(Ionicons.ios_airplane,
|
icon: Icon(Ionicons.ios_airplane,
|
||||||
color: primaryColor)),
|
color: primaryColor)),
|
||||||
items: shipmentModel.shipmentType
|
items: shipmentModel.shipmentType
|
||||||
@@ -300,71 +212,104 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
|||||||
_currentShipment = selected;
|
_currentShipment = selected;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
),
|
|
||||||
)
|
)
|
||||||
: Container(),
|
: Container(),
|
||||||
|
|
||||||
widget.shipment == null
|
widget.shipment == null
|
||||||
? Container(
|
? InputText(
|
||||||
padding: EdgeInsets.only(top: 5),
|
labelTextKey: 'FCSshipment.consignee',
|
||||||
child: fcsInput('Consignee', Icons.work,
|
iconData: Icons.work,
|
||||||
controller: _consigneeController),
|
controller: _consigneeController)
|
||||||
)
|
|
||||||
: Container(),
|
: Container(),
|
||||||
widget.shipment == null
|
widget.shipment == null
|
||||||
? Container(
|
? InputText(
|
||||||
padding: EdgeInsets.only(top: 5),
|
labelTextKey: 'FCSshipment.port_of_loading',
|
||||||
child: fcsInput(
|
iconData: FontAwesomeIcons.ship,
|
||||||
'Port of Loading', FontAwesomeIcons.ship,
|
controller: _portController)
|
||||||
controller: _portController),
|
|
||||||
)
|
|
||||||
: Container(),
|
: Container(),
|
||||||
widget.shipment == null
|
widget.shipment == null
|
||||||
? Container(
|
? InputText(
|
||||||
padding: EdgeInsets.only(top: 5),
|
labelTextKey: 'FCSshipment.final_destination',
|
||||||
child: fcsInput('Final Destination',
|
iconData: MaterialCommunityIcons.location_enter,
|
||||||
MaterialCommunityIcons.location_enter,
|
controller: _destinationController)
|
||||||
controller: _destinationController),
|
|
||||||
)
|
|
||||||
: Container(),
|
: Container(),
|
||||||
widget.shipment == null
|
widget.shipment == null
|
||||||
? Container()
|
? Container()
|
||||||
: Container(
|
: Container(
|
||||||
padding: EdgeInsets.only(top: 5),
|
padding: EdgeInsets.only(top: 5),
|
||||||
child: TextFormField(
|
child: DisplayText(
|
||||||
controller: _statusController,
|
text: _statusController.text,
|
||||||
cursorColor: primaryColor,
|
iconData: Icons.av_timer,
|
||||||
decoration: InputDecoration(
|
labelText: 'FCSshipment.status',
|
||||||
fillColor: Colors.white,
|
)),
|
||||||
labelText: 'Status',
|
|
||||||
filled: true,
|
|
||||||
labelStyle: TextStyle(
|
|
||||||
fontSize: 16, color: Colors.grey),
|
|
||||||
focusedBorder: UnderlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Colors.grey, width: 1.0)),
|
|
||||||
icon: Icon(Icons.av_timer,
|
|
||||||
color: primaryColor))),
|
|
||||||
),
|
|
||||||
widget.shipment == null
|
widget.shipment == null
|
||||||
? Container()
|
? Container()
|
||||||
: Container(
|
: InputText(
|
||||||
padding: EdgeInsets.only(top: 5),
|
labelTextKey: 'FCSshipment.remark',
|
||||||
child: fcsInput('Remark', MaterialCommunityIcons.note,
|
iconData: MaterialCommunityIcons.note,
|
||||||
controller: _remarkController),
|
controller: _remarkController),
|
||||||
),
|
|
||||||
widget.shipment == null ? Container() : commercialBtn,
|
|
||||||
widget.shipment == null ? Container() : packingBtn,
|
|
||||||
widget.shipment == null ? Container() : dmsBtn,
|
|
||||||
widget.shipment == null ? Container() : cargoBtn,
|
|
||||||
widget.shipment == null ? createBtn : updateBtn,
|
|
||||||
SizedBox(height: 15)
|
|
||||||
]),
|
]),
|
||||||
)),
|
)),
|
||||||
|
widget.shipment == null ? createBtn : updateBtn,
|
||||||
|
SizedBox(height: 15)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget menuPopWidget(BuildContext context) {
|
||||||
|
return PopupMenuButton<PopupMenu>(
|
||||||
|
elevation: 3.2,
|
||||||
|
icon: Icon(Icons.more_vert, color: primaryColor),
|
||||||
|
tooltip: 'This is tooltip',
|
||||||
|
onSelected: (choice) {
|
||||||
|
if (choice.id == 1) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
} else if (choice.id == 2) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
} else if (choice.id == 3) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
} else if (choice.id == 4) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
itemBuilder: (BuildContext context) {
|
||||||
|
List<PopupMenu> menuPopup = <PopupMenu>[
|
||||||
|
PopupMenu(
|
||||||
|
id: 3,
|
||||||
|
status: "FCSshipment.commercial_invoice",
|
||||||
|
),
|
||||||
|
PopupMenu(id: 2, status: "FCSshipment.packing_list"),
|
||||||
|
PopupMenu(
|
||||||
|
id: 5,
|
||||||
|
status: "FCSshipment.dms",
|
||||||
|
),
|
||||||
|
PopupMenu(
|
||||||
|
id: 4,
|
||||||
|
status: "FCSshipment.cargo_manifest",
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
return menuPopup.map((PopupMenu choice) {
|
||||||
|
return PopupMenuItem<PopupMenu>(
|
||||||
|
value: choice,
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(left: 15),
|
||||||
|
child: LocalText(
|
||||||
|
context,
|
||||||
|
choice.status,
|
||||||
|
color: primaryColor,
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ class _FcsShipmentListState extends State<FcsShipmentList> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var shipmentModel = Provider.of<FcsShipmentModel>(context);
|
||||||
|
|
||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: DefaultTabController(
|
|
||||||
length: 3,
|
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
@@ -43,7 +43,7 @@ class _FcsShipmentListState extends State<FcsShipmentList> {
|
|||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
title: LocalText(context, 'shipment.list.title',
|
title: LocalText(context, 'FCSshipment.list.title',
|
||||||
color: Colors.white, fontSize: 20),
|
color: Colors.white, fontSize: 20),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
IconButton(
|
IconButton(
|
||||||
@@ -55,99 +55,36 @@ class _FcsShipmentListState extends State<FcsShipmentList> {
|
|||||||
// onPressed: () => showPlacesSearch(context),
|
// onPressed: () => showPlacesSearch(context),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
bottom: TabBar(
|
|
||||||
unselectedLabelColor: Colors.grey,
|
|
||||||
tabs: [
|
|
||||||
Tab(
|
|
||||||
text: "Upcoming",
|
|
||||||
),
|
|
||||||
Tab(text: "Completed"),
|
|
||||||
Tab(text: "Canceled"),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton.extended(
|
floatingActionButton: FloatingActionButton.extended(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_newShipment();
|
_newShipment();
|
||||||
},
|
},
|
||||||
icon: Icon(Icons.add),
|
icon: Icon(Icons.add),
|
||||||
label: Text(AppTranslations.of(context).text("shipment.add")),
|
label: LocalText(context, "FCSshipment.add", color: Colors.white),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
),
|
),
|
||||||
body: TabBarView(
|
body: Column(
|
||||||
children: [_upComing(), _completed(), _canceled()],
|
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: shipmentModel.shipments.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return FcsShipmentListRow(
|
||||||
|
shipment: shipmentModel.shipments[index]);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
_newShipment() {
|
_newShipment() {
|
||||||
Navigator.of(context).push(BottomUpPageRoute(FcsShipmentEditor()));
|
Navigator.of(context).push(BottomUpPageRoute(FcsShipmentEditor()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _upComing() {
|
|
||||||
var shipmentModel = Provider.of<FcsShipmentModel>(context);
|
|
||||||
return 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: shipmentModel.upcoming.length,
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
return FcsShipmentListRow(
|
|
||||||
shipment: shipmentModel.upcoming[index]);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _completed() {
|
|
||||||
var shipmentModel = Provider.of<FcsShipmentModel>(context);
|
|
||||||
return 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: shipmentModel.completed.length,
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
return FcsShipmentListRow(
|
|
||||||
shipment: shipmentModel.completed[index]);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _canceled() {
|
|
||||||
var shipmentModel = Provider.of<FcsShipmentModel>(context);
|
|
||||||
return 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: shipmentModel.canceled.length,
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
return FcsShipmentListRow(
|
|
||||||
shipment: shipmentModel.canceled[index]);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
btnCallback: () =>
|
btnCallback: () =>
|
||||||
Navigator.of(context).push(BottomUpPageRoute(ShipmentRates())));
|
Navigator.of(context).push(BottomUpPageRoute(ShipmentRates())));
|
||||||
|
|
||||||
final fcsShipmentBtn = TaskButton("shipment.title",
|
final fcsShipmentBtn = TaskButton("FCSshipment.title",
|
||||||
icon: Ionicons.ios_airplane,
|
icon: Ionicons.ios_airplane,
|
||||||
btnCallback: () =>
|
btnCallback: () =>
|
||||||
Navigator.of(context).push(BottomUpPageRoute(FcsShipmentList())));
|
Navigator.of(context).push(BottomUpPageRoute(FcsShipmentList())));
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:fcs/helpers/theme.dart';
|
import 'package:fcs/helpers/theme.dart';
|
||||||
|
import 'package:fcs/localization/app_translations.dart';
|
||||||
import 'package:fcs/pages/main/model/language_model.dart';
|
import 'package:fcs/pages/main/model/language_model.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -45,7 +46,8 @@ class DisplayText extends StatelessWidget {
|
|||||||
iconData == null
|
iconData == null
|
||||||
? icon == null ? Container() : icon
|
? icon == null ? Container() : icon
|
||||||
: Padding(
|
: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.only(
|
||||||
|
left: .0, right: 15.0, top: 8.0, bottom: 8.0),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
iconData,
|
iconData,
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
@@ -58,7 +60,7 @@ class DisplayText extends StatelessWidget {
|
|||||||
labelText == null
|
labelText == null
|
||||||
? Container()
|
? Container()
|
||||||
: Text(
|
: Text(
|
||||||
labelText,
|
AppTranslations.of(context).text(labelText),
|
||||||
style: labelStyle,
|
style: labelStyle,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
14
lib/pages/widgets/popupmenu.dart
Normal file
14
lib/pages/widgets/popupmenu.dart
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class PopupMenu {
|
||||||
|
int id;
|
||||||
|
String status;
|
||||||
|
PopupMenu({this.id, this.status});
|
||||||
|
}
|
||||||
|
|
||||||
|
List<PopupMenu> menuPopup = <PopupMenu>[
|
||||||
|
PopupMenu(id: 1, status: "Download Commercial Invoice"),
|
||||||
|
PopupMenu(id: 2, status: "Download Packing List"),
|
||||||
|
PopupMenu(id: 3, status: "Download DMS"),
|
||||||
|
PopupMenu(id: 5, status: "Download Cargo Manifest"),
|
||||||
|
];
|
||||||
Reference in New Issue
Block a user