dart type check code example
Example 1: how to find the type of object in dart
var x = [32,4424];
print(x.runtimeType);
O/P:-
JSArray<int>
Example 2: dart check type of variable
class Foo { }
main() {
var foo = new Foo();
if (foo is Foo) {
print("it's a foo!");
}
}
Example 3: flutter type check
bool check(dynamic object) => object is T;