mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-25 15:09:41 +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()),
|
..add(const LoadProducts()),
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
title: const Text('Add Devices'),
|
title: const SelectableText('Add Devices'),
|
||||||
backgroundColor: ColorsManager.whiteColors,
|
backgroundColor: ColorsManager.whiteColors,
|
||||||
content: BlocBuilder<ProductsBloc, ProductsState>(
|
content: BlocBuilder<ProductsBloc, ProductsState>(
|
||||||
builder: (context, state) => switch (state) {
|
builder: (context, state) => switch (state) {
|
||||||
|
@ -25,12 +25,10 @@ class AssignTagsDialog extends StatelessWidget {
|
|||||||
actions: [
|
actions: [
|
||||||
SpaceDetailsActionButtons(
|
SpaceDetailsActionButtons(
|
||||||
onSave: () {},
|
onSave: () {},
|
||||||
onCancel: () {
|
onCancel: () => showDialog<void>(
|
||||||
showDialog<void>(
|
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => const AddDeviceTypeWidget(),
|
builder: (context) => const AddDeviceTypeWidget(),
|
||||||
);
|
),
|
||||||
},
|
|
||||||
cancelButtonLabel: 'Add New Device',
|
cancelButtonLabel: 'Add New Device',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -42,7 +42,8 @@ class _AssignTagsTableState extends State<AssignTagsTable> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DataColumn _buildDataColumn(String label) {
|
DataColumn _buildDataColumn(String label) {
|
||||||
return DataColumn(label: Text(label, style: context.textTheme.bodyMedium));
|
return DataColumn(
|
||||||
|
label: SelectableText(label, style: context.textTheme.bodyMedium));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -69,7 +70,7 @@ class _AssignTagsTableState extends State<AssignTagsTable> {
|
|||||||
cells: [
|
cells: [
|
||||||
DataCell(
|
DataCell(
|
||||||
Center(
|
Center(
|
||||||
child: Text(
|
child: SelectableText(
|
||||||
'No Devices Available',
|
'No Devices Available',
|
||||||
style: context.textTheme.bodyMedium?.copyWith(
|
style: context.textTheme.bodyMedium?.copyWith(
|
||||||
color: ColorsManager.lightGrayColor,
|
color: ColorsManager.lightGrayColor,
|
||||||
|
@ -25,10 +25,7 @@ class ProductsGrid extends StatelessWidget {
|
|||||||
color: ColorsManager.textFieldGreyColor,
|
color: ColorsManager.textFieldGreyColor,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Expanded(
|
||||||
children: [
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
Expanded(
|
|
||||||
child: GridView.builder(
|
child: GridView.builder(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 20,
|
horizontal: 20,
|
||||||
@ -49,8 +46,6 @@ class ProductsGrid extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user