update
This commit is contained in:
parent
6c5742b596
commit
06b853b2ca
18 changed files with 147 additions and 149 deletions
|
|
@ -44,10 +44,6 @@ class _AddStockPageState extends State<AddStockPage> with WidgetsBindingObserver
|
|||
late DateTime selectedDate = DateTime.now();
|
||||
late String barcode = '';
|
||||
|
||||
// void autoRun() async {
|
||||
// _medicineList = await _refMedicines.getList();
|
||||
// }
|
||||
|
||||
void _getMedicines() async {
|
||||
_medicineList = await _refMedicines.getList2();
|
||||
|
||||
|
|
@ -70,38 +66,23 @@ class _AddStockPageState extends State<AddStockPage> with WidgetsBindingObserver
|
|||
}
|
||||
}
|
||||
|
||||
// Future<bool> _getMedicines() async {
|
||||
// late bool? result;
|
||||
// _medicineList = await _refMedicines.getList();
|
||||
// if (mounted) {
|
||||
// result = await checkResult(context, _medicineList, 'Medicines');
|
||||
// log(result.toString());
|
||||
// }
|
||||
// return result ?? false;
|
||||
// }
|
||||
|
||||
void _updateMedicine(dynamic medicine) {
|
||||
_selectedMedicine = medicine;
|
||||
}
|
||||
|
||||
void _saveStock() async {
|
||||
// final stockNameUUID = await _refMedicines.getUUID(_selectedMedicine);
|
||||
// final stockQuantity = _quantityController.text;
|
||||
// final stockExpiration = _dateController.text;
|
||||
final stockNameUUID = await _refMedicines.getUUID(_selectedMedicine);
|
||||
final stockQuantity = _quantityController.text;
|
||||
final stockExpiration = _dateController.text;
|
||||
|
||||
// await _stocks.postStock(stockNameUUID, stockExpiration, stockQuantity);
|
||||
final aa = await encrypt('text');
|
||||
final bb =
|
||||
await decrypt('4cee2f33af6ebac8dcfdeeccdd6c73c4698ce25b0cb26249c571fafc8483b5a047baefc4d626fa56e027343d');
|
||||
log('encrypt: $aa');
|
||||
log('plain: $bb');
|
||||
await _stocks.postStock(stockNameUUID, stockExpiration, stockQuantity);
|
||||
}
|
||||
|
||||
Future<void> _scanBarcode() async {
|
||||
final scannedBarcode = await barcodeScan(context);
|
||||
|
||||
setState(() {
|
||||
_selectedMedicine = scannedBarcode;
|
||||
_updateMedicine(scannedBarcode);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -152,10 +133,12 @@ class _AddStockPageState extends State<AddStockPage> with WidgetsBindingObserver
|
|||
text: 'Data',
|
||||
children: [
|
||||
DropDownWidget(
|
||||
label: 'Medicine Name',
|
||||
list: _medicineList,
|
||||
listTitle: 'medicine_name',
|
||||
onChanged: _updateMedicine),
|
||||
label: 'Medicine Name',
|
||||
list: _medicineList,
|
||||
listTitle: 'medicine_name',
|
||||
onChanged: _updateMedicine,
|
||||
value: _selectedMedicine,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue