push<T extends Widget> method

Future<Object?>? push<T extends Widget>(
  1. T route
)

navigate to a new screen

Example Usage: PulseXNavigator navigator = PulseXNavigator(); navigator.push(ExampleView());

Implementation

Future<Object?>? push<T extends Widget>(T route) {
  BuildContext? context = navigatorKey.currentState?.context;
  assert(context != null, PulseXErrors.contextNotFoundError());
  return navigatorKey.currentState?.push(
    PulseXRoute(
      builder: (_) => route,
    ),
  );
}