Skip to content
Discussion options

You must be logged in to vote

Hey 👋

Try extracting all the contents of the builder into a custom widget. This is usually good practise anyway as it means you can change what's shown inside the dialog during debugging with hot reload rather than having to close and reopen the dialog, and it improves code clarity. If a stateless widget doesn't do the trick, try a stateful one.

// In showDialog
builder: (context) => DialogWidget(),

// New widget
class DialogWidget extends StatelessWidget {
 // Etc.
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hadjiprocopis
Comment options

Answer selected by hadjiprocopis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants