isTypeOf<T> method

bool isTypeOf<T>()

判断本对象是否是指定类型 T。

example:

final value = 'hello';
value.isTypeOf<String>(); // true
value.isTypeOf<int>();    // false

Implementation

bool isTypeOf<T>() => this is T;