From 20fe751dc658daef4d0811c2fe5c4d0fdcb1dc12 Mon Sep 17 00:00:00 2001 From: Aref Mozafari Date: Mon, 2 Nov 2026 19:38:09 +0330 Subject: [PATCH 1/2] Drop the removed synthetic-package option from the flutter-setup-localization skill --- skills/flutter-setup-localization/SKILL.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/skills/flutter-setup-localization/SKILL.md b/skills/flutter-setup-localization/SKILL.md index d3dd4596..049cd955 100644 --- a/skills/flutter-setup-localization/SKILL.md +++ b/skills/flutter-setup-localization/SKILL.md @@ -52,20 +52,21 @@ flutter: ``` ### 3. Create Configuration File -Create a new file named `l10n.yaml` in the root directory of the Flutter project. Define the input directory, template file, and output file: +Create a new file named `l10n.yaml` in the root directory of the Flutter project. Define the input directory, template file, and output file. The generated Dart files are written next to the `.arb` files in `arb-dir` unless `output-dir` is set: ```yaml arb-dir: lib/l10n template-arb-file: app_en.arb output-localization-file: app_localizations.dart -synthetic-package: true ``` +Do not set `synthetic-package`. Synthetic packages were removed from Flutter, and `flutter gen-l10n` rejects the option. + ### 4. Configure the App Entry Point Import the generated localizations and the `flutter_localizations` library in your `main.dart`. Inject the delegates and supported locales into your `MaterialApp` or `CupertinoApp`. ```dart import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Adjust path if synthetic-package is false +import 'l10n/app_localizations.dart'; // Generated into arb-dir; adjust if output-dir is set // ... inside build method return MaterialApp( @@ -176,14 +177,13 @@ Use the `select` syntax for conditional strings, such as gendered text. arb-dir: lib/l10n template-arb-file: app_en.arb output-localization-file: app_localizations.dart -synthetic-package: true use-escaping: true ``` ### Complete Widget Implementation ```dart import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'l10n/app_localizations.dart'; class GreetingWidget extends StatelessWidget { final String userName; From e58ac794b1248140170db57d3d7cc0cb8420df99 Mon Sep 17 00:00:00 2001 From: Aref Mozafari Date: Mon, 2 Nov 2026 19:45:57 +0330 Subject: [PATCH 2/2] Note that the widget example's import path depends on the file location --- skills/flutter-setup-localization/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/flutter-setup-localization/SKILL.md b/skills/flutter-setup-localization/SKILL.md index 049cd955..89816476 100644 --- a/skills/flutter-setup-localization/SKILL.md +++ b/skills/flutter-setup-localization/SKILL.md @@ -183,7 +183,7 @@ use-escaping: true ### Complete Widget Implementation ```dart import 'package:flutter/material.dart'; -import 'l10n/app_localizations.dart'; +import 'l10n/app_localizations.dart'; // Adjust path depending on the widget's file location class GreetingWidget extends StatelessWidget { final String userName;