update
This commit is contained in:
parent
7fca1e79a8
commit
75cbdbf2fa
6 changed files with 157 additions and 97 deletions
|
|
@ -5,6 +5,7 @@ import 'package:pharmacy_mobile/tables/ref_categories.dart';
|
|||
import 'package:pharmacy_mobile/tables/ref_generic_names.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/dropdown_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/form_border_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';
|
||||
|
|
@ -82,21 +83,24 @@ class _AddGenericsPageState extends State<AddGenericsPage> {
|
|||
const Gap(32),
|
||||
const TextWidget(text: 'Add Generics'),
|
||||
const Gap(16),
|
||||
Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
InputWidget(label: 'Name', controller: _nameController),
|
||||
const Gap(16),
|
||||
DropDownWidget(
|
||||
label: 'Category',
|
||||
list: _categoryList,
|
||||
listTitle: 'category_name',
|
||||
onChanged: _updateCategory),
|
||||
const Gap(16),
|
||||
ButtonWidget(text: 'Add', onPressed: saveGeneric)
|
||||
],
|
||||
))
|
||||
FormBorderWidget(
|
||||
color: 'blue',
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
InputWidget(label: 'Name', controller: _nameController),
|
||||
const Gap(16),
|
||||
DropDownWidget(
|
||||
label: 'Category',
|
||||
list: _categoryList,
|
||||
listTitle: 'category_name',
|
||||
onChanged: _updateCategory),
|
||||
const Gap(16),
|
||||
ButtonWidget(text: 'Add', onPressed: saveGeneric)
|
||||
],
|
||||
)),
|
||||
)
|
||||
],
|
||||
)),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import 'package:pharmacy_mobile/tables/ref_medicines.dart';
|
|||
import 'package:pharmacy_mobile/tables/ref_types.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/dropdown_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/form_border_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';
|
||||
|
|
@ -116,39 +117,42 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
|
|||
const Gap(32),
|
||||
const TextWidget(text: 'Add Medicine'),
|
||||
const Gap(16),
|
||||
Form(
|
||||
key: _formKey,
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
InputWidget(label: 'Name', controller: _nameController),
|
||||
const Gap(16),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
DropDownWidget(
|
||||
label: 'Generic Name',
|
||||
list: _genericNameList,
|
||||
listTitle: 'generic_name',
|
||||
onChanged: _updateGeneric),
|
||||
const Gap(8),
|
||||
TextWidget(text: _selectedCategory, size: 18),
|
||||
],
|
||||
),
|
||||
const Gap(16),
|
||||
DropDownWidget(
|
||||
label: 'Type', list: _typeList, listTitle: 'type_name', onChanged: _updateType),
|
||||
const Gap(16),
|
||||
DropDownWidget(
|
||||
label: 'Manufactorer',
|
||||
list: _manufactorerList,
|
||||
listTitle: 'manufactorer_name',
|
||||
onChanged: _updateManufactorer),
|
||||
const Gap(16),
|
||||
ButtonWidget(text: 'Save Medicine', onPressed: _saveMedicine)
|
||||
],
|
||||
),
|
||||
))
|
||||
FormBorderWidget(
|
||||
color: 'green',
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
InputWidget(label: 'Name', controller: _nameController),
|
||||
const Gap(16),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
DropDownWidget(
|
||||
label: 'Generic Name',
|
||||
list: _genericNameList,
|
||||
listTitle: 'generic_name',
|
||||
onChanged: _updateGeneric),
|
||||
const Gap(8),
|
||||
TextWidget(text: _selectedCategory, size: 18),
|
||||
],
|
||||
),
|
||||
const Gap(16),
|
||||
DropDownWidget(
|
||||
label: 'Type', list: _typeList, listTitle: 'type_name', onChanged: _updateType),
|
||||
const Gap(16),
|
||||
DropDownWidget(
|
||||
label: 'Manufactorer',
|
||||
list: _manufactorerList,
|
||||
listTitle: 'manufactorer_name',
|
||||
onChanged: _updateManufactorer),
|
||||
const Gap(16),
|
||||
ButtonWidget(text: 'Save Medicine', onPressed: _saveMedicine)
|
||||
],
|
||||
),
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ 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/form_border_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';
|
||||
|
|
@ -88,27 +89,30 @@ class _AddStockPageState extends State<AddStockPage> {
|
|||
const Gap(32),
|
||||
const TextWidget(text: 'Add Stock'),
|
||||
const Gap(16),
|
||||
Form(
|
||||
key: _formKey,
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
DropDownWidget(
|
||||
label: 'Medicine Name',
|
||||
list: _medicineList,
|
||||
listTitle: 'medicine_name',
|
||||
onChanged: _updateMedicine),
|
||||
const Gap(16),
|
||||
InputWidget(label: 'Quantity', controller: _quantityController),
|
||||
const Gap(16),
|
||||
DatePickerWidget(
|
||||
label: 'Date Expiration',
|
||||
controller: _dateController,
|
||||
value: selectedDate,
|
||||
),
|
||||
const Gap(16),
|
||||
ButtonWidget(text: 'Add Stock', onPressed: saveStock)
|
||||
],
|
||||
FormBorderWidget(
|
||||
color: 'green',
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
DropDownWidget(
|
||||
label: 'Medicine Name',
|
||||
list: _medicineList,
|
||||
listTitle: 'medicine_name',
|
||||
onChanged: _updateMedicine),
|
||||
const Gap(16),
|
||||
InputWidget(label: 'Quantity', controller: _quantityController),
|
||||
const Gap(16),
|
||||
DatePickerWidget(
|
||||
label: 'Date Expiration',
|
||||
controller: _dateController,
|
||||
value: selectedDate,
|
||||
),
|
||||
const Gap(16),
|
||||
ButtonWidget(text: 'Add Stock', onPressed: saveStock)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
import 'dart:developer';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
// import 'package:pharmacy_mobile/auth/auth_service.dart';
|
||||
import 'package:pharmacy_mobile/tables/ref_categories.dart';
|
||||
import 'package:pharmacy_mobile/tables/ref_generic_names.dart';
|
||||
import 'package:pharmacy_mobile/tables/ref_types.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/dropdown_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/form_border_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';
|
||||
|
|
@ -47,17 +43,20 @@ class _AddTypePageState extends State<AddTypePage> {
|
|||
const Gap(32),
|
||||
const TextWidget(text: 'Add Medicine Type'),
|
||||
const Gap(16),
|
||||
Form(
|
||||
key: _formKey,
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
InputWidget(label: 'Type Name', controller: _typeController),
|
||||
const Gap(16),
|
||||
ButtonWidget(text: 'Save Type', onPressed: saveType)
|
||||
],
|
||||
),
|
||||
))
|
||||
FormBorderWidget(
|
||||
color: 'blue',
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
InputWidget(label: 'Type Name', controller: _typeController),
|
||||
const Gap(16),
|
||||
ButtonWidget(text: 'Save Type', onPressed: saveType)
|
||||
],
|
||||
),
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -40,29 +40,26 @@ class MainPage extends StatelessWidget {
|
|||
const Gap(32),
|
||||
const TextWidget(text: 'Menu'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Type',
|
||||
onPressed: () => {context.push('/addtype')},
|
||||
color: 'blue'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus, text: 'Add Generics', onPressed: gotoAddGenerics, color: 'blue'),
|
||||
const Gap(32),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Medicine',
|
||||
onPressed: gotoAddMedicine,
|
||||
color: 'green'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Generics',
|
||||
onPressed: gotoAddGenerics,
|
||||
color: 'green'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Stock',
|
||||
onPressed: () => {context.push('/addstock')},
|
||||
color: 'green'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Medicine Type',
|
||||
onPressed: () => {context.push('/addtype')},
|
||||
color: 'green'),
|
||||
const Gap(32),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.listCheck,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue