I would like this formatting to happen when I save the file
instead I get this upon save, even if I have manually formatted the code as I like.
my settings look like this
I have the flutter extension installed as well, as recommended by Flutter documentation.
Add a trailing comma.
Expense(
{required this.title,
required this.amount,
required this.date,
required this.category,})
When you run dart format
(or use the equivalent integrated command on VSCode), the code will be formatted to:
Expense({
required this.title,
required this.amount,
required this.date,
required this.category,
})
The documentation has example of how trailing commas affect the formatting result: https://docs.flutter.dev/tools/formatting#using-trailing-commas
You can also enable a lint that will tell you to always use trailing commas: https://dart.dev/tools/linter-rules/require_trailing_commas