Skip to content

Conversation

@Amitjoiya
Copy link

@Amitjoiya Amitjoiya commented Nov 13, 2025

… rename UI label to 'Dot-Matrix'

Fixes #

Changes

Screenshots / Recordings

Checklist:

  • No hard coding: I have used resources from constants.dart without hard coding any value.
  • No end of file edits: No modifications done at end of resource files.
  • Code reformatting: I have reformatted code and fixed indentation in every file included in this pull request.
  • Code analyzation: My code passes analyzations run in flutter analyze and tests run in flutter test.

Summary by Sourcery

Standardize animation timing across badge animations and update UI naming

Enhancements:

  • Simplify Snowflake animation to use linear frame mapping over a combined frame span for consistent timing
  • Align Dot-Matrix animation frame selection to use animationIndex modulo frames count for one tick per frame
  • Rename UI label to 'Dot-Matrix' for consistency

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 13, 2025

Reviewer's Guide

Unified animation timing by standardizing one tick == one frame, refactored the Snowflake animation to a single-phase drop algorithm, aligned frame stepping logic in the general Dot-Matrix animation to use modulo operations, and updated the UI label to ‘Dot-Matrix’.

Sequence diagram for unified animation frame stepping

sequenceDiagram
participant Timer
participant "AniAnimation.processAnimation()"
participant "SnowFlakeAnimation.processAnimation()"
participant Canvas
Timer->>"AniAnimation.processAnimation()": increment animationIndex (one tick)
"AniAnimation.processAnimation()"->>Canvas: update frame using animationIndex % framesCount
Timer->>"SnowFlakeAnimation.processAnimation()": increment animationIndex (one tick)
"SnowFlakeAnimation.processAnimation()"->>Canvas: update frame using animationIndex % totalFrames
Loading

Class diagram for updated SnowFlakeAnimation and AniAnimation classes

classDiagram
class SnowFlakeAnimation {
  +processAnimation(int badgeHeight, int badgeWidth, int animationIndex, List<List<bool>> processGrid, List<List<bool>> canvas)
}
class AniAnimation {
  +processAnimation(int badgeHeight, int badgeWidth, int animationIndex, List<List<bool>> processGrid, List<List<bool>> canvas)
}
class BadgeAnimation
BadgeAnimation <|-- SnowFlakeAnimation
BadgeAnimation <|-- AniAnimation
Loading

File-Level Changes

Change Details Files
Refactor Snowflake animation timing to a single-phase drop per frame
  • Removed dual-phase loops and manual fall calculations
  • Introduced totalFrames = badgeHeight + newHeight and frame = animationIndex % totalFrames
  • Computed destRow/destCol per source pixel and applied bounds checks
lib/badge_animation/ani_snowflake.dart
Adjust Dot-Matrix (AniAnimation) frame-stepping to use modulo-based indexing
  • Renamed currentcountFrame to currentFrame and switched to modulo for frame selection
  • Recomputed startCol from currentFrame and badgeWidth
  • Simplified bounds check and direct canvas assignment from processGrid
lib/badge_animation/ani_animation.dart
Rename UI label to ‘Dot-Matrix’
  • Replaced localized animationName with hard-coded ‘Dot-Matrix’ string
  • Updated inline comment to reflect new label
lib/view/widgets/transitiontab.dart

Possibly linked issues

  • #[ISSUE_ID]: The PR fixes the snowflake effect, aligns the Dot-Matrix (animation) frame stepping, and renames the UI label 'animation' to 'Dot-Matrix', directly addressing all tasks in the issue.
  • #N/A: The PR's rewrite of Snowflake animation's processAnimation method and timing alignment addresses text overflow rendering.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant