toJson method Null safety

Map<String, dynamic>? toJson()

Returns a representation of this object as a JSON object.

Implementation

Map<String, dynamic>? toJson() {
  return enabled
    ? <String, dynamic>{
        'uniqueIdentifier': uniqueIdentifier,
        'hints': autofillHints,
        'editingValue': currentEditingValue.toJSON(),
        if (hintText != null) 'hintText': hintText,
      }
    : null;
}