sailor_plus 1.0.1
sailor_plus: ^1.0.1 copied to clipboard
This package lets you navigate through screens and named routes without context in Flutter
Sailor Plus #
This package lets you navigate through screens and named routes without context in Flutter.
[anchor image]
Getting started #
add sailor_plus
as a dependency in your pubspec.yaml file.
dependencies:
flutter:
sdk: flutter
sailor_plus: 1.0.0
copied to clipboard
Next, import 'sailor_plus.dart'
import 'package:sailor_plus/sailor_plus.dart';
copied to clipboard
and finally make sure to set navigatorKey in your main.dart
MaterialApp(
navigatorKey: Sailor.navigatorKey,
)
copied to clipboard
Screens navigation #
To navigate to another screen or page:
Sailor.to(AnotherPage());
copied to clipboard
Named Routes navigation #
To navigate using named routes:
Sailor.toNamed("new_route");
copied to clipboard
Go back #
To go back to the previous page or route:
Sailor.back();
copied to clipboard