/flutter_approuter

Navigation made easy, now navigate to screens, without BuildContext from pure flutter & dart code, published on Pub dev.

Primary LanguageC++BSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Flutter Approuter

  • Navigation made easy, now navigate to screens, without BuildContext from pure flutter & dart code.

Installation

  1. Add the latest version of package to your pubspec.yaml (and rundart pub get):
dependencies:
  flutter_approuter:
  1. Import the package and use it in your Flutter App.
import 'package:flutter_approuter/flutter_approuter.dart';
  1. Add NavigatorKey in Material App for routing without BuiltContext
 MaterialApp(
   navigatorKey: navigatorKey,
   ...
 )

Supported Devices

  • Android
  • IOS
  • Linux
  • Windows
  • Macos

Features

  • Custom appRouter without BuiltContext

    • push
    • pushOffAll
    • pushNamed
    • pop
  • Get Context on initMethod also outside of page

    • getContext

Example

AppRouter without BuildContext

  1. getContext()
        appRouter.getContext();
    
  2. Push(Page)
        appRouter.push(HomeScreen());
    
  3. Pop()
        appRouter.pop();
    
  4. pushNamed(String route)
        appRouter.pushNamed(route);
    
  5. pushOffAll(Widget page)
        appRouter.pushOffAll(page);
    

Contributions

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.

If you fixed a bug or implemented a feature, please send a pull request.