{"id":25974341,"url":"https://github.com/gianmen91/widgetbook_setup_script","last_synced_at":"2026-04-07T16:31:16.307Z","repository":{"id":280507827,"uuid":"942235404","full_name":"GianMen91/widgetbook_setup_script","owner":"GianMen91","description":"Automates the integration of Widgetbook into your Flutter project by adding Widgetbook to your project and generating Widgetbook use-cases for all widgets in the project’s `lib` directory.","archived":false,"fork":false,"pushed_at":"2025-03-03T19:59:07.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T20:34:35.912Z","etag":null,"topics":["bash","bash-script","flutter","widgetbook"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GianMen91.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-03-03T19:41:26.000Z","updated_at":"2025-03-03T20:00:04.000Z","dependencies_parsed_at":"2025-03-03T20:44:52.360Z","dependency_job_id":null,"html_url":"https://github.com/GianMen91/widgetbook_setup_script","commit_stats":null,"previous_names":["gianmen91/widgetbook_setup_script"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianMen91%2Fwidgetbook_setup_script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianMen91%2Fwidgetbook_setup_script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianMen91%2Fwidgetbook_setup_script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GianMen91%2Fwidgetbook_setup_script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GianMen91","download_url":"https://codeload.github.com/GianMen91/widgetbook_setup_script/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241951227,"owners_count":20047784,"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":["bash","bash-script","flutter","widgetbook"],"created_at":"2025-03-05T02:22:57.060Z","updated_at":"2025-12-02T19:01:56.020Z","avatar_url":"https://github.com/GianMen91.png","language":"Shell","funding_links":["https://www.buymeacoffee.com/giancarlo.mennillo"],"categories":[],"sub_categories":[],"readme":"# 📖 Widgetbook Setup Script  \n\n[![License](https://img.shields.io/github/license/GianMen91/widgetbook_setup_script)](https://github.com/GianMen91/widgetbook_setup_script/blob/master/LICENSE)\n[![Version](https://img.shields.io/github/v/release/GianMen91/widgetbook_setup_script)](https://github.com/GianMen91/widgetbook_setup_script/releases)\n[![Last Commit](https://img.shields.io/github/last-commit/GianMen91/widgetbook_setup_script)](https://github.com/GianMen91/widgetbook_setup_script/commits)\n\n## Overview  \nThis script automates the integration of [Widgetbook](https://widgetbook.io/) into your Flutter project. It scans your `lib` directory for all widgets (`StatelessWidget` and `StatefulWidget`) and generates corresponding Widgetbook use-cases, allowing you to preview them interactively.  \n\n## Features  \n- ✅ Automates the setup of a Widgetbook project within a 'widgetbook' directory, streamlining the steps outlined in the Widgetbook [Quick Start Guide](https://docs.widgetbook.io/guides/quick-start).\n- ✅ Scans your Flutter project's `lib` directory for all widgets.  \n- ✅ Generates use-cases for each widget and saves them in `widgetbook/lib`, preserving the original directory structure.  \n- ✅ Runs `build_runner` to generate the required `main.directories.g.dart` file.\n\n## Usage  \n\n### Option 1\n\nYou can use curl to download and execute the script in one command:\n\n```sh\ncurl -s https://raw.githubusercontent.com/GianMen91/widgetbook_setup_script/main/widgetbook_setup.sh | bash\n```\n\n- `curl -s` fetches the script silently.\n- The `| bash` part pipes it directly into a new Bash process.\n\n### Option 2\n1. Place the script in the root directory of your Flutter project (same level as `lib`, `pubspec.yaml`, etc.).  \n2. Open a terminal in the project root.  \n3. Run the script:\n\n```sh\nbash widgetbook_setup.sh\n```\n\n# Running Widgetbook\n\n1. Once the script is finished and the setup is complete, navigate to the widgetbook directory:\n\n ```sh\n cd widgetbook  \n ```\n\n2. Run the following command to generate the necessary files:\n\n```sh\ndart run build_runner build\n```   \n\n3. Now, start Widgetbook using:\n   \n```sh\nflutter run\n```\n\n# ⚠️ Important Notice  \n\nDuring setup, you might see messages about **version conflicts** or **dependency issues**. This happens when some packages in your project require different versions to work together.  \n\n## 🔍 What does this mean?  \n- If you see a message like _\"Version solving failed\"_, it means some dependencies need to be adjusted.  \n- The error message usually suggests a fix (e.g., changing a package version).  \n\n## ✅ How to Fix It  \n1. Check the error message for suggested version changes.  \n2. If a solution is provided (e.g., updating a package version), run the suggested command.  \n3. If no suggestion is given, try running:\n   \n   ```sh\n   flutter pub upgrade --major-versions\n    ```\n4. If the issue persists, manually adjust dependency versions in `pubspec.yaml` and then run:\n   \n   ```sh\n   flutter pub get\n   ```\n\n# Contributing\n\nContributions from users are highly valued and appreciated. Two main ways to contribute to this project are through pull requests and issues.\n\n## Pull Requests\n\n1. Fork the repository and create a branch from the `main` branch.\n2. Make changes or additions to the code.\n3. Commit the changes, and push them to the branch.\n4. Open a pull request to the `main` branch with a clear and concise description of the changes.\n\n## Issues\n\n1. Navigate to the [Issues](https://github.com/GianMen91/gitlab-statistics/issues) section of the repository.\n2. Check if there is an existing issue similar to the one you'd like to create.\n3. If there isn't an existing issue, create a new issue by clicking the \"New issue\" button.\n4. Provide a descriptive title and detailed information about the proposed changes you want to add to the current script.\n\n---\n\nFeel free to contribute and share\n\n# License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n# Buy me a coffee\n\n\u003ca href=\"https://www.buymeacoffee.com/giancarlo.mennillo\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgianmen91%2Fwidgetbook_setup_script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgianmen91%2Fwidgetbook_setup_script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgianmen91%2Fwidgetbook_setup_script/lists"}