Wraps creation of native page route in simple function. Also provide function with preventing of creation the same route twice. Is fully tested on mobile (Android/iOS).
To use this plugin, add native_page_route
as a dependency in your pubspec.yaml file.
Here are small example that show you how to use this library.
// Creating a platform page route.
nativePageRoute(
builder: (context) => const YourAwesomeScreen(),
settings: RouteSettings(name: 'YourAwesomeScreenConstantName', arguments: SomeArguments()),
maintainState: true,
fullscreenDialog: true,
iosTitle: 'Awesome',
);
// Creating an platform page route, that returns null if this screen already presented.
notRepeatableNativePageRoute(
builder: (context) => const YourAwesomeScreen(),
context: context,
settings: RouteSettings(name: 'YourAwesomeScreenConstantName', arguments: SomeArguments()),
maintainState: true,
fullscreenDialog: true,
iosTitle: 'Awesome',
);