update processing,customer and staff

This commit is contained in:
tzw
2021-10-11 17:09:47 +06:30
parent bfa6b8c2ed
commit 8df11b70a0
22 changed files with 158 additions and 59 deletions

View File

@@ -21,6 +21,7 @@ import 'package:provider/provider.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import '../../helpers/theme.dart';
import 'package:collection/collection.dart';
typedef void ProfileCallback();
@@ -202,9 +203,11 @@ class _ProfileState extends State<Profile> {
Provider.of<StaffModel>(context, listen: false).privileges;
if (user == null || user.isCustomer()) return Container();
List<Privilege> privileges = [];
user.privileges.forEach((e) {
var p = _privileges.firstWhere((p) => p.id == e);
Privilege? p = _privileges.firstWhereOrNull((p) => p.id == e);
if (p != null) {
privileges.add(p);
}