Update mybutton widget to take in buttonColor & TextColour. Add Success message pop up message.

Update all buttons to include button color and text colors.
This commit is contained in:
2024-07-03 16:33:52 +02:00
parent b25583ddf3
commit 0c40888907
10 changed files with 226 additions and 88 deletions

View File

@@ -3,8 +3,16 @@ import 'package:flutter/material.dart';
class MyButton extends StatelessWidget {
final void Function() onTap;
final String buttonText;
final Color buttonColor;
final Color textColor;
const MyButton({super.key, required this.onTap, required this.buttonText});
const MyButton({
super.key,
required this.onTap,
required this.buttonText,
required this.buttonColor,
required this.textColor,
});
@override
Widget build(BuildContext context) {
@@ -13,17 +21,17 @@ class MyButton extends StatelessWidget {
child: ElevatedButton(
onPressed: onTap,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blueAccent,
backgroundColor: buttonColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0),
),
),
child: Text(
buttonText,
style: const TextStyle(
style: TextStyle(
//fontWeight: FontWeight.bold,
fontSize: 20,
color: Colors.white,
color: textColor,
),
),
),