Double-check analysis_options.yaml You've already added this, but just to be sure, make sure it's correctly formatted:
yaml Copy Edit analyzer: exclude: - "**/*.g.dart"
linter: rules: require_trailing_commas: true Also, make sure this file is in the root of your Flutter project.
Open VSCode settings (Ctrl + ,) Search for “Format On Save” and turn it off json Copy Edit "editor.formatOnSave": false Instead of letting VSCode auto-format, run this manually: lua Copy Edit dart format --fix . 3. Check Your Dart SDK Version Dart updates sometimes change how the formatter works. Make sure you’re using the latest stable version by running:
css Copy Edit dart --version If it’s outdated, update it using:
nginx Copy Edit flutter upgrade 4. Try Using a Different Formatter The default Dart formatter (dart_style) has strict rules, and it might not respect require_trailing_commas. If that’s the case, you may need a custom formatter or an extension that allows more control over formatting behavior.