push bug fixes

This commit is contained in:
ashrafzarkanisala
2024-10-01 00:27:03 +03:00
parent 92d32e4d84
commit 9e5d5c0d84
15 changed files with 192 additions and 73 deletions

View File

@ -18,6 +18,7 @@ class DefaultButton extends StatelessWidget {
this.height,
this.padding,
this.borderColor,
this.elevation,
});
final void Function()? onPressed;
final Widget child;
@ -33,6 +34,7 @@ class DefaultButton extends StatelessWidget {
final Color? backgroundColor;
final Color? foregroundColor;
final Color? borderColor;
final double? elevation;
@override
Widget build(BuildContext context) {
@ -45,7 +47,9 @@ class DefaultButton extends StatelessWidget {
textStyle: WidgetStateProperty.all(
customTextStyle ??
Theme.of(context).textTheme.bodySmall!.copyWith(
fontSize: 13, color: foregroundColor, fontWeight: FontWeight.normal),
fontSize: 13,
color: foregroundColor,
fontWeight: FontWeight.normal),
),
foregroundColor: WidgetStateProperty.all(
isSecondary
@ -54,7 +58,8 @@ class DefaultButton extends StatelessWidget {
? foregroundColor ?? Colors.white
: Colors.black,
),
backgroundColor: WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
backgroundColor: WidgetStateProperty.resolveWith<Color>(
(Set<WidgetState> states) {
return enabled
? backgroundColor ?? ColorsManager.primaryColor
: Colors.black.withOpacity(0.2);
@ -74,6 +79,7 @@ class DefaultButton extends StatelessWidget {
minimumSize: WidgetStateProperty.all(
const Size.fromHeight(50),
),
elevation: WidgetStateProperty.all(elevation ?? 0),
),
child: SizedBox(
height: height ?? 50,