only allow saving after image uploaded
This commit is contained in:
parent
5283e7a6c6
commit
9cf3934f6f
2 changed files with 3 additions and 3 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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(() {});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue