init method

  1. @override
Future<RouteBase?> init(
  1. BuildContext context
)
override

Initialize the route when it becomes active.

This is called when the route is first navigated to. Use this to set up any route-specific state or resources. Return null to prevent the route from being shown.

Implementation

@override
Future<RouteBase?> init(BuildContext context) async {
  return this;
}