mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
check if row in the table checked
This commit is contained in:
@ -51,7 +51,10 @@ class ToggleDaySelectionEvent extends VisitorPasswordEvent {
|
||||
class ToggleRepeatEvent extends VisitorPasswordEvent {}
|
||||
class GeneratePasswordEvent extends VisitorPasswordEvent {}
|
||||
|
||||
class FetchDevice extends VisitorPasswordEvent {}
|
||||
class FetchDevice extends VisitorPasswordEvent {
|
||||
final List<String>? list;
|
||||
const FetchDevice({this.list});
|
||||
}
|
||||
|
||||
//online password
|
||||
class OnlineOneTimePasswordEvent extends VisitorPasswordEvent {
|
||||
|
@ -13,15 +13,25 @@ import 'package:syncrow_web/utils/constants/const.dart';
|
||||
import 'package:syncrow_web/utils/style.dart';
|
||||
|
||||
class AddDeviceDialog extends StatelessWidget {
|
||||
const AddDeviceDialog({super.key});
|
||||
final List<String>? selectedDeviceIds;
|
||||
const AddDeviceDialog({super.key,this.selectedDeviceIds });
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Size size = MediaQuery.of(context).size;
|
||||
return BlocProvider(
|
||||
create: (context) => VisitorPasswordBloc()..add(FetchDevice()),
|
||||
create: (context) => VisitorPasswordBloc()..add(FetchDevice(list: selectedDeviceIds)),
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return AlertDialog(
|
||||
backgroundColor: Colors.white,
|
||||
title: Text('Add Accessible Device',
|
||||
@ -143,6 +153,7 @@ class AddDeviceDialog extends StatelessWidget {
|
||||
flex: 3,
|
||||
child: state is TableLoaded
|
||||
? DynamicTable(
|
||||
initialSelectedIds:selectedDeviceIds ,
|
||||
cellDecoration: containerDecoration,
|
||||
isEmpty:visitorBloc.data.isEmpty,
|
||||
selectAll: (p0) {
|
||||
|
@ -318,7 +318,7 @@ class VisitorPasswordDialog extends StatelessWidget {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return const AddDeviceDialog();
|
||||
return AddDeviceDialog(selectedDeviceIds: visitorBloc.selectedDevices,);
|
||||
},
|
||||
).then((listDevice) {
|
||||
if(listDevice!=null){
|
||||
|
Reference in New Issue
Block a user