CartButtonStyle.fromTheme constructor

CartButtonStyle.fromTheme(
  1. ThemeData theme, {
  2. BoxShape shape = BoxShape.rectangle,
  3. Radius? radius,
  4. BoxBorder? border,
  5. IconThemeData? iconTheme,
  6. IconData? iconPlus,
  7. IconData? iconMinus,
  8. double? buttonAspectRatio,
  9. double? elevation,
})

Implementation

factory CartButtonStyle.fromTheme(
  ThemeData theme, {
  BoxShape shape = BoxShape.rectangle,
  Radius? radius,
  BoxBorder? border,
  IconThemeData? iconTheme,
  IconData? iconPlus,
  IconData? iconMinus,
  double? buttonAspectRatio,
  double? elevation,
}) {
  return CartButtonStyle(
    activeForegroundColor: theme.colorScheme.onPrimary,
    activeBackgroundColor: theme.colorScheme.primary,
    foregroundColor: theme.colorScheme.onSurface,
    backgroundColor: theme.colorScheme.surface,
    shadowColor: theme.colorScheme.shadow,
    shape: shape,
    radius: radius,
    border: border,
    textStyle: theme.textTheme.bodyMedium,
    iconTheme: iconTheme ?? const IconThemeData(),
    iconPlus: iconPlus,
    iconMinus: iconMinus,
    buttonAspectRatio: buttonAspectRatio ?? 1,
    elevation: elevation ?? 2,
  );
}