Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if the context is there rather than isMounted because I'm using Stateless Widget

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 ?

like image 729
Flutter Dev Avatar asked Dec 21 '25 21:12

Flutter Dev


1 Answers

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

like image 184
void void Avatar answered Dec 24 '25 10:12

void void



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!