update
This commit is contained in:
parent
cbf2ff062f
commit
7886eeb6c2
26 changed files with 210 additions and 228 deletions
|
|
@ -47,9 +47,9 @@ class ButtonWidget extends StatelessWidget {
|
|||
|
||||
TextStyle _textStyle(bool? outline) {
|
||||
if (outline == true) {
|
||||
return GoogleFonts.outfit(textStyle: const TextStyle(fontSize: 14, color: Color.fromRGBO(198, 133, 232, 1)));
|
||||
return GoogleFonts.inter(textStyle: const TextStyle(fontSize: 14, color: Color.fromRGBO(198, 133, 232, 1)));
|
||||
} else {
|
||||
return GoogleFonts.outfit(textStyle: const TextStyle(fontSize: 14, color: Color.fromRGBO(0, 0, 0, 1)));
|
||||
return GoogleFonts.inter(textStyle: const TextStyle(fontSize: 14, color: Color.fromRGBO(0, 0, 0, 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,23 +33,24 @@ class _DatePickerWidgetState extends State<DatePickerWidget> {
|
|||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('${widget.label}:',
|
||||
style: GoogleFonts.outfit(
|
||||
textStyle: const TextStyle(color: Colors.white, fontSize: 12),
|
||||
style: GoogleFonts.inter(
|
||||
textStyle: const TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
|
||||
)),
|
||||
const Gap(8),
|
||||
GestureDetector(
|
||||
onTap: () => {_selectDate(context)},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 14),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.white),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
color: Colors.transparent,
|
||||
),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(widget.controller.text.isNotEmpty ? widget.controller.text : 'Select Date',
|
||||
style: GoogleFonts.outfit(
|
||||
textStyle: const TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: 16))),
|
||||
style: GoogleFonts.inter(
|
||||
textStyle: const TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: 16),
|
||||
fontWeight: FontWeight.w500)),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -24,15 +24,15 @@ class DropDownWidget extends StatelessWidget {
|
|||
children: [
|
||||
Text(
|
||||
'$label:',
|
||||
style: GoogleFonts.outfit(
|
||||
textStyle: const TextStyle(color: Colors.white, fontSize: 12),
|
||||
style: GoogleFonts.inter(
|
||||
textStyle: const TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
const Gap(8),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8), // Set the desired border radius
|
||||
border: Border.all(color: const Color.fromRGBO(255, 255, 255, 1)), // Set the border color
|
||||
borderRadius: BorderRadius.circular(4), // Set the desired border radius
|
||||
border: Border.all(color: const Color.fromRGBO(255, 255, 255, 1)),
|
||||
),
|
||||
child: DropdownMenu(
|
||||
initialSelection: '',
|
||||
|
|
@ -42,20 +42,22 @@ class DropDownWidget extends StatelessWidget {
|
|||
label: item[listTitle].toString(),
|
||||
value: item[listTitle],
|
||||
style: ButtonStyle(
|
||||
foregroundColor: WidgetStateProperty.all<Color>(const Color.fromRGBO(230, 230, 230, 1)),
|
||||
foregroundColor: WidgetStateProperty.all<Color>(const Color.fromRGBO(10, 10, 10, 1)),
|
||||
textStyle: WidgetStateProperty.all<TextStyle>(
|
||||
GoogleFonts.inter(fontSize: 16, fontWeight: FontWeight.w500)))),
|
||||
],
|
||||
onSelected: onChanged,
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
menuHeight: MediaQuery.of(context).size.height * 0.8,
|
||||
textStyle:
|
||||
GoogleFonts.outfit(textStyle: const TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: 16)),
|
||||
textStyle: GoogleFonts.inter(
|
||||
textStyle: const TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: 16),
|
||||
fontWeight: FontWeight.w500),
|
||||
menuStyle: MenuStyle(
|
||||
backgroundColor: WidgetStateProperty.all<Color>(const Color.fromRGBO(21, 13, 35, 0.902)),
|
||||
// backgroundColor: WidgetStateProperty.all<Color>(const Color.fromRGBO(21, 13, 35, 0.902)),
|
||||
backgroundColor: WidgetStateProperty.all<Color>(const Color.fromRGBO(255, 255, 255, 1)),
|
||||
padding: WidgetStateProperty.all(const EdgeInsets.symmetric(vertical: 16, horizontal: 8)),
|
||||
shape: WidgetStateProperty.all(RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8), // Set the border radius for the dropdown menu
|
||||
borderRadius: BorderRadius.circular(4), // Set the border radius for the dropdown menu
|
||||
)),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class DropdownWrapperWidget extends StatelessWidget {
|
|||
spacing: 16,
|
||||
children: [
|
||||
const CircularProgressIndicator(color: Color.fromRGBO(255, 255, 255, 1)),
|
||||
TextWidget(text: 'Fetching $text', size: 16, footer: true)
|
||||
TextWidget(text: 'Fetching $text', size: 16)
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -26,7 +26,10 @@ class DropdownWrapperMultiWidget extends StatelessWidget {
|
|||
spacing: 16,
|
||||
children: [
|
||||
const CircularProgressIndicator(color: Color.fromRGBO(255, 255, 255, 1)),
|
||||
TextWidget(text: 'Fetching $text', size: 16, footer: true)
|
||||
TextWidget(
|
||||
text: 'Fetching $text',
|
||||
size: 16,
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class InputWidget extends StatelessWidget {
|
|||
children: [
|
||||
if (label.isNotEmpty)
|
||||
Text('$label:',
|
||||
style: GoogleFonts.outfit(
|
||||
style: GoogleFonts.inter(
|
||||
textStyle:
|
||||
const TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: 12, fontWeight: FontWeight.w500),
|
||||
)),
|
||||
|
|
@ -31,11 +31,15 @@ class InputWidget extends StatelessWidget {
|
|||
decoration: InputDecoration(
|
||||
filled: true,
|
||||
fillColor: const Color.fromRGBO(255, 255, 255, 1),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 2, horizontal: 24),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(4)),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0, horizontal: 14),
|
||||
prefixIcon: placeholder != null ? Icon(Icons.search, color: Colors.grey) : null,
|
||||
hintText: placeholder),
|
||||
style: GoogleFonts.outfit(textStyle: const TextStyle(color: Color.fromRGBO(0, 0, 0, 1), fontSize: 16)),
|
||||
style: GoogleFonts.inter(
|
||||
textStyle: const TextStyle(
|
||||
color: Color.fromRGBO(0, 0, 0, 1),
|
||||
fontSize: 16,
|
||||
)),
|
||||
obscureText: password ?? false,
|
||||
onChanged: onChanged,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,67 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class MenuWidget extends StatelessWidget {
|
||||
final String text;
|
||||
final IconData? icon;
|
||||
final VoidCallback? onPressed;
|
||||
final String? color;
|
||||
|
||||
final Color green = const Color.fromRGBO(58, 236, 27, 0.2);
|
||||
final Color blue = const Color.fromRGBO(27, 90, 236, 0.2);
|
||||
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 MenuWidget({super.key, required this.text, this.icon, this.onPressed, this.color});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onPressed,
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width - 96,
|
||||
padding: const EdgeInsets.only(top: 16, bottom: 16),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
color: color != null ? _getColorBasedOnString(color ?? '') : const Color.fromRGBO(255, 255, 255, 0.6),
|
||||
width: 2),
|
||||
color: color != null ? _getColorBasedOnString(color ?? '') : const Color.fromRGBO(0, 0, 0, 0),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
const Gap(32),
|
||||
Icon(icon, size: 24, color: const Color.fromRGBO(255, 255, 255, 1)),
|
||||
const Gap(64),
|
||||
Text(
|
||||
text,
|
||||
style: GoogleFonts.outfit(
|
||||
color: const Color.fromRGBO(255, 255, 255, 1),
|
||||
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Color _getColorBasedOnString(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(0, 0, 0, 0); // Default to transparent if color is not recognized
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
|
||||
class MenuWidget2 extends StatelessWidget {
|
||||
class MenuWidget extends StatelessWidget {
|
||||
final String text;
|
||||
final IconData? icon;
|
||||
final VoidCallback? onPressed;
|
||||
|
|
@ -34,7 +34,7 @@ class MenuWidget2 extends StatelessWidget {
|
|||
const Color.fromRGBO(104, 156, 59, 0.8),
|
||||
];
|
||||
|
||||
MenuWidget2({super.key, required this.text, required this.description, this.icon, this.onPressed, this.color});
|
||||
MenuWidget({super.key, required this.text, required this.description, this.icon, this.onPressed, this.color});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ class TextWidget extends StatelessWidget {
|
|||
final double? size;
|
||||
final double? opacity;
|
||||
final bool? bold;
|
||||
final bool? footer;
|
||||
final bool? title;
|
||||
final bool? underlined;
|
||||
final Color? color;
|
||||
|
||||
const TextWidget(
|
||||
{super.key, required this.text, this.size, this.opacity, this.bold, this.footer, this.underlined, this.color});
|
||||
{super.key, required this.text, this.size, this.opacity, this.bold, this.title, this.underlined, this.color});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -23,8 +23,8 @@ class TextWidget extends StatelessWidget {
|
|||
decorationColor: const Color.fromRGBO(255, 255, 255, 1),
|
||||
decorationThickness: 2);
|
||||
|
||||
return footer == true
|
||||
? Text(text, style: GoogleFonts.inter(textStyle: textStyle))
|
||||
: Text(text, style: GoogleFonts.outfit(textStyle: textStyle));
|
||||
return title == true
|
||||
? Text(text, style: GoogleFonts.outfit(textStyle: textStyle))
|
||||
: Text(text, style: GoogleFonts.inter(textStyle: textStyle));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue