I see in examples this code:
if (obj is User) { // do something }
I want to check the type of the object in a switch/case flow, and found a
switch string works.
switchType(Object object) { switch (MirrorSystem.getName(new Symbol(object.runtimeType.toString()))) { case "Animal": print('animal basic'); break; case 'Cat': print('Mouse for cat'); break; } }