update rate
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user