toJson method

  1. @override
String? toJson(
  1. TextInputType? object
)

Implementation

@override
String? toJson(TextInputType? object) {
  if (object == null) return null;

  if (object.index == TextInputType.datetime.index) {
    return 'datetime';
  } else if (object.index == TextInputType.emailAddress.index) {
    return 'emailAddress';
  } else if (object.index == TextInputType.multiline.index) {
    return 'multiline';
  } else if (object.index == TextInputType.name.index) {
    return 'name';
  } else if (object.index == TextInputType.number.index) {
    return 'number';
  } else if (object.index == TextInputType.phone.index) {
    return 'phone';
  } else if (object.index == TextInputType.streetAddress.index) {
    return 'streetAddress';
  } else if (object.index == TextInputType.text.index) {
    return 'text';
  } else if (object.index == TextInputType.url.index) {
    return 'url';
  } else if (object.index == TextInputType.visiblePassword.index) {
    return 'visiblePassword';
  }

  throw 'Json_Unsuported_Value';
}