castToType<T> function

T castToType<T>(
  1. dynamic value
)

Implementation

T castToType<T>(value) {
  assert(value is T, '$value is not or not a subtype of $T');
  return value as T;
}