This commit is contained in:
admin
2020-05-31 15:01:49 +06:30
52 changed files with 1401 additions and 744 deletions

10
.vscode/launch.json vendored
View File

@@ -11,5 +11,15 @@
"lib/main-dev.dart",
],
},
{
"name": "Flutter Dev2",
"request": "launch",
"type": "dart",
"program": "lib/main-dev.dart",
"args": [
"-t",
"lib/main-dev.dart",
],
},
]
}

BIN
assets/amazon_ins.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -474,13 +474,14 @@
"user_edit.welcome":"Welcome to FCS",
"user_edit.name":"Please enter your name",
"user.phone":"My phone number",
"user.fcs_id":"My FCS_ID",
"user.shipping_address":"My USA shipping address",
"user.phone":"MY PHONE NUMBER",
"user.fcs_id":"MY FCS_ID",
"user.shipping_address":"USA SHIPPING ADDRESS",
"user.deliveryAddress":"My delivery address",
"user.buying_instruction":"See below instructions to add shipping address",
"user.buying_instruction":"See below instructions to add USA shipping address while shoping online",
"buy_online":"Buying online",
"buy_online.title":"BUYING ONLINE",
"buy.amazon":"Amazon",
"buy.newegg":"Newegg",
"buy.macy":"Macy",
@@ -495,7 +496,15 @@
"shipment.title":"Shipments",
"shipment.add":"New shipment",
"pickup.title": "Pickups",
"pickup": "Pickups",
"pickup.title": "PICKUPS",
"pickup.new": "New Pickup",
"pickup.edit.title": "Pickup"
"pickup.edit.title": "Pickup",
"rate":"Rates",
"rate.title":"RATES",
"rate.edit.title":"EDIT RATES",
"rate.cal.title":"CALCULATE RATES"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 405 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 564 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'package:fcs/config.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'app.dart';

View File

@@ -1,9 +1,9 @@
import 'package:flutter/foundation.dart';
import 'package:fcs/model/api_helper.dart';
import 'package:fcs/model/main_model.dart';
import '../vo/setting.dart';
import '../vo/user.dart';
import 'main_model.dart';
abstract class BaseModel extends ChangeNotifier {
User user;

View File

@@ -10,7 +10,6 @@ import 'package:fcs/vo/revenue.dart';
import 'base_model.dart';
import 'constants.dart';
import 'firebase_helper.dart';
class ChartModel extends BaseModel {
final log = Logger('ChartModel');

View File

@@ -51,7 +51,7 @@ class MainModel extends ChangeNotifier {
phoneNumber: '+95 9 444444444',
fcsID: 'FCS-0203-390-2',
shippingAddress:
'154-19 64th Ave.Flushing, NY 11367 TEL. +1 (929) 215-2247',
'154-19 64th Ave.Flushing, \nNY 11367 \nTEL. +1 (929) 215-2247',
deliveryAddress: '39 42th St. Kyaut Ta Thar Township Yangon');
Setting setting;
@@ -70,6 +70,23 @@ class MainModel extends ChangeNotifier {
// this.isOnline = _isOnline;
// notifyListeners();
// });
_loadFcs();
}
_loadFcs() async {
user = await SharedPref.getUser();
notifyListeners();
}
saveUser(String pin, String phone) {
if (pin == "000000") {
user = User(name: "Owner", phoneNumber: phone);
SharedPref.saveUser(user);
} else {
user = User(name: "Customer", phoneNumber: phone);
SharedPref.saveUser(user);
}
notifyListeners();
}
resetPinTimer() {
@@ -83,7 +100,7 @@ class MainModel extends ChangeNotifier {
}
bool isLogin() {
return true;
return this.user != null;
}
bool hasEmail() {
@@ -138,7 +155,6 @@ class MainModel extends ChangeNotifier {
void addModel(BaseModel model) {
models.add(model);
model.mainModel = this;
}
void _initUser(User user) {
@@ -292,6 +308,10 @@ class MainModel extends ChangeNotifier {
}
Future<void> logout() async {
this.user = null;
notifyListeners();
return;
if (this.userListener != null) {
await this.userListener.cancel();
}

View File

@@ -11,25 +11,26 @@ class NotificationModel extends BaseModel {
int filer = 0;
List<Notification> notifications = [
Notification(
desc: 'A102A-34-#23',
status: 'delivered',
desc: 'Package delivered!',
status: 'A102A-34-#23',
time: DateTime(2020, 4, 28, 10, 32)),
Notification(
desc: 'A102A-34-#24',
status: 'picked up',
desc: 'Package in transit!',
status: 'A102A-34-#24',
time: DateTime(2020, 4, 26, 9, 32)),
Notification(
desc: 'A102A-34-#23',
status: 'sorted',
desc: 'Package delivered!',
status: 'A102A-34-#23',
time: DateTime(2020, 4, 24, 10, 32)),
Notification(
desc: 'ORDER # 114-0725982-9074639',
status: 'audited',
marketPlace: "Macy",
desc: "Audited received goods!",
status: 'ORDER # 114-0725982-9074639',
time: DateTime(2020, 4, 22, 12, 30)),
Notification(
marketPlace: "Amazon",
desc: 'ORDER # 114-0725982-9074639',
status: 'received',
desc: "Receive goods!",
status: 'ORDER # 323-982-2308',
time: DateTime(2020, 4, 22, 12, 22))
];

View File

@@ -14,7 +14,8 @@ class PickUpModel extends BaseModel {
var profile = FCSProfile(
id: '1',
usaAddress: '154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247',
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',
@@ -30,7 +31,8 @@ class PickUpModel extends BaseModel {
toTime: '3PM',
numberOfPackage: 5,
weight: 25,
status: 'pickup',
status: 'Pending',
date: DateTime(2020, 5, 1),
address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
PickUp(
@@ -41,7 +43,8 @@ class PickUpModel extends BaseModel {
toTime: '3PM',
numberOfPackage: 5,
weight: 25,
status: 'pickup',
status: 'Assigned',
date: DateTime(2020, 5, 6),
address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
PickUp(
@@ -52,11 +55,100 @@ class PickUpModel extends BaseModel {
toTime: '3PM',
numberOfPackage: 5,
weight: 25,
status: "delivered",
status: "Pickuped",
date: DateTime(2020, 5, 9),
address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
PickUp(
id: "P200412 - 12 Apr 2020",
userName: "Ko Kyaw Nyi",
phoneNumber: '+959111111111',
fromTime: '1PM',
toTime: '3PM',
numberOfPackage: 5,
weight: 25,
status: 'Pickuped',
date: DateTime(2020, 5, 15),
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: 'Pickuped',
date: DateTime(2020, 5, 20),
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: "Pickuped",
date: DateTime(2020, 5, 21),
address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
PickUp(
id: "P200441 - 10 Apr 2020",
userName: "Ko Kyaw Nyi",
phoneNumber: '+959111111111',
fromTime: '1PM',
toTime: '3PM',
numberOfPackage: 5,
weight: 25,
status: "Canceled",
date: DateTime(2020, 5, 25),
address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
PickUp(
id: "P200441 - 6 Apr 2020",
userName: "Ko Kyaw Nyi",
phoneNumber: '+959111111111',
fromTime: '1PM',
toTime: '3PM',
numberOfPackage: 5,
weight: 25,
status: "Canceled",
date: DateTime(2020, 5, 27),
address:
'154-19 64th Ave.\nFlushing, NY 11367\nTEL. +1 (929) 215-2247'),
];
List<PickUp> get canceled {
List<PickUp> _p = pickups.where((e) => e.status == "Canceled").toList()
..sort((e1, e2) {
return e2.date.compareTo(e1.date);
});
return _p;
}
List<PickUp> get completed {
return pickups.where((e) => e.status == "Pickuped").toList()
..sort((e1, e2) {
return e2.date.compareTo(e1.date);
});
}
List<PickUp> get upcoming {
return pickups
.where((e) =>
e.status == "Pending" ||
e.status == "Assigned" ||
e.status == "Processed" ||
e.status == "Rescheduled")
.toList()
..sort((e1, e2) {
return e2.date.compareTo(e1.date);
});
}
void initUser(user) {
super.initUser(user);
}

View File

@@ -11,7 +11,6 @@ import 'package:fcs/vo/po.dart';
import 'package:fcs/vo/popup_menu.dart';
import 'base_model.dart';
import 'constants.dart';
import 'firebase_helper.dart';
class POSubmissionModel extends BaseModel {

View File

@@ -60,13 +60,21 @@ class SharedPref {
}
static _read(String key) async {
final prefs = await SharedPreferences.getInstance();
return json.decode(prefs.getString(key));
try {
final prefs = await SharedPreferences.getInstance();
return json.decode(prefs.getString(key));
} catch (e) {
print("Error:$e");
}
}
static _save(String key, value) async {
final prefs = await SharedPreferences.getInstance();
prefs.setString(key, json.encode(value));
try {
final prefs = await SharedPreferences.getInstance();
prefs.setString(key, json.encode(value));
} catch (e) {
print("Error:$e");
}
}
static _remove(String key) async {

View File

@@ -22,6 +22,8 @@ class ShipmentRateModel extends BaseModel {
price: 8),
];
int freeDeliveryWeight=10;
void initUser(user) {
super.initUser(user);
}

View File

@@ -1,3 +1,5 @@
import 'package:fcs/pages/util.dart';
import 'package:fcs/vo/manual.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:fcs/model/main_model.dart';
@@ -7,6 +9,7 @@ import 'package:fcs/widget/progress.dart';
import '../theme/theme.dart';
import '../widget/label_widgets.dart';
import '../widget/local_text.dart';
import 'instruction.dart';
import 'manual/manual_page.dart';
class BuyingOnlinePage extends StatefulWidget {
@@ -36,7 +39,7 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
"user.deliveryAddress"));
final instructionBox = Container(
padding: EdgeInsets.only(top: 30),
padding: EdgeInsets.only(left: 10, top: 30, bottom: 10),
child: Center(
child: Wrap(
children: <Widget>[
@@ -56,9 +59,10 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
child: Container(
height: 45.0,
decoration: BoxDecoration(
color: primaryColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(10.0))),
color: primaryColor,
shape: BoxShape.rectangle,
// borderRadius: BorderRadius.all(Radius.circular(10.0))
),
child: ButtonTheme(
minWidth: 900.0,
height: 100.0,
@@ -67,8 +71,9 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ManualPage(
marketplace: 'Amazon',
builder: (context) => InstructionPage(
name: 'Amazon',
image: "assets/amazon_ins.png",
)));
},
child: LocalText(
@@ -88,9 +93,10 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
child: Container(
height: 45.0,
decoration: BoxDecoration(
color: primaryColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(10.0))),
color: primaryColor,
shape: BoxShape.rectangle,
// borderRadius: BorderRadius.all(Radius.circular(10.0))
),
child: ButtonTheme(
minWidth: 900.0,
height: 100.0,
@@ -120,9 +126,10 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
child: Container(
height: 45.0,
decoration: BoxDecoration(
color: primaryColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(10.0))),
color: primaryColor,
shape: BoxShape.rectangle,
// borderRadius: BorderRadius.all(Radius.circular(10.0))
),
child: ButtonTheme(
minWidth: 900.0,
height: 100.0,
@@ -151,9 +158,14 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(),
),
title: LocalText(
context,
"buy_online",
"buy_online.title",
fontSize: 20,
color: Colors.white,
),
@@ -163,36 +175,42 @@ class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
shrinkWrap: true,
padding: EdgeInsets.only(top: 10, left: 10, right: 10),
children: <Widget>[
Center(
child: Text(
mainModel.customer.name,
style: TextStyle(
color: secondaryColor,
fontSize: 16,
fontWeight: FontWeight.bold),
)),
Container(
padding: EdgeInsets.only(top: 15),
child: Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: phoneBox,
nameWidget(mainModel.customer.name),
phoneWidget(context, mainModel.customer.phoneNumber),
Row(
children: <Widget>[
SizedBox(
width: 25,
height: 25,
child: FittedBox(
child: Image.asset("assets/logo.jpg"),
fit: BoxFit.fill,
),
InkWell(
onTap: () {},
child: Icon(
Icons.open_in_new,
color: Colors.grey,
size: 15,
),
),
fcsIdBox,
Padding(
padding: const EdgeInsets.only(left: 7.0, top: 50),
child: Icon(
Icons.content_copy,
color: Colors.grey,
),
],
),
)
],
),
fcsIdBox,
shippingAddressBox,
deliveryAddressBox,
Row(
children: <Widget>[
Icon(Icons.location_on),
shippingAddressBox,
Padding(
padding: const EdgeInsets.only(left: 7.0, top: 50),
child: Icon(
Icons.content_copy,
color: Colors.grey,
),
)
],
),
// deliveryAddressBox,
instructionBox,
amazonbutton,
neweggbutton,

View File

@@ -1,5 +1,8 @@
import 'dart:async';
import 'package:fcs/model/main_model.dart';
import 'package:fcs/model/shared_pref.dart';
import 'package:fcs/vo/user.dart';
import 'package:flutter/material.dart';
import 'package:pin_input_text_field/pin_input_text_field.dart';
import 'package:provider/provider.dart';
@@ -182,10 +185,12 @@ class _CodePageState extends State<CodePage> {
_resend() async {}
_verify() async {
Navigator.push(
Provider.of<MainModel>(context).saveUser(pin,widget.phoneNumber);
await Navigator.push(
context,
MaterialPageRoute(builder: (context) => UserEditPage()),
);
Navigator.pop(context);
}
_completeResend() {

View File

@@ -1,4 +1,7 @@
import 'package:fcs/model/main_model.dart';
import 'package:fcs/widget/bottom_up_page_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_icons/flutter_icons.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';
@@ -68,6 +71,8 @@ typedef BtnCallback();
class _HomePageState extends State<HomePage> {
final log = Logger('_HomePageState');
bool login = false;
bool customer = true;
@override
void initState() {
@@ -91,6 +96,7 @@ class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
login=Provider.of<MainModel>(context).isLogin();
final helpBtn = _buildBtn2("manual.title",
icon: FontAwesomeIcons.readme,
imgIcon: Image.asset(
@@ -100,7 +106,7 @@ class _HomePageState extends State<HomePage> {
color: primaryColor,
),
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => ManualPage()))
.push(BottomUpPageRoute(ManualPage()))
// btnCallback: () => Navigator.of(context)
// .push(MaterialPageRoute(builder: (_) => TestList()))
);
@@ -130,17 +136,17 @@ class _HomePageState extends State<HomePage> {
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => ReportList())));
final pickUpBtn = _buildBtn("pickup.title",
icon: FontAwesomeIcons.directions,
final pickUpBtn = _buildBtn2("pickup",
icon: MaterialCommunityIcons.directions,
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => PickUpList())));
.push(BottomUpPageRoute(PickUpList())));
final shipmentCostBtn = _buildBtn("pickup.title",
icon: FontAwesomeIcons.ship,
final shipmentCostBtn = _buildBtn2("rate",
icon: FontAwesomeIcons.calculator,
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => ShipmentRates())));
.push(BottomUpPageRoute(ShipmentRates())));
final fcsProfileBtn = _buildBtn("profile.title",
final fcsProfileBtn = _buildBtn2("profile.title",
icon: Icons.account_circle,
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => FCSProfilePage())));
@@ -173,7 +179,8 @@ class _HomePageState extends State<HomePage> {
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => DOList())));
final shipmentBtn = _buildBtn("shipment.title",
final shipmentBtn = _buildBtn2("shipment.title",
icon: Ionicons.ios_airplane,
imgIcon: Image.asset(
"assets/truck.png",
width: 50,
@@ -203,7 +210,6 @@ class _HomePageState extends State<HomePage> {
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => PDList())));
final termBtn = _buildBtn2("term.title",
icon: FontAwesomeIcons.fileContract,
imgIcon: Image.asset(
@@ -223,16 +229,13 @@ class _HomePageState extends State<HomePage> {
);
});
final signinBtn = _buildBtn2("login",
icon: FontAwesomeIcons.signInAlt,
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => SigninPage())));
final buyingBtn =
_buildBtn2("buy_online", icon: Icons.person, btnCallback: () {
final buyingBtn = _buildBtn2("buy_online",
icon: MaterialCommunityIcons.cart_outline, btnCallback: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => BuyingOnlinePage()),
BottomUpPageRoute(BuyingOnlinePage())
// MaterialPageRoute(builder: (context) => BuyingOnlinePage()),
);
});
@@ -240,21 +243,15 @@ class _HomePageState extends State<HomePage> {
btnCallback: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => NotificationList()),
BottomUpPageRoute(NotificationList()),
);
});
final staffBtn = _buildBtn("staff.title",
imgIcon: Image.asset(
"assets/employee.png",
width: 40,
height: 40,
color: primaryColor,
),
final staffBtn = _buildBtn2("staff.title",
icon: SimpleLineIcons.people,
btnCallback: () => Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => StaffList())));
final _bankAccountsBtn = _buildBtn2("banks.title",
icon: FontAwesomeIcons.moneyCheck, btnCallback: () {
Navigator.push(
@@ -263,15 +260,14 @@ class _HomePageState extends State<HomePage> {
);
});
List<Widget> widgets = [helpBtn];
widgets.add(signinBtn);
List<Widget> widgets = [];
widgets.add(buyingBtn);
widgets.add(pickUpBtn);
widgets.add(shipmentBtn);
widgets.add(notiBtn);
widgets.add(staffBtn);
// widgets.add(_bankAccountsBtn);
widgets.add(announcementBtn);
widgets.add(pickUpBtn);
widgets.add(fcsProfileBtn);
widgets.add(shipmentCostBtn);
widgets.add(reportBtn);
@@ -391,28 +387,44 @@ class _HomePageState extends State<HomePage> {
child: Image.asset("assets/logo.jpg", height: 40),
borderRadius: new BorderRadius.circular(35.0),
),
actions: <Widget>[
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Contact()),
);
},
iconSize: 30,
icon: Icon(Icons.notifications),
),
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Profile()),
);
},
iconSize: 30,
icon: Icon(Icons.tune),
),
]),
actions: login
? <Widget>[
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Contact()),
);
},
iconSize: 30,
icon: Icon(Icons.notifications),
),
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Profile()),
);
},
iconSize: 30,
icon: Icon(Icons.tune),
),
]
: [
FlatButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SigninPage()),
);
},
// iconSize: 30,
child: Text("Sign in",style: siginButtonStyle,),
),
]),
body: Container(
decoration: BoxDecoration(
gradient:
@@ -425,34 +437,51 @@ class _HomePageState extends State<HomePage> {
// ],
// 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],
LinearGradient(
begin: Alignment.topCenter,
end: Alignment
.bottomCenter, // 10% of the width, so there are ten blinds.
colors: [
Color(0xd0272262),
Color(0xfa272262),
// Color(0xa0ff4400),
// secondaryColor,
], // 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],
// ),
),
child: ListView(children: [
Wrap(
children: widgets,
),
])
child: Column(
children: <Widget>[
Expanded(
child: ListView(children: [
Wrap(
alignment: WrapAlignment.center,
children: widgets,
),
]),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_buildSmallButton(
"Policies", FontAwesomeIcons.fileContract),
_buildSmallButton("Support", SimpleLineIcons.support),
],
)
],
)
// child: StaggeredGridView.count(
// crossAxisCount: 3,
// crossAxisSpacing: 12.0,
@@ -553,8 +582,8 @@ class _HomePageState extends State<HomePage> {
{Image imgIcon, IconData icon, BtnCallback btnCallback}) {
var languageModel = Provider.of<LanguageModel>(context);
return Container(
width: 130,
height: 130,
width: 100,
height: 100,
decoration: new BoxDecoration(
color: Colors.transparent, //new Color.fromRGBO(255, 0, 0, 0.0),
borderRadius: new BorderRadius.only(
@@ -573,33 +602,65 @@ class _HomePageState extends State<HomePage> {
// Padding(padding: EdgeInsets.only(bottom: 10.0)),
ClipOval(
child: Material(
color: Colors.white, // button color
color: Colors.black54, // button color
child: InkWell(
splashColor: secondaryColor, // inkwell color
splashColor: primaryColor, // inkwell color
child: SizedBox(
width: 60, height: 60, child: Icon(icon, size: 35)),
width: 60,
height: 60,
child: Icon(icon, color: Colors.white, size: 30)),
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")
),
FittedBox(
fit: BoxFit.fitWidth,
child: Text(AppTranslations.of(context).text(title),
style: languageModel.isEng
? TextStyle(
color: Colors.white,
fontWeight: FontWeight.w500,
fontSize: 14.0,
fontFamily: "Roboto")
: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 12.0,
fontFamily: "MyanmarUnicode")),
),
]),
),
);
}
Widget _buildSmallButton(String text, IconData iconData) {
return InkWell(
onTap: () => {},
child: Padding(
padding: const EdgeInsets.all(18.0),
child: Row(
children: <Widget>[
IconButton(
icon: Icon(iconData, color: Colors.white70),
color: Colors.white70,
onPressed: null),
// RaisedButton(onPressed: ()=>{},child: Row(
// children: <Widget>[
// IconButton(
// icon: Icon(iconData, ),
// onPressed: null),
// Text(text),
// ],
// ),color: Colors.transparent,
// focusColor: Colors.transparent,),
Text(
text,
style: subMenuStyle,
)
],
),
),
);
}
}

View File

@@ -0,0 +1,61 @@
import 'package:fcs/theme/theme.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:fcs/model/language_model.dart';
import 'package:fcs/model/main_model.dart';
import 'package:fcs/model/manual_model.dart';
import 'package:fcs/pages/manual/manual_item_title_dialog.dart';
import 'package:fcs/pages/util.dart';
import 'package:fcs/vo/manual.dart';
import 'package:fcs/widget/local_text.dart';
import 'package:fcs/widget/progress.dart';
class InstructionPage extends StatefulWidget {
final String image;
final String name;
const InstructionPage({Key key, this.image, this.name}) : super(key: key);
@override
_InstructionPageState createState() => _InstructionPageState();
}
class _InstructionPageState extends State<InstructionPage> {
TextEditingController _manualVersionController = TextEditingController();
final double dotSize = 10.0;
List<ManualItem> helpList = new List();
bool isEng;
String versionName;
bool _isLoading = false;
@override
void initState() {
helpList.clear();
var manualModel = Provider.of<ManualModel>(context, listen: false);
var mainModel = Provider.of<MainModel>(context, listen: false);
versionName = manualModel.version;
helpList = manualModel.getHelpList(mainModel.isBuyer());
super.initState();
}
@override
Widget build(BuildContext context) {
return LocalProgress(
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, color: secondaryColor),
onPressed: () => Navigator.of(context).pop(),
),
title: Text(widget.name),
backgroundColor: primaryColor,
),
body: Container(
child: FittedBox(
child: Image.asset(widget.image), fit: BoxFit.contain),
),
),
);
}
}

View File

@@ -49,6 +49,10 @@ class _ManualPageState extends State<ManualPage> {
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
leading: new IconButton(
icon: new Icon(Icons.close, color: secondaryColor),
onPressed: () => Navigator.of(context).pop(),
),
title: Text(widget.marketplace == null ? '' : widget.marketplace),
backgroundColor: primaryColor,
),

View File

@@ -31,6 +31,11 @@ class _NotificationListState extends State<NotificationList> {
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close, ),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,
title: LocalText(
context,
@@ -38,68 +43,6 @@ class _NotificationListState extends State<NotificationList> {
fontSize: 18,
color: Colors.white,
),
// actions: <Widget>[
// PopupMenuButton<PopupMenu>(
// elevation: 3.2,
// onSelected: (selected) {
// setState(() {
// this._selectedIndex = selected.index;
// });
// notificationModel.filter(selected.index);
// },
// 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,
// ),
// _selectedIndex != 0
// ? Positioned(
// bottom: 0,
// right: 0,
// child: Container(
// width: 10,
// height: 10,
// decoration: new BoxDecoration(
// shape: BoxShape.circle,
// color: secondaryColor,
// ),
// ),
// )
// : Container()
// ],
// )),
// itemBuilder: (BuildContext context) {
// return notificationMenu.map((PopupMenu choice) {
// return PopupMenuItem<PopupMenu>(
// value: choice,
// child: Row(
// children: <Widget>[
// Text(choice.status),
// SizedBox(
// width: 10,
// ),
// _selectedIndex != null &&
// _selectedIndex == choice.index
// ? Icon(
// Icons.check,
// color: Colors.grey,
// )
// : Container(),
// ],
// ),
// );
// }).toList();
// }),
// ],
),
body: new ListView.separated(
separatorBuilder: (context, index) => Divider(
@@ -133,25 +76,31 @@ class _NotificationListState extends State<NotificationList> {
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
noti.marketPlace == null
? Container()
: new Text(
noti.marketPlace,
style: new TextStyle(
fontSize: 15.0,
color: secondaryColor),
),
new Text(
noti.getDesc,
style: new TextStyle(
fontSize: 15.0,
color: secondaryColor),
color: primaryColor),
),
new Text(
noti.status == null ? "" : noti.status,
style: new TextStyle(
fontSize: 13.0,
color: secondaryColor),
noti.marketPlace == null
? Container()
: Padding(
padding: const EdgeInsets.only(top:8.0),
child: new Text(
noti.marketPlace,
style: new TextStyle(
fontSize: 15.0,
color: primaryColor),
),
),
Padding(
padding: const EdgeInsets.only(top:8.0),
child: new Text(
noti.status == null ? "" : noti.status,
style: new TextStyle(
fontSize: 16.0,
color: Colors.grey),
),
),
],
),
@@ -174,32 +123,7 @@ class _NotificationListState extends State<NotificationList> {
)
],
),
),
// noti.seen
// ? Container()
// : new Positioned(
// left: 11,
// top: 11,
// child: new Container(
// padding: EdgeInsets.all(2),
// decoration: new BoxDecoration(
// color: Colors.red,
// borderRadius: BorderRadius.circular(6),
// ),
// constraints: BoxConstraints(
// minWidth: 18,
// minHeight: 18,
// ),
// child: Text(
// 'new',
// style: TextStyle(
// color: Colors.white,
// fontSize: 14,
// ),
// textAlign: TextAlign.center,
// ),
// ),
// )
),
],
);
}),

View File

@@ -1,5 +1,9 @@
import 'package:fcs/model/main_model.dart';
import 'package:fcs/model/pickup_model.dart';
import 'package:fcs/pages/util.dart';
import 'package:fcs/vo/pickup.dart';
import 'package:flutter_icons/flutter_icons.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'package:fcs/widget/localization/app_translations.dart';
@@ -56,6 +60,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
controller: _addressEditingController,
cursorColor: primaryColor,
style: textStyle,
minLines: 2,
decoration: new InputDecoration(
labelText: 'Pickup Address',
enabledBorder: UnderlineInputBorder(
@@ -139,10 +144,17 @@ class _PickUpEditorState extends State<PickUpEditor> {
]),
);
MainModel mainModel = Provider.of<MainModel>(context);
return LocalProgress(
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,
title: Text(AppTranslations.of(context).text("pickup.edit.title")),
),
@@ -153,23 +165,54 @@ class _PickUpEditorState extends State<PickUpEditor> {
child: Padding(
padding: const EdgeInsets.all(20.0),
child: ListView(children: <Widget>[
Text(
"U Aung Zaw",
style: TextStyle(fontSize: 15.0),
Center(child: nameWidget(mainModel.customer.name)),
phoneWidget(context, mainModel.customer.phoneNumber),
Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Icon(Icons.location_on),
),
Expanded(child: pickUpAddress),
],
),
Text(
"+82054857695",
style: TextStyle(fontSize: 15.0),
SizedBox(height: 25),
Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Icon(Icons.timer),
),
Text('Pickup Time',
style: TextStyle(color: Colors.grey, fontSize: 18)),
],
),
SizedBox(height: 5),
Padding(
padding: const EdgeInsets.only(left: 33),
child: pickupTime,
),
pickUpAddress,
SizedBox(height: 15),
Text('Pickup Time'),
SizedBox(height: 15),
pickupTime,
SizedBox(height: 15),
noOfPackageBox,
SizedBox(height: 15),
weightBox
Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Icon(Octicons.package),
),
Expanded(child: noOfPackageBox),
],
),
SizedBox(
height: 15,
),
fcsInput("Total Weight (lb)", FontAwesomeIcons.weightHanging),
SizedBox(
height: 15,
),
widget.pickUp != null
? fcsDropDown("Assigned", MaterialCommunityIcons.worker)
: Container(),
fcsInput("Remark", MaterialCommunityIcons.note)
]),
)),
widget.pickUp == null
@@ -179,9 +222,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
child: Container(
width: 250,
child: FlatButton(
shape: new RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(10)),
child: Text('Request'),
child: Text('Request for pickup'),
color: primaryColor,
textColor: Colors.white,
onPressed: () {
@@ -198,10 +239,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
child: Container(
width: 250,
child: FlatButton(
shape: new RoundedRectangleBorder(
borderRadius:
new BorderRadius.circular(10)),
child: Text('Pickuped'),
child: Text('Update'),
color: primaryColor,
textColor: Colors.white,
onPressed: () {
@@ -215,11 +253,8 @@ class _PickUpEditorState extends State<PickUpEditor> {
child: Container(
width: 250,
child: FlatButton(
shape: new RoundedRectangleBorder(
borderRadius:
new BorderRadius.circular(10)),
child: Text('Cancel'),
color: Colors.blue,
child: Text('Cancel Pickup'),
color: Colors.grey[600],
textColor: Colors.white,
onPressed: () {
Navigator.pop(context);

View File

@@ -38,133 +38,127 @@ class _PickUpListState extends State<PickUpList> {
@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,
child: DefaultTabController(
length: 3,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(Icons.close),
onPressed: () => Navigator.of(context).pop(),
),
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()),
);
},
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),
),
],
bottom: TabBar(
unselectedLabelColor: Colors.grey,
tabs: [
Tab(
text: "Upcoming",
),
Tab(text: "Completed"),
Tab(text: "Canceled"),
],
),
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {
_newPickup();
},
icon: Icon(Icons.add),
label: Text(AppTranslations.of(context).text("pickup.new")),
backgroundColor: primaryColor,
),
body: TabBarView(
children: [
//Icon(Icons.directions_car),
_upComing(),
_completed(),
_canceled()
],
)),
),
);
}
_newPickup() {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => new PickUpEditor()),
);
}
Widget _upComing() {
var pickupModel = Provider.of<PickUpModel>(context);
return Column(
children: <Widget>[
Expanded(
child: new ListView.separated(
separatorBuilder: (context, index) => Divider(
color: Colors.black,
),
scrollDirection: Axis.vertical,
padding: EdgeInsets.only(top: 15),
shrinkWrap: true,
itemCount: pickupModel.upcoming.length,
itemBuilder: (BuildContext context, int index) {
return PickupListRow(pickUp: pickupModel.upcoming[index]);
}),
),
],
);
}
Widget _completed() {
var pickupModel = Provider.of<PickUpModel>(context);
return Column(
children: <Widget>[
Expanded(
child: new ListView.separated(
separatorBuilder: (context, index) => Divider(
color: Colors.black,
),
scrollDirection: Axis.vertical,
padding: EdgeInsets.only(top: 15),
shrinkWrap: true,
itemCount: pickupModel.completed.length,
itemBuilder: (BuildContext context, int index) {
return PickupListRow(pickUp: pickupModel.completed[index]);
}),
),
],
);
}
Widget _canceled() {
var pickupModel = Provider.of<PickUpModel>(context);
return Column(
children: <Widget>[
Expanded(
child: new ListView.separated(
separatorBuilder: (context, index) => Divider(
color: Colors.black,
),
scrollDirection: Axis.vertical,
padding: EdgeInsets.only(top: 15),
shrinkWrap: true,
itemCount: pickupModel.canceled.length,
itemBuilder: (BuildContext context, int index) {
return PickupListRow(pickUp: pickupModel.canceled[index]);
}),
),
],
);
}
}

View File

@@ -41,75 +41,78 @@ class _PickupListRowState extends State<PickupListRow> {
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(
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: 10.0, top: 10),
child: new Text(
_pickUp.id == null ? '' : "Last ${_pickUp.last} days" ,
style: new TextStyle(
fontSize: 15.0, color: Colors.grey),
),
)
],
),
),
],
),
),
),
Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(0),
child: getStatus(_pickUp.status),
),
Padding(
padding: const EdgeInsets.only(left: 8.0,top:5,bottom: 5),
child: 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),
),
],
),
),
],
),
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),
),
],
)
],
),
],
)
],
),
),
);

View File

@@ -223,6 +223,8 @@ class _ProfileState extends State<Profile> {
_isLoading = true;
});
await mainModel.logout();
Navigator.pop(context);
// Navigator.of(context)
// .pushNamedAndRemoveUntil("/", ModalRoute.withName('/'));
Future.delayed(Duration(seconds: 1), () {

View File

@@ -1,5 +1,7 @@
import 'package:fcs/model/pickup_model.dart';
import 'package:fcs/model/shipment_rate_model.dart';
import 'package:fcs/pages/shipment_rates_calculate.dart';
import 'package:fcs/pages/shipment_rates_edit.dart';
import 'package:fcs/vo/pickup.dart';
import 'package:provider/provider.dart';
import 'package:fcs/widget/localization/app_translations.dart';
@@ -8,6 +10,7 @@ import 'package:flutter/material.dart';
import 'package:fcs/widget/progress.dart';
import '../theme/theme.dart';
import 'util.dart';
class ShipmentRates extends StatefulWidget {
final PickUp pickUp;
@@ -28,6 +31,14 @@ class _ShipmentRatesState extends State<ShipmentRates> {
PickUp _pickUp;
bool _isLoading = false;
List<String> texts = [
"Minimum shipping weight is 1lbs.",
"Oversized goods, Light weight/Large volume items, laptops, phones, tablets may incur extra charges based on specifications. Please contact us for pricing.",
"Goods with lithium battary needs extra packaging and declaration. Please inform us ahead of time so that we can process your package accordingly.",
"Loose Batteries, Drones, and Prescription medicines are not allowed on aircraft.",
"Payment: We accept money orders, any US bank transfers via Zelle, AYA, KBZ and CB. No COD except for pick-ups.",
"Payments made in Myanmar will incur 2% tranfer fee"
];
@override
void initState() {
@@ -51,6 +62,13 @@ class _ShipmentRatesState extends State<ShipmentRates> {
Widget build(BuildContext context) {
var shipmentRateModel = Provider.of<ShipmentRateModel>(context);
var textList = texts
.map(
(e) => TextSpan(
text: "\n * " + e + "\n",
style: TextStyle(fontWeight: FontWeight.normal, fontSize: 13)),
)
.toList();
final usaAddress = Container(
child: TextFormField(
maxLines: null,
@@ -66,240 +84,91 @@ class _ShipmentRatesState extends State<ShipmentRates> {
),
));
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(
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,
title: Text(AppTranslations.of(context).text("pickup.edit.title")),
title: Text(AppTranslations.of(context).text("rate.title")),
),
body: Card(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
body: Padding(
padding: const EdgeInsets.all(8.0),
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.center,
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),
)
],
));
})),
height: 135,
child: ListView.builder(
itemCount: shipmentRateModel.rates.length,
itemBuilder: (context, index) {
return _row(
shipmentRateModel.rates[index].description,
"\$ " +shipmentRateModel.rates[index].price.toString(),
'per pound');
}),
),
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);
},
),
)))
],
))
_row("Free delivery within Yangon \nfor shipments over","10","pounds"),
_row("Delivery fees","\$ 5","below 10 pounds"),
Padding(
padding: const EdgeInsets.only(left: 18.0, right: 18),
child: RichText(
// overflow: TextOverflow.fade,
text: TextSpan(
style: TextStyle(color: primaryColor),
children: textList,
),
),
),
fcsButton(context, "Calculate", callack: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => ShipmentRatesCal()));
}),
fcsButton(context, "Edit", callack: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (_) => ShipmentRatesEdit()));
}),
SizedBox(height:10)
],
),
),
),
);
}
_row(String desc, String price, String unit) {
return Container(
padding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
child: Row(
children: <Widget>[
Text('$desc ', style: TextStyle(fontSize: 15)),
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 3.0),
child: Text(
'$price',
style: TextStyle(color: primaryColor, fontSize: 14),
),
),
Text(
'$unit',
style: TextStyle(color: Colors.grey, fontSize: 14),
),
],
),
SizedBox(
width: 50,
),
],
));
}
}

View File

@@ -0,0 +1,127 @@
import 'package:fcs/model/pickup_model.dart';
import 'package:fcs/model/shipment_rate_model.dart';
import 'package:fcs/pages/shipment_rates_calculate.dart';
import 'package:fcs/pages/shipment_rates_edit.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';
import 'util.dart';
class ShipmentRatesCal extends StatefulWidget {
final PickUp pickUp;
ShipmentRatesCal({this.pickUp});
@override
_ShipmentRatesCalState createState() => _ShipmentRatesCalState();
}
class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
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);
return LocalProgress(
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
backgroundColor: primaryColor,
title: Text(AppTranslations.of(context).text("rate.title")),
),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
height: 185,
child: ListView.builder(
itemCount: shipmentRateModel.rates.length,
itemBuilder: (context, index) {
return _row(
shipmentRateModel.rates[index].description +
"\n\$ " +
shipmentRateModel.rates[index].price.toString() +
" per pound",
'',
"",input: true);
}),
),
SizedBox(height: 50),
Center(child: Text("Delivery fee:\$ 5",style: TextStyle(color:primaryColor,fontSize:16),)),
SizedBox(height: 20),
Center(child: Text("Total estimated amount:\$ 38",style: TextStyle(color:primaryColor,fontSize:20),))
],
),
),
),
);
}
_row(String desc, String price, String unit,{bool input}) {
return Container(
padding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
child: Row(
children: <Widget>[
Text('$desc ', style: TextStyle(fontSize: 15)),
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 3.0),
child: Text(
'$price',
style: TextStyle(color: primaryColor, fontSize: 14),
),
),
Text(
'$unit',
style: TextStyle(color: Colors.grey, fontSize: 14),
),
// TextFormField(),
],
),
SizedBox(
width: 50,
),
Container(
width: 70,
child: TextField(textAlign: TextAlign.end,)),
],
));
}
}

View File

@@ -0,0 +1,154 @@
import 'package:fcs/model/pickup_model.dart';
import 'package:fcs/model/shipment_rate_model.dart';
import 'package:fcs/vo/pickup.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.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';
import 'util.dart';
class ShipmentRatesEdit extends StatefulWidget {
final PickUp pickUp;
ShipmentRatesEdit({this.pickUp});
@override
_ShipmentRatesEditState createState() => _ShipmentRatesEditState();
}
class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
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;
List<String> texts = [
"Minimum shipping weight is 1lbs.",
"Oversized goods, Light weight/Large volume items, laptops, phones, tablets may incur extra charges based on specifications. Please contact us for pricing.",
"Goods with lithium battary needs extra packaging and declaration. Please inform us ahead of time so that we can process your package accordingly.",
"Loose Batteries, Drones, and Prescription medicines are not allowed on aircraft.",
"Payment: We accept money orders, any US bank transfers via Zelle, AYA, KBZ and CB. No COD except for pick-ups.",
"Payments made in Myanmar will incur 2% tranfer fee"
];
@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);
var textList = texts
.map(
(e) => TextSpan(
text: "\n * " + e + "\n",
style: TextStyle(fontWeight: FontWeight.normal, fontSize: 13)),
)
.toList();
return LocalProgress(
inAsyncCall: _isLoading,
child: Scaffold(
appBar: AppBar(
centerTitle: true,
leading: new IconButton(
icon: new Icon(
Icons.close,
),
onPressed: () => Navigator.of(context).pop(),
),
backgroundColor: primaryColor,
title: Text(AppTranslations.of(context).text("rate.edit.title")),
),
body: Container(
padding: EdgeInsets.all(18),
child: ListView(
children: <Widget>[
Container(
height: 145,
child: ListView.builder(
itemCount: shipmentRateModel.rates.length,
itemBuilder: (context, index) {
return fcsInput(
shipmentRateModel.rates[index].description,
Icons.attach_money,
value:
shipmentRateModel.rates[index].price.toString());
}),
),
fcsInput("Min Weight for Free delivery within Yangon",
FontAwesomeIcons.weightHanging,
value: "10"),
fcsInput("Delivery fees", Icons.attach_money, value: "5"),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8),
child: RichText(
// overflow: TextOverflow.fade,
text: TextSpan(
style: TextStyle(color: primaryColor),
children: textList,
),
),
),
fcsButton(context, "Save", callack: () {}),
SizedBox(height: 10)
],
),
),
),
);
}
_row(String desc, String price, String unit) {
return Container(
padding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
child: Row(
children: <Widget>[
Text('$desc ', style: TextStyle(fontSize: 15)),
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 3.0),
child: Text(
'$price',
style: TextStyle(color: primaryColor, fontSize: 14),
),
),
Text(
'$unit',
style: TextStyle(color: Colors.grey, fontSize: 14),
),
],
),
SizedBox(
width: 50,
),
],
));
}
}

View File

@@ -162,11 +162,12 @@ class _SigninPageState extends State<SigninPage> {
: phoneNumber;
phoneNumber = dialCode + phoneNumber;
Navigator.push(
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CodePage(phoneNumber: phoneNumber)));
Navigator.pop(context);
if (exp != null) throw exp;
} catch (e) {
showMsgDialog(context, "Error", e.toString());

View File

@@ -1,16 +1,12 @@
import 'dart:async';
import 'dart:io' show Platform;
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:google_api_availability/google_api_availability.dart';
import 'package:logging/logging.dart';
import 'package:provider/provider.dart';
import 'package:fcs/model/main_model.dart';
import 'package:fcs/model/shared_pref.dart';
import 'package:fcs/theme/theme.dart';
import 'package:fcs/widget/local_text.dart';
import 'package:fcs/widget/localization/app_translations.dart';
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'package:provider/provider.dart';
class SplashScreen extends StatefulWidget {
@override
@@ -30,7 +26,7 @@ class _SplashScreenState extends State<SplashScreen> {
Timer timer;
startTime() async {
var _duration = new Duration(milliseconds: 500);
var _duration = new Duration(milliseconds: 1000);
this.timer = new Timer.periodic(_duration, navigationPage);
}
@@ -55,7 +51,7 @@ class _SplashScreenState extends State<SplashScreen> {
if (_loaded) {
timer.cancel();
Navigator.of(context).pushReplacementNamed('/home');
Navigator.of(context).pushReplacementNamed('/home');
// if (_isSupport) {
// if (_isLogin) {
// if (!_isAgree) {
@@ -92,7 +88,7 @@ class _SplashScreenState extends State<SplashScreen> {
MainModel mainModel = Provider.of<MainModel>(context);
this._loaded = mainModel.isLoaded;
this._isSupport = mainModel.isSupport();
this._isSupport = true;
this._isLogin = mainModel.isLogin();
this._isAgree = mainModel.agreedTerm();
this._hasEmail = mainModel.hasEmail();
@@ -105,13 +101,25 @@ class _SplashScreenState extends State<SplashScreen> {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Image.asset(
"assets/logo.png",
"assets/logo.jpg",
width: 180,
),
SizedBox(height: 50),
CircularProgressIndicator(
valueColor: new AlwaysStoppedAnimation<Color>(primaryColor),
Column(
children: <Widget>[
Text(
"Cargo Services",
style: welcomeLabelStyle,
),
Text(
"by FCS Trading",
style: welcomeSubLabelStyle,
),
],
),
// CircularProgressIndicator(
// valueColor: new AlwaysStoppedAnimation<Color>(primaryColor),
// ),
SizedBox(height: 30),
_isOnline
? Container()

View File

@@ -1,3 +1,4 @@
import 'package:fcs/model/shared_pref.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -108,5 +109,7 @@ class _UserEditPageState extends State<UserEditPage> {
);
}
_submit() async {}
_submit() async {
Navigator.pop(context);
}
}

View File

@@ -1,3 +1,4 @@
import 'package:fcs/widget/label_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_colorpicker/flutter_colorpicker.dart';
import 'package:logging/logging.dart';
@@ -234,22 +235,66 @@ Widget getStatus(String status) {
status,
style: TextStyle(color: Colors.white, fontSize: 12),
))
: status == "pickup"
: status == "Pickuped"
? Text(
status,
style: TextStyle(color: Colors.red, fontSize: 12),
style: TextStyle(
color: primaryColor,
fontSize: 18,
fontWeight: FontWeight.bold),
)
: status == "delivered"
? Text(
status,
style: TextStyle(color: Colors.green, fontSize: 12),
: status == "Pending" || status == "Rescheduled"
? Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(Icons.schedule),
),
Text(
status,
style: TextStyle(
color: primaryColor,
fontSize: 18,
fontWeight: FontWeight.bold),
)
],
)
: Chip(
avatar: Icon(
Icons.check,
size: 14,
),
label: Text(status));
: status == "Assigned"
? Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(Icons.check),
),
Text(
status,
style: TextStyle(
color: primaryColor,
fontSize: 18,
fontWeight: FontWeight.bold),
)
],
)
: status == "Canceled"
? Text(
status,
style: TextStyle(
color: primaryColor,
fontSize: 18,
fontWeight: FontWeight.bold),
)
: 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) {
@@ -325,3 +370,131 @@ Future<void> displayNotiContent(
showMsgDialog(context, "Error", "Notification item not found!");
} finally {}
}
Widget nameWidget(String name) {
return Center(
child: Padding(
padding: const EdgeInsets.only(left: 10.0, top: 8),
child: Text(
name,
style: TextStyle(
color: Colors.black87, fontSize: 18, fontWeight: FontWeight.bold),
),
),
);
}
Widget phoneWidget(BuildContext context, String phone) {
return Container(
padding: EdgeInsets.only(top: 10),
child: Row(
children: <Widget>[
Icon(Icons.phone),
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: labeledText(context, phone, "user.phone"),
),
],
),
);
}
Widget fcsInput(String label, IconData iconData,
{TextEditingController controller,String value}) {
return Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Icon(iconData),
),
Expanded(
child: Container(
height: 50.0,
child: Row(children: <Widget>[
Expanded(
child: TextFormField(
initialValue: value,
controller: controller,
cursorColor: primaryColor,
textAlign: TextAlign.left,
decoration: new InputDecoration(
contentPadding: EdgeInsets.only(top: 8),
labelText: label,
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: primaryColor, width: 1.0)),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: primaryColor, width: 1.0)),
),
)),
]),
)),
],
);
}
Widget fcsDropDown(String label, IconData iconData,
{TextEditingController controller}) {
return Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Icon(iconData),
),
Expanded(
child: Container(
height: 50.0,
child: Row(children: <Widget>[
Expanded(child: _dropDown()),
]),
)),
],
);
}
Widget _dropDown() {
return DropdownButton<String>(
value: "Ko Nge",
icon: Icon(Icons.arrow_downward),
iconSize: 24,
elevation: 16,
// style: TextStyle(color: Colors.deepPurple),
underline: Container(
height: 2,
color: primaryColor,
),
onChanged: (String newValue) {},
items: <String>['Ko Nge', 'Two', 'Free', 'Four']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
);
}
Widget fcsButton(BuildContext context, String text,{Function callack}) {
return Container(
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
child: Container(
height: 45.0,
decoration: BoxDecoration(
color: primaryColor,
shape: BoxShape.rectangle,
),
child: ButtonTheme(
minWidth: 900.0,
height: 100.0,
child: FlatButton(
onPressed: callack,
child: Text(text,
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold,
)),
),
),
),
);
}

View File

@@ -4,7 +4,7 @@ import 'package:flutter/cupertino.dart';
const primaryColor = const Color(0xff272262);
const secondaryColor = const Color(0xffff4400);
const thirdColor = const Color(0xFF0700f1);
const thirdColor = const Color(0xf0ff4444);
const nextColor = const Color(0xFFfa833d);
const buttonColor = const Color(0xFFFFFFFF);
const buttonBkColor = const Color(0xFF268944);
@@ -12,6 +12,16 @@ const labelColor = const Color(0xFF757575);
const TextStyle labelStyle =
TextStyle(fontSize: 13, color: Colors.grey, fontWeight: FontWeight.w500);
const TextStyle welcomeLabelStyle =
TextStyle(fontSize: 23, color: primaryColor, fontWeight: FontWeight.w500);
const TextStyle welcomeSubLabelStyle =
TextStyle(fontSize: 18, color: primaryColor, fontWeight: FontWeight.w500);
const TextStyle subMenuStyle =
TextStyle(fontSize: 14, color: Colors.white, fontWeight: FontWeight.w500);
const TextStyle siginButtonStyle =
TextStyle(fontSize: 18, color: Colors.white, fontWeight: FontWeight.w800);
const TextStyle labelStyleMM = TextStyle(
fontSize: 13,
color: Colors.grey,
@@ -48,7 +58,7 @@ const TextStyle photoLabelStyle =
const TextStyle photoLabelStyleMM = TextStyle(
color: Colors.black, fontSize: 13.0, fontFamily: "MyanmarUnicode");
const TextStyle textStyle =
TextStyle(fontSize: 15, color: Colors.black87, fontWeight: FontWeight.w500);
TextStyle(fontSize: 18, color: Colors.black87, fontWeight: FontWeight.w500);
const TextStyle textStyleOdd = TextStyle(
fontSize: 15, color: Colors.blueAccent, fontWeight: FontWeight.w500);
const TextStyle textStrikeStyle = TextStyle(

View File

@@ -8,6 +8,7 @@ class PickUp {
int weight;
String address;
String status;
DateTime date;
PickUp(
{this.id,
@@ -18,7 +19,10 @@ class PickUp {
this.numberOfPackage,
this.weight,
this.address,
this.status});
this.status,
this.date});
int get last => DateTime.now().difference(date).inDays;
factory PickUp.fromMap(Map<String, dynamic> map, String id) {
return PickUp(

View File

@@ -0,0 +1,23 @@
import 'package:flutter/cupertino.dart';
class BottomUpPageRoute extends PageRouteBuilder {
final Widget child;
BottomUpPageRoute(this.child)
: super(
pageBuilder: (context, animation, secondaryAnimation) => child,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
var begin = Offset(0.0, 1.0);
var end = Offset.zero;
var curve = Curves.ease;
var tween =
Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
return SlideTransition(
position: animation.drive(tween),
child: child,
);
},
);
}

View File

@@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:fcs/theme/theme.dart';
@@ -11,14 +13,20 @@ Widget labeledText(BuildContext context, String text, String label,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
LocalText(
context,
label,
fontSize: 15,
Padding(
padding: const EdgeInsets.only(top:8.0),
child: LocalText(
context,
label,
fontSize: 16,
color:primaryColor,
fontWeight: FontWeight.bold,
),
),
// number ? Spacer() : Container(),
Container(
// padding: EdgeInsets.only(left: 10),
padding: EdgeInsets.only(top: 10),
// alignment: number ? Alignment.topRight : null,
child: Text(
text == null ? "" : text,

View File

@@ -1,3 +1,4 @@
import 'package:fcs/model/product_model.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:intl/intl.dart';
@@ -5,7 +6,6 @@ import 'package:progress/progress.dart';
import 'package:provider/provider.dart';
import 'package:fcs/charts/lines.dart';
import 'package:fcs/model/main_model.dart';
import 'package:fcs/model/product_model.dart';
import 'package:fcs/pages/po/po_submission_form.dart';
import 'package:fcs/theme/theme.dart';
import 'package:fcs/vo/product.dart';

View File

@@ -1,9 +1,9 @@
import 'package:fcs/model/product_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:fcs/model/language_model.dart';
import 'package:fcs/model/product_model.dart';
import 'package:fcs/theme/theme.dart';
import 'package:fcs/vo/product.dart';
import 'package:fcs/widget/local_text.dart';

View File

@@ -119,7 +119,7 @@ packages:
name: country_code_picker
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.14"
version: "1.3.15"
crypto:
dependency: transitive
description:
@@ -251,6 +251,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.4"
flutter_icons:
dependency: "direct main"
description:
name: flutter_icons
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
flutter_launcher_icons:
dependency: "direct main"
description:
@@ -610,7 +617,28 @@ packages:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
version: "0.5.7+3"
shared_preferences_macos:
dependency: transitive
description:
name: shared_preferences_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+9"
shared_preferences_platform_interface:
dependency: transitive
description:
name: shared_preferences_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
shared_preferences_web:
dependency: transitive
description:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2+7"
sky_engine:
dependency: transitive
description: flutter

View File

@@ -22,7 +22,7 @@ dependencies:
flutter_launcher_icons: "^0.7.2"
qr_flutter: ^2.1.0+55
image_picker: ^0.6.0+9
shared_preferences: ^0.4.3
shared_preferences: ^0.5.7+3
http_parser: ^3.1.3
progress:
path:
@@ -64,6 +64,7 @@ dependencies:
permission_handler: ^4.0.0
country_code_picker: ^1.3.12
pin_input_text_field:
flutter_icons: ^1.1.0
dev_dependencies:
flutter_test: