insert shipment form
This commit is contained in:
@@ -271,6 +271,7 @@
|
|||||||
"term.iagree":"I agree on terms and condition.",
|
"term.iagree":"I agree on terms and condition.",
|
||||||
|
|
||||||
"noti.title":"Notifications",
|
"noti.title":"Notifications",
|
||||||
|
"noti.list.title":"NOTIFICATIONS",
|
||||||
"log.title":"Logs",
|
"log.title":"Logs",
|
||||||
|
|
||||||
"document.log.title":"Document Logs",
|
"document.log.title":"Document Logs",
|
||||||
@@ -490,11 +491,17 @@
|
|||||||
"notifications.title":"Notification",
|
"notifications.title":"Notification",
|
||||||
|
|
||||||
"staff.title":"FCS staffs",
|
"staff.title":"FCS staffs",
|
||||||
"staff.form.title":"FCS staff",
|
"staff.list.title":"FCS STAFFS",
|
||||||
|
"staff.new":"New Staff",
|
||||||
|
"staff.form.title":"FCS STAFF",
|
||||||
|
"staff.add":"Add",
|
||||||
"staff.update":"Update",
|
"staff.update":"Update",
|
||||||
|
|
||||||
"shipment.title":"Shipments",
|
"shipment.title":"Shipments",
|
||||||
|
"shipment.list.title":"SHIPMENTS",
|
||||||
"shipment.add":"New shipment",
|
"shipment.add":"New shipment",
|
||||||
|
"shipment.form.title":"SHIPMENT",
|
||||||
|
"shipment.number":"Shipment number",
|
||||||
|
|
||||||
"pickup": "Pickups",
|
"pickup": "Pickups",
|
||||||
"pickup.title": "PICKUPS",
|
"pickup.title": "PICKUPS",
|
||||||
|
|||||||
@@ -266,6 +266,7 @@
|
|||||||
"term.iagree":"ကျွန်တော် သဘောတူပါသည်",
|
"term.iagree":"ကျွန်တော် သဘောတူပါသည်",
|
||||||
|
|
||||||
"noti.title":"အသိပေးချက်များ",
|
"noti.title":"အသိပေးချက်များ",
|
||||||
|
"noti.list.title":"NOTIFICATIONS",
|
||||||
"log.title":"မှတ်တမ်းများ",
|
"log.title":"မှတ်တမ်းများ",
|
||||||
|
|
||||||
"document.log.title":"မှတ်တမ်းများ",
|
"document.log.title":"မှတ်တမ်းများ",
|
||||||
@@ -522,11 +523,17 @@
|
|||||||
"notifications.title":"Notifications",
|
"notifications.title":"Notifications",
|
||||||
|
|
||||||
"staff.title":"FCS staffs",
|
"staff.title":"FCS staffs",
|
||||||
"staff.form.title":"FCS staff",
|
"staff.list.title":"FCS STAFFS",
|
||||||
|
"staff.new":"New Staff",
|
||||||
|
"staff.form.title":"FCS STAFF",
|
||||||
|
"staff.add":"Add",
|
||||||
"staff.update":"Update",
|
"staff.update":"Update",
|
||||||
|
|
||||||
"shipment.title":"Shipments",
|
"shipment.title":"Shipments",
|
||||||
|
"shipment.list.title":"SHIPMENTS",
|
||||||
"shipment.add":"New shipment",
|
"shipment.add":"New shipment",
|
||||||
|
"shipment.form.title":"SHIPMENT",
|
||||||
|
"shipment.number":"Shipment number",
|
||||||
|
|
||||||
"pickup.title": "Pickups",
|
"pickup.title": "Pickups",
|
||||||
"pickup.new": "New Pickup",
|
"pickup.new": "New Pickup",
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:fcs/model/shipment_model.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@@ -63,6 +64,7 @@ class _AppState extends State<App> {
|
|||||||
final ReportUserModel reportUserModel = new ReportUserModel();
|
final ReportUserModel reportUserModel = new ReportUserModel();
|
||||||
final PickUpModel pickUpModel = new PickUpModel();
|
final PickUpModel pickUpModel = new PickUpModel();
|
||||||
final ShipmentRateModel shipmentRateModel = new ShipmentRateModel();
|
final ShipmentRateModel shipmentRateModel = new ShipmentRateModel();
|
||||||
|
final ShipmentModel shipmentModel = new ShipmentModel();
|
||||||
|
|
||||||
AppTranslationsDelegate _newLocaleDelegate;
|
AppTranslationsDelegate _newLocaleDelegate;
|
||||||
|
|
||||||
@@ -94,7 +96,8 @@ class _AppState extends State<App> {
|
|||||||
..addModel(testModel)
|
..addModel(testModel)
|
||||||
..addModel(reportUserModel)
|
..addModel(reportUserModel)
|
||||||
..addModel(pickUpModel)
|
..addModel(pickUpModel)
|
||||||
..addModel(shipmentRateModel);
|
..addModel(shipmentRateModel)
|
||||||
|
..addModel(shipmentModel);
|
||||||
this.mainModel.init();
|
this.mainModel.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,6 +148,7 @@ class _AppState extends State<App> {
|
|||||||
ChangeNotifierProvider(builder: (context) => reportUserModel),
|
ChangeNotifierProvider(builder: (context) => reportUserModel),
|
||||||
ChangeNotifierProvider(builder: (context) => pickUpModel),
|
ChangeNotifierProvider(builder: (context) => pickUpModel),
|
||||||
ChangeNotifierProvider(builder: (context) => shipmentRateModel),
|
ChangeNotifierProvider(builder: (context) => shipmentRateModel),
|
||||||
|
ChangeNotifierProvider(builder: (context) => shipmentModel),
|
||||||
ChangeNotifierProvider(
|
ChangeNotifierProvider(
|
||||||
builder: (context) => testModel,
|
builder: (context) => testModel,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||||
import 'package:fcs/vo/announcement.dart';
|
import 'package:fcs/vo/announcement.dart';
|
||||||
import 'package:fcs/vo/shipment.dart';
|
|
||||||
|
|
||||||
import 'base_model.dart';
|
import 'base_model.dart';
|
||||||
import 'constants.dart';
|
import 'constants.dart';
|
||||||
@@ -11,12 +10,6 @@ import 'firebase_helper.dart';
|
|||||||
class AnnouncementModel extends BaseModel {
|
class AnnouncementModel extends BaseModel {
|
||||||
List<Announcement> announcements = [];
|
List<Announcement> announcements = [];
|
||||||
|
|
||||||
List<Shipment> shipments = [
|
|
||||||
Shipment(shipDate: DateTime(2020, 4, 23), shipmentNumber: 'A103B',status: 'In progress'),
|
|
||||||
Shipment(shipDate: DateTime(2020, 4, 2), shipmentNumber: 'A100A',status: 'Delivered'),
|
|
||||||
Shipment(shipDate: DateTime(2020, 4, 2), shipmentNumber: 'A100B',status: 'Delivered')
|
|
||||||
];
|
|
||||||
|
|
||||||
void initUser(user) {
|
void initUser(user) {
|
||||||
super.initUser(user);
|
super.initUser(user);
|
||||||
_loadAnnouncements();
|
_loadAnnouncements();
|
||||||
|
|||||||
83
lib/model/shipment_model.dart
Normal file
83
lib/model/shipment_model.dart
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
import 'package:fcs/vo/shipment.dart';
|
||||||
|
|
||||||
|
import 'base_model.dart';
|
||||||
|
|
||||||
|
class ShipmentModel extends BaseModel {
|
||||||
|
List<String> shipmentType = ['Air', 'Ship', 'Cargo Truck'];
|
||||||
|
List<Shipment> shipments = [
|
||||||
|
Shipment(
|
||||||
|
shipDate: DateTime(2020, 4, 23),
|
||||||
|
shipmentNumber: 'A103B',
|
||||||
|
status: 'Pending',
|
||||||
|
arrivalDate: DateTime(2020, 4, 30),
|
||||||
|
departureDate: DateTime(2020, 4, 23)),
|
||||||
|
Shipment(
|
||||||
|
shipDate: DateTime(2020, 4, 2),
|
||||||
|
shipmentNumber: 'A100A',
|
||||||
|
status: 'Delivered',
|
||||||
|
arrivalDate: DateTime(2020, 4, 28),
|
||||||
|
departureDate: DateTime(2020, 4, 15)),
|
||||||
|
Shipment(
|
||||||
|
shipDate: DateTime(2020, 4, 2),
|
||||||
|
shipmentNumber: 'A100B',
|
||||||
|
status: 'Delivered',
|
||||||
|
arrivalDate: DateTime(2020, 4, 28),
|
||||||
|
departureDate: DateTime(2020, 4, 15)),
|
||||||
|
Shipment(
|
||||||
|
shipDate: DateTime(2020, 4, 10),
|
||||||
|
shipmentNumber: 'A102B',
|
||||||
|
status: 'Canceled',
|
||||||
|
arrivalDate: DateTime(2020, 4, 20),
|
||||||
|
departureDate: DateTime(2020, 4, 10)),
|
||||||
|
Shipment(
|
||||||
|
shipDate: DateTime(2020, 4, 2),
|
||||||
|
shipmentNumber: 'A100B',
|
||||||
|
status: 'Canceled',
|
||||||
|
arrivalDate: DateTime(2020, 4, 20),
|
||||||
|
departureDate: DateTime(2020, 4, 23)),
|
||||||
|
Shipment(
|
||||||
|
shipDate: DateTime(2020, 4, 10),
|
||||||
|
shipmentNumber: 'A102B',
|
||||||
|
status: 'Assigned',
|
||||||
|
arrivalDate: DateTime(2020, 4, 30),
|
||||||
|
departureDate: DateTime(2020, 4, 20),
|
||||||
|
)
|
||||||
|
];
|
||||||
|
|
||||||
|
List<Shipment> get canceled {
|
||||||
|
List<Shipment> _p = shipments.where((e) => e.status == "Canceled").toList()
|
||||||
|
..sort((e1, e2) {
|
||||||
|
return e2.shipDate.compareTo(e1.shipDate);
|
||||||
|
});
|
||||||
|
return _p;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Shipment> get completed {
|
||||||
|
return shipments.where((e) => e.status == "Delivered").toList()
|
||||||
|
..sort((e1, e2) {
|
||||||
|
return e2.shipDate.compareTo(e1.shipDate);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Shipment> get upcoming {
|
||||||
|
return shipments
|
||||||
|
.where((e) =>
|
||||||
|
e.status == "Pending" ||
|
||||||
|
e.status == "Assigned" ||
|
||||||
|
e.status == "Processed" ||
|
||||||
|
e.status == "Rescheduled")
|
||||||
|
.toList()
|
||||||
|
..sort((e1, e2) {
|
||||||
|
return e2.shipDate.compareTo(e1.shipDate);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void initUser(user) {
|
||||||
|
super.initUser(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
logout() async {
|
||||||
|
shipments = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:pin_input_text_field/pin_input_text_field.dart';
|
import 'package:pin_input_text_field/pin_input_text_field.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../theme/theme.dart';
|
|
||||||
import '../theme/theme.dart';
|
import '../theme/theme.dart';
|
||||||
import '../widget/local_text.dart';
|
import '../widget/local_text.dart';
|
||||||
import '../widget/progress.dart';
|
import '../widget/progress.dart';
|
||||||
@@ -66,6 +65,11 @@ class _CodePageState extends State<CodePage> {
|
|||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
|
leading: new IconButton(
|
||||||
|
icon: new Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
@@ -82,7 +86,7 @@ class _CodePageState extends State<CodePage> {
|
|||||||
context,
|
context,
|
||||||
'singup.verify.title',
|
'singup.verify.title',
|
||||||
fontSize: 21,
|
fontSize: 21,
|
||||||
color: secondaryColor,
|
color: primaryColor,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -161,6 +165,7 @@ class _CodePageState extends State<CodePage> {
|
|||||||
'login.smscode.retry',
|
'login.smscode.retry',
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
translationVariables: [_start.toString()],
|
translationVariables: [_start.toString()],
|
||||||
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:fcs/model/main_model.dart';
|
import 'package:fcs/model/main_model.dart';
|
||||||
|
import 'package:fcs/pages/shipment_list.dart';
|
||||||
import 'package:fcs/widget/bottom_up_page_route.dart';
|
import 'package:fcs/widget/bottom_up_page_route.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_icons/flutter_icons.dart';
|
import 'package:flutter_icons/flutter_icons.dart';
|
||||||
@@ -45,7 +46,6 @@ import 'buying_online.dart';
|
|||||||
import 'do/do_list.dart';
|
import 'do/do_list.dart';
|
||||||
import 'my_registeration.dart';
|
import 'my_registeration.dart';
|
||||||
import 'pd/pd_list.dart';
|
import 'pd/pd_list.dart';
|
||||||
import 'po/shipment_list.dart';
|
|
||||||
import 'products_list.dart';
|
import 'products_list.dart';
|
||||||
import 'profile_page.dart';
|
import 'profile_page.dart';
|
||||||
import 'signin_page.dart';
|
import 'signin_page.dart';
|
||||||
@@ -105,8 +105,8 @@ class _HomePageState extends State<HomePage> {
|
|||||||
height: 40,
|
height: 40,
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
btnCallback: () => Navigator.of(context)
|
btnCallback: () =>
|
||||||
.push(BottomUpPageRoute(ManualPage()))
|
Navigator.of(context).push(BottomUpPageRoute(ManualPage()))
|
||||||
// btnCallback: () => Navigator.of(context)
|
// btnCallback: () => Navigator.of(context)
|
||||||
// .push(MaterialPageRoute(builder: (_) => TestList()))
|
// .push(MaterialPageRoute(builder: (_) => TestList()))
|
||||||
);
|
);
|
||||||
@@ -138,13 +138,13 @@ class _HomePageState extends State<HomePage> {
|
|||||||
|
|
||||||
final pickUpBtn = _buildBtn2("pickup",
|
final pickUpBtn = _buildBtn2("pickup",
|
||||||
icon: MaterialCommunityIcons.directions,
|
icon: MaterialCommunityIcons.directions,
|
||||||
btnCallback: () => Navigator.of(context)
|
btnCallback: () =>
|
||||||
.push(BottomUpPageRoute(PickUpList())));
|
Navigator.of(context).push(BottomUpPageRoute(PickUpList())));
|
||||||
|
|
||||||
final shipmentCostBtn = _buildBtn2("rate",
|
final shipmentCostBtn = _buildBtn2("rate",
|
||||||
icon: FontAwesomeIcons.calculator,
|
icon: FontAwesomeIcons.calculator,
|
||||||
btnCallback: () => Navigator.of(context)
|
btnCallback: () =>
|
||||||
.push(BottomUpPageRoute(ShipmentRates())));
|
Navigator.of(context).push(BottomUpPageRoute(ShipmentRates())));
|
||||||
|
|
||||||
final fcsProfileBtn = _buildBtn2("profile.title",
|
final fcsProfileBtn = _buildBtn2("profile.title",
|
||||||
icon: Icons.account_circle,
|
icon: Icons.account_circle,
|
||||||
@@ -229,12 +229,9 @@ class _HomePageState extends State<HomePage> {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
final buyingBtn = _buildBtn2("buy_online",
|
final buyingBtn = _buildBtn2("buy_online",
|
||||||
icon: MaterialCommunityIcons.cart_outline, btnCallback: () {
|
icon: MaterialCommunityIcons.cart_outline, btnCallback: () {
|
||||||
Navigator.push(
|
Navigator.push(context, BottomUpPageRoute(BuyingOnlinePage())
|
||||||
context,
|
|
||||||
BottomUpPageRoute(BuyingOnlinePage())
|
|
||||||
// MaterialPageRoute(builder: (context) => BuyingOnlinePage()),
|
// MaterialPageRoute(builder: (context) => BuyingOnlinePage()),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -422,7 +419,10 @@ class _HomePageState extends State<HomePage> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
// iconSize: 30,
|
// iconSize: 30,
|
||||||
child: Text("Sign in",style: siginButtonStyle,),
|
child: Text(
|
||||||
|
"Sign in",
|
||||||
|
style: siginButtonStyle,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|||||||
@@ -45,15 +45,17 @@ class _InstructionPageState extends State<InstructionPage> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(Icons.close, color: secondaryColor),
|
icon: new Icon(Icons.close, color: Colors.white),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
title: Text(widget.name),
|
title: Text(widget.name),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
),
|
),
|
||||||
body: Container(
|
body: Container(
|
||||||
|
padding: EdgeInsets.only(left: 5, right: 5, top: 5),
|
||||||
|
child: Card(elevation: 0,
|
||||||
child: FittedBox(
|
child: FittedBox(
|
||||||
child: Image.asset(widget.image), fit: BoxFit.contain),
|
child: Image.asset(widget.image), fit: BoxFit.contain)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class _ManualPageState extends State<ManualPage> {
|
|||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(Icons.close, color: secondaryColor),
|
icon: new Icon(Icons.close, color: Colors.white),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
title: Text(widget.marketplace == null ? '' : widget.marketplace),
|
title: Text(widget.marketplace == null ? '' : widget.marketplace),
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import 'package:intl/intl.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:fcs/model/notification_model.dart';
|
import 'package:fcs/model/notification_model.dart';
|
||||||
import 'package:fcs/vo/notification.dart' as Noti;
|
import 'package:fcs/vo/notification.dart' as Noti;
|
||||||
import 'package:fcs/widget/localization/app_translations.dart';
|
|
||||||
import 'package:fcs/widget/progress.dart';
|
import 'package:fcs/widget/progress.dart';
|
||||||
|
|
||||||
import '../theme/theme.dart';
|
import '../theme/theme.dart';
|
||||||
@@ -33,14 +32,16 @@ class _NotificationListState extends State<NotificationList> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(Icons.close, ),
|
icon: new Icon(
|
||||||
|
Icons.close,
|
||||||
|
),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
title: LocalText(
|
title: LocalText(
|
||||||
context,
|
context,
|
||||||
'noti.title',
|
'noti.list.title',
|
||||||
fontSize: 18,
|
fontSize: 20,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -65,12 +66,11 @@ class _NotificationListState extends State<NotificationList> {
|
|||||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||||
child: new Row(
|
child: new Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
// new Padding(
|
new Padding(
|
||||||
// padding: new EdgeInsets.symmetric(
|
padding: new EdgeInsets.symmetric(
|
||||||
// horizontal: 32.0 - dotSize / 2),
|
horizontal: 32.0 - dotSize / 2),
|
||||||
// child: Icon(Icons.message),
|
child: Icon(Icons.message,color: primaryColor,),
|
||||||
// ),
|
),
|
||||||
new Padding(padding: EdgeInsets.only(left: 10)),
|
|
||||||
new Expanded(
|
new Expanded(
|
||||||
child: new Column(
|
child: new Column(
|
||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
@@ -85,7 +85,8 @@ class _NotificationListState extends State<NotificationList> {
|
|||||||
noti.marketPlace == null
|
noti.marketPlace == null
|
||||||
? Container()
|
? Container()
|
||||||
: Padding(
|
: Padding(
|
||||||
padding: const EdgeInsets.only(top:8.0),
|
padding: const EdgeInsets.only(
|
||||||
|
top: 8.0),
|
||||||
child: new Text(
|
child: new Text(
|
||||||
noti.marketPlace,
|
noti.marketPlace,
|
||||||
style: new TextStyle(
|
style: new TextStyle(
|
||||||
@@ -94,11 +95,14 @@ class _NotificationListState extends State<NotificationList> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top:8.0),
|
padding:
|
||||||
|
const EdgeInsets.only(top: 8.0),
|
||||||
child: new Text(
|
child: new Text(
|
||||||
noti.status == null ? "" : noti.status,
|
noti.status == null
|
||||||
|
? ""
|
||||||
|
: noti.status,
|
||||||
style: new TextStyle(
|
style: new TextStyle(
|
||||||
fontSize: 16.0,
|
fontSize: 15.0,
|
||||||
color: Colors.grey),
|
color: Colors.grey),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,163 +0,0 @@
|
|||||||
import 'package:fcs/vo/shipment.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:fcs/theme/theme.dart';
|
|
||||||
import 'package:fcs/widget/progress.dart';
|
|
||||||
|
|
||||||
import '../../model/announcement_model.dart';
|
|
||||||
import '../../widget/local_text.dart';
|
|
||||||
import '../util.dart';
|
|
||||||
|
|
||||||
class ShipmentList extends StatefulWidget {
|
|
||||||
@override
|
|
||||||
_ShipmentListState createState() => _ShipmentListState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _ShipmentListState extends State<ShipmentList> {
|
|
||||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
|
||||||
final double dotSize = 10.0;
|
|
||||||
String status;
|
|
||||||
|
|
||||||
bool _isLoading = false;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
var shipmentModel = Provider.of<AnnouncementModel>(context);
|
|
||||||
final addbutton = Container(
|
|
||||||
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
|
|
||||||
child: Container(
|
|
||||||
height: 45.0,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: primaryColor,
|
|
||||||
shape: BoxShape.rectangle,
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
|
||||||
child: ButtonTheme(
|
|
||||||
minWidth: 900.0,
|
|
||||||
height: 100.0,
|
|
||||||
child: FlatButton(
|
|
||||||
onPressed: () {
|
|
||||||
// Navigator.push(
|
|
||||||
// context,
|
|
||||||
// MaterialPageRoute(
|
|
||||||
// builder: (context) => ManualPage(
|
|
||||||
// marketplace: 'Amazon',
|
|
||||||
// )));
|
|
||||||
},
|
|
||||||
child: LocalText(
|
|
||||||
context,
|
|
||||||
'shipment.add',
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return LocalProgress(
|
|
||||||
inAsyncCall: _isLoading,
|
|
||||||
child: Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
backgroundColor: primaryColor,
|
|
||||||
title: LocalText(context, 'shipment.title',
|
|
||||||
fontSize: 18, color: Colors.white),
|
|
||||||
),
|
|
||||||
body: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: new ListView.builder(
|
|
||||||
scrollDirection: Axis.vertical,
|
|
||||||
padding: EdgeInsets.only(left: 15, right: 15, top: 15),
|
|
||||||
shrinkWrap: true,
|
|
||||||
itemCount: shipmentModel.shipments.length,
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
Shipment _shipment = shipmentModel.shipments[index];
|
|
||||||
return Card(
|
|
||||||
elevation: 10,
|
|
||||||
color: Colors.white,
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
// Navigator.push(
|
|
||||||
// context,
|
|
||||||
// MaterialPageRoute(
|
|
||||||
// builder: (context) => POSubmissionForm(
|
|
||||||
// poSubmission: _shipment,
|
|
||||||
// )),
|
|
||||||
// );
|
|
||||||
},
|
|
||||||
child: Row(
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: new Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(vertical: 16.0),
|
|
||||||
child: new Row(
|
|
||||||
children: <Widget>[
|
|
||||||
new Padding(
|
|
||||||
padding: new EdgeInsets.symmetric(
|
|
||||||
horizontal: 15.0 - dotSize / 2),
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.all(5.0),
|
|
||||||
child: Image.asset(
|
|
||||||
"assets/truck.png",
|
|
||||||
width: 40,
|
|
||||||
height: 40,
|
|
||||||
color: primaryColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
new Expanded(
|
|
||||||
child: new Column(
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
new Text(
|
|
||||||
_shipment.shipmentNumber.toString(),
|
|
||||||
style: new TextStyle(
|
|
||||||
fontSize: 12.0,
|
|
||||||
color: Colors.black),
|
|
||||||
),
|
|
||||||
new Text(
|
|
||||||
dateFormatter
|
|
||||||
.format(_shipment.shipDate),
|
|
||||||
style: new TextStyle(
|
|
||||||
fontSize: 12.0,
|
|
||||||
color: Colors.grey),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 18.0),
|
|
||||||
child: getStatus(_shipment.status),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
addbutton,
|
|
||||||
SizedBox(height: 15)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
371
lib/pages/shipment_editor.dart
Normal file
371
lib/pages/shipment_editor.dart
Normal file
@@ -0,0 +1,371 @@
|
|||||||
|
import 'package:fcs/model/main_model.dart';
|
||||||
|
import 'package:fcs/model/shipment_model.dart';
|
||||||
|
import 'package:fcs/pages/util.dart';
|
||||||
|
import 'package:fcs/vo/shipment.dart';
|
||||||
|
import 'package:fcs/vo/user.dart';
|
||||||
|
import 'package:fcs/widget/label_widgets.dart';
|
||||||
|
import 'package:flutter_icons/flutter_icons.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:fcs/widget/localization/app_translations.dart';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:fcs/widget/progress.dart';
|
||||||
|
|
||||||
|
import '../theme/theme.dart';
|
||||||
|
|
||||||
|
class ShipmentEditor extends StatefulWidget {
|
||||||
|
final Shipment shipment;
|
||||||
|
ShipmentEditor({this.shipment});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ShipmentEditorState createState() => _ShipmentEditorState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||||
|
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||||
|
TextEditingController _shipmentNumberController = new TextEditingController();
|
||||||
|
TextEditingController _cutoffDateController = new TextEditingController();
|
||||||
|
TextEditingController _arrivalDateController = new TextEditingController();
|
||||||
|
TextEditingController _departureDateControler = new TextEditingController();
|
||||||
|
TextEditingController _consigneeController = new TextEditingController();
|
||||||
|
TextEditingController _portController = new TextEditingController();
|
||||||
|
TextEditingController _destinationController = new TextEditingController();
|
||||||
|
TextEditingController _statusController = new TextEditingController();
|
||||||
|
TextEditingController _remarkController = new TextEditingController();
|
||||||
|
|
||||||
|
Shipment _shipment = new Shipment();
|
||||||
|
bool _isLoading = false;
|
||||||
|
String _currentShipment;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
if (widget.shipment != null) {
|
||||||
|
_shipment = widget.shipment;
|
||||||
|
_shipmentNumberController.text = _shipment.shipmentNumber;
|
||||||
|
_arrivalDateController.text = dateFormatter.format(_shipment.arrivalDate);
|
||||||
|
_departureDateControler.text =
|
||||||
|
dateFormatter.format(_shipment.departureDate);
|
||||||
|
_statusController.text = _shipment.status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _showCustomerData(User customer) {
|
||||||
|
return Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 10.0, top: 8),
|
||||||
|
child: Text(
|
||||||
|
customer.name,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black87,
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 10.0, top: 8),
|
||||||
|
child: Text(
|
||||||
|
customer.phoneNumber,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black87,
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
widget.shipment == null
|
||||||
|
? Container()
|
||||||
|
: Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 10.0, top: 8),
|
||||||
|
child: Text(
|
||||||
|
_shipmentNumberController.text,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black87,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget showShipmentNumber(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.only(top: 10),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(Icons.text_rotation_none),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 8.0),
|
||||||
|
child: labeledText(
|
||||||
|
context, _shipmentNumberController.text, "shipment.number"),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget showShipmentTypes(BuildContext context, ShipmentModel shipmentModel) {
|
||||||
|
return Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(MaterialCommunityIcons.box_shadow),
|
||||||
|
SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
|
new Flexible(
|
||||||
|
child: Container(
|
||||||
|
width: 200.0,
|
||||||
|
child: DropdownButton<String>(
|
||||||
|
value: _currentShipment,
|
||||||
|
isExpanded: true,
|
||||||
|
hint: Text(
|
||||||
|
'Select shipment type',
|
||||||
|
),
|
||||||
|
onChanged: changedDropDown,
|
||||||
|
items: shipmentModel.shipmentType
|
||||||
|
.map<DropdownMenuItem<String>>((String shipment) {
|
||||||
|
return new DropdownMenuItem<String>(
|
||||||
|
value: shipment,
|
||||||
|
child: new Text(shipment,
|
||||||
|
style:
|
||||||
|
new TextStyle(color: Colors.black87, fontSize: 17)),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void changedDropDown(selected) {
|
||||||
|
setState(() {
|
||||||
|
_currentShipment = selected;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var shipmentModel = Provider.of<ShipmentModel>(context);
|
||||||
|
|
||||||
|
final statusBox = Container(
|
||||||
|
padding: EdgeInsets.only(top: 10),
|
||||||
|
child: TextFormField(
|
||||||
|
maxLines: null,
|
||||||
|
controller: _statusController,
|
||||||
|
cursorColor: primaryColor,
|
||||||
|
style: textStyle,
|
||||||
|
decoration: new InputDecoration(
|
||||||
|
labelText: 'Status',
|
||||||
|
labelStyle: TextStyle(fontSize: 14, color: Colors.grey),
|
||||||
|
enabledBorder: UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||||
|
focusedBorder: UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
|
||||||
|
MainModel mainModel = Provider.of<MainModel>(context);
|
||||||
|
|
||||||
|
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 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'),
|
||||||
|
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'),
|
||||||
|
color: primaryColor,
|
||||||
|
textColor: Colors.white,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
))),
|
||||||
|
);
|
||||||
|
return LocalProgress(
|
||||||
|
inAsyncCall: _isLoading,
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
|
leading: new IconButton(
|
||||||
|
icon: new Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
|
backgroundColor: primaryColor,
|
||||||
|
title: Text(AppTranslations.of(context).text("shipment.form.title")),
|
||||||
|
),
|
||||||
|
body: Card(
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(10.0),
|
||||||
|
child: ListView(children: <Widget>[
|
||||||
|
_showCustomerData(mainModel.customer),
|
||||||
|
widget.shipment == null
|
||||||
|
? fcsInput('Shipment number', Icons.text_rotation_none,
|
||||||
|
controller: _shipmentNumberController)
|
||||||
|
: Container(),
|
||||||
|
widget.shipment == null
|
||||||
|
? Container(
|
||||||
|
padding: EdgeInsets.only(top: 15),
|
||||||
|
child: fcsInput('Cutoff date', Icons.date_range,
|
||||||
|
controller: _cutoffDateController),
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
widget.shipment == null
|
||||||
|
? Container(
|
||||||
|
padding: EdgeInsets.only(top: 15),
|
||||||
|
child: showShipmentTypes(context, shipmentModel))
|
||||||
|
: Container(),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(top: 15),
|
||||||
|
child: fcsInput('Arrival date', Icons.date_range,
|
||||||
|
controller: _arrivalDateController),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(top: 15),
|
||||||
|
child: fcsInput('Departure date', Icons.date_range,
|
||||||
|
controller: _departureDateControler),
|
||||||
|
),
|
||||||
|
widget.shipment == null
|
||||||
|
? Container(
|
||||||
|
padding: EdgeInsets.only(top: 15),
|
||||||
|
child: fcsInput('Consignee', Icons.work,
|
||||||
|
controller: _consigneeController),
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
widget.shipment == null
|
||||||
|
? Container(
|
||||||
|
padding: EdgeInsets.only(top: 15),
|
||||||
|
child: fcsInput(
|
||||||
|
'Port of loading', FontAwesomeIcons.ship,
|
||||||
|
controller: _portController),
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
widget.shipment == null
|
||||||
|
? Container(
|
||||||
|
padding: EdgeInsets.only(top: 15),
|
||||||
|
child: fcsInput('Final destination',
|
||||||
|
MaterialCommunityIcons.location_enter,
|
||||||
|
controller: _destinationController),
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
widget.shipment == null
|
||||||
|
? Container()
|
||||||
|
: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(top: 15, right: 8.0),
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/status.png',
|
||||||
|
width: 24,
|
||||||
|
height: 24,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(child: statusBox)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
widget.shipment == null
|
||||||
|
? Container()
|
||||||
|
: Container(
|
||||||
|
padding: EdgeInsets.only(top: 15),
|
||||||
|
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 ? createBtn : updateBtn,
|
||||||
|
SizedBox(height: 15)
|
||||||
|
]),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
156
lib/pages/shipment_list.dart
Normal file
156
lib/pages/shipment_list.dart
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
import 'package:fcs/model/shipment_model.dart';
|
||||||
|
import 'package:fcs/widget/local_text.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:fcs/pages/search_page.dart';
|
||||||
|
import 'package:fcs/vo/buyer.dart';
|
||||||
|
import 'package:fcs/widget/localization/app_translations.dart';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:fcs/widget/progress.dart';
|
||||||
|
|
||||||
|
import '../theme/theme.dart';
|
||||||
|
import 'shipment_editor.dart';
|
||||||
|
import 'shipment_list_row.dart';
|
||||||
|
|
||||||
|
class ShipmentList extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_ShipmentListState createState() => _ShipmentListState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ShipmentListState extends State<ShipmentList> {
|
||||||
|
Buyer buyer;
|
||||||
|
bool _isLoading = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return LocalProgress(
|
||||||
|
inAsyncCall: _isLoading,
|
||||||
|
child: DefaultTabController(
|
||||||
|
length: 3,
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
|
leading: new IconButton(
|
||||||
|
icon: new Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
|
backgroundColor: primaryColor,
|
||||||
|
title: LocalText(context, 'shipment.list.title',
|
||||||
|
color: Colors.white, fontSize: 20),
|
||||||
|
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: "Completed"),
|
||||||
|
Tab(text: "Canceled"),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
floatingActionButton: FloatingActionButton.extended(
|
||||||
|
onPressed: () {
|
||||||
|
_newShipment();
|
||||||
|
},
|
||||||
|
icon: Icon(Icons.add),
|
||||||
|
label: Text(AppTranslations.of(context).text("shipment.add")),
|
||||||
|
backgroundColor: primaryColor,
|
||||||
|
),
|
||||||
|
body: TabBarView(
|
||||||
|
children: [_upComing(), _completed(), _canceled()],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_newShipment() {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => new ShipmentEditor()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _upComing() {
|
||||||
|
var shipmentModel = Provider.of<ShipmentModel>(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 ShipmentListRow(shipment: shipmentModel.upcoming[index]);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _completed() {
|
||||||
|
var shipmentModel = Provider.of<ShipmentModel>(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 ShipmentListRow(
|
||||||
|
shipment: shipmentModel.completed[index]);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _canceled() {
|
||||||
|
var shipmentModel = Provider.of<ShipmentModel>(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 ShipmentListRow(shipment: shipmentModel.canceled[index]);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
97
lib/pages/shipment_list_row.dart
Normal file
97
lib/pages/shipment_list_row.dart
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
import 'package:fcs/theme/theme.dart';
|
||||||
|
import 'package:fcs/vo/shipment.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_icons/flutter_icons.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
import 'shipment_editor.dart';
|
||||||
|
import 'util.dart';
|
||||||
|
|
||||||
|
class ShipmentListRow extends StatefulWidget {
|
||||||
|
final Shipment shipment;
|
||||||
|
const ShipmentListRow({this.shipment});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ShipmentListRowState createState() => _ShipmentListRowState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ShipmentListRowState extends State<ShipmentListRow> {
|
||||||
|
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||||
|
final double dotSize = 15.0;
|
||||||
|
Shipment _shipment = new Shipment();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
if (widget.shipment != null) {
|
||||||
|
_shipment = widget.shipment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.only(left: 15, right: 15),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => ShipmentEditor(shipment: _shipment)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: new Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||||
|
child: new Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(left: 5, right: 10),
|
||||||
|
child: Icon(
|
||||||
|
Ionicons.ios_airplane,
|
||||||
|
color: primaryColor,
|
||||||
|
size: 30,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
new Expanded(
|
||||||
|
child: new Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
child: new Text(
|
||||||
|
_shipment.shipmentNumber == null
|
||||||
|
? ''
|
||||||
|
: _shipment.shipmentNumber,
|
||||||
|
style: new TextStyle(
|
||||||
|
fontSize: 15.0, color: Colors.black),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 10.0, top: 10),
|
||||||
|
child: new Text(
|
||||||
|
dateFormatter.format(_shipment.shipDate),
|
||||||
|
style: new TextStyle(
|
||||||
|
fontSize: 15.0, color: Colors.grey),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(0),
|
||||||
|
child: getStatus(_shipment.status),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,6 +36,11 @@ class _SigninPageState extends State<SigninPage> {
|
|||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: new Scaffold(
|
child: new Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
|
leading: new IconButton(
|
||||||
|
icon: new Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
),
|
),
|
||||||
body: _buildLogin(context),
|
body: _buildLogin(context),
|
||||||
@@ -53,7 +58,7 @@ class _SigninPageState extends State<SigninPage> {
|
|||||||
context,
|
context,
|
||||||
'login.title',
|
'login.title',
|
||||||
fontSize: 21,
|
fontSize: 21,
|
||||||
color: secondaryColor,
|
color: primaryColor,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -91,29 +96,25 @@ class _SigninPageState extends State<SigninPage> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.only(top: 10, bottom: 10),
|
padding: EdgeInsets.only(top: 10, bottom: 10),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
autofocus: true,
|
|
||||||
controller: phonenumberCtl,
|
controller: phonenumberCtl,
|
||||||
cursorColor: primaryColor,
|
cursorColor: primaryColor,
|
||||||
keyboardType: TextInputType.phone,
|
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
|
autofocus: true,
|
||||||
|
keyboardType: TextInputType.phone,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
),
|
),
|
||||||
decoration: InputDecoration(
|
decoration: new InputDecoration(
|
||||||
contentPadding: EdgeInsets.all(8.0),
|
contentPadding: EdgeInsets.only(top: 8),
|
||||||
enabledBorder: OutlineInputBorder(
|
enabledBorder: UnderlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(12.0)),
|
|
||||||
borderSide:
|
borderSide:
|
||||||
BorderSide(color: Colors.grey[400], width: 1),
|
BorderSide(color: primaryColor, width: 1.0)),
|
||||||
),
|
focusedBorder: UnderlineInputBorder(
|
||||||
focusedBorder: OutlineInputBorder(
|
borderSide:
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
BorderSide(color: primaryColor, width: 1.0)),
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Colors.grey[400],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import 'package:fcs/vo/user.dart';
|
|||||||
import 'package:fcs/widget/local_text.dart';
|
import 'package:fcs/widget/local_text.dart';
|
||||||
import 'package:fcs/widget/localization/app_translations.dart';
|
import 'package:fcs/widget/localization/app_translations.dart';
|
||||||
import 'package:fcs/widget/progress.dart';
|
import 'package:fcs/widget/progress.dart';
|
||||||
import 'document_log_page.dart';
|
|
||||||
import 'util.dart';
|
import 'util.dart';
|
||||||
|
|
||||||
typedef void FindCallBack();
|
typedef void FindCallBack();
|
||||||
@@ -112,16 +111,9 @@ class _StaffEditorState extends State<StaffEditor> {
|
|||||||
focusedBorder: UnderlineInputBorder(
|
focusedBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||||
),
|
),
|
||||||
validator: (value) {
|
|
||||||
if (value.isEmpty) {
|
|
||||||
return "Please enter phone number";
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
new FlatButton(
|
new FlatButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (!_formKey.currentState.validate()) return;
|
|
||||||
this.isSend = true;
|
this.isSend = true;
|
||||||
findCallBack();
|
findCallBack();
|
||||||
},
|
},
|
||||||
@@ -191,7 +183,7 @@ class _StaffEditorState extends State<StaffEditor> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
),
|
||||||
child: ButtonTheme(
|
child: ButtonTheme(
|
||||||
minWidth: 900.0,
|
minWidth: 900.0,
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
@@ -208,25 +200,23 @@ class _StaffEditorState extends State<StaffEditor> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final addButton = Container(
|
final addButton = Container(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(top: 40),
|
||||||
left: 24.0,
|
|
||||||
right: 24.0,
|
|
||||||
),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 45.0,
|
height: 45.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
),
|
||||||
child: ButtonTheme(
|
child: ButtonTheme(
|
||||||
minWidth: 900.0,
|
minWidth: 900.0,
|
||||||
height: 100.0,
|
height: 100.0,
|
||||||
child: FlatButton(
|
child: FlatButton(
|
||||||
onPressed: () {
|
onPressed: () {},
|
||||||
if (!_formKey.currentState.validate()) return;
|
|
||||||
_add(context);
|
|
||||||
},
|
|
||||||
child: LocalText(
|
child: LocalText(
|
||||||
context,
|
context,
|
||||||
'employee.add',
|
'staff.add',
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -240,6 +230,11 @@ class _StaffEditorState extends State<StaffEditor> {
|
|||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
|
leading: new IconButton(
|
||||||
|
icon: new Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
title: LocalText(
|
title: LocalText(
|
||||||
context,
|
context,
|
||||||
@@ -276,7 +271,7 @@ class _StaffEditorState extends State<StaffEditor> {
|
|||||||
Column(
|
Column(
|
||||||
children: showprivilegeList(context, userModel),
|
children: showprivilegeList(context, userModel),
|
||||||
),
|
),
|
||||||
updateButton,
|
widget.staff == null ? addButton : updateButton,
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
)
|
)
|
||||||
@@ -315,8 +310,7 @@ class _StaffEditorState extends State<StaffEditor> {
|
|||||||
if (widget.staff == null) return;
|
if (widget.staff == null) return;
|
||||||
var employeeModel = Provider.of<EmployeeModel>(context);
|
var employeeModel = Provider.of<EmployeeModel>(context);
|
||||||
try {
|
try {
|
||||||
await employeeModel.updatePrivileges(
|
await employeeModel.updatePrivileges(widget.staff.docID, privilegesIDs());
|
||||||
widget.staff.docID, privilegesIDs());
|
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showMsgDialog(context, "Error", e.toString());
|
showMsgDialog(context, "Error", e.toString());
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
import 'package:fcs/widget/localization/app_translations.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_icons/flutter_icons.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@@ -30,58 +32,64 @@ class _StaffListState extends State<StaffList> {
|
|||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
|
leading: new IconButton(
|
||||||
|
icon: new Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
title: LocalText(
|
title: LocalText(
|
||||||
context,
|
context,
|
||||||
'staff.title',
|
'staff.list.title',
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 18,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton.extended(
|
||||||
// backgroundColor: primaryColor,
|
onPressed: () {
|
||||||
// child: Icon(Icons.add),
|
Navigator.push(
|
||||||
// onPressed: () {
|
context,
|
||||||
// Navigator.push(
|
MaterialPageRoute(builder: (context) => StaffEditor()),
|
||||||
// context,
|
);
|
||||||
// MaterialPageRoute(builder: (context) => EmployeeEditor()),
|
},
|
||||||
// );
|
icon: Icon(Icons.add),
|
||||||
// },
|
label: Text(AppTranslations.of(context).text("staff.new")),
|
||||||
// ),
|
backgroundColor: primaryColor,
|
||||||
body: new ListView.builder(
|
),
|
||||||
padding: EdgeInsets.only(left: 10, right: 10, top: 15),
|
body: new ListView.separated(
|
||||||
|
separatorBuilder: (context, index) => Divider(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
padding: EdgeInsets.only(left: 15, right: 15, top: 15),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: employeeModel.employees.length,
|
itemCount: employeeModel.employees.length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
User _user = employeeModel.employees[index];
|
User user = employeeModel.employees[index];
|
||||||
return Container(
|
return Stack(
|
||||||
child: Card(
|
children: <Widget>[
|
||||||
elevation: 10,
|
InkWell(
|
||||||
color: Colors.white,
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) =>
|
builder: (context) => StaffEditor(staff: user)),
|
||||||
StaffEditor(staff: _user)),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: new Padding(
|
child: new Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 20.0),
|
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||||
child: new Row(
|
child: new Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
new Padding(
|
new Padding(
|
||||||
padding: new EdgeInsets.symmetric(
|
padding: new EdgeInsets.symmetric(
|
||||||
horizontal: 32.0 - dotSize / 2),
|
horizontal: 32.0 - dotSize / 2),
|
||||||
child: Image.asset(
|
child: Icon(
|
||||||
"assets/employee.png",
|
SimpleLineIcons.people,
|
||||||
width: 40,
|
|
||||||
height: 40,
|
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
|
size: 40,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
new Expanded(
|
new Expanded(
|
||||||
@@ -90,38 +98,32 @@ class _StaffListState extends State<StaffList> {
|
|||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
new Text(
|
new Text(
|
||||||
_user.name,
|
user.name,
|
||||||
style: new TextStyle(
|
style: new TextStyle(
|
||||||
fontSize: 15.0,
|
fontSize: 15.0,
|
||||||
color: secondaryColor),
|
color: primaryColor),
|
||||||
),
|
),
|
||||||
new Text(
|
|
||||||
_user.phoneNumber,
|
|
||||||
style: new TextStyle(
|
|
||||||
fontSize: 13.0,
|
|
||||||
color: secondaryColor),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
_user.status == null
|
|
||||||
? Container()
|
|
||||||
: Row(
|
|
||||||
children: <Widget>[
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding:
|
||||||
child: getStatus(_user.status),
|
const EdgeInsets.only(top: 8.0),
|
||||||
|
child: new Text(
|
||||||
|
user.phoneNumber,
|
||||||
|
style: new TextStyle(
|
||||||
|
fontSize: 15.0,
|
||||||
|
color: Colors.grey),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import 'package:fcs/model/shared_pref.dart';
|
import 'package:fcs/model/shared_pref.dart';
|
||||||
|
import 'package:fcs/widget/localization/app_translations.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
|
||||||
import '../theme/theme.dart';
|
|
||||||
import '../theme/theme.dart';
|
import '../theme/theme.dart';
|
||||||
import '../widget/local_text.dart';
|
import '../widget/local_text.dart';
|
||||||
import '../widget/progress.dart';
|
import '../widget/progress.dart';
|
||||||
@@ -29,6 +29,11 @@ class _UserEditPageState extends State<UserEditPage> {
|
|||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: new Scaffold(
|
child: new Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
|
leading: new IconButton(
|
||||||
|
icon: new Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
),
|
),
|
||||||
body: _buildBody(context),
|
body: _buildBody(context),
|
||||||
@@ -38,7 +43,7 @@ class _UserEditPageState extends State<UserEditPage> {
|
|||||||
|
|
||||||
Widget _buildBody(BuildContext context) {
|
Widget _buildBody(BuildContext context) {
|
||||||
return ListView(
|
return ListView(
|
||||||
padding: EdgeInsets.only(top: 5, left: 15, right: 15),
|
padding: EdgeInsets.only(top: 5, left: 10, right: 10),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(top: 40),
|
padding: EdgeInsets.only(top: 40),
|
||||||
@@ -46,7 +51,7 @@ class _UserEditPageState extends State<UserEditPage> {
|
|||||||
context,
|
context,
|
||||||
'user_edit.welcome',
|
'user_edit.welcome',
|
||||||
fontSize: 21,
|
fontSize: 21,
|
||||||
color: secondaryColor,
|
color: primaryColor,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -60,28 +65,21 @@ class _UserEditPageState extends State<UserEditPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(top: 10, bottom: 10),
|
padding: EdgeInsets.only(top: 0, bottom: 10),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
autofocus: true,
|
|
||||||
controller: nameCtl,
|
controller: nameCtl,
|
||||||
cursorColor: primaryColor,
|
cursorColor: primaryColor,
|
||||||
keyboardType: TextInputType.text,
|
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
autofocus: true,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
),
|
),
|
||||||
decoration: InputDecoration(
|
decoration: new InputDecoration(
|
||||||
contentPadding: EdgeInsets.all(8.0),
|
enabledBorder: UnderlineInputBorder(
|
||||||
enabledBorder: OutlineInputBorder(
|
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||||
borderRadius: BorderRadius.all(Radius.circular(12.0)),
|
focusedBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(color: Colors.grey[400], width: 1),
|
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Colors.grey[400],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|||||||
@@ -200,17 +200,9 @@ void showCommentDialog(BuildContext context, commentCallback(comment)) {
|
|||||||
|
|
||||||
Widget getStatus(String status) {
|
Widget getStatus(String status) {
|
||||||
return status == "Delivered"
|
return status == "Delivered"
|
||||||
? Chip(
|
? Text(status,
|
||||||
backgroundColor: Colors.green,
|
style: TextStyle(
|
||||||
avatar: Icon(
|
color: primaryColor, fontSize: 18, fontWeight: FontWeight.bold))
|
||||||
Icons.check,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 14,
|
|
||||||
),
|
|
||||||
label: Text(
|
|
||||||
status,
|
|
||||||
style: TextStyle(color: Colors.white, fontSize: 12),
|
|
||||||
))
|
|
||||||
: status == "rejected"
|
: status == "rejected"
|
||||||
? Chip(
|
? Chip(
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
@@ -224,17 +216,10 @@ Widget getStatus(String status) {
|
|||||||
style: TextStyle(color: Colors.white, fontSize: 12),
|
style: TextStyle(color: Colors.white, fontSize: 12),
|
||||||
))
|
))
|
||||||
: status == "In progress"
|
: status == "In progress"
|
||||||
? Chip(
|
? Text(
|
||||||
backgroundColor: Colors.red,
|
|
||||||
avatar: Icon(
|
|
||||||
Icons.timelapse,
|
|
||||||
color: Colors.white,
|
|
||||||
size: 14,
|
|
||||||
),
|
|
||||||
label: Text(
|
|
||||||
status,
|
status,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 12),
|
style: TextStyle(color: Colors.white, fontSize: 12),
|
||||||
))
|
)
|
||||||
: status == "Pickuped"
|
: status == "Pickuped"
|
||||||
? Text(
|
? Text(
|
||||||
status,
|
status,
|
||||||
@@ -409,7 +394,6 @@ Widget fcsInput(String label, IconData iconData,
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 50.0,
|
|
||||||
child: Row(children: <Widget>[
|
child: Row(children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
@@ -420,6 +404,7 @@ Widget fcsInput(String label, IconData iconData,
|
|||||||
decoration: new InputDecoration(
|
decoration: new InputDecoration(
|
||||||
contentPadding: EdgeInsets.only(top: 8),
|
contentPadding: EdgeInsets.only(top: 8),
|
||||||
labelText: label,
|
labelText: label,
|
||||||
|
labelStyle: TextStyle(fontSize: 14, color: Colors.grey),
|
||||||
enabledBorder: UnderlineInputBorder(
|
enabledBorder: UnderlineInputBorder(
|
||||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||||
focusedBorder: UnderlineInputBorder(
|
focusedBorder: UnderlineInputBorder(
|
||||||
|
|||||||
@@ -1,6 +1,25 @@
|
|||||||
class Shipment {
|
class Shipment {
|
||||||
DateTime shipDate;
|
DateTime shipDate;
|
||||||
String shipmentNumber;
|
String shipmentNumber;
|
||||||
|
DateTime cutoffDate;
|
||||||
|
String shipType;
|
||||||
|
DateTime arrivalDate;
|
||||||
|
DateTime departureDate;
|
||||||
|
String consignee;
|
||||||
|
String port;
|
||||||
|
String destination;
|
||||||
String status;
|
String status;
|
||||||
Shipment({this.shipDate, this.shipmentNumber,this.status});
|
String remark;
|
||||||
|
Shipment(
|
||||||
|
{this.shipDate,
|
||||||
|
this.shipmentNumber,
|
||||||
|
this.cutoffDate,
|
||||||
|
this.shipType,
|
||||||
|
this.status,
|
||||||
|
this.arrivalDate,
|
||||||
|
this.departureDate,
|
||||||
|
this.consignee,
|
||||||
|
this.port,
|
||||||
|
this.destination,
|
||||||
|
this.remark});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user