Merge branch 'master' of https://git.mokkon.com/sainw/fcs
This commit is contained in:
@@ -2,6 +2,8 @@ import 'package:fcs/domain/entities/discount.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
@@ -42,6 +44,24 @@ class _DiscountEditorState extends State<DiscountEditor> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final codeBox = InputText(
|
||||
labelTextKey: 'discount.code',
|
||||
iconData: FontAwesomeIcons.algolia,
|
||||
controller: _codeController);
|
||||
final nameBox = InputText(
|
||||
labelTextKey: 'discount.name',
|
||||
iconData: Feather.user,
|
||||
controller: _customerController);
|
||||
final amountBox = InputText(
|
||||
labelTextKey: 'discount.amount',
|
||||
iconData: FontAwesomeIcons.moneyBill,
|
||||
controller: _amountController);
|
||||
final statusBox = DisplayText(
|
||||
text: _statusController.text,
|
||||
labelText: getLocalString(context, "discount.status"),
|
||||
iconData: Icons.av_timer,
|
||||
);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -65,32 +85,14 @@ class _DiscountEditorState extends State<DiscountEditor> {
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
fcsInput('Code', FontAwesomeIcons.algolia,
|
||||
controller: _codeController),
|
||||
fcsInput('Customer Name', Feather.user,
|
||||
controller: _customerController),
|
||||
fcsInput('Amount', FontAwesomeIcons.moneyBill,
|
||||
controller: _amountController),
|
||||
codeBox,
|
||||
nameBox,
|
||||
amountBox,
|
||||
widget.discount == null
|
||||
? Container()
|
||||
: Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: TextFormField(
|
||||
controller: _statusController,
|
||||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'Status',
|
||||
labelStyle: TextStyle(
|
||||
fontSize: 16, color: primaryColor),
|
||||
filled: true,
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
icon: Icon(
|
||||
Icons.av_timer,
|
||||
color: primaryColor,
|
||||
),
|
||||
)),
|
||||
child: statusBox,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -2,8 +2,13 @@ import 'package:fcs/domain/entities/fcs_shipment.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.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/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/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/popupmenu.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -116,124 +121,36 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var shipmentModel = Provider.of<FcsShipmentModel>(context);
|
||||
var languageModel = Provider.of<LanguageModel>(context);
|
||||
|
||||
final cargoBtn = Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: Align(
|
||||
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 createBtn = fcsButton(
|
||||
context,
|
||||
getLocalString(context, "FCSshipment.create"),
|
||||
);
|
||||
|
||||
final commercialBtn = Container(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Align(
|
||||
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 updateBtn = fcsButton(
|
||||
context,
|
||||
getLocalString(context, "FCSshipment.update"),
|
||||
);
|
||||
|
||||
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(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
shadowColor: Colors.transparent,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(Icons.close),
|
||||
icon: new Icon(Icons.close, color: primaryColor),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("shipment.form.title")),
|
||||
backgroundColor: Colors.white,
|
||||
title: LocalText(
|
||||
context,
|
||||
"FCSshipment.form.title",
|
||||
color: primaryColor,
|
||||
fontSize: 18,
|
||||
),
|
||||
actions: [menuPopWidget(context)],
|
||||
),
|
||||
body: Card(
|
||||
child: Column(
|
||||
@@ -244,127 +161,155 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
||||
child: ListView(children: <Widget>[
|
||||
// _showCustomerData(mainModel.customer),
|
||||
widget.shipment == null
|
||||
? fcsInput('FCS Shipment Number', Ionicons.ios_airplane,
|
||||
controller: _shipmentNumberController)
|
||||
: Container(
|
||||
child: TextFormField(
|
||||
controller: _shipmentNumberController,
|
||||
readOnly: true,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'FCS Shipment Number',
|
||||
labelStyle:
|
||||
TextStyle(fontSize: 16, color: Colors.grey),
|
||||
filled: true,
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
icon: Icon(
|
||||
Ionicons.ios_airplane,
|
||||
color: primaryColor,
|
||||
),
|
||||
)),
|
||||
),
|
||||
? InputText(
|
||||
labelTextKey: "FCSshipment.number",
|
||||
iconData: Ionicons.ios_airplane,
|
||||
controller: _shipmentNumberController,
|
||||
)
|
||||
: DisplayText(
|
||||
iconData: Ionicons.ios_airplane,
|
||||
labelText: "FCSshipment.number",
|
||||
text: _shipmentNumberController.text),
|
||||
|
||||
widget.shipment == null
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput('Cutoff Date', Icons.date_range,
|
||||
controller: _cutoffDateController),
|
||||
? InputText(
|
||||
labelTextKey: "FCSshipment.cutoff_date",
|
||||
iconData: Icons.date_range,
|
||||
controller: _cutoffDateController,
|
||||
)
|
||||
: Container(),
|
||||
Container(
|
||||
padding:
|
||||
EdgeInsets.only(top: widget.shipment == null ? 5 : 0),
|
||||
child: fcsInput('ETA', Icons.date_range,
|
||||
controller: _arrivalDateController),
|
||||
|
||||
InputText(
|
||||
labelTextKey: "FCSshipment.ETA",
|
||||
iconData: Icons.date_range,
|
||||
controller: _arrivalDateController,
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput('Departure Date', Icons.date_range,
|
||||
controller: _departureDateControler),
|
||||
|
||||
InputText(
|
||||
labelTextKey: "FCSshipment.departure_date",
|
||||
iconData: Icons.date_range,
|
||||
controller: _departureDateControler,
|
||||
),
|
||||
widget.shipment == null
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: DropdownButtonFormField(
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: 'FCS Shipment Type',
|
||||
icon: Icon(Ionicons.ios_airplane,
|
||||
color: primaryColor)),
|
||||
items: shipmentModel.shipmentType
|
||||
.map((e) =>
|
||||
DropdownMenuItem(child: Text(e), value: e))
|
||||
.toList(),
|
||||
onChanged: (selected) => {
|
||||
setState(() {
|
||||
_currentShipment = selected;
|
||||
})
|
||||
},
|
||||
),
|
||||
? DropdownButtonFormField(
|
||||
decoration: InputDecoration(
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor)),
|
||||
fillColor: Colors.white,
|
||||
labelStyle: languageModel.isEng
|
||||
? labelStyle
|
||||
: labelStyleMM,
|
||||
labelText: AppTranslations.of(context)
|
||||
.text('FCSshipment.shipment_type'),
|
||||
icon: Icon(Ionicons.ios_airplane,
|
||||
color: primaryColor)),
|
||||
items: shipmentModel.shipmentType
|
||||
.map((e) =>
|
||||
DropdownMenuItem(child: Text(e), value: e))
|
||||
.toList(),
|
||||
onChanged: (selected) => {
|
||||
setState(() {
|
||||
_currentShipment = selected;
|
||||
})
|
||||
},
|
||||
)
|
||||
: Container(),
|
||||
|
||||
widget.shipment == null
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput('Consignee', Icons.work,
|
||||
controller: _consigneeController),
|
||||
)
|
||||
? InputText(
|
||||
labelTextKey: 'FCSshipment.consignee',
|
||||
iconData: Icons.work,
|
||||
controller: _consigneeController)
|
||||
: Container(),
|
||||
widget.shipment == null
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput(
|
||||
'Port of Loading', FontAwesomeIcons.ship,
|
||||
controller: _portController),
|
||||
)
|
||||
? InputText(
|
||||
labelTextKey: 'FCSshipment.port_of_loading',
|
||||
iconData: FontAwesomeIcons.ship,
|
||||
controller: _portController)
|
||||
: Container(),
|
||||
widget.shipment == null
|
||||
? Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput('Final Destination',
|
||||
MaterialCommunityIcons.location_enter,
|
||||
controller: _destinationController),
|
||||
)
|
||||
? InputText(
|
||||
labelTextKey: 'FCSshipment.final_destination',
|
||||
iconData: MaterialCommunityIcons.location_enter,
|
||||
controller: _destinationController)
|
||||
: Container(),
|
||||
widget.shipment == null
|
||||
? Container()
|
||||
: Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: TextFormField(
|
||||
controller: _statusController,
|
||||
cursorColor: primaryColor,
|
||||
decoration: InputDecoration(
|
||||
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))),
|
||||
),
|
||||
child: DisplayText(
|
||||
text: _statusController.text,
|
||||
iconData: Icons.av_timer,
|
||||
labelText: 'FCSshipment.status',
|
||||
)),
|
||||
|
||||
widget.shipment == null
|
||||
? Container()
|
||||
: Container(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
child: fcsInput('Remark', MaterialCommunityIcons.note,
|
||||
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)
|
||||
: InputText(
|
||||
labelTextKey: 'FCSshipment.remark',
|
||||
iconData: MaterialCommunityIcons.note,
|
||||
controller: _remarkController),
|
||||
]),
|
||||
)),
|
||||
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
|
||||
Widget build(BuildContext context) {
|
||||
var shipmentModel = Provider.of<FcsShipmentModel>(context);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: DefaultTabController(
|
||||
length: 3,
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
@@ -43,7 +43,7 @@ class _FcsShipmentListState extends State<FcsShipmentList> {
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(context, 'shipment.list.title',
|
||||
title: LocalText(context, 'FCSshipment.list.title',
|
||||
color: Colors.white, fontSize: 20),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
@@ -55,99 +55,36 @@ class _FcsShipmentListState extends State<FcsShipmentList> {
|
||||
// onPressed: () => showPlacesSearch(context),
|
||||
),
|
||||
],
|
||||
bottom: TabBar(
|
||||
unselectedLabelColor: Colors.grey,
|
||||
tabs: [
|
||||
Tab(
|
||||
text: "Upcoming",
|
||||
),
|
||||
Tab(text: "Completed"),
|
||||
Tab(text: "Canceled"),
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
_newShipment();
|
||||
},
|
||||
icon: Icon(Icons.add),
|
||||
label: Text(AppTranslations.of(context).text("shipment.add")),
|
||||
label: LocalText(context, "FCSshipment.add", color: Colors.white),
|
||||
backgroundColor: primaryColor,
|
||||
),
|
||||
body: TabBarView(
|
||||
children: [_upComing(), _completed(), _canceled()],
|
||||
)),
|
||||
),
|
||||
);
|
||||
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: shipmentModel.shipments.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return FcsShipmentListRow(
|
||||
shipment: shipmentModel.shipments[index]);
|
||||
}),
|
||||
),
|
||||
],
|
||||
)));
|
||||
}
|
||||
|
||||
_newShipment() {
|
||||
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]);
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("payment.title")),
|
||||
title: Text(AppTranslations.of(context).text("pm_.title")),
|
||||
),
|
||||
body: Card(
|
||||
child: Column(
|
||||
@@ -78,7 +78,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
child: Container(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
LocalText(context, 'total.amount',
|
||||
LocalText(context, 'pm.total.amount',
|
||||
color: Colors.black, fontSize: 16),
|
||||
Text(
|
||||
' \$ ${_invoice.amount}',
|
||||
@@ -95,7 +95,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
child: Container(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
LocalText(context, 'remaining_balance',
|
||||
LocalText(context, 'pm.remaining_balance',
|
||||
color: Colors.black, fontSize: 16),
|
||||
Text(
|
||||
' \$ ${_invoice.amount - _invoice.receipts[0].amount}',
|
||||
@@ -111,7 +111,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
child: ListView(
|
||||
children: [
|
||||
ExpansionTile(
|
||||
title: LocalText(context, 'payment.attachment',
|
||||
title: LocalText(context, 'pm.attachment',
|
||||
color: Colors.black, fontSize: 16),
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
@@ -144,7 +144,7 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
],
|
||||
),
|
||||
ExpansionTile(
|
||||
title: LocalText(context, 'payment.receipt',
|
||||
title: LocalText(context, 'pm.receipt',
|
||||
color: Colors.black, fontSize: 16),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
@@ -157,14 +157,14 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
MyDataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"payment.date",
|
||||
"pm.date",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
MyDataColumn(
|
||||
label: LocalText(
|
||||
context,
|
||||
"payment.amount",
|
||||
"pm.amount",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -208,7 +208,7 @@ class _HomePageState extends State<HomePage> {
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(BoxList())));
|
||||
|
||||
final pickUpBtn = TaskButton("pickup",
|
||||
final pickUpBtn = TaskButton("shipment",
|
||||
icon: SimpleLineIcons.direction,
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(ShipmentList())));
|
||||
@@ -218,7 +218,7 @@ class _HomePageState extends State<HomePage> {
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(ShipmentRates())));
|
||||
|
||||
final fcsShipmentBtn = TaskButton("shipment.title",
|
||||
final fcsShipmentBtn = TaskButton("FCSshipment.title",
|
||||
icon: Ionicons.ios_airplane,
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(FcsShipmentList())));
|
||||
|
||||
@@ -54,7 +54,7 @@ Future<void> showConfirmDialog(
|
||||
FlatButton(
|
||||
color: Colors.grey[300],
|
||||
child: Text(
|
||||
AppTranslations.of(context).text('Cancel'),
|
||||
AppTranslations.of(context).text('btn.cancel'),
|
||||
style: Provider.of<LanguageModel>(context).isEng
|
||||
? TextStyle()
|
||||
: TextStyle(fontFamily: 'Myanmar3'),
|
||||
@@ -67,7 +67,7 @@ Future<void> showConfirmDialog(
|
||||
),
|
||||
FlatButton(
|
||||
color: primaryColor,
|
||||
child: Text(AppTranslations.of(context).text('Ok'),
|
||||
child: Text(AppTranslations.of(context).text('btn.ok'),
|
||||
style: Provider.of<LanguageModel>(context).isEng
|
||||
? TextStyle(
|
||||
color: Colors.white,
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:fcs/pages/package/tracking_id_page.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/multi_img_controller.dart';
|
||||
import 'package:fcs/pages/widgets/multi_img_file.dart';
|
||||
@@ -69,12 +70,15 @@ class _PackageEditorPageState extends State<PackageEditorPage> {
|
||||
getLocalString(context, 'package.edit.complete.process.btn'),
|
||||
callack: _completeProcessing,
|
||||
);
|
||||
final descBox = fcsInput(getLocalString(context, "package.edit.desc"),
|
||||
MaterialCommunityIcons.message_text_outline,
|
||||
controller: _descCtl, autoFocus: false);
|
||||
final remarkBox = fcsInput(
|
||||
getLocalString(context, "package.edit.remark"), Entypo.new_message,
|
||||
controller: _remarkCtl, autoFocus: false);
|
||||
final descBox = InputText(
|
||||
labelTextKey: 'package.edit.desc',
|
||||
iconData: MaterialCommunityIcons.message_text_outline,
|
||||
controller: _descCtl);
|
||||
final remarkBox = InputText(
|
||||
labelTextKey: 'package.edit.remark',
|
||||
iconData: Entypo.new_message,
|
||||
controller: _remarkCtl);
|
||||
|
||||
final img = MultiImageFile(
|
||||
enabled: true,
|
||||
controller: multiImgController,
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:fcs/domain/entities/rate.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -37,6 +38,14 @@ class _CargoEditorState extends State<CargoEditor> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final typeBox = InputText(
|
||||
labelTextKey: 'cargo.type',
|
||||
iconData: Icons.text_format,
|
||||
controller: _descController);
|
||||
final rateBox = InputText(
|
||||
labelTextKey: 'cargo.rate',
|
||||
iconData: Icons.attach_money,
|
||||
controller: _rateController);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -58,10 +67,8 @@ class _CargoEditorState extends State<CargoEditor> {
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
fcsInput("Cargo Type", Icons.text_format,
|
||||
controller: _descController),
|
||||
fcsInput("Rate", Icons.attach_money,
|
||||
controller: _rateController),
|
||||
typeBox,
|
||||
rateBox,
|
||||
SizedBox(height: 30),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:fcs/domain/entities/custom.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -38,6 +39,14 @@ class _CustomEditorState extends State<CustomEditor> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final productBox = InputText(
|
||||
labelTextKey: 'rate.cutom.product_type',
|
||||
iconData: FontAwesomeIcons.weightHanging,
|
||||
controller: _productController);
|
||||
final feeBox = InputText(
|
||||
labelTextKey: 'rate.custom.fee',
|
||||
iconData: Icons.attach_money,
|
||||
controller: _feeController);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -50,7 +59,8 @@ class _CustomEditorState extends State<CustomEditor> {
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("custom.form.title")),
|
||||
title:
|
||||
Text(AppTranslations.of(context).text("rate.custom.form.title")),
|
||||
),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(18),
|
||||
@@ -59,10 +69,8 @@ class _CustomEditorState extends State<CustomEditor> {
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
fcsInput("Procut Type", FontAwesomeIcons.weightHanging,
|
||||
controller: _productController),
|
||||
fcsInput("Fee", Icons.attach_money,
|
||||
controller: _feeController),
|
||||
productBox,
|
||||
feeBox,
|
||||
SizedBox(height: 30),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:fcs/domain/entities/discount.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -38,6 +39,16 @@ class _DiscountByWeightEditorState extends State<DiscountByWeightEditor> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
final weightBox = InputText(
|
||||
labelTextKey: 'rate.discount.weight',
|
||||
iconData: FontAwesomeIcons.weightHanging,
|
||||
controller: _weightController);
|
||||
final discountRateBox = InputText(
|
||||
labelTextKey: 'rate.discount.rate',
|
||||
iconData: Icons.attach_money,
|
||||
controller: _rateController);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -59,10 +70,8 @@ class _DiscountByWeightEditorState extends State<DiscountByWeightEditor> {
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
fcsInput("Weight", FontAwesomeIcons.weightHanging,
|
||||
controller: _weightController),
|
||||
fcsInput("Discount Rate", Icons.attach_money,
|
||||
controller: _rateController),
|
||||
weightBox,
|
||||
discountRateBox,
|
||||
SizedBox(height: 30),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/my_data_table.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -27,10 +28,16 @@ class ShipmentRatesEdit extends StatefulWidget {
|
||||
|
||||
class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
|
||||
bool _isLoading = false;
|
||||
TextEditingController _minWeight = new TextEditingController();
|
||||
TextEditingController _deliveryFee = new TextEditingController();
|
||||
TextEditingController _volumetricRatio = new TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_minWeight.text = "10";
|
||||
_deliveryFee.text = "5";
|
||||
_volumetricRatio.text = "166.36";
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -42,6 +49,19 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
|
||||
Widget build(BuildContext context) {
|
||||
var shipmentRateModel = Provider.of<ShipmentRateModel>(context);
|
||||
|
||||
final minWigBox = InputText(
|
||||
labelTextKey: 'rate.min_weight',
|
||||
iconData: FontAwesomeIcons.weightHanging,
|
||||
controller: _minWeight);
|
||||
final feeBox = InputText(
|
||||
labelTextKey: 'rate.delivery_fee',
|
||||
iconData: Icons.attach_money,
|
||||
controller: _deliveryFee);
|
||||
final ratioBox = InputText(
|
||||
labelTextKey: 'rate.volumetric_ratio',
|
||||
iconData: Icons.attach_money,
|
||||
controller: _volumetricRatio);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
@@ -63,13 +83,9 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
|
||||
Expanded(
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
fcsInput("Min Weight for Free delivery within Yangon",
|
||||
FontAwesomeIcons.weightHanging,
|
||||
value: "10"),
|
||||
fcsInput("Delivery fees", Icons.attach_money, value: "5"),
|
||||
SizedBox(height: 10),
|
||||
fcsInput("Volumetric Ratio", Icons.attach_money,
|
||||
value: "166.36"),
|
||||
minWigBox,
|
||||
feeBox,
|
||||
ratioBox,
|
||||
SizedBox(height: 10),
|
||||
ExpansionTile(
|
||||
title: Text(
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:fcs/pages/shipment_address/model/shipment_address_model.dart';
|
||||
import 'package:fcs/pages/shipment_address/shipping_address_row.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/multi_img_controller.dart';
|
||||
import 'package:fcs/pages/widgets/multi_img_file.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
@@ -206,7 +207,7 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
decoration: new InputDecoration(
|
||||
border: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
labelText: AppTranslations.of(context).text("pickup.date"),
|
||||
labelText: AppTranslations.of(context).text("shipment.date"),
|
||||
// labelStyle: languageModel.isEng ? labelStyle : labelStyleMM,
|
||||
contentPadding:
|
||||
EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0),
|
||||
@@ -236,7 +237,8 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("pickup.edit.title")),
|
||||
title: LocalText(context, "shipment.edit.title",
|
||||
fontSize: 18, color: Colors.white),
|
||||
),
|
||||
body: Card(
|
||||
child: Column(
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/shipment/model/shipment_model.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';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -43,7 +44,8 @@ class _ShipmentListState extends State<ShipmentList> {
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("pickup.title")),
|
||||
title: LocalText(context, "shipment.title",
|
||||
fontSize: 18, color: Colors.white),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
@@ -70,7 +72,7 @@ class _ShipmentListState extends State<ShipmentList> {
|
||||
_newPickup();
|
||||
},
|
||||
icon: Icon(Icons.add),
|
||||
label: Text(AppTranslations.of(context).text("pickup.new")),
|
||||
label: Text(AppTranslations.of(context).text("shipment.new")),
|
||||
backgroundColor: primaryColor,
|
||||
),
|
||||
body: new ListView.separated(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/main/model/language_model.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -45,7 +46,8 @@ class DisplayText extends StatelessWidget {
|
||||
iconData == null
|
||||
? icon == null ? Container() : icon
|
||||
: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
padding: const EdgeInsets.only(
|
||||
left: .0, right: 15.0, top: 8.0, bottom: 8.0),
|
||||
child: Icon(
|
||||
iconData,
|
||||
color: primaryColor,
|
||||
@@ -58,7 +60,7 @@ class DisplayText extends StatelessWidget {
|
||||
labelText == null
|
||||
? Container()
|
||||
: Text(
|
||||
labelText,
|
||||
AppTranslations.of(context).text(labelText),
|
||||
style: labelStyle,
|
||||
),
|
||||
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