From 7f41ce68f45db4fe0b57c68d62e9f9f547939c3c Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 16 Aug 2025 19:05:43 +0530 Subject: [PATCH 1/2] chore: update pubspec.lock before merging development --- pubspec.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index ce60ee718..1430bcb5e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -837,5 +837,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.7.0-0 <4.0.0" - flutter: ">=3.29.0" + dart: ">=3.8.0 <4.0.0" + flutter: ">=3.32.2" From f55832fd1f199a95a43324fd2d63af89f21dc11b Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 11 Oct 2025 15:58:08 +0530 Subject: [PATCH 2/2] made the scrolling feature in snowflake effect --- lib/badge_animation/ani_snowflake.dart | 44 ++++++++++++++++++++------ lib/l10n/app_en.arb | 2 +- lib/l10n/app_hi.arb | 2 +- lib/l10n/app_localizations_hi.dart | 2 +- 4 files changed, 38 insertions(+), 12 deletions(-) diff --git a/lib/badge_animation/ani_snowflake.dart b/lib/badge_animation/ani_snowflake.dart index 9fc1c8a0d..637f2b391 100644 --- a/lib/badge_animation/ani_snowflake.dart +++ b/lib/badge_animation/ani_snowflake.dart @@ -5,10 +5,34 @@ class SnowFlakeAnimation extends BadgeAnimation { void processAnimation(int badgeHeight, int badgeWidth, int animationIndex, List> processGrid, List> canvas) { int newWidth = processGrid[0].length; - int totalAnimationLength = badgeHeight * 16; - int frame = animationIndex % totalAnimationLength; + int newHeight = processGrid.length; - int horizontalOffset = (badgeWidth - newWidth) ~/ 2; + // Calculate the total number of frames that fit the badge width + int framesCount = (newWidth / badgeWidth).ceil(); + + // Calculate the total animation length for one complete snowflake cycle + int snowflakeCycleLength = badgeHeight * 16; + + // For transfer optimization: limit to 8 frames maximum + int maxFrames = 8; + int effectiveFramesCount = framesCount.clamp(1, maxFrames); + + // Calculate the total length for one complete text scroll cycle + int totalCycleLength = snowflakeCycleLength * effectiveFramesCount; + + // Get the current position in the overall cycle + int cyclePosition = animationIndex % totalCycleLength; + + // Determine which text section we're currently showing + int currentFrame = cyclePosition ~/ snowflakeCycleLength; + + // Calculate the starting column for the current frame in newGrid + int startCol = currentFrame * badgeWidth; + + // Get the frame within the current snowflake cycle + int frame = cyclePosition % snowflakeCycleLength; + + int horizontalOffset = (badgeWidth - newWidth).clamp(0, badgeWidth) ~/ 2; bool phase1 = frame < badgeHeight * 4; bool phase2 = frame >= badgeHeight * 4 && frame < badgeHeight * 8; @@ -22,9 +46,9 @@ class SnowFlakeAnimation extends BadgeAnimation { if (fallPosition >= 0 && fallPosition < badgeHeight) { for (int col = 0; col < badgeWidth; col++) { - int sourceCol = col - horizontalOffset; + int sourceCol = startCol + col - horizontalOffset; bool isWithinNewGrid = sourceCol >= 0 && sourceCol < newWidth; - if (isWithinNewGrid) { + if (isWithinNewGrid && row < newHeight) { canvas[fallPosition][col] = processGrid[row][sourceCol]; } } @@ -38,9 +62,9 @@ class SnowFlakeAnimation extends BadgeAnimation { if (fallOutPosition < row) { for (int col = 0; col < badgeWidth; col++) { - int sourceCol = col - horizontalOffset; + int sourceCol = startCol + col - horizontalOffset; bool isWithinNewGrid = sourceCol >= 0 && sourceCol < newWidth; - if (isWithinNewGrid) { + if (isWithinNewGrid && row < newHeight) { canvas[row][col] = processGrid[row][sourceCol]; } } @@ -52,9 +76,11 @@ class SnowFlakeAnimation extends BadgeAnimation { } for (int col = 0; col < badgeWidth; col++) { - int sourceCol = col - horizontalOffset; + int sourceCol = startCol + col - horizontalOffset; bool isWithinNewGrid = sourceCol >= 0 && sourceCol < newWidth; - if (isWithinNewGrid && fallOutPosition < badgeHeight) { + if (isWithinNewGrid && + fallOutPosition < badgeHeight && + row < newHeight) { canvas[fallOutPosition][col] = processGrid[row][sourceCol]; } } diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 697877483..48c688863 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -130,7 +130,7 @@ "up": "Up", "down": "Down", "fixed": "Fixed", - "animation": "Animation", + "animation": "Dot-Matrix", "snowflake": "Snowflake", "picture": "Picture", "laser": "Laser", diff --git a/lib/l10n/app_hi.arb b/lib/l10n/app_hi.arb index aa0a7d393..9bf874a8c 100644 --- a/lib/l10n/app_hi.arb +++ b/lib/l10n/app_hi.arb @@ -146,7 +146,7 @@ "failedToSaveBadge": "बैज सेव नहीं हुआ", "save": "सेव करें", "speed": "स्पीड", - "animation": "एनिमेशन", + "animation": "डॉट-मैट्रिक्स", "effects": "इफेक्ट", "transfer": "बैज पर भेजें", "saveBadge": "बैज सेव करें", diff --git a/lib/l10n/app_localizations_hi.dart b/lib/l10n/app_localizations_hi.dart index ea891420a..4dc97d4b4 100644 --- a/lib/l10n/app_localizations_hi.dart +++ b/lib/l10n/app_localizations_hi.dart @@ -182,7 +182,7 @@ class AppLocalizationsHi extends AppLocalizations { String get speedTitle => 'स्पीड'; @override - String get animation => 'एनिमेशन'; + String get animation => 'डॉट-मैट्रिक्स'; @override String get transition => 'बदलाव';