{"id":18107206,"url":"https://github.com/sergiandreplace/flutter_rough","last_synced_at":"2025-04-13T21:51:54.793Z","repository":{"id":45206345,"uuid":"260513636","full_name":"sergiandreplace/flutter_rough","owner":"sergiandreplace","description":"A Flutter implementation of the rough.js library","archived":false,"fork":false,"pushed_at":"2021-12-31T13:12:40.000Z","size":897,"stargazers_count":89,"open_issues_count":5,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T12:12:26.649Z","etag":null,"topics":["art","dart","drawing","flutter","flutter-lib","rough"],"latest_commit_sha":null,"homepage":null,"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/sergiandreplace.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}},"created_at":"2020-05-01T17:05:44.000Z","updated_at":"2025-03-03T15:53:56.000Z","dependencies_parsed_at":"2022-09-13T08:50:16.685Z","dependency_job_id":null,"html_url":"https://github.com/sergiandreplace/flutter_rough","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/sergiandreplace%2Fflutter_rough","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiandreplace%2Fflutter_rough/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiandreplace%2Fflutter_rough/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sergiandreplace%2Fflutter_rough/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sergiandreplace","download_url":"https://codeload.github.com/sergiandreplace/flutter_rough/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788865,"owners_count":21161726,"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":["art","dart","drawing","flutter","flutter-lib","rough"],"created_at":"2024-10-31T23:09:53.739Z","updated_at":"2025-04-13T21:51:54.773Z","avatar_url":"https://github.com/sergiandreplace.png","language":"Dart","readme":"[![Pub](https://img.shields.io/pub/v/rough?label=latest%20version)](https://pub.dev/packages/rough)\n[![GitHub Release Date](https://img.shields.io/github/release-date/sergiandreplace/flutter_rough)](https://pub.dev/packages/rough)\n[![GitHub](https://img.shields.io/github/license/sergiandreplace/flutter_rough)](https://github.com/sergiandreplace/flutter_rough/blob/master/LICENSE)\n\n# Rough\n\nRough is a library that allows you draw in a sketchy, hand-drawn-like style. It's a direct port of [Rough.js](https://roughjs.com/).\n\n## Installation\n\nIn the `dependencies:` section of your `pubspec.yaml`, add the following line:\n\n```yaml\ndependencies:\n  rough: \u003clatest_version\u003e\n```\n## Basic usage\n\nRight now only drawing via canvas is supported. This is a basic documentation in case you want to play around with Rough. I can't ensure non-breaking changes of the library interface.\n\nTo draw a figure you have to:\n\n1. Create a `DrawConfig` object to determine how your drawing will look.\n2. Create a `Filler` to be used when drawing objects (you have to provide a configuration for the filling and a `DrawConfig` for the filling path).\n3. Create a `Generator` object using the created `DrawConfig` and `Filler`. This will define a drawing/filling style.\n4. Invoke the drawing method from the `Generator` to create a `Drawable`.\n5. Paint the `Drawable` in the canvas using the `drawRough` method extension for `Canvas`.\n\nHere an example on how to draw a circle:\n\n```dart\n//Create a `DrawConfig` object.\nDrawConfig myDrawConfig = DrawConfig.build(\n  roughness: 3,\n  curveStepCount: 14,\n  maxRandomnessOffset: 3,\n);\n\n//Create a `Filler` with a configuration (we reuse the drawConfig in this case).\nFillerConfig myFillerConfig = FillerConfig(\n    hachureGap: 8,\n    hachureAngle: -20,\n    drawConfig: myDrawConfig,\n);\nFiller myFiller = ZigZagFiller(myFillerConfig);\n\n//Create a `Generator` with the created `DrawConfig` and `Filler`\nGenerator generator = Generator(\n  myDrawConfig,\n  myFiller,\n);\n\n//4. Build a circle `Drawable`.\nDrawable figure = generator.circle(200, 200, 320);\n\n//5. Paint the `Drawable` in the canvas.\nCanvas.drawRough(figure, pathPaint, fillPaint);\n```\n\nAnd this is the result:\n\n![Result](https://raw.githubusercontent.com/sergiandreplace/flutter_rough/master/screenshots/circle.png)\n\nBoth `DrawConfig` and `FillerConfig` will use default values for anything not specified.\n\n## Samples\n\nSome screenshots of the example app:\n\n\n![Example 1](https://raw.githubusercontent.com/sergiandreplace/flutter_rough/master/screenshots/example_app_1.jpg)\n![Example 2](https://raw.githubusercontent.com/sergiandreplace/flutter_rough/master/screenshots/example_app_2.jpg)\n![Example 3](https://raw.githubusercontent.com/sergiandreplace/flutter_rough/master/screenshots/example_app_3.jpg)\n![Example 4](https://raw.githubusercontent.com/sergiandreplace/flutter_rough/master/screenshots/example_app_4.jpg)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergiandreplace%2Fflutter_rough","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsergiandreplace%2Fflutter_rough","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsergiandreplace%2Fflutter_rough/lists"}