toJson method Null safety

Map<String, dynamic> toJson()

Returns a representation of this object as a JSON object.

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic>? autofill = autofillConfiguration.toJson();
  return <String, dynamic>{
    'inputType': inputType.toJson(),
    'readOnly': readOnly,
    'obscureText': obscureText,
    'autocorrect': autocorrect,
    'smartDashesType': smartDashesType.index.toString(),
    'smartQuotesType': smartQuotesType.index.toString(),
    'enableSuggestions': enableSuggestions,
    'enableInteractiveSelection': enableInteractiveSelection,
    'actionLabel': actionLabel,
    'inputAction': inputAction.toString(),
    'textCapitalization': textCapitalization.toString(),
    'keyboardAppearance': keyboardAppearance.toString(),
    'enableIMEPersonalizedLearning': enableIMEPersonalizedLearning,
    if (autofill != null) 'autofill': autofill,
    'enableDeltaModel' : enableDeltaModel,
  };
}