fromJson method

  1. @override
String fromJson(
  1. ObjectId? json
)

Converts a JSON value to a String representation of ObjectId.

If the json value is null, an empty string is returned. Otherwise, the oid property of the ObjectId is returned as a String.

json is the JSON value to be converted to a String representation of ObjectId.

Returns a String representing the ObjectId.

Implementation

@override
String fromJson(ObjectId? json) {
  return json == null ? '' : json.oid;
}