IncrementDecrementWidget.flat constructor

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

Factory constructor for a flat design.

The flat design has no elevation and transparent background by default.

Example usage:

IncrementDecrementWidget.flat(
  quantity: 1,
  maxQuantity: 10,
  onChanged: (newValue) {
    // Handle value change
  },
);

Implementation

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