IncrementDecrementWidget.raised constructor

IncrementDecrementWidget.raised({
  1. required int quantity,
  2. int? maxQuantity,
  3. int? minValue,
  4. ValueUpdate? onChanged,
  5. Color? backgroundColor,
  6. Color? iconColor,
  7. double? elevation,
  8. EdgeInsetsGeometry? margin,
  9. EdgeInsetsGeometry? valuePadding,
  10. EdgeInsetsGeometry? buttonMargin,
  11. EdgeInsetsGeometry? buttonPadding,
  12. TextStyle? quantityTextStyle,
  13. double? borderRadius,
  14. double? width,
  15. double? height,
  16. double? buttonWidth,
  17. double? buttonHeight,
  18. Color? borderColor,
  19. Widget? incrementIcon,
  20. Widget? decrementIcon,
  21. Duration longPressInterval = const Duration(milliseconds: 100),
  22. MainAxisAlignment? alignment,
})

Factory constructor for a raised design.

The raised design has elevation and an optional background color.

Example usage:

IncrementDecrementWidget.raised(
  quantity: 2,
  maxQuantity: 5,
  onChanged: (newValue) {
    // Handle value change
  },
);

Implementation

factory IncrementDecrementWidget.raised({
  required int quantity,
  int? maxQuantity,
  int? minValue,
  ValueUpdate? onChanged,
  Color? backgroundColor,
  Color? iconColor,
  double? elevation,
  EdgeInsetsGeometry? margin,
  EdgeInsetsGeometry? valuePadding,
  EdgeInsetsGeometry? buttonMargin,
  EdgeInsetsGeometry? buttonPadding,
  TextStyle? quantityTextStyle,
  double? borderRadius,
  double? width,
  double? height,
  double? buttonWidth,
  double? buttonHeight,
  Color? borderColor,
  Widget? incrementIcon,
  Widget? decrementIcon,
  Duration longPressInterval = const Duration(milliseconds: 100),
  MainAxisAlignment? alignment,
}) {
  return IncrementDecrementWidget(
    quantity: quantity,
    maxQuantity: maxQuantity,
    minValue: minValue,
    onChanged: onChanged,
    backgroundColor: backgroundColor,
    iconColor: iconColor,
    elevation: elevation ?? 6.0,
    margin: margin,
    valuePadding: valuePadding,
    buttonMargin: buttonMargin,
    buttonPadding: buttonPadding,
    quantityTextStyle: quantityTextStyle,
    borderRadius: borderRadius ?? 10.0,
    width: width,
    height: height,
    buttonWidth: buttonWidth,
    buttonHeight: buttonHeight,
    borderColor: borderColor,
    splashFactory: NoSplash.splashFactory,
    splashColor: Colors.transparent,
    incrementIcon: incrementIcon,
    decrementIcon: decrementIcon,
    longPressInterval: longPressInterval,
    alignment: alignment,
  );
}