no_context_navigation 3.0.0 copy "no_context_navigation: ^3.0.0" to clipboard
no_context_navigation: ^3.0.0 copied to clipboard

A Flutter package built to navigate between screens (routes) without using context (BuildContext).

example/main.dart

import 'package:flutter/material.dart';
import 'package:no_context_navigation/no_context_navigation.dart';

import 'src/detail_screen/detail_screen.dart';
import 'src/home_screen/home_screen.dart';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorKey: NavigationService.navigationKey,
      onGenerateRoute: (RouteSettings settings) {
        switch (settings.name) {
          case '/':
            return MaterialPageRoute(builder: (context) => HomeScreen());
          case '/detail_screen':
            return MaterialPageRoute(
                builder: (context) =>
                    DetailScreen(settings.arguments as String));
          default:
            return null;
        }
      },
    );
  }
}
19
likes
150
points
2.65k
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package built to navigate between screens (routes) without using context (BuildContext).

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on no_context_navigation