only allow saving after image uploaded

This commit is contained in:
Patrick Alvin Alcala 2025-04-11 17:36:29 +08:00
parent 5283e7a6c6
commit 9cf3934f6f
2 changed files with 3 additions and 3 deletions

View file

@ -59,6 +59,7 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
late String uuid = '';
late bool imageUploaded = false;
late String imageUrl = '';
late bool uploaded = false;
Future<void> _getGenerics() async {
_genericNameList = await _refGenericNames.getList();
@ -227,7 +228,6 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
final imageBytes = await image!.readAsBytes();
final webpImage = await _webpConvert(imageBytes);
late bool uploaded = false;
uuid = imageName;
@ -366,6 +366,7 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
// const Center(child: CircularProgressIndicator(color: Colors.white))
// else
// ButtonWidget(text: 'Save Medicine', onPressed: _saveMedicine)
if (uploaded)
ButtonWithProgressWidget(
trigger: _isLoading,
progressText: 'Adding Medicine',

View file

@ -101,8 +101,7 @@ class _DeleteStockPageState extends State<DeleteStockPage> {
setState(() {});
} else {
_noStock = false;
print('quantity: $quantity');
print('serverQuantity: $_serverQuantity');
if (double.parse(quantity) > _serverQuantity) {
_aboveQuantity = true;
setState(() {});