Late Keyword

 /// late keyword: It has two use cases

///Declaring a non-nullable variable that's initialized after its declaration.
///Lazily initializing a variable.
//If we add "late" keyword at variable declaration time that means we promise to compiler that we will assign value
//to that variable before it is used.

void main() {
Sample obj = Sample();
obj.x = 10;
print(obj.x);
}
class Sample {
late int x;
}

Comments

Popular posts from this blog

Second GET API Calling with Bloc simple Example in Flutter

Exception_Dart

Pagination with Bloc Pattern in Flutter