Skip to content
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

Simple Alert Dialog #5043

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Simple Alert Dialog #5043

wants to merge 2 commits into from

Conversation

Williamrai
Copy link
Collaborator

What does this do?

This adds a class called SimpleAlertDialog. The purpose of this class is to simplify the creation and display of alert dialog and to centralize the creation of AlertDialogs into a single reusable class.

Why is this needed?

It helps to avoid doing the repetitive code often needed with setting up alert dialog and reduce boilerplate code. It provides customizable Dialog elements like title, message, icon, buttons and theme. Also adds a delay feature.

@dbrant
Copy link
Member

dbrant commented Oct 18, 2024

@Williamrai It's an interesting idea, but can you be more specific about what boilerplate this reduces? Most of our usages of MaterialAlertDialogBuilder are pretty concise already.

Maybe it would help if you include an example of switching a usage of MaterialAlertDialogBuilder for this new extension? Something like here or here.

@Williamrai
Copy link
Collaborator Author

The boilerplate I was referring to is the need to manually repeat the MaterialAlertDialogBuilder setup each time we create a dialog. On the contribution dashboard, we have dialogs with different content and some we show after some delay. I think by centralizing the dialog creation in this class, we can simply things for basic dialogs and common features like delay. This way we don't have to repeat the setup every time which makes the setup process cleaner.

Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants