flutter-setup-localization: sets `synthetic-package: true`, which gen-l10n now rejects

Open Beginner friendly
#239 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
dart, flutter
Domain
documentation

Research direction

Update skills/flutter-setup-localization/SKILL.md, starting with the l10n.yaml snippet, the “Configure the App Entry Point” section, and both worked examples. Run flutter gen-l10n on Flutter 3.47.2 to verify the configuration, then confirm the examples use the generated file’s real path and no longer enable synthetic-package.

Written by the indexing model from the issue text.

Description

skills/flutter-setup-localization/SKILL.md tells the agent to write an l10n.yaml with synthetic-package: true and to import the result from package:flutter_gen/gen_l10n/app_localizations.dart. Both the config snippet and both worked examples do this:

https://github.com/flutter/agent-plugins/blob/e89522a/skills/flutter-setup-localization/SKILL.md#L60
https://github.com/flutter/agent-plugins/blob/e89522a/skills/flutter-setup-localization/SKILL.md#L68
https://github.com/flutter/agent-plugins/blob/e89522a/skills/flutter-setup-localization/SKILL.md#L179
https://github.com/flutter/agent-plugins/blob/e89522a/skills/flutter-setup-localization/SKILL.md#L186

Synthetic packages have been removed. On Flutter 3.47.2 stable, following the skill as written fails at the first step:

$ flutter gen-l10n
l10n.yaml: Cannot enable "synthetic-package", this feature has been removed. See http://flutter.dev/to/flutter-gen-deprecation.

and flutter gen-l10n --help lists the flag only as:

--[no-]synthetic-package    DEPRECATED. This flag cannot be enabled and should be removed.

An agent following the skill therefore produces a project whose localization step errors out and whose imports point at a package that will never exist.

Suggested fix: drop synthetic-package from the config, set output-dir (for example lib/l10n), and change the imports to the generated file's real path (import 'l10n/app_localizations.dart'; or the package-relative equivalent). The "Configure the App Entry Point" section and both examples need the same change.

Found while reviewing the skills vendored into a project via npx skills add flutter/agent-plugins --skill '*' --agent universal.

Dominant language
Dart
Stars
3k
Forks
180
Avg merge
5d 29m
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flutter/agent-plugins

All issues in flutter/agent-plugins

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.