merge material 3
This commit is contained in:
@@ -6,9 +6,8 @@ import 'package:fcs/pages/main/model/language_model.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/staff/model/staff_model.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -37,8 +36,8 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
isNew = widget.staff == null;
|
||||
user = User();
|
||||
if (!isNew) {
|
||||
user =
|
||||
User(name: widget.staff!.name, phoneNumber: widget.staff!.phoneNumber);
|
||||
user = User(
|
||||
name: widget.staff!.name, phoneNumber: widget.staff!.phoneNumber);
|
||||
user.privileges = widget.staff!.privileges;
|
||||
privileges.forEach((p) => user.privileges.contains(p.id)
|
||||
? p.isChecked = true
|
||||
@@ -64,11 +63,12 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
new Checkbox(
|
||||
value: p.isChecked == null ? false : p.isChecked,
|
||||
activeColor: primaryColor,
|
||||
side: BorderSide(color: Colors.black38, width: 2),
|
||||
onChanged: (bool? value) {
|
||||
if(value != null)
|
||||
setState(() {
|
||||
p.isChecked = value;
|
||||
});
|
||||
if (value != null)
|
||||
setState(() {
|
||||
p.isChecked = value;
|
||||
});
|
||||
}),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0),
|
||||
@@ -79,7 +79,7 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
p.name ??"",
|
||||
p.name ?? "",
|
||||
style: TextStyle(fontSize: 15.0, color: primaryColor),
|
||||
),
|
||||
Text(p.desc ?? "",
|
||||
@@ -169,23 +169,11 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back,
|
||||
color: primaryColor, size: 30),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
}),
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: Colors.white,
|
||||
title: LocalText(
|
||||
context,
|
||||
"staff.form.title",
|
||||
fontSize: 20,
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
appBar: LocalAppBar(
|
||||
labelKey: "staff.form.title",
|
||||
backgroundColor: Colors.white,
|
||||
labelColor: primaryColor,
|
||||
arrowColor: primaryColor),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.only(left: 12.0, right: 12),
|
||||
child: ListView(
|
||||
@@ -197,7 +185,7 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
namebox,
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 18.0),
|
||||
child: Text("Privileges"),
|
||||
child: Text("Privileges", style: TextStyle(fontSize: 15)),
|
||||
),
|
||||
Column(
|
||||
children: showprivilegeList(context),
|
||||
@@ -227,7 +215,8 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
});
|
||||
StaffModel staffModel = Provider.of<StaffModel>(context, listen: false);
|
||||
try {
|
||||
await staffModel.updatePrivileges(this.selectedUser!.id!, privilegesIDs());
|
||||
await staffModel.updatePrivileges(
|
||||
this.selectedUser!.id!, privilegesIDs());
|
||||
Navigator.pop(context);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:fcs/domain/entities/user.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/staff/model/staff_model.dart';
|
||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -35,20 +36,7 @@ class _StaffListState extends State<StaffList> {
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: primaryColor,
|
||||
title: LocalText(
|
||||
context,
|
||||
'staff.list.title',
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
appBar: LocalAppBar(labelKey: "staff.list.title"),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
Navigator.of(context).push(
|
||||
|
||||
Reference in New Issue
Block a user