When you build an app in Flutter , it goes through different states depending on how the user interacts with it (open, minimize, back button, etc). Think of it like a human day cycle – Wake up → Active → Sleep → Wake again . π± 1. main() – Birth of the App Every Flutter app starts from the main() function. void main() { runApp(MyApp()); } π This is like turning ON the lights – your app is born. π 2. Widgets Lifecycle In Flutter, everything is a Widget . There are two main types: StatelessWidget → UI that doesn’t change. StatefulWidget → UI that changes with user interaction. For StatefulWidget , the lifecycle looks like this: πΉ When Widget is created createState() → Creates a State object (like preparing memory). initState() → First time setup (like waking up, stretching, preparing breakfast). Best place for API calls , animation controllers , initial values . πΉ When Widget builds build() → Renders UI (like dressin...
Learn Flutter app development, Dart coding, Firebase integration, animations, and state management with daily tutorials and examples. Java and Python Important Placement Question Guide.
Comments
Post a Comment