decodeAs<T> static method

T decodeAs<T>(
  1. String json, {
  2. required T fromMap(
    1. Map<String, dynamic>
    ),
})

Decodes a JSON string to a value of type T.

Implementation

static T decodeAs<T>(
  String json, {
  required T Function(Map<String, dynamic>) fromMap,
}) {
  return fromMap(decode(json));
}