mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
fix bugs
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/bloc/device_managment_bloc.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
|
||||
@ -78,20 +80,22 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
_selectAll = false;
|
||||
}
|
||||
|
||||
void _toggleSelectAll(bool? value) {
|
||||
setState(() {
|
||||
_selectAll = value ?? false;
|
||||
_selectedRows = List<bool>.filled(widget.data.length, _selectAll);
|
||||
});
|
||||
widget.onSelectionChanged?.call(_selectedRows);
|
||||
}
|
||||
|
||||
void _toggleRowSelection(int index) {
|
||||
setState(() {
|
||||
_selectedRows[index] = !_selectedRows[index];
|
||||
_selectAll = _selectedRows.every((isSelected) => isSelected);
|
||||
});
|
||||
widget.onSelectionChanged?.call(_selectedRows);
|
||||
context.read<DeviceManagementBloc>().add(UpdateSelection(_selectedRows));
|
||||
}
|
||||
|
||||
void _toggleSelectAll(bool? value) {
|
||||
setState(() {
|
||||
_selectAll = value ?? false;
|
||||
_selectedRows = List<bool>.filled(widget.data.length, _selectAll);
|
||||
});
|
||||
widget.onSelectionChanged?.call(_selectedRows);
|
||||
context.read<DeviceManagementBloc>().add(UpdateSelection(_selectedRows));
|
||||
}
|
||||
|
||||
@override
|
||||
@ -130,13 +134,9 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
),
|
||||
Text(
|
||||
// no password
|
||||
widget.tableName == 'AccessManagement'
|
||||
? 'No Password '
|
||||
: 'No Devices',
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(color: ColorsManager.grayColor),
|
||||
widget.tableName == 'AccessManagement' ? 'No Password ' : 'No Devices',
|
||||
style:
|
||||
Theme.of(context).textTheme.bodySmall!.copyWith(color: ColorsManager.grayColor),
|
||||
)
|
||||
],
|
||||
),
|
||||
@ -155,10 +155,8 @@ class _DynamicTableState extends State<DynamicTable> {
|
||||
final row = widget.data[index];
|
||||
return Row(
|
||||
children: [
|
||||
if (widget.withCheckBox)
|
||||
_buildRowCheckbox(index, widget.size.height * 0.10),
|
||||
...row.map((cell) =>
|
||||
_buildTableCell(cell.toString(), widget.size.height * 0.10)),
|
||||
if (widget.withCheckBox) _buildRowCheckbox(index, widget.size.height * 0.10),
|
||||
...row.map((cell) => _buildTableCell(cell.toString(), widget.size.height * 0.10)),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
Reference in New Issue
Block a user