easy_nav

Last updated:

0 purchases

easy_nav Image
easy_nav Images
Add to Cart

Description:

easy nav

EasyNav #
pub package](https://pub.dartlang.org/packages/easy_nav)
Just a simple wrapper around flutter navigator, dialogs and snackbar to do those things without context.
Don't forget to do add the navigator key:
@override
Widget build(BuildContext context, WidgetRef ref) {
return MaterialApp(

...
navigatorKey: EasyNav.navigatorKey,
...
);
}
copied to clipboard
Navigation #
Initialize NavManager in your viewmodel or pass it via constructor.
class HomeViewModel extends ChangeNotifier{
final navManager = NavManager();

...
...
...
}
copied to clipboard
And navigate from there
// Naviagte to widgets
navManager.goTo(HomePage());

navManager.replace(HomePage());

navManager.goToAndRemoveUntil(HomePage(), (route) => false);

// Named Routes
navManager.goToNamed("/homepage");

navManager.replaceNamed("/homepage");

navManager.goToNamedAndRemoveUntil("/homepage", ((route) => false));

// Full Screen Dialogs
navManager.goTo(AddContactPage(), fullScreenDialog: true);
copied to clipboard
Dialogs #
Initialize DialogManager in your viewmodel or pass it via constructor.
class HomeViewModel extends ChangeNotifier{
final dialogManager = DialogManager();

...
...
...
}
copied to clipboard
Show dialogs from viewModel
dialogManager.showEasyDialog(builder: (context){
return YourWidget();
});

dialogManager.showEasyDatePicker(initialDate: DateTime.now(),
firstDate: DateTime.now().subtract(const Duration(hours: 24 * 365)),
lastDate: DateTime.now().subtract(const Duration(hours: 24 * 365)),
);

dialogManager.showEasyGeneralDialog(pageBuilder: ((context, animation, secondaryAnimation) {
return YourWidget();
}));
copied to clipboard
Bottom Sheets #
Initialize BottomSheetManager in your viewmodel or pass it via constructor.
class HomeViewModel extends ChangeNotifier{
final bottomSheetManager = BottomSheetManager();

...
...
...
}
copied to clipboard
Show Bottom Sheets from viewModel
bottomSheetManager.showEasyBottomSheet(builder: (context){
return YourWidget();
});

bottomSheetManager.showEasyModalBottomSheet(builder: (context){
return YourWidget();
});
copied to clipboard
Snackbars #
Initialize SnackBarManager in your viewmodel or pass it via constructor.
class HomeViewModel extends ChangeNotifier{
final snackBarManager = SnackBarManager();

...
...
...
}
copied to clipboard
Show Snackbars from viewModel
snackBarManager.showEasySnackbar(const SnackBar(content: Text("Item Deleted")));

snackBarManager.clearAllSnacks();

snackBarManager.hideCurrentSnackBar();

snackBarManager.removeCurrentSnackBar();
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.