-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Description
We ran a new formatter on our codebase with trailing commas preserved. Here are a couple of cases where the line breaks don’t feel natural to us.
What input code did you provide to the formatter?
// case 1
_barrierOpacity = Tween<double>(
begin: 0,
end: 0.8,
).animate(
CurvedAnimation(
parent: _controller,
curve: Curves.easeOutCubic,
),
);
// case 2
Animation<double> _animation() {
return TweenSequence<double>([
TweenSequenceItem(
weight: 20,
tween: Tween<double>(
begin: 1,
end: 1.1,
).chain(
CurveTween(
curve: const Cubic(0.2, 0, 0.4, 1),
),
),
),
]).animate(_controller);
}
// case 3
typedef ConditionalWrapperBuilder = Widget Function(
BuildContext context,
Widget child,
);
// case 4 (declare argument of the class)
final Widget Function(
BuildContext context,
double shrinkOffset,
bool overlapsContent,
) builder;
// case 5 (no strong opinion on this one)
description: 'We were unable to verify your account. Please try '
'again or use a different sign-in method.',
What output did the formatter produce?
// case 1
_barrierOpacity =
Tween<double>(
begin: 0,
end: 0.8,
).animate(
CurvedAnimation(
parent: _controller,
curve: Curves.easeOutCubic,
),
);
// case 2
Animation<double> _animation() {
return TweenSequence<double>([
TweenSequenceItem(
weight: 20,
tween:
Tween<double>(
begin: 1,
end: 1.1,
).chain(
CurveTween(
curve: const Cubic(0.2, 0, 0.4, 1),
),
),
),
]).animate(_controller);
}
// case 3
typedef ConditionalWrapperBuilder =
Widget Function(
BuildContext context,
Widget child,
);
// case 4 (declare argument of the class)
final Widget Function(
BuildContext context,
double shrinkOffset,
bool overlapsContent,
)
builder;
// case 5 (no strong opinion on this one)
description:
'We were unable to verify your account. Please try '
'again or use a different sign-in method.',
What output did you expect or want the formatter to produce?
// case 1
_barrierOpacity = Tween<double>(
begin: 0,
end: 0.8,
).animate(
CurvedAnimation(
parent: _controller,
curve: Curves.easeOutCubic,
),
);
// case 2
Animation<double> _animation() {
return TweenSequence<double>([
TweenSequenceItem(
weight: 20,
tween: Tween<double>(
begin: 1,
end: 1.1,
).chain(
CurveTween(
curve: const Cubic(0.2, 0, 0.4, 1),
),
),
),
]).animate(_controller);
}
// case 3
typedef ConditionalWrapperBuilder = Widget Function(
BuildContext context,
Widget child,
);
// case 4 (declare argument of the class)
final Widget Function(
BuildContext context,
double shrinkOffset,
bool overlapsContent,
) builder;
// case 5 (no strong opinion on this one)
description: 'We were unable to verify your account. Please try '
'again or use a different sign-in method.',
Anything else we should know?
Thank you for your hard work!
MahmoudSaleh998
Metadata
Metadata
Assignees
Labels
No labels