dialog_queue

Creator: coderz1093

Last updated:

0 purchases

dialog_queue Image
dialog_queue Images

Languages

Categories

Add to Cart

Description:

dialog queue

A dialog queue for you to manage your dialogs to display on flutter platform
中文
Features #

Support pop dialog orderly
Support pop dialog by priority
Support deduplicate dialog in the queue
Support pause \ resume the pop action


Getting started #
Installation
Add the following lines to pubspec.yaml on your app module. Then run flutter pub get.
dependencies:
dialog_queue: ">=1.0.1"
...
copied to clipboard
Usage #
Step 1 : Add DialogQueueRouteObserver in your MaterialApp

class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
navigatorObservers: [DialogQueueRouteObserver()],
);
}
}

copied to clipboard
Step 2 : Replace "showDialog" with DialogQueue.instance.addDialog
Old usage
showModalBottomSheet<T>(
context: context,
backgroundColor: Colors.white,
isScrollControlled: true,
isDismissible: false,
builder: (BuildContext context) {
return SafeArea(child: Text('Hello DialogQueue'));
},
);
copied to clipboard
New usage
DialogQueue.instance.addDialog(DialogQueueElement(() {
return showModalBottomSheet(
context: context,
backgroundColor: Colors.white,
isScrollControlled: true,
isDismissible: false,
builder: (BuildContext context) {
return SafeArea(child: Text('Hello DialogQueue'));
}
);
}, tag: tag, priority: priority, uniqueKey: uniqueKey));
copied to clipboard
Other usage #

You can pause \ resume the pop action of queue at any time

DialogQueue.instance.resume();
DialogQueue.instance.pause();
copied to clipboard

If you want to break off the queue when route to PageB,and resume it after PageA popped, then you can use:

DialogQueue.instance.pushNameThenResume(navigatorState, PageB);
copied to clipboard

License

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

Customer Reviews

There are no reviews.