mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
add_new_user_dialog
This commit is contained in:
@ -199,7 +199,6 @@ class UsersBloc extends Bloc<UsersEvent, UsersState> {
|
||||
node.title.toLowerCase().contains(searchTerm.toLowerCase());
|
||||
bool childMatch = _searchRolePermission(node.subOptions, searchTerm);
|
||||
node.isHighlighted = isMatch || childMatch;
|
||||
|
||||
anyMatch = anyMatch || node.isHighlighted;
|
||||
}
|
||||
return anyMatch;
|
||||
|
@ -208,22 +208,52 @@ class _PermissionManagementState extends State<PermissionManagement> {
|
||||
itemCount: subOption.subOptions.length,
|
||||
itemBuilder: (context, index) {
|
||||
final child = subOption.subOptions[index];
|
||||
return CheckboxListTile(
|
||||
selectedTileColor: child.isHighlighted
|
||||
return Container(
|
||||
color: option.isHighlighted
|
||||
? Colors.blue.shade50
|
||||
: Colors.white,
|
||||
dense: true,
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
title: Text(
|
||||
child: Row(
|
||||
children: [
|
||||
Builder(
|
||||
builder: (context) {
|
||||
final checkState =
|
||||
checkifOneOfthemChecked(PermissionOption(
|
||||
id: child.id,
|
||||
title: child.title,
|
||||
subOptions: [child],
|
||||
));
|
||||
|
||||
if (checkState == CheckState.all) {
|
||||
return Image.asset(
|
||||
Assets.CheckBoxChecked,
|
||||
width: 20,
|
||||
height: 20,
|
||||
);
|
||||
} else if (checkState == CheckState.some) {
|
||||
return Image.asset(
|
||||
Assets.rectangleCheckBox,
|
||||
width: 20,
|
||||
height: 20,
|
||||
);
|
||||
} else {
|
||||
return Image.asset(
|
||||
Assets.emptyBox,
|
||||
width: 20,
|
||||
height: 20,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
child.title,
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 12,
|
||||
color: ColorsManager.lightGreyColor),
|
||||
),
|
||||
value: child.isChecked,
|
||||
onChanged: (value) => toggleOptionById(child.id),
|
||||
enabled: false,
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
@ -237,3 +267,29 @@ class _PermissionManagementState extends State<PermissionManagement> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Container(
|
||||
// height: 50,
|
||||
// width: 120,
|
||||
// child: CheckboxListTile(
|
||||
// activeColor: ColorsManager.dialogBlueTitle,
|
||||
// selectedTileColor: child.isHighlighted
|
||||
// ? Colors.blue.shade50
|
||||
// : Colors.white,
|
||||
// dense: true,
|
||||
// controlAffinity:
|
||||
// ListTileControlAffinity.leading,
|
||||
// title: Text(
|
||||
// child.title,
|
||||
// style: context.textTheme.bodyMedium?.copyWith(
|
||||
// fontWeight: FontWeight.w400,
|
||||
// fontSize: 12,
|
||||
// color: ColorsManager.lightGreyColor),
|
||||
// ),
|
||||
// value: child.isChecked,
|
||||
// onChanged: (value) =>
|
||||
// toggleOptionById(child.id),
|
||||
// enabled: false,
|
||||
// ),
|
||||
// ),
|
Reference in New Issue
Block a user