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 String uuid = '';
|
||||||
late bool imageUploaded = false;
|
late bool imageUploaded = false;
|
||||||
late String imageUrl = '';
|
late String imageUrl = '';
|
||||||
|
late bool uploaded = false;
|
||||||
|
|
||||||
Future<void> _getGenerics() async {
|
Future<void> _getGenerics() async {
|
||||||
_genericNameList = await _refGenericNames.getList();
|
_genericNameList = await _refGenericNames.getList();
|
||||||
|
|
@ -227,7 +228,6 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
|
||||||
|
|
||||||
final imageBytes = await image!.readAsBytes();
|
final imageBytes = await image!.readAsBytes();
|
||||||
final webpImage = await _webpConvert(imageBytes);
|
final webpImage = await _webpConvert(imageBytes);
|
||||||
late bool uploaded = false;
|
|
||||||
|
|
||||||
uuid = imageName;
|
uuid = imageName;
|
||||||
|
|
||||||
|
|
@ -366,6 +366,7 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
|
||||||
// const Center(child: CircularProgressIndicator(color: Colors.white))
|
// const Center(child: CircularProgressIndicator(color: Colors.white))
|
||||||
// else
|
// else
|
||||||
// ButtonWidget(text: 'Save Medicine', onPressed: _saveMedicine)
|
// ButtonWidget(text: 'Save Medicine', onPressed: _saveMedicine)
|
||||||
|
if (uploaded)
|
||||||
ButtonWithProgressWidget(
|
ButtonWithProgressWidget(
|
||||||
trigger: _isLoading,
|
trigger: _isLoading,
|
||||||
progressText: 'Adding Medicine',
|
progressText: 'Adding Medicine',
|
||||||
|
|
|
||||||
|
|
@ -101,8 +101,7 @@ class _DeleteStockPageState extends State<DeleteStockPage> {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
} else {
|
} else {
|
||||||
_noStock = false;
|
_noStock = false;
|
||||||
print('quantity: $quantity');
|
|
||||||
print('serverQuantity: $_serverQuantity');
|
|
||||||
if (double.parse(quantity) > _serverQuantity) {
|
if (double.parse(quantity) > _serverQuantity) {
|
||||||
_aboveQuantity = true;
|
_aboveQuantity = true;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue