Option<T>.fromJson constructor
Option<T>.fromJson (
- dynamic json,
- T fromJsonT(
- dynamic json
Converts from Json.
Json serialization support for json_serializable with @JsonSerializable.
Implementation
factory Option.fromJson(
// nature of JSON
//ignore: avoid_annotating_with_dynamic
dynamic json,
// nature of JSON
//ignore: avoid_annotating_with_dynamic
T Function(dynamic json) fromJsonT,
) =>
json != null ? Option.tryCatch(() => fromJsonT(json)) : Option.none();