isMapToModelType function

bool isMapToModelType(
  1. InterfaceType t
)

Determines if a DartType is a Map with the second type argument being a Model.

Implementation

bool isMapToModelType(InterfaceType t) {
  return const TypeChecker.fromRuntime(Map).isAssignableFromType(t) &&
      t.typeArguments.length == 2 &&
      isModelClass(t.typeArguments[1]);
}