Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -464,10 +464,9 @@ class _BoxEditorState extends State<BoxEditor> {
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Text(
|
||||
"Total Weight",
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
)),
|
||||
child: LocalText(context, "box.cargo.total",
|
||||
color: Colors.black87, fontWeight: FontWeight.bold),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 40.0),
|
||||
child: Align(
|
||||
|
||||
@@ -2,6 +2,8 @@ import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/box/model/box_model.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/local_popup_menu_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_popupmenu.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -18,6 +20,7 @@ class BoxList extends StatefulWidget {
|
||||
|
||||
class _BoxListState extends State<BoxList> {
|
||||
bool _isLoading = false;
|
||||
bool _showDelivered = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -31,110 +34,70 @@ class _BoxListState extends State<BoxList> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var boxModel = Provider.of<BoxModel>(context);
|
||||
final popupMenu = LocalPopupMenuButton(
|
||||
popmenus: [
|
||||
LocalPopupMenu(id: 1, textKey: "box.popupmenu.active", selected: true),
|
||||
LocalPopupMenu(id: 2, textKey: "box.popupmenu.delivered")
|
||||
],
|
||||
popupMenuCallback: (p) => this.setState(() {
|
||||
_showDelivered = p.id == 2;
|
||||
}),
|
||||
);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: DefaultTabController(
|
||||
length: 2,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(context, "boxes.name",
|
||||
color: Colors.white, fontSize: 20),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
color: Colors.white,
|
||||
),
|
||||
iconSize: 30, onPressed: () {},
|
||||
// onPressed: () => showPlacesSearch(context),
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(context, "boxes.name",
|
||||
color: Colors.white, fontSize: 20),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
color: Colors.white,
|
||||
),
|
||||
],
|
||||
bottom: TabBar(
|
||||
unselectedLabelColor: Colors.grey,
|
||||
tabs: [
|
||||
Tab(
|
||||
text: "Upcoming",
|
||||
),
|
||||
Tab(text: "Delivered"),
|
||||
],
|
||||
iconSize: 30, onPressed: () {},
|
||||
// onPressed: () => showPlacesSearch(context),
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
_newPickup();
|
||||
},
|
||||
icon: Icon(Icons.add),
|
||||
label: Text(AppTranslations.of(context).text("boxes.new")),
|
||||
backgroundColor: primaryColor,
|
||||
),
|
||||
body: TabBarView(
|
||||
children: [
|
||||
_upComing(),
|
||||
_completed(),
|
||||
],
|
||||
)),
|
||||
popupMenu
|
||||
],
|
||||
),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
_newBox();
|
||||
},
|
||||
icon: Icon(Icons.add),
|
||||
label: LocalText(context, "boxes.new", color: Colors.white),
|
||||
backgroundColor: primaryColor,
|
||||
),
|
||||
body: new ListView.separated(
|
||||
separatorBuilder: (context, index) => Divider(
|
||||
color: Colors.black,
|
||||
),
|
||||
scrollDirection: Axis.vertical,
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
shrinkWrap: true,
|
||||
itemCount: boxModel.boxes.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return BoxListRow(box: boxModel.boxes[index]);
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_newPickup() {
|
||||
_newBox() {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(builder: (context) => BoxEditor()),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _upComing() {
|
||||
var boxModel = Provider.of<BoxModel>(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: boxModel.upcoming.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return BoxListRow(
|
||||
box: boxModel.upcoming[index],
|
||||
isReadOnly: false,
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _completed() {
|
||||
var boxModel = Provider.of<BoxModel>(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: boxModel.completed.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return BoxListRow(
|
||||
box: boxModel.completed[index],
|
||||
isReadOnly: false,
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,8 @@ import 'package:intl/intl.dart';
|
||||
import 'box_info.dart';
|
||||
|
||||
class BoxListRow extends StatefulWidget {
|
||||
final bool isReadOnly;
|
||||
final Box box;
|
||||
const BoxListRow({this.box, this.isReadOnly});
|
||||
const BoxListRow({this.box});
|
||||
|
||||
@override
|
||||
_BoxListRowState createState() => _BoxListRowState();
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/box/model/box_model.dart';
|
||||
import 'package:fcs/pages/widgets/local_popup_menu_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_popupmenu.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -15,6 +18,7 @@ class DeliverList extends StatefulWidget {
|
||||
|
||||
class _DeliverListState extends State<DeliverList> {
|
||||
bool _isLoading = false;
|
||||
bool _showDelivered = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -28,102 +32,55 @@ class _DeliverListState extends State<DeliverList> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var boxModel = Provider.of<BoxModel>(context);
|
||||
final popupMenu = LocalPopupMenuButton(
|
||||
popmenus: [
|
||||
LocalPopupMenu(id: 1, textKey: "delivery.popupmenu.active", selected: true),
|
||||
LocalPopupMenu(id: 2, textKey: "delivery.popupmenu.delivered")
|
||||
],
|
||||
popupMenuCallback: (p) => this.setState(() {
|
||||
_showDelivered = p.id == 2;
|
||||
}),
|
||||
);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: DefaultTabController(
|
||||
length: 2,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("delivery")),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
color: Colors.white,
|
||||
),
|
||||
iconSize: 30,
|
||||
// onPressed: () => showPlacesSearch(context),
|
||||
),
|
||||
],
|
||||
bottom: TabBar(
|
||||
unselectedLabelColor: Colors.grey,
|
||||
tabs: [
|
||||
Tab(
|
||||
text: "Upcoming",
|
||||
),
|
||||
Tab(text: "Delivered"),
|
||||
],
|
||||
),
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
// floatingActionButton: FloatingActionButton.extended(
|
||||
// onPressed: () {
|
||||
// _newPickup();
|
||||
// },
|
||||
// icon: Icon(Icons.add),
|
||||
// label: Text(AppTranslations.of(context).text("boxes.new")),
|
||||
// backgroundColor: primaryColor,
|
||||
// ),
|
||||
body: TabBarView(
|
||||
children: [
|
||||
_upComing(),
|
||||
_completed(),
|
||||
],
|
||||
)),
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(context, "delivery",
|
||||
color: Colors.white, fontSize: 20),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
color: Colors.white,
|
||||
),
|
||||
iconSize: 30,
|
||||
// onPressed: () => showPlacesSearch(context),
|
||||
),
|
||||
popupMenu
|
||||
],
|
||||
),
|
||||
body: new ListView.separated(
|
||||
separatorBuilder: (context, index) => Divider(
|
||||
color: Colors.black,
|
||||
),
|
||||
scrollDirection: Axis.vertical,
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
shrinkWrap: true,
|
||||
itemCount: boxModel.boxes.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return DeliveryListRow(box: boxModel.boxes[index]);
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _upComing() {
|
||||
var boxModel = Provider.of<BoxModel>(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: boxModel.upcoming.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return DeliveryListRow(
|
||||
box: boxModel.upcoming[index],
|
||||
isReadOnly: false,
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _completed() {
|
||||
var boxModel = Provider.of<BoxModel>(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: boxModel.completed.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return DeliveryListRow(
|
||||
box: boxModel.completed[index],
|
||||
isReadOnly: false,
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
import 'package:fcs/domain/entities/box.dart';
|
||||
import 'package:fcs/pages/box/box_editor.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class DeliveryListRow extends StatefulWidget {
|
||||
final bool isReadOnly;
|
||||
final Box box;
|
||||
const DeliveryListRow({this.box, this.isReadOnly});
|
||||
const DeliveryListRow({this.box});
|
||||
|
||||
@override
|
||||
_DeliveryListRowState createState() => _DeliveryListRowState();
|
||||
@@ -32,17 +30,10 @@ class _DeliveryListRowState extends State<DeliveryListRow> {
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if (widget.isReadOnly) {
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// CupertinoPageRoute(builder: (context) => PackageInfo(package: _box)),
|
||||
// );
|
||||
} else {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(builder: (context) => BoxEditor(box: _box)),
|
||||
);
|
||||
}
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(builder: (context) => BoxEditor(box: _box)),
|
||||
);
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
|
||||
@@ -100,7 +100,6 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
||||
color: primaryColor,
|
||||
fontSize: 18,
|
||||
),
|
||||
actions: _isNew ? [] : [menuPopWidget(context)],
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
@@ -175,59 +174,6 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
||||
);
|
||||
}
|
||||
|
||||
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();
|
||||
});
|
||||
}
|
||||
|
||||
FcsShipment _getPayload() {
|
||||
FcsShipment fcsShipment = FcsShipment();
|
||||
fcsShipment.id = _shipment.id;
|
||||
|
||||
206
lib/pages/fcs_shipment/fcs_shipment_info.dart
Normal file
206
lib/pages/fcs_shipment/fcs_shipment_info.dart
Normal file
@@ -0,0 +1,206 @@
|
||||
import 'package:fcs/domain/entities/fcs_shipment.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.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/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import 'fcs_shipment_editor.dart';
|
||||
|
||||
class FcsShipmentInfo extends StatefulWidget {
|
||||
final FcsShipment fcsShipment;
|
||||
FcsShipmentInfo({this.fcsShipment});
|
||||
|
||||
@override
|
||||
_FcsShipmentInfoState createState() => _FcsShipmentInfoState();
|
||||
}
|
||||
|
||||
class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
FcsShipment _fcsShipment;
|
||||
bool _isLoading = false;
|
||||
TextEditingController _shipmentNumberController = new TextEditingController();
|
||||
TextEditingController _cutoffDateController = new TextEditingController();
|
||||
TextEditingController _arrivalDateController = new TextEditingController();
|
||||
TextEditingController _departureDateControler = new TextEditingController();
|
||||
TextEditingController _shipmentTypeControler = new TextEditingController();
|
||||
TextEditingController _consigneeController = new TextEditingController();
|
||||
TextEditingController _portController = new TextEditingController();
|
||||
TextEditingController _destinationController = new TextEditingController();
|
||||
TextEditingController _statusController = new TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_fcsShipment = widget.fcsShipment;
|
||||
_shipmentNumberController.text = _fcsShipment.shipmentNumber;
|
||||
_cutoffDateController.text = dateFormatter.format(_fcsShipment.cutoffDate);
|
||||
_arrivalDateController.text =
|
||||
dateFormatter.format(_fcsShipment.arrivalDate);
|
||||
_departureDateControler.text =
|
||||
dateFormatter.format(_fcsShipment.departureDate);
|
||||
_shipmentTypeControler.text = _fcsShipment.shipType;
|
||||
_consigneeController.text = _fcsShipment.consignee;
|
||||
_portController.text = _fcsShipment.port;
|
||||
_destinationController.text = _fcsShipment.destination;
|
||||
_statusController.text = _fcsShipment.status;
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final shipmentNumberBox = DisplayText(
|
||||
text: _shipmentNumberController.text,
|
||||
labelTextKey: "FCSshipment.number",
|
||||
iconData: Ionicons.ios_airplane,
|
||||
);
|
||||
final cutoffDateDBox = DisplayText(
|
||||
text: _cutoffDateController.text,
|
||||
labelTextKey: "FCSshipment.cutoff_date",
|
||||
iconData: Icons.date_range,
|
||||
);
|
||||
final etaBox = DisplayText(
|
||||
text: _arrivalDateController.text,
|
||||
labelTextKey: "FCSshipment.ETA",
|
||||
iconData: Icons.date_range,
|
||||
);
|
||||
|
||||
final departureDateBox = DisplayText(
|
||||
text: _departureDateControler.text,
|
||||
labelTextKey: "FCSshipment.departure_date",
|
||||
iconData: Icons.date_range,
|
||||
);
|
||||
|
||||
final shipTypeBox = DisplayText(
|
||||
text: _shipmentTypeControler.text,
|
||||
labelTextKey: "FCSshipment.shipment_type",
|
||||
iconData: Ionicons.ios_airplane,
|
||||
);
|
||||
|
||||
final consigneeBox = DisplayText(
|
||||
text: _consigneeController.text,
|
||||
labelTextKey: "FCSshipment.consignee",
|
||||
iconData: Icons.work,
|
||||
);
|
||||
|
||||
final portBox = DisplayText(
|
||||
text: _portController.text,
|
||||
labelTextKey: "FCSshipment.port_of_loading",
|
||||
iconData: FontAwesomeIcons.ship,
|
||||
);
|
||||
|
||||
final destinationBox = DisplayText(
|
||||
text: _destinationController.text,
|
||||
labelTextKey: "FCSshipment.final_destination",
|
||||
iconData: MaterialCommunityIcons.location_enter,
|
||||
);
|
||||
|
||||
final statusBox = DisplayText(
|
||||
text: _statusController.text,
|
||||
labelTextKey: "FCSshipment.status",
|
||||
iconData: Icons.av_timer,
|
||||
);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: Colors.white,
|
||||
title: LocalText(
|
||||
context,
|
||||
"FCSshipment.form.title",
|
||||
fontSize: 20,
|
||||
color: primaryColor,
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.edit, color: primaryColor),
|
||||
onPressed: _edit,
|
||||
),
|
||||
menuPopWidget(context)
|
||||
],
|
||||
),
|
||||
body: Card(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: ListView(children: <Widget>[
|
||||
shipmentNumberBox,
|
||||
cutoffDateDBox,
|
||||
etaBox,
|
||||
departureDateBox,
|
||||
shipTypeBox,
|
||||
consigneeBox,
|
||||
portBox,
|
||||
destinationBox,
|
||||
statusBox,
|
||||
SizedBox(
|
||||
height: 20,
|
||||
)
|
||||
]),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_edit() async {
|
||||
await Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => FcsShipmentEditor(shipment: _fcsShipment)),
|
||||
);
|
||||
}
|
||||
|
||||
Widget menuPopWidget(BuildContext context) {
|
||||
return PopupMenuButton<PopupMenu>(
|
||||
elevation: 3.2,
|
||||
icon: Icon(Icons.more_vert, color: primaryColor),
|
||||
tooltip: 'This is tooltip',
|
||||
onSelected: (choice) {
|
||||
print(choice.id);
|
||||
if (choice.id == 1) {
|
||||
} else if (choice.id == 2) {
|
||||
} else if (choice.id == 3) {
|
||||
} else if (choice.id == 4) {}
|
||||
},
|
||||
itemBuilder: (BuildContext context) {
|
||||
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();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
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/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import 'package:fcs/domain/entities/fcs_shipment.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import 'fcs_shipment_editor.dart';
|
||||
import 'fcs_shipment_info.dart';
|
||||
|
||||
class FcsShipmentListRow extends StatelessWidget {
|
||||
final FcsShipment shipment;
|
||||
@@ -21,7 +19,7 @@ class FcsShipmentListRow extends StatelessWidget {
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(CupertinoPageRoute(
|
||||
builder: (context) => FcsShipmentEditor(shipment: shipment)));
|
||||
builder: (context) => FcsShipmentInfo(fcsShipment: shipment)));
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
|
||||
@@ -252,14 +252,17 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
|
||||
cells: [
|
||||
MyDataCell(Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text("Total",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
)),
|
||||
child: LocalText(
|
||||
context,
|
||||
"shipment.cargo.total",
|
||||
color: Colors.black87,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
||||
)),
|
||||
MyDataCell(
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 45.0),
|
||||
padding: const EdgeInsets.only(right: 48.0),
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(total.toString(),
|
||||
|
||||
@@ -181,6 +181,13 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
selectedValue: _selectedPickupType,
|
||||
values: pickupModel.pickupTypes,
|
||||
);
|
||||
final createBtn = LocalButton(
|
||||
textKey: "shipment.create",
|
||||
);
|
||||
|
||||
final updateBtn = LocalButton(
|
||||
textKey: "shipment.update",
|
||||
);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
@@ -245,9 +252,7 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
Column(
|
||||
children: getBoxList(context, boxModel.boxes),
|
||||
),
|
||||
LocalButton(
|
||||
textKey: "shipment.new",
|
||||
),
|
||||
_isNew ? createBtn : updateBtn,
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -2,6 +2,8 @@ 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_popup_menu_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_popupmenu.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -19,6 +21,7 @@ class ShipmentList extends StatefulWidget {
|
||||
|
||||
class _ShipmentListState extends State<ShipmentList> {
|
||||
bool _isLoading = false;
|
||||
bool _showDelivered = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -33,6 +36,16 @@ class _ShipmentListState extends State<ShipmentList> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var pickupModel = Provider.of<ShipmentModel>(context);
|
||||
final popupMenu = LocalPopupMenuButton(
|
||||
popmenus: [
|
||||
LocalPopupMenu(
|
||||
id: 1, textKey: "shipment.popupmenu.active", selected: true),
|
||||
LocalPopupMenu(id: 2, textKey: "shipment.popupmenu.delivered")
|
||||
],
|
||||
popupMenuCallback: (p) => this.setState(() {
|
||||
_showDelivered = p.id == 2;
|
||||
}),
|
||||
);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: DefaultTabController(
|
||||
@@ -56,6 +69,7 @@ class _ShipmentListState extends State<ShipmentList> {
|
||||
iconSize: 30,
|
||||
// onPressed: () => showPlacesSearch(context),
|
||||
),
|
||||
popupMenu
|
||||
],
|
||||
),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
|
||||
@@ -62,6 +62,7 @@ class _LengthPickerState extends State<LengthPicker> {
|
||||
builder: (BuildContext context) {
|
||||
return LengthPickerDialog(
|
||||
controller: widget.controller,
|
||||
labelKey: widget.lableKey,
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -70,8 +71,10 @@ class _LengthPickerState extends State<LengthPicker> {
|
||||
|
||||
class LengthPickerDialog extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
final String labelKey;
|
||||
|
||||
const LengthPickerDialog({Key key, this.controller}) : super(key: key);
|
||||
const LengthPickerDialog({Key key, this.controller, this.labelKey})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_LengthPickerDialogState createState() => _LengthPickerDialogState();
|
||||
@@ -98,7 +101,7 @@ class _LengthPickerDialogState extends State<LengthPickerDialog> {
|
||||
title: Center(
|
||||
child: LocalText(
|
||||
context,
|
||||
"shipment.box.height",
|
||||
widget.labelKey,
|
||||
color: primaryColor,
|
||||
fontSize: 16,
|
||||
)),
|
||||
|
||||
@@ -5,8 +5,17 @@ class PopupMenu {
|
||||
}
|
||||
|
||||
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"),
|
||||
PopupMenu(
|
||||
id: 1,
|
||||
status: "FCSshipment.commercial_invoice",
|
||||
),
|
||||
PopupMenu(id: 2, status: "FCSshipment.packing_list"),
|
||||
PopupMenu(
|
||||
id: 3,
|
||||
status: "FCSshipment.dms",
|
||||
),
|
||||
PopupMenu(
|
||||
id: 4,
|
||||
status: "FCSshipment.cargo_manifest",
|
||||
),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user