Is there a more idiomaic way to express "is not" than !(o is T)
?
/// Object (o) is not type (T)
///
/// Syntax that works but is not concise: `!(o is T)`
final word = 'drow';
if (!(word is String)) print('undoable');
You can use o is! T
:
if (word is! String) print('undoable');
See Type test operators.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With