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,7 +83,9 @@ class _AddGenericsPageState extends State<AddGenericsPage> {
|
|||
const Gap(32),
|
||||
const TextWidget(text: 'Add Generics'),
|
||||
const Gap(16),
|
||||
Form(
|
||||
FormBorderWidget(
|
||||
color: 'blue',
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
|
|
@ -96,7 +99,8 @@ class _AddGenericsPageState extends State<AddGenericsPage> {
|
|||
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,7 +117,9 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
|
|||
const Gap(32),
|
||||
const TextWidget(text: 'Add Medicine'),
|
||||
const Gap(16),
|
||||
Form(
|
||||
FormBorderWidget(
|
||||
color: 'green',
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Center(
|
||||
child: Column(
|
||||
|
|
@ -148,7 +151,8 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
|
|||
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,7 +89,9 @@ class _AddStockPageState extends State<AddStockPage> {
|
|||
const Gap(32),
|
||||
const TextWidget(text: 'Add Stock'),
|
||||
const Gap(16),
|
||||
Form(
|
||||
FormBorderWidget(
|
||||
color: 'green',
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Center(
|
||||
child: Column(
|
||||
|
|
@ -111,6 +114,7 @@ class _AddStockPageState extends State<AddStockPage> {
|
|||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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,7 +43,9 @@ class _AddTypePageState extends State<AddTypePage> {
|
|||
const Gap(32),
|
||||
const TextWidget(text: 'Add Medicine Type'),
|
||||
const Gap(16),
|
||||
Form(
|
||||
FormBorderWidget(
|
||||
color: 'blue',
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Center(
|
||||
child: Column(
|
||||
|
|
@ -57,7 +55,8 @@ class _AddTypePageState extends State<AddTypePage> {
|
|||
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,
|
||||
|
|
|
|||
52
lib/widgets/form_border_widget.dart
Normal file
52
lib/widgets/form_border_widget.dart
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class FormBorderWidget extends StatelessWidget {
|
||||
final Widget child;
|
||||
final String? color;
|
||||
|
||||
final Color green = const Color.fromRGBO(58, 236, 27, 0.1);
|
||||
final Color blue = const Color.fromRGBO(27, 90, 236, 0.1);
|
||||
final Color red = const Color.fromRGBO(236, 27, 27, 0.2);
|
||||
final Color yellow = const Color.fromRGBO(236, 232, 27, 0.2);
|
||||
final Color teal = const Color.fromRGBO(27, 236, 229, 0.2);
|
||||
|
||||
const FormBorderWidget({super.key, required this.child, this.color});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 32, right: 32),
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(32, 32, 32, 40),
|
||||
decoration: BoxDecoration(
|
||||
color: _getColor(color ?? ''),
|
||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color.fromRGBO(0, 0, 0, 0.2), // Subtle shadow to give depth
|
||||
spreadRadius: 0,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
)
|
||||
]),
|
||||
child: child),
|
||||
);
|
||||
}
|
||||
|
||||
Color _getColor(String color) {
|
||||
switch (color.toLowerCase()) {
|
||||
case 'green':
|
||||
return green;
|
||||
case 'blue':
|
||||
return blue;
|
||||
case 'red':
|
||||
return red;
|
||||
case 'yellow':
|
||||
return yellow;
|
||||
case 'teal':
|
||||
return teal;
|
||||
default:
|
||||
return const Color.fromRGBO(57, 38, 62, 0.6); // Default to transparent if color is not recognized
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue