TypeTest Operator

 /// TypeTest operators : is , is!

///   is :  If the object has the specified type then it is true
/// is! : If the object does not have the specified type then it is true

void main() {
var a = 10;
print(a is int); //output will be boolean value
print(a is String);
print(a is! String);
print("is Operator : ${a is int}");
print("is! Operator : ${a is! int}");
}

Comments

Popular posts from this blog

Second GET API Calling with Bloc simple Example in Flutter

Exception_Dart

Pagination with Bloc Pattern in Flutter