Skip to content

Commit

Permalink
Remove shadow from edit buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k committed Jan 10, 2025
1 parent 4f7c2fb commit 4251bf3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SmoothLargeButtonWithIcon extends StatelessWidget {
this.foregroundColor,
this.textAlign,
this.textStyle,
this.elevation,
});

final String text;
Expand All @@ -24,6 +25,7 @@ class SmoothLargeButtonWithIcon extends StatelessWidget {
final Color? foregroundColor;
final TextAlign? textAlign;
final TextStyle? textStyle;
final WidgetStateProperty<double?>? elevation;

Color _getBackgroundColor(final ThemeData themeData) =>
backgroundColor ?? themeData.colorScheme.secondary;
Expand All @@ -44,6 +46,7 @@ class SmoothLargeButtonWithIcon extends StatelessWidget {
minWidth: double.infinity,
padding: padding ?? const EdgeInsets.all(10),
onPressed: onPressed,
elevation: elevation,
buttonColor: _getBackgroundColor(themeData),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class SmoothSimpleButton extends StatelessWidget {
this.borderRadius = ROUNDED_BORDER_RADIUS,
this.padding = const EdgeInsets.all(10),
this.buttonColor,
this.elevation,
});

final Widget child;
Expand All @@ -21,6 +22,7 @@ class SmoothSimpleButton extends StatelessWidget {
final BorderRadius borderRadius;
final EdgeInsetsGeometry padding;
final Color? buttonColor;
final WidgetStateProperty<double?>? elevation;

@override
Widget build(BuildContext context) {
Expand All @@ -31,6 +33,7 @@ class SmoothSimpleButton extends StatelessWidget {
),
child: ElevatedButton(
style: ButtonStyle(
elevation: elevation,
backgroundColor: buttonColor == null
? null
: WidgetStateProperty.all<Color>(buttonColor!),
Expand Down
2 changes: 2 additions & 0 deletions packages/smooth_app/lib/helpers/product_cards_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,14 @@ Widget addPanelButton(
final String? textAlign,
final EdgeInsetsGeometry? padding,
required final Function() onPressed,
WidgetStateProperty<double?>? elevation,
}) =>
Padding(
padding: const EdgeInsets.symmetric(vertical: SMALL_SPACE),
child: SmoothLargeButtonWithIcon(
text: label,
icon: iconData ?? Icons.add,
elevation: elevation,
onPressed: onPressed,
textAlign: iconData == null ? TextAlign.center : null,
padding: padding,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ abstract class AbstractSimpleInputPageHelper extends ChangeNotifier {
isLoggedInMandatory: false,
),
iconData: Icons.add_a_photo,
elevation: const WidgetStatePropertyAll<double>(0.0),
padding: const EdgeInsetsDirectional.only(
top: SMALL_SPACE,
bottom: SMALL_SPACE,
Expand Down

0 comments on commit 4251bf3

Please sign in to comment.