type<T> static method

T? type<T>(
  1. String key,
  2. dynamic source,
  3. EntityBuilder<T> builder
)

Returns an object associated with the given key from the source, constructed using the provided builder.

Implementation

static T? type<T>(
  String key,
  dynamic source,
  EntityBuilder<T> builder,
) {
  final data = _v(key, source);
  if (data is String) {
    return builder.call(data);
  } else {
    return null;
  }
}