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

Pagination with Bloc Pattern in Flutter

Pagination First Practical in Flutter

ExpansionPanel with ExpansionPanelList with Complete Collapse Operation in Flutter