Type error when adding two derivatives of same base class in a List
This can be solved by specifying the object type in the generics field of the map
function. Since you're not specifying the type, it's being assumed to be an iterable of ShowingLocation
.
Do this instead:
List<Widget> _elementsHere = _locationsRegister .map<Widget>((e) => ShowingLocation( num: e.num, name: e.name, icon: e.icon, )) .toList();