check if row in the table checked

This commit is contained in:
mohammad
2024-08-24 09:28:29 +03:00
parent 13ae978908
commit 9d21b32607
3 changed files with 3 additions and 5 deletions

View File

@ -257,7 +257,8 @@ class VisitorPasswordBloc
stateDialog(
context: event.context!,
message: e.toString(),
title: 'Something Wrong'); }
title: 'Something Wrong');
}
}
//offline password

View File

@ -52,8 +52,6 @@ class ToggleRepeatEvent extends VisitorPasswordEvent {}
class GeneratePasswordEvent extends VisitorPasswordEvent {}
class FetchDevice extends VisitorPasswordEvent {
final List<String>? list;
const FetchDevice({this.list});
}
//online password

View File

@ -19,12 +19,11 @@ class AddDeviceDialog extends StatelessWidget {
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return BlocProvider(
create: (context) => VisitorPasswordBloc()..add(FetchDevice(list: selectedDeviceIds)),
create: (context) => VisitorPasswordBloc()..add(FetchDevice()),
child: BlocBuilder<VisitorPasswordBloc, VisitorPasswordState>(
builder: (BuildContext context, VisitorPasswordState state) {
final visitorBloc = BlocProvider.of<VisitorPasswordBloc>(context);
if (state is TableLoaded) {
print('ooooooooooo${selectedDeviceIds}');
for (var device in selectedDeviceIds!) {
if (selectedDeviceIds!.contains(device)) {
visitorBloc.add(SelectDeviceEvent(device));