IncrementDecrementWidget.minimal constructor
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,
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,
);
}