Skip to content

[mustache_template] Add example app and code excerpts#11466

Open
HibaChamkhi wants to merge 7 commits intoflutter:mainfrom
HibaChamkhi:mustache-template-example-app
Open

[mustache_template] Add example app and code excerpts#11466
HibaChamkhi wants to merge 7 commits intoflutter:mainfrom
HibaChamkhi:mustache-template-example-app

Conversation

@HibaChamkhi
Copy link
Copy Markdown

Adds an example app for the mustache_template package, adds code excerpts,
and removes the package from script/configs/temp_exclude_excerpt.yaml.

Fixes flutter/flutter#183936

Copy link
Copy Markdown

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

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 introduces a Flutter example application for the mustache_template package and refactors the README.md to utilize code excerpts from the new example. Additionally, the package is removed from the excerpt exclusion list, and the version is bumped to 2.0.5. Feedback suggests making the changelog entry more descriptive regarding the specific features demonstrated by the example app.

@@ -1,3 +1,8 @@
## 2.0.5

* Adds example app.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The changelog entry for the example app is redundant with the description of the change. Consider being more specific about what the example app demonstrates.

Copy link
Copy Markdown
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Please look over the review feedback on the previous attempted PRs that referenced this issue, and make sure that your PR addresses all of that feedback. For instance, this PR significantly rewrites the README in ways that have nothing to do with the issue, which as discussed previously is not in scope for this PR, and this also doesn't have meaningful tests, as was flagged in several previous PRs.

Also, as this package does not have a Flutter dependency, the example app should be a Dart script, not a Flutter app.

@HibaChamkhi
Copy link
Copy Markdown
Author

Thanks for the feedback! I've addressed the review comments:

  • Converted the example from a Flutter app to a Dart script
  • Restored the README to its original content, only adding code-excerpt references

@stuartmorgan-g stuartmorgan-g added the CICD Run CI/CD label Apr 17, 2026
Copy link
Copy Markdown
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

and this also doesn't have meaningful tests, as was flagged in several previous PRs

This has not been addressed in the PR update; there is still nothing ensuring that the excerpts run as expected.

var t = Template('{{# foo }}{{bar}}{{/ foo }}');
var lambda = (LambdaContext ctx) => '<b>${ctx.renderString().toUpperCase()}</b>';
t.renderString({'foo': lambda, 'bar': 'pub'}); // <b>PUB</b>
```
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.

Why are these examples removed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@stuartmorgan-g Both issues fixed:

  1. Lambda examples restored in README (both renderString and renderSource examples with var syntax)
  2. Added test/example_test.dart with 5 tests ensuring all README excerpts run correctly

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.

with var syntax

Code excerpts need to follow our style. The source file should not be overriding any style rules other than avoid_print.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@stuartmorgan-g fixed:

1- Lambda examples restored in README
2- Added test/example_test.dart
3- Following style guidelines (only ignoring avoid_print)

@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 21, 2026
- Use final instead of var in example code
- Add proper type annotations (Object) for non-obvious types
- Only ignore avoid_print lint rule as required
- Update README excerpts to reflect proper style
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