update rate

This commit is contained in:
Thinzar Win
2020-06-29 16:15:25 +06:30
parent 02450c003e
commit 8e65a533db
25 changed files with 746 additions and 136 deletions

View File

@@ -25,6 +25,7 @@ class _CustomerEditorState extends State<CustomerEditor> {
TextEditingController _name = new TextEditingController();
TextEditingController _phone = new TextEditingController();
TextEditingController _phoneInput = new TextEditingController();
TextEditingController _status = new TextEditingController();
final _formKey = GlobalKey<FormState>();
bool _isLoading = false;
@@ -41,6 +42,7 @@ class _CustomerEditorState extends State<CustomerEditor> {
if (widget.customer != null) {
_name.text = widget.customer.name;
_phone.text = widget.customer.phone;
_status.text = widget.customer.status;
// privileges.forEach((p) => widget.employee.privilegeIds.contains(p.id)
// ? p.isChecked = true
// : p.isChecked = false);
@@ -174,6 +176,21 @@ class _CustomerEditorState extends State<CustomerEditor> {
],
);
final statusbox = TextFormField(
controller: _status,
autofocus: false,
readOnly: true,
cursorColor: primaryColor,
decoration: new InputDecoration(
border: InputBorder.none,
focusedBorder: InputBorder.none,
icon: Icon(
Icons.av_timer,
color: primaryColor,
),
),
);
final updateButton = Container(
padding: EdgeInsets.only(top: 40),
child: Container(
@@ -265,7 +282,8 @@ class _CustomerEditorState extends State<CustomerEditor> {
: phoneNumberBox,
widget.customer == null
? this.isSend ? namebox : Container()
: namebox,
: namebox,
statusbox,
// widget.customer == null ? addButton : updateButton,
SizedBox(
height: 20,
@@ -305,7 +323,8 @@ class _CustomerEditorState extends State<CustomerEditor> {
if (widget.customer == null) return;
var employeeModel = Provider.of<EmployeeModel>(context);
try {
await employeeModel.updatePrivileges(widget.customer.docID, privilegesIDs());
await employeeModel.updatePrivileges(
widget.customer.docID, privilegesIDs());
Navigator.pop(context);
} catch (e) {
showMsgDialog(context, "Error", e.toString());