modify
This commit is contained in:
@@ -521,6 +521,9 @@
|
|||||||
"package.edit.title":"PACKAGE",
|
"package.edit.title":"PACKAGE",
|
||||||
|
|
||||||
"pickup.date": "Pickup Date",
|
"pickup.date": "Pickup Date",
|
||||||
|
"pickup.location_time": "Pickup Location / Time",
|
||||||
|
"pickup.information": "Pickup Informations",
|
||||||
|
"pickup.recipient_information": "Recipient Informations",
|
||||||
|
|
||||||
"message.btn":"Messages",
|
"message.btn":"Messages",
|
||||||
"message.title":"MESSAGES",
|
"message.title":"MESSAGES",
|
||||||
@@ -531,5 +534,16 @@
|
|||||||
"invoices.btn": "Invoices",
|
"invoices.btn": "Invoices",
|
||||||
"invoices.title": "INVOICES",
|
"invoices.title": "INVOICES",
|
||||||
|
|
||||||
"term":"TERMS"
|
"term":"TERMS",
|
||||||
|
"term.btn":"Terms",
|
||||||
|
|
||||||
|
"customer.list.title":"CUSTOMERS",
|
||||||
|
"customer.form.title":"CUSTOMER",
|
||||||
|
|
||||||
|
"contact": "CONTACTS",
|
||||||
|
|
||||||
|
"fcs.profile": "FCS PROFILE",
|
||||||
|
|
||||||
|
"contact.usa.phone": "USA Phone",
|
||||||
|
"contact.mm.phone": "Myanmar Phone"
|
||||||
}
|
}
|
||||||
@@ -539,6 +539,20 @@
|
|||||||
"pickup.new": "New Pickup",
|
"pickup.new": "New Pickup",
|
||||||
"pickup.edit.title": "PICKUP",
|
"pickup.edit.title": "PICKUP",
|
||||||
"pickup.date": "Pickup Date",
|
"pickup.date": "Pickup Date",
|
||||||
|
"pickup.location_time": "Pickup Location / Time",
|
||||||
|
"pickup.information": "Pickup Informations",
|
||||||
|
"pickup.recipient_information": "Recipient Informations",
|
||||||
|
|
||||||
"term":"TERMS"
|
"term":"စည်းကမ်းချက်များ",
|
||||||
|
"term.btn":"စည်းကမ်းချက်များ",
|
||||||
|
|
||||||
|
"customer.list.title":"ဝယ်ယူသူများ",
|
||||||
|
"customer.form.title":"ဝယ်ယူသူ",
|
||||||
|
|
||||||
|
"contact": "ဆက်သွယ်ရန်",
|
||||||
|
|
||||||
|
"fcs.profile": "FCS ပရိုဖိုင်",
|
||||||
|
|
||||||
|
"contact.usa.phone": "ယူအက်စ်အေ ဖုန်းနံပါတ်",
|
||||||
|
"contact.mm.phone": "မြန်မာ ဖုန်းနံပါတ်"
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,7 @@ import 'package:fcs/pages/login_page.dart';
|
|||||||
|
|
||||||
import 'model/announcement_model.dart';
|
import 'model/announcement_model.dart';
|
||||||
import 'model/chart_model.dart';
|
import 'model/chart_model.dart';
|
||||||
|
import 'model/customer_model.dart';
|
||||||
import 'model/device_model.dart';
|
import 'model/device_model.dart';
|
||||||
import 'model/do_model.dart';
|
import 'model/do_model.dart';
|
||||||
import 'model/employee_model.dart';
|
import 'model/employee_model.dart';
|
||||||
@@ -66,8 +67,8 @@ class _AppState extends State<App> {
|
|||||||
final PickUpModel pickUpModel = new PickUpModel();
|
final PickUpModel pickUpModel = new PickUpModel();
|
||||||
final ShipmentRateModel shipmentRateModel = new ShipmentRateModel();
|
final ShipmentRateModel shipmentRateModel = new ShipmentRateModel();
|
||||||
final ShipmentModel shipmentModel = new ShipmentModel();
|
final ShipmentModel shipmentModel = new ShipmentModel();
|
||||||
final PackageModel packageModel=new PackageModel();
|
final PackageModel packageModel = new PackageModel();
|
||||||
|
final CustomerModel customerModel = new CustomerModel();
|
||||||
|
|
||||||
AppTranslationsDelegate _newLocaleDelegate;
|
AppTranslationsDelegate _newLocaleDelegate;
|
||||||
|
|
||||||
@@ -102,7 +103,8 @@ class _AppState extends State<App> {
|
|||||||
..addModel(shipmentRateModel)
|
..addModel(shipmentRateModel)
|
||||||
..addModel(shipmentModel)
|
..addModel(shipmentModel)
|
||||||
..addModel(packageModel)
|
..addModel(packageModel)
|
||||||
..addModel(shipmentRateModel);
|
..addModel(shipmentRateModel)
|
||||||
|
..addModel(customerModel);
|
||||||
this.mainModel.init();
|
this.mainModel.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,6 +157,7 @@ class _AppState extends State<App> {
|
|||||||
ChangeNotifierProvider(builder: (context) => shipmentRateModel),
|
ChangeNotifierProvider(builder: (context) => shipmentRateModel),
|
||||||
ChangeNotifierProvider(builder: (context) => shipmentModel),
|
ChangeNotifierProvider(builder: (context) => shipmentModel),
|
||||||
ChangeNotifierProvider(builder: (context) => packageModel),
|
ChangeNotifierProvider(builder: (context) => packageModel),
|
||||||
|
ChangeNotifierProvider(builder: (context) => customerModel),
|
||||||
ChangeNotifierProvider(
|
ChangeNotifierProvider(
|
||||||
builder: (context) => testModel,
|
builder: (context) => testModel,
|
||||||
),
|
),
|
||||||
|
|||||||
67
lib/model/customer_model.dart
Normal file
67
lib/model/customer_model.dart
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
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';
|
||||||
|
|
||||||
|
class CustomerModel extends BaseModel {
|
||||||
|
final log = Logger('CustomerModel');
|
||||||
|
|
||||||
|
List<User> customers = [
|
||||||
|
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);
|
||||||
|
// _loadCustomer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
logout() async {
|
||||||
|
customers = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Future<void> _loadCustomer() async {
|
||||||
|
// if (!user.isOwnerAndAbove() && !user.hasAccount()) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// try {
|
||||||
|
// Firestore.instance
|
||||||
|
// .collection("/$biz_collection/${setting.okEnergyId}/$user_collection")
|
||||||
|
// .where("is_employee", isEqualTo: true)
|
||||||
|
// .snapshots()
|
||||||
|
// .listen((QuerySnapshot snapshot) {
|
||||||
|
// customers.clear();
|
||||||
|
// customers = snapshot.documents.map((documentSnapshot) {
|
||||||
|
// var user =
|
||||||
|
// User.fromMap(documentSnapshot.data, documentSnapshot.documentID);
|
||||||
|
// return user;
|
||||||
|
// }).toList();
|
||||||
|
// notifyListeners();
|
||||||
|
// }).onError((e) {
|
||||||
|
// log.warning("Error! $e");
|
||||||
|
// });
|
||||||
|
// } catch (e) {
|
||||||
|
// log.warning("Error!! $e");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Future<void> updatePrivileges(String userID, List<String> privileges) async {
|
||||||
|
// try {
|
||||||
|
// await request("/employee/privileges", "PUT",
|
||||||
|
// payload: {"id": userID, "privileges": privileges},
|
||||||
|
// token: await getToken());
|
||||||
|
// } catch (e) {
|
||||||
|
// throw Exception(e);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
@@ -60,9 +60,7 @@ class MainModel extends ChangeNotifier {
|
|||||||
shippingAddress: '154-19 64th Ave.Flushing, \nNY 11367',
|
shippingAddress: '154-19 64th Ave.Flushing, \nNY 11367',
|
||||||
deliveryAddress: '39 42th St. Kyaut Ta Thar Township Yangon');
|
deliveryAddress: '39 42th St. Kyaut Ta Thar Township Yangon');
|
||||||
|
|
||||||
Setting setting = Setting(
|
Setting setting = Setting(terms: '[{"insert":"* Minimum shipping weight is 1lbs.\n* Oversized goods, Light weight/Large volume items, laptops, phones, tablets may incur extra charges based on pecifications.Please contact us for pricing.\n* Goods with lithium battary needs extra packaging and declaration. Please inform us ahead of time so that we can process your package accordingly.\n* Loose Batteries, Drones, and Prescription medicines are not allowed on aircraft.\n* Payment: We accept money orders, any US bank transfers via Zelle, AYA, KBZ and CB. No COD except for pick-ups.\n*Payments made in Myanmar will incur 2% tranfer fee\n"}]');
|
||||||
terms:
|
|
||||||
'[{"insert":"Minimum shipping weight is 1lbs.\nOversized goods, Light weight/Large volume items, laptops, phones, tablets may incur extra charges based on pecifications.Please contact us for pricing.\nGoods with lithium battary needs extra packaging and declaration. Please inform us ahead of time so that we can process your package accordingly.\nLoose Batteries, Drones, and Prescription medicines are not allowed on aircraft.\nPayment: We accept money orders, any US bank transfers via Zelle, AYA, KBZ and CB. No COD except for pick-ups.\nPayments made in Myanmar will incur 2% tranfer fee\n"}]');
|
|
||||||
PackageInfo packageInfo;
|
PackageInfo packageInfo;
|
||||||
bool isLoaded = true;
|
bool isLoaded = true;
|
||||||
bool isOnline = true;
|
bool isOnline = true;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'package:fcs/model/pickup_model.dart';
|
||||||
|
import 'package:fcs/widget/label_widgets.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:package_info/package_info.dart';
|
import 'package:package_info/package_info.dart';
|
||||||
@@ -9,8 +11,6 @@ import 'package:fcs/theme/theme.dart';
|
|||||||
import 'package:fcs/widget/local_text.dart';
|
import 'package:fcs/widget/local_text.dart';
|
||||||
import 'package:fcs/widget/progress.dart';
|
import 'package:fcs/widget/progress.dart';
|
||||||
|
|
||||||
import 'contact_editor.dart';
|
|
||||||
|
|
||||||
class Contact extends StatefulWidget {
|
class Contact extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
_ContactState createState() => _ContactState();
|
_ContactState createState() => _ContactState();
|
||||||
@@ -21,71 +21,56 @@ class _ContactState extends State<Contact> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
MainModel mainModel = Provider.of<MainModel>(context);
|
var pickupModel = Provider.of<PickUpModel>(context, listen: false);
|
||||||
bool isOwner = mainModel.user != null && mainModel.user.isOwner();
|
|
||||||
bool hasAdmin = mainModel.user != null && mainModel.user.hasAdmin();
|
// MainModel mainModel = Provider.of<MainModel>(context);
|
||||||
|
// bool isOwner = mainModel.user != null && mainModel.user.isOwner();
|
||||||
|
// bool hasAdmin = mainModel.user != null && mainModel.user.hasAdmin();
|
||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: primaryColor,
|
||||||
iconTheme: IconThemeData(
|
|
||||||
color: Colors.grey,
|
|
||||||
),
|
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
title: Image(
|
leading: new IconButton(
|
||||||
height: 30,
|
icon: new Icon(Icons.close),
|
||||||
fit: BoxFit.scaleDown,
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
image: new AssetImage('assets/img/logo.png')),
|
),
|
||||||
actions: <Widget>[
|
title: LocalText(
|
||||||
isOwner || hasAdmin
|
context,
|
||||||
? IconButton(
|
"contact",
|
||||||
icon: Icon(Icons.edit),
|
fontSize: 25,
|
||||||
onPressed: () {
|
color: Colors.white,
|
||||||
Navigator.push(
|
),
|
||||||
context,
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) =>
|
|
||||||
ContactEditor(setting: mainModel.setting)),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
: Container()
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Center(
|
link(pickupModel.profile.usaContactNumber, Icons.phone_forwarded,
|
||||||
child: Padding(
|
onTap: () => _call(pickupModel.profile.usaContactNumber),
|
||||||
padding: EdgeInsets.only(top: 5.0, bottom: 5),
|
label: LocalText(
|
||||||
child: LocalText(
|
context,
|
||||||
context,
|
"contact.usa.phone",
|
||||||
"contact.title",
|
color: primaryColor,
|
||||||
fontSize: 25,
|
)),
|
||||||
)),
|
link(pickupModel.profile.mmContactNumber, Icons.phone_forwarded,
|
||||||
|
onTap: () => _call(
|
||||||
|
pickupModel.profile.mmContactNumber,
|
||||||
|
),
|
||||||
|
label: LocalText(
|
||||||
|
context,
|
||||||
|
"contact.mm.phone",
|
||||||
|
color: primaryColor,
|
||||||
|
)),
|
||||||
|
link(
|
||||||
|
pickupModel.profile.usaAddress,
|
||||||
|
Icons.location_on,
|
||||||
),
|
),
|
||||||
Padding(
|
link(pickupModel.profile.mmAddress, Icons.location_on),
|
||||||
padding: const EdgeInsets.only(bottom: 15.0),
|
link(pickupModel.profile.mail, Icons.email,
|
||||||
child: Column(
|
onTap: () => _email(pickupModel.profile.mail)),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
link(pickupModel.profile.facebook, FontAwesomeIcons.facebook,
|
||||||
children:
|
onTap: () => _openLink(pickupModel.profile.facebook)),
|
||||||
List.generate(mainModel.setting.phones.length, (index) {
|
|
||||||
return link(mainModel.setting.phones[index], Icons.phone,
|
|
||||||
onTap: () => _call(mainModel.setting.phones[index]));
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
link(mainModel.setting.deliveryPhone, Icons.phone_forwarded,
|
|
||||||
onTap: () => _call(mainModel.setting.deliveryPhone),
|
|
||||||
label: LocalText(context, "contact.delivery.phone")),
|
|
||||||
link(mainModel.setting.email, Icons.email,
|
|
||||||
onTap: () => _email(mainModel.setting.email)),
|
|
||||||
link(mainModel.setting.facebook, FontAwesomeIcons.facebook,
|
|
||||||
onTap: () => _openLink(mainModel.setting.facebook)),
|
|
||||||
link(mainModel.setting.website, FontAwesomeIcons.chrome,
|
|
||||||
onTap: () => _openLink(mainModel.setting.website)),
|
|
||||||
link(mainModel.setting.address, Icons.location_on),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -106,17 +91,25 @@ class _ContactState extends State<Contact> {
|
|||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
iconData,
|
iconData,
|
||||||
color: primaryColor,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
label == null ? Container() : label,
|
label == null
|
||||||
Text(
|
? Container()
|
||||||
text == null ? "" : text,
|
: Padding(
|
||||||
overflow: TextOverflow.ellipsis,
|
padding: EdgeInsets.fromLTRB(10, 10, 10, 0),
|
||||||
maxLines: 5,
|
child: label,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
text == null ? "" : text,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
maxLines: 5,
|
||||||
|
style: TextStyle(fontSize: 14.0),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
343
lib/pages/customer_editor.dart
Normal file
343
lib/pages/customer_editor.dart
Normal file
@@ -0,0 +1,343 @@
|
|||||||
|
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/main_model.dart';
|
||||||
|
import 'package:fcs/model/user_model.dart';
|
||||||
|
import 'package:fcs/theme/theme.dart';
|
||||||
|
import 'package:fcs/vo/role.dart';
|
||||||
|
import 'package:fcs/vo/user.dart';
|
||||||
|
import 'package:fcs/widget/local_text.dart';
|
||||||
|
import 'package:fcs/widget/localization/app_translations.dart';
|
||||||
|
import 'package:fcs/widget/progress.dart';
|
||||||
|
import 'util.dart';
|
||||||
|
|
||||||
|
typedef void FindCallBack();
|
||||||
|
|
||||||
|
class CustomerEditor extends StatefulWidget {
|
||||||
|
final User customer;
|
||||||
|
const CustomerEditor({this.customer});
|
||||||
|
@override
|
||||||
|
_CustomerEditorState createState() => _CustomerEditorState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CustomerEditorState extends State<CustomerEditor> {
|
||||||
|
TextEditingController _name = new TextEditingController();
|
||||||
|
TextEditingController _phone = new TextEditingController();
|
||||||
|
TextEditingController _phoneInput = new TextEditingController();
|
||||||
|
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
bool _isLoading = false;
|
||||||
|
String currentBizId;
|
||||||
|
bool isSend = false;
|
||||||
|
User user;
|
||||||
|
User selectedUser;
|
||||||
|
List<Privilege> privileges = [];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
// privileges = Provider.of<UserModel>(context, listen: false).privileges;
|
||||||
|
if (widget.customer != null) {
|
||||||
|
_name.text = widget.customer.name;
|
||||||
|
_phone.text = widget.customer.phone;
|
||||||
|
// privileges.forEach((p) => widget.employee.privilegeIds.contains(p.id)
|
||||||
|
// ? p.isChecked = true
|
||||||
|
// : p.isChecked = false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
|
var languageModel = Provider.of<LanguageModel>(context);
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.only(top: 10),
|
||||||
|
child: Stack(
|
||||||
|
alignment: const Alignment(1.2, 1.0),
|
||||||
|
children: <Widget>[
|
||||||
|
TextFormField(
|
||||||
|
controller: _phoneInput,
|
||||||
|
autofocus: false,
|
||||||
|
cursorColor: primaryColor,
|
||||||
|
keyboardType: TextInputType.phone,
|
||||||
|
style: textStyle,
|
||||||
|
decoration: new InputDecoration(
|
||||||
|
labelText: AppTranslations.of(context).text('employee.phone'),
|
||||||
|
labelStyle: languageModel.isEng ? labelStyle : labelStyleMM,
|
||||||
|
icon: Icon(
|
||||||
|
Icons.phone,
|
||||||
|
color: primaryColor,
|
||||||
|
),
|
||||||
|
enabledBorder: UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||||
|
focusedBorder: UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
new FlatButton(
|
||||||
|
onPressed: () {
|
||||||
|
this.isSend = true;
|
||||||
|
findCallBack();
|
||||||
|
},
|
||||||
|
child: new Icon(
|
||||||
|
Icons.search,
|
||||||
|
size: 25,
|
||||||
|
))
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var userModel = Provider.of<UserModel>(context);
|
||||||
|
MainModel mainModel = Provider.of<MainModel>(context);
|
||||||
|
|
||||||
|
final namebox = TextFormField(
|
||||||
|
controller: _name,
|
||||||
|
autofocus: false,
|
||||||
|
readOnly: true,
|
||||||
|
cursorColor: primaryColor,
|
||||||
|
decoration: new InputDecoration(
|
||||||
|
border: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
icon: Icon(
|
||||||
|
Icons.person,
|
||||||
|
color: primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final displayPhoneNo = TextFormField(
|
||||||
|
controller: _phone,
|
||||||
|
autofocus: false,
|
||||||
|
readOnly: true,
|
||||||
|
cursorColor: primaryColor,
|
||||||
|
decoration: new InputDecoration(
|
||||||
|
border: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
icon: Icon(
|
||||||
|
Icons.phone,
|
||||||
|
color: primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
var phoneNumberBox = Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(child: displayPhoneNo),
|
||||||
|
Expanded(
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => call(context, _phone.text),
|
||||||
|
child: Icon(
|
||||||
|
Icons.open_in_new,
|
||||||
|
color: Colors.grey,
|
||||||
|
size: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
final updateButton = Container(
|
||||||
|
padding: EdgeInsets.only(top: 40),
|
||||||
|
child: Container(
|
||||||
|
height: 45.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: primaryColor,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
),
|
||||||
|
child: ButtonTheme(
|
||||||
|
minWidth: 900.0,
|
||||||
|
height: 100.0,
|
||||||
|
child: FlatButton(
|
||||||
|
onPressed: () {},
|
||||||
|
child: LocalText(
|
||||||
|
context,
|
||||||
|
'customer.update',
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final addButton = Container(
|
||||||
|
padding: EdgeInsets.only(top: 40),
|
||||||
|
child: Container(
|
||||||
|
height: 45.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: primaryColor,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
),
|
||||||
|
child: ButtonTheme(
|
||||||
|
minWidth: 900.0,
|
||||||
|
height: 100.0,
|
||||||
|
child: FlatButton(
|
||||||
|
onPressed: () {},
|
||||||
|
child: LocalText(
|
||||||
|
context,
|
||||||
|
'customer.add',
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
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: LocalText(
|
||||||
|
context,
|
||||||
|
"customer.form.title",
|
||||||
|
fontSize: 20,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
// actions: <Widget>[
|
||||||
|
// widget.customer == null || !mainModel.showHistoryBtn()
|
||||||
|
// ? Container()
|
||||||
|
// : IconButton(
|
||||||
|
// icon: Icon(Icons.history),
|
||||||
|
// onPressed: () {
|
||||||
|
// Navigator.push(
|
||||||
|
// context,
|
||||||
|
// MaterialPageRoute(
|
||||||
|
// builder: (context) => DocumentLogPage(
|
||||||
|
// docID: widget.customer.docID)),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
),
|
||||||
|
body: ListView(
|
||||||
|
shrinkWrap: true,
|
||||||
|
padding: EdgeInsets.only(left: 24.0, right: 24.0),
|
||||||
|
children: <Widget>[
|
||||||
|
widget.customer == null
|
||||||
|
? phoneInputbox(context, () => _findUser(context))
|
||||||
|
: phoneNumberBox,
|
||||||
|
widget.customer == null
|
||||||
|
? this.isSend ? namebox : Container()
|
||||||
|
: namebox,
|
||||||
|
// widget.customer == null ? addButton : updateButton,
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
_add(BuildContext context) async {
|
||||||
|
if (selectedUser == null) return;
|
||||||
|
setState(() {
|
||||||
|
_isLoading = true;
|
||||||
|
});
|
||||||
|
var employeeModel = Provider.of<EmployeeModel>(context);
|
||||||
|
try {
|
||||||
|
await employeeModel.updatePrivileges(
|
||||||
|
this.selectedUser.docID, privilegesIDs());
|
||||||
|
Navigator.pop(context);
|
||||||
|
} catch (e) {
|
||||||
|
showMsgDialog(context, "Error", e.toString());
|
||||||
|
} finally {
|
||||||
|
setState(() {
|
||||||
|
_isLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> privilegesIDs() {
|
||||||
|
return this.privileges.where((p) => p.isChecked).map((p) => p.id).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
_save() async {
|
||||||
|
setState(() {
|
||||||
|
_isLoading = true;
|
||||||
|
});
|
||||||
|
if (widget.customer == null) return;
|
||||||
|
var employeeModel = Provider.of<EmployeeModel>(context);
|
||||||
|
try {
|
||||||
|
await employeeModel.updatePrivileges(widget.customer.docID, privilegesIDs());
|
||||||
|
Navigator.pop(context);
|
||||||
|
} catch (e) {
|
||||||
|
showMsgDialog(context, "Error", e.toString());
|
||||||
|
} finally {
|
||||||
|
setState(() {
|
||||||
|
_isLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_findUser(BuildContext context) async {
|
||||||
|
var userModel = Provider.of<UserModel>(context);
|
||||||
|
setState(() {
|
||||||
|
_isLoading = true;
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
selectedUser = await userModel.findUser(_phoneInput.text);
|
||||||
|
setState(() {
|
||||||
|
isSend = true;
|
||||||
|
_name.text = selectedUser.name;
|
||||||
|
if (selectedUser.privilegeIds != null) {
|
||||||
|
privileges.forEach((p) => selectedUser.privilegeIds.contains(p.id)
|
||||||
|
? p.isChecked = true
|
||||||
|
: p.isChecked = false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
showMsgDialog(context, "Error", e.toString());
|
||||||
|
} finally {
|
||||||
|
setState(() {
|
||||||
|
_isLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
131
lib/pages/customer_list.dart
Normal file
131
lib/pages/customer_list.dart
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
import 'package:fcs/model/customer_model.dart';
|
||||||
|
import 'package:fcs/pages/search_page.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_icons/flutter_icons.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
import 'package:provider/provider.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 'customer_editor.dart';
|
||||||
|
|
||||||
|
class CustomerList extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_CustomerListState createState() => _CustomerListState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CustomerListState extends State<CustomerList> {
|
||||||
|
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 customerModel = Provider.of<CustomerModel>(context);
|
||||||
|
|
||||||
|
return LocalProgress(
|
||||||
|
inAsyncCall: _isLoading,
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
centerTitle: true,
|
||||||
|
leading: new IconButton(
|
||||||
|
icon: new Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.search,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
iconSize: 30,
|
||||||
|
onPressed: () => showPlacesSearch(context),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
backgroundColor: primaryColor,
|
||||||
|
title: LocalText(
|
||||||
|
context,
|
||||||
|
'customer.list.title',
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: new ListView.separated(
|
||||||
|
separatorBuilder: (context, index) => Divider(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
padding: EdgeInsets.only(left: 15, right: 15, top: 15),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: customerModel.customers.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
User user = customerModel.customers[index];
|
||||||
|
return Stack(
|
||||||
|
children: <Widget>[
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
CustomerEditor(customer: user)),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: 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: Icon(
|
||||||
|
Feather.users,
|
||||||
|
color: primaryColor,
|
||||||
|
size: 40,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
new Expanded(
|
||||||
|
child: new Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
new Text(
|
||||||
|
user.name,
|
||||||
|
style: new TextStyle(
|
||||||
|
fontSize: 15.0,
|
||||||
|
color: primaryColor),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(top: 8.0),
|
||||||
|
child: new Text(
|
||||||
|
user.phoneNumber,
|
||||||
|
style: new TextStyle(
|
||||||
|
fontSize: 15.0,
|
||||||
|
color: Colors.grey),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
import 'package:fcs/model/pickup_model.dart';
|
import 'package:fcs/model/pickup_model.dart';
|
||||||
|
import 'package:fcs/pages/util.dart';
|
||||||
import 'package:fcs/vo/pickup.dart';
|
import 'package:fcs/vo/pickup.dart';
|
||||||
import 'package:fcs/widget/fcs_text_field.dart';
|
import 'package:fcs/widget/fcs_text_field.dart';
|
||||||
|
import 'package:fcs/widget/local_text.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -49,67 +52,37 @@ class _FCSProfilePageState extends State<FCSProfilePage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final usaAddress = Container(
|
final usaAddress = fcsInput('USA Delivery Address', Icons.location_on,
|
||||||
child: FCSTextField(
|
controller: _usaAddressEditingController);
|
||||||
controller: _usaAddressEditingController,
|
final mmAddress = fcsInput('Yangon, Myanmar Office', Icons.location_on,
|
||||||
label: 'USA Delivery Address',
|
controller: _mmAddressEditingController);
|
||||||
));
|
|
||||||
|
|
||||||
final mmAddress = Container(
|
final contactNumber = fcsInput('USA contact number', Icons.phone,
|
||||||
child: Row(children: <Widget>[
|
controller: _contactEditingController);
|
||||||
Expanded(
|
final mmContactNumber = fcsInput('Myanmar contact number', Icons.phone,
|
||||||
child: FCSTextField(
|
controller: _mmContactEditingController);
|
||||||
controller: _mmAddressEditingController,
|
|
||||||
label: 'Yangon, Myanmar Office',
|
|
||||||
)),
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
|
|
||||||
final contactNumber = Container(
|
final mailBox = fcsInput('Email Address', Icons.mail,
|
||||||
child: Row(children: <Widget>[
|
controller: _mailEditingController);
|
||||||
Expanded(
|
final fbLinkBox = fcsInput('Facebook Link', FontAwesomeIcons.facebook,
|
||||||
child: FCSTextField(
|
controller: _fbLinkEditingController);
|
||||||
controller: _contactEditingController,
|
|
||||||
label: 'USA contact number',
|
|
||||||
)),
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
|
|
||||||
final mmContactNumber = Container(
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: FCSTextField(
|
|
||||||
controller: _mmContactEditingController,
|
|
||||||
label: 'Myanmar contact number',
|
|
||||||
)),
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
|
|
||||||
final mailBox = Container(
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: FCSTextField(
|
|
||||||
controller: _mailEditingController,
|
|
||||||
label: 'Email Address',
|
|
||||||
)),
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
|
|
||||||
final fbLinkBox = Container(
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: FCSTextField(
|
|
||||||
controller: _fbLinkEditingController, label: ' Facebook Link')),
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
|
|
||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
|
leading: new IconButton(
|
||||||
|
icon: new Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
title: Text('FCS PROFILE'),
|
title: LocalText(
|
||||||
|
context,
|
||||||
|
'fcs.profile',
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
body: Card(
|
body: Card(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import 'package:provider/provider.dart';
|
|||||||
import '../theme/theme.dart';
|
import '../theme/theme.dart';
|
||||||
import 'announcement_list.dart';
|
import 'announcement_list.dart';
|
||||||
import 'buying_online.dart';
|
import 'buying_online.dart';
|
||||||
|
import 'customer_list.dart';
|
||||||
import 'do/do_list.dart';
|
import 'do/do_list.dart';
|
||||||
import 'my_registeration.dart';
|
import 'my_registeration.dart';
|
||||||
import 'pd/pd_list.dart';
|
import 'pd/pd_list.dart';
|
||||||
@@ -155,13 +156,18 @@ class _HomePageState extends State<HomePage> {
|
|||||||
final customersBtn = _buildBtn2("customers.btn",
|
final customersBtn = _buildBtn2("customers.btn",
|
||||||
icon: Feather.users,
|
icon: Feather.users,
|
||||||
btnCallback: () =>
|
btnCallback: () =>
|
||||||
Navigator.of(context).push(BottomUpPageRoute(StaffList())));
|
Navigator.of(context).push(BottomUpPageRoute(CustomerList())));
|
||||||
|
|
||||||
final invoicesBtn = _buildBtn2("invoices.btn",
|
final invoicesBtn = _buildBtn2("invoices.btn",
|
||||||
icon: FontAwesomeIcons.fileInvoice,
|
icon: FontAwesomeIcons.fileInvoice,
|
||||||
btnCallback: () =>
|
btnCallback: () =>
|
||||||
Navigator.of(context).push(BottomUpPageRoute(StaffList())));
|
Navigator.of(context).push(BottomUpPageRoute(StaffList())));
|
||||||
|
|
||||||
|
final termBtn = _buildBtn2("term.btn",
|
||||||
|
icon: FontAwesomeIcons.info,
|
||||||
|
btnCallback: () =>
|
||||||
|
Navigator.of(context).push(BottomUpPageRoute(Term())));
|
||||||
|
|
||||||
List<Widget> widgets = [];
|
List<Widget> widgets = [];
|
||||||
widgets.add(buyingBtn);
|
widgets.add(buyingBtn);
|
||||||
widgets.add(pickUpBtn);
|
widgets.add(pickUpBtn);
|
||||||
@@ -173,6 +179,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
widgets.add(packagesBtn);
|
widgets.add(packagesBtn);
|
||||||
widgets.add(customersBtn);
|
widgets.add(customersBtn);
|
||||||
widgets.add(invoicesBtn);
|
widgets.add(invoicesBtn);
|
||||||
|
widgets.add(termBtn);
|
||||||
|
|
||||||
return OfflineRedirect(
|
return OfflineRedirect(
|
||||||
child: FlavorBanner(
|
child: FlavorBanner(
|
||||||
@@ -432,7 +439,10 @@ class _HomePageState extends State<HomePage> {
|
|||||||
|
|
||||||
Widget _buildSmallButton(String text, IconData iconData) {
|
Widget _buildSmallButton(String text, IconData iconData) {
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () => {},
|
onTap: () => {
|
||||||
|
Navigator.of(context)
|
||||||
|
.push(MaterialPageRoute(builder: (_) => Contact())),
|
||||||
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(18.0),
|
padding: const EdgeInsets.all(18.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|||||||
@@ -75,110 +75,88 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var pickupModel = Provider.of<PickUpModel>(context);
|
var pickupModel = Provider.of<PickUpModel>(context);
|
||||||
|
|
||||||
final pickUpAddress = Container(
|
final pickUpAddress = fcsInput('Pickup Address', Icons.location_on,
|
||||||
child: TextFormField(
|
controller: _addressEditingController);
|
||||||
maxLines: null,
|
|
||||||
controller: _addressEditingController,
|
|
||||||
cursorColor: primaryColor,
|
|
||||||
style: textStyle,
|
|
||||||
minLines: 2,
|
|
||||||
decoration: new InputDecoration(
|
|
||||||
labelText: 'Pickup Address',
|
|
||||||
disabledBorder: InputBorder.none,
|
|
||||||
enabledBorder: UnderlineInputBorder(
|
|
||||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
|
||||||
focusedBorder: UnderlineInputBorder(
|
|
||||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
|
||||||
),
|
|
||||||
));
|
|
||||||
|
|
||||||
final pickUpAddressReadOnly = Container(
|
final pickUpAddressReadOnly = fcsInputReadOnly(
|
||||||
child: FCSTextFieldReadOnly(
|
'Pickup Address', Icons.location_on,
|
||||||
controller: _addressEditingController,
|
controller: _addressEditingController);
|
||||||
label: 'Pickup Address',
|
|
||||||
));
|
|
||||||
|
|
||||||
final pickupTime = Container(
|
final fromTimeBox = fcsInput(
|
||||||
height: 50.0,
|
'From',
|
||||||
child: Row(children: <Widget>[
|
Icons.timer,
|
||||||
Container(
|
controller: _fromTimeEditingController,
|
||||||
width: 70.0,
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _fromTimeEditingController,
|
|
||||||
cursorColor: primaryColor,
|
|
||||||
decoration: new InputDecoration(
|
|
||||||
labelText: 'From',
|
|
||||||
enabledBorder: UnderlineInputBorder(
|
|
||||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
|
||||||
focusedBorder: UnderlineInputBorder(
|
|
||||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Text(' - '),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
width: 70.0,
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _toTimeEditingController,
|
|
||||||
cursorColor: primaryColor,
|
|
||||||
decoration: new InputDecoration(
|
|
||||||
labelText: 'To',
|
|
||||||
enabledBorder: UnderlineInputBorder(
|
|
||||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
|
||||||
focusedBorder: UnderlineInputBorder(
|
|
||||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
]),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
final pickupTimeReadOnly = Container(
|
final toTimeBox = fcsInput(
|
||||||
height: 50.0,
|
'To',
|
||||||
child: Row(children: <Widget>[
|
null,
|
||||||
Container(
|
controller: _toTimeEditingController,
|
||||||
width: 70.0,
|
|
||||||
child: FCSTextFieldReadOnly(
|
|
||||||
controller: _fromTimeEditingController, label: 'From')),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Text(' - '),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
width: 70.0,
|
|
||||||
child: FCSTextFieldReadOnly(
|
|
||||||
controller: _toTimeEditingController, label: 'To')),
|
|
||||||
]),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
final noOfPackageBox = Container(
|
final fromTimeBoxReadOnly = fcsInputReadOnly(
|
||||||
height: 50.0,
|
'From',
|
||||||
child: Row(children: <Widget>[
|
Icons.timer,
|
||||||
Expanded(
|
controller: _fromTimeEditingController,
|
||||||
child: TextFormField(
|
);
|
||||||
controller: _noOfPackageEditingController,
|
|
||||||
cursorColor: primaryColor,
|
final toTimeBoxReadOnly = fcsInputReadOnly(
|
||||||
textAlign: TextAlign.left,
|
'To',
|
||||||
decoration: new InputDecoration(
|
null,
|
||||||
labelText: 'Number of Packages',
|
controller: _toTimeEditingController,
|
||||||
enabledBorder: UnderlineInputBorder(
|
);
|
||||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
|
||||||
focusedBorder: UnderlineInputBorder(
|
final pickupTime = Padding(
|
||||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
child: fromTimeBox,
|
||||||
|
width: 120,
|
||||||
),
|
),
|
||||||
)),
|
Padding(
|
||||||
]),
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
child: Text('-'),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: toTimeBox,
|
||||||
|
width: 120,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final noOfPackageBoxReadonly = Container(
|
final pickupTimeReadOnly = Padding(
|
||||||
height: 50.0,
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
child: Row(children: <Widget>[
|
child: Row(
|
||||||
Expanded(
|
children: <Widget>[
|
||||||
child: FCSTextFieldReadOnly(
|
SizedBox(height: 5),
|
||||||
controller: _noOfPackageEditingController,
|
Container(
|
||||||
label: 'Number of Packages')),
|
child: fromTimeBoxReadOnly,
|
||||||
]),
|
width: 120,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
child: Text('-'),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: toTimeBoxReadOnly,
|
||||||
|
width: 120,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final noOfPackageBox = fcsInput(
|
||||||
|
'Number of Packages',
|
||||||
|
Octicons.package,
|
||||||
|
controller: _noOfPackageEditingController,
|
||||||
|
);
|
||||||
|
|
||||||
|
final noOfPackageBoxReadonly = fcsInputReadOnly(
|
||||||
|
'Number of Packages',
|
||||||
|
Octicons.package,
|
||||||
|
controller: _noOfPackageEditingController,
|
||||||
);
|
);
|
||||||
|
|
||||||
final requestDateBox = Container(
|
final requestDateBox = Container(
|
||||||
@@ -212,7 +190,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0),
|
EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0),
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.date_range,
|
Icons.date_range,
|
||||||
color: Colors.black87,
|
color: Colors.grey,
|
||||||
)),
|
)),
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value.isEmpty) {
|
if (value.isEmpty) {
|
||||||
@@ -258,62 +236,22 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 15),
|
|
||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
title: Text('Pickup Location / Time'),
|
title: Text('Pickup Location / Time'),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0),
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
child: Row(
|
child: widget.pickUp == null
|
||||||
children: <Widget>[
|
? pickUpAddress
|
||||||
Padding(
|
: widget.pickUp.status == 'Pending'
|
||||||
padding: const EdgeInsets.only(right: 8.0),
|
? pickUpAddress
|
||||||
child: Icon(Icons.location_on),
|
: pickUpAddressReadOnly,
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: widget.pickUp == null
|
|
||||||
? pickUpAddress
|
|
||||||
: widget.pickUp.status == 'Pending'
|
|
||||||
? pickUpAddress
|
|
||||||
: pickUpAddressReadOnly),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(height: 15),
|
widget.pickUp == null
|
||||||
Padding(
|
? pickupTime
|
||||||
padding: const EdgeInsets.only(left: 20.0),
|
: widget.pickUp.status == 'Pending'
|
||||||
child: Row(
|
? pickupTime
|
||||||
children: <Widget>[
|
: pickupTimeReadOnly,
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 8.0),
|
|
||||||
child: Icon(Icons.timer),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
|
||||||
child: Text('Pickup Time',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.grey, fontSize: 14)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 20.0),
|
|
||||||
child: Row(
|
|
||||||
children: <Widget>[
|
|
||||||
SizedBox(height: 5),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 33),
|
|
||||||
child: widget.pickUp == null
|
|
||||||
? pickupTime
|
|
||||||
: widget.pickUp.status == 'Pending'
|
|
||||||
? pickupTime
|
|
||||||
: pickupTimeReadOnly,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 5),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0),
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -323,7 +261,6 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
@@ -331,23 +268,11 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0),
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
child: Row(
|
child: widget.pickUp == null
|
||||||
children: <Widget>[
|
? noOfPackageBox
|
||||||
Padding(
|
: widget.pickUp.status == 'Pending'
|
||||||
padding: const EdgeInsets.only(right: 8.0),
|
? noOfPackageBox
|
||||||
child: Icon(Octicons.package),
|
: noOfPackageBoxReadonly,
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: widget.pickUp == null
|
|
||||||
? noOfPackageBox
|
|
||||||
: widget.pickUp.status == 'Pending'
|
|
||||||
? noOfPackageBox
|
|
||||||
: noOfPackageBoxReadonly),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 15,
|
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0),
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
@@ -363,12 +288,11 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
FontAwesomeIcons.weightHanging,
|
FontAwesomeIcons.weightHanging,
|
||||||
controller: _weightEditingController),
|
controller: _weightEditingController),
|
||||||
),
|
),
|
||||||
SizedBox(height: 15),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0),
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
child: fcsInput("Remark", MaterialCommunityIcons.note),
|
child: fcsInput("Remark", MaterialCommunityIcons.note),
|
||||||
),
|
),
|
||||||
SizedBox(height: 25),
|
SizedBox(height: 10.0),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
@@ -387,22 +311,19 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
"Name", FontAwesomeIcons.user,
|
"Name", FontAwesomeIcons.user,
|
||||||
controller:
|
controller:
|
||||||
_recipientNameEditingController)),
|
_recipientNameEditingController)),
|
||||||
SizedBox(height: 25),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0),
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
child: widget.pickUp == null
|
child: widget.pickUp == null
|
||||||
? fcsInput("Phone Number", FontAwesomeIcons.phone,
|
? fcsInput("Phone Number", Icons.phone,
|
||||||
controller: _recipientPhoneEditingController)
|
controller: _recipientPhoneEditingController)
|
||||||
: widget.pickUp.status == 'Pending'
|
: widget.pickUp.status == 'Pending'
|
||||||
? fcsInput(
|
? fcsInput("Phone Number", Icons.phone,
|
||||||
"Phone Number", FontAwesomeIcons.phone,
|
|
||||||
controller:
|
controller:
|
||||||
_recipientPhoneEditingController)
|
_recipientPhoneEditingController)
|
||||||
: fcsInputReadOnly(
|
: fcsInputReadOnly(
|
||||||
"Phone Number", FontAwesomeIcons.phone,
|
"Phone Number", Icons.phone,
|
||||||
controller:
|
controller:
|
||||||
_recipientPhoneEditingController)),
|
_recipientPhoneEditingController)),
|
||||||
SizedBox(height: 25),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20.0),
|
padding: const EdgeInsets.only(left: 20.0),
|
||||||
child: widget.pickUp == null
|
child: widget.pickUp == null
|
||||||
@@ -417,7 +338,6 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
"Address", Icons.location_on,
|
"Address", Icons.location_on,
|
||||||
controller:
|
controller:
|
||||||
_recipientAddressEditingController)),
|
_recipientAddressEditingController)),
|
||||||
SizedBox(height: 25),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
ExpansionTile(
|
ExpansionTile(
|
||||||
@@ -432,9 +352,6 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
|||||||
)
|
)
|
||||||
: Container()
|
: Container()
|
||||||
: Container(),
|
: Container(),
|
||||||
SizedBox(
|
|
||||||
height: 25,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
|
|||||||
@@ -116,16 +116,16 @@ class _ShipmentRatesState extends State<ShipmentRates> {
|
|||||||
),
|
),
|
||||||
_row("Free delivery within Yangon \nfor shipments over","10","pounds"),
|
_row("Free delivery within Yangon \nfor shipments over","10","pounds"),
|
||||||
_row("Delivery fees","\$ 5","below 10 pounds"),
|
_row("Delivery fees","\$ 5","below 10 pounds"),
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.only(left: 18.0, right: 18),
|
// padding: const EdgeInsets.only(left: 18.0, right: 18),
|
||||||
child: RichText(
|
// child: RichText(
|
||||||
// overflow: TextOverflow.fade,
|
// // overflow: TextOverflow.fade,
|
||||||
text: TextSpan(
|
// text: TextSpan(
|
||||||
style: TextStyle(color: primaryColor),
|
// style: TextStyle(color: primaryColor),
|
||||||
children: textList,
|
// children: textList,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
fcsButton(context, "Calculate", callack: () {
|
fcsButton(context, "Calculate", callack: () {
|
||||||
Navigator.of(context)
|
Navigator.of(context)
|
||||||
.push(MaterialPageRoute(builder: (_) => ShipmentRatesCal()));
|
.push(MaterialPageRoute(builder: (_) => ShipmentRatesCal()));
|
||||||
|
|||||||
@@ -31,16 +31,18 @@ class _TermState extends State<Term> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_controller = ZefyrController(_loadDocument());
|
_controller = ZefyrController(_loadDocument());
|
||||||
|
print("controller terms => ${_controller.document}");
|
||||||
_focusNode = FocusNode();
|
_focusNode = FocusNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
NotusDocument _loadDocument() {
|
NotusDocument _loadDocument() {
|
||||||
MainModel mainModel = Provider.of<MainModel>(context, listen: false);
|
MainModel mainModel = Provider.of<MainModel>(context, listen: false);
|
||||||
String term = mainModel.setting.terms;
|
String term = mainModel.setting.terms;
|
||||||
|
print("terms => $term");
|
||||||
NotusDocument doc;
|
NotusDocument doc;
|
||||||
try {
|
try {
|
||||||
doc = NotusDocument.fromJson(jsonDecode(term));
|
doc = NotusDocument.fromJson(jsonDecode(term));
|
||||||
|
print('doc=> $doc');
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
if (doc == null) {
|
if (doc == null) {
|
||||||
doc = NotusDocument();
|
doc = NotusDocument();
|
||||||
@@ -51,7 +53,6 @@ class _TermState extends State<Term> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
MainModel mainModel = Provider.of<MainModel>(context);
|
MainModel mainModel = Provider.of<MainModel>(context);
|
||||||
print("controller terms => ${_controller.document}");
|
|
||||||
|
|
||||||
bool isOwnerAndAbove =
|
bool isOwnerAndAbove =
|
||||||
mainModel.user != null && mainModel.user.isOwnerAndAbove();
|
mainModel.user != null && mainModel.user.isOwnerAndAbove();
|
||||||
@@ -89,21 +90,41 @@ class _TermState extends State<Term> {
|
|||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
automaticallyImplyLeading: !widget.agreePage,
|
leading: new IconButton(
|
||||||
|
icon: new Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
|
// automaticallyImplyLeading: !widget.agreePage,
|
||||||
title: LocalText(context, 'term', color: Colors.white, fontSize: 20),
|
title: LocalText(context, 'term', color: Colors.white, fontSize: 20),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
isOwnerAndAbove || hasAdmin
|
// isOwnerAndAbove || hasAdmin
|
||||||
? IconButton(
|
// ?
|
||||||
icon: Icon(Icons.edit),
|
IconButton(
|
||||||
onPressed: () {
|
icon: Icon(Icons.edit),
|
||||||
Navigator.push(
|
onPressed: () async {
|
||||||
context,
|
Navigator.push(
|
||||||
MaterialPageRoute(builder: (context) => TermEdit()),
|
context,
|
||||||
);
|
MaterialPageRoute(
|
||||||
},
|
builder: (context) => TermEdit((data) {
|
||||||
)
|
setState(() {
|
||||||
: Container()
|
_controller = ZefyrController(data);
|
||||||
|
});
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
// print('doc=> $doc');
|
||||||
|
|
||||||
|
// setState(() {
|
||||||
|
// document = doc;
|
||||||
|
// });
|
||||||
|
// var document = await
|
||||||
|
// Navigator.push(
|
||||||
|
// context,
|
||||||
|
// MaterialPageRoute(builder: (context) => TermEdit()),
|
||||||
|
// );
|
||||||
|
},
|
||||||
|
)
|
||||||
|
// : Container()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import '../theme/theme.dart';
|
|||||||
typedef void ProfileCallback();
|
typedef void ProfileCallback();
|
||||||
|
|
||||||
class TermEdit extends StatefulWidget {
|
class TermEdit extends StatefulWidget {
|
||||||
|
final ValueChanged onChangedData;
|
||||||
|
TermEdit(this.onChangedData);
|
||||||
@override
|
@override
|
||||||
_TermEditState createState() => _TermEditState();
|
_TermEditState createState() => _TermEditState();
|
||||||
}
|
}
|
||||||
@@ -110,8 +112,10 @@ class _TermEditState extends State<TermEdit> {
|
|||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
final contents = jsonEncode(_controller.document);
|
final contents = jsonEncode(_controller.document);
|
||||||
MainModel mainModel = Provider.of<MainModel>(context, listen: false);
|
print('contents => $contents');
|
||||||
mainModel.updateTerms(contents);
|
widget.onChangedData(_controller.document);
|
||||||
|
// MainModel mainModel = Provider.of<MainModel>(context, listen: false);
|
||||||
|
// mainModel.updateTerms(contents);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showMsgDialog(context, "Error", e.toString());
|
showMsgDialog(context, "Error", e.toString());
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -388,32 +388,50 @@ Widget fcsInput(String label, IconData iconData,
|
|||||||
{TextEditingController controller, String value}) {
|
{TextEditingController controller, String value}) {
|
||||||
return Row(
|
return Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.only(right: 8.0),
|
// padding: const EdgeInsets.only(right: 8.0),
|
||||||
child: Icon(iconData),
|
// child: Icon(iconData),
|
||||||
),
|
// ),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
||||||
child: Row(children: <Widget>[
|
child: Row(children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
initialValue: value,
|
initialValue: value,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
cursorColor: primaryColor,
|
cursorColor: primaryColor,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
minLines: 1,
|
minLines: 1,
|
||||||
textAlign: TextAlign.left,
|
decoration: InputDecoration(
|
||||||
decoration: new InputDecoration(
|
fillColor: Colors.white,
|
||||||
contentPadding: EdgeInsets.only(top: 8),
|
labelText: label,
|
||||||
labelText: label,
|
labelStyle: TextStyle(fontSize: 16, color: Colors.grey),
|
||||||
labelStyle: TextStyle(fontSize: 14, color: Colors.grey),
|
filled: true,
|
||||||
enabledBorder: UnderlineInputBorder(
|
icon: Icon(
|
||||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
iconData,
|
||||||
focusedBorder: UnderlineInputBorder(
|
color: Colors.grey,
|
||||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
),
|
||||||
),
|
focusedBorder: UnderlineInputBorder(
|
||||||
)),
|
borderSide: BorderSide(color: Colors.grey, width: 1.0)),
|
||||||
|
))
|
||||||
|
// TextFormField(
|
||||||
|
// initialValue: value,
|
||||||
|
// controller: controller,
|
||||||
|
// cursorColor: primaryColor,
|
||||||
|
// maxLines: null,
|
||||||
|
// minLines: 1,
|
||||||
|
// textAlign: TextAlign.left,
|
||||||
|
// decoration: new InputDecoration(
|
||||||
|
// contentPadding: EdgeInsets.only(top: 8),
|
||||||
|
// labelText: label,
|
||||||
|
// labelStyle: TextStyle(fontSize: 14, color: Colors.grey),
|
||||||
|
// enabledBorder: UnderlineInputBorder(
|
||||||
|
// borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||||
|
// focusedBorder: UnderlineInputBorder(
|
||||||
|
// borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
),
|
||||||
]),
|
]),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
@@ -424,28 +442,28 @@ Widget fcsInputReadOnly(String label, IconData iconData,
|
|||||||
{TextEditingController controller, String value}) {
|
{TextEditingController controller, String value}) {
|
||||||
return Row(
|
return Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(right: 8.0),
|
|
||||||
child: Icon(iconData),
|
|
||||||
),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
child: Row(children: <Widget>[
|
child: Row(children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
initialValue: value,
|
initialValue: value,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
cursorColor: primaryColor,
|
cursorColor: primaryColor,
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
minLines: 1,
|
minLines: 1,
|
||||||
readOnly: true,
|
decoration: InputDecoration(
|
||||||
textAlign: TextAlign.left,
|
fillColor: Colors.white,
|
||||||
decoration: new InputDecoration(
|
border: InputBorder.none,
|
||||||
border: InputBorder.none,
|
labelText: label,
|
||||||
contentPadding: EdgeInsets.only(top: 8),
|
labelStyle: TextStyle(fontSize: 16, color: Colors.grey),
|
||||||
labelText: label,
|
filled: true,
|
||||||
),
|
icon: Icon(
|
||||||
)),
|
iconData,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
))
|
||||||
|
),
|
||||||
]),
|
]),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user