{"id":18878967,"url":"https://github.com/ercantomac/elegant_spring_animation","last_synced_at":"2026-02-19T20:30:15.750Z","repository":{"id":192610472,"uuid":"655766310","full_name":"ercantomac/elegant_spring_animation","owner":"ercantomac","description":"A package that provides an intuitive API for using spring animations.","archived":false,"fork":false,"pushed_at":"2023-06-19T22:48:51.000Z","size":1838,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-09-05T04:39:44.853Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ercantomac.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-19T14:52:20.000Z","updated_at":"2023-09-05T04:41:45.188Z","dependencies_parsed_at":null,"dependency_job_id":"8ac37bba-ff08-4d88-b146-2313e2bf54c6","html_url":"https://github.com/ercantomac/elegant_spring_animation","commit_stats":null,"previous_names":["ercantomac/elegant_spring_animation"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ercantomac%2Felegant_spring_animation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ercantomac%2Felegant_spring_animation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ercantomac%2Felegant_spring_animation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ercantomac%2Felegant_spring_animation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ercantomac","download_url":"https://codeload.github.com/ercantomac/elegant_spring_animation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239841728,"owners_count":19705981,"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","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-08T06:31:41.046Z","updated_at":"2026-02-19T20:30:15.718Z","avatar_url":"https://github.com/ercantomac.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nThis README describes the package. If you publish this package to pub.dev,\nthis README's contents appear on the landing page for your package.\n\nFor information about how to write a good package README, see the guide for\n[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).\n\nFor general information about developing packages, see the Dart guide for\n[creating packages](https://dart.dev/guides/libraries/create-library-packages)\nand the Flutter guide for\n[developing packages and plugins](https://flutter.dev/developing-packages).\n--\u003e\n\nElegant Spring Animation\n================================================================================\n\nMake your animations feel natural with spring animations.\n\nThis package lets you easily create animation curves that are based on spring physics, with customizable bounciness!\n\nLive demo:\n- [WASM](https://wasm-app-launch-animation-concept.netlify.app/) | [JavaScript](https://app-launch-animation-concept.netlify.app/)\n\nLive demo 2:\n- [WASM](https://wasm-elegant-spring-animation.netlify.app/) | [JavaScript](https://elegant-spring-animation.netlify.app/)\n\n## Getting started\n\nAdd `elegant_spring_animation` as a dependency in your pubspec.yaml file:\n```yaml\ndependencies:\n  elegant_spring_animation: ^2.0.2\n```\n\n## Usage\n\n### Basic usage\n\n```dart\nlate AnimationController animationController;\nfinal ElegantSpring curve = ElegantSpring.smooth;\n\n@override\nvoid initState() {\n  super.initState();\n  animationController = AnimationController(vsync: this, duration: curve.recommendedDuration);\n}\n```\n```dart\nScaleTransition(\n    scale: CurvedAnimation(parent: animationController, curve: curve, reverseCurve: curve.flipped),\n    child: ...,\n)\n```\n```dart\nAnimatedScale(\n    scale: condition ? 0.5 : 1.0,\n    duration: curve.recommendedDuration,\n    curve: curve,\n    child: ...,\n)\n```\n\n### Customizing the bounciness\n\nThere is an optional `bounce` parameter, which has a default value of 0 (no bounce).\n\nYou can provide a value between 0 and 1. Higher the value, bouncier the animation.\n\n```dart\nfinal ElegantSpring curve = ElegantSpring(bounce: 0.25);\n```\n\n### Predefined curves\nThere are five predefined curves:\n\n- ``ElegantSpring.smooth``: Has no bounce, gracefully comes to rest.\n  \n\u003cimg src=\"https://raw.githubusercontent.com/ercantomac/elegant_spring_animation/refs/heads/main/assets/bounce_0.png\" height=\"480\" title=\"0 Bounce\"/\u003e\n\n\n- ``ElegantSpring.gentleBounce``: Has a very subtle bounce.\n  \n\u003cimg src=\"https://raw.githubusercontent.com/ercantomac/elegant_spring_animation/refs/heads/main/assets/bounce_0-25.png\" height=\"480\" title=\"0.25 Bounce\"/\u003e\n\n\n- ``ElegantSpring.mediumBounce``: Has a noticeable bounce, but not too distracting.\n  \n\u003cimg src=\"https://raw.githubusercontent.com/ercantomac/elegant_spring_animation/refs/heads/main/assets/bounce_0-5.png\" height=\"480\" title=\"0.5 Bounce\"/\u003e\n\n\n- ``ElegantSpring.strongBounce``: Has a strong bounce.\n  \n\u003cimg src=\"https://raw.githubusercontent.com/ercantomac/elegant_spring_animation/refs/heads/main/assets/bounce_0-75.png\" height=\"480\" title=\"0.75 Bounce\"/\u003e\n\n\n- ``ElegantSpring.maximumBounce``: Has the maximum bounce, ideal for playful UIs and games.\n  \n\u003cimg src=\"https://raw.githubusercontent.com/ercantomac/elegant_spring_animation/refs/heads/main/assets/bounce_1.png\" height=\"480\" title=\"1 Bounce\"/\u003e\n\n\n### ``recommendedDuration`` property\nYou can use whatever duration you want for your animation. After all, ``ElegantSpring`` is just a ``Curve``.\n\nHowever, if you don't want your animation to feel too fast or too slow, it is recommended to use the ``recommendedDuration``.\nIt is calculated based on the ``bounce`` parameter, and it's approximately equal to the time it takes the spring to \"settle\" at the final point.\n\n### Credits\nThis package is inspired by [sprung](https://pub.dev/packages/sprung) package and [SwiftUI's Spring API](https://developer.apple.com/documentation/swiftui/spring).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fercantomac%2Felegant_spring_animation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fercantomac%2Felegant_spring_animation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fercantomac%2Felegant_spring_animation/lists"}