You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! i faced a problem in flutter today. your Watch uses a post frame callback, this is not an issue in majority of cases, but i'm using a context that is building my page twice in one frame, the first one get instantly disposed (actually an issue, but not necessarily one in other projects). so when my render finishes, watch calls an update on disposed widgets.
i made my own class to wait:
this.createComputed(() => widget.builder(context),
debugLabel: widget.debugLabel)
became:
this.createComputed(() => mounted ? widget.builder(context) : Container(),
debugLabel: widget.debugLabel)
and
WidgetsBinding.instance.addPostFrameCallback(() {
result.recompute();
if (mounted) setState(() {});
});
became
WidgetsBinding.instance.addPostFrameCallback(() {
if (mounted) result.recompute();
if (mounted) setState(() {});
});
The text was updated successfully, but these errors were encountered:
Hi! i faced a problem in flutter today. your Watch uses a post frame callback, this is not an issue in majority of cases, but i'm using a context that is building my page twice in one frame, the first one get instantly disposed (actually an issue, but not necessarily one in other projects). so when my render finishes, watch calls an update on disposed widgets.
i made my own class to wait:
this.createComputed(() => widget.builder(context),
debugLabel: widget.debugLabel)
became:
this.createComputed(() => mounted ? widget.builder(context) : Container(),
debugLabel: widget.debugLabel)
and
WidgetsBinding.instance.addPostFrameCallback(() {
result.recompute();
if (mounted) setState(() {});
});
became
WidgetsBinding.instance.addPostFrameCallback(() {
if (mounted) result.recompute();
if (mounted) setState(() {});
});
The text was updated successfully, but these errors were encountered: