My Car
My Car

Reputation: 4566

Why does formatting code in VS Code always return uglier code than I expected?

I'm formatting code in VS Code. However, VS Code always returns uglier code than I expected.

Example:

My original code:

                                                    body: Padding(
                                                      padding: const EdgeInsets.all(AppSizes.kDefaultPadding,),
                                                      …
                                                    ),

Expected code:

                                                    body: Padding(
                                                      padding: const EdgeInsets.all(
                                                        AppSizes.kDefaultPadding,
                                                      ),
                                                      …
                                                    ),

Actual code:

                                                    body: Padding(
                                                      padding:
                                                          const EdgeInsets.all(
                                                        AppSizes
                                                            .kDefaultPadding,
                                                      ),
                                                      …
                                                    ),

The actual code is really ugly (in my opinion, not sure how others see it).

How can I get the expected code? I would appreciate any help. Thank you in advance!

Upvotes: 1

Views: 590

Answers (1)

Md. Yeasin Sheikh
Md. Yeasin Sheikh

Reputation: 63614

As jamesdlin commented, Open your setting and search for dart line length, increase the value

enter image description here

enter image description here

Upvotes: 1

Related Questions