dart_style icon indicating copy to clipboard operation
dart_style copied to clipboard

Variable name is placed on separate line (in variable declaration with generic type)

Open simphotonics opened this issue 1 year ago • 0 comments

Formatting with Dart SDK version: 3.7.2 (stable) (Tue Mar 11 04:27:50 2025 -0700) on "linux_x64" resulted in the following layout, where the variable name is placed on a separate line:

class AutoDisposeAsyncNotifierProvider<T, U> {}

class AutoDisposeAsyncNotifier<T> {}

class SearchFilter<S, T> {}

class SampleClass<T> {
  SampleClass({required this.provider});

  final AutoDisposeAsyncNotifierProvider<
    AutoDisposeAsyncNotifier<SearchFilter<T, String>>,
    SearchFilter<T, String>
  >
  provider;
}

I realize that squeezing a variable declaration involving generic types with long parameter type names into 80 character lines will never result in something pretty.

I am just wondering if the linebreak before the variable name is really intended.

simphotonics avatar Mar 21 '25 18:03 simphotonics