How can I determine whether an object is of a class or not in the Dart language?
I\'m looking to do something like the following:
if (someObject.class.to
Here is a simple explanation with a solution.
You have:
Object obj =t1; where t1 is an object of class T.
Object obj =t1
t1
And you have other object T called t.
t
T t = new T();
T t = new T()
How to check if obj is the same type of t ?
obj
Solution:
if(obj is t) print('obj is typeof t') else print('obj is not typeof t')