diff --git a/lib/pages/common/custom_table.dart b/lib/pages/common/custom_table.dart index 2b312152..c2a83273 100644 --- a/lib/pages/common/custom_table.dart +++ b/lib/pages/common/custom_table.dart @@ -8,7 +8,6 @@ class DynamicTable extends StatefulWidget { final BoxDecoration? cellDecoration; final Size size; final bool withCheckBox; - final void Function(bool?)? onChanged; final void Function(bool?)? selectAll; final void Function(int, bool?)? onRowCheckboxChanged; @@ -20,7 +19,6 @@ class DynamicTable extends StatefulWidget { required this.withCheckBox, this.headerDecoration, this.cellDecoration, - this.onChanged, this.selectAll, this.onRowCheckboxChanged, }) : super(key: key); diff --git a/lib/pages/visitor_password/view/add_device_dialog.dart b/lib/pages/visitor_password/view/add_device_dialog.dart index d50ec164..58e49182 100644 --- a/lib/pages/visitor_password/view/add_device_dialog.dart +++ b/lib/pages/visitor_password/view/add_device_dialog.dart @@ -151,33 +151,31 @@ class AddDeviceDialog extends StatelessWidget { const SizedBox(height: 20), Expanded( child: state is TableLoaded - ? Container( - decoration: containerDecoration, - child: DynamicTable( - selectAll: (p0) { - visitorBloc.selectedDeviceIds.clear(); - for (var item in state.data) { - visitorBloc.add(SelectDeviceEvent(item.uuid)); - } - }, - onRowCheckboxChanged: (index, isSelected) { - final deviceId = state.data[index].uuid; - visitorBloc.add(SelectDeviceEvent(deviceId)); - }, - withCheckBox: true, - size: size*0.5, - headers: const [ 'Device Name', 'Device ID', 'Access Type', 'Unit Name', 'Status'], - data: state.data.map((item) { - return [ - item.name.toString(), - item.uuid.toString(), - item.productType.toString(), - '', - item.online.value.toString(), - ]; - }).toList(), - ), - ) + ? DynamicTable( + cellDecoration: containerDecoration, + selectAll: (p0) { + visitorBloc.selectedDeviceIds.clear(); + for (var item in state.data) { + visitorBloc.add(SelectDeviceEvent(item.uuid)); + } + }, + onRowCheckboxChanged: (index, isSelected) { + final deviceId = state.data[index].uuid; + visitorBloc.add(SelectDeviceEvent(deviceId)); + }, + withCheckBox: true, + size: size*0.5, + headers: const [ 'Device Name', 'Device ID', 'Access Type', 'Unit Name', 'Status'], + data: state.data.map((item) { + return [ + item.name.toString(), + item.uuid.toString(), + item.productType.toString(), + '', + item.online.value.toString(), + ]; + }).toList(), + ) : const Center(child: CircularProgressIndicator())) ], ),