toKeyBoardType static method

TextInputType? toKeyBoardType(
  1. dynamic value
)

Implementation

static TextInputType? toKeyBoardType(dynamic value) {
  if (value is! String) return null;

  return switch (value) {
    'text' => TextInputType.text,
    'multiline' => TextInputType.multiline,
    'number' => TextInputType.number,
    'phone' => TextInputType.phone,
    'datetime' => TextInputType.datetime,
    'emailAddress' => TextInputType.emailAddress,
    'url' => TextInputType.url,
    'visiblePassword' => TextInputType.visiblePassword,
    'name' => TextInputType.name,
    'streetAddress' => TextInputType.streetAddress,
    'none' => TextInputType.none,
    _ => null
  };
}