Useful Flutter DevOPS Tools, Lifecycle Logs
2 min readDec 30, 2022
One of the useful things that we can have in logs is lifecycle calls as they allow the debugging of navigation, etc. Let me show you how to use the Lifecycle package to achieve this feat.
What We Are Using
We are using the lifecycle package:
The widgets that this package supports are:
-StatefulWidget.
-StatelessWidget(include Dialog).
-PageView/TabBarView and it’s children.
-Nested PageView.
-Navigator(Navigator 2.0 pages api).
-Child of ListView/GridView/CustomScrollView.
Now, for some sample code.
Sample Code
In navigator 2.0 you will put the lifecycle observer as an observer in the routers: