fix: distinguish constuct level up animations by construct ID instead of count (#5468)
This commit is contained in:
parent
eb41139343
commit
1f7ca4c1fc
2 changed files with 9 additions and 4 deletions
|
|
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue