toJson method Null safety

  1. @override
dynamic toJson()
override

Returns the json representation of value.

Implementation

@override
dynamic toJson() {
  try {
    return (value as dynamic)?.toJson();
  } on Exception catch (_) {
    throw '$T has not method [toJson]';
  }
}