This commit is contained in:
Patrick Alvin Alcala 2025-01-30 13:45:43 +08:00
parent e48e400e43
commit ecc427c958
5 changed files with 76 additions and 18 deletions

View file

@ -1,4 +1,3 @@
import 'dart:developer';
import 'package:gap/gap.dart';
import 'package:flutter/material.dart';
// import 'package:pharmacy_mobile/auth/auth_service.dart';
@ -22,6 +21,7 @@ class AddGenericsPageState extends State<AddGenericsPage> {
final _refCategories = RefCategories();
final _refGenericNames = RefGenericNames();
final _nameController = TextEditingController();
final _formKey = GlobalKey<FormState>();
late List _categoryList = [];
late String _selectedCategory = '';
@ -80,12 +80,18 @@ class AddGenericsPageState extends State<AddGenericsPage> {
const Gap(32),
const TextWidget(text: 'Add Generics'),
const Gap(16),
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)
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)
],
))
],
)),
),