IncrementDecrementWidget.minimal constructor

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

Factory constructor for a minimalistic design.

The minimal design has no elevation and transparent background by default, focusing on simplicity and compactness.

Example usage:

IncrementDecrementWidget.minimal(
  quantity: 3,
  minValue: 1,
  onChanged: (newValue) {
    // Handle value change
  },
);

Implementation

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