needsListConversion function

bool needsListConversion(
  1. String type
)

Checks if a type is a List<T> where T is not a primitive.

Implementation

bool needsListConversion(String type) {
  final bt = baseType(type);
  if (!bt.startsWith('List<')) return false;
  final inner = bt.substring(5, bt.length - 1);
  return !const [
    'String',
    'int',
    'double',
    'bool',
    'num',
    'dynamic',
  ].contains(inner);
}