{"id":13552349,"url":"https://github.com/leancodepl/dashed_line","last_synced_at":"2025-04-11T23:31:02.999Z","repository":{"id":45889224,"uuid":"353975073","full_name":"leancodepl/dashed_line","owner":"leancodepl","description":"Draw dashed lines with any shape and style you want. Just like that.","archived":false,"fork":false,"pushed_at":"2023-12-01T23:00:02.000Z","size":332,"stargazers_count":24,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-25T19:21:15.372Z","etag":null,"topics":["flutter","ui-components"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/dashed_line","language":"Dart","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/leancodepl.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":"2021-04-02T09:45:13.000Z","updated_at":"2024-10-11T03:12:05.000Z","dependencies_parsed_at":"2024-08-01T12:20:35.784Z","dependency_job_id":"152993bf-ef2c-44a5-8b1b-65d9774eb668","html_url":"https://github.com/leancodepl/dashed_line","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leancodepl%2Fdashed_line","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leancodepl%2Fdashed_line/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leancodepl%2Fdashed_line/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leancodepl%2Fdashed_line/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leancodepl","download_url":"https://codeload.github.com/leancodepl/dashed_line/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248494762,"owners_count":21113494,"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","ui-components"],"created_at":"2024-08-01T12:02:02.583Z","updated_at":"2025-04-11T23:31:02.966Z","avatar_url":"https://github.com/leancodepl.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# dashed_line\n\n[![pub.dev][pub-badge]][pub-link] [![build status][build-badge]][build-link]\n\n\u003c/div\u003e\n\n![][underheader]\n\nDraw dashed lines with any shape and style you want. Just like that.\n\n## Usage\n\nAdd the dependency to your `pubspec.yaml` (you can see the newest version in the pub badge):\n\n```yaml\ndependencies:\n  dashed_line: ^0.1.0\n```\n\nUse the widget:\n\n```dart\nimport 'package:dashed_line/dashed_line.dart';\n\n// ...\n\nDashedLine(\n  path: Path()..cubicTo(-40, 53, 14, 86, 61, 102),\n  color: Colors.red,\n)\n```\n\n...you can also use the SVG path commands instead of a `Path`:\n\n```dart\nDashedLine.svgPath(\n  'C -40 53 14 86 61 102',\n  color: Colors.red,\n)\n```\n\n## Where to obtain path methods/commands?\n\nThere are many ways.\n\nYou can construct the path yourself using the [`Path` methods][path-methods] like [`lineTo`][path-lineto] or [`cubicTo`][path-cubicto].\n\nYou can also use the [path commands][svg-commands] used in the `d` attribute of SVG files. You can do this manually or via export from one of the vector graphics software, like [Inkscape][inkscape] or [Figma][figma]. We found [SvgPathEditor][svgpatheditor] quite useful too.\n\n### Example: Exporting path commands from Figma\n\n|               First step              |             Second step            |\n|:-------------------------------------:|:----------------------------------:|\n| ![Create path using pen][figma-step1] | ![Export path as SVG][figma-step2] |\n\nAnd now we have an SVG in the clipboard:\n\n```svg\n\u003csvg width=\"190\" height=\"48\" viewBox=\"0 0 190 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"\u003e\n  \u003cpath d=\"M1 16C73 79 100 3 121 0.999997C142 -1 214.5 11.5 179 47\" stroke=\"black\"/\u003e\n\u003c/svg\u003e\n```\n\nFrom here we can just copy the value of the `path`'s `d` attribute and use for the `DashedLine.svgPath` constructor's first argument.\n\n## 🚨 Note about paths\n\nDue to how `Path`s work in Flutter and Skia, the `DashedLine` widget takes NOT as much space as the dashed line needs, but as much it needs to contain all the [control points][control-points]. Table below should help understand the problem.\n\n| Path commands                 |          Path          |          Result line          |\n|-------------------------------|:----------------------:|:-----------------------------:|\n| ``` C 8 63 14 86 61 102 ```   | ![][path-inside-bbox]  | ![][path-inside-bbox-result]  |\n| ``` C -40 53 14 86 61 102 ``` | ![][path-outside-bbox] | ![][path-outside-bbox-result] |\n\n## License\n\nSee [`LICENSE`][license].\n\n[underheader]: https://raw.githubusercontent.com/leancodepl/dashed_line/main/art/underheader.png\n[pub-badge]: https://img.shields.io/pub/v/dashed_line\n[pub-link]: https://pub.dev/packages/dashed_line\n[build-badge]: https://img.shields.io/github/actions/workflow/status/leancodepl/dashed_line/test.yml?branch=main\n[build-link]: https://github.com/leancodepl/dashed_line/actions/workflows/test.yml\n\n[path-methods]: https://api.flutter.dev/flutter/dart-ui/Path-class.html\n[path-lineto]: https://api.flutter.dev/flutter/dart-ui/Path/lineTo.html\n[path-cubicto]: https://api.flutter.dev/flutter/dart-ui/Path/cubicTo.html\n[svg-commands]: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d\n[inkscape]: https://inkscape.org/\n[figma]: https://www.figma.com/\n[svgpatheditor]: https://yqnn.github.io/svg-path-editor/\n\n[figma-step1]: https://raw.githubusercontent.com/leancodepl/dashed_line/main/art/figma-step1.png\n[figma-step2]: https://raw.githubusercontent.com/leancodepl/dashed_line/main/art/figma-step2.png\n\n[control-points]: https://en.wikipedia.org/wiki/Control_point_(mathematics)\n[path-inside-bbox]: https://raw.githubusercontent.com/leancodepl/dashed_line/main/art/path-inside-bbox.png\n[path-inside-bbox-result]: https://raw.githubusercontent.com/leancodepl/dashed_line/main/art/path-inside-bbox-result.png\n[path-outside-bbox]: https://raw.githubusercontent.com/leancodepl/dashed_line/main/art/path-outside-bbox.png\n[path-outside-bbox-result]: https://raw.githubusercontent.com/leancodepl/dashed_line/main/art/path-outside-bbox-result.png\n\n[license]: LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleancodepl%2Fdashed_line","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleancodepl%2Fdashed_line","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleancodepl%2Fdashed_line/lists"}