3

I'm using StateLess Widget and I want to check if the context not disposed before showing up the dialog, without using the isMounted method so is there any solution for that ?

Flutter Dev
  • 488
  • 3
  • 18

1 Answers1

2

According to https://github.com/flutter/flutter/issues/111488 there is currently no way to do that, but it should be available soon as this PR was merged. It is currently in the beta branch.

Edit: as of Flutter 3.7.0 you can use BuildContext.mounted. Check https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.7.0

void void
  • 1,080
  • 3
  • 8