{"id":13550368,"url":"https://github.com/letsar/local_hero","last_synced_at":"2025-04-06T16:12:46.620Z","repository":{"id":41502534,"uuid":"276688661","full_name":"letsar/local_hero","owner":"letsar","description":"A widget which implicitly launches a hero animation when its position changed within the same route.","archived":false,"fork":false,"pushed_at":"2024-06-29T15:53:04.000Z","size":4691,"stargazers_count":212,"open_issues_count":13,"forks_count":49,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T13:09:57.328Z","etag":null,"topics":["flutter","flutter-package","flutter-ui","flutter-widget"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/letsar.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-02T15:56:36.000Z","updated_at":"2025-02-12T06:43:28.000Z","dependencies_parsed_at":"2024-03-16T22:58:49.681Z","dependency_job_id":"06ec6269-4c74-47a2-947a-4035025342ae","html_url":"https://github.com/letsar/local_hero","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsar%2Flocal_hero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsar%2Flocal_hero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsar%2Flocal_hero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letsar%2Flocal_hero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letsar","download_url":"https://codeload.github.com/letsar/local_hero/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509235,"owners_count":20950232,"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":["flutter","flutter-package","flutter-ui","flutter-widget"],"created_at":"2024-08-01T12:01:32.261Z","updated_at":"2025-04-06T16:12:46.593Z","avatar_url":"https://github.com/letsar.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"# local_hero\n\n[![Pub][pub_badge]][pub]\n\nA widget which implicitly launches a hero animation when its position changed within the same route.\n\n![Overview][overview]\n\n## Getting started\n\nIn the `pubspec.yaml` of your flutter project, add the following dependency:\n\n```yaml\ndependencies:\n  ...\n  local_hero:\n```\n\nIn your library add the following import:\n\n```dart\nimport 'package:local_hero/local_hero.dart';\n```\n\n## Usage\n\nTo be animated implicitly, a widget needs to be surrounded by a `LocalHero` widget with a unique `tag`:\n\n```dart\nconst LocalHero(\n    tag: 'my_widget_tag',\n    child: MyWidget(),\n),\n```\n\nA `LocalHero` widget must have a `LocalHeroScope` ancestor which hosts the animations properties (duration, curve, etc.).\nAt each frame we must have only one `LocalHero` per tag, per `LocalHeroScope`.\n\nThe following example shows the basic usage of a `LocalHero` widget:\n\n```dart\nclass _LocalHeroPage extends StatelessWidget {\n  const _LocalHeroPage({\n    Key key,\n  }) : super(key: key);\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      body: SafeArea(\n        child: LocalHeroScope(\n          duration: const Duration(milliseconds: 300),\n          curve: Curves.easeInOut,\n          child: const _LocalHeroPlayground(),\n        ),\n      ),\n    );\n  }\n}\n\nclass _LocalHeroPlayground extends StatefulWidget {\n  const _LocalHeroPlayground({\n    Key key,\n  }) : super(key: key);\n\n  @override\n  _LocalHeroPlaygroundState createState() =\u003e _LocalHeroPlaygroundState();\n}\n\nclass _LocalHeroPlaygroundState extends State\u003c_LocalHeroPlayground\u003e {\n  AlignmentGeometry alignment = Alignment.topLeft;\n\n  @override\n  Widget build(BuildContext context) {\n    return Column(\n      children: \u003cWidget\u003e[\n        Expanded(\n          child: Padding(\n            padding: const EdgeInsets.all(8),\n            child: Align(\n              alignment: alignment,\n              child: const LocalHero(\n                tag: 'id',\n                child: _Box(),\n              ),\n            ),\n          ),\n        ),\n        RaisedButton(\n          onPressed: () {\n            setState(() {\n              alignment = alignment == Alignment.topLeft\n                  ? Alignment.bottomRight\n                  : Alignment.topLeft;\n            });\n          },\n          child: const Text('Move'),\n        ),\n      ],\n    );\n  }\n}\n\nclass _Box extends StatelessWidget {\n  const _Box({\n    Key key,\n  }) : super(key: key);\n\n  @override\n  Widget build(BuildContext context) {\n    return Container(\n      color: Colors.red,\n      width: 50,\n      height: 50,\n    );\n  }\n}\n```\n\n![Example][example]\n\n## Sponsoring\n\nI'm working on my packages on my free-time, but I don't have as much time as I would. If 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.\n\n## Changelog\n\nPlease see the [Changelog][changelog] page to know what's recently changed.\n\n## Contributions\n\nFeel free to contribute to this project.\n\nIf you find a bug or want a feature, but don't know how to fix/implement it, please fill an [issue][issue].  \nIf you fixed a bug or implemented a feature, please send a [pull request][pr].\n\n\u003c!--Links--\u003e\n[pub_badge]: https://img.shields.io/pub/v/local_hero.svg\n[pub]: https://pub.dartlang.org/packages/local_hero\n[changelog]: https://github.com/letsar/local_hero/blob/master/CHANGELOG.md\n[issue]: https://github.com/letsar/local_hero/issues\n[pr]: https://github.com/letsar/local_hero/pulls\n[example]: https://raw.githubusercontent.com/letsar/local_hero/master/packages/images/local_hero.gif\n[overview]: https://raw.githubusercontent.com/letsar/local_hero/master/packages/images/local_hero_02.gif\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsar%2Flocal_hero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletsar%2Flocal_hero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletsar%2Flocal_hero/lists"}