{"id":19581646,"url":"https://github.com/hathibelagal-dev/path_morph_for_flutter","last_synced_at":"2025-09-29T07:32:16.253Z","repository":{"id":34159362,"uuid":"170817535","full_name":"hathibelagal-dev/path_morph_for_flutter","owner":"hathibelagal-dev","description":"This is a Flutter package that lets you smoothly morph one path into another.","archived":false,"fork":false,"pushed_at":"2023-05-20T21:01:05.000Z","size":1138,"stargazers_count":39,"open_issues_count":1,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-29T07:31:56.471Z","etag":null,"topics":["animation","flutter","path"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/path_morph","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hathibelagal-dev.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":"2019-02-15T07:04:31.000Z","updated_at":"2025-01-29T00:25:06.000Z","dependencies_parsed_at":"2024-11-11T07:37:42.221Z","dependency_job_id":"c488e725-d0d5-4393-9bb2-342ec87e8040","html_url":"https://github.com/hathibelagal-dev/path_morph_for_flutter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hathibelagal-dev/path_morph_for_flutter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hathibelagal-dev%2Fpath_morph_for_flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hathibelagal-dev%2Fpath_morph_for_flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hathibelagal-dev%2Fpath_morph_for_flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hathibelagal-dev%2Fpath_morph_for_flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hathibelagal-dev","download_url":"https://codeload.github.com/hathibelagal-dev/path_morph_for_flutter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hathibelagal-dev%2Fpath_morph_for_flutter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277483275,"owners_count":25825559,"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-09-29T02:00:09.175Z","response_time":84,"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":["animation","flutter","path"],"created_at":"2024-11-11T07:37:30.691Z","updated_at":"2025-09-29T07:32:16.222Z","avatar_url":"https://github.com/hathibelagal-dev.png","language":"C++","readme":"# Path Morph\n\nThis is a pure Dart package that lets you smoothly morph one Flutter `Path` object into another. You can think of this as a path tween animation. The idea is to take two paths, a source path and a destination path, and smoothly move the points of the source path until it looks exactly like the destination path.\n\n![](https://raw.githubusercontent.com/hathibelagal-dev/path_morph_for_flutter/master/example.gif)\n\n## Usage\n\nFirst you need to sample two paths using the `PathMorph.samplePaths()` method, which returns a `SampledPathData` object.\n\n```\nSampledPathData data = PathMorph.samplePaths(path1, path2);\n```\n\nThen you call the `PathMorph.generateAnimations()` method to create an animation for every point in the path. This method needs an `AnimationController` object and a `SampledPathData` object as arguments. Additionally, it expects you to pass a function to it, one that takes two arguments itself. In the body of the function, you must call `setState()` and update the value of the `shiftedPoints` list, which is present in the `SampledPathData` object.\n\n```\nAnimationController controller = AnimationController(vsync: this,\n                                    duration: Duration(seconds: 1));\n\nPathMorph.generateAnimations(controller, data, (i,z) {\n    setState((){\n      data.shiftedPoints[i] = z;\n    });\n});\n```\n\nLastly, while rendering the morph animation, you can call the `PathMorph.generatePath()` method and pass the `shiftedPoints` list to it. This returns a `Path` object you can draw on your canvas. If you are using a `CustomPainter` object, you'll want to pass the path as an argument to it.\n\n```\n@override\nWidget build(BuildContext context) {\n    return CustomPaint(painter: MyPainter(PathMorph.generatePath(data)));\n}\n```\n\nDo take a look at the example project to get a better idea.\n\n## Important\n\nThis package currently allows you to morph two paths only if they both have an equal number of contours. You can think of a contour as a line you can draw without lifting the pen. For example, the path to draw a triangle, a circle, or a square has one contour only. But a path to draw two concentric circles will have two contours.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhathibelagal-dev%2Fpath_morph_for_flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhathibelagal-dev%2Fpath_morph_for_flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhathibelagal-dev%2Fpath_morph_for_flutter/lists"}