add page of fcs
This commit is contained in:
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,
|
||||
),
|
||||
|
||||
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);
|
||||
},
|
||||
),
|
||||
)))
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:fcs/pages/fcs_profile_page.dart';
|
||||
import 'package:fcs/pages/pickup_list.dart';
|
||||
import 'package:fcs/pages/shipment_rates.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||
@@ -125,6 +128,21 @@ 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",
|
||||
@@ -227,9 +245,11 @@ class _HomePageState extends State<HomePage> {
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
List<Widget> widgets = [helpBtn];
|
||||
widgets.add(announcementBtn);
|
||||
widgets.add(pickUpBtn);
|
||||
widgets.add(fcsProfileBtn);
|
||||
widgets.add(shipmentCostBtn);
|
||||
widgets.add(reportBtn);
|
||||
widgets.add(termBtn);
|
||||
widgets.add(_bankAccountsBtn);
|
||||
|
||||
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),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
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,12 +234,22 @@ Widget getStatus(String status) {
|
||||
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) {
|
||||
|
||||
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)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user