mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Refactor device search filters layout for improved code organization and to remove any code duplication.
This commit is contained in:
@ -31,42 +31,33 @@ class _DeviceSearchFiltersState extends State<DeviceSearchFilters>
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Widget> get _widgets => [
|
||||||
|
_buildSearchField(
|
||||||
|
"Space Name",
|
||||||
|
unitNameController,
|
||||||
|
200,
|
||||||
|
),
|
||||||
|
_buildSearchField(
|
||||||
|
"Device Name / Product Name",
|
||||||
|
productNameController,
|
||||||
|
300,
|
||||||
|
),
|
||||||
|
_buildSearchResetButtons(),
|
||||||
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return isExtraLargeScreenSize(context)
|
if (isExtraLargeScreenSize(context)) {
|
||||||
? Row(
|
return Row(
|
||||||
children: [
|
spacing: 20,
|
||||||
_buildSearchField(
|
children: _widgets,
|
||||||
"Space Name",
|
);
|
||||||
unitNameController,
|
}
|
||||||
200,
|
|
||||||
),
|
return Wrap(
|
||||||
const SizedBox(width: 20),
|
|
||||||
_buildSearchField(
|
|
||||||
"Device Name / Product Name",
|
|
||||||
productNameController,
|
|
||||||
300,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 20),
|
|
||||||
_buildSearchResetButtons(),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: Wrap(
|
|
||||||
spacing: 20,
|
spacing: 20,
|
||||||
runSpacing: 10,
|
runSpacing: 10,
|
||||||
children: [
|
children: _widgets,
|
||||||
_buildSearchField(
|
|
||||||
"Space Name",
|
|
||||||
unitNameController,
|
|
||||||
200,
|
|
||||||
),
|
|
||||||
_buildSearchField(
|
|
||||||
"Device Name / Product Name",
|
|
||||||
productNameController,
|
|
||||||
300,
|
|
||||||
),
|
|
||||||
_buildSearchResetButtons(),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user