NumberInputPrefabbed.roundedEdgeButtons constructor
NumberInputPrefabbed.roundedEdgeButtons({
- required TextEditingController controller,
- Key? key,
- bool enabled = true,
- ButtonArrangement buttonArrangement = ButtonArrangement.rightEnd,
- num min = 0,
- num max = double.infinity,
- num initialValue = 0,
- num incDecFactor = 1,
- bool isInt = true,
- AutovalidateMode autovalidateMode = AutovalidateMode.always,
- bool enableMinMaxClamping = true,
- InputDecoration? numberFieldDecoration,
- Decoration widgetContainerDecoration = const BoxDecoration(),
- FormFieldValidator<
String> ? validator, - TextStyle? style,
- IconData incIcon = Icons.arrow_drop_up,
- IconData decIcon = Icons.arrow_drop_down,
- int fractionDigits = 2,
- double scaleWidth = 1.0,
- double scaleHeight = 1.0,
- double incIconSize = 27,
- double decIconSize = 27,
- Color? decIconColor,
- Color? incIconColor,
- DiffIncDecCallBack? onDecrement,
- DiffIncDecCallBack? onIncrement,
- ValueCallBack? onSubmitted,
- ValueCallBack? onChanged,
- bool separateIcons = true,
- Color incDecBgColor = Colors.lightGreen,
- TextAlign textAlign = TextAlign.center,
A pre-fabricated NumberInputWithIncrementDecrement widget with the increment/decrement buttons decorated as rounded edge buttons.
Implementation
NumberInputPrefabbed.roundedEdgeButtons({
required TextEditingController controller,
Key? key,
bool enabled = true,
ButtonArrangement buttonArrangement = ButtonArrangement.rightEnd,
num min = 0,
num max = double.infinity,
num initialValue = 0,
num incDecFactor = 1,
bool isInt = true,
AutovalidateMode autovalidateMode = AutovalidateMode.always,
bool enableMinMaxClamping = true,
InputDecoration? numberFieldDecoration,
Decoration widgetContainerDecoration = const BoxDecoration(),
FormFieldValidator<String>? validator,
TextStyle? style,
IconData incIcon = Icons.arrow_drop_up,
IconData decIcon = Icons.arrow_drop_down,
int fractionDigits = 2,
double scaleWidth = 1.0,
double scaleHeight = 1.0,
double incIconSize = 27,
double decIconSize = 27,
Color? decIconColor,
Color? incIconColor,
DiffIncDecCallBack? onDecrement,
DiffIncDecCallBack? onIncrement,
ValueCallBack? onSubmitted,
ValueCallBack? onChanged,
bool separateIcons = true,
Color incDecBgColor = Colors.lightGreen,
TextAlign textAlign = TextAlign.center,
}) : super(
controller: controller,
key: key,
enabled: enabled,
min: min,
max: max,
initialValue: initialValue,
incDecFactor: incDecFactor,
isInt: isInt,
autovalidateMode: autovalidateMode,
enableMinMaxClamping: enableMinMaxClamping,
buttonArrangement: buttonArrangement,
widgetContainerDecoration: widgetContainerDecoration,
validator: validator,
style: style,
incIcon: incIcon,
decIcon: decIcon,
fractionDigits: fractionDigits,
scaleHeight: scaleHeight,
scaleWidth: scaleWidth,
incIconSize: incIconSize,
decIconSize: decIconSize,
decIconColor: decIconColor,
incIconColor: incIconColor,
onDecrement: onDecrement,
onIncrement: onIncrement,
onSubmitted: onSubmitted,
onChanged: onChanged,
separateIcons: separateIcons,
incDecBgColor: incDecBgColor,
numberFieldDecoration:
buttonArrangement == ButtonArrangement.rightEnd ||
buttonArrangement == ButtonArrangement.leftEnd
? InputDecoration(
border: OutlineInputBorder(
borderRadius:
buttonArrangement == ButtonArrangement.rightEnd
? BorderRadius.only(
topLeft: Radius.circular(5),
bottomLeft: Radius.circular(5),
)
: BorderRadius.only(
topRight: Radius.circular(5),
bottomRight: Radius.circular(5),
),
),
)
: null,
incIconDecoration: BoxDecoration(
color: incDecBgColor,
borderRadius: buttonArrangement == ButtonArrangement.rightEnd
? BorderRadius.only(
topRight: Radius.circular(5),
)
: buttonArrangement == ButtonArrangement.incLeftDecRight
? BorderRadius.only(
topLeft: Radius.circular(5),
bottomLeft: Radius.circular(5),
)
: buttonArrangement == ButtonArrangement.incRightDecLeft
? BorderRadius.only(
topRight: Radius.circular(5),
bottomRight: Radius.circular(5),
)
: BorderRadius.only(
topLeft: Radius.circular(5),
),
border: Border.all(
color: Colors.black,
width: 0.25,
),
),
decIconDecoration: BoxDecoration(
color: incDecBgColor,
borderRadius: buttonArrangement == ButtonArrangement.rightEnd
? BorderRadius.only(
bottomRight: Radius.circular(5),
)
: buttonArrangement == ButtonArrangement.incLeftDecRight
? BorderRadius.only(
topRight: Radius.circular(5),
bottomRight: Radius.circular(5),
)
: buttonArrangement == ButtonArrangement.incRightDecLeft
? BorderRadius.only(
topLeft: Radius.circular(5),
bottomLeft: Radius.circular(5),
)
: BorderRadius.only(
bottomLeft: Radius.circular(5),
),
border: Border.all(
color: Colors.black,
width: 0.25,
),
),
textAlign: textAlign,
);