modify
This commit is contained in:
@@ -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:font_awesome_flutter/font_awesome_flutter.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/progress.dart';
|
||||
|
||||
import 'contact_editor.dart';
|
||||
|
||||
class Contact extends StatefulWidget {
|
||||
@override
|
||||
_ContactState createState() => _ContactState();
|
||||
@@ -21,71 +21,56 @@ class _ContactState extends State<Contact> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
MainModel mainModel = Provider.of<MainModel>(context);
|
||||
bool isOwner = mainModel.user != null && mainModel.user.isOwner();
|
||||
bool hasAdmin = mainModel.user != null && mainModel.user.hasAdmin();
|
||||
var pickupModel = Provider.of<PickUpModel>(context, listen: false);
|
||||
|
||||
// MainModel mainModel = Provider.of<MainModel>(context);
|
||||
// bool isOwner = mainModel.user != null && mainModel.user.isOwner();
|
||||
// bool hasAdmin = mainModel.user != null && mainModel.user.hasAdmin();
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
iconTheme: IconThemeData(
|
||||
color: Colors.grey,
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
elevation: 0,
|
||||
centerTitle: true,
|
||||
title: Image(
|
||||
height: 30,
|
||||
fit: BoxFit.scaleDown,
|
||||
image: new AssetImage('assets/img/logo.png')),
|
||||
actions: <Widget>[
|
||||
isOwner || hasAdmin
|
||||
? IconButton(
|
||||
icon: Icon(Icons.edit),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) =>
|
||||
ContactEditor(setting: mainModel.setting)),
|
||||
);
|
||||
},
|
||||
)
|
||||
: Container()
|
||||
],
|
||||
leading: new IconButton(
|
||||
icon: new Icon(Icons.close),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
title: LocalText(
|
||||
context,
|
||||
"contact",
|
||||
fontSize: 25,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
body: ListView(
|
||||
children: <Widget>[
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: 5.0, bottom: 5),
|
||||
child: LocalText(
|
||||
context,
|
||||
"contact.title",
|
||||
fontSize: 25,
|
||||
)),
|
||||
link(pickupModel.profile.usaContactNumber, Icons.phone_forwarded,
|
||||
onTap: () => _call(pickupModel.profile.usaContactNumber),
|
||||
label: LocalText(
|
||||
context,
|
||||
"contact.usa.phone",
|
||||
color: primaryColor,
|
||||
)),
|
||||
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(
|
||||
padding: const EdgeInsets.only(bottom: 15.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children:
|
||||
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),
|
||||
link(pickupModel.profile.mmAddress, Icons.location_on),
|
||||
link(pickupModel.profile.mail, Icons.email,
|
||||
onTap: () => _email(pickupModel.profile.mail)),
|
||||
link(pickupModel.profile.facebook, FontAwesomeIcons.facebook,
|
||||
onTap: () => _openLink(pickupModel.profile.facebook)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -106,17 +91,25 @@ class _ContactState extends State<Contact> {
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Icon(
|
||||
iconData,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
label == null ? Container() : label,
|
||||
Text(
|
||||
text == null ? "" : text,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 5,
|
||||
label == null
|
||||
? Container()
|
||||
: Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 10, 10, 0),
|
||||
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/pages/util.dart';
|
||||
import 'package:fcs/vo/pickup.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:flutter/material.dart';
|
||||
@@ -49,67 +52,37 @@ class _FCSProfilePageState extends State<FCSProfilePage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final usaAddress = Container(
|
||||
child: FCSTextField(
|
||||
controller: _usaAddressEditingController,
|
||||
label: 'USA Delivery Address',
|
||||
));
|
||||
final usaAddress = fcsInput('USA Delivery Address', Icons.location_on,
|
||||
controller: _usaAddressEditingController);
|
||||
final mmAddress = fcsInput('Yangon, Myanmar Office', Icons.location_on,
|
||||
controller: _mmAddressEditingController);
|
||||
|
||||
final mmAddress = Container(
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
child: FCSTextField(
|
||||
controller: _mmAddressEditingController,
|
||||
label: 'Yangon, Myanmar Office',
|
||||
)),
|
||||
]),
|
||||
);
|
||||
final contactNumber = fcsInput('USA contact number', Icons.phone,
|
||||
controller: _contactEditingController);
|
||||
final mmContactNumber = fcsInput('Myanmar contact number', Icons.phone,
|
||||
controller: _mmContactEditingController);
|
||||
|
||||
final contactNumber = Container(
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
child: FCSTextField(
|
||||
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')),
|
||||
]),
|
||||
);
|
||||
final mailBox = fcsInput('Email Address', Icons.mail,
|
||||
controller: _mailEditingController);
|
||||
final fbLinkBox = fcsInput('Facebook Link', FontAwesomeIcons.facebook,
|
||||
controller: _fbLinkEditingController);
|
||||
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(Icons.close),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: Text('FCS PROFILE'),
|
||||
title: LocalText(
|
||||
context,
|
||||
'fcs.profile',
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
body: Card(
|
||||
child: Column(
|
||||
|
||||
@@ -45,6 +45,7 @@ import 'package:provider/provider.dart';
|
||||
import '../theme/theme.dart';
|
||||
import 'announcement_list.dart';
|
||||
import 'buying_online.dart';
|
||||
import 'customer_list.dart';
|
||||
import 'do/do_list.dart';
|
||||
import 'my_registeration.dart';
|
||||
import 'pd/pd_list.dart';
|
||||
@@ -155,13 +156,18 @@ class _HomePageState extends State<HomePage> {
|
||||
final customersBtn = _buildBtn2("customers.btn",
|
||||
icon: Feather.users,
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(StaffList())));
|
||||
Navigator.of(context).push(BottomUpPageRoute(CustomerList())));
|
||||
|
||||
final invoicesBtn = _buildBtn2("invoices.btn",
|
||||
icon: FontAwesomeIcons.fileInvoice,
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(StaffList())));
|
||||
|
||||
final termBtn = _buildBtn2("term.btn",
|
||||
icon: FontAwesomeIcons.info,
|
||||
btnCallback: () =>
|
||||
Navigator.of(context).push(BottomUpPageRoute(Term())));
|
||||
|
||||
List<Widget> widgets = [];
|
||||
widgets.add(buyingBtn);
|
||||
widgets.add(pickUpBtn);
|
||||
@@ -173,6 +179,7 @@ class _HomePageState extends State<HomePage> {
|
||||
widgets.add(packagesBtn);
|
||||
widgets.add(customersBtn);
|
||||
widgets.add(invoicesBtn);
|
||||
widgets.add(termBtn);
|
||||
|
||||
return OfflineRedirect(
|
||||
child: FlavorBanner(
|
||||
@@ -248,7 +255,7 @@ class _HomePageState extends State<HomePage> {
|
||||
"Sign In",
|
||||
style: siginButtonStyle,
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
body: Container(
|
||||
decoration: BoxDecoration(
|
||||
@@ -432,7 +439,10 @@ class _HomePageState extends State<HomePage> {
|
||||
|
||||
Widget _buildSmallButton(String text, IconData iconData) {
|
||||
return InkWell(
|
||||
onTap: () => {},
|
||||
onTap: () => {
|
||||
Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => Contact())),
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(18.0),
|
||||
child: Row(
|
||||
|
||||
@@ -75,110 +75,88 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
Widget build(BuildContext context) {
|
||||
var pickupModel = Provider.of<PickUpModel>(context);
|
||||
|
||||
final pickUpAddress = Container(
|
||||
child: TextFormField(
|
||||
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 pickUpAddress = fcsInput('Pickup Address', Icons.location_on,
|
||||
controller: _addressEditingController);
|
||||
|
||||
final pickUpAddressReadOnly = Container(
|
||||
child: FCSTextFieldReadOnly(
|
||||
controller: _addressEditingController,
|
||||
label: 'Pickup Address',
|
||||
));
|
||||
final pickUpAddressReadOnly = fcsInputReadOnly(
|
||||
'Pickup Address', Icons.location_on,
|
||||
controller: _addressEditingController);
|
||||
|
||||
final pickupTime = Container(
|
||||
height: 50.0,
|
||||
child: Row(children: <Widget>[
|
||||
Container(
|
||||
width: 70.0,
|
||||
child: TextFormField(
|
||||
controller: _fromTimeEditingController,
|
||||
cursorColor: primaryColor,
|
||||
decoration: new InputDecoration(
|
||||
labelText: 'From',
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
),
|
||||
)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(' - '),
|
||||
),
|
||||
Container(
|
||||
width: 70.0,
|
||||
child: TextFormField(
|
||||
controller: _toTimeEditingController,
|
||||
cursorColor: primaryColor,
|
||||
decoration: new InputDecoration(
|
||||
labelText: 'To',
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
),
|
||||
)),
|
||||
]),
|
||||
final fromTimeBox = fcsInput(
|
||||
'From',
|
||||
Icons.timer,
|
||||
controller: _fromTimeEditingController,
|
||||
);
|
||||
|
||||
final pickupTimeReadOnly = Container(
|
||||
height: 50.0,
|
||||
child: Row(children: <Widget>[
|
||||
Container(
|
||||
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 toTimeBox = fcsInput(
|
||||
'To',
|
||||
null,
|
||||
controller: _toTimeEditingController,
|
||||
);
|
||||
|
||||
final noOfPackageBox = Container(
|
||||
height: 50.0,
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
child: TextFormField(
|
||||
controller: _noOfPackageEditingController,
|
||||
cursorColor: primaryColor,
|
||||
textAlign: TextAlign.left,
|
||||
decoration: new InputDecoration(
|
||||
labelText: 'Number of Packages',
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
final fromTimeBoxReadOnly = fcsInputReadOnly(
|
||||
'From',
|
||||
Icons.timer,
|
||||
controller: _fromTimeEditingController,
|
||||
);
|
||||
|
||||
final toTimeBoxReadOnly = fcsInputReadOnly(
|
||||
'To',
|
||||
null,
|
||||
controller: _toTimeEditingController,
|
||||
);
|
||||
|
||||
final pickupTime = Padding(
|
||||
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(
|
||||
height: 50.0,
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
child: FCSTextFieldReadOnly(
|
||||
controller: _noOfPackageEditingController,
|
||||
label: 'Number of Packages')),
|
||||
]),
|
||||
final pickupTimeReadOnly = Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
SizedBox(height: 5),
|
||||
Container(
|
||||
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(
|
||||
@@ -212,7 +190,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
EdgeInsets.symmetric(vertical: 10.0, horizontal: 0.0),
|
||||
icon: Icon(
|
||||
Icons.date_range,
|
||||
color: Colors.black87,
|
||||
color: Colors.grey,
|
||||
)),
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
@@ -258,62 +236,22 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
ExpansionTile(
|
||||
title: Text('Pickup Location / Time'),
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0),
|
||||
child: Icon(Icons.location_on),
|
||||
),
|
||||
Expanded(
|
||||
child: widget.pickUp == null
|
||||
? pickUpAddress
|
||||
: widget.pickUp.status == 'Pending'
|
||||
? pickUpAddress
|
||||
: pickUpAddressReadOnly),
|
||||
],
|
||||
),
|
||||
child: widget.pickUp == null
|
||||
? pickUpAddress
|
||||
: widget.pickUp.status == 'Pending'
|
||||
? pickUpAddress
|
||||
: pickUpAddressReadOnly,
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
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),
|
||||
widget.pickUp == null
|
||||
? pickupTime
|
||||
: widget.pickUp.status == 'Pending'
|
||||
? pickupTime
|
||||
: pickupTimeReadOnly,
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
child: Column(
|
||||
@@ -323,7 +261,6 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
ExpansionTile(
|
||||
@@ -331,23 +268,11 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0),
|
||||
child: Icon(Octicons.package),
|
||||
),
|
||||
Expanded(
|
||||
child: widget.pickUp == null
|
||||
? noOfPackageBox
|
||||
: widget.pickUp.status == 'Pending'
|
||||
? noOfPackageBox
|
||||
: noOfPackageBoxReadonly),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 15,
|
||||
child: widget.pickUp == null
|
||||
? noOfPackageBox
|
||||
: widget.pickUp.status == 'Pending'
|
||||
? noOfPackageBox
|
||||
: noOfPackageBoxReadonly,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
@@ -363,12 +288,11 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
FontAwesomeIcons.weightHanging,
|
||||
controller: _weightEditingController),
|
||||
),
|
||||
SizedBox(height: 15),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
child: fcsInput("Remark", MaterialCommunityIcons.note),
|
||||
),
|
||||
SizedBox(height: 25),
|
||||
SizedBox(height: 10.0),
|
||||
],
|
||||
),
|
||||
ExpansionTile(
|
||||
@@ -387,22 +311,19 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
"Name", FontAwesomeIcons.user,
|
||||
controller:
|
||||
_recipientNameEditingController)),
|
||||
SizedBox(height: 25),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
child: widget.pickUp == null
|
||||
? fcsInput("Phone Number", FontAwesomeIcons.phone,
|
||||
? fcsInput("Phone Number", Icons.phone,
|
||||
controller: _recipientPhoneEditingController)
|
||||
: widget.pickUp.status == 'Pending'
|
||||
? fcsInput(
|
||||
"Phone Number", FontAwesomeIcons.phone,
|
||||
? fcsInput("Phone Number", Icons.phone,
|
||||
controller:
|
||||
_recipientPhoneEditingController)
|
||||
: fcsInputReadOnly(
|
||||
"Phone Number", FontAwesomeIcons.phone,
|
||||
"Phone Number", Icons.phone,
|
||||
controller:
|
||||
_recipientPhoneEditingController)),
|
||||
SizedBox(height: 25),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20.0),
|
||||
child: widget.pickUp == null
|
||||
@@ -417,7 +338,6 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
"Address", Icons.location_on,
|
||||
controller:
|
||||
_recipientAddressEditingController)),
|
||||
SizedBox(height: 25),
|
||||
],
|
||||
),
|
||||
ExpansionTile(
|
||||
@@ -432,9 +352,6 @@ class _PickUpEditorState extends State<PickUpEditor> {
|
||||
)
|
||||
: 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("Delivery fees","\$ 5","below 10 pounds"),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 18.0, right: 18),
|
||||
child: RichText(
|
||||
// overflow: TextOverflow.fade,
|
||||
text: TextSpan(
|
||||
style: TextStyle(color: primaryColor),
|
||||
children: textList,
|
||||
),
|
||||
),
|
||||
),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(left: 18.0, right: 18),
|
||||
// child: RichText(
|
||||
// // overflow: TextOverflow.fade,
|
||||
// text: TextSpan(
|
||||
// style: TextStyle(color: primaryColor),
|
||||
// children: textList,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
fcsButton(context, "Calculate", callack: () {
|
||||
Navigator.of(context)
|
||||
.push(MaterialPageRoute(builder: (_) => ShipmentRatesCal()));
|
||||
|
||||
@@ -31,16 +31,18 @@ class _TermState extends State<Term> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = ZefyrController(_loadDocument());
|
||||
print("controller terms => ${_controller.document}");
|
||||
_focusNode = FocusNode();
|
||||
}
|
||||
|
||||
NotusDocument _loadDocument() {
|
||||
MainModel mainModel = Provider.of<MainModel>(context, listen: false);
|
||||
String term = mainModel.setting.terms;
|
||||
|
||||
print("terms => $term");
|
||||
NotusDocument doc;
|
||||
try {
|
||||
doc = NotusDocument.fromJson(jsonDecode(term));
|
||||
print('doc=> $doc');
|
||||
} catch (e) {}
|
||||
if (doc == null) {
|
||||
doc = NotusDocument();
|
||||
@@ -51,7 +53,6 @@ class _TermState extends State<Term> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
MainModel mainModel = Provider.of<MainModel>(context);
|
||||
print("controller terms => ${_controller.document}");
|
||||
|
||||
bool isOwnerAndAbove =
|
||||
mainModel.user != null && mainModel.user.isOwnerAndAbove();
|
||||
@@ -89,21 +90,41 @@ class _TermState extends State<Term> {
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
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),
|
||||
backgroundColor: primaryColor,
|
||||
actions: <Widget>[
|
||||
isOwnerAndAbove || hasAdmin
|
||||
? IconButton(
|
||||
icon: Icon(Icons.edit),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => TermEdit()),
|
||||
);
|
||||
},
|
||||
)
|
||||
: Container()
|
||||
// isOwnerAndAbove || hasAdmin
|
||||
// ?
|
||||
IconButton(
|
||||
icon: Icon(Icons.edit),
|
||||
onPressed: () async {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => TermEdit((data) {
|
||||
setState(() {
|
||||
_controller = ZefyrController(data);
|
||||
});
|
||||
})),
|
||||
);
|
||||
// print('doc=> $doc');
|
||||
|
||||
// setState(() {
|
||||
// document = doc;
|
||||
// });
|
||||
// var document = await
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(builder: (context) => TermEdit()),
|
||||
// );
|
||||
},
|
||||
)
|
||||
// : Container()
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
|
||||
@@ -14,6 +14,8 @@ import '../theme/theme.dart';
|
||||
typedef void ProfileCallback();
|
||||
|
||||
class TermEdit extends StatefulWidget {
|
||||
final ValueChanged onChangedData;
|
||||
TermEdit(this.onChangedData);
|
||||
@override
|
||||
_TermEditState createState() => _TermEditState();
|
||||
}
|
||||
@@ -110,8 +112,10 @@ class _TermEditState extends State<TermEdit> {
|
||||
});
|
||||
try {
|
||||
final contents = jsonEncode(_controller.document);
|
||||
MainModel mainModel = Provider.of<MainModel>(context, listen: false);
|
||||
mainModel.updateTerms(contents);
|
||||
print('contents => $contents');
|
||||
widget.onChangedData(_controller.document);
|
||||
// MainModel mainModel = Provider.of<MainModel>(context, listen: false);
|
||||
// mainModel.updateTerms(contents);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
|
||||
@@ -388,32 +388,50 @@ Widget fcsInput(String label, IconData iconData,
|
||||
{TextEditingController controller, String value}) {
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0),
|
||||
child: Icon(iconData),
|
||||
),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(right: 8.0),
|
||||
// child: Icon(iconData),
|
||||
// ),
|
||||
Expanded(
|
||||
child: Container(
|
||||
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
child: 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)),
|
||||
),
|
||||
)),
|
||||
initialValue: value,
|
||||
controller: controller,
|
||||
cursorColor: primaryColor,
|
||||
maxLines: null,
|
||||
minLines: 1,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
labelText: label,
|
||||
labelStyle: TextStyle(fontSize: 16, color: Colors.grey),
|
||||
filled: true,
|
||||
icon: Icon(
|
||||
iconData,
|
||||
color: Colors.grey,
|
||||
),
|
||||
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}) {
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0),
|
||||
child: Icon(iconData),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
child: TextFormField(
|
||||
initialValue: value,
|
||||
controller: controller,
|
||||
cursorColor: primaryColor,
|
||||
maxLines: null,
|
||||
minLines: 1,
|
||||
readOnly: true,
|
||||
textAlign: TextAlign.left,
|
||||
decoration: new InputDecoration(
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.only(top: 8),
|
||||
labelText: label,
|
||||
),
|
||||
)),
|
||||
initialValue: value,
|
||||
controller: controller,
|
||||
cursorColor: primaryColor,
|
||||
maxLines: null,
|
||||
minLines: 1,
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.white,
|
||||
border: InputBorder.none,
|
||||
labelText: label,
|
||||
labelStyle: TextStyle(fontSize: 16, color: Colors.grey),
|
||||
filled: true,
|
||||
icon: Icon(
|
||||
iconData,
|
||||
color: Colors.grey,
|
||||
),
|
||||
))
|
||||
),
|
||||
]),
|
||||
)),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user