enable lint avoid_field_initializers_in_const_classes (#18415)

This commit is contained in:
Alexandre Ardhuin
2018-06-13 07:20:18 +02:00
committed by GitHub
parent 587569337e
commit e45836f271
3 changed files with 5 additions and 5 deletions

View File

@@ -57,7 +57,7 @@ linter:
- avoid_classes_with_only_static_members
# - avoid_double_and_int_checks # only useful when targeting JS runtime
- avoid_empty_else
# - avoid_field_initializers_in_const_classes # not yet tested
- avoid_field_initializers_in_const_classes
- avoid_function_literals_in_foreach_calls
- avoid_init_to_null
# - avoid_js_rounded_ints # only useful when targeting JS runtime

View File

@@ -250,14 +250,14 @@ class _PestoLogoState extends State<PestoLogo> {
// A card with the recipe's image, author, and title.
class RecipeCard extends StatelessWidget {
final TextStyle titleStyle = const PestoStyle(fontSize: 24.0, fontWeight: FontWeight.w600);
final TextStyle authorStyle = const PestoStyle(fontWeight: FontWeight.w500, color: Colors.black54);
const RecipeCard({ Key key, this.recipe, this.onTap }) : super(key: key);
final Recipe recipe;
final VoidCallback onTap;
TextStyle get titleStyle => const PestoStyle(fontSize: 24.0, fontWeight: FontWeight.w600);
TextStyle get authorStyle => const PestoStyle(fontWeight: FontWeight.w500, color: Colors.black54);
@override
Widget build(BuildContext context) {
return new GestureDetector(

View File

@@ -176,7 +176,7 @@ abstract class PointerEvent {
final double distance;
/// The minimum value that a distance can return for this pointer (always 0.0).
final double distanceMin = 0.0;
double get distanceMin => 0.0;
/// The maximum value that a distance can return for this pointer. If this
/// input device cannot detect "hover touch" input events, then this will be