flame
flame copied to clipboard
Docs: two code snippets that do not compile
Following the "Documentation & Miscellaneous" step in CONTRIBUTING (file an issue first), here are two documentation snippets that do not compile as written. Happy to send a PR for both.
1. packages/flame_kenney_xml/README.md — wrong parameter names, unterminated string
final spritesheet = await XmlSpriteSheet.load(
image: 'spritesheet.png',
xml: 'spritesheet.xml`,
);
Three problems in four lines:
image:andxml:are not parameters ofXmlSpriteSheet.load.lib/flame_kenney_xml.dart:34declaresimagePath:andxmlPath:, and the package's ownexample/lib/main.dart:26-27andtest/flame_kenney_xml_test.dart:60-61both use those names.'spritesheet.xml`` ends with a backtick instead of a closing'`, so the string is unterminated and the block does not parse.- Two lines above, the prose says to place
spritesheet.jsoninassets/. This is the XML package —loadreads the file throughassetsCache.readFileas XML, so it should sayspritesheet.xml.
2. doc/flame/rendering/decorators.md:118 — missing closing paren
final decorator = PaintDecorator.tint(const Color(0xAAFF0000);
PaintDecorator.tint(Color color) is declared at packages/flame/lib/src/rendering/paint_decorator.dart:19; the line needs one more ) before the ;.
How I found them
I extracted every fenced code block in the repo's docs and checked paren/bracket balance outside strings and comments, then cross-checked the flagged snippets against the actual declarations in lib/. I did not include a third hit in packages/flame/CHANGELOG.md:523, since changelog entries are historical records and probably should not be edited.