You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new dart formatter wants to format this as follows:
void_showDialog(Widget child, BuildContext context) {
showCupertinoModalPopup<void>(
context: context,
builder:
(BuildContext context) =>Container(
height:216,
padding:constEdgeInsets.only(top:6.0),
// The Bottom margin is provided to align the popup above the system// navigation bar.
margin:EdgeInsets.only(
bottom:MediaQuery.of(context).viewInsets.bottom,
),
// Provide a background color for the popup.
color:CupertinoColors.systemBackground.resolveFrom(context),
// Use a SafeArea widget to avoid system overlaps.
child:SafeArea(top:false, child: child),
),
);
}
This gives the closure a lot of prominence over the other parameters and also causes more indentation reducing the effective line length for code inside the closure.
void_showDialog(Widget child, BuildContext context) {
showCupertinoModalPopup<void>(
context: context,
builder: (BuildContext context) =>Container(
height:216,
padding:constEdgeInsets.only(top:6.0),
// The Bottom margin is provided to align the popup above the system// navigation bar.
margin:EdgeInsets.only(
bottom:MediaQuery.of(context).viewInsets.bottom,
),
// Provide a background color for the popup.
color:CupertinoColors.systemBackground.resolveFrom(context),
// Use a SafeArea widget to avoid system overlaps.
child:SafeArea(top:false, child: child),
),
);
}
This formatting would visually also be more in line with the formatting I'd expect if builder were a list argument:
The new dart formatter wants to format this as follows:
This gives the closure a lot of prominence over the other parameters and also causes more indentation reducing the effective line length for code inside the closure.
This formatting would visually also be more in line with the formatting I'd expect if builder were a list argument:
@munificent did mention that there are cases were this kind of formatting for
=>
closures looks worse. I'm interested in seeing examples for that.The text was updated successfully, but these errors were encountered: