fast_nav 0.2.4 copy "fast_nav: ^0.2.4" to clipboard
fast_nav: ^0.2.4 copied to clipboard

outdated

Navigate without context. Call navigation methods from your business logic.

Navigate without context

pub package codecov checks popularity likes pub points

Features #

fast_nav supports the following navigation methods:

  • pop
  • canPop
  • push
  • pushReplacement
  • pushAndRemoveUntil
  • pushAndRemoveAll
  • pushNamed
  • pushReplacementNamed
  • pushNamedAndRemoveUntil
  • pushNamedAndRemoveAll

Convenience features:

  • Nested navigation with a NestedNavigator class for simple setup
  • Optional duplicate page prevention

Getting started #

Register a GlobalKey with FastNav and your MaterialApp

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

void example() {
  MaterialApp(
    navigatorKey: FastNav.init(),
    // Required for duplicate prevention
    navigatorObservers: [FastNavObserver()],
    // Required for anonymous page route duplicate prevention to work on root page
    onGenerateRoute: (settings) => FastNav.generateAnonymousRoute(
      settings: settings,
      page: const Text('home'),
    ),
  );
}

Usage #

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

void example() {
  FastNav.push(const Text('New page'));
}

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

void example() {
  // ...

  NestedNavigator(
    name: 'nestedNavigator',
    home: const Text('home'),
  );

  // ...

  FastNav.push(const Text('New page'), navigatorName: 'nestedNavigator');
}

Additional information #

See fast_ui for more information

0
likes
0
pub points
26%
popularity

Publisher

verified publisherrexios.dev

Navigate without context. Call navigation methods from your business logic.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on fast_nav