|
|
|
|
@ -47,10 +47,7 @@ class _MyAssetsPageState extends State<MyAssetsPage> {
|
|
|
|
|
|
|
|
|
|
_getDevice(String result, {bool isQr = false}) async {
|
|
|
|
|
_devicesProvider.reset();
|
|
|
|
|
await _devicesProvider.getAssets(
|
|
|
|
|
search: DeviceSearch(assetNo: result, assetSerialNumber: ""),
|
|
|
|
|
isQr: isQr,
|
|
|
|
|
);
|
|
|
|
|
await _devicesProvider.getAssets(search: DeviceSearch(assetNo: result, assetSerialNumber: ""), isQr: isQr);
|
|
|
|
|
_searchableList.clear();
|
|
|
|
|
_searchableList.addAll(_devicesProvider.devices);
|
|
|
|
|
}
|
|
|
|
|
@ -144,7 +141,7 @@ class _MyAssetsPageState extends State<MyAssetsPage> {
|
|
|
|
|
),
|
|
|
|
|
body: SafeArea(
|
|
|
|
|
child: LoadingManager(
|
|
|
|
|
isLoading: _devicesProvider.isLoading,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
stateCode: _devicesProvider.stateCode,
|
|
|
|
|
isFailedLoading: _devicesProvider.devices == null,
|
|
|
|
|
onRefresh: () async {
|
|
|
|
|
@ -155,20 +152,22 @@ class _MyAssetsPageState extends State<MyAssetsPage> {
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: _searchableList.isEmpty
|
|
|
|
|
? NoDataFound(message: context.translation.noDeviceFound)
|
|
|
|
|
? NoDataFound(message: context.translation.noDeviceFound).center
|
|
|
|
|
: LazyLoading(
|
|
|
|
|
nextPage: _devicesProvider.nextPage,
|
|
|
|
|
onLazyLoad: () async {
|
|
|
|
|
await _devicesProvider.getDevicesList(
|
|
|
|
|
user: _userProvider.user!,
|
|
|
|
|
host: _settingProvider.host!,
|
|
|
|
|
hospitalId: _userProvider.user!.clientId!,
|
|
|
|
|
search: _searchAsset?.copyWith(assetSerialNumber: snController.text, assetNo: numberController.text),
|
|
|
|
|
await _devicesProvider.getAssets(
|
|
|
|
|
// user: _userProvider.user!,
|
|
|
|
|
// host: _settingProvider.host!,
|
|
|
|
|
// hospitalId: _userProvider.user!.clientId!,
|
|
|
|
|
search: _searchAsset,
|
|
|
|
|
// serialNumber: snController.text,
|
|
|
|
|
// number: numberController.text,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: AnimatedSwitcher(
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
AnimatedSwitcher(
|
|
|
|
|
duration: const Duration(milliseconds: 500),
|
|
|
|
|
child: showListView
|
|
|
|
|
? ListView.separated(
|
|
|
|
|
@ -199,6 +198,9 @@ class _MyAssetsPageState extends State<MyAssetsPage> {
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (_devicesProvider.isLoading) Align(alignment: Alignment.bottomCenter, child: const CircularProgressIndicator().paddingOnly(top: 16, bottom: 16)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|