Skip to content

Commit 49fa2e1

Browse files
authored
fix: 🐛 Fixed RecalculateRootWidgetSize null check issue. (SimformSolutionsPvtLtd#429)
- Added `mounted` check in `addPostFrameCallback` under `recalculateRootWidgetSize` in `showcase.dart` as to ensure that the operation is only performed if the element is mounted.
1 parent b3128d3 commit 49fa2e1

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## [2.1.1]
22
- Fixed [#425](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/425) - Unhandled breaking change in v2.1.0
3+
- Fixed [#428](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/428) - _ShowcaseState.recalculateRootWidgetSize null value
34

45
## [2.1.0]
56
- Feature [#420](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/pull/420) - Dart SDK Upgrade

lib/src/showcase.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ class _ShowcaseState extends State<Showcase> {
472472

473473
void recalculateRootWidgetSize() {
474474
ambiguate(WidgetsBinding.instance)?.addPostFrameCallback((_) {
475+
if (!mounted) return;
475476
final rootWidget =
476477
context.findRootAncestorStateOfType<State<WidgetsApp>>();
477478
rootRenderObject = rootWidget?.context.findRenderObject() as RenderBox?;

0 commit comments

Comments
 (0)