This commit is contained in:
Patrick Alvin Alcala 2025-02-03 11:00:42 +08:00
parent b5151a053d
commit cf2ce36f87
14 changed files with 92 additions and 74 deletions

View file

@ -1,30 +1,41 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
// import 'package:google_fonts/google_fonts.dart';
class ButtonWidget extends StatelessWidget {
final String text;
final VoidCallback onPressed;
final bool? outline;
const ButtonWidget({super.key, required this.text, required this.onPressed});
const ButtonWidget({super.key, required this.text, required this.onPressed, this.outline});
@override
Widget build(BuildContext context) {
return ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: Color.fromRGBO(0, 0, 0, 1), // text color
backgroundColor: const Color.fromRGBO(198, 133, 232, 1), // background color
side: const BorderSide(color: Color.fromRGBO(79, 51, 94, 1)), // border color
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(26), // rounded corners
),
minimumSize: Size(MediaQuery.of(context).size.width - 96, 40), // minimum size
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 16), // padding
),
onPressed: onPressed,
child: Text(
text,
style: GoogleFonts.outfit(textStyle: const TextStyle(fontSize: 16)),
));
style: outline == true
? OutlinedButton.styleFrom(
foregroundColor: Color.fromRGBO(0, 0, 0, 1), // text color
side: const BorderSide(color: Color.fromRGBO(79, 51, 94, 1)), // border color
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12), // rounded corners
),
minimumSize: Size(MediaQuery.of(context).size.width - 96, 44), // minimum size
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 16),
)
: ElevatedButton.styleFrom(
foregroundColor: Color.fromRGBO(0, 0, 0, 1), // text color
backgroundColor: const Color.fromRGBO(198, 133, 232, 1), // background color
side: const BorderSide(color: Color.fromRGBO(79, 51, 94, 1)), // border color
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12), // rounded corners
),
minimumSize: Size(MediaQuery.of(context).size.width - 96, 44), // minimum size
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 16),
),
onPressed: onPressed,
child: Text(
text,
style: GoogleFonts.outfit(textStyle: const TextStyle(fontSize: 14)),
),
);
}
}

View file

@ -6,16 +6,20 @@ class TextWidget extends StatelessWidget {
final double? size;
final double? opacity;
final bool? bold;
final bool? footer;
const TextWidget({super.key, required this.text, this.size, this.opacity, this.bold});
const TextWidget({super.key, required this.text, this.size, this.opacity, this.bold, this.footer});
@override
Widget build(BuildContext context) {
return Text(text,
style: GoogleFonts.outfit(
textStyle: TextStyle(
color: Color.fromRGBO(255, 255, 255, opacity ?? 1),
fontSize: size ?? 28,
fontWeight: bold == true ? FontWeight.bold : FontWeight.normal)));
final textStyle = TextStyle(
color: Color.fromRGBO(255, 255, 255, opacity ?? 1),
fontSize: size ?? 28,
fontWeight: bold == true ? FontWeight.bold : FontWeight.normal,
);
return footer == true
? Text(text, style: GoogleFonts.inter(textStyle: textStyle))
: Text(text, style: GoogleFonts.outfit(textStyle: textStyle));
}
}

View file

@ -14,7 +14,7 @@ class TitleWidget extends StatelessWidget {
style: GoogleFonts.outfit(
textStyle: TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: firstTextSize))),
Text('Pharmacy',
style: GoogleFonts.outfit(
style: GoogleFonts.poppins(
textStyle: TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: secondTextSize))),
]);
}