fix: distinguish constuct level up animations by construct ID instead of count (#5468)

This commit is contained in:
ggurdin 2026-01-27 15:33:24 -05:00 committed by GitHub
parent eb41139343
commit 1f7ca4c1fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 4 deletions

View file

@ -46,7 +46,12 @@ mixin AnalyticsUpdater<T extends StatefulWidget> on State<T> {
void _onConstructLevelUp(ConstructLevelUpdate update) {
if (update.targetID != null) {
OverlayUtil.showGrowthAnimation(context, update.targetID!, update.level);
OverlayUtil.showGrowthAnimation(
context,
update.targetID!,
update.level,
update.constructId,
);
}
}
}

View file

@ -14,6 +14,7 @@ import 'package:fluffychat/pangea/common/utils/any_state_holder.dart';
import 'package:fluffychat/pangea/common/widgets/anchored_overlay_widget.dart';
import 'package:fluffychat/pangea/common/widgets/overlay_container.dart';
import 'package:fluffychat/pangea/common/widgets/transparent_backdrop.dart';
import 'package:fluffychat/pangea/constructs/construct_identifier.dart';
import 'package:fluffychat/pangea/constructs/construct_level_enum.dart';
import 'package:fluffychat/pangea/learning_settings/language_mismatch_popup.dart';
import '../../../config/themes.dart';
@ -314,14 +315,13 @@ class OverlayUtil {
);
}
static int _growthAnimationCounter = 0;
static void showGrowthAnimation(
BuildContext context,
String targetId,
ConstructLevelEnum level,
ConstructIdentifier constructId,
) {
final overlayKey = "${targetId}_growth_${_growthAnimationCounter++}";
final overlayKey = "${targetId}_growth_${constructId.string}";
showOverlay(
overlayKey: overlayKey,
followerAnchor: Alignment.topCenter,