{"id":21196327,"url":"https://github.com/davigmacode/flutter_animated_repeatable","last_synced_at":"2025-09-08T16:46:58.517Z","repository":{"id":237151242,"uuid":"793912182","full_name":"davigmacode/flutter_animated_repeatable","owner":"davigmacode","description":"Provides a way to create animated transitions on a child widget that repeat indefinitely or for a certain number of times.","archived":false,"fork":false,"pushed_at":"2024-06-07T10:32:57.000Z","size":4251,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T21:49:55.112Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/animated_repeatable","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-30T05:26:59.000Z","updated_at":"2025-01-13T16:26:55.000Z","dependencies_parsed_at":"2024-06-07T11:50:55.293Z","dependency_job_id":"face2629-2142-4db8-bb2b-9686ee6cb424","html_url":"https://github.com/davigmacode/flutter_animated_repeatable","commit_stats":null,"previous_names":["davigmacode/animated_repeatable"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davigmacode/flutter_animated_repeatable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_animated_repeatable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_animated_repeatable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_animated_repeatable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_animated_repeatable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davigmacode","download_url":"https://codeload.github.com/davigmacode/flutter_animated_repeatable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davigmacode%2Fflutter_animated_repeatable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267875600,"owners_count":24158781,"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-07-30T02:00:09.044Z","response_time":70,"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:35.769Z","updated_at":"2025-07-30T13:33:05.586Z","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/animated_repeatable)](https://pub.dev/packages/animated_repeatable) ![GitHub](https://img.shields.io/github/license/davigmacode/flutter_animated_repeatable) [![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 `animated_repeatable` package offers a versatile widget called `AnimatedRepeatable` 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_animated_repeatable/raw/main/media/preview.gif)](https://davigmacode.github.io/flutter_animated_repeatable)\n\n[Demo](https://davigmacode.github.io/flutter_animated_repeatable)\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 AnimatedRepeatableTransitionBuilder.\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 AnimatedRepeatableBuilder 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  * `reverseTransition`: The transition applied for the backward direction (in mirroring).\n  * `reverseCurve`: The curve to use in the backward direction (in mirroring effect).\n  * `reverseDelay`: Delay before starting the backward animation (in mirroring effect)\n  * `reverseDuration`: 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 `animated_repeatable`, see the [API Reference](https://pub.dev/documentation/animated_repeatable/latest/).\n\n### Import the package\n```dart\nimport 'package:animated_repeatable/animated_repeatable.dart';\n```\n\n### Create a repeatable transition widget\n```dart\nAnimatedRepeatable(\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\n  // a custom AnimatedRepeatableBuilder for more complex animations\n  transition: AnimatedRepeatable.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  // Use different transition for backward animation (optional)\n  reverseTransition: AnimatedRepeatable.shakeX,\n\n  // Use a curve to ease the backward animation (optional)\n  reverseCurve: Curves.bounceOut,\n\n  // Set a delay before the reverse animation starts (optional)\n  reverseDelay: const Duration(milliseconds: 200),\n\n  // Set a different duration for the backward animation (optional)\n  reverseDuration: 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, state) {\n    if (state.isCompleted) {\n      return AnimatedRepeatable(\n        delay: const Duration(milliseconds: 300),\n        duration: const Duration(milliseconds: 700),\n        transition: AnimatedRepeatable.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* `AnimatedRepeatable.fade`: Fades the child widget in and out during the animation cycle.\n* `AnimatedRepeatable.spin`: Rotates the child widget around a central point.\n* `AnimatedRepeatable.slide`: Slides the child widget to a specified position.\n* `AnimatedRepeatable.zoom`: Zooms the child widget in and out.\n* `AnimatedRepeatable.shimmer`: Creates a shimmering effect on the child widget.\n* `AnimatedRepeatable.shakeX`: Shakes the child widget horizontally.\n* `AnimatedRepeatable.shakeY`: Shakes the child widget vertically.\n\n### Custom transitions\nFor more control, define your own transition functions using `AnimatedRepeatableBuilder`:\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\nAnimatedRepeatable(\n  transition: myCustomTransition,\n  child: MyWidget(),\n),\n```\n\n### Programmatic Play/Pause\nWith this approach, you can control the animation playback (play/pause) of the AnimatedRepeatable widget from anywhere in your code using the globally accessible key.\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:animated_repeatable/animated_repeatable.dart';\n\nfinal repeatableKey = GlobalKey\u003cAnimatedRepeatableState\u003e();\n\nvoid main() {\n  runApp(MyApp());\n}\n\nclass MyApp extends StatelessWidget {\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      home: Scaffold(\n        appBar: AppBar(\n          title: const Text('Programmatic AnimatedRepeatable'),\n        ),\n        body: Center(\n          child: Column(\n            mainAxisAlignment: MainAxisAlignment.center,\n            children: [\n              AnimatedRepeatable(\n                key: repeatableKey,\n                repeat: -1, // repeat infinitely\n                mirror: true,\n                transition: AnimatedRepeatable.fade,\n                duration: const Duration(seconds: 2),\n                child: const FlutterLogo(size: 100),\n              ),\n              const SizedBox(height: 20),\n              Row(\n                mainAxisAlignment: MainAxisAlignment.center,\n                children: [\n                  ElevatedButton(\n                    onPressed: () {\n                      repeatableKey.currentState?.play();\n                    },\n                    child: const Text('Play'),\n                  ),\n                  const SizedBox(width: 10),\n                  ElevatedButton(\n                    onPressed: () {\n                      repeatableKey.currentState?.pause();\n                    },\n                    child: const Text('Pause'),\n                  ),\n                ],\n              ),\n            ],\n          ),\n        ),\n      ),\n    );\n  }\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_animated_repeatable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavigmacode%2Fflutter_animated_repeatable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavigmacode%2Fflutter_animated_repeatable/lists"}