|
|
|
@ -1,5 +1,4 @@
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:fluttertoast/fluttertoast.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:test_sa/controllers/localization/localization.dart';
|
|
|
|
import 'package:test_sa/controllers/localization/localization.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/api/devices_provider.dart';
|
|
|
|
import 'package:test_sa/controllers/providers/api/devices_provider.dart';
|
|
|
|
@ -33,20 +32,20 @@ class _SingleDevicePickerState extends State<SingleDevicePicker> {
|
|
|
|
TextEditingController numberController = TextEditingController();
|
|
|
|
TextEditingController numberController = TextEditingController();
|
|
|
|
TextEditingController snController = TextEditingController();
|
|
|
|
TextEditingController snController = TextEditingController();
|
|
|
|
_getDevice(String result) async {
|
|
|
|
_getDevice(String result) async {
|
|
|
|
|
|
|
|
print(result);
|
|
|
|
if (result == null) return;
|
|
|
|
if (result == null) return;
|
|
|
|
showDialog(
|
|
|
|
// List<Device> devices = await _devicesProvider.getDevicesListBySN(host: _settingProvider.host, user: _userProvider.user, hospitalId: _userProvider.user.clientId, sn: result);
|
|
|
|
barrierDismissible: false,
|
|
|
|
_devicesProvider.reset();
|
|
|
|
context: context,
|
|
|
|
await _devicesProvider.getEquipment(user: _userProvider.user, host: _settingProvider.host, hospitalId: _userProvider.user.clientId, serialNumber: "", number: result);
|
|
|
|
builder: (dialogContext) {
|
|
|
|
_searchableList.clear();
|
|
|
|
return const Center(child: CircularProgressIndicator());
|
|
|
|
_searchableList.addAll(_devicesProvider.devices);
|
|
|
|
});
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
List<Device> devices = await _devicesProvider.getDevicesListBySN(host: _settingProvider.host, user: _userProvider.user, hospitalId: _userProvider.user.clientId, sn: result);
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
// if (devices.isEmpty) {
|
|
|
|
if (devices.isEmpty) {
|
|
|
|
// Fluttertoast.showToast(msg: _subtitle.noDeviceFound);
|
|
|
|
Fluttertoast.showToast(msg: _subtitle.noDeviceFound);
|
|
|
|
// return;
|
|
|
|
return;
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// Navigator.of(context).pop(devices.first);
|
|
|
|
Navigator.of(context).pop(devices.first);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
|