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