Open dvorapa opened 5 years ago
Describe the issue If there is a large multiline declaration of some Widget returned inside, the code seems to be more clean with curly braces.
To Reproduce
Builder(builder: (BuildContext context) { return Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ Row( children: <Widget>[ Tooltip( message: 'Select start', child: InkWell( onTap: () {}, child: Padding( padding: EdgeInsets.symmetric( horizontal: 20.0, vertical: 16.0), child: Text('A', style: TextStyle( fontSize: 15.0, fontWeight: FontWeight.bold, color: backgroundColor)), )), ), Tooltip( message: 'Select end', child: InkWell( onTap: () {}, child: Padding( padding: EdgeInsets.symmetric( horizontal: 20.0, vertical: 16.0), child: Text('B', style: TextStyle( fontSize: 15.0, fontWeight: FontWeight.bold, color: backgroundColor)), )), ), IconButton( onPressed: () { onSet(context); }, tooltip: 'Set (one, all, or random songs)', icon: Icon(_status(_set), size: 20.0), ), ], ), Row( children: <Widget>[ IconButton( onPressed: () { onMode(context); }, tooltip: 'Mode (once or in a loop)', icon: Icon( _mode == 'loop' ? Icons.repeat : Icons.trending_flat, size: 20.0), ), ], ), ], ); }),
vs
Builder(builder: (BuildContext context) => Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ Row( children: <Widget>[ Tooltip( message: 'Select start', child: InkWell( onTap: () {}, child: Padding( padding: EdgeInsets.symmetric( horizontal: 20.0, vertical: 16.0), child: Text('A', style: TextStyle( fontSize: 15.0, fontWeight: FontWeight.bold, color: backgroundColor)), )), ), Tooltip( message: 'Select end', child: InkWell( onTap: () {}, child: Padding( padding: EdgeInsets.symmetric( horizontal: 20.0, vertical: 16.0), child: Text('B', style: TextStyle( fontSize: 15.0, fontWeight: FontWeight.bold, color: backgroundColor)), )), ), IconButton( onPressed: () { onSet(context); }, tooltip: 'Set (one, all, or random songs)', icon: Icon(_status(_set), size: 20.0), ), ], ), Row( children: <Widget>[ IconButton( onPressed: () { onMode(context); }, tooltip: 'Mode (once or in a loop)', icon: Icon( _mode == 'loop' ? Icons.repeat : Icons.trending_flat, size: 20.0), ), ], ), ], ); ),
Expected behavior This warning could be omited in this particular case.
Additional context Latest stable Flutter v1.9.1+h6 with Dart 2.5.0
Maybe consider letting some Configurable linters as DCM rules. Adding ignored-named-arguments like prefer-extracting-callbacks
Configurable
ignored-named-arguments
Describe the issue If there is a large multiline declaration of some Widget returned inside, the code seems to be more clean with curly braces.
To Reproduce
vs
Expected behavior This warning could be omited in this particular case.
Additional context Latest stable Flutter v1.9.1+h6 with Dart 2.5.0