Merge branch 'master' of sma/fcs into master
This commit is contained in:
@@ -263,7 +263,8 @@
|
||||
"box.cargo.type":"Cargos",
|
||||
"box.dimension":"Dimension",
|
||||
"box.delivery_address":"Delivery address",
|
||||
"box.fcs_shipment_num":"FCS shipment number",
|
||||
"box.delivery_type":"Delivery type",
|
||||
"box.fcs_shipment_num":"Shipment",
|
||||
"box.fcs.id":"FCS ID",
|
||||
"box.name":"Customer name",
|
||||
"box.phone":"Phone number",
|
||||
@@ -279,13 +280,14 @@
|
||||
"box.tracking.id":"Tracking ID",
|
||||
"box.market":"Market",
|
||||
"box.cargo.save.btn":"Update Carton",
|
||||
"box.type.title":"Carton types",
|
||||
"box.type.title":"Carton number",
|
||||
"box.shipment.boxes":"Cartons",
|
||||
"box.shipment_number":"Shipment number",
|
||||
"box.shipment.desc":"Description",
|
||||
"box.mix.number":"Carton number",
|
||||
"box.package":"Packages",
|
||||
"box.mix.desc":"Description",
|
||||
"box.info.title":"Carton",
|
||||
"box.info.title":"Carton Info",
|
||||
"box.popupmenu.active":"Active Cartons",
|
||||
"box.popupmenu.delivered":"Delivered Cartons",
|
||||
"box.cargo.total":"Total Weight",
|
||||
|
||||
@@ -263,9 +263,11 @@
|
||||
"box.cargo.type":"ကုန်ပစ္စည်းအမျိုးအစားများ",
|
||||
"box.dimension":"အရွယ်အစား",
|
||||
"box.delivery_address":"ပို့ဆောင်ရမည့်လိပ်စာ",
|
||||
"box.fcs_shipment_num":"FCS တင်ပို့နံပါတ်",
|
||||
"box.delivery_type":"ပို့ဆောင်ရမည့်အမျိုးအစား",
|
||||
"box.fcs_shipment_num":"တင်ပို့နံပါတ်",
|
||||
"box.fcs.id":"FCS ID",
|
||||
"box.name":"နာမည်",
|
||||
"box.package":"အထုပ်များ",
|
||||
"box.phone":"ဖုန်းနံပါတ်",
|
||||
"box.actual_weight":"အမှန်အလေးချိန်",
|
||||
"box.add_cargo":"ကုန်ပစ္စည်း\nထည့်ရန်",
|
||||
@@ -279,7 +281,7 @@
|
||||
"box.tracking.id":"Tracking ID",
|
||||
"box.market":"အွန်လိုင်စျေးဆိုင်",
|
||||
"box.cargo.save.btn":"သေတ္တာ ပြုပြင်မည်",
|
||||
"box.type.title":"သေတ္တာအမျိုးအစားများ",
|
||||
"box.type.title":"သေတ္တာနံပါတ်",
|
||||
"box.shipment.boxes":"သေတ္တာများ",
|
||||
"box.shipment_number":"ပို့ဆောင်နံပါတ်",
|
||||
"box.shipment.desc":"ဖော်ပြချက်",
|
||||
|
||||
@@ -164,27 +164,44 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
Widget build(BuildContext context) {
|
||||
var cartonModel = Provider.of<CartonModel>(context);
|
||||
|
||||
final cartonTypeBox = LocalRadioButtons(
|
||||
readOnly: true,
|
||||
values: cartonModel.cartonTypesInfo,
|
||||
selectedValue: (_box!.isShipmentCarton ?? false)
|
||||
? carton_from_shipments
|
||||
: _box!.cartonType);
|
||||
// final cartonTypeBox = LocalRadioButtons(
|
||||
// readOnly: true,
|
||||
// values: cartonModel.cartonTypesInfo,
|
||||
// selectedValue: (_box!.isShipmentCarton ?? false)
|
||||
// ? carton_from_shipments
|
||||
// : _box!.cartonType);
|
||||
final cartonTypeBox = DisplayText(
|
||||
text: _box!.cartonNumber,
|
||||
labelTextKey: "box.number",
|
||||
//iconData: Ionicons.ios_airplane,
|
||||
);
|
||||
final cartonQrBox = DisplayText(
|
||||
// text: _box!.,
|
||||
//labelTextKey: "box.number",
|
||||
iconData: AntDesign.qrcode,
|
||||
);
|
||||
final shipmentBox = DisplayText(
|
||||
text: _box!.fcsShipmentNumber,
|
||||
labelTextKey: "box.fcs_shipment_num",
|
||||
iconData: Ionicons.ios_airplane,
|
||||
// iconData: Ionicons.ios_airplane,
|
||||
);
|
||||
final deliveryBox = DisplayText(
|
||||
text: "Delivery Carton",
|
||||
labelTextKey: "box.delivery_type",
|
||||
//icon: FcsIDIcon(),
|
||||
);
|
||||
|
||||
final fcsIDBox = DisplayText(
|
||||
text: _box!.fcsID == null ? "" : _box!.fcsID,
|
||||
labelTextKey: "box.fcs.id",
|
||||
icon: FcsIDIcon(),
|
||||
//icon: FcsIDIcon(),
|
||||
);
|
||||
|
||||
final customerNameBox = DisplayText(
|
||||
text: _box!.userName == null ? "" : _box!.userName,
|
||||
text1: _box!.fcsID == null ? "" : _box!.fcsID,
|
||||
labelTextKey: "box.name",
|
||||
iconData: Icons.person,
|
||||
//iconData: Icons.person,
|
||||
);
|
||||
|
||||
final consigneefcsIDBox = DisplayText(
|
||||
@@ -195,9 +212,10 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
|
||||
final consigneeNameBox = DisplayText(
|
||||
text: _box!.userName != null ? _box!.userName : "",
|
||||
text1: _box!.fcsID != null ? _box!.fcsID : "",
|
||||
labelTextKey: "processing.consignee.name",
|
||||
maxLines: 2,
|
||||
iconData: Icons.person,
|
||||
//maxLines: 2,
|
||||
//iconData: Ionicons.document_text_outline,
|
||||
);
|
||||
|
||||
final consigneeBox = Container(
|
||||
@@ -264,6 +282,11 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
SizedBox(child: heightBox, width: 80),
|
||||
],
|
||||
);
|
||||
final packageBox = DisplayText(
|
||||
text: "203FVH",
|
||||
labelTextKey: "box.package",
|
||||
//iconData: AntDesign.CodeSandbox,
|
||||
);
|
||||
|
||||
final cartonSizeBox = DisplayText(
|
||||
text: _cartonSizeController.text,
|
||||
@@ -333,30 +356,82 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: ListView(shrinkWrap: true, children: <Widget>[
|
||||
Center(child: getCartonNumberStatus(context, _box!)),
|
||||
LocalTitle(textKey: "box.type.title"),
|
||||
cartonTypeBox,
|
||||
LocalTitle(textKey: "box.shipment_info"),
|
||||
shipmentBox,
|
||||
// Container(child: Row(children: [
|
||||
// Column(children: [
|
||||
// LocalTitle(textKey: "box.type.title"),
|
||||
// Align(
|
||||
// alignment: Alignment(-0.1,0.1),
|
||||
// child: getCartonNumberStatus(context, _box!)),
|
||||
|
||||
// ],)
|
||||
// ]),),
|
||||
Padding(padding: EdgeInsets.only(left: 30),
|
||||
child:
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [Expanded(child: cartonTypeBox,
|
||||
flex: 1,
|
||||
),
|
||||
Flexible(
|
||||
child: cartonQrBox,
|
||||
),
|
||||
],)),
|
||||
|
||||
|
||||
Padding(padding: EdgeInsets.only(left: 30),
|
||||
child:
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [Expanded(child: shipmentBox,
|
||||
flex: 1,
|
||||
),
|
||||
Flexible(
|
||||
child: deliveryBox,
|
||||
),
|
||||
],)),
|
||||
Padding(padding: EdgeInsets.only(left: 30),
|
||||
child:
|
||||
Row(
|
||||
children: [
|
||||
Flexible(child: customerNameBox,
|
||||
),
|
||||
|
||||
Flexible(
|
||||
child: consigneeNameBox,
|
||||
),
|
||||
Flexible(child:
|
||||
Column(
|
||||
children: [
|
||||
Icon(Ionicons.document_text_outline),
|
||||
Text("Bill to",style:TextStyle(color:Colors.blue))
|
||||
]
|
||||
)),
|
||||
],)),
|
||||
|
||||
//LocalTitle(textKey: "box.shipment_info"),
|
||||
// shipmentBox,
|
||||
// isSmallBag ? mixCartonNumberBox : Container(),
|
||||
isMixBox
|
||||
? Container()
|
||||
: isFromPackages
|
||||
? fcsIDBox
|
||||
: Container(),
|
||||
isMixBox
|
||||
? Container()
|
||||
: isFromPackages
|
||||
? customerNameBox
|
||||
: Container(),
|
||||
isFromCartons
|
||||
? Row(
|
||||
children: [
|
||||
Flexible(child: consigneeBox),
|
||||
Flexible(child: shipperBox)
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
// isMixBox
|
||||
// ? Container()
|
||||
// : isFromPackages
|
||||
// ? fcsIDBox
|
||||
// : Container(),
|
||||
// isMixBox
|
||||
// ? Container()
|
||||
// : isFromPackages
|
||||
// ? customerNameBox
|
||||
// : Container(),
|
||||
// isFromCartons
|
||||
// ? Row(
|
||||
// children: [
|
||||
// Flexible(child: consigneeBox),
|
||||
// Flexible(child: shipperBox)
|
||||
// ],
|
||||
// )
|
||||
// : Container(),
|
||||
Padding(padding: EdgeInsets.only(left: 30),
|
||||
child:
|
||||
packageBox),
|
||||
isMixBox ? mixTypeBox : Container(),
|
||||
isMixBox ? LocalTitle(textKey: "box.mix_caton_title") : Container(),
|
||||
isMixBox
|
||||
@@ -367,7 +442,7 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
packages: _box!.packages,
|
||||
)
|
||||
: Container(),
|
||||
isMixBox ? Container() : LocalTitle(textKey: "box.cargo.type"),
|
||||
// isMixBox ? Container() : LocalTitle(textKey: "box.cargo.type"),
|
||||
isMixBox ? Container() : cargoTableBox,
|
||||
...(isFromPackages || isFromCartons
|
||||
? [
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:fcs/pagination/paginator_listview.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../domain/entities/fcs_shipment.dart';
|
||||
import 'fcs_shipment_editor.dart';
|
||||
@@ -20,7 +21,7 @@ class FcsShipmentList extends StatefulWidget {
|
||||
|
||||
class _FcsShipmentListState extends State<FcsShipmentList> {
|
||||
bool _isLoading = false;
|
||||
int _selectedIndex = 1;
|
||||
int _selectedIndex = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -41,40 +42,14 @@ class _FcsShipmentListState extends State<FcsShipmentList> {
|
||||
Widget build(BuildContext context) {
|
||||
var shipmentModel = Provider.of<FcsShipmentModel>(context);
|
||||
|
||||
final popupMenu = LocalPopupMenuButton(
|
||||
popmenus: [
|
||||
LocalPopupMenu(
|
||||
id: 0, text: "All", selected: shipmentModel.selectedIndex == 0),
|
||||
LocalPopupMenu(
|
||||
id: 1, text: "Pending", selected: shipmentModel.selectedIndex == 1),
|
||||
LocalPopupMenu(
|
||||
id: 2,
|
||||
text: "Processing",
|
||||
selected: shipmentModel.selectedIndex == 2),
|
||||
LocalPopupMenu(
|
||||
id: 3, text: "Shipped", selected: shipmentModel.selectedIndex == 3),
|
||||
LocalPopupMenu(
|
||||
id: 4, text: "Arrived", selected: shipmentModel.selectedIndex == 4),
|
||||
LocalPopupMenu(
|
||||
id: 5,
|
||||
text: "Invoiced",
|
||||
selected: shipmentModel.selectedIndex == 5),
|
||||
LocalPopupMenu(
|
||||
id: 6, text: "Canceled", selected: shipmentModel.selectedIndex == 6)
|
||||
],
|
||||
popupMenuCallback: (p) {
|
||||
setState(() {
|
||||
_selectedIndex = p.id;
|
||||
});
|
||||
context.read<FcsShipmentModel>().onChanged(_selectedIndex);
|
||||
},
|
||||
);
|
||||
|
||||
return LocalProgress(
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: LocalAppBar(
|
||||
labelKey: "FCSshipment.list.title", actions: [popupMenu]),
|
||||
labelKey: "FCSshipment.list.title", actions: [
|
||||
//popupMenu,
|
||||
_menuFilteringWidget(context),
|
||||
]),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
_newShipment();
|
||||
@@ -93,4 +68,62 @@ class _FcsShipmentListState extends State<FcsShipmentList> {
|
||||
Navigator.of(context)
|
||||
.push(CupertinoPageRoute(builder: (context) => FcsShipmentEditor()));
|
||||
}
|
||||
Widget _menuFilteringWidget(BuildContext context) {
|
||||
return PopupMenuButton<LocalPopupMenu>(
|
||||
splashRadius: 25,
|
||||
padding: const EdgeInsets.only(right: 15),
|
||||
elevation: 3.2,
|
||||
tooltip: 'This is tooltip',
|
||||
onSelected: (choice) async {
|
||||
setState(() {
|
||||
_selectedIndex = choice.id;
|
||||
});
|
||||
|
||||
await context.read<FcsShipmentModel>().onChanged(choice.id);
|
||||
},
|
||||
icon: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
const Icon(
|
||||
Ionicons.filter,
|
||||
color: Colors.white,
|
||||
),
|
||||
_selectedIndex != 0
|
||||
? Positioned(
|
||||
bottom: 15,
|
||||
right: 0,
|
||||
child: Container(
|
||||
width: 10,
|
||||
height: 10,
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container()
|
||||
],
|
||||
),
|
||||
itemBuilder: (BuildContext context) {
|
||||
return shipFiteringMenu.map((LocalPopupMenu choice) {
|
||||
return PopupMenuItem<LocalPopupMenu>(
|
||||
value: choice,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Flexible(child: Text("${choice.text}")),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
_selectedIndex == choice.id
|
||||
? const Icon(
|
||||
Icons.check,
|
||||
color: Colors.grey,
|
||||
)
|
||||
: const SizedBox(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,22 +6,26 @@ import 'package:provider/provider.dart';
|
||||
|
||||
class DisplayText extends StatelessWidget {
|
||||
final String? text;
|
||||
final String? text1;
|
||||
final String? labelTextKey;
|
||||
final IconData? iconData;
|
||||
final int? maxLines;
|
||||
final bool? withBorder;
|
||||
final Color? borderColor;
|
||||
final Widget? icon;
|
||||
|
||||
|
||||
const DisplayText({
|
||||
Key? key,
|
||||
this.text,
|
||||
this.text1,
|
||||
this.labelTextKey,
|
||||
this.iconData,
|
||||
this.maxLines = 1,
|
||||
this.withBorder = false,
|
||||
this.borderColor,
|
||||
this.icon,
|
||||
|
||||
}) : super(key: key);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -46,12 +50,13 @@ class DisplayText extends StatelessWidget {
|
||||
: icon!
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: .0, right: 15.0, top: 8.0, bottom: 8.0),
|
||||
left: .0, right: 15, top: 8.0, bottom: 8.0),
|
||||
child: Icon(
|
||||
iconData,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -68,6 +73,12 @@ class DisplayText extends StatelessWidget {
|
||||
text!,
|
||||
style: textStyle,
|
||||
),
|
||||
text1 == null
|
||||
? Container()
|
||||
: Text(
|
||||
text1!,
|
||||
style: textStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -13,3 +13,13 @@ class LocalPopupMenu {
|
||||
this.highlight = false,
|
||||
this.enabled = true});
|
||||
}
|
||||
List<LocalPopupMenu> shipFiteringMenu = <LocalPopupMenu>[
|
||||
LocalPopupMenu(id: 0, text :"All"),
|
||||
LocalPopupMenu(id: 1, text: "Pending"),
|
||||
LocalPopupMenu(id: 2, text: "Processing"),
|
||||
LocalPopupMenu(id: 3, text: "Shipped"),
|
||||
LocalPopupMenu(id: 4, text: "Arrived"),
|
||||
LocalPopupMenu(id: 5, text: "Invoiced"),
|
||||
LocalPopupMenu(id: 6, text: "Canceled"),
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user