CodeInput constructor
CodeInput({
- Key? key,
- required int length,
- FocusNode? focusNode,
- TextInputType keyboardType = TextInputType.text,
- List<
TextInputFormatter> ? inputFormatters, - required CodeInputBuilder builder,
- double spacing = 8,
- void onChanged(
- String value
- void onFilled(
- String value
- void onDone(
- String value
Implementation
factory CodeInput({
Key? key,
required int length,
FocusNode? focusNode,
TextInputType keyboardType = TextInputType.text,
List<TextInputFormatter>? inputFormatters,
required CodeInputBuilder builder,
double spacing = 8,
void Function(String value)? onChanged,
void Function(String value)? onFilled,
void Function(String value)? onDone,
}) {
assert(length > 0, 'The length needs to be larger than zero.');
assert(length.isFinite, 'The length needs to be finite.');
return CodeInput._(
key: key,
length: length,
focusNode: focusNode ?? FocusNode(),
keyboardType: keyboardType,
inputFormatters:
inputFormatters ?? _createInputFormatters(length, keyboardType),
builder: builder,
spacing: spacing,
onChanged: onChanged,
onFilled: onFilled,
onDone: onDone,
);
}