update
This commit is contained in:
parent
b5151a053d
commit
cf2ce36f87
14 changed files with 92 additions and 74 deletions
|
|
@ -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)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue