-
-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature]: ability to unregister dialogs #1119
Comments
@WinXaito Dos leaving them there cause any issues. I like the idea of unregistering, but I'm wondering if the same functionality can't be achieved simply by not calling the showDialog function for that variant |
Sorry for the delayed answer. Yeah, at this time, I don't unregister them and that works fine. I was wondering if it could be an issue if I register multiple time the same dialog? In my software, I have a "features" system. Unlike standard plugin (as it is not possible with dart). All my feature are in my soft, but some can be enabled/disabled by a license or by the user itself. So, a feature can be enabled/disabled multiple time and the enabling action will call |
@WinXaito yes that would not be an issue, the dialog would be overwritten with the new registration since we use a map to track the dialogs. So if you register for the same enum twice, you'll have the last dialogFunction called when showing a dialog for that enum |
Is your feature request related to a problem? Please describe.
In m'y application, I use a "FeatureSystem", it means I can activate or deactivate some functionalities with a license. (it's a little like a plugin system, but the code loading is not dynamic, because of dart).
Some of the functionalities use dialogs. So I'm able to register these dialogs when the package is initialised, but I have no way to unregister them when I dispose my package.
Describe the solution you would like
It would be cool if we can have a method like
unregisterCustomDialogBuilders(List<dynamic>)
here: https://github.com/Stacked-Org/services/blob/main/lib/src/dialog/dialog_service.dart#L25Additional Context
No response
The text was updated successfully, but these errors were encountered: