{"id":13551119,"url":"https://github.com/flutter/assets-for-api-docs","last_synced_at":"2025-04-12T14:20:18.995Z","repository":{"id":37549310,"uuid":"87467330","full_name":"flutter/assets-for-api-docs","owner":"flutter","description":"Static assets for embedding into docs.flutter.io","archived":false,"fork":false,"pushed_at":"2024-12-09T16:55:54.000Z","size":273640,"stargazers_count":124,"open_issues_count":0,"forks_count":107,"subscribers_count":77,"default_branch":"main","last_synced_at":"2025-04-12T14:20:00.403Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flutter.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-04-06T19:31:50.000Z","updated_at":"2025-04-04T02:23:59.000Z","dependencies_parsed_at":"2023-01-28T03:15:20.177Z","dependency_job_id":"e79eaf20-0547-412e-af7c-c6915a6cf9de","html_url":"https://github.com/flutter/assets-for-api-docs","commit_stats":{"total_commits":286,"total_committers":49,"mean_commits":5.836734693877551,"dds":0.7377622377622377,"last_synced_commit":"6baeff6d12034aa922060f4723aaee29fc5217e4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flutter%2Fassets-for-api-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flutter%2Fassets-for-api-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flutter%2Fassets-for-api-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flutter%2Fassets-for-api-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flutter","download_url":"https://codeload.github.com/flutter/assets-for-api-docs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578875,"owners_count":21127714,"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-08-01T12:01:42.697Z","updated_at":"2025-04-12T14:20:18.968Z","avatar_url":"https://github.com/flutter.png","language":"Dart","readme":"# assets-for-api-docs\n\nThis repo is used to host and serve static assets in support of\n[docs.flutter.dev](https://docs.flutter.dev), as well as some manual tests that use\nspecially-crafted graphics.\n\nAssets committed to this repo and pushed to GitHub are immediately\navailable for linking and reference.\n\n## Adding new assets\n\nIn accordance with the [Flutter style guide](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#provide-illustrations-diagrams-or-screenshots),\nassets submitted to this repository should be easily reproducible, e.g. by\nrunning a Flutter app or a script. This makes it easier to update the asset in\nthe future, if needed. Check the existing diagrams (and their generation code)\nin this repository to see examples. Avoid checking in just a static image file\n(e.g. PNG, JPEG), without a way to regenerate and update it.\n\n## Creating new diagrams\n\nTo create a new diagram:\n\n1. Create a new Dart file inside `/packages/diagrams/lib/src/`.\n\n2. Export that file from `/packages/diagrams/lib/diagrams.dart`.\n\n3. Create one or more diagram widgets that mix-in `DiagramMetadata`, overriding the `name` getter to return their name,\n   which should be lower_snake_case.\n\n    * If your diagram is animated, override the `duration` getter to return the duration of the animation.\n\n    * If your diagram's state needs to wait imperatively, mix-in `LockstepStateMixin` and call `waitLockstep(duration)`.\n\n    * If your diagram needs simulated gesture input, acquire a [WidgetController](https://api.flutter.dev/flutter/flutter_test/WidgetController-class.html)\n      by calling `DiagramWidgetController.of(context)`.\n\n4. Create a class that extends `DiagramStep`.\n\n5. Override the `diagrams` getter of `DiagramStep` to return a list containing the new diagrams.\n\n6. Override the `category` getter of `DiagramStep` to return the category it belongs in, this corresponds to the folders\n   under `/assets`.\n\n7. Add your new `DiagramStep` to the list in `packages/diagrams/lib/src/steps.dart`, sorted alphabetically.\n\n8. Generate assets with `bin/generate -s MyDiagramStep`, for more options see the [generation](#Generation) section.\n\n## URL structure\n\nReference the assets with this URL structure:\n\n`https://flutter.github.io/assets-for-api-docs/assets/\u003clibrary\u003e/\u003casset\u003e`\n\nFor example, an image named `app_bar.png` about `AppBar` from the\nmaterial library would go in the `assets/material/` directory and be at\n`https://flutter.github.io/assets-for-api-docs/assets/material/app_bar.png`.\n\nAll asset files should be under the `assets` directory in an appropriate\nsubdirectory.\n\n## Generation\n\nImages must be code-generated.\n\nTo create new images, see the [`packages/diagrams/lib/src/`](./packages/diagrams/lib/src/) directory.\n\nThe [`generate.dart`](./bin/generate.dart) script regenerates almost all of existing assets\nusing the Flutter version you have installed. A small wrapper [`bin/generate`](./bin/generate)\n([`bin\\generate.bat`](./bin/generate.bat) on Windows)\nis provided as a convenience.\n\nTo limit image generation to certain categories and/or names, run:\n```sh\n# Filter by category\nbin/generate -c cupertino,material\n# Filter by name\nbin/generate -n basic_material_app,blend_mode\n# Filter by step class name\nbin/generate -s MaterialAppDiagramStep,BlendModeDiagramStep\n```\n\n`bin/generate --help` lists available arguments.\n\n### Prerequisites\n\nThe `generate.dart` script works on macOS, Linux, and Windows, but it needs several prerequisites in order to run. On\nLinux and macOS run `bin/generate`. On Windows, run `bin\\generate.bat`.\n\nTo optimize PNG files, it needs `optipng`, which is available for macOS via Homebrew, and Linux via\napt-get, and Windows from the [optipng website](http://optipng.sourceforge.net/).\n\nTo convert animations into mp4 files, it needs `ffmpeg`, available for macOS via Homebrew and Linux\nvia apt-get, and for Windows from the [FFMPEG website](https://ffmpeg.org/download.html).\n\nBoth `optipng` and `ffmpeg` need to be in your path when you run the generate script.\n\nThe commands `flutter`, `dart`, and (when using an Android device) `adb` need to be available\nin a directory in the `PATH` environment variable (e.g. `PATH=~/\u003cpath_to_flutter\u003e/flutter/bin/cache/dart-sdk/bin:~/Android/Sdk/platform-tools:$PATH`).\nThe script needs the most recent development version of Flutter and is _not_ intended to work with released Flutter versions.\n\nWhen using an Android device, be sure that the  `adb` command is the same as the one running\nas a server (which is often started by your IDE, so use the same `adb` the IDE is running).\n\nYou cannot currently generate docs on an iOS device (although you can generate them on macOS).\n\n## Optimization\n\nPlease consider optimization tools for assets.\n\nFor PNGs, we recommend `optipng`, using the following command line:\n\n```bash\noptipng -zc1-9 -zm1-9 -zs0-3 -f0-5 *.png\n```\n\nBe careful about applying this aggressively. In particular, files in\nthe `assets/tests` directory should not be optimized.\n\nThe automatic generation tool will automatically apply optimization to\nthe assets it generates.\n\n## Issues\n\nPlease file any issues in the [main flutter repo](https://github.com/flutter/flutter/issues/new).\n\n## Origin of third-party content\n\n* `/assets/audio/rooster.mp3`: CC0 Creative Commons, from [https://pixabay.com/sound-effects/rooster-crowing-7027/](https://pixabay.com/sound-effects/rooster-crowing-7027/)\n* `/assets/videos/bee.mp4`: CC0 Creative Commons, from [https://pixabay.com/en/videos/honey-bee-insect-bee-flower-flying-211/](https://pixabay.com/en/videos/honey-bee-insect-bee-flower-flying-211/)\n* `/assets/videos/butterfly.mp4`: CC0 Creative Commons, from [https://pixabay.com/en/videos/butterfly-flower-insect-nature-209/](https://pixabay.com/en/videos/butterfly-flower-insect-nature-209/)\n* Also see the license information for [images used in the diagrams](packages/diagrams/assets/README.md)\n","funding_links":[],"categories":["Dart"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflutter%2Fassets-for-api-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflutter%2Fassets-for-api-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflutter%2Fassets-for-api-docs/lists"}