{"id":21196340,"url":"https://github.com/davigmacode/flutter_loop_transition","last_synced_at":"2025-10-09T23:11:32.546Z","repository":{"id":235967842,"uuid":"791634522","full_name":"davigmacode/flutter_loop_transition","owner":"davigmacode","description":"Provides a way to create animated transitions on a child widget that repeat a certain number of times.","archived":false,"fork":false,"pushed_at":"2024-04-29T03:22:56.000Z","size":3382,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T21:49:57.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/loop_transition","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davigmacode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["davigmacode"],"patreon":null,"open_collective":null,"ko_fi":"davigmacode","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://www.buymeacoffee.com/davigmacode"]}},"created_at":"2024-04-25T04:39:23.000Z","updated_at":"2024-12-22T10:49:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"0978ca1f-8e67-4e60-8fb3-8dd0974396c4","html_url":"https://github.com/davigmacode/flutter_loop_transition","commit_stats":null,"previous_names":["davigmacode/flutter_loop_transition"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davigmacode/flutter_loop_transition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_loop_transition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_loop_transition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_loop_transition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_loop_transition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davigmacode","download_url":"https://codeload.github.com/davigmacode/flutter_loop_transition/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_loop_transition/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002339,"owners_count":26083340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T19:35:37.835Z","updated_at":"2025-10-09T23:11:32.510Z","avatar_url":"https://github.com/davigmacode.png","language":"Dart","funding_links":["https://github.com/sponsors/davigmacode","https://ko-fi.com/davigmacode","https://www.buymeacoffee.com/davigmacode"],"categories":[],"sub_categories":[],"readme":"[![Pub Version](https://img.shields.io/pub/v/loop_transition)](https://pub.dev/packages/loop_transition) ![GitHub](https://img.shields.io/github/license/davigmacode/flutter_loop_transition) [![GitHub](https://badgen.net/badge/icon/buymeacoffee?icon=buymeacoffee\u0026color=yellow\u0026label)](https://www.buymeacoffee.com/davigmacode) [![GitHub](https://badgen.net/badge/icon/ko-fi?icon=kofi\u0026color=red\u0026label)](https://ko-fi.com/davigmacode)\n\nThe `loop_transition` package offers a versatile widget called `LoopTransition` that allows you to apply repeatable animated transitions to a child widget. These transitions cycle through a specified number of times, creating dynamic effects within your UI.\n\n[![Preview](https://github.com/davigmacode/flutter_loop_transition/raw/main/media/preview.gif)](https://davigmacode.github.io/flutter_loop_transition)\n\n[Demo](https://davigmacode.github.io/flutter_loop_transition)\n\n## Features\n\n* Applies repeatable animated transitions to a child widget.\n* Offers various built-in transition functions (`fade`, `spin`, `slide`, `zoom`, `shimmer`).\n* Allows customization of transitions using the LoopTransitionBuilder.\n* Supports pausing and resuming playback using the pause property.\n* Provides control over animation behavior with properties like:\n  * `repeat`: Number of times to repeat the animation loop (-1 for infinite)\n  * `pause`: Whether to pause the animation.\n  * `continuity`: Controls whether the animation should maintain continuity when paused.\n  * `mirror`: Whether the animation should play forward, then backward in a mirroring effect.\n  * `reverse`: Controls the initial animation direction (forward or backward)\n  * `transition`: The LoopTransitionBuilder function that defines the animation behavior.\n  * `curve`: The animation curve that controls the easing of the animation.\n  * `delay`: Delay before the animation starts.\n  * `duration`: Animation duration for each direction (forward and backward if applicable).\n  * `backwardDelay`: Delay before starting the backward animation (in mirroring effect)\n  * `backwardDuration`: Optional duration for the backward animation (mirroring effect)\n* Triggers callbacks at various animation lifecycle stages:\n  * `onStart`: Called only once at the very beginning of the first animation play-through.\n  * `onPause`: Called whenever the animation is paused.\n  * `onContinue`: Called whenever the animation is resumed after being paused.\n  * `onCycle`: Called every time the animation completes a single loop iteration (forward and potentially backward if reverse is true).\n  * `onComplete`: Called only once when all specified loops have finished playing (if repeat is not set to -1 for infinite loops).\n\n## Usage\n\nTo read more about classes and other references used by `loop_transition`, see the [API Reference](https://pub.dev/documentation/loop_transition/latest/).\n\n### Import the package\n```dart\nimport 'package:loop_transition/loop_transition.dart';\n```\n\n### Create a repeatable transition widget\n```dart\nLoopTransition(\n  // Repeat the animation loop 3 times (in addition to the initial cycle)\n  repeat: 3,\n\n  // Start the animation\n  pause: false,\n\n  // When [pause] set to `true` then `false`, reset the animation to continue\n  continuity: false,\n\n  // Enable the mirror effect\n  mirror: true,\n\n  // Play the animation in reverse initially (optional)\n  reverse: true,\n\n  // Built-in fade transition animation (you can use a custom LoopTransitionBuilder for more complex animations)\n  transition: LoopTransition.fade,\n\n  // Use a curve to ease the animation (optional)\n  curve: Curves.easeInOut,\n\n  // Delay the animation start by 1 second\n  delay: const Duration(seconds: 1),\n\n  // Set the animation duration to 500 milliseconds for each direction (forward and backward)\n  duration: const Duration(milliseconds: 500),\n\n  // Set a delay before the reverse animation starts (optional)\n  backwardDelay: const Duration(milliseconds: 200),\n\n  // Set a different duration for the backward animation (optional)\n  backwardDuration: const Duration(milliseconds: 500),\n\n  // Callbacks for various animation lifecycle events (optional)\n  onStart: () =\u003e debugPrint('Animation Started'),\n  onPause: () =\u003e debugPrint('Animation Paused'),\n  onContinue: () =\u003e debugPrint('Animation Continued'),\n  onCycle: (cycle) =\u003e debugPrint('Animation Cycle: $cycle'),\n  onComplete: () =\u003e debugPrint('Animation Completed'),\n\n  // Allows chain effect\n  wrapper: (child, status) {\n    if (status.isCompleted) {\n      return LoopTransition(\n        delay: const Duration(milliseconds: 300),\n        duration: const Duration(milliseconds: 700),\n        transition: LoopTransition.shimmer(colors: [\n          Colors.black87,\n          Colors.blue,\n          Colors.black87,\n          Colors.black87,\n        ]),\n        child: child,\n      );\n    }\n    return child;\n  },\n\n  // Animate the child widget\n  child: const MyWidget(\n    text: 'This is the widget that will be animated',\n  ),\n)\n```\n\n### Built-in transitions\nThe package provides various built-in transitions you can use directly:\n\n* `LoopTransition.fade`: Fades the child widget in and out during the animation cycle.\n* `LoopTransition.spin`: Rotates the child widget around a central point.\n* `LoopTransition.slide`: Slides the child widget to a specified position.\n* `LoopTransition.zoom`: Zooms the child widget in and out.\n* `LoopTransition.shimmer`: Creates a shimmering effect on the child widget.\n* `LoopTransition.shakeX`: Shakes the child widget horizontally.\n* `LoopTransition.shakeY`: Shakes the child widget vertically.\n\n### Custom transitions\nFor more control, define your own transition functions using `LoopTransitionBuilder`:\n\n```dart\nfinal myCustomTransition = (child, animation) {\n  // Implement your custom animation logic here\n  return Container(child: child); // Wrap the child widget\n};\n\nLoopTransition(\n  transition: myCustomTransition,\n  child: MyWidget(),\n),\n```\n\n## Sponsoring\n\n\u003ca href=\"https://www.buymeacoffee.com/davigmacode\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" height=\"45\"\u003e\u003c/a\u003e\n\u003ca href=\"https://ko-fi.com/davigmacode\" target=\"_blank\"\u003e\u003cimg src=\"https://storage.ko-fi.com/cdn/brandasset/kofi_s_tag_white.png\" alt=\"Ko-Fi\" height=\"45\"\u003e\u003c/a\u003e\n\nIf this package or any other package I created is helping you, please consider to sponsor me so that I can take time to read the issues, fix bugs, merge pull requests and add features to these packages.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavigmacode%2Fflutter_loop_transition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavigmacode%2Fflutter_loop_transition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavigmacode%2Fflutter_loop_transition/lists"}