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