Merge remote-tracking branch 'upstream/master'
This commit is contained in:
17
android/.project
Normal file
17
android/.project
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>android</name>
|
||||
<comment>Project android created by Buildship.</comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
13
android/.settings/org.eclipse.buildship.core.prefs
Normal file
13
android/.settings/org.eclipse.buildship.core.prefs
Normal file
@@ -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
|
||||
6
android/app/.classpath
Normal file
6
android/app/.classpath
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
||||
<classpathentry kind="output" path="bin/default"/>
|
||||
</classpath>
|
||||
23
android/app/.project
Normal file
23
android/app/.project
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>app</name>
|
||||
<comment>Project app created by Buildship.</comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
2
android/app/.settings/org.eclipse.buildship.core.prefs
Normal file
2
android/app/.settings/org.eclipse.buildship.core.prefs
Normal file
@@ -0,0 +1,2 @@
|
||||
connection.project.dir=..
|
||||
eclipse.preferences.version=1
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
BIN
assets/logo.jpg
Normal file
BIN
assets/logo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
10
lib/app.dart
10
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<App> {
|
||||
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<App> {
|
||||
..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<App> {
|
||||
ChangeNotifierProvider(builder: (context) => reportModel),
|
||||
ChangeNotifierProvider(builder: (context) => announcementModel),
|
||||
ChangeNotifierProvider(builder: (context) => reportUserModel),
|
||||
ChangeNotifierProvider(builder: (context) => pickUpModel),
|
||||
ChangeNotifierProvider(builder: (context) => shipmentRateModel),
|
||||
ChangeNotifierProvider(
|
||||
builder: (context) => testModel,
|
||||
),
|
||||
|
||||
@@ -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",
|
||||
|
||||
69
lib/model/pickup_model.dart
Normal file
69
lib/model/pickup_model.dart
Normal file
@@ -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<QuerySnapshot> 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<PickUp> 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 = [];
|
||||
}
|
||||
}
|
||||
34
lib/model/shipment_rate_model.dart
Normal file
34
lib/model/shipment_rate_model.dart
Normal file
@@ -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<QuerySnapshot> listener;
|
||||
|
||||
List<Rate> 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 = [];
|
||||
}
|
||||
}
|
||||
255
lib/pages/calculate_shipment_cost_editor.dart
Normal file
255
lib/pages/calculate_shipment_cost_editor.dart
Normal file
@@ -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<CalculateShipmentCostEditor> {
|
||||
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<PickUpModel>(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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: ListView(children: <Widget>[
|
||||
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: <Widget>[
|
||||
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);
|
||||
},
|
||||
),
|
||||
)))
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
201
lib/pages/fcs_profile_page.dart
Normal file
201
lib/pages/fcs_profile_page.dart
Normal file
@@ -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<FCSProfilePage> {
|
||||
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<PickUpModel>(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: <Widget>[
|
||||
Expanded(
|
||||
child: FCSTextField(
|
||||
controller: _mmAddressEditingController,
|
||||
label: 'Yangon, Myanmar Office',
|
||||
)),
|
||||
]),
|
||||
);
|
||||
|
||||
final contactNumber = Container(
|
||||
height: 50.0,
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
child: FCSTextField(
|
||||
controller: _contactEditingController,
|
||||
label: 'USA contact number',
|
||||
)),
|
||||
]),
|
||||
);
|
||||
|
||||
final mmContactNumber = Container(
|
||||
height: 50.0,
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
child: FCSTextField(
|
||||
controller: _mmContactEditingController,
|
||||
label: 'Myanmar contact number',
|
||||
)),
|
||||
]),
|
||||
);
|
||||
|
||||
final mailBox = Container(
|
||||
height: 50.0,
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
child: FCSTextField(
|
||||
controller: _mailEditingController,
|
||||
label: 'Email Address',
|
||||
)),
|
||||
]),
|
||||
);
|
||||
|
||||
final fbLinkBox = Container(
|
||||
height: 50.0,
|
||||
child: Row(children: <Widget>[
|
||||
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: <Widget>[
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: ListView(children: <Widget>[
|
||||
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: <Widget>[
|
||||
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);
|
||||
},
|
||||
),
|
||||
)))
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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<HomePage> {
|
||||
|
||||
@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<HomePage> {
|
||||
// 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<HomePage> {
|
||||
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<HomePage> {
|
||||
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<HomePage> {
|
||||
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<HomePage> {
|
||||
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<HomePage> {
|
||||
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<HomePage> {
|
||||
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: <Widget>[
|
||||
IconButton(
|
||||
@@ -357,7 +400,7 @@ class _HomePageState extends State<HomePage> {
|
||||
);
|
||||
},
|
||||
iconSize: 30,
|
||||
icon: Icon(Icons.phone),
|
||||
icon: Icon(Icons.notifications),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
@@ -367,53 +410,99 @@ class _HomePageState extends State<HomePage> {
|
||||
);
|
||||
},
|
||||
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: <Widget>[
|
||||
_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 <Color>[
|
||||
secondaryColor,
|
||||
primaryColor,
|
||||
secondaryColor,
|
||||
primaryColor,
|
||||
secondaryColor,
|
||||
],
|
||||
stops: const <double>[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: <Widget>[
|
||||
// _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<HomePage> {
|
||||
);
|
||||
}
|
||||
|
||||
_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<LanguageModel>(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: <Widget>[
|
||||
// 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<NotificationModel>(context, listen: false).seen();
|
||||
}
|
||||
}
|
||||
|
||||
237
lib/pages/pickup_editor.dart
Normal file
237
lib/pages/pickup_editor.dart
Normal file
@@ -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<PickUpEditor> {
|
||||
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<PickUpModel>(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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: ListView(children: <Widget>[
|
||||
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: <Widget>[
|
||||
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);
|
||||
},
|
||||
),
|
||||
)))
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
170
lib/pages/pickup_list.dart
Normal file
170
lib/pages/pickup_list.dart
Normal file
@@ -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<PickUpList> {
|
||||
Buyer buyer;
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var pickupModel = Provider.of<PickUpModel>(context);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("pickup.title")),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
color: Colors.white,
|
||||
),
|
||||
iconSize: 30,
|
||||
onPressed: () => showPlacesSearch(context),
|
||||
),
|
||||
PopupMenuButton<PopupMenu>(
|
||||
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: <Widget>[
|
||||
Icon(
|
||||
Icons.sort,
|
||||
color: primaryColor,
|
||||
),
|
||||
],
|
||||
)),
|
||||
itemBuilder: (BuildContext context) {
|
||||
return userMenu.map((PopupMenu choice) {
|
||||
return PopupMenuItem<PopupMenu>(
|
||||
value: choice,
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 8),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Text(choice.status),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList();
|
||||
}),
|
||||
PopupMenuButton<PopupMenu>(
|
||||
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: <Widget>[
|
||||
Icon(
|
||||
Icons.filter_list,
|
||||
color: primaryColor,
|
||||
),
|
||||
],
|
||||
)),
|
||||
itemBuilder: (BuildContext context) {
|
||||
return buyerStatusMenu.map((PopupMenu choice) {
|
||||
return PopupMenuItem<PopupMenu>(
|
||||
value: choice,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Text(choice.status),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList();
|
||||
}),
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
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()),
|
||||
);
|
||||
},
|
||||
),
|
||||
)))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
117
lib/pages/pickup_list_row.dart
Normal file
117
lib/pages/pickup_list_row.dart
Normal file
@@ -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<PickupListRow> {
|
||||
final double dotSize = 15.0;
|
||||
PickUp _pickUp = new PickUp();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// PickUpModel pickUpModel = Provider.of<PickUpModel>(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: <Widget>[
|
||||
Expanded(
|
||||
child: new Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
new Expanded(
|
||||
child: new Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: getStatus(_pickUp.status),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -94,6 +94,7 @@ class _ProfileState extends State<Profile> {
|
||||
],
|
||||
),
|
||||
));
|
||||
|
||||
final phonenumberbox = Container(
|
||||
height: 45.0,
|
||||
child: Row(
|
||||
@@ -319,6 +320,14 @@ class _ProfileState extends State<Profile> {
|
||||
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<Profile> {
|
||||
Widget getPrivilegeBox(BuildContext context) {
|
||||
var languageModel = Provider.of<LanguageModel>(context);
|
||||
var userModel = Provider.of<UserModel>(context);
|
||||
|
||||
|
||||
return ListTileTheme(
|
||||
contentPadding: EdgeInsets.all(0),
|
||||
child: ExpansionTile(
|
||||
|
||||
305
lib/pages/shipment_rates.dart
Normal file
305
lib/pages/shipment_rates.dart
Normal file
@@ -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<ShipmentRates> {
|
||||
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<ShipmentRateModel>(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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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: <Widget>[
|
||||
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);
|
||||
},
|
||||
),
|
||||
)))
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
19
lib/vo/fcs_profile.dart
Normal file
19
lib/vo/fcs_profile.dart
Normal file
@@ -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,
|
||||
});
|
||||
}
|
||||
40
lib/vo/pickup.dart
Normal file
40
lib/vo/pickup.dart
Normal file
@@ -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<String, dynamic> 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}';
|
||||
}
|
||||
}
|
||||
31
lib/vo/rate.dart
Normal file
31
lib/vo/rate.dart
Normal file
@@ -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<String, dynamic> 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}';
|
||||
}
|
||||
}
|
||||
27
lib/widget/fcs_text_field.dart
Normal file
27
lib/widget/fcs_text_field.dart
Normal file
@@ -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)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
14
pubspec.lock
14
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:
|
||||
|
||||
Reference in New Issue
Block a user