Json.fromJson constructor

Json.fromJson(
  1. Object? value
)

Creates a Json from a valid Json value. throws Exception if value could not be coerced into a Json

Implementation

factory Json.fromJson(Object? value) {
  final result = fromJsonChecked(value);

  return result.match(
    (ok) => ok,
    (err) => throw Exception(err),
  );
}