|
|
|
|
@ -161,35 +161,38 @@ class _SingleDevicePickerState extends State<SingleDevicePicker> {
|
|
|
|
|
await _devicesProvider.getDevicesList(
|
|
|
|
|
user: _userProvider.user, host: _settingProvider.host, hospitalId: _userProvider.user.clientId, serialNumber: snController.text, number: numberController.text);
|
|
|
|
|
},
|
|
|
|
|
child: showListView
|
|
|
|
|
? ListView.separated(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
itemCount: _searchableList.length,
|
|
|
|
|
separatorBuilder: (listContext, itemIndex) => 8.height,
|
|
|
|
|
itemBuilder: (listContext, itemIndex) {
|
|
|
|
|
return AssetItemListView(
|
|
|
|
|
device: _searchableList[itemIndex],
|
|
|
|
|
onPressed: (device) {
|
|
|
|
|
Navigator.of(context).pop(device);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: GridView.builder(
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 191 / 261, crossAxisSpacing: 16, mainAxisSpacing: 16),
|
|
|
|
|
itemCount: _searchableList.length,
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return AssetItemGridView(
|
|
|
|
|
device: _searchableList[index],
|
|
|
|
|
onPressed: (device) {
|
|
|
|
|
Navigator.of(context).pushNamed(AssetDetailPage.id, arguments: device.id);
|
|
|
|
|
return;
|
|
|
|
|
Navigator.of(context).pop(device);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
child: AnimatedSwitcher(
|
|
|
|
|
duration: const Duration(milliseconds: 500),
|
|
|
|
|
child: showListView
|
|
|
|
|
? ListView.separated(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
itemCount: _searchableList.length,
|
|
|
|
|
separatorBuilder: (listContext, itemIndex) => 8.height,
|
|
|
|
|
itemBuilder: (listContext, itemIndex) {
|
|
|
|
|
return AssetItemListView(
|
|
|
|
|
device: _searchableList[itemIndex],
|
|
|
|
|
onPressed: (device) {
|
|
|
|
|
Navigator.of(context).pop(device);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: GridView.builder(
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 191 / 261, crossAxisSpacing: 16, mainAxisSpacing: 16),
|
|
|
|
|
itemCount: _searchableList.length,
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return AssetItemGridView(
|
|
|
|
|
device: _searchableList[index],
|
|
|
|
|
onPressed: (device) {
|
|
|
|
|
Navigator.of(context).pushNamed(AssetDetailPage.id, arguments: device.id);
|
|
|
|
|
return;
|
|
|
|
|
Navigator.of(context).pop(device);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|