such as:

var list = List();
print(list.runtimeType);

// this should prints _GrowableList but prints List //, List is not list's actual type // it's not consistent with map.runtimeType, map.runtimeType is the map's actual Type

var map = Map();
print(map.runtimeType);

// this prints _InternalLinkedHashMap<dynamic,dynamic>, it is the map actual type.


Solution 1: fartem

In Dart, List and Map classes instance creation provides by a factory constructor. You can find how to a collection creates in Dart Language source code here for List and here for Map. More information described in first comment for this answer.


Solution 2: Silentdoer

void main(List arguments) {
var list= List.filled(1, 4, growable: true);
print(list.runtimeType);
list= List.filled(1, 4, growable: false);
print(list.runtimeType);
}

my thoughts is list.runtimeType is list's actual type in runtime, so it should prints _GrowableList and _List //(fixed length list), but in this case, it prints two List.