Modified Devices Pages

This commit is contained in:
Mohammad Salameh
2024-03-11 12:04:26 +03:00
parent f11b6d8d32
commit d3bd10730c
16 changed files with 136 additions and 131 deletions

View File

@ -13,6 +13,8 @@ class DefaultButton extends StatelessWidget {
this.isDone = false,
this.customTextStyle,
this.customButtonStyle,
this.backgroundColor,
this.foregroundColor,
});
final void Function()? onPressed;
@ -29,6 +31,10 @@ class DefaultButton extends StatelessWidget {
final ButtonStyle? customButtonStyle;
final Color? backgroundColor;
final Color? foregroundColor;
@override
Widget build(BuildContext context) {
return ElevatedButton(
@ -41,17 +47,22 @@ class DefaultButton extends StatelessWidget {
customTextStyle ??
context.bodyMedium.copyWith(
fontSize: 16,
color: foregroundColor,
),
),
foregroundColor: MaterialStateProperty.all(
isSecondary
? Colors.black
: enabled
? Colors.white
? foregroundColor ?? Colors.white
: Colors.black,
),
backgroundColor: MaterialStateProperty.all(
enabled ? ColorsManager.primaryColor : Colors.grey),
backgroundColor: MaterialStateProperty.resolveWith<Color>(
(Set<MaterialState> states) {
return enabled
? backgroundColor ?? ColorsManager.primaryColor
: Colors.grey;
}),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),