update
This commit is contained in:
parent
ecc427c958
commit
ee1884790a
11 changed files with 113 additions and 127 deletions
|
|
@ -4,10 +4,12 @@ import 'package:flutter/material.dart';
|
|||
import 'package:gap/gap.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:pharmacy_mobile/tables/ref_medicines.dart';
|
||||
import 'package:pharmacy_mobile/tables/stocks.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/datepicker_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/dropdown_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/input_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/title_widget.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
|
@ -25,6 +27,8 @@ class _AddStockPageState extends State<AddStockPage> {
|
|||
final _refMedicines = RefMedicines();
|
||||
final _quantityController = TextEditingController();
|
||||
final _dateController = TextEditingController();
|
||||
final _stocks = Stocks();
|
||||
final _ref_medicines = RefMedicines();
|
||||
|
||||
late List _medicineList = [];
|
||||
late String _selectedMedicine = '';
|
||||
|
|
@ -50,7 +54,22 @@ class _AddStockPageState extends State<AddStockPage> {
|
|||
// }
|
||||
// }
|
||||
|
||||
void saveStock() async {}
|
||||
// void _saveMedicine() async {
|
||||
// final medName = _nameController.text;
|
||||
// final medGenericUUID = await _refGenericNames.getUUID(_selectedGeneric);
|
||||
// final medTypeUUID = await _refTypes.getUUID(_selectedType);
|
||||
// final medManufactorerUUID = await _refManufactorer.getUUID(_selectedManufactorer);
|
||||
|
||||
// await _refMedicines.postMedicine(medName, medGenericUUID, medManufactorerUUID, medTypeUUID);
|
||||
// }
|
||||
|
||||
void saveStock() async {
|
||||
final stockNameUUID = await _ref_medicines.getUUID(_selectedMedicine);
|
||||
final stockQuantity = _quantityController.text;
|
||||
final stockExpiration = _dateController.text;
|
||||
|
||||
await _stocks.postStock(stockNameUUID, stockExpiration, stockQuantity);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
|
@ -71,19 +90,7 @@ class _AddStockPageState extends State<AddStockPage> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
alignment: Alignment.center,
|
||||
height: MediaQuery.of(context).size.height * 8,
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Color.fromRGBO(34, 51, 69, 1),
|
||||
Color.fromRGBO(22, 32, 44, 1),
|
||||
],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
body: PageBackgroundWidget(
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue