update on settings and customer background

This commit is contained in:
Patrick Alvin Alcala 2025-03-26 14:41:48 +08:00
parent 05c3208cad
commit 6424e82d54
18 changed files with 227 additions and 42 deletions

View file

@ -21,15 +21,16 @@ class CustomerPagebackgroundWidget extends StatelessWidget {
height: height ?? MediaQuery.of(context).size.height + 200,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
page == 'login'
? 'assets/login_background.webp'
: page == 'register'
? 'assets/register_background.webp'
: page == 'menu'
? 'assets/menu_background.webp'
: 'assets/background.webp',
),
// image: AssetImage(
// page == 'login'
// ? 'assets/login_background.webp'
// : page == 'register'
// ? 'assets/register_background.webp'
// : page == 'menu'
// ? 'assets/menu_background.webp'
// : 'assets/background.webp',
// ),
image: AssetImage('assets/customer_background.webp'),
fit: BoxFit.cover, // Ensures the background covers the entire container
alignment: Alignment.center,
opacity: 0.1, // Adjusts the opacity as needed
@ -37,8 +38,8 @@ class CustomerPagebackgroundWidget extends StatelessWidget {
gradient: RadialGradient(
tileMode: TileMode.clamp,
colors: [
Color.fromRGBO(19, 8, 26, 1),
Color.fromRGBO(43, 22, 60, 1),
Color.fromRGBO(15, 6, 20, 1),
Color.fromRGBO(23, 12, 32, 1),
],
),
),

View file

@ -11,18 +11,31 @@ class IndicatorWidget extends StatelessWidget {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
// Container(
// height: 24,
// padding: EdgeInsets.symmetric(horizontal: 16),
// decoration: BoxDecoration(
// border: Border.all(color: color ?? const Color.fromRGBO(249, 249, 249, 1), width: 1),
// borderRadius: BorderRadius.circular(20),
// color: color ?? const Color.fromRGBO(249, 249, 249, 1)),
// alignment: Alignment.center, // Center the text within the container
// child: TextWidget(
// text: text,
// size: 12,
// color: const Color.fromRGBO(0, 0, 0, 1),
// ),
// ),
Container(
height: 24,
padding: EdgeInsets.symmetric(horizontal: 16),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 4),
decoration: BoxDecoration(
border: Border.all(color: color ?? const Color.fromRGBO(249, 249, 249, 1), width: 1),
// border: Border.all(color: color ?? const Color.fromRGBO(7, 5, 7, 0.783), width: 1),
borderRadius: BorderRadius.circular(20),
color: color ?? const Color.fromRGBO(249, 249, 249, 1)),
color: color ?? const Color.fromRGBO(28, 10, 28, 0.894)),
alignment: Alignment.center, // Center the text within the container
child: TextWidget(
text: text,
size: 12,
color: const Color.fromRGBO(0, 0, 0, 1),
color: const Color.fromARGB(255, 255, 255, 255),
),
),
],

View file

@ -15,7 +15,7 @@ class SettingWidget extends StatelessWidget {
return Container(
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
decoration: BoxDecoration(
color: const Color.fromRGBO(39, 20, 36, 0.66),
color: const Color.fromRGBO(28, 17, 32, 0.678),
border: Border.all(color: const Color.fromRGBO(74, 74, 74, 0.127)),
borderRadius: BorderRadius.circular(8.0)),
child: SizedBox(

View file

@ -1,24 +1,73 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:go_router/go_router.dart';
import 'package:pharmacy_mobile/blocs/language/functions/bloc_setlanguage.dart';
import 'package:pharmacy_mobile/widgets/text_widget.dart';
class SettingsMenuWidget extends StatefulWidget {
const SettingsMenuWidget({super.key});
class SettingsMenuWidget extends StatelessWidget {
final String title;
final String value;
final bool? isSelection;
final List selectionList;
final String selectionFor;
@override
State<SettingsMenuWidget> createState() => _SettingsMenuWidgetState();
}
const SettingsMenuWidget({
super.key,
required this.title,
required this.value,
this.isSelection = false,
this.selectionList = const [],
this.selectionFor = '',
});
class _SettingsMenuWidgetState extends State<SettingsMenuWidget> {
@override
Widget build(BuildContext context) {
void setNewValue(String newValue) async {
switch (selectionFor) {
case 'Language':
final language = await blocSetLanguage(context, newValue);
if (language) {
// ignore: use_build_context_synchronously
context.pop(true);
}
break;
default:
break;
}
}
return Container(
padding: const EdgeInsets.all(16),
width: MediaQuery.of(context).size.width * 0.9,
decoration: BoxDecoration(color: const Color.fromRGBO(28, 17, 32, 0.678), borderRadius: BorderRadius.circular(8.0)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [TextWidget(text: 'Current', size: 8,), TextWidget(text: 'text')],
),
width: MediaQuery.of(context).size.width,
decoration:
BoxDecoration(color: const Color.fromRGBO(28, 17, 32, 0.678), borderRadius: BorderRadius.circular(8.0)),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
TextWidget(
text: title,
size: 8,
),
const Gap(8),
if (isSelection!)
Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [
const Gap(8),
for (var item in selectionList)
GestureDetector(
onTap: () => setNewValue(item),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: TextWidget(text: item, size: 12, color: const Color.fromRGBO(255, 255, 255, 1)),
),
),
const Gap(8),
])
else
TextWidget(
text: value,
size: 12,
bold: true,
),
]),
);
}
}