Skip to content

Commit

Permalink
fix: 🐛 Fixed RecalculateRootWidgetSize null check issue. (#429)
Browse files Browse the repository at this point in the history
- Added `mounted` check in `addPostFrameCallback` under `recalculateRootWidgetSize` in `showcase.dart` as to ensure that the operation is only performed if the element is mounted.
  • Loading branch information
aditya-css authored Apr 29, 2024
1 parent b3128d3 commit 49fa2e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [2.1.1]
- Fixed [#425](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/425) - Unhandled breaking change in v2.1.0
- Fixed [#428](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/428) - _ShowcaseState.recalculateRootWidgetSize null value

## [2.1.0]
- Feature [#420](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/pull/420) - Dart SDK Upgrade
Expand Down
1 change: 1 addition & 0 deletions lib/src/showcase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ class _ShowcaseState extends State<Showcase> {

void recalculateRootWidgetSize() {
ambiguate(WidgetsBinding.instance)?.addPostFrameCallback((_) {
if (!mounted) return;
final rootWidget =
context.findRootAncestorStateOfType<State<WidgetsApp>>();
rootRenderObject = rootWidget?.context.findRenderObject() as RenderBox?;
Expand Down

0 comments on commit 49fa2e1

Please sign in to comment.