Skip to content

Commit d835997

Browse files
committed
fix: 🐛 Fixed showcase key issue (#578)
1 parent 721e823 commit d835997

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

lib/src/showcase/showcase.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ class _ShowcaseState extends State<Showcase> {
535535

536536
late ShowcaseScope _showCaseWidgetManager;
537537

538-
late final int _uniqueId = widget.hashCode;
538+
late final int _uniqueId = UniqueKey().hashCode;
539539

540540
@override
541541
void initState() {

lib/src/showcase/showcase_controller.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ class ShowcaseController {
310310
targetPadding: config.targetPadding,
311311
),
312312
ToolTipWrapper(
313-
key: ValueKey(id),
314313
title: config.title,
315314
titleTextAlign: config.titleTextAlign,
316315
description: config.description,

lib/src/utils/overlay_manager.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class OverlayManager {
181181
// This key is used to force rebuild the overlay when needed.
182182
// this key enables `_overlayEntry?.markNeedsBuild();` to detect that
183183
// output of the builder has changed.
184-
key: ValueKey(firstShowcaseConfig.hashCode),
184+
key: ValueKey(firstController.id),
185185
children: [
186186
GestureDetector(
187187
onTap: firstController.handleBarrierTap,
@@ -199,7 +199,7 @@ class OverlayManager {
199199
),
200200
),
201201
),
202-
...controllers.expand((object) => object.tooltipWidgets),
202+
...controllers.expand((object) => object.tooltipWidgets).toList(),
203203
],
204204
);
205205

0 commit comments

Comments
 (0)