app_navigator 0.0.4 copy "app_navigator: ^0.0.4" to clipboard
app_navigator: ^0.0.4 copied to clipboard

This package helps to manage the navigate between screens in an easy way. A Navigator 2.0 implementation.

App Navigator #

A declarative implementation of Flutter's Navigator for easy and clean code.

Features #

  • Easy to integrate & easy to use
  • Uses Flutter's Navigator v2.0

Getting started #

Add this package as a dependency

flutter pub add app_navigator

Import this package in your file

import 'package:app_navigator/app_navigator.dart';

Usage #

Setup #

  1. Init
import 'package:flutter/material.dart';
import 'package:app_navigator/app_navigator.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'AppNavigator Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: NavigationLayer(
        initPage: Page1(),
        initPath: Page1.route,
      ),
    );
  }
}

Push #

To navigate between routes, use the AppNavigator.push method:

onTap() => AppNavigator().push(Page(), name: 'page');

Pop #

To navigate backward, use the AppNavigator.pop method:

onTap() => AppNavigator().pop();

PopUntilNamed #

To navigate backward to a target page, use AppNavigator.popUntilNamed

onTap() => AppNavigator().popUntilNamed();

Context-less navigation #

The class AppNavigator by using the singleton pattern allows navigation within the app without care about the context.

3
likes
140
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

This package helps to manage the navigate between screens in an easy way. A Navigator 2.0 implementation.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on app_navigator