rensawamo / flutterlifecycle

flutter life cycle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check the above sample program as you run it.

App lifecycle

image

  • inactive : The application is displayed but is not in focus.

  • paused : App transitions to background (not in the forefront) and is paused with no input possible.

  • resumed : The app transitions to the foreground (returns from paused state) and the state for return processing

  • detached : State for exit processing that is passed when the application exits.

Stateful widget lifecycle

image

Initial screen construction

  • initState

  • didChangeDependencies

  • call build

When changing the state with State{}

  • setState

  • build

Discard screen at screen transition

  • deactivate
  • dispose

Change and save the source code in VSCode on the main screen and reload it hot

  • didUpdateWidget
  • build

Navigation Lifecycle

The following is an example of a call from Screen A to Screen B.

  • didPush : Method called on the screen specified by Navigator.push() on screen A, i.e., the screen side (screen B) from which the call is made

  • didPop : Method called on Screen B when Navigator.pop() is executed from Screen B.

  • didPushNext : Method called on Screen A when Navigator.push() is executed from Screen A.

  • didPopNext : Method called on Screen A when Navigator.pop() is executed on Screen B.

About

flutter life cycle


Languages

Language:Dart 85.7%Language:Swift 11.6%Language:Kotlin 2.1%Language:Objective-C 0.6%