diff --git a/android/.project b/android/.project
new file mode 100644
index 0000000..3964dd3
--- /dev/null
+++ b/android/.project
@@ -0,0 +1,17 @@
+
+
+ android
+ Project android created by Buildship.
+
+
+
+
+ org.eclipse.buildship.core.gradleprojectbuilder
+
+
+
+
+
+ org.eclipse.buildship.core.gradleprojectnature
+
+
diff --git a/android/.settings/org.eclipse.buildship.core.prefs b/android/.settings/org.eclipse.buildship.core.prefs
new file mode 100644
index 0000000..d19d611
--- /dev/null
+++ b/android/.settings/org.eclipse.buildship.core.prefs
@@ -0,0 +1,13 @@
+arguments=
+auto.sync=false
+build.scans.enabled=false
+connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
+connection.project.dir=
+eclipse.preferences.version=1
+gradle.user.home=
+java.home=/usr/lib/jvm/java-8-openjdk-amd64
+jvm.arguments=
+offline.mode=false
+override.workspace.settings=true
+show.console.view=true
+show.executions.view=true
diff --git a/android/app/.classpath b/android/app/.classpath
new file mode 100644
index 0000000..eb19361
--- /dev/null
+++ b/android/app/.classpath
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/android/app/.project b/android/app/.project
new file mode 100644
index 0000000..ac485d7
--- /dev/null
+++ b/android/app/.project
@@ -0,0 +1,23 @@
+
+
+ app
+ Project app created by Buildship.
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.buildship.core.gradleprojectbuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+ org.eclipse.buildship.core.gradleprojectnature
+
+
diff --git a/android/app/.settings/org.eclipse.buildship.core.prefs b/android/app/.settings/org.eclipse.buildship.core.prefs
new file mode 100644
index 0000000..b1886ad
--- /dev/null
+++ b/android/app/.settings/org.eclipse.buildship.core.prefs
@@ -0,0 +1,2 @@
+connection.project.dir=..
+eclipse.preferences.version=1
diff --git a/assets/local/localization_en.json b/assets/local/localization_en.json
index ebed6b1..02e8e7a 100644
--- a/assets/local/localization_en.json
+++ b/assets/local/localization_en.json
@@ -493,6 +493,9 @@
"staff.update":"Update",
"shipment.title":"Shipments",
- "shipment.add":"New shipment"
+ "shipment.add":"New shipment",
+ "pickup.title": "Pickups",
+ "pickup.new": "New Pickup",
+ "pickup.edit.title": "Pickup"
}
\ No newline at end of file
diff --git a/assets/local/localization_mu.json b/assets/local/localization_mu.json
index 3c1f060..331fe37 100644
--- a/assets/local/localization_mu.json
+++ b/assets/local/localization_mu.json
@@ -526,5 +526,9 @@
"staff.update":"Update",
"shipment.title":"Shipments",
- "shipment.add":"New shipment"
+ "shipment.add":"New shipment",
+
+ "pickup.title": "Pickups",
+ "pickup.new": "New Pickup",
+ "pickup.edit.title": "Pickup"
}
\ No newline at end of file
diff --git a/assets/logo.jpg b/assets/logo.jpg
new file mode 100644
index 0000000..2df4aa2
Binary files /dev/null and b/assets/logo.jpg differ
diff --git a/lib/app.dart b/lib/app.dart
index 320de7a..613dabf 100644
--- a/lib/app.dart
+++ b/lib/app.dart
@@ -21,9 +21,11 @@ import 'model/employee_model.dart';
import 'model/language_model.dart';
import 'model/log_model.dart';
import 'model/main_model.dart';
+import 'model/pickup_model.dart';
import 'model/po_model.dart';
import 'model/product_model.dart';
import 'model/report_user_model.dart';
+import 'model/shipment_rate_model.dart';
import 'model/user_model.dart';
import 'pages/home_page.dart';
import 'pages/splash.dart';
@@ -59,6 +61,8 @@ class _AppState extends State {
final ReportModel reportModel = new ReportModel();
final AnnouncementModel announcementModel = new AnnouncementModel();
final ReportUserModel reportUserModel = new ReportUserModel();
+ final PickUpModel pickUpModel = new PickUpModel();
+ final ShipmentRateModel shipmentRateModel = new ShipmentRateModel();
AppTranslationsDelegate _newLocaleDelegate;
@@ -88,7 +92,9 @@ class _AppState extends State {
..addModel(announcementModel)
..addModel(reportModel)
..addModel(testModel)
- ..addModel(reportUserModel);
+ ..addModel(reportUserModel)
+ ..addModel(pickUpModel)
+ ..addModel(shipmentRateModel);
this.mainModel.init();
}
@@ -137,6 +143,8 @@ class _AppState extends State {
ChangeNotifierProvider(builder: (context) => reportModel),
ChangeNotifierProvider(builder: (context) => announcementModel),
ChangeNotifierProvider(builder: (context) => reportUserModel),
+ ChangeNotifierProvider(builder: (context) => pickUpModel),
+ ChangeNotifierProvider(builder: (context) => shipmentRateModel),
ChangeNotifierProvider(
builder: (context) => testModel,
),
diff --git a/lib/main-dev.dart b/lib/main-dev.dart
index 446fb23..0913770 100644
--- a/lib/main-dev.dart
+++ b/lib/main-dev.dart
@@ -6,7 +6,7 @@ import 'app.dart';
void main() {
Config(
- flavor: Flavor.DEV,
+ flavor: Flavor.PRODUCTION,
color: Colors.blue,
apiURL:
"https://asia-northeast1-mokkon-wholesale-dev.cloudfunctions.net/APIOK",
diff --git a/lib/model/pickup_model.dart b/lib/model/pickup_model.dart
new file mode 100644
index 0000000..08a2920
--- /dev/null
+++ b/lib/model/pickup_model.dart
@@ -0,0 +1,69 @@
+import 'dart:async';
+
+import 'package:cloud_firestore/cloud_firestore.dart';
+import 'package:fcs/vo/fcs_profile.dart';
+import 'package:fcs/vo/pickup.dart';
+import 'package:logging/logging.dart';
+
+import 'base_model.dart';
+
+class PickUpModel extends BaseModel {
+ final log = Logger('PickUpModel');
+
+ StreamSubscription listener;
+
+ var profile = FCSProfile(
+ id: '1',
+ usaAddress: '154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247',
+ mmAddress: 'FCS Trading Myanmar\nRoom 333, Yangon',
+ usaContactNumber: '1 (929) 215-2247',
+ mmContactNumber: '+95 9 700224723',
+ mail: 'admin@fcs.com',
+ facebook: 'https://facebook.com/fcs');
+
+ List pickups = [
+ PickUp(
+ id: "P200412 - 12 Apr 2020",
+ userName: "Ko Kyaw Nyi",
+ phoneNumber: '+959111111111',
+ fromTime: '1PM',
+ toTime: '3PM',
+ numberOfPackage: 5,
+ weight: 25,
+ status: 'pickup',
+ address:
+ '154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
+ PickUp(
+ id: "P200125 - 12 May 2020",
+ userName: "Ko Kyaw Nyi",
+ phoneNumber: '+959111111111',
+ fromTime: '1PM',
+ toTime: '3PM',
+ numberOfPackage: 5,
+ weight: 25,
+ status: 'pickup',
+ address:
+ '154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
+ PickUp(
+ id: "P200441 - 13 Apr 2020",
+ userName: "Ko Kyaw Nyi",
+ phoneNumber: '+959111111111',
+ fromTime: '1PM',
+ toTime: '3PM',
+ numberOfPackage: 5,
+ weight: 25,
+ status: "delivered",
+ address:
+ '154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
+ ];
+
+ void initUser(user) {
+ super.initUser(user);
+ }
+
+ @override
+ logout() async {
+ if (listener != null) await listener.cancel();
+ pickups = [];
+ }
+}
diff --git a/lib/model/shipment_rate_model.dart b/lib/model/shipment_rate_model.dart
new file mode 100644
index 0000000..0df3e3e
--- /dev/null
+++ b/lib/model/shipment_rate_model.dart
@@ -0,0 +1,34 @@
+import 'dart:async';
+
+import 'package:cloud_firestore/cloud_firestore.dart';
+import 'package:fcs/vo/rate.dart';
+import 'package:logging/logging.dart';
+
+import 'base_model.dart';
+
+class ShipmentRateModel extends BaseModel {
+ final log = Logger('ShipmentRateModel');
+
+ StreamSubscription listener;
+
+ List rates = [
+ Rate(
+ id: '1', name: 'general_cargo', description: 'General Cargo', price: 6),
+ Rate(id: '2', name: 'medicine', description: 'Medicine', price: 7),
+ Rate(
+ id: '3',
+ name: 'dangerous_cargo',
+ description: 'Dangerous Cargo',
+ price: 8),
+ ];
+
+ void initUser(user) {
+ super.initUser(user);
+ }
+
+ @override
+ logout() async {
+ if (listener != null) await listener.cancel();
+ rates = [];
+ }
+}
diff --git a/lib/pages/calculate_shipment_cost_editor.dart b/lib/pages/calculate_shipment_cost_editor.dart
new file mode 100644
index 0000000..955191c
--- /dev/null
+++ b/lib/pages/calculate_shipment_cost_editor.dart
@@ -0,0 +1,255 @@
+import 'package:fcs/model/pickup_model.dart';
+import 'package:fcs/vo/pickup.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 CalculateShipmentCostEditor extends StatefulWidget {
+ final PickUp pickUp;
+ CalculateShipmentCostEditor({this.pickUp});
+
+ @override
+ _CalculateShipmentCostEditorState createState() => _CalculateShipmentCostEditorState();
+}
+
+class _CalculateShipmentCostEditorState extends State {
+ TextEditingController _addressEditingController = new TextEditingController();
+ TextEditingController _fromTimeEditingController =
+ new TextEditingController();
+ TextEditingController _toTimeEditingController = new TextEditingController();
+ TextEditingController _noOfPackageEditingController =
+ new TextEditingController();
+ TextEditingController _weightEditingController = new TextEditingController();
+
+ PickUp _pickUp;
+ bool _isLoading = false;
+
+ @override
+ void initState() {
+ super.initState();
+ if (widget.pickUp != null) {
+ _pickUp = widget.pickUp;
+ _addressEditingController.text = _pickUp.address;
+ _fromTimeEditingController.text = _pickUp.fromTime;
+ _toTimeEditingController.text = _pickUp.toTime;
+ _noOfPackageEditingController.text = _pickUp.numberOfPackage.toString();
+ _weightEditingController.text = _pickUp.weight.toString();
+ }
+ }
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ var pickupModel = Provider.of(context);
+
+ final pickUpAddress = Container(
+ child: TextFormField(
+ maxLines: null,
+ controller: _addressEditingController,
+ cursorColor: primaryColor,
+ style: textStyle,
+ decoration: new InputDecoration(
+ labelText: 'Pickup Address',
+ enabledBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ focusedBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ ),
+ ));
+
+ final pickupTime = Container(
+ height: 50.0,
+ child: Row(children: [
+ Container(
+ width: 70.0,
+ child: TextFormField(
+ controller: _fromTimeEditingController,
+ cursorColor: primaryColor,
+ textAlign: TextAlign.left,
+ decoration: InputDecoration(
+ contentPadding: EdgeInsets.all(10.0),
+ enabledBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.grey[300], width: 2),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderSide: const BorderSide(color: primaryColor, width: 2.0),
+ ),
+ ),
+ )),
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Text(' to '),
+ ),
+ Container(
+ width: 70.0,
+ child: TextFormField(
+ controller: _toTimeEditingController,
+ cursorColor: primaryColor,
+ textAlign: TextAlign.left,
+ decoration: InputDecoration(
+ contentPadding: EdgeInsets.all(10.0),
+ enabledBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.grey[300], width: 2),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderSide: const BorderSide(color: primaryColor, width: 2.0),
+ ),
+ ),
+ )),
+ ]),
+ );
+
+ final noOfPackageBox = Container(
+ height: 50.0,
+ child: Row(children: [
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Text('Number of Packages '),
+ ),
+ Expanded(
+ child: TextFormField(
+ controller: _noOfPackageEditingController,
+ cursorColor: primaryColor,
+ textAlign: TextAlign.left,
+ decoration: InputDecoration(
+ contentPadding: EdgeInsets.all(10.0),
+ enabledBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.grey[300], width: 2),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderSide: const BorderSide(color: primaryColor, width: 2.0),
+ ),
+ ),
+ )),
+ ]),
+ );
+
+ final weightBox = Container(
+ height: 50.0,
+ child: Row(children: [
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Text('Total Weight (lb) '),
+ ),
+ Expanded(
+ child: TextFormField(
+ controller: _weightEditingController,
+ cursorColor: primaryColor,
+ textAlign: TextAlign.left,
+ decoration: InputDecoration(
+ contentPadding: EdgeInsets.all(10.0),
+ enabledBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.grey[300], width: 2),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderSide: const BorderSide(color: primaryColor, width: 2.0),
+ ),
+ ),
+ )),
+ ]),
+ );
+
+ return LocalProgress(
+ inAsyncCall: _isLoading,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: primaryColor,
+ title: Text(AppTranslations.of(context).text("pickup.edit.title")),
+ ),
+ body: Card(
+ child: Column(
+ children: [
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.all(20.0),
+ child: ListView(children: [
+ Text(
+ "U Aung Zaw",
+ style: TextStyle(fontSize: 15.0),
+ ),
+ Text(
+ "+82054857695",
+ style: TextStyle(fontSize: 15.0),
+ ),
+ pickUpAddress,
+ SizedBox(height: 15),
+ Text('Pickup Time'),
+ SizedBox(height: 15),
+ pickupTime,
+ SizedBox(height: 15),
+ noOfPackageBox,
+ SizedBox(height: 15),
+ weightBox
+ ]),
+ )),
+ widget.pickUp == null
+ ? Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius: new BorderRadius.circular(10)),
+ child: Text('Request'),
+ color: primaryColor,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ )))
+ : Container(
+ child: Column(
+ children: [
+ Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius:
+ new BorderRadius.circular(10)),
+ child: Text('Pickuped'),
+ color: primaryColor,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ ))),
+ Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius:
+ new BorderRadius.circular(10)),
+ child: Text('Cancel'),
+ color: primaryColor,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ )))
+ ],
+ ))
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/pages/fcs_profile_page.dart b/lib/pages/fcs_profile_page.dart
new file mode 100644
index 0000000..26cc8a9
--- /dev/null
+++ b/lib/pages/fcs_profile_page.dart
@@ -0,0 +1,201 @@
+import 'package:fcs/model/pickup_model.dart';
+import 'package:fcs/vo/pickup.dart';
+import 'package:fcs/widget/fcs_text_field.dart';
+import 'package:provider/provider.dart';
+
+import 'package:flutter/material.dart';
+import 'package:fcs/widget/progress.dart';
+
+import '../theme/theme.dart';
+
+class FCSProfilePage extends StatefulWidget {
+ final PickUp pickUp;
+ FCSProfilePage({this.pickUp});
+
+ @override
+ _FCSProfilePageState createState() => _FCSProfilePageState();
+}
+
+class _FCSProfilePageState extends State {
+ TextEditingController _usaAddressEditingController =
+ new TextEditingController();
+ TextEditingController _mmAddressEditingController =
+ new TextEditingController();
+ TextEditingController _contactEditingController = new TextEditingController();
+ TextEditingController _mmContactEditingController =
+ new TextEditingController();
+ TextEditingController _mailEditingController = new TextEditingController();
+ TextEditingController _fbLinkEditingController = new TextEditingController();
+
+ PickUp _pickUp;
+ bool _isLoading = false;
+
+ @override
+ void initState() {
+ super.initState();
+ var pickupModel = Provider.of(context, listen: false);
+ _usaAddressEditingController.text = pickupModel.profile.usaAddress;
+ _mmAddressEditingController.text = pickupModel.profile.mmAddress;
+ _contactEditingController.text = pickupModel.profile.usaContactNumber;
+ _mmContactEditingController.text = pickupModel.profile.mmContactNumber;
+ _mailEditingController.text = pickupModel.profile.mail;
+ _fbLinkEditingController.text = pickupModel.profile.facebook;
+ }
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final usaAddress = Container(
+ child: FCSTextField(
+ controller: _usaAddressEditingController,
+ label: 'USA Delivery Address',
+ ));
+
+ final mmAddress = Container(
+ height: 50.0,
+ child: Row(children: [
+ Expanded(
+ child: FCSTextField(
+ controller: _mmAddressEditingController,
+ label: 'Yangon, Myanmar Office',
+ )),
+ ]),
+ );
+
+ final contactNumber = Container(
+ height: 50.0,
+ child: Row(children: [
+ Expanded(
+ child: FCSTextField(
+ controller: _contactEditingController,
+ label: 'USA contact number',
+ )),
+ ]),
+ );
+
+ final mmContactNumber = Container(
+ height: 50.0,
+ child: Row(children: [
+ Expanded(
+ child: FCSTextField(
+ controller: _mmContactEditingController,
+ label: 'Myanmar contact number',
+ )),
+ ]),
+ );
+
+ final mailBox = Container(
+ height: 50.0,
+ child: Row(children: [
+ Expanded(
+ child: FCSTextField(
+ controller: _mailEditingController,
+ label: 'Email Address',
+ )),
+ ]),
+ );
+
+ final fbLinkBox = Container(
+ height: 50.0,
+ child: Row(children: [
+ Expanded(
+ child: FCSTextField(
+ controller: _fbLinkEditingController, label: ' Facebook Link')),
+ ]),
+ );
+
+ return LocalProgress(
+ inAsyncCall: _isLoading,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: primaryColor,
+ title: Text('Profile'),
+ ),
+ body: Card(
+ child: Column(
+ children: [
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.all(20.0),
+ child: ListView(children: [
+ usaAddress,
+ SizedBox(height: 15),
+ mmAddress,
+ SizedBox(height: 15),
+ contactNumber,
+ SizedBox(height: 15),
+ mmContactNumber,
+ SizedBox(height: 15),
+ mailBox,
+ SizedBox(height: 15),
+ fbLinkBox,
+ SizedBox(height: 15),
+ ]),
+ )),
+ widget.pickUp == null
+ ? Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius: new BorderRadius.circular(10)),
+ child: Text('Update'),
+ color: primaryColor,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ )))
+ : Container(
+ child: Column(
+ children: [
+ Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius:
+ new BorderRadius.circular(10)),
+ child: Text('Pickuped'),
+ color: primaryColor,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ ))),
+ Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius:
+ new BorderRadius.circular(10)),
+ child: Text('Cancel'),
+ color: primaryColor,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ )))
+ ],
+ ))
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart
index 7e1197c..14d6518 100644
--- a/lib/pages/home_page.dart
+++ b/lib/pages/home_page.dart
@@ -4,6 +4,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:intl/intl.dart';
import 'package:logging/logging.dart';
import 'package:provider/provider.dart';
+import 'dart:math' as math;
import 'package:fcs/charts/bar_chart.dart';
import 'package:fcs/charts/delivery_do_line.dart';
import 'package:fcs/charts/delivery_do_summary.dart';
@@ -12,30 +13,28 @@ import 'package:fcs/charts/delivery_summary.dart';
import 'package:fcs/charts/do_line.dart';
import 'package:fcs/charts/po_balance_chart.dart';
import 'package:fcs/charts/po_line.dart';
-import 'package:fcs/charts/quota.dart';
import 'package:fcs/charts/revenue_line.dart';
import 'package:fcs/model/language_model.dart';
-import 'package:fcs/model/main_model.dart';
-import 'package:fcs/model/notification_model.dart';
import 'package:fcs/model/product_model.dart';
import 'package:fcs/pages/banks/banks.dart';
import 'package:fcs/pages/buyer_list.dart';
import 'package:fcs/pages/contact.dart';
import 'package:fcs/pages/delivery/delivery_list.dart';
import 'package:fcs/pages/manual/manual_page.dart';
-import 'package:fcs/pages/my_registeration_info.dart';
import 'package:fcs/pages/notification_list.dart';
import 'package:fcs/pages/term.dart';
-import 'package:fcs/pages/test_list.dart';
-import 'package:fcs/pages/util.dart';
import 'package:fcs/reports/report_list.dart';
-import 'package:fcs/vo/user.dart';
-import 'package:fcs/widget/badge.dart';
import 'package:fcs/widget/banner.dart';
import 'package:fcs/widget/local_text.dart';
import 'package:fcs/widget/localization/app_translations.dart';
import 'package:fcs/widget/offline_redirect.dart';
-import 'package:fcs/vo/notification.dart' as Noti;
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
+import 'package:font_awesome_flutter/font_awesome_flutter.dart';
+import 'package:intl/intl.dart';
+import 'package:logging/logging.dart';
+import 'package:provider/provider.dart';
import '../theme/theme.dart';
import 'announcement_list.dart';
@@ -48,6 +47,13 @@ import 'products_list.dart';
import 'profile_page.dart';
import 'signin_page.dart';
import 'staff_list.dart';
+
+import 'fcs_profile_page.dart';
+import 'pd/pd_list.dart';
+import 'pickup_list.dart';
+import 'products_list.dart';
+import 'profile_page.dart';
+import 'shipment_rates.dart';
import 'storage/storage_list.dart';
import 'user_list.dart';
@@ -85,7 +91,8 @@ class _HomePageState extends State {
@override
Widget build(BuildContext context) {
- final helpBtn = _buildBtn("manual.title",
+ final helpBtn = _buildBtn2("manual.title",
+ icon: FontAwesomeIcons.readme,
imgIcon: Image.asset(
"assets/manual.png",
width: 40,
@@ -97,7 +104,7 @@ class _HomePageState extends State {
// btnCallback: () => Navigator.of(context)
// .push(MaterialPageRoute(builder: (_) => TestList()))
);
- final announcementBtn = _buildBtn("announcement.title",
+ final announcementBtn = _buildBtn2("announcement.title",
icon: Icons.announcement,
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => AnnouncementList())));
@@ -112,7 +119,8 @@ class _HomePageState extends State {
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => BuyerList())));
- final reportBtn = _buildBtn("report.title",
+ final reportBtn = _buildBtn2("report.title",
+ icon: FontAwesomeIcons.paperPlane,
imgIcon: Image.asset(
"assets/report.png",
width: 50,
@@ -122,6 +130,30 @@ class _HomePageState extends State {
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => ReportList())));
+ final pickUpBtn = _buildBtn("pickup.title",
+ icon: FontAwesomeIcons.directions,
+ btnCallback: () => Navigator.of(context)
+ .push(MaterialPageRoute(builder: (_) => PickUpList())));
+
+ final shipmentCostBtn = _buildBtn("pickup.title",
+ icon: FontAwesomeIcons.ship,
+ btnCallback: () => Navigator.of(context)
+ .push(MaterialPageRoute(builder: (_) => ShipmentRates())));
+
+ final fcsProfileBtn = _buildBtn("profile.title",
+ icon: Icons.account_circle,
+ btnCallback: () => Navigator.of(context)
+ .push(MaterialPageRoute(builder: (_) => FCSProfilePage())));
+
+ final myRegBtn = _buildBtn("myreg.title",
+ imgIcon: Image.asset(
+ "assets/reg.png",
+ width: 40,
+ height: 30,
+ color: primaryColor,
+ ),
+ btnCallback: () async {});
+
final posBtn = _buildBtn("po.title",
imgIcon: Image.asset(
"assets/pay.png",
@@ -171,7 +203,9 @@ class _HomePageState extends State {
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => PDList())));
- final termBtn = _buildBtn("term.title",
+
+ final termBtn = _buildBtn2("term.title",
+ icon: FontAwesomeIcons.fileContract,
imgIcon: Image.asset(
"assets/term.png",
width: 40,
@@ -220,7 +254,8 @@ class _HomePageState extends State {
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => StaffList())));
- final _bankAccountsBtn = _buildBtn("banks.title",
+
+ final _bankAccountsBtn = _buildBtn2("banks.title",
icon: FontAwesomeIcons.moneyCheck, btnCallback: () {
Navigator.push(
context,
@@ -235,6 +270,13 @@ class _HomePageState extends State {
widgets.add(notiBtn);
widgets.add(staffBtn);
// widgets.add(_bankAccountsBtn);
+ widgets.add(announcementBtn);
+ widgets.add(pickUpBtn);
+ widgets.add(fcsProfileBtn);
+ widgets.add(shipmentCostBtn);
+ widgets.add(reportBtn);
+ widgets.add(termBtn);
+ widgets.add(_bankAccountsBtn);
var revenueChart = Padding(
padding: const EdgeInsets.all(10.0),
@@ -343,10 +385,11 @@ class _HomePageState extends State {
child: FlavorBanner(
child: Scaffold(
appBar: AppBar(
+ elevation: 0,
backgroundColor: primaryColor,
title: ClipRRect(
- child: Image.asset("assets/logo.png", height: 40),
- borderRadius: new BorderRadius.circular(15.0),
+ child: Image.asset("assets/logo.jpg", height: 40),
+ borderRadius: new BorderRadius.circular(35.0),
),
actions: [
IconButton(
@@ -357,7 +400,7 @@ class _HomePageState extends State {
);
},
iconSize: 30,
- icon: Icon(Icons.phone),
+ icon: Icon(Icons.notifications),
),
IconButton(
onPressed: () {
@@ -367,53 +410,99 @@ class _HomePageState extends State {
);
},
iconSize: 30,
- icon: Icon(Icons.account_circle),
+ icon: Icon(Icons.tune),
),
]),
- body: StaggeredGridView.count(
- crossAxisCount: 3,
- crossAxisSpacing: 12.0,
- mainAxisSpacing: 12.0,
- padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
- children: [
- _buildTile(
- Padding(
- padding: const EdgeInsets.all(20.0),
- child: productListBox,
- ),
- onTap: () => Navigator.of(context)
- .push(MaterialPageRoute(builder: (_) => ProductsList())),
- ),
- new GridView.count(
- shrinkWrap: true,
- scrollDirection: Axis.horizontal,
- crossAxisCount: 1,
- crossAxisSpacing: 12,
- mainAxisSpacing: 12,
- padding: EdgeInsets.only(bottom: 5, left: 10, right: 5),
- children: widgets,
- ),
- _buildTile(
- PageView(
- children: chartWidgets,
+ body: Container(
+ decoration: BoxDecoration(
+ gradient:
+ // RadialGradient(
+ // center: const Alignment(-0.7, 0.6), // near the top right
+ // radius: 0.6,
+ // colors: [
+ // secondaryColor,
+ // primaryColor, // yellow sun
+ // ],
+ // stops: [0.4, 1.0],
+ // )
+ // LinearGradient(
+ // begin: Alignment.topCenter,
+ // end: Alignment
+ // .bottomCenter, // 10% of the width, so there are ten blinds.
+ // colors: [
+ // Color(0xd0272262),
+ // Color(0xfa272262),
+ // ], // whitish to gray
+ // ),
+ SweepGradient(
+ center: FractionalOffset.centerLeft,
+ startAngle: 0.0,
+ endAngle: math.pi * 2,
+ colors: const [
+ secondaryColor,
+ primaryColor,
+ secondaryColor,
+ primaryColor,
+ secondaryColor,
+ ],
+ stops: const [0.0, 0.25, 0.5, 0.75, 1.0],
),
),
- ],
- staggeredTiles: [
- StaggeredTile.extent(5, 110.0),
- StaggeredTile.extent(3, 110.0),
- StaggeredTile.extent(3, 250.0),
- ],
- )),
+ child: ListView(children: [
+ Wrap(
+ children: widgets,
+ ),
+ ])
+ // child: StaggeredGridView.count(
+ // crossAxisCount: 3,
+ // crossAxisSpacing: 12.0,
+ // mainAxisSpacing: 12.0,
+ // padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
+ // children: [
+ // _buildTile(
+ // Padding(
+ // padding: const EdgeInsets.all(20.0),
+ // child: productListBox,
+ // ),
+ // onTap: () => Navigator.of(context).push(
+ // MaterialPageRoute(builder: (_) => ProductsList())),
+ // ),
+ // new GridView.count(
+ // shrinkWrap: true,
+ // scrollDirection: Axis.horizontal,
+ // crossAxisCount: 1,
+ // crossAxisSpacing: 12,
+ // mainAxisSpacing: 12,
+ // padding: EdgeInsets.only(bottom: 5, left: 10, right: 5),
+ // children: widgets,
+ // ),
+ // Container(
+ // color:Colors.red
+ // ),
+
+ // _buildTile(
+ // PageView(
+ // children: chartWidgets,
+ // ),
+ // ),
+ // ],
+ // staggeredTiles: [
+ // StaggeredTile.extent(5, 110.0),
+ // StaggeredTile.extent(3, 110.0),
+ // StaggeredTile.extent(3, 250.0),
+ // ],
+ // ),
+ )),
),
);
}
Widget _buildTile(Widget child, {Function() onTap}) {
return Material(
- elevation: 30.0,
+ elevation: 0,
borderRadius: BorderRadius.circular(12.0),
- shadowColor: Color(0x802196F3),
+ // shadowColor: Colors.transparent,
+ color: Colors.transparent,
child: InkWell(
onTap: onTap != null
? () => onTap()
@@ -460,12 +549,57 @@ class _HomePageState extends State {
);
}
- _showNotifications() async {
- if (!super.mounted) return;
- await Navigator.push(
- context,
- MaterialPageRoute(builder: (context) => NotificationList()),
+ Widget _buildBtn2(String title,
+ {Image imgIcon, IconData icon, BtnCallback btnCallback}) {
+ var languageModel = Provider.of(context);
+ return Container(
+ width: 130,
+ height: 130,
+ decoration: new BoxDecoration(
+ color: Colors.transparent, //new Color.fromRGBO(255, 0, 0, 0.0),
+ borderRadius: new BorderRadius.only(
+ topLeft: const Radius.circular(40.0),
+ topRight: const Radius.circular(40.0))),
+ // color: Colors.transparent,
+ child: Padding(
+ padding: const EdgeInsets.all(5.0),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ // Padding(
+ // padding: EdgeInsets.only(top: 10),
+ // child: Icon(icon, color: Colors.white, size: 35.0)),
+ // Padding(padding: EdgeInsets.only(bottom: 10.0)),
+ ClipOval(
+ child: Material(
+ color: Colors.white, // button color
+ child: InkWell(
+ splashColor: secondaryColor, // inkwell color
+ child: SizedBox(
+ width: 60, height: 60, child: Icon(icon, size: 35)),
+ onTap: btnCallback,
+ ),
+ ),
+ ),
+
+ Text(AppTranslations.of(context).text(title),
+ style:
+ // languageModel.isEng
+ // ?
+ TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.normal,
+ fontSize: 16.0,
+ fontFamily: "Roboto")
+ // : TextStyle(
+ // color: Colors.black,
+ // fontWeight: FontWeight.w700,
+ // fontSize: 12.0,
+ // fontFamily: "MyanmarUnicode")
+ ),
+ ]),
+ ),
);
- // Provider.of(context, listen: false).seen();
}
}
diff --git a/lib/pages/pickup_editor.dart b/lib/pages/pickup_editor.dart
new file mode 100644
index 0000000..8e6e103
--- /dev/null
+++ b/lib/pages/pickup_editor.dart
@@ -0,0 +1,237 @@
+import 'package:fcs/model/pickup_model.dart';
+import 'package:fcs/vo/pickup.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 PickUpEditor extends StatefulWidget {
+ final PickUp pickUp;
+ PickUpEditor({this.pickUp});
+
+ @override
+ _PickUpEditorState createState() => _PickUpEditorState();
+}
+
+class _PickUpEditorState extends State {
+ TextEditingController _addressEditingController = new TextEditingController();
+ TextEditingController _fromTimeEditingController =
+ new TextEditingController();
+ TextEditingController _toTimeEditingController = new TextEditingController();
+ TextEditingController _noOfPackageEditingController =
+ new TextEditingController();
+ TextEditingController _weightEditingController = new TextEditingController();
+
+ PickUp _pickUp;
+ bool _isLoading = false;
+
+ @override
+ void initState() {
+ super.initState();
+ if (widget.pickUp != null) {
+ _pickUp = widget.pickUp;
+ _addressEditingController.text = _pickUp.address;
+ _fromTimeEditingController.text = _pickUp.fromTime;
+ _toTimeEditingController.text = _pickUp.toTime;
+ _noOfPackageEditingController.text = _pickUp.numberOfPackage.toString();
+ _weightEditingController.text = _pickUp.weight.toString();
+ }
+ }
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ var pickupModel = Provider.of(context);
+
+ final pickUpAddress = Container(
+ child: TextFormField(
+ maxLines: null,
+ controller: _addressEditingController,
+ cursorColor: primaryColor,
+ style: textStyle,
+ decoration: new InputDecoration(
+ labelText: 'Pickup Address',
+ enabledBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ focusedBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ ),
+ ));
+
+ final pickupTime = Container(
+ height: 50.0,
+ child: Row(children: [
+ Container(
+ width: 70.0,
+ child: TextFormField(
+ controller: _fromTimeEditingController,
+ cursorColor: primaryColor,
+ decoration: new InputDecoration(
+ labelText: 'From',
+ enabledBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ focusedBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ ),
+ )),
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Text(' - '),
+ ),
+ Container(
+ width: 70.0,
+ child: TextFormField(
+ controller: _toTimeEditingController,
+ cursorColor: primaryColor,
+ decoration: new InputDecoration(
+ labelText: 'To',
+ enabledBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ focusedBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ ),
+ )),
+ ]),
+ );
+
+ final noOfPackageBox = Container(
+ height: 50.0,
+ child: Row(children: [
+ Expanded(
+ child: TextFormField(
+ controller: _noOfPackageEditingController,
+ cursorColor: primaryColor,
+ textAlign: TextAlign.left,
+ decoration: new InputDecoration(
+ labelText: 'Number of Packages',
+ enabledBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ focusedBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ ),
+ )),
+ ]),
+ );
+
+ final weightBox = Container(
+ height: 50.0,
+ child: Row(children: [
+ Expanded(
+ child: TextFormField(
+ controller: _weightEditingController,
+ cursorColor: primaryColor,
+ textAlign: TextAlign.left,
+ decoration: new InputDecoration(
+ labelText: 'Total Weight (lb)',
+ enabledBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ focusedBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ ),
+ )),
+ ]),
+ );
+
+ return LocalProgress(
+ inAsyncCall: _isLoading,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: primaryColor,
+ title: Text(AppTranslations.of(context).text("pickup.edit.title")),
+ ),
+ body: Card(
+ child: Column(
+ children: [
+ Expanded(
+ child: Padding(
+ padding: const EdgeInsets.all(20.0),
+ child: ListView(children: [
+ Text(
+ "U Aung Zaw",
+ style: TextStyle(fontSize: 15.0),
+ ),
+ Text(
+ "+82054857695",
+ style: TextStyle(fontSize: 15.0),
+ ),
+ pickUpAddress,
+ SizedBox(height: 15),
+ Text('Pickup Time'),
+ SizedBox(height: 15),
+ pickupTime,
+ SizedBox(height: 15),
+ noOfPackageBox,
+ SizedBox(height: 15),
+ weightBox
+ ]),
+ )),
+ widget.pickUp == null
+ ? Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius: new BorderRadius.circular(10)),
+ child: Text('Request'),
+ color: primaryColor,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ )))
+ : Container(
+ child: Column(
+ children: [
+ Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius:
+ new BorderRadius.circular(10)),
+ child: Text('Pickuped'),
+ color: primaryColor,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ ))),
+ Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius:
+ new BorderRadius.circular(10)),
+ child: Text('Cancel'),
+ color: Colors.blue,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ )))
+ ],
+ ))
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/pages/pickup_list.dart b/lib/pages/pickup_list.dart
new file mode 100644
index 0000000..8f2f414
--- /dev/null
+++ b/lib/pages/pickup_list.dart
@@ -0,0 +1,170 @@
+import 'package:fcs/model/pickup_model.dart';
+import 'package:fcs/pages/pickup_list_row.dart';
+import 'package:provider/provider.dart';
+import 'package:fcs/model/buyer_model.dart';
+import 'package:fcs/pages/search_page.dart';
+import 'package:fcs/vo/buyer.dart';
+import 'package:fcs/vo/popup_menu.dart';
+import 'package:fcs/widget/localization/app_translations.dart';
+import 'package:fcs/widget/popupmenu.dart';
+
+import 'package:flutter/material.dart';
+import 'package:fcs/widget/progress.dart';
+
+import '../theme/theme.dart';
+import '../theme/theme.dart';
+import '../theme/theme.dart';
+import 'buyer_list_row.dart';
+import 'pickup_editor.dart';
+
+class PickUpList extends StatefulWidget {
+ @override
+ _PickUpListState createState() => _PickUpListState();
+}
+
+class _PickUpListState extends State {
+ Buyer buyer;
+ bool _isLoading = false;
+
+ @override
+ void initState() {
+ super.initState();
+ }
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ var pickupModel = Provider.of(context);
+
+ return LocalProgress(
+ inAsyncCall: _isLoading,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: primaryColor,
+ title: Text(AppTranslations.of(context).text("pickup.title")),
+ actions: [
+ IconButton(
+ icon: Icon(
+ Icons.search,
+ color: Colors.white,
+ ),
+ iconSize: 30,
+ onPressed: () => showPlacesSearch(context),
+ ),
+ PopupMenuButton(
+ elevation: 3.2,
+ onSelected: (selected) {},
+ icon: Container(
+ width: 30,
+ height: 30,
+ decoration: new BoxDecoration(
+ shape: BoxShape.circle,
+ color: Colors.white,
+ ),
+ child: Stack(
+ fit: StackFit.expand,
+ children: [
+ Icon(
+ Icons.sort,
+ color: primaryColor,
+ ),
+ ],
+ )),
+ itemBuilder: (BuildContext context) {
+ return userMenu.map((PopupMenu choice) {
+ return PopupMenuItem(
+ value: choice,
+ child: Container(
+ padding: EdgeInsets.only(left: 8),
+ child: Row(
+ children: [
+ Text(choice.status),
+ SizedBox(
+ width: 10,
+ ),
+ ],
+ ),
+ ),
+ );
+ }).toList();
+ }),
+ PopupMenuButton(
+ elevation: 3.2,
+ onSelected: (selected) {
+ String status;
+ },
+ icon: Container(
+ width: 30,
+ height: 30,
+ decoration: new BoxDecoration(
+ shape: BoxShape.circle,
+ color: Colors.white,
+ ),
+ child: Stack(
+ fit: StackFit.expand,
+ children: [
+ Icon(
+ Icons.filter_list,
+ color: primaryColor,
+ ),
+ ],
+ )),
+ itemBuilder: (BuildContext context) {
+ return buyerStatusMenu.map((PopupMenu choice) {
+ return PopupMenuItem(
+ value: choice,
+ child: Row(
+ children: [
+ Text(choice.status),
+ SizedBox(
+ width: 10,
+ ),
+ ],
+ ),
+ );
+ }).toList();
+ }),
+ ],
+ ),
+ body: Column(
+ children: [
+ Expanded(
+ child: new ListView.builder(
+ scrollDirection: Axis.vertical,
+ padding: EdgeInsets.only(top: 15),
+ shrinkWrap: true,
+ itemCount: pickupModel.pickups.length,
+ itemBuilder: (BuildContext context, int index) {
+ return PickupListRow(pickUp: pickupModel.pickups[index]);
+ }),
+ ),
+ Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius: new BorderRadius.circular(10)),
+ child: Text(AppTranslations.of(context).text("pickup.new")),
+ color: primaryColor,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (context) => new PickUpEditor()),
+ );
+ },
+ ),
+ )))
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/pages/pickup_list_row.dart b/lib/pages/pickup_list_row.dart
new file mode 100644
index 0000000..c8a9890
--- /dev/null
+++ b/lib/pages/pickup_list_row.dart
@@ -0,0 +1,117 @@
+import 'package:fcs/model/pickup_model.dart';
+import 'package:fcs/pages/pickup_editor.dart';
+import 'package:fcs/vo/pickup.dart';
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+import 'package:fcs/model/buyer_model.dart';
+import 'package:fcs/pages/util.dart';
+import 'package:fcs/theme/theme.dart';
+import 'package:fcs/vo/buyer.dart';
+
+import 'buyer_info.dart';
+
+class PickupListRow extends StatefulWidget {
+ final PickUp pickUp;
+ const PickupListRow({this.pickUp});
+
+ @override
+ _PickupListRowState createState() => _PickupListRowState();
+}
+
+class _PickupListRowState extends State {
+ final double dotSize = 15.0;
+ PickUp _pickUp = new PickUp();
+
+ @override
+ void initState() {
+ super.initState();
+ // PickUpModel pickUpModel = Provider.of(context, listen: false);
+ if (widget.pickUp != null) {
+ _pickUp = widget.pickUp;
+ // pickUpModel.pickups.forEach((b) {
+ // if (widget.pickUp.id == b.id) {
+ // _pickUp = b;
+ // }
+ // });
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ print('_pickup $_pickUp');
+ return Container(
+ padding: EdgeInsets.only(left: 15, right: 15),
+ child: Card(
+ elevation: 10,
+ color: Colors.white,
+ child: InkWell(
+ onTap: () {
+ Navigator.push(
+ context,
+ MaterialPageRoute(
+ builder: (context) => PickUpEditor(pickUp: _pickUp)),
+ );
+ },
+ child: Row(
+ children: [
+ Expanded(
+ child: new Padding(
+ padding: const EdgeInsets.symmetric(vertical: 16.0),
+ child: new Row(
+ children: [
+ new Expanded(
+ child: new Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding(
+ padding: const EdgeInsets.only(left: 8.0),
+ child: new Text(
+ _pickUp.id == null ? '' : _pickUp.id,
+ style: new TextStyle(
+ fontSize: 15.0, color: Colors.black),
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.only(left: 8.0),
+ child: Row(
+ children: [
+ new Text(
+ _pickUp.weight == null
+ ? ''
+ : _pickUp.weight.toString() + 'lb - ',
+ style: new TextStyle(
+ fontSize: 15.0, color: Colors.grey),
+ ),
+ new Text(
+ _pickUp.numberOfPackage == null
+ ? ""
+ : _pickUp.numberOfPackage.toString() +
+ ' packages',
+ style: new TextStyle(
+ fontSize: 15.0, color: Colors.grey),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ Row(
+ children: [
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: getStatus(_pickUp.status),
+ ),
+ ],
+ )
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/pages/profile_page.dart b/lib/pages/profile_page.dart
index a0e0c83..b7ec792 100644
--- a/lib/pages/profile_page.dart
+++ b/lib/pages/profile_page.dart
@@ -94,6 +94,7 @@ class _ProfileState extends State {
],
),
));
+
final phonenumberbox = Container(
height: 45.0,
child: Row(
@@ -319,6 +320,14 @@ class _ProfileState extends State {
languageBox,
logoutbutton,
Divider(color: secondaryColor),
+ Switch(
+ value: false,
+ onChanged: (value) {
+ setState(() {});
+ },
+ // activeTrackColor: Colors.lightGreenAccent,
+ // activeColor: Colors.green,
+ ),
versionbox,
SizedBox(
height: 20,
@@ -332,7 +341,7 @@ class _ProfileState extends State {
Widget getPrivilegeBox(BuildContext context) {
var languageModel = Provider.of(context);
var userModel = Provider.of(context);
-
+
return ListTileTheme(
contentPadding: EdgeInsets.all(0),
child: ExpansionTile(
diff --git a/lib/pages/shipment_rates.dart b/lib/pages/shipment_rates.dart
new file mode 100644
index 0000000..977e633
--- /dev/null
+++ b/lib/pages/shipment_rates.dart
@@ -0,0 +1,305 @@
+import 'package:fcs/model/pickup_model.dart';
+import 'package:fcs/model/shipment_rate_model.dart';
+import 'package:fcs/vo/pickup.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 ShipmentRates extends StatefulWidget {
+ final PickUp pickUp;
+ ShipmentRates({this.pickUp});
+
+ @override
+ _ShipmentRatesState createState() => _ShipmentRatesState();
+}
+
+class _ShipmentRatesState extends State {
+ TextEditingController _addressEditingController = new TextEditingController();
+ TextEditingController _fromTimeEditingController =
+ new TextEditingController();
+ TextEditingController _toTimeEditingController = new TextEditingController();
+ TextEditingController _noOfPackageEditingController =
+ new TextEditingController();
+ TextEditingController _weightEditingController = new TextEditingController();
+
+ PickUp _pickUp;
+ bool _isLoading = false;
+
+ @override
+ void initState() {
+ super.initState();
+ if (widget.pickUp != null) {
+ _pickUp = widget.pickUp;
+ _addressEditingController.text = _pickUp.address;
+ _fromTimeEditingController.text = _pickUp.fromTime;
+ _toTimeEditingController.text = _pickUp.toTime;
+ _noOfPackageEditingController.text = _pickUp.numberOfPackage.toString();
+ _weightEditingController.text = _pickUp.weight.toString();
+ }
+ }
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ var shipmentRateModel = Provider.of(context);
+
+ final usaAddress = Container(
+ child: TextFormField(
+ maxLines: null,
+ controller: _addressEditingController,
+ cursorColor: primaryColor,
+ style: textStyle,
+ decoration: new InputDecoration(
+ labelText: 'USA Delivery Address',
+ enabledBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ focusedBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ ),
+ ));
+
+ final mmAddress = Container(
+ height: 50.0,
+ child: Row(children: [
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Text('Yangon, Myanmar Office'),
+ ),
+ Expanded(
+ child: TextFormField(
+ controller: _noOfPackageEditingController,
+ cursorColor: primaryColor,
+ textAlign: TextAlign.left,
+ decoration: InputDecoration(
+ contentPadding: EdgeInsets.all(10.0),
+ enabledBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.grey[300], width: 2),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderSide: const BorderSide(color: primaryColor, width: 2.0),
+ ),
+ ),
+ )),
+ ]),
+ );
+
+ final contactNumber = Container(
+ height: 50.0,
+ child: Row(children: [
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Text('USA contact number'),
+ ),
+ Expanded(
+ child: TextFormField(
+ controller: _weightEditingController,
+ cursorColor: primaryColor,
+ textAlign: TextAlign.left,
+ decoration: InputDecoration(
+ contentPadding: EdgeInsets.all(10.0),
+ enabledBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.grey[300], width: 2),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderSide: const BorderSide(color: primaryColor, width: 2.0),
+ ),
+ ),
+ )),
+ ]),
+ );
+
+ final mmContactNumber = Container(
+ height: 50.0,
+ child: Row(children: [
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Text('Myanmar contact number'),
+ ),
+ Expanded(
+ child: TextFormField(
+ controller: _weightEditingController,
+ cursorColor: primaryColor,
+ textAlign: TextAlign.left,
+ decoration: InputDecoration(
+ contentPadding: EdgeInsets.all(10.0),
+ enabledBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.grey[300], width: 2),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderSide: const BorderSide(color: primaryColor, width: 2.0),
+ ),
+ ),
+ )),
+ ]),
+ );
+
+ final mailBox = Container(
+ height: 50.0,
+ child: Row(children: [
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Text('Email Address'),
+ ),
+ Expanded(
+ child: TextFormField(
+ controller: _weightEditingController,
+ cursorColor: primaryColor,
+ textAlign: TextAlign.left,
+ decoration: InputDecoration(
+ contentPadding: EdgeInsets.all(10.0),
+ enabledBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.grey[300], width: 2),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderSide: const BorderSide(color: primaryColor, width: 2.0),
+ ),
+ ),
+ )),
+ ]),
+ );
+
+ final fbLinkBox = Container(
+ height: 50.0,
+ child: Row(children: [
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Text('Facebook Link'),
+ ),
+ Expanded(
+ child: TextFormField(
+ controller: _weightEditingController,
+ cursorColor: primaryColor,
+ textAlign: TextAlign.left,
+ decoration: InputDecoration(
+ contentPadding: EdgeInsets.all(10.0),
+ enabledBorder: OutlineInputBorder(
+ borderSide: BorderSide(color: Colors.grey[300], width: 2),
+ ),
+ focusedBorder: OutlineInputBorder(
+ borderSide: const BorderSide(color: primaryColor, width: 2.0),
+ ),
+ ),
+ )),
+ ]),
+ );
+
+ return LocalProgress(
+ inAsyncCall: _isLoading,
+ child: Scaffold(
+ appBar: AppBar(
+ backgroundColor: primaryColor,
+ title: Text(AppTranslations.of(context).text("pickup.edit.title")),
+ ),
+ body: Card(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ SizedBox(
+ height: 250,
+ // child: Image.asset(
+ // 'assets/logo.jpg',
+ // ),
+ ),
+ Padding(
+ padding: const EdgeInsets.only(left: 20.0),
+ child: Text('Rates',
+ style:
+ TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
+ ),
+ Padding(
+ padding: const EdgeInsets.only(left: 20.0),
+ child: Text('Most affortable rate',
+ style: TextStyle(fontSize: 14.0)),
+ ),
+ Container(
+ height: 100,
+ child: Padding(
+ padding: const EdgeInsets.all(20.0),
+ child: ListView.builder(
+ itemCount: shipmentRateModel.rates.length,
+ itemBuilder: (context, index) {
+ return Container(
+ child: Row(
+ children: [
+ Text(
+ '${shipmentRateModel.rates[index].description} - '),
+ Text(
+ '\$${shipmentRateModel.rates[index].price} per lb',
+ style: TextStyle(color: Colors.blueAccent),
+ )
+ ],
+ ));
+ })),
+ ),
+ widget.pickUp == null
+ ? Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius: new BorderRadius.circular(10)),
+ child: Text('Calculate my packages'),
+ color: primaryColor,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ )))
+ : Container(
+ child: Column(
+ children: [
+ Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius:
+ new BorderRadius.circular(10)),
+ child: Text('Pickuped'),
+ color: primaryColor,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ ))),
+ Align(
+ alignment: Alignment.bottomCenter,
+ child: Center(
+ child: Container(
+ width: 250,
+ child: FlatButton(
+ shape: new RoundedRectangleBorder(
+ borderRadius:
+ new BorderRadius.circular(10)),
+ child: Text('Cancel'),
+ color: primaryColor,
+ textColor: Colors.white,
+ onPressed: () {
+ Navigator.pop(context);
+ },
+ ),
+ )))
+ ],
+ ))
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/pages/util.dart b/lib/pages/util.dart
index 9273e7d..85638ba 100644
--- a/lib/pages/util.dart
+++ b/lib/pages/util.dart
@@ -234,24 +234,22 @@ Widget getStatus(String status) {
status,
style: TextStyle(color: Colors.white, fontSize: 12),
))
- : status == "pending"
- ? Chip(
- backgroundColor: Colors.blue,
- avatar: Icon(
- Icons.timelapse,
- color: Colors.white,
- size: 14,
- ),
- label: Text(
- status,
- style: TextStyle(color: Colors.white, fontSize: 12),
- ))
- : Chip(
- avatar: Icon(
- Icons.check,
- size: 14,
- ),
- label: Text(status));
+ : status == "pickup"
+ ? Text(
+ status,
+ style: TextStyle(color: Colors.red, fontSize: 12),
+ )
+ : status == "delivered"
+ ? Text(
+ status,
+ style: TextStyle(color: Colors.green, fontSize: 12),
+ )
+ : Chip(
+ avatar: Icon(
+ Icons.check,
+ size: 14,
+ ),
+ label: Text(status));
}
call(BuildContext context, String phone) {
diff --git a/lib/theme/theme.dart b/lib/theme/theme.dart
index 0c4413d..5d70c2d 100644
--- a/lib/theme/theme.dart
+++ b/lib/theme/theme.dart
@@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
import 'dart:ui';
import 'package:flutter/cupertino.dart';
-const primaryColor = const Color(0xfff00a21);
-const secondaryColor = const Color(0xFF01579b);
+const primaryColor = const Color(0xff272262);
+const secondaryColor = const Color(0xffff4400);
const thirdColor = const Color(0xFF0700f1);
const nextColor = const Color(0xFFfa833d);
const buttonColor = const Color(0xFFFFFFFF);
diff --git a/lib/vo/fcs_profile.dart b/lib/vo/fcs_profile.dart
new file mode 100644
index 0000000..3dc44ac
--- /dev/null
+++ b/lib/vo/fcs_profile.dart
@@ -0,0 +1,19 @@
+class FCSProfile {
+ String id;
+ String usaAddress;
+ String mmAddress;
+ String usaContactNumber;
+ String mmContactNumber;
+ String mail;
+ String facebook;
+
+ FCSProfile({
+ this.id,
+ this.usaAddress,
+ this.mmAddress,
+ this.usaContactNumber,
+ this.mmContactNumber,
+ this.mail,
+ this.facebook,
+ });
+}
diff --git a/lib/vo/pickup.dart b/lib/vo/pickup.dart
new file mode 100644
index 0000000..cbe080c
--- /dev/null
+++ b/lib/vo/pickup.dart
@@ -0,0 +1,40 @@
+class PickUp {
+ String id;
+ String userName;
+ String phoneNumber;
+ String fromTime;
+ String toTime;
+ int numberOfPackage;
+ int weight;
+ String address;
+ String status;
+
+ PickUp(
+ {this.id,
+ this.userName,
+ this.phoneNumber,
+ this.fromTime,
+ this.toTime,
+ this.numberOfPackage,
+ this.weight,
+ this.address,
+ this.status});
+
+ factory PickUp.fromMap(Map map, String id) {
+ return PickUp(
+ id: id,
+ userName: map['user_name'],
+ phoneNumber: map['phone_number'],
+ fromTime: map['from_time'],
+ toTime: map['to_time'],
+ numberOfPackage: map['number_of_package'],
+ weight: map['weight'],
+ address: map['address'],
+ status: map['status']);
+ }
+
+ @override
+ String toString() {
+ return 'PickUp{id:$id, userName:$userName,phoneNumber:$phoneNumber,fromTime:$fromTime,toTime:$toTime,numberOfPackage:$numberOfPackage,weight:$weight,status:$status}';
+ }
+}
diff --git a/lib/vo/rate.dart b/lib/vo/rate.dart
new file mode 100644
index 0000000..c0faaf6
--- /dev/null
+++ b/lib/vo/rate.dart
@@ -0,0 +1,31 @@
+class Rate {
+ String id;
+ String name;
+ String description;
+ String fromTime;
+ String toTime;
+ int price;
+
+ Rate(
+ {this.id,
+ this.name,
+ this.description,
+ this.fromTime,
+ this.toTime,
+ this.price,});
+
+ factory Rate.fromMap(Map map, String id) {
+ return Rate(
+ id: id,
+ name: map['name'],
+ description: map['description'],
+ fromTime: map['from_time'],
+ toTime: map['to_time'],
+ price: map['price'],);
+ }
+
+ @override
+ String toString() {
+ return 'Rate{id:$id, name:$name,description:$description,fromTime:$fromTime,toTime:$toTime}';
+ }
+}
diff --git a/lib/widget/fcs_text_field.dart b/lib/widget/fcs_text_field.dart
new file mode 100644
index 0000000..eb29067
--- /dev/null
+++ b/lib/widget/fcs_text_field.dart
@@ -0,0 +1,27 @@
+import 'package:flutter/material.dart';
+
+import '../theme/theme.dart';
+
+class FCSTextField extends StatelessWidget {
+ final TextEditingController controller;
+ final String label;
+
+ const FCSTextField({Key key, this.controller, this.label}) : super(key: key);
+ @override
+ Widget build(BuildContext context) {
+ return TextFormField(
+ maxLines: null,
+ controller: controller,
+ cursorColor: primaryColor,
+ textAlign: TextAlign.left,
+ decoration: InputDecoration(
+ labelText: label,
+ contentPadding: EdgeInsets.all(10.0),
+ enabledBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ focusedBorder: UnderlineInputBorder(
+ borderSide: BorderSide(color: primaryColor, width: 1.0)),
+ ),
+ );
+ }
+}
diff --git a/pubspec.lock b/pubspec.lock
index 5d101c8..1ecefae 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -113,6 +113,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
+ country_code_picker:
+ dependency: "direct main"
+ description:
+ name: country_code_picker
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.3.14"
crypto:
dependency: transitive
description:
@@ -520,6 +527,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.2"
+ pin_input_text_field:
+ dependency: "direct main"
+ description:
+ name: pin_input_text_field
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "3.0.1"
platform:
dependency: transitive
description: