no_context_navigation 1.0.0

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(message: settings.arguments));
          default:
            return null;
        }
      },
    );
  }
}
4
likes
70
pub points
78%
popularity

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

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

fellipedmmalta@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on no_context_navigation