Merge remote-tracking branch 'upstream/master'
This commit is contained in:
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) {
|
||||
|
||||
Reference in New Issue
Block a user