CodeInputBuilder typedef

CodeInputBuilder = Widget Function(bool hasFocus, String char)

A widget for inputting content with a fixed length, visually treating each character as a separate segment.

Sample code

CodeInput(
  length: 4,
  keyboardType: TextInputType.number,
  builder: CodeInputBuilders.lightCircle(),
  onFilled: (value) => print('Your input is $value.'),
  onDone: (value) => print('Your input is $value.'),
)

See also:

  • TextField, an input where the characters aren't separated from each other.

Implementation

typedef CodeInputBuilder = Widget Function(bool hasFocus, String char);