fix saving and display of stocks
This commit is contained in:
parent
6c5e9f84d7
commit
e8d0f213e9
5 changed files with 255 additions and 138 deletions
|
|
@ -190,8 +190,20 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
|
|||
final medTypeUUID = await _refTypes.getUUID(_selectedType);
|
||||
final medManufacturerUUID = await _refManufacturer.getUUID(_selectedManufacturer);
|
||||
|
||||
await _refMedicines.postMedicine(
|
||||
final posted = await _refMedicines.postMedicine(
|
||||
uuid, medName, medManufacturerUUID, medGenericUUID, medTypeUUID, encrpytedBarcode);
|
||||
|
||||
if (posted) {
|
||||
if (mounted) {
|
||||
showNotification(context, 'Medicine Added Successfully', true);
|
||||
setState(() => _isLoading = false);
|
||||
context.pop();
|
||||
}
|
||||
} else {
|
||||
if (mounted) {
|
||||
showNotification(context, 'Error: Medicine Not Added', false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mounted) {
|
||||
showNotification(context, 'Error: No Internet Connection', false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue