Skip to content

[mustache_template] Add example app - #36

Open
princesoni18 wants to merge 5 commits into
flutter:mainfrom
princesoni18:add-mustache-template-example
Open

[mustache_template] Add example app#36
princesoni18 wants to merge 5 commits into
flutter:mainfrom
princesoni18:add-mustache-template-example

Conversation

@princesoni18

Copy link
Copy Markdown

Adds an example application for the mustache_template package and updates the README to be more high-level.

Previously the package had no example app (causing a pub.dev score deduction), and most of the documentation lived in the README. This PR moves the detailed examples into a proper example/ directory and cleans up the README.

Fixes flutter/flutter#183936

Pre-Review Checklist

This PR only adds an example app and improves documentation. It does not change any package code, so no version bump or CHANGELOG entry is required. It also falls under the test exemption for pure documentation / example changes.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new example package for mustache_template, including a main.dart file with usage examples and a pubspec.yaml file, and updates the .gitignore to exclude FVM cache. It also updates the README.md to reference these examples using code-excerpt markers. The review feedback highlights discrepancies between the code snippets in README.md and the actual implementations in example/lib/main.dart for exampleUsage, nestedPaths, and lambdasExample, which should be kept in sync.

Comment thread third_party/packages/mustache_template/README.md
Comment thread third_party/packages/mustache_template/README.md
Comment thread third_party/packages/mustache_template/README.md

@stuartmorgan-g stuartmorgan-g left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

It does not change any package code, so no version bump or CHANGELOG entry is required. It also falls under the test exemption for pure documentation / example changes.

The exemption is for unpublished portions of the example; main.dart is published on pub.dev

Also, this PR does not appear to have had the formatter run on it, as indicated in the checklist, nor does it pass analysis.

Comment thread .gitignore
.settings

# FVM Version Cache
.fvm/ No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignores for local tools should be done in your user-level git ignore, not added to the repository.

path: ../

dev_dependencies:
lints: ^3.0.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use lints.

{'firstname': 'Bob', 'lastname': 'Johnson'}
]});
/// The main entrypoint for the example app.
void main() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of this is relevant to the example; just the original code, omitting the main() and print, should be part of the excerpt.

'author': <String, String>{'name': 'Greg Lowe'},
});
print(output);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then more generally, you've significantly changed the structure of all of these examples, making them longer by adding unnecessary boilerplate. The code being excerpted should be structurally the same as it was, with the changes being those necessary to follow style rules.


## Example usage

<?code-excerpt "main.dart (example_usage)"?>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reference is not correct. Did you run the excerpting tool, or did you manually copy everything between the files?

@princesoni18

Copy link
Copy Markdown
Author

ok i will make the changes and update it ASAP!!

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

Regarding your comment in the issue about this PR, you will need to be running a current version of the repository tooling to correctly implement this. Targeting a version of the tooling that is more than three years old won't result in a PR that passes CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[mustache_template] No example app

2 participants