add_new_user_dialog

This commit is contained in:
mohammad
2024-12-29 09:52:13 +03:00
parent ed2187b7ff
commit c834ad0670
2 changed files with 69 additions and 14 deletions

View File

@ -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;

View File

@ -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,
// ),
// ),