fromDynamicMap<T> static method

Map<String, T> fromDynamicMap<T>(
  1. dynamic map,
  2. JsonClassBuilder<T> builder
)

Helper function to create a map of string keys to dynamic objects given a builder that can build a single object.

Implementation

static Map<String, T> fromDynamicMap<T>(
  dynamic map,
  JsonClassBuilder<T> builder,
) {
  final result = maybeFromDynamicMap(map, builder);

  if (result == null) {
    throw Exception(
      'Requested non-nullable fromDynamicMap but null was encountered.',
    );
  }

  return result;
}