This commit is contained in:
Patrick Alvin Alcala 2025-02-19 15:28:53 +08:00
parent 5f38ce753f
commit 8d4eb1f728
12 changed files with 102 additions and 20 deletions

BIN
assets/icon/Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Before After
Before After

View file

@ -3,7 +3,7 @@ import 'package:gap/gap.dart';
import 'package:internet_connection_checker/internet_connection_checker.dart'; import 'package:internet_connection_checker/internet_connection_checker.dart';
import 'package:pharmacy_mobile/tables/ref_categories.dart'; import 'package:pharmacy_mobile/tables/ref_categories.dart';
import 'package:pharmacy_mobile/widgets/button_widget.dart'; import 'package:pharmacy_mobile/widgets/button_widget.dart';
import 'package:pharmacy_mobile/widgets/form_border_widget.dart'; import 'package:pharmacy_mobile/widgets/form_border_widget2.dart';
import 'package:pharmacy_mobile/widgets/input_widget.dart'; import 'package:pharmacy_mobile/widgets/input_widget.dart';
import 'package:pharmacy_mobile/widgets/page_background_widget.dart'; import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart'; import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
@ -66,7 +66,7 @@ class _AddCategoryPageState extends State<AddCategoryPage> {
const Gap(32), const Gap(32),
const TextWidget(text: 'Add Category'), const TextWidget(text: 'Add Category'),
const Gap(16), const Gap(16),
FormBorderWidget( FormBorderWidget2(
color: 'blue', color: 'blue',
child: Form( child: Form(
key: _formKey, key: _formKey,

View file

@ -6,6 +6,7 @@ import 'package:pharmacy_mobile/tables/ref_generic_names.dart';
import 'package:pharmacy_mobile/widgets/button_widget.dart'; import 'package:pharmacy_mobile/widgets/button_widget.dart';
import 'package:pharmacy_mobile/widgets/dropdown_widget.dart'; import 'package:pharmacy_mobile/widgets/dropdown_widget.dart';
import 'package:pharmacy_mobile/widgets/form_border_widget.dart'; import 'package:pharmacy_mobile/widgets/form_border_widget.dart';
import 'package:pharmacy_mobile/widgets/form_border_widget2.dart';
import 'package:pharmacy_mobile/widgets/input_widget.dart'; import 'package:pharmacy_mobile/widgets/input_widget.dart';
import 'package:pharmacy_mobile/widgets/page_background_widget.dart'; import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart'; import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
@ -130,7 +131,7 @@ class _AddGenericsPageState extends State<AddGenericsPage> {
const Gap(32), const Gap(32),
const TextWidget(text: 'Add Generics'), const TextWidget(text: 'Add Generics'),
const Gap(16), const Gap(16),
FormBorderWidget( FormBorderWidget2(
color: 'blue', color: 'blue',
child: Form( child: Form(
key: _formKey, key: _formKey,

View file

@ -12,6 +12,7 @@ import 'package:pharmacy_mobile/widgets/button_widget.dart';
import 'package:pharmacy_mobile/widgets/dropdown_widget.dart'; import 'package:pharmacy_mobile/widgets/dropdown_widget.dart';
import 'package:pharmacy_mobile/widgets/dropdown_wrappermulti_widget.dart'; import 'package:pharmacy_mobile/widgets/dropdown_wrappermulti_widget.dart';
import 'package:pharmacy_mobile/widgets/form_border_widget.dart'; import 'package:pharmacy_mobile/widgets/form_border_widget.dart';
import 'package:pharmacy_mobile/widgets/form_border_widget2.dart';
import 'package:pharmacy_mobile/widgets/input_widget.dart'; import 'package:pharmacy_mobile/widgets/input_widget.dart';
import 'package:pharmacy_mobile/widgets/page_background_widget.dart'; import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart'; import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
@ -199,7 +200,7 @@ class _AddMedicinePageState extends State<AddMedicinePage> {
const Gap(32), const Gap(32),
const TextWidget(text: 'Add Medicine'), const TextWidget(text: 'Add Medicine'),
const Gap(16), const Gap(16),
FormBorderWidget( FormBorderWidget2(
color: 'green', color: 'green',
child: Form( child: Form(
key: _formKey, key: _formKey,

View file

@ -6,6 +6,7 @@ import 'package:pharmacy_mobile/widgets/button_widget.dart';
import 'package:pharmacy_mobile/widgets/datepicker_widget.dart'; import 'package:pharmacy_mobile/widgets/datepicker_widget.dart';
import 'package:pharmacy_mobile/widgets/dropdown_widget.dart'; import 'package:pharmacy_mobile/widgets/dropdown_widget.dart';
import 'package:pharmacy_mobile/widgets/form_border_widget.dart'; import 'package:pharmacy_mobile/widgets/form_border_widget.dart';
import 'package:pharmacy_mobile/widgets/form_border_widget2.dart';
import 'package:pharmacy_mobile/widgets/input_widget.dart'; import 'package:pharmacy_mobile/widgets/input_widget.dart';
import 'package:pharmacy_mobile/widgets/page_background_widget.dart'; import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
import 'package:pharmacy_mobile/widgets/text_widget.dart'; import 'package:pharmacy_mobile/widgets/text_widget.dart';
@ -74,7 +75,7 @@ class _AddStockPageState extends State<AddStockPage> {
const Gap(32), const Gap(32),
const TextWidget(text: 'Add Stock'), const TextWidget(text: 'Add Stock'),
const Gap(16), const Gap(16),
FormBorderWidget( FormBorderWidget2(
color: 'green', color: 'green',
child: Form( child: Form(
key: _formKey, key: _formKey,

View file

@ -4,6 +4,7 @@ import 'package:internet_connection_checker/internet_connection_checker.dart';
import 'package:pharmacy_mobile/tables/ref_types.dart'; import 'package:pharmacy_mobile/tables/ref_types.dart';
import 'package:pharmacy_mobile/widgets/button_widget.dart'; import 'package:pharmacy_mobile/widgets/button_widget.dart';
import 'package:pharmacy_mobile/widgets/form_border_widget.dart'; import 'package:pharmacy_mobile/widgets/form_border_widget.dart';
import 'package:pharmacy_mobile/widgets/form_border_widget2.dart';
import 'package:pharmacy_mobile/widgets/input_widget.dart'; import 'package:pharmacy_mobile/widgets/input_widget.dart';
import 'package:pharmacy_mobile/widgets/page_background_widget.dart'; import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart'; import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
@ -73,7 +74,7 @@ class _AddTypePageState extends State<AddTypePage> {
const Gap(32), const Gap(32),
const TextWidget(text: 'Add Medicine Type'), const TextWidget(text: 'Add Medicine Type'),
const Gap(16), const Gap(16),
FormBorderWidget( FormBorderWidget2(
color: 'blue', color: 'blue',
child: Form( child: Form(
key: _formKey, key: _formKey,

View file

@ -6,6 +6,7 @@ import 'package:pharmacy_mobile/widgets/button_widget.dart';
import 'package:pharmacy_mobile/widgets/dropdown_widget.dart'; import 'package:pharmacy_mobile/widgets/dropdown_widget.dart';
import 'package:pharmacy_mobile/widgets/dropdown_wrappermulti_widget.dart'; import 'package:pharmacy_mobile/widgets/dropdown_wrappermulti_widget.dart';
import 'package:pharmacy_mobile/widgets/form_border_widget.dart'; import 'package:pharmacy_mobile/widgets/form_border_widget.dart';
import 'package:pharmacy_mobile/widgets/form_border_widget2.dart';
import 'package:pharmacy_mobile/widgets/input_widget.dart'; import 'package:pharmacy_mobile/widgets/input_widget.dart';
import 'package:pharmacy_mobile/widgets/page_background_widget.dart'; import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart'; import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
@ -123,7 +124,7 @@ class _DeleteStockPageState extends State<DeleteStockPage> {
const Gap(32), const Gap(32),
const TextWidget(text: 'Remove Stock'), const TextWidget(text: 'Remove Stock'),
const Gap(16), const Gap(16),
FormBorderWidget( FormBorderWidget2(
color: 'red', color: 'red',
child: Form( child: Form(
key: _formKey, key: _formKey,

View file

@ -55,7 +55,7 @@ class _MainPageState extends State<MainPage> {
icon: FontAwesomeIcons.circlePlus, icon: FontAwesomeIcons.circlePlus,
text: 'Add Category', text: 'Add Category',
description: 'Create a new medicine category', description: 'Create a new medicine category',
onPressed: () => {context.push('/addtype')}, onPressed: () => {context.push('/addcategory')},
color: 'blue', color: 'blue',
), ),
const Gap(16), const Gap(16),

View file

@ -0,0 +1,77 @@
import 'package:flutter/material.dart';
class FormBorderWidget2 extends StatelessWidget {
final Widget child;
final String? color;
final List<Color> blue = [
const Color.fromRGBO(30, 50, 77, 0.8),
const Color.fromRGBO(30, 50, 77, 0.8),
const Color.fromRGBO(37, 94, 94, 0.8),
];
final List<Color> green = [
const Color.fromRGBO(23, 56, 38, 0.8),
const Color.fromRGBO(23, 56, 38, 0.8),
const Color.fromRGBO(66, 98, 38, 0.8),
];
final List<Color> red = [
const Color.fromRGBO(87, 33, 33, 0.8),
const Color.fromRGBO(87, 33, 33, 0.8),
const Color.fromRGBO(68, 44, 26, 0.8),
];
final List<Color> yellow = [
const Color.fromRGBO(156, 156, 59, 1),
const Color.fromRGBO(156, 156, 59, 1),
const Color.fromRGBO(104, 156, 59, 1),
];
FormBorderWidget2({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: const EdgeInsets.fromLTRB(32, 32, 32, 40),
decoration: BoxDecoration(
// color: _getColor(color ?? ''),
borderRadius: const BorderRadius.all(Radius.circular(16)),
gradient: LinearGradient(
colors: _getColorList(color!),
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
boxShadow: [
// const BoxShadow(
// color: Color.fromRGBO(0, 0, 0, 0.2), // Subtle shadow to give depth
// spreadRadius: 0,
// blurRadius: 4,
// offset: Offset(0, 2),
// )
]),
child: child),
);
}
List<Color> _getColorList(String color) {
switch (color.toLowerCase()) {
case 'green':
return green;
case 'blue':
return blue;
case 'red':
return red;
case 'yellow':
return yellow;
default:
return [
const Color.fromRGBO(0, 0, 0, 0.8),
const Color.fromRGBO(0, 0, 0, 0.8),
const Color.fromRGBO(133, 133, 133, 0.8),
];
}
}
}

View file

@ -11,27 +11,27 @@ class MenuWidget2 extends StatelessWidget {
final String description; final String description;
final List<Color> blue = [ final List<Color> blue = [
const Color.fromRGBO(59, 101, 156, 1), const Color.fromRGBO(59, 101, 156, 0.8),
const Color.fromRGBO(59, 101, 156, 1), const Color.fromRGBO(59, 101, 156, 0.8),
const Color.fromRGBO(59, 156, 156, 1), const Color.fromRGBO(59, 156, 156, 0.8),
]; ];
final List<Color> green = [ final List<Color> green = [
const Color.fromRGBO(59, 156, 103, 1), const Color.fromRGBO(59, 156, 103, 0.8),
const Color.fromRGBO(59, 156, 103, 1), const Color.fromRGBO(59, 156, 103, 0.8),
const Color.fromRGBO(122, 182, 70, 1), const Color.fromRGBO(122, 182, 70, 0.8),
]; ];
final List<Color> red = [ final List<Color> red = [
const Color.fromRGBO(156, 59, 59, 1), const Color.fromRGBO(156, 59, 59, 0.8),
const Color.fromRGBO(164, 62, 62, 1), const Color.fromRGBO(164, 62, 62, 0.8),
const Color.fromRGBO(186, 120, 70, 1), const Color.fromRGBO(186, 120, 70, 0.8),
]; ];
final List<Color> yellow = [ final List<Color> yellow = [
const Color.fromRGBO(156, 156, 59, 1), const Color.fromRGBO(156, 156, 59, 0.8),
const Color.fromRGBO(156, 156, 59, 1), const Color.fromRGBO(156, 156, 59, 0.8),
const Color.fromRGBO(104, 156, 59, 1), const Color.fromRGBO(104, 156, 59, 0.8),
]; ];
MenuWidget2({super.key, required this.text, required this.description, this.icon, this.onPressed, this.color}); MenuWidget2({super.key, required this.text, required this.description, this.icon, this.onPressed, this.color});