Steps to reproduce
Summary
After upgrading Flutter from v3.24.3 to v3.32.6, navigation that replaces the widget tree (e.g., logout) causes a persistent assertion error related to overlays created by the showcaseview package. This issue did not occur on earlier Flutter versions, and all recommended lifecycle and overlay cleanup steps have been attempted without success.
Environment
- Flutter Version: 3.32.6
- ShowcaseView Version: ^4.0.1
- Platform: Android/iOS (reproduced on both)
- Navigation: In-app navigator with
navigatorKey.currentState!.pushNamedAndRemoveUntil('/', (Route route) => false);
Error Details
════════ Exception caught by widgets library ═══════════════════════════════════
RenderBox was not laid out: RenderFractionalTranslation#a56d8 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2251 pos 12: 'hasSize'
The relevant error-causing widget was:
Navigator Navigator ...
#2 RenderBox.size (package:flutter/src/rendering/box.dart:2251:12)
#3 RenderFractionalTranslation.applyPaintTransform (package:flutter/src/rendering/proxy_box.dart:3081:42)
...
Steps to Reproduce
-
Setup
- Main screen contains a widget tree wrapped in
ShowCaseWidget.
- Guided highlights are started conditionally after build, using keys (e.g.,
_plusIconShowcaseKey, _dropDownShowcaseKey).
- Navigation is handled with a custom
navigatorKey.
-
Logout Flow
- Triggers data clearing and abrupt route replacement with
pushNamedAndRemoveUntil.
- No new showcase is started, but overlays may have been recently active.
-
Result
- During navigation away from the dashboard, Flutter throws a
RenderBox was not laid out assertion.
- Error surfaces in the stack trace related to Showcase overlay layout (RenderFractionalTranslation).
Attempts to Fix
- Explicitly called
ShowCaseWidget.of(context).dismiss() before navigation.
- Ensured no
ShowCaseWidget.of(context).startShowCase() is triggered during logout (confirmed via breakpoints).
- Popped all modal sheets/dialogs before navigating away.
- Deferred navigation using
WidgetsBinding.instance.addPostFrameCallback.
- Checked and guarded for active overlays or delayed async callbacks.
- Updated showcase package to the latest version.
- Validated that modal/overlay targets are not unmounted or unlaid out by the time navigation occurs.
None of these steps resolved the issue on Flutter 3.32.6. The error persists consistently every time navigation clears the stack while Showcase overlay was (potentially) used.
Additional Context
- This problem did not exist in Flutter 3.24.3 with the same code and package version.
- It appears after the upgrade, possibly due to stricter layout assertions or overlay lifecycle management changes in Flutter.
- Showcase overlays are not active when logout is triggered, but the widget tree has previously used them in the same session.
Request
- Clarification on changes in the Flutter rendering pipeline or overlay system that could cause this regression.
- Guidance for package maintainers on adapting ShowcaseView to avoid overlay layout issues with the new Flutter versions.
- Any workaround or systematic fix to prevent overlays (from Showcase or similar packages) from triggering assertion failures during widget tree teardown or navigation replacement?
Attachments
- Stack trace (as above)
- Brief setup and reproduction code snippets (see above)
Thank you! Please advise on resolving or mitigating this regression for apps using ShowcaseView and abrupt navigation on recent Flutter versions.
Expected results
Expected Behavior
- Navigating away or logging out should not trigger overlay or render assertion errors, even if Showcase was previously used or overlays were recently active.
Actual results
Actual Behavior
- Upon navigation, an exception is thrown (
RenderBox was not laid out), and the app's stability is compromised. App did not experience this problem before upgrading Flutter.
Code sample
Sample Logout Function
Future logoutAndClearData(BuildContext context) async {
// ...data clearing and preference removal...
final showCase = ShowCaseWidget.of(context);
if (showCase != null && showCase.isShowCaseActive) {
showCase.dismiss();
}
while (Navigator.of(context).canPop()) {
Navigator.of(context).pop();
}
WidgetsBinding.instance.addPostFrameCallback((_) {
navigatorKey.currentState!
.pushNamedAndRemoveUntil('/', (Route route) => false);
});
}
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
Flutter Doctor output
Doctor output
Steps to reproduce
Summary
After upgrading Flutter from v3.24.3 to v3.32.6, navigation that replaces the widget tree (e.g., logout) causes a persistent assertion error related to overlays created by the
showcaseviewpackage. This issue did not occur on earlier Flutter versions, and all recommended lifecycle and overlay cleanup steps have been attempted without success.Environment
navigatorKey.currentState!.pushNamedAndRemoveUntil('/', (Route route) => false);Error Details
Steps to Reproduce
Setup
ShowCaseWidget._plusIconShowcaseKey,_dropDownShowcaseKey).navigatorKey.Logout Flow
pushNamedAndRemoveUntil.Result
RenderBox was not laid outassertion.Attempts to Fix
ShowCaseWidget.of(context).dismiss()before navigation.ShowCaseWidget.of(context).startShowCase()is triggered during logout (confirmed via breakpoints).WidgetsBinding.instance.addPostFrameCallback.None of these steps resolved the issue on Flutter 3.32.6. The error persists consistently every time navigation clears the stack while Showcase overlay was (potentially) used.
Additional Context
Request
Attachments
Thank you! Please advise on resolving or mitigating this regression for apps using ShowcaseView and abrupt navigation on recent Flutter versions.
Expected results
Expected Behavior
Actual results
Actual Behavior
RenderBox was not laid out), and the app's stability is compromised. App did not experience this problem before upgrading Flutter.Code sample
Sample Logout Function
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[Paste your output here]