insert shipment form
This commit is contained in:
@@ -10,7 +10,6 @@ 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 'document_log_page.dart';
|
||||
import 'util.dart';
|
||||
|
||||
typedef void FindCallBack();
|
||||
@@ -112,16 +111,9 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(color: primaryColor, width: 1.0)),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return "Please enter phone number";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
new FlatButton(
|
||||
onPressed: () {
|
||||
if (!_formKey.currentState.validate()) return;
|
||||
this.isSend = true;
|
||||
findCallBack();
|
||||
},
|
||||
@@ -189,9 +181,9 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
child: Container(
|
||||
height: 45.0,
|
||||
decoration: BoxDecoration(
|
||||
color: primaryColor,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(Radius.circular(10.0))),
|
||||
color: primaryColor,
|
||||
shape: BoxShape.rectangle,
|
||||
),
|
||||
child: ButtonTheme(
|
||||
minWidth: 900.0,
|
||||
height: 100.0,
|
||||
@@ -208,25 +200,23 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final addButton = Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 24.0,
|
||||
right: 24.0,
|
||||
),
|
||||
padding: EdgeInsets.only(top: 40),
|
||||
child: Container(
|
||||
height: 45.0,
|
||||
color: primaryColor,
|
||||
decoration: BoxDecoration(
|
||||
color: primaryColor,
|
||||
shape: BoxShape.rectangle,
|
||||
),
|
||||
child: ButtonTheme(
|
||||
minWidth: 900.0,
|
||||
height: 100.0,
|
||||
child: FlatButton(
|
||||
onPressed: () {
|
||||
if (!_formKey.currentState.validate()) return;
|
||||
_add(context);
|
||||
},
|
||||
onPressed: () {},
|
||||
child: LocalText(
|
||||
context,
|
||||
'employee.add',
|
||||
'staff.add',
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -240,6 +230,11 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
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,
|
||||
@@ -276,7 +271,7 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
Column(
|
||||
children: showprivilegeList(context, userModel),
|
||||
),
|
||||
updateButton,
|
||||
widget.staff == null ? addButton : updateButton,
|
||||
SizedBox(
|
||||
height: 20,
|
||||
)
|
||||
@@ -315,8 +310,7 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
if (widget.staff == null) return;
|
||||
var employeeModel = Provider.of<EmployeeModel>(context);
|
||||
try {
|
||||
await employeeModel.updatePrivileges(
|
||||
widget.staff.docID, privilegesIDs());
|
||||
await employeeModel.updatePrivileges(widget.staff.docID, privilegesIDs());
|
||||
Navigator.pop(context);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
|
||||
Reference in New Issue
Block a user