Conversation
This PR implements a Mason-based template for SolidUI applications. It includes: - A new templates/solidui/brick directory with the template files. - Replacing hardcoded values with Mason variables. - A mason.yaml file to register the brick. - A sync script support/sync_template_to_example.py to keep the example app in sync with the template. - Updated README.md with instructions on how to use the template with Mason. Closes anusii#104
Updated deleteFile() calls to use positional argument for fileUrl, matching the latest solidpod API. Also excluded templates from analysis to avoid false positives. Closes anusii#207
There was a problem hiding this comment.
Pull request overview
This PR primarily addresses Issue #207 by updating SolidUI’s file deletion calls to match the updated solidpod API (removing the obsolete named parameter). It also introduces a Mason brick template for generating a SolidUI starter app and updates repo tooling/docs to support the template.
Changes:
- Update
deleteFile(fileUrl: ...)calls todeleteFile(...)to match the newsolidpodsignature. - Add a Mason brick under
templates/solidui/brickplus a contributor sync script to keepexample/in sync. - Update documentation and static analysis configuration (including excluding
templates/**from analysis).
Reviewed changes
Copilot reviewed 19 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/widgets/solid_file_operations.dart | Updates delete call to new solidpod deleteFile signature. |
| lib/src/utils/solid_file_operations_delete.dart | Updates delete call to new solidpod deleteFile signature. |
| analysis_options.yaml | Excludes templates/** from analyzer runs. |
| README.md | Documents Mason-based app creation and template syncing workflow. |
| mason.yaml | Registers the local solidui brick for Mason usage. |
| support/sync_template_to_example.py | Adds script to generate from Mason brick and copy output into example/. |
| templates/solidui/brick/brick.yaml | Defines the Mason brick and its variables. |
| templates/solidui/brick/brick/pubspec.yaml | Template app pubspec for generated projects. |
| templates/solidui/brick/brick/analysis_options.yaml | Template app lint configuration. |
| templates/solidui/brick/brick/README.md | Template app README. |
| templates/solidui/brick/brick/.gitignore | Template app gitignore. |
| templates/solidui/brick/brick/lib/main.dart | Template app entrypoint with desktop window setup. |
| templates/solidui/brick/brick/lib/app.dart | Template root widget wiring SolidThemeApp + SolidLogin. |
| templates/solidui/brick/brick/lib/app_scaffold.dart | Template scaffold demonstrating SolidScaffold configuration. |
| templates/solidui/brick/brick/lib/home.dart | Template home screen content. |
| templates/solidui/brick/brick/lib/constants/app.dart | Template constants using Mason variables. |
| templates/solidui/brick/brick/lib/utils/is_desktop.dart | Template helper for desktop platform detection. |
| templates/solidui/brick/brick/lib/screens/sample_page.dart | Template sample page demonstrating navigation behavior. |
| templates/solidui/brick/brick/lib/screens/all_pod_files_page.dart | Template page for browsing POD root. |
| templates/solidui/brick/brick/assets/images/app_icon.png | Adds template app icon asset. |
| templates/solidui/brick/brick/lib/home.dart.old | Adds an “old” home file (currently appears corrupted/binary). |
| example/lib/home.dart.old | Adds an “old” home file in example (currently appears corrupted/binary). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # 3. Copy generated files back to example | ||
| # Generated files are usually lib/, assets/, pubspec.yaml, etc. | ||
| gen_content_dir = os.path.join(temp_gen_dir) # mason make -o temp_gen_dir puts files directly there | ||
|
|
||
| for item in os.listdir(gen_content_dir): | ||
| s = os.path.join(gen_content_dir, item) | ||
| d = os.path.join(example_dir, item) | ||
| if os.path.isdir(s): | ||
| if os.path.exists(d): | ||
| shutil.rmtree(d) | ||
| shutil.copytree(s, d) | ||
| print(f"Updated directory: {item}") | ||
| else: | ||
| shutil.copy2(s, d) | ||
| print(f"Updated file: {item}") |
There was a problem hiding this comment.
This sync script copies the generated template files directly into example/, which will overwrite example/pubspec.yaml. The template pubspec currently depends on solidui from pub (solidui: ^...), while the repo example uses a path: .. dependency to test local changes. The script should preserve/patch the example's dependency setup (and any overrides) so running it doesn't break local development of the example app.
| 3. Add the SolidUI brick: | ||
| ```bash | ||
| mason add solidui --path templates/solidui/brick | ||
| ``` |
There was a problem hiding this comment.
README instructions use mason add solidui --path templates/solidui/brick, which will only work if the user has this repo checked out and the template directory is present. For end users starting a new project, document a mason add command that pulls the brick from a git URL (or a published brick), or explicitly state they must clone/vendor the template directory first.
| 3. Add the SolidUI brick: | |
| ```bash | |
| mason add solidui --path templates/solidui/brick | |
| ``` | |
| 3. Add the SolidUI brick (choose one of the following): | |
| - **Recommended (no local clone required):** | |
| ```bash | |
| mason add solidui -g https://github.com/anusii/solidui --path templates/solidui/brick | |
| ``` | |
| - **Using a local checkout of this repository:** | |
| Make sure you have cloned this repository and are running the command from its root directory: | |
| ```bash | |
| mason add solidui --path templates/solidui/brick | |
| ``` |
README.md
Outdated
|
|
||
| To create a new Solid-based app using `solidui` named `myapp` and | ||
| published by `example.com` begin with: | ||
| To quickly create a new Solid-based app, we provide a [Mason](https://pub.dev/packages/mason) template. |
There was a problem hiding this comment.
There is trailing whitespace at the end of this line, which can trip markdown linting rules (e.g., MD009) in CI. Remove the trailing space.
| To quickly create a new Solid-based app, we provide a [Mason](https://pub.dev/packages/mason) template. | |
| To quickly create a new Solid-based app, we provide a [Mason](https://pub.dev/packages/mason) template. |
| exclude: | ||
| - ignore/** | ||
| - ignore/ | ||
| - templates/** |
There was a problem hiding this comment.
Excluding templates/** from analysis means CI's flutter analyze will no longer catch regressions in the Mason brick source. Consider adding a separate CI step that generates the template (e.g., via mason make) into a temp directory and runs flutter analyze on the generated app (or otherwise validates the brick), so template breakages are still detected.
| - templates/** |
This PR fixes the mismatch between SolidUI and the updated solidpod API for file deletion.
What issue does this PR address
deleteFile()was called with an obsolete named parameterfileUrl.Type of change
Changes
deleteFile(fileUrl: ...)todeleteFile(...)in:templates/from static analysis in analysis_options.yaml.How Has This Been Tested?
solidpodchange is fully propagated to the environment.