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

If contentList is not Null, title and description are not displayed in dialog box #9

Closed
MikeCodeman opened this issue Oct 14, 2022 · 2 comments

Comments

@MikeCodeman
Copy link

Version: easy_dialog: ^1.1.0

working code:

EasyDialog(
        title: Text("Basic Easy Dialog Title"),
        description: Text("This is a basic dialog")).show(context);

Broken Code:

EasyDialog(
        title: Text("Basic Easy Dialog Title"),
        description: Text("This is a basic dialog"),
contentList:[ Text("this is the only message that will now show in the dialog box"),],).show(context);

This code will show the text inside contentList and will not show the text inside title or description.

I was able to fix the problem by making the following changes in the file "easy_dialog.dart":

Change (line #76):

if (contentList != null) {
     _contentList = contentList as List<Widget>;
}

to:

if (contentList != null) {
      // _contentList = contentList as List<Widget>;
    
      contentList?.forEach((element) {
        insertByIndex(EdgeInsets.zero,  element, _contentList.length);
      });

Thank you for providing the easy_dialog package and for reviewing this issue.

Best regards,
Mike

@JavierDuarteC
Copy link
Collaborator

Done! Thanks for your input. Also, we took time to update the example app.

@MikeCodeman
Copy link
Author

Thank you.

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

No branches or pull requests

2 participants