Merge branch 'master' of https://git.mokkon.com/sainw/fcs
This commit is contained in:
@@ -32,11 +32,9 @@
|
||||
"product.open": "Order is opened at {0} to {1}\nOn {2}.",
|
||||
"product.purchase.order": "Order",
|
||||
|
||||
"login": "Login",
|
||||
"login.title":"Login",
|
||||
|
||||
"login.btn":"Login",
|
||||
"login.name":"Name",
|
||||
"login.phone":"Phone Number",
|
||||
"login.password":"Password",
|
||||
"login.confirm_password":"Confirm Password",
|
||||
"login.name_empty": "Please enter your name",
|
||||
@@ -309,7 +307,7 @@
|
||||
"employee.item.title":"Employee",
|
||||
"employee.phone":"Phone Number",
|
||||
"employee.add":"Add",
|
||||
"employee.save":"Save",
|
||||
"employee.update":"Update",
|
||||
|
||||
"setting.title":"Settings",
|
||||
"setting.confirm":"Confirm update setting?",
|
||||
@@ -465,6 +463,38 @@
|
||||
"announcement.delete_confirm":"Delete announcement?",
|
||||
"announcement.desc":"Description",
|
||||
|
||||
"login": "SignIn",
|
||||
"login.title":"Sign in to FCS",
|
||||
"login.phone":"Enter phone number",
|
||||
"login.smscode.retry":"Resend again in {0} seconds",
|
||||
|
||||
"singup.verify.title":"Verify your number",
|
||||
"singup.code_sent":"Enter 6 digit sms code sent to",
|
||||
"singup.resend":"Resend",
|
||||
|
||||
"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.deliveryAddress":"My delivery address",
|
||||
"user.buying_instruction":"See below instructions to add shipping address",
|
||||
|
||||
"buy_online":"Buying online",
|
||||
"buy.amazon":"Amazon",
|
||||
"buy.newegg":"Newegg",
|
||||
"buy.macy":"Macy",
|
||||
"buy.instruction":"Adding your shipment address in {0}",
|
||||
|
||||
"notifications.title":"Notification",
|
||||
|
||||
"staff.title":"FCS staffs",
|
||||
"staff.form.title":"FCS staff",
|
||||
"staff.update":"Update",
|
||||
|
||||
"shipment.title":"Shipments",
|
||||
"shipment.add":"New shipment",
|
||||
|
||||
"pickup.title": "Pickups",
|
||||
"pickup.new": "New Pickup",
|
||||
"pickup.edit.title": "Pickup"
|
||||
|
||||
@@ -32,10 +32,9 @@
|
||||
"product.open": "ဆီအဝယ် ကို {0} မှ {1}\n{2} နေ့များတွင် ဖွင့်ပါသည်။",
|
||||
"product.purchase.order": "ဝယ်မည်",
|
||||
|
||||
"login.title":"အကောင့်ဒ်၀င်ရန်",
|
||||
|
||||
"login.btn":"ဝင်မည်",
|
||||
"login.name":"နာမည်",
|
||||
"login.phone":"ဖုန်းနံပါတ်",
|
||||
"login.password":"စကားဝှက်",
|
||||
"login.confirm_password":"အတည်ပြုစကားဝှက်",
|
||||
"login.name_empty": "ကျေးဇူးပြု၍ နာမည်ထည့်ပေးပါ",
|
||||
@@ -304,7 +303,7 @@
|
||||
"employee.item.title":"ဝန်ထမ်း",
|
||||
"employee.phone":"ဖုန်းနံပါတ်",
|
||||
"employee.add":"ထည့်မည်",
|
||||
"employee.save":"သိမ်းဆည်းမည်",
|
||||
"employee.update":"Update",
|
||||
|
||||
"setting.title":"ချိန်ညှိချက်များ",
|
||||
"setting.confirm":"ချိန်ညှိချက်များ ကိုပြင်မည်လား?",
|
||||
@@ -367,7 +366,6 @@
|
||||
"Ok": "အိုကေ",
|
||||
|
||||
"singup": "အကောင့်ဒ်အသစ်ပြုလုပ်ခြင်း",
|
||||
"login": "အကောင့်ဒ်၀င်ရန်",
|
||||
"buyer.reg": "ဝယ်ယူသူမှတ်ပုံတင်ခြင်း",
|
||||
"po.sub": "ဆီအဝယ် တင်သွင်းခြင်း",
|
||||
"do.sub": "ဆီအထုတ် တင်သွင်းခြင်း",
|
||||
@@ -498,6 +496,38 @@
|
||||
"announcement.delete_confirm":"ကြေငြာချက်ကိုဖျက်မည်လား?",
|
||||
"announcement.desc":"ဖော်ပြချက်",
|
||||
|
||||
"login": "SignIn",
|
||||
"login.title":"Sign in to FCS",
|
||||
"login.phone":"Enter phone number",
|
||||
"login.smscode.retry":"Resend again in {0} seconds",
|
||||
|
||||
"singup.verify.title":"Verify your number",
|
||||
"singup.code_sent":"Enter 6 digit sms code sent to",
|
||||
"singup.resend":"Resend",
|
||||
|
||||
"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.deliveryAddress":"My delivery address",
|
||||
"user.buying_instruction":"See below instructions to add shipping address",
|
||||
|
||||
"buy_online":"Buying online",
|
||||
"buy.amazon":"Amazon",
|
||||
"buy.newegg":"Newegg",
|
||||
"buy.macy":"Macy",
|
||||
"buy.instruction":"Adding your shipment address in {0}",
|
||||
|
||||
"notifications.title":"Notifications",
|
||||
|
||||
"staff.title":"FCS staffs",
|
||||
"staff.form.title":"FCS staff",
|
||||
"staff.update":"Update",
|
||||
|
||||
"shipment.title":"Shipments",
|
||||
"shipment.add":"New shipment",
|
||||
|
||||
"pickup.title": "Pickups",
|
||||
"pickup.new": "New Pickup",
|
||||
"pickup.edit.title": "Pickup"
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:fcs/vo/announcement.dart';
|
||||
import 'package:fcs/vo/shipment.dart';
|
||||
|
||||
import 'base_model.dart';
|
||||
import 'constants.dart';
|
||||
@@ -10,6 +11,12 @@ import 'firebase_helper.dart';
|
||||
class AnnouncementModel extends BaseModel {
|
||||
List<Announcement> announcements = [];
|
||||
|
||||
List<Shipment> shipments = [
|
||||
Shipment(shipDate: DateTime(2020, 4, 23), shipmentNumber: 'A103B',status: 'In progress'),
|
||||
Shipment(shipDate: DateTime(2020, 4, 2), shipmentNumber: 'A100A',status: 'Delivered'),
|
||||
Shipment(shipDate: DateTime(2020, 4, 2), shipmentNumber: 'A100B',status: 'Delivered')
|
||||
];
|
||||
|
||||
void initUser(user) {
|
||||
super.initUser(user);
|
||||
_loadAnnouncements();
|
||||
@@ -37,9 +44,9 @@ class AnnouncementModel extends BaseModel {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Future<Announcement> getAnnouncement(String id) async {
|
||||
String path = "/$biz_collection/${setting.okEnergyId}/$announcement_collection";
|
||||
String path =
|
||||
"/$biz_collection/${setting.okEnergyId}/$announcement_collection";
|
||||
var snap = await getDocSnap(path, id);
|
||||
return Announcement.fromMap(snap.data, snap.documentID);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:fcs/vo/user.dart';
|
||||
|
||||
import '../vo/user.dart';
|
||||
import 'base_model.dart';
|
||||
import 'constants.dart';
|
||||
import 'firebase_helper.dart';
|
||||
@@ -9,7 +10,11 @@ import 'firebase_helper.dart';
|
||||
class EmployeeModel extends BaseModel {
|
||||
final log = Logger('EmployeeModel');
|
||||
|
||||
List<User> employees = [];
|
||||
List<User> employees = [
|
||||
User(name: 'Ko Nyi', phoneNumber: '+95 9 717273634',),
|
||||
User(name: 'Ko Phyu', phoneNumber: '+1 (939) 382-3844'),
|
||||
User(name: 'Ko Ye', phoneNumber: '+95 9 983734783',status: "Delivered"),
|
||||
];
|
||||
|
||||
void initUser(user) async {
|
||||
super.initUser(user);
|
||||
|
||||
@@ -46,6 +46,14 @@ class MainModel extends ChangeNotifier {
|
||||
bool pinRequired;
|
||||
Timer pinTimer;
|
||||
|
||||
User customer = User(
|
||||
name: "Ko Myo Min",
|
||||
phoneNumber: '+95 9 444444444',
|
||||
fcsID: 'FCS-0203-390-2',
|
||||
shippingAddress:
|
||||
'154-19 64th Ave.Flushing, NY 11367 TEL. +1 (929) 215-2247',
|
||||
deliveryAddress: '39 42th St. Kyaut Ta Thar Township Yangon');
|
||||
|
||||
Setting setting;
|
||||
PackageInfo packageInfo;
|
||||
bool isLoaded = true;
|
||||
|
||||
@@ -8,8 +8,30 @@ import 'constants.dart';
|
||||
import 'firebase_helper.dart';
|
||||
|
||||
class NotificationModel extends BaseModel {
|
||||
int filer=0;
|
||||
List<Notification> notifications = [];
|
||||
int filer = 0;
|
||||
List<Notification> notifications = [
|
||||
Notification(
|
||||
desc: 'A102A-34-#23',
|
||||
status: 'delivered',
|
||||
time: DateTime(2020, 4, 28, 10, 32)),
|
||||
Notification(
|
||||
desc: 'A102A-34-#24',
|
||||
status: 'picked up',
|
||||
time: DateTime(2020, 4, 26, 9, 32)),
|
||||
Notification(
|
||||
desc: 'A102A-34-#23',
|
||||
status: 'sorted',
|
||||
time: DateTime(2020, 4, 24, 10, 32)),
|
||||
Notification(
|
||||
desc: 'ORDER # 114-0725982-9074639',
|
||||
status: 'audited',
|
||||
time: DateTime(2020, 4, 22, 12, 30)),
|
||||
Notification(
|
||||
marketPlace: "Amazon",
|
||||
desc: 'ORDER # 114-0725982-9074639',
|
||||
status: 'received',
|
||||
time: DateTime(2020, 4, 22, 12, 22))
|
||||
];
|
||||
|
||||
var filterValues = {1: "po", 2: "do", 3: "buyer"};
|
||||
List<Notification> get notis {
|
||||
@@ -25,7 +47,6 @@ class NotificationModel extends BaseModel {
|
||||
_loadNotifications();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
logout() async {
|
||||
notifications = [];
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:fcs/vo/popup_menu.dart';
|
||||
import 'package:fcs/vo/role.dart';
|
||||
|
||||
import '../config.dart';
|
||||
import '../vo/role.dart';
|
||||
import '../vo/user.dart';
|
||||
import 'base_model.dart';
|
||||
import 'constants.dart';
|
||||
@@ -19,7 +20,13 @@ class UserModel extends BaseModel {
|
||||
PopupMenu popupMenu = new PopupMenu();
|
||||
|
||||
List<User> users = [];
|
||||
List<Privilege> privileges = [];
|
||||
List<Privilege> privileges = [
|
||||
Privilege(name: 'Manage shipment'),
|
||||
Privilege(name: 'Manage pickups'),
|
||||
Privilege(name: 'Manage packages'),
|
||||
Privilege(name: 'Manage deliveries'),
|
||||
Privilege(name: 'Admin')
|
||||
];
|
||||
List<UserLevel> userLevels = [];
|
||||
User user = new User();
|
||||
|
||||
|
||||
206
lib/pages/buying_online.dart
Normal file
206
lib/pages/buying_online.dart
Normal file
@@ -0,0 +1,206 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/model/main_model.dart';
|
||||
import 'package:fcs/widget/local_text.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
|
||||
import '../theme/theme.dart';
|
||||
import '../widget/label_widgets.dart';
|
||||
import '../widget/local_text.dart';
|
||||
import 'manual/manual_page.dart';
|
||||
|
||||
class BuyingOnlinePage extends StatefulWidget {
|
||||
@override
|
||||
_BuyingOnlinePagetate createState() => _BuyingOnlinePagetate();
|
||||
}
|
||||
|
||||
class _BuyingOnlinePagetate extends State<BuyingOnlinePage> {
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
MainModel mainModel = Provider.of<MainModel>(context);
|
||||
|
||||
final phoneBox =
|
||||
labeledText(context, mainModel.customer.phoneNumber, "user.phone");
|
||||
final fcsIdBox = Container(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
child: labeledText(context, mainModel.customer.fcsID, "user.fcs_id"));
|
||||
final shippingAddressBox = Container(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
child: labeledText(context, mainModel.customer.shippingAddress,
|
||||
"user.shipping_address"));
|
||||
final deliveryAddressBox = Container(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
child: labeledText(context, mainModel.customer.deliveryAddress,
|
||||
"user.deliveryAddress"));
|
||||
|
||||
final instructionBox = Container(
|
||||
padding: EdgeInsets.only(top: 30),
|
||||
child: Center(
|
||||
child: Wrap(
|
||||
children: <Widget>[
|
||||
LocalText(
|
||||
context,
|
||||
'user.buying_instruction',
|
||||
color: labelColor,
|
||||
fontSize: 15,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final amazonbutton = Container(
|
||||
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
|
||||
child: Container(
|
||||
height: 45.0,
|
||||
decoration: BoxDecoration(
|
||||
color: primaryColor,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||||
child: ButtonTheme(
|
||||
minWidth: 900.0,
|
||||
height: 100.0,
|
||||
child: FlatButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ManualPage(
|
||||
marketplace: 'Amazon',
|
||||
)));
|
||||
},
|
||||
child: LocalText(
|
||||
context,
|
||||
'buy.amazon',
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final neweggbutton = Container(
|
||||
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
|
||||
child: Container(
|
||||
height: 45.0,
|
||||
decoration: BoxDecoration(
|
||||
color: primaryColor,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||||
child: ButtonTheme(
|
||||
minWidth: 900.0,
|
||||
height: 100.0,
|
||||
child: FlatButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ManualPage(
|
||||
marketplace: 'Newegg',
|
||||
)));
|
||||
},
|
||||
child: LocalText(
|
||||
context,
|
||||
'buy.newegg',
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final macybutton = Container(
|
||||
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
|
||||
child: Container(
|
||||
height: 45.0,
|
||||
decoration: BoxDecoration(
|
||||
color: primaryColor,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||||
child: ButtonTheme(
|
||||
minWidth: 900.0,
|
||||
height: 100.0,
|
||||
child: FlatButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => ManualPage(
|
||||
marketplace: "Macy",
|
||||
)));
|
||||
},
|
||||
child: LocalText(
|
||||
context,
|
||||
'buy.macy',
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: LocalText(
|
||||
context,
|
||||
"buy_online",
|
||||
fontSize: 20,
|
||||
color: Colors.white,
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
),
|
||||
body: ListView(
|
||||
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,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: Icon(
|
||||
Icons.open_in_new,
|
||||
color: Colors.grey,
|
||||
size: 15,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
fcsIdBox,
|
||||
shippingAddressBox,
|
||||
deliveryAddressBox,
|
||||
instructionBox,
|
||||
amazonbutton,
|
||||
neweggbutton,
|
||||
macybutton,
|
||||
SizedBox(height: 10)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
205
lib/pages/code_page.dart
Normal file
205
lib/pages/code_page.dart
Normal file
@@ -0,0 +1,205 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:pin_input_text_field/pin_input_text_field.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../theme/theme.dart';
|
||||
import '../theme/theme.dart';
|
||||
import '../widget/local_text.dart';
|
||||
import '../widget/progress.dart';
|
||||
import 'user_edit.dart';
|
||||
|
||||
const resend_count_sec = 5;
|
||||
|
||||
class CodePage extends StatefulWidget {
|
||||
final String phoneNumber;
|
||||
const CodePage({Key key, this.phoneNumber}) : super(key: key);
|
||||
@override
|
||||
_CodePageState createState() => _CodePageState();
|
||||
}
|
||||
|
||||
class _CodePageState extends State<CodePage> {
|
||||
bool _isLoading = false;
|
||||
String pin;
|
||||
bool allNumberEntered;
|
||||
Timer _timer;
|
||||
int _start = resend_count_sec;
|
||||
bool canResend = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
pin = "";
|
||||
allNumberEntered = false;
|
||||
super.initState();
|
||||
startTimer();
|
||||
}
|
||||
|
||||
void startTimer() {
|
||||
_timer = new Timer.periodic(
|
||||
Duration(seconds: 1),
|
||||
(t) => setState(
|
||||
() {
|
||||
if (_start < 1) {
|
||||
t.cancel();
|
||||
canResend = true;
|
||||
} else {
|
||||
_start = _start - 1;
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_timer.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: primaryColor,
|
||||
),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(top: 5, left: 5, right: 5),
|
||||
children: <Widget>[
|
||||
Card(
|
||||
elevation: 5.0,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 20, right: 20, top: 40),
|
||||
child: LocalText(
|
||||
context,
|
||||
'singup.verify.title',
|
||||
fontSize: 21,
|
||||
color: secondaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 20,
|
||||
top: 20,
|
||||
),
|
||||
child: LocalText(context, 'singup.code_sent',
|
||||
fontSize: 15, color: labelColor),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 20),
|
||||
child: Text(
|
||||
widget.phoneNumber,
|
||||
style: TextStyle(
|
||||
color: primaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 20, left: 20, right: 20),
|
||||
child: PinInputTextField(
|
||||
pinLength: 6,
|
||||
decoration:
|
||||
BoxLooseDecoration(strokeColor: Colors.grey[400]),
|
||||
textInputAction: TextInputAction.done,
|
||||
autoFocus: true,
|
||||
onChanged: _pinChange,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 20, top: 20, right: 20),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
RaisedButton(
|
||||
onPressed: canResend ? _resend : null,
|
||||
color: canResend ? Colors.white : Colors.grey,
|
||||
child: LocalText(context, 'singup.resend',
|
||||
fontSize: 16,
|
||||
color:
|
||||
canResend ? primaryColor : Colors.grey[400]),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
side: BorderSide(
|
||||
color: canResend
|
||||
? primaryColor
|
||||
: Colors.grey[400])),
|
||||
),
|
||||
InkWell(
|
||||
onTap: allNumberEntered ? _verify : null,
|
||||
child: CircleAvatar(
|
||||
backgroundColor: allNumberEntered
|
||||
? primaryColor
|
||||
: Colors.grey[400],
|
||||
child: Icon(
|
||||
Icons.check,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 20,
|
||||
right: 20,
|
||||
),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
LocalText(
|
||||
context,
|
||||
'login.smscode.retry',
|
||||
fontSize: 15,
|
||||
translationVariables: [_start.toString()],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_pinChange(pin) {
|
||||
setState(() {
|
||||
this.pin = pin;
|
||||
this.allNumberEntered = this.pin.length == 6;
|
||||
});
|
||||
}
|
||||
|
||||
_resend() async {}
|
||||
|
||||
_verify() async {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => UserEditPage()),
|
||||
);
|
||||
}
|
||||
|
||||
_completeResend() {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
_start = resend_count_sec;
|
||||
canResend = false;
|
||||
startTimer();
|
||||
});
|
||||
}
|
||||
|
||||
_completeVerify() {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import 'package:progress/progress.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/model/employee_model.dart';
|
||||
import 'package:fcs/model/language_model.dart';
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/widget/localization/app_translations.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
|
||||
import 'employee_editor.dart';
|
||||
|
||||
class EmployeeList extends StatefulWidget {
|
||||
@override
|
||||
_EmployeeListState createState() => _EmployeeListState();
|
||||
}
|
||||
|
||||
class _EmployeeListState extends State<EmployeeList> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy - hh:mm:ss a');
|
||||
final double dotSize = 15.0;
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var employeeModel = Provider.of<EmployeeModel>(context);
|
||||
var languageModle = Provider.of<LanguageModel>(context);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(
|
||||
AppTranslations.of(context).text("employee.title"),
|
||||
style: languageModle.isEng
|
||||
? TextStyle()
|
||||
: TextStyle(fontFamily: 'MyanmarUnicode'),
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
backgroundColor: primaryColor,
|
||||
child: Icon(Icons.add),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => EmployeeEditor()),
|
||||
);
|
||||
},
|
||||
),
|
||||
body: new ListView.builder(
|
||||
padding: EdgeInsets.only(left: 15, right: 15, top: 15),
|
||||
shrinkWrap: true,
|
||||
itemCount: employeeModel.employees.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => EmployeeEditor(
|
||||
employee: employeeModel.employees[index],
|
||||
)),
|
||||
);
|
||||
},
|
||||
child: Card(
|
||||
elevation: 10,
|
||||
color: Colors.white,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
new Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
new Padding(
|
||||
padding: new EdgeInsets.symmetric(
|
||||
horizontal: 32.0 - dotSize / 2),
|
||||
child: Image.asset(
|
||||
"assets/employee.png",
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
employeeModel.employees[index].name == null
|
||||
? ""
|
||||
: employeeModel.employees[index].name,
|
||||
style: new TextStyle(
|
||||
fontSize: 17.0, color: Colors.black),
|
||||
),
|
||||
Text(
|
||||
employeeModel.employees[index].phone ==
|
||||
null
|
||||
? ""
|
||||
: employeeModel
|
||||
.employees[index].phone,
|
||||
style: new TextStyle(
|
||||
fontSize: 14.0, color: Colors.grey),
|
||||
),
|
||||
employeeModel.employees[index].device == null
|
||||
? Text("No login",
|
||||
style: TextStyle(color: Colors.red))
|
||||
: Text("last active",
|
||||
style: TextStyle(color: Colors.green)),
|
||||
Text(
|
||||
"${employeeModel.employees[index].device == null ? "" : employeeModel.employees[index].device}",
|
||||
style: TextStyle(fontSize: 11)),
|
||||
Text(
|
||||
"${employeeModel.employees[index].lastActiveTime == null ? "" : dateFormatter.format(employeeModel.employees[index].lastActiveTime)}")
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,9 @@
|
||||
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 'dart:math' as math;
|
||||
import 'package:fcs/charts/bar_chart.dart';
|
||||
import 'package:fcs/charts/delivery_do_line.dart';
|
||||
@@ -16,7 +22,6 @@ 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/notification_list.dart';
|
||||
import 'package:fcs/pages/settings.dart';
|
||||
import 'package:fcs/pages/term.dart';
|
||||
import 'package:fcs/reports/report_list.dart';
|
||||
import 'package:fcs/widget/banner.dart';
|
||||
@@ -33,8 +38,16 @@ import 'package:provider/provider.dart';
|
||||
|
||||
import '../theme/theme.dart';
|
||||
import 'announcement_list.dart';
|
||||
import 'buying_online.dart';
|
||||
import 'do/do_list.dart';
|
||||
import 'employee_list.dart';
|
||||
import 'my_registeration.dart';
|
||||
import 'pd/pd_list.dart';
|
||||
import 'po/shipment_list.dart';
|
||||
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';
|
||||
@@ -160,7 +173,7 @@ class _HomePageState extends State<HomePage> {
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => DOList())));
|
||||
|
||||
final deliveryBtn = _buildBtn("delivery.title",
|
||||
final shipmentBtn = _buildBtn("shipment.title",
|
||||
imgIcon: Image.asset(
|
||||
"assets/truck.png",
|
||||
width: 50,
|
||||
@@ -168,7 +181,7 @@ class _HomePageState extends State<HomePage> {
|
||||
color: primaryColor,
|
||||
),
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => DeliveryList())));
|
||||
.push(MaterialPageRoute(builder: (_) => ShipmentList())));
|
||||
|
||||
final storageBtn = _buildBtn("storage.title",
|
||||
imgIcon: Image.asset(
|
||||
@@ -190,16 +203,7 @@ class _HomePageState extends State<HomePage> {
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => PDList())));
|
||||
|
||||
final employeeBtn = _buildBtn("employee.title",
|
||||
imgIcon: Image.asset(
|
||||
"assets/employee.png",
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: primaryColor,
|
||||
),
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => EmployeeList())));
|
||||
|
||||
|
||||
final termBtn = _buildBtn2("term.title",
|
||||
icon: FontAwesomeIcons.fileContract,
|
||||
imgIcon: Image.asset(
|
||||
@@ -219,14 +223,38 @@ class _HomePageState extends State<HomePage> {
|
||||
);
|
||||
});
|
||||
|
||||
final settingsBtn =
|
||||
_buildBtn("setting.title", icon: Icons.settings, btnCallback: () {
|
||||
final signinBtn = _buildBtn2("login",
|
||||
icon: FontAwesomeIcons.signInAlt,
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => SigninPage())));
|
||||
|
||||
final buyingBtn =
|
||||
_buildBtn2("buy_online", icon: Icons.person, btnCallback: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => Settings()),
|
||||
MaterialPageRoute(builder: (context) => BuyingOnlinePage()),
|
||||
);
|
||||
});
|
||||
|
||||
final notiBtn = _buildBtn2("notifications.title", icon: Icons.notifications,
|
||||
btnCallback: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => NotificationList()),
|
||||
);
|
||||
});
|
||||
|
||||
final staffBtn = _buildBtn("staff.title",
|
||||
imgIcon: Image.asset(
|
||||
"assets/employee.png",
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: primaryColor,
|
||||
),
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => StaffList())));
|
||||
|
||||
|
||||
final _bankAccountsBtn = _buildBtn2("banks.title",
|
||||
icon: FontAwesomeIcons.moneyCheck, btnCallback: () {
|
||||
Navigator.push(
|
||||
@@ -236,6 +264,12 @@ class _HomePageState extends State<HomePage> {
|
||||
});
|
||||
|
||||
List<Widget> widgets = [helpBtn];
|
||||
widgets.add(signinBtn);
|
||||
widgets.add(buyingBtn);
|
||||
widgets.add(shipmentBtn);
|
||||
widgets.add(notiBtn);
|
||||
widgets.add(staffBtn);
|
||||
// widgets.add(_bankAccountsBtn);
|
||||
widgets.add(announcementBtn);
|
||||
widgets.add(pickUpBtn);
|
||||
widgets.add(fcsProfileBtn);
|
||||
|
||||
@@ -662,13 +662,14 @@ class _LoginPageState extends State<LoginPage>
|
||||
var phoneNumber = signupPhoneNumberController.text;
|
||||
try {
|
||||
await authModel.signup(name, password, confirmPassword, phoneNumber);
|
||||
Navigator.push(
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
SmsCodePage(id: phoneNumber, password: password),
|
||||
),
|
||||
);
|
||||
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
|
||||
@@ -9,9 +9,13 @@ import 'package:fcs/vo/manual.dart';
|
||||
import 'package:fcs/widget/local_text.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
|
||||
import '../../theme/theme.dart';
|
||||
import 'slide_page.dart';
|
||||
|
||||
class ManualPage extends StatefulWidget {
|
||||
final String marketplace;
|
||||
|
||||
const ManualPage({Key key, this.marketplace}) : super(key: key);
|
||||
@override
|
||||
_ManualPageState createState() => _ManualPageState();
|
||||
}
|
||||
@@ -45,49 +49,8 @@ class _ManualPageState extends State<ManualPage> {
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
actions: <Widget>[
|
||||
mainModel.isSysAdmin()
|
||||
? Row(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
versionName,
|
||||
style: TextStyle(fontSize: 15, color: Colors.black),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.refresh),
|
||||
color: Colors.blue,
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
manualModel.resetManualItems();
|
||||
helpList =
|
||||
manualModel.getHelpList(mainModel.isBuyer());
|
||||
});
|
||||
}),
|
||||
IconButton(
|
||||
icon: Icon(Icons.cloud_upload),
|
||||
color: Colors.blue,
|
||||
onPressed: () {
|
||||
_inputManualVersion(context, manualModel);
|
||||
})
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
iconTheme: IconThemeData(
|
||||
color: Colors.grey,
|
||||
),
|
||||
centerTitle: true,
|
||||
title: Stack(
|
||||
children: <Widget>[
|
||||
LocalText(
|
||||
context,
|
||||
"manual.title",
|
||||
fontSize: 25,
|
||||
),
|
||||
],
|
||||
),
|
||||
title: Text(widget.marketplace == null ? '' : widget.marketplace),
|
||||
backgroundColor: primaryColor,
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
|
||||
@@ -2,14 +2,12 @@ import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/model/notification_model.dart';
|
||||
import 'package:fcs/pages/util.dart';
|
||||
import 'package:fcs/vo/notification.dart' as Noti;
|
||||
import 'package:fcs/vo/popup_menu.dart';
|
||||
import 'package:fcs/widget/localization/app_translations.dart';
|
||||
import 'package:fcs/widget/popupmenu.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
|
||||
import '../theme/theme.dart';
|
||||
import '../widget/local_text.dart';
|
||||
|
||||
class NotificationList extends StatefulWidget {
|
||||
@override
|
||||
@@ -18,7 +16,7 @@ class NotificationList extends StatefulWidget {
|
||||
|
||||
class _NotificationListState extends State<NotificationList> {
|
||||
var timeFormatter = new DateFormat('KK:mm a');
|
||||
var dateFormatter = new DateFormat('dd MMM');
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
final double dotSize = 15.0;
|
||||
int _selectedIndex = 0;
|
||||
bool _isLoading = false;
|
||||
@@ -34,69 +32,74 @@ class _NotificationListState extends State<NotificationList> {
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(AppTranslations.of(context).text("noti.title")),
|
||||
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();
|
||||
}),
|
||||
],
|
||||
title: LocalText(
|
||||
context,
|
||||
'noti.title',
|
||||
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(
|
||||
@@ -105,9 +108,9 @@ class _NotificationListState extends State<NotificationList> {
|
||||
scrollDirection: Axis.vertical,
|
||||
padding: EdgeInsets.only(left: 15, right: 15, top: 15),
|
||||
shrinkWrap: true,
|
||||
itemCount: notificationModel.notis.length,
|
||||
itemCount: notificationModel.notifications.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
Noti.Notification noti = notificationModel.notis[index];
|
||||
Noti.Notification noti = notificationModel.notifications[index];
|
||||
return Stack(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
@@ -116,31 +119,39 @@ class _NotificationListState extends State<NotificationList> {
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
new Padding(
|
||||
padding: new EdgeInsets.symmetric(
|
||||
horizontal: 32.0 - dotSize / 2),
|
||||
child: Icon(Icons.message),
|
||||
),
|
||||
// new Padding(
|
||||
// padding: new EdgeInsets.symmetric(
|
||||
// horizontal: 32.0 - dotSize / 2),
|
||||
// child: Icon(Icons.message),
|
||||
// ),
|
||||
new Padding(padding: EdgeInsets.only(left: 10)),
|
||||
new Expanded(
|
||||
child: new Column(
|
||||
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: Colors.black),
|
||||
color: secondaryColor),
|
||||
),
|
||||
new Text(
|
||||
noti.itemType == "reg"
|
||||
? ""
|
||||
: noti.itemNumber,
|
||||
noti.status == null ? "" : noti.status,
|
||||
style: new TextStyle(
|
||||
fontSize: 13.0, color: Colors.grey),
|
||||
fontSize: 13.0,
|
||||
color: secondaryColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -164,31 +175,31 @@ 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,
|
||||
),
|
||||
),
|
||||
)
|
||||
// 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,
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
);
|
||||
}),
|
||||
@@ -196,10 +207,5 @@ class _NotificationListState extends State<NotificationList> {
|
||||
);
|
||||
}
|
||||
|
||||
_display(Noti.Notification noti) async {
|
||||
if (_isClicked) return;
|
||||
_isClicked = true;
|
||||
await displayNotiContent(context, noti);
|
||||
_isClicked = false;
|
||||
}
|
||||
_display(Noti.Notification noti) {}
|
||||
}
|
||||
|
||||
@@ -1,291 +0,0 @@
|
||||
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/main_model.dart';
|
||||
import 'package:fcs/model/po_model.dart';
|
||||
import 'package:fcs/pages/po/po_submission_form.dart';
|
||||
import 'package:fcs/pages/util.dart';
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/vo/po.dart';
|
||||
import 'package:fcs/vo/popup_menu.dart';
|
||||
import 'package:fcs/widget/localization/app_translations.dart';
|
||||
import 'package:fcs/widget/popupmenu.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
|
||||
class SubmissionList extends StatefulWidget {
|
||||
@override
|
||||
_SubmissionListState createState() => _SubmissionListState();
|
||||
}
|
||||
|
||||
class _SubmissionListState extends State<SubmissionList> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
final double dotSize = 10.0;
|
||||
PopupMenu selectedChoices = poMenus[0];
|
||||
POSubmission poSubmission;
|
||||
DateTime _selectedDate = DateTime.now();
|
||||
String status;
|
||||
int _selectedIndex = 0;
|
||||
int _dateIndex = 0;
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
var poModel = Provider.of<POSubmissionModel>(context, listen: false);
|
||||
_selectedIndex = poModel.popupMenu.index;
|
||||
_dateIndex = poModel.dateIndex;
|
||||
_selectedDate = poModel.selectedDate;
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<Null> _selectDate(BuildContext context) async {
|
||||
var poSubmissionModel = Provider.of<POSubmissionModel>(context);
|
||||
|
||||
final DateTime picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: _selectedDate,
|
||||
firstDate: DateTime(2015, 8),
|
||||
lastDate: DateTime(2101),
|
||||
builder: (BuildContext context, Widget child) {
|
||||
return Theme(
|
||||
data: ThemeData.light().copyWith(
|
||||
primaryColor: primaryColor, //Head background
|
||||
accentColor: secondaryColor, //selection color
|
||||
dialogBackgroundColor: Colors.white, //Background color
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
);
|
||||
if (picked != null) {
|
||||
var pickedDate = new DateTime(picked.year, picked.month, picked.day);
|
||||
var currentDate = new DateTime(
|
||||
DateTime.now().year, DateTime.now().month, DateTime.now().day);
|
||||
|
||||
this._dateIndex = pickedDate == currentDate ? 0 : 1;
|
||||
setState(() {
|
||||
_selectedDate = picked;
|
||||
poSubmissionModel.filterData(
|
||||
this.status, _selectedDate, this._selectedIndex, this._dateIndex);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var poSubmissionModel = Provider.of<POSubmissionModel>(context);
|
||||
MainModel mainModel = Provider.of<MainModel>(context);
|
||||
bool isBuyer = mainModel.user.isBuyer();
|
||||
var languageModle = Provider.of<LanguageModel>(context);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: primaryColor,
|
||||
title: Text(
|
||||
AppTranslations.of(context).text("po.title"),
|
||||
style: languageModle.isEng
|
||||
? TextStyle()
|
||||
: TextStyle(fontFamily: 'MyanmarUnicode'),
|
||||
),
|
||||
actions: <Widget>[
|
||||
InkWell(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Image.asset(
|
||||
"assets/date_filter.png",
|
||||
color: Colors.white,
|
||||
width: 25,
|
||||
),
|
||||
_dateIndex == 0
|
||||
? Container()
|
||||
: Positioned(
|
||||
bottom: 15,
|
||||
right: 10,
|
||||
child: Container(
|
||||
width: 10,
|
||||
height: 10,
|
||||
decoration: new BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: secondaryColor,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () => _selectDate(context),
|
||||
),
|
||||
PopupMenuButton<PopupMenu>(
|
||||
elevation: 3.2,
|
||||
onSelected: (selected) {
|
||||
setState(() {
|
||||
_selectedIndex = selected.index;
|
||||
});
|
||||
if (selected.status == 'All') {
|
||||
status = null;
|
||||
} else {
|
||||
status = selected.status;
|
||||
}
|
||||
poSubmissionModel.filterData(
|
||||
status, _selectedDate, _selectedIndex, _dateIndex);
|
||||
},
|
||||
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 statusMenu.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();
|
||||
}),
|
||||
],
|
||||
),
|
||||
floatingActionButton: isBuyer
|
||||
? FloatingActionButton(
|
||||
backgroundColor: primaryColor,
|
||||
heroTag: "btn2",
|
||||
onPressed: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => POSubmissionForm()),
|
||||
),
|
||||
child: Icon(Icons.add),
|
||||
)
|
||||
: null,
|
||||
body: new ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
padding: EdgeInsets.only(left: 15, right: 15, top: 15),
|
||||
shrinkWrap: true,
|
||||
itemCount: poSubmissionModel.pos.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Card(
|
||||
elevation: 10,
|
||||
color: Colors.white,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => POSubmissionForm(
|
||||
poSubmission: poSubmissionModel.pos[index],
|
||||
)),
|
||||
);
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
new Padding(
|
||||
padding: new EdgeInsets.symmetric(
|
||||
horizontal: 15.0 - dotSize / 2),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(5.0),
|
||||
child: Image.asset(
|
||||
"assets/pay.png",
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
new Expanded(
|
||||
child: new Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
poSubmissionModel.pos[index].poNumber
|
||||
.toString(),
|
||||
style: new TextStyle(
|
||||
fontSize: 12.0, color: Colors.black),
|
||||
),
|
||||
new Text(
|
||||
dateFormatter.format(
|
||||
poSubmissionModel.pos[index].poDate),
|
||||
style: new TextStyle(
|
||||
fontSize: 12.0, color: Colors.grey),
|
||||
),
|
||||
!isBuyer
|
||||
? new Text(
|
||||
poSubmissionModel
|
||||
.pos[index].userName
|
||||
.toString(),
|
||||
style: new TextStyle(
|
||||
fontSize: 12.0,
|
||||
color: Colors.grey),
|
||||
)
|
||||
: Container()
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 18.0),
|
||||
child: getStatus(poSubmissionModel.pos[index].status),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
163
lib/pages/po/shipment_list.dart
Normal file
163
lib/pages/po/shipment_list.dart
Normal file
@@ -0,0 +1,163 @@
|
||||
import 'package:fcs/vo/shipment.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
|
||||
import '../../model/announcement_model.dart';
|
||||
import '../../widget/local_text.dart';
|
||||
import '../util.dart';
|
||||
|
||||
class ShipmentList extends StatefulWidget {
|
||||
@override
|
||||
_ShipmentListState createState() => _ShipmentListState();
|
||||
}
|
||||
|
||||
class _ShipmentListState extends State<ShipmentList> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
final double dotSize = 10.0;
|
||||
String status;
|
||||
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var shipmentModel = Provider.of<AnnouncementModel>(context);
|
||||
final addbutton = Container(
|
||||
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
|
||||
child: Container(
|
||||
height: 45.0,
|
||||
decoration: BoxDecoration(
|
||||
color: primaryColor,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||||
child: ButtonTheme(
|
||||
minWidth: 900.0,
|
||||
height: 100.0,
|
||||
child: FlatButton(
|
||||
onPressed: () {
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => ManualPage(
|
||||
// marketplace: 'Amazon',
|
||||
// )));
|
||||
},
|
||||
child: LocalText(
|
||||
context,
|
||||
'shipment.add',
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(context, 'shipment.title',
|
||||
fontSize: 18, color: Colors.white),
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
padding: EdgeInsets.only(left: 15, right: 15, top: 15),
|
||||
shrinkWrap: true,
|
||||
itemCount: shipmentModel.shipments.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
Shipment _shipment = shipmentModel.shipments[index];
|
||||
return Card(
|
||||
elevation: 10,
|
||||
color: Colors.white,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => POSubmissionForm(
|
||||
// poSubmission: _shipment,
|
||||
// )),
|
||||
// );
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 16.0),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
new Padding(
|
||||
padding: new EdgeInsets.symmetric(
|
||||
horizontal: 15.0 - dotSize / 2),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(5.0),
|
||||
child: Image.asset(
|
||||
"assets/truck.png",
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
new Expanded(
|
||||
child: new Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
_shipment.shipmentNumber.toString(),
|
||||
style: new TextStyle(
|
||||
fontSize: 12.0,
|
||||
color: Colors.black),
|
||||
),
|
||||
new Text(
|
||||
dateFormatter
|
||||
.format(_shipment.shipDate),
|
||||
style: new TextStyle(
|
||||
fontSize: 12.0,
|
||||
color: Colors.grey),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 18.0),
|
||||
child: getStatus(_shipment.status),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
addbutton,
|
||||
SizedBox(height: 15)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,198 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/model/main_model.dart';
|
||||
import 'package:fcs/pages/setting_editor.dart';
|
||||
import 'package:fcs/pages/setting_editor_byOwner.dart';
|
||||
import 'package:fcs/vo/setting.dart';
|
||||
import 'package:fcs/widget/local_text.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
|
||||
import '../theme/theme.dart';
|
||||
|
||||
class Settings extends StatefulWidget {
|
||||
@override
|
||||
_SettingState createState() => _SettingState();
|
||||
}
|
||||
|
||||
class _SettingState extends State<Settings> {
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
MainModel mainModel = Provider.of<MainModel>(context);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: LocalText(
|
||||
context,
|
||||
"setting.title",
|
||||
fontSize: 20,
|
||||
color: Colors.white,
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
actions: <Widget>[
|
||||
mainModel.isBizAdmin() || mainModel.isSysAdmin()
|
||||
? IconButton(
|
||||
icon: Icon(Icons.edit),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => SettingEidtor(
|
||||
setting: mainModel.setting,
|
||||
)),
|
||||
);
|
||||
})
|
||||
: Container()
|
||||
],
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.only(
|
||||
left: 25.0,
|
||||
right: 25.0,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Text("PO will expire in"),
|
||||
subtitle: Text("After PO is submitted"),
|
||||
trailing: Text(
|
||||
mainModel.setting.poExpireInHours.toString() + " hours"),
|
||||
),
|
||||
Divider(color: secondaryColor),
|
||||
Container(
|
||||
alignment: Alignment.topRight,
|
||||
child: mainModel.isOwnerAndAbove() || mainModel.isAdmin()
|
||||
? IconButton(
|
||||
padding: EdgeInsets.all(0),
|
||||
visualDensity: VisualDensity.compact,
|
||||
icon: Icon(Icons.edit),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => SettingOwner(
|
||||
setting: mainModel.setting,
|
||||
)),
|
||||
);
|
||||
})
|
||||
: SizedBox(),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Text("PO submission opened at"),
|
||||
trailing: Text("${mainModel.setting.getPoOpenAt}"),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Text("PO submission closed at"),
|
||||
trailing: Text("${mainModel.setting.getPoCloseAt}"),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Text("PO submission closed on"),
|
||||
subtitle: Text(
|
||||
mainModel.setting.getPoCloseOn,
|
||||
style: textStyleOdd,
|
||||
),
|
||||
),
|
||||
Divider(color: secondaryColor),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Text("Latest Delivery Day at"),
|
||||
trailing: Text("${mainModel.setting.latestDeliveryDay} days"),
|
||||
),
|
||||
Divider(color: secondaryColor),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Text("First storage charge starts in"),
|
||||
subtitle: Text("After PO is approved"),
|
||||
trailing:
|
||||
Text("${mainModel.setting.firstStorageChargeIn} days"),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Text(
|
||||
"First storage charge ",
|
||||
style: TextStyle(backgroundColor: Colors.greenAccent),
|
||||
),
|
||||
trailing:
|
||||
Text("${mainModel.setting.firstStorageCharge} Kyats/Liter"),
|
||||
),
|
||||
Divider(color: secondaryColor),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Text("Second storage charge starts in"),
|
||||
subtitle: Text("After PO is approved"),
|
||||
trailing:
|
||||
Text("${mainModel.setting.secondStorageChargeIn} days"),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Text(
|
||||
"Second storage charge ",
|
||||
style: TextStyle(backgroundColor: Colors.amber),
|
||||
),
|
||||
trailing: Text(
|
||||
"${mainModel.setting.secondStorageCharge} Kyats/Liter"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget buildSettingTile(
|
||||
{@required String text,
|
||||
@required BuildContext context,
|
||||
@required String image,
|
||||
@required GestureTapCallback tap}) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
tap();
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 8.0, bottom: 5),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 12.0, right: 20.0),
|
||||
child: Image.asset(
|
||||
image,
|
||||
width: 28,
|
||||
height: 28,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
LocalText(
|
||||
context,
|
||||
text,
|
||||
fontSize: 15.0,
|
||||
color: Colors.black87,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Icon(Icons.keyboard_arrow_right)
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
color: Colors.grey,
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
175
lib/pages/signin_page.dart
Normal file
175
lib/pages/signin_page.dart
Normal file
@@ -0,0 +1,175 @@
|
||||
import 'package:country_code_picker/country_code_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import '../theme/theme.dart';
|
||||
import '../widget/local_text.dart';
|
||||
import '../widget/progress.dart';
|
||||
import 'code_page.dart';
|
||||
import 'util.dart';
|
||||
|
||||
class SigninPage extends StatefulWidget {
|
||||
@override
|
||||
_SigninPageState createState() => _SigninPageState();
|
||||
}
|
||||
|
||||
class _SigninPageState extends State<SigninPage> {
|
||||
bool _isLoading = false;
|
||||
String dialCode;
|
||||
|
||||
TextEditingController phonenumberCtl;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
phonenumberCtl = new TextEditingController(text: "09");
|
||||
phonenumberCtl.selection = TextSelection.fromPosition(
|
||||
TextPosition(offset: phonenumberCtl.text.length));
|
||||
|
||||
dialCode = "+95";
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: new Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: primaryColor,
|
||||
),
|
||||
body: _buildLogin(context),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLogin(BuildContext context) {
|
||||
return ListView(
|
||||
padding: EdgeInsets.only(top: 5, left: 15, right: 15),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 40),
|
||||
child: LocalText(
|
||||
context,
|
||||
'login.title',
|
||||
fontSize: 21,
|
||||
color: secondaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 25),
|
||||
child: LocalText(
|
||||
context,
|
||||
'login.phone',
|
||||
color: labelColor,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey[400], width: 1),
|
||||
borderRadius: BorderRadius.all(Radius.circular(12.0))),
|
||||
child: CountryCodePicker(
|
||||
onChanged: _countryChange,
|
||||
initialSelection: dialCode,
|
||||
countryFilter: ['+95', '+65', '+66'],
|
||||
showCountryOnly: false,
|
||||
showOnlyCountryWhenClosed: false,
|
||||
alignLeft: false,
|
||||
textStyle: TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Flexible(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: 10, bottom: 10),
|
||||
child: TextFormField(
|
||||
autofocus: true,
|
||||
controller: phonenumberCtl,
|
||||
cursorColor: primaryColor,
|
||||
keyboardType: TextInputType.phone,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.all(8.0),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12.0)),
|
||||
borderSide:
|
||||
BorderSide(color: Colors.grey[400], width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||
borderSide: BorderSide(
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _next(),
|
||||
child: CircleAvatar(
|
||||
minRadius: 25,
|
||||
backgroundColor: primaryColor,
|
||||
child: Icon(
|
||||
FontAwesomeIcons.arrowRight,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
_countryChange(CountryCode countryCode) {
|
||||
setState(() {
|
||||
dialCode = countryCode.dialCode;
|
||||
});
|
||||
}
|
||||
|
||||
_next() async {
|
||||
String phoneNumber = phonenumberCtl.text;
|
||||
if (phoneNumber.length < 5) {
|
||||
showMsgDialog(context, "Error", "Invalid phone number");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Exception exp;
|
||||
phoneNumber = phoneNumber[0] == "0"
|
||||
? phoneNumber.replaceFirst("0", "")
|
||||
: phoneNumber;
|
||||
phoneNumber = dialCode + phoneNumber;
|
||||
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => CodePage(phoneNumber: phoneNumber)));
|
||||
|
||||
if (exp != null) throw exp;
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:progress/progress.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/model/main_model.dart';
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/widget/localization/app_translations.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
|
||||
import '../model/main_model.dart';
|
||||
import '../theme/theme.dart';
|
||||
import '../widget/localization/app_translations.dart';
|
||||
import '../widget/progress.dart';
|
||||
import 'util.dart';
|
||||
|
||||
class SmsCodePage extends StatefulWidget {
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/model/employee_model.dart';
|
||||
import 'package:fcs/model/language_model.dart';
|
||||
import 'package:fcs/model/log_model.dart';
|
||||
import 'package:fcs/model/main_model.dart';
|
||||
import 'package:fcs/model/user_model.dart';
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
@@ -16,14 +15,14 @@ import 'util.dart';
|
||||
|
||||
typedef void FindCallBack();
|
||||
|
||||
class EmployeeEditor extends StatefulWidget {
|
||||
final User employee;
|
||||
const EmployeeEditor({this.employee});
|
||||
class StaffEditor extends StatefulWidget {
|
||||
final User staff;
|
||||
const StaffEditor({this.staff});
|
||||
@override
|
||||
_EmployeeEditorState createState() => _EmployeeEditorState();
|
||||
_StaffEditorState createState() => _StaffEditorState();
|
||||
}
|
||||
|
||||
class _EmployeeEditorState extends State<EmployeeEditor> {
|
||||
class _StaffEditorState extends State<StaffEditor> {
|
||||
TextEditingController _name = new TextEditingController();
|
||||
TextEditingController _phone = new TextEditingController();
|
||||
TextEditingController _phoneInput = new TextEditingController();
|
||||
@@ -39,61 +38,53 @@ class _EmployeeEditorState extends State<EmployeeEditor> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
privileges = Provider.of<UserModel>(context, listen: false).getPrivileges;
|
||||
if (widget.employee != null) {
|
||||
_name.text = widget.employee.name;
|
||||
_phone.text = widget.employee.phone;
|
||||
privileges.forEach((p) => widget.employee.privilegeIds.contains(p.id)
|
||||
? p.isChecked = true
|
||||
: p.isChecked = false);
|
||||
privileges = Provider.of<UserModel>(context, listen: false).privileges;
|
||||
if (widget.staff != null) {
|
||||
_name.text = widget.staff.name;
|
||||
_phone.text = widget.staff.phone;
|
||||
// privileges.forEach((p) => widget.employee.privilegeIds.contains(p.id)
|
||||
// ? p.isChecked = true
|
||||
// : p.isChecked = false);
|
||||
} else {
|
||||
privileges.forEach((p) => p.isChecked = false);
|
||||
}
|
||||
}
|
||||
|
||||
Widget showprivilegeList(BuildContext context, UserModel userModel) {
|
||||
return Container(
|
||||
width: 300,
|
||||
height: 300,
|
||||
child: ListView.builder(
|
||||
itemCount: privileges.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return new ListTile(
|
||||
title: new Row(
|
||||
children: <Widget>[
|
||||
new Checkbox(
|
||||
value: privileges[index].isChecked == null
|
||||
? false
|
||||
: privileges[index].isChecked,
|
||||
activeColor: primaryColor,
|
||||
onChanged: (bool value) {
|
||||
setState(() {
|
||||
privileges[index].isChecked = value;
|
||||
});
|
||||
}),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
userModel.getPrivileges[index].name,
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.5,
|
||||
child: new Text(
|
||||
userModel.getPrivileges[index].desc,
|
||||
style:
|
||||
TextStyle(fontSize: 12.0, color: Colors.grey[600]),
|
||||
),
|
||||
),
|
||||
],
|
||||
List<Widget> showprivilegeList(BuildContext context, UserModel userModel) {
|
||||
return privileges.map((p) {
|
||||
return new ListTile(
|
||||
title: new Row(
|
||||
children: <Widget>[
|
||||
new Checkbox(
|
||||
value: p.isChecked == null ? false : p.isChecked,
|
||||
activeColor: primaryColor,
|
||||
onChanged: (bool value) {
|
||||
setState(() {
|
||||
p.isChecked = value;
|
||||
});
|
||||
}),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
p.name,
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
),
|
||||
],
|
||||
));
|
||||
}),
|
||||
);
|
||||
),
|
||||
// Container(
|
||||
// width: MediaQuery.of(context).size.width * 0.5,
|
||||
// child: new Text(
|
||||
// userModel.getPrivileges[index].desc,
|
||||
// style:
|
||||
// TextStyle(fontSize: 12.0, color: Colors.grey[600]),
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
],
|
||||
));
|
||||
}).toList();
|
||||
}
|
||||
|
||||
Widget phoneInputbox(BuildContext context, FindCallBack findCallBack) {
|
||||
@@ -193,22 +184,22 @@ class _EmployeeEditorState extends State<EmployeeEditor> {
|
||||
],
|
||||
);
|
||||
|
||||
final saveButton = Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 24.0,
|
||||
right: 24.0,
|
||||
),
|
||||
final updateButton = Container(
|
||||
padding: EdgeInsets.only(top: 40),
|
||||
child: Container(
|
||||
height: 45.0,
|
||||
color: primaryColor,
|
||||
decoration: BoxDecoration(
|
||||
color: primaryColor,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||||
child: ButtonTheme(
|
||||
minWidth: 900.0,
|
||||
height: 100.0,
|
||||
child: FlatButton(
|
||||
onPressed: _save,
|
||||
onPressed: () {},
|
||||
child: LocalText(
|
||||
context,
|
||||
'employee.save',
|
||||
'staff.update',
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -246,59 +237,52 @@ class _EmployeeEditorState extends State<EmployeeEditor> {
|
||||
);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(
|
||||
context,
|
||||
"employee.item.title",
|
||||
"staff.form.title",
|
||||
fontSize: 20,
|
||||
color: Colors.white,
|
||||
),
|
||||
actions: <Widget>[
|
||||
widget.employee == null || !mainModel.showHistoryBtn()
|
||||
? Container()
|
||||
: IconButton(
|
||||
icon: Icon(Icons.history),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => DocumentLogPage(
|
||||
docID: widget.employee.docID)),
|
||||
);
|
||||
},
|
||||
),
|
||||
// actions: <Widget>[
|
||||
// widget.staff == null || !mainModel.showHistoryBtn()
|
||||
// ? Container()
|
||||
// : IconButton(
|
||||
// icon: Icon(Icons.history),
|
||||
// onPressed: () {
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => DocumentLogPage(
|
||||
// docID: widget.staff.docID)),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
),
|
||||
body: ListView(
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.only(left: 24.0, right: 24.0),
|
||||
children: <Widget>[
|
||||
widget.staff == null
|
||||
? phoneInputbox(context, () => _findUser(context))
|
||||
: phoneNumberBox,
|
||||
widget.staff == null
|
||||
? this.isSend ? namebox : Container()
|
||||
: namebox,
|
||||
Column(
|
||||
children: showprivilegeList(context, userModel),
|
||||
),
|
||||
updateButton,
|
||||
SizedBox(
|
||||
height: 20,
|
||||
)
|
||||
],
|
||||
),
|
||||
body: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.only(left: 24.0, right: 24.0),
|
||||
children: <Widget>[
|
||||
widget.employee == null
|
||||
? phoneInputbox(context, () => _findUser(context))
|
||||
: phoneNumberBox,
|
||||
widget.employee == null
|
||||
? this.isSend ? namebox : Container()
|
||||
: namebox,
|
||||
showprivilegeList(context, userModel)
|
||||
],
|
||||
),
|
||||
),
|
||||
widget.employee == null ? addButton : saveButton,
|
||||
SizedBox(
|
||||
height: 20,
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
_add(BuildContext context) async {
|
||||
@@ -328,11 +312,11 @@ class _EmployeeEditorState extends State<EmployeeEditor> {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
if (widget.employee == null) return;
|
||||
if (widget.staff == null) return;
|
||||
var employeeModel = Provider.of<EmployeeModel>(context);
|
||||
try {
|
||||
await employeeModel.updatePrivileges(
|
||||
widget.employee.docID, privilegesIDs());
|
||||
widget.staff.docID, privilegesIDs());
|
||||
Navigator.pop(context);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
130
lib/pages/staff_list.dart
Normal file
130
lib/pages/staff_list.dart
Normal file
@@ -0,0 +1,130 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/model/employee_model.dart';
|
||||
import 'package:fcs/theme/theme.dart';
|
||||
import 'package:fcs/widget/progress.dart';
|
||||
|
||||
import '../theme/theme.dart';
|
||||
import '../vo/user.dart';
|
||||
import '../widget/local_text.dart';
|
||||
import 'staff_editor.dart';
|
||||
import 'util.dart';
|
||||
|
||||
class StaffList extends StatefulWidget {
|
||||
@override
|
||||
_StaffListState createState() => _StaffListState();
|
||||
}
|
||||
|
||||
class _StaffListState extends State<StaffList> {
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy - hh:mm:ss a');
|
||||
final double dotSize = 15.0;
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var employeeModel = Provider.of<EmployeeModel>(context);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(
|
||||
context,
|
||||
'staff.title',
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
// floatingActionButton: FloatingActionButton(
|
||||
// backgroundColor: primaryColor,
|
||||
// child: Icon(Icons.add),
|
||||
// onPressed: () {
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(builder: (context) => EmployeeEditor()),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
body: new ListView.builder(
|
||||
padding: EdgeInsets.only(left: 10, right: 10, top: 15),
|
||||
shrinkWrap: true,
|
||||
itemCount: employeeModel.employees.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
User _user = employeeModel.employees[index];
|
||||
return Container(
|
||||
child: Card(
|
||||
elevation: 10,
|
||||
color: Colors.white,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
StaffEditor(staff: _user)),
|
||||
);
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20.0),
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
new Padding(
|
||||
padding: new EdgeInsets.symmetric(
|
||||
horizontal: 32.0 - dotSize / 2),
|
||||
child: Image.asset(
|
||||
"assets/employee.png",
|
||||
width: 40,
|
||||
height: 40,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
new Expanded(
|
||||
child: new Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
_user.name,
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0,
|
||||
color: secondaryColor),
|
||||
),
|
||||
new Text(
|
||||
_user.phoneNumber,
|
||||
style: new TextStyle(
|
||||
fontSize: 13.0,
|
||||
color: secondaryColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
_user.status == null
|
||||
? Container()
|
||||
: Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: getStatus(_user.status),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
112
lib/pages/user_edit.dart
Normal file
112
lib/pages/user_edit.dart
Normal file
@@ -0,0 +1,112 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import '../theme/theme.dart';
|
||||
import '../theme/theme.dart';
|
||||
import '../widget/local_text.dart';
|
||||
import '../widget/progress.dart';
|
||||
|
||||
class UserEditPage extends StatefulWidget {
|
||||
@override
|
||||
_UserEditPageState createState() => _UserEditPageState();
|
||||
}
|
||||
|
||||
class _UserEditPageState extends State<UserEditPage> {
|
||||
bool _isLoading = false;
|
||||
TextEditingController nameCtl;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
nameCtl = new TextEditingController();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: new Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: primaryColor,
|
||||
),
|
||||
body: _buildBody(context),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBody(BuildContext context) {
|
||||
return ListView(
|
||||
padding: EdgeInsets.only(top: 5, left: 15, right: 15),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 40),
|
||||
child: LocalText(
|
||||
context,
|
||||
'user_edit.welcome',
|
||||
fontSize: 21,
|
||||
color: secondaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 25),
|
||||
child: LocalText(
|
||||
context,
|
||||
'user_edit.name',
|
||||
color: labelColor,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 10, bottom: 10),
|
||||
child: TextFormField(
|
||||
autofocus: true,
|
||||
controller: nameCtl,
|
||||
cursorColor: primaryColor,
|
||||
keyboardType: TextInputType.text,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.all(8.0),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12.0)),
|
||||
borderSide: BorderSide(color: Colors.grey[400], width: 1),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||
borderSide: BorderSide(
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _submit(),
|
||||
child: CircleAvatar(
|
||||
minRadius: 25,
|
||||
backgroundColor: primaryColor,
|
||||
child: Icon(
|
||||
FontAwesomeIcons.check,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
_submit() async {}
|
||||
}
|
||||
@@ -198,7 +198,7 @@ void showCommentDialog(BuildContext context, commentCallback(comment)) {
|
||||
}
|
||||
|
||||
Widget getStatus(String status) {
|
||||
return status == "approved"
|
||||
return status == "Delivered"
|
||||
? Chip(
|
||||
backgroundColor: Colors.green,
|
||||
avatar: Icon(
|
||||
@@ -222,9 +222,9 @@ Widget getStatus(String status) {
|
||||
status,
|
||||
style: TextStyle(color: Colors.white, fontSize: 12),
|
||||
))
|
||||
: status == "pending"
|
||||
: status == "In progress"
|
||||
? Chip(
|
||||
backgroundColor: Colors.blue,
|
||||
backgroundColor: Colors.red,
|
||||
avatar: Icon(
|
||||
Icons.timelapse,
|
||||
color: Colors.white,
|
||||
|
||||
@@ -8,6 +8,7 @@ const thirdColor = const Color(0xFF0700f1);
|
||||
const nextColor = const Color(0xFFfa833d);
|
||||
const buttonColor = const Color(0xFFFFFFFF);
|
||||
const buttonBkColor = const Color(0xFF268944);
|
||||
const labelColor = const Color(0xFF757575);
|
||||
|
||||
const TextStyle labelStyle =
|
||||
TextStyle(fontSize: 13, color: Colors.grey, fontWeight: FontWeight.w500);
|
||||
@@ -24,7 +25,7 @@ TextStyle newLabelStyle(
|
||||
bool underline = false}) {
|
||||
return TextStyle(
|
||||
fontSize: fontSize == null ? 13 : fontSize,
|
||||
color: color == null ? Colors.grey : color,
|
||||
color: color == null ? secondaryColor : color,
|
||||
fontWeight: fontWeight == null ? FontWeight.w500 : fontWeight,
|
||||
decoration: underline ? TextDecoration.underline : TextDecoration.none);
|
||||
}
|
||||
@@ -36,7 +37,7 @@ TextStyle newLabelStyleMM(
|
||||
bool underline = false}) {
|
||||
return TextStyle(
|
||||
fontSize: fontSize == null ? 13 : fontSize,
|
||||
color: color == null ? Colors.grey : color,
|
||||
color: color == null ? secondaryColor : color,
|
||||
fontWeight: fontWeight == null ? FontWeight.w500 : fontWeight,
|
||||
decoration: underline ? TextDecoration.underline : TextDecoration.none,
|
||||
fontFamily: "MyanmarUnicode");
|
||||
@@ -85,7 +86,6 @@ final BoxDecoration tableRowEven = BoxDecoration(
|
||||
color: Colors.white54,
|
||||
);
|
||||
|
||||
|
||||
class LoginColors {
|
||||
const LoginColors();
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ class Notification {
|
||||
String desc;
|
||||
DateTime time;
|
||||
bool seen;
|
||||
String marketPlace;
|
||||
String status;
|
||||
|
||||
Notification(
|
||||
{this.id,
|
||||
@@ -16,11 +18,13 @@ class Notification {
|
||||
this.itemType,
|
||||
this.desc,
|
||||
this.time,
|
||||
this.seen});
|
||||
this.seen,
|
||||
this.marketPlace,
|
||||
this.status});
|
||||
|
||||
String get getDesc =>
|
||||
desc != null && desc.length > 30 ? desc.substring(0, 30) : desc;
|
||||
|
||||
|
||||
bool fromToday() {
|
||||
var now = DateTime.now();
|
||||
return time.day == now.day &&
|
||||
|
||||
6
lib/vo/shipment.dart
Normal file
6
lib/vo/shipment.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
class Shipment {
|
||||
DateTime shipDate;
|
||||
String shipmentNumber;
|
||||
String status;
|
||||
Shipment({this.shipDate, this.shipmentNumber,this.status});
|
||||
}
|
||||
@@ -8,6 +8,9 @@ class User {
|
||||
final String corpId;
|
||||
final String name;
|
||||
String phoneNumber;
|
||||
String fcsID;
|
||||
String shippingAddress;
|
||||
String deliveryAddress;
|
||||
String get phone => phoneNumber != null && phoneNumber.startsWith("959")
|
||||
? "0${phoneNumber.substring(2)}"
|
||||
: phoneNumber;
|
||||
@@ -78,6 +81,9 @@ class User {
|
||||
this.name,
|
||||
this.gender,
|
||||
this.phoneNumber,
|
||||
this.fcsID,
|
||||
this.shippingAddress,
|
||||
this.deliveryAddress,
|
||||
this.dateofBirth,
|
||||
this.corpId,
|
||||
this.roleName,
|
||||
|
||||
@@ -8,14 +8,17 @@ Widget labeledText(BuildContext context, String text, String label,
|
||||
{bool number = false}) {
|
||||
final w = Container(
|
||||
padding: EdgeInsets.only(top: 3, left: 10, bottom: 3, right: 10),
|
||||
child: Wrap(
|
||||
alignment: number ? WrapAlignment.spaceBetween : WrapAlignment.start,
|
||||
// scrollDirection: Axis.horizontal,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
LocalText(context, label),
|
||||
LocalText(
|
||||
context,
|
||||
label,
|
||||
fontSize: 15,
|
||||
),
|
||||
// number ? Spacer() : Container(),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 10),
|
||||
// padding: EdgeInsets.only(left: 10),
|
||||
// alignment: number ? Alignment.topRight : null,
|
||||
child: Text(
|
||||
text == null ? "" : text,
|
||||
|
||||
@@ -12,7 +12,7 @@ class LocalText extends Text {
|
||||
double fontSize,
|
||||
FontWeight fontWeight,
|
||||
List<String> translationVariables,
|
||||
bool underline=false})
|
||||
bool underline = false})
|
||||
: super(
|
||||
AppTranslations.of(context).text(translationKey,
|
||||
translationVariables: translationVariables),
|
||||
|
||||
14
pubspec.lock
14
pubspec.lock
@@ -113,6 +113,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
country_code_picker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: country_code_picker
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.14"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -520,6 +527,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.2"
|
||||
pin_input_text_field:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: pin_input_text_field
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -63,6 +63,8 @@ dependencies:
|
||||
flutter_downloader: ^1.4.4
|
||||
downloads_path_provider: ^0.1.0
|
||||
permission_handler: ^4.0.0
|
||||
country_code_picker: ^1.3.12
|
||||
pin_input_text_field:
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Reference in New Issue
Block a user