mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Refactor Widgets for Improved UI Consistency and Usability:
- Replaced Text with SelectableText in AddDeviceTypeWidget and AssignTagsTable for better text selection and accessibility. - Simplified onCancel action in AssignTagsDialog for improved readability. - Enhanced ProductsGrid layout by removing unnecessary Column widget, streamlining the widget structure for better performance and maintainability.
This commit is contained in:
@ -17,7 +17,7 @@ class AddDeviceTypeWidget extends StatelessWidget {
|
||||
..add(const LoadProducts()),
|
||||
child: Builder(
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('Add Devices'),
|
||||
title: const SelectableText('Add Devices'),
|
||||
backgroundColor: ColorsManager.whiteColors,
|
||||
content: BlocBuilder<ProductsBloc, ProductsState>(
|
||||
builder: (context, state) => switch (state) {
|
||||
|
@ -25,12 +25,10 @@ class AssignTagsDialog extends StatelessWidget {
|
||||
actions: [
|
||||
SpaceDetailsActionButtons(
|
||||
onSave: () {},
|
||||
onCancel: () {
|
||||
showDialog<void>(
|
||||
onCancel: () => showDialog<void>(
|
||||
context: context,
|
||||
builder: (context) => const AddDeviceTypeWidget(),
|
||||
);
|
||||
},
|
||||
),
|
||||
cancelButtonLabel: 'Add New Device',
|
||||
),
|
||||
],
|
||||
|
@ -42,7 +42,8 @@ class _AssignTagsTableState extends State<AssignTagsTable> {
|
||||
}
|
||||
|
||||
DataColumn _buildDataColumn(String label) {
|
||||
return DataColumn(label: Text(label, style: context.textTheme.bodyMedium));
|
||||
return DataColumn(
|
||||
label: SelectableText(label, style: context.textTheme.bodyMedium));
|
||||
}
|
||||
|
||||
@override
|
||||
@ -69,7 +70,7 @@ class _AssignTagsTableState extends State<AssignTagsTable> {
|
||||
cells: [
|
||||
DataCell(
|
||||
Center(
|
||||
child: Text(
|
||||
child: SelectableText(
|
||||
'No Devices Available',
|
||||
style: context.textTheme.bodyMedium?.copyWith(
|
||||
color: ColorsManager.lightGrayColor,
|
||||
|
@ -25,10 +25,7 @@ class ProductsGrid extends StatelessWidget {
|
||||
color: ColorsManager.textFieldGreyColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
Expanded(
|
||||
child: Expanded(
|
||||
child: GridView.builder(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20,
|
||||
@ -49,8 +46,6 @@ class ProductsGrid extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user