Unverified Commit 8560d914 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Upgrade to flutter_lints 2.0 (#99881)

parent d435b724
...@@ -746,9 +746,10 @@ dependencies: ...@@ -746,9 +746,10 @@ dependencies:
sdk: flutter sdk: flutter
flutter_test: flutter_test:
sdk: flutter sdk: flutter
vector_math: any
dev_dependencies: dev_dependencies:
flutter_lints: ^1.0.3 flutter_lints: ^2.0.0
'''); ''');
} }
......
...@@ -135,10 +135,10 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> { ...@@ -135,10 +135,10 @@ abstract class Animation<T> extends Listenable implements ValueListenable<T> {
/// vary. /// vary.
/// ///
/// ```dart /// ```dart
/// final Animatable<Alignment> _tween = AlignmentTween(begin: Alignment.topLeft, end: Alignment.topRight) /// final Animatable<Alignment> tween = AlignmentTween(begin: Alignment.topLeft, end: Alignment.topRight)
/// .chain(CurveTween(curve: Curves.easeIn)); /// .chain(CurveTween(curve: Curves.easeIn));
/// // ... /// // ...
/// final Animation<Alignment> _alignment2 = _controller.drive(_tween); /// final Animation<Alignment> alignment2 = _controller.drive(tween);
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
/// {@tool snippet} /// {@tool snippet}
......
...@@ -598,13 +598,13 @@ class CupertinoColors { ...@@ -598,13 +598,13 @@ class CupertinoColors {
/// ///
/// ```dart /// ```dart
/// CupertinoButton( /// CupertinoButton(
/// child: child,
/// // CupertinoDynamicColor works out of box in a CupertinoButton. /// // CupertinoDynamicColor works out of box in a CupertinoButton.
/// color: const CupertinoDynamicColor.withBrightness( /// color: const CupertinoDynamicColor.withBrightness(
/// color: CupertinoColors.white, /// color: CupertinoColors.white,
/// darkColor: CupertinoColors.black, /// darkColor: CupertinoColors.black,
/// ), /// ),
/// onPressed: () { }, /// onPressed: () { },
/// child: child,
/// ) /// )
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
......
...@@ -158,10 +158,6 @@ class CupertinoContextMenu extends StatefulWidget { ...@@ -158,10 +158,6 @@ class CupertinoContextMenu extends StatefulWidget {
/// ///
/// ```dart /// ```dart
/// CupertinoContextMenu( /// CupertinoContextMenu(
/// child: FittedBox(
/// fit: BoxFit.cover,
/// child: Image.asset('assets/photo.jpg'),
/// ),
/// // The FittedBox in the preview here allows the image to animate its /// // The FittedBox in the preview here allows the image to animate its
/// // aspect ratio when the CupertinoContextMenu is animating its preview /// // aspect ratio when the CupertinoContextMenu is animating its preview
/// // widget open and closed. /// // widget open and closed.
...@@ -184,6 +180,10 @@ class CupertinoContextMenu extends StatefulWidget { ...@@ -184,6 +180,10 @@ class CupertinoContextMenu extends StatefulWidget {
/// onPressed: () {}, /// onPressed: () {},
/// ), /// ),
/// ], /// ],
/// child: FittedBox(
/// fit: BoxFit.cover,
/// child: Image.asset('assets/photo.jpg'),
/// ),
/// ) /// )
/// ``` /// ```
/// ///
......
...@@ -58,6 +58,9 @@ const EdgeInsetsGeometry _kDefaultPadding = ...@@ -58,6 +58,9 @@ const EdgeInsetsGeometry _kDefaultPadding =
/// header: const Text('SECTION 1'), /// header: const Text('SECTION 1'),
/// children: <Widget>[ /// children: <Widget>[
/// CupertinoFormRow( /// CupertinoFormRow(
/// prefix: const Text('Toggle'),
/// helper: const Text('Use your instincts'),
/// error: toggleValue ? const Text('Cannot be true') : null,
/// child: CupertinoSwitch( /// child: CupertinoSwitch(
/// value: toggleValue, /// value: toggleValue,
/// onChanged: (bool value) { /// onChanged: (bool value) {
...@@ -66,9 +69,6 @@ const EdgeInsetsGeometry _kDefaultPadding = ...@@ -66,9 +69,6 @@ const EdgeInsetsGeometry _kDefaultPadding =
/// }); /// });
/// }, /// },
/// ), /// ),
/// prefix: const Text('Toggle'),
/// helper: const Text('Use your instincts'),
/// error: toggleValue ? const Text('Cannot be true') : null,
/// ), /// ),
/// ], /// ],
/// ), /// ),
......
...@@ -3162,8 +3162,8 @@ class RenderRepaintBoundary extends RenderProxyBox { ...@@ -3162,8 +3162,8 @@ class RenderRepaintBoundary extends RenderProxyBox {
/// key: globalKey, /// key: globalKey,
/// child: Center( /// child: Center(
/// child: TextButton( /// child: TextButton(
/// child: const Text('Hello World', textDirection: TextDirection.ltr),
/// onPressed: _capturePng, /// onPressed: _capturePng,
/// child: const Text('Hello World', textDirection: TextDirection.ltr),
/// ), /// ),
/// ), /// ),
/// ); /// );
......
...@@ -222,12 +222,12 @@ class DecoratedBox extends SingleChildRenderObjectWidget { ...@@ -222,12 +222,12 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// padding: const EdgeInsets.all(8.0), /// padding: const EdgeInsets.all(8.0),
/// color: Colors.blue[600], /// color: Colors.blue[600],
/// alignment: Alignment.center, /// alignment: Alignment.center,
/// transform: Matrix4.rotationZ(0.1),
/// child: Text('Hello World', /// child: Text('Hello World',
/// style: Theme.of(context) /// style: Theme.of(context)
/// .textTheme /// .textTheme
/// .headline4! /// .headline4!
/// .copyWith(color: Colors.white)), /// .copyWith(color: Colors.white)),
/// transform: Matrix4.rotationZ(0.1),
/// ) /// )
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
......
...@@ -1324,8 +1324,8 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState<Animat ...@@ -1324,8 +1324,8 @@ class _AnimatedPositionedDirectionalState extends AnimatedWidgetBaseState<Animat
/// mainAxisAlignment: MainAxisAlignment.center, /// mainAxisAlignment: MainAxisAlignment.center,
/// children: <Widget>[ /// children: <Widget>[
/// ElevatedButton( /// ElevatedButton(
/// child: const Text('Scale Logo'),
/// onPressed: _changeScale, /// onPressed: _changeScale,
/// child: const Text('Scale Logo'),
/// ), /// ),
/// Padding( /// Padding(
/// padding: const EdgeInsets.all(50), /// padding: const EdgeInsets.all(50),
...@@ -1455,8 +1455,8 @@ class _AnimatedScaleState extends ImplicitlyAnimatedWidgetState<AnimatedScale> { ...@@ -1455,8 +1455,8 @@ class _AnimatedScaleState extends ImplicitlyAnimatedWidgetState<AnimatedScale> {
/// mainAxisAlignment: MainAxisAlignment.center, /// mainAxisAlignment: MainAxisAlignment.center,
/// children: <Widget>[ /// children: <Widget>[
/// ElevatedButton( /// ElevatedButton(
/// child: const Text('Rotate Logo'),
/// onPressed: _changeRotation, /// onPressed: _changeRotation,
/// child: const Text('Rotate Logo'),
/// ), /// ),
/// Padding( /// Padding(
/// padding: const EdgeInsets.all(50), /// padding: const EdgeInsets.all(50),
...@@ -1673,8 +1673,8 @@ class _AnimatedSlideState extends ImplicitlyAnimatedWidgetState<AnimatedSlide> { ...@@ -1673,8 +1673,8 @@ class _AnimatedSlideState extends ImplicitlyAnimatedWidgetState<AnimatedSlide> {
/// child: const FlutterLogo(), /// child: const FlutterLogo(),
/// ), /// ),
/// ElevatedButton( /// ElevatedButton(
/// child: const Text('Fade Logo'),
/// onPressed: _changeOpacity, /// onPressed: _changeOpacity,
/// child: const Text('Fade Logo'),
/// ), /// ),
/// ], /// ],
/// ); /// );
......
...@@ -586,8 +586,8 @@ mixin LocalHistoryRoute<T> on Route<T> { ...@@ -586,8 +586,8 @@ mixin LocalHistoryRoute<T> on Route<T> {
/// color: Colors.red, /// color: Colors.red,
/// ) /// )
/// : ElevatedButton( /// : ElevatedButton(
/// child: const Text('Show Rectangle'),
/// onPressed: _navigateLocallyToShowRectangle, /// onPressed: _navigateLocallyToShowRectangle,
/// child: const Text('Show Rectangle'),
/// ); /// );
/// ///
/// return Scaffold( /// return Scaffold(
......
...@@ -1588,33 +1588,33 @@ class ListView extends BoxScrollView { ...@@ -1588,33 +1588,33 @@ class ListView extends BoxScrollView {
/// children: <Widget>[ /// children: <Widget>[
/// Container( /// Container(
/// padding: const EdgeInsets.all(8), /// padding: const EdgeInsets.all(8),
/// child: const Text("He'd have you all unravel at the"),
/// color: Colors.teal[100], /// color: Colors.teal[100],
/// child: const Text("He'd have you all unravel at the"),
/// ), /// ),
/// Container( /// Container(
/// padding: const EdgeInsets.all(8), /// padding: const EdgeInsets.all(8),
/// child: const Text('Heed not the rabble'),
/// color: Colors.teal[200], /// color: Colors.teal[200],
/// child: const Text('Heed not the rabble'),
/// ), /// ),
/// Container( /// Container(
/// padding: const EdgeInsets.all(8), /// padding: const EdgeInsets.all(8),
/// child: const Text('Sound of screams but the'),
/// color: Colors.teal[300], /// color: Colors.teal[300],
/// child: const Text('Sound of screams but the'),
/// ), /// ),
/// Container( /// Container(
/// padding: const EdgeInsets.all(8), /// padding: const EdgeInsets.all(8),
/// child: const Text('Who scream'),
/// color: Colors.teal[400], /// color: Colors.teal[400],
/// child: const Text('Who scream'),
/// ), /// ),
/// Container( /// Container(
/// padding: const EdgeInsets.all(8), /// padding: const EdgeInsets.all(8),
/// child: const Text('Revolution is coming...'),
/// color: Colors.teal[500], /// color: Colors.teal[500],
/// child: const Text('Revolution is coming...'),
/// ), /// ),
/// Container( /// Container(
/// padding: const EdgeInsets.all(8), /// padding: const EdgeInsets.all(8),
/// child: const Text('Revolution, they...'),
/// color: Colors.teal[600], /// color: Colors.teal[600],
/// child: const Text('Revolution, they...'),
/// ), /// ),
/// ], /// ],
/// ) /// )
...@@ -1640,33 +1640,33 @@ class ListView extends BoxScrollView { ...@@ -1640,33 +1640,33 @@ class ListView extends BoxScrollView {
/// children: <Widget>[ /// children: <Widget>[
/// Container( /// Container(
/// padding: const EdgeInsets.all(8), /// padding: const EdgeInsets.all(8),
/// child: const Text("He'd have you all unravel at the"),
/// color: Colors.green[100], /// color: Colors.green[100],
/// child: const Text("He'd have you all unravel at the"),
/// ), /// ),
/// Container( /// Container(
/// padding: const EdgeInsets.all(8), /// padding: const EdgeInsets.all(8),
/// child: const Text('Heed not the rabble'),
/// color: Colors.green[200], /// color: Colors.green[200],
/// child: const Text('Heed not the rabble'),
/// ), /// ),
/// Container( /// Container(
/// padding: const EdgeInsets.all(8), /// padding: const EdgeInsets.all(8),
/// child: const Text('Sound of screams but the'),
/// color: Colors.green[300], /// color: Colors.green[300],
/// child: const Text('Sound of screams but the'),
/// ), /// ),
/// Container( /// Container(
/// padding: const EdgeInsets.all(8), /// padding: const EdgeInsets.all(8),
/// child: const Text('Who scream'),
/// color: Colors.green[400], /// color: Colors.green[400],
/// child: const Text('Who scream'),
/// ), /// ),
/// Container( /// Container(
/// padding: const EdgeInsets.all(8), /// padding: const EdgeInsets.all(8),
/// child: const Text('Revolution is coming...'),
/// color: Colors.green[500], /// color: Colors.green[500],
/// child: const Text('Revolution is coming...'),
/// ), /// ),
/// Container( /// Container(
/// padding: const EdgeInsets.all(8), /// padding: const EdgeInsets.all(8),
/// child: const Text('Revolution, they...'),
/// color: Colors.green[600], /// color: Colors.green[600],
/// child: const Text('Revolution, they...'),
/// ), /// ),
/// ], /// ],
/// ), /// ),
......
...@@ -969,8 +969,8 @@ class RawScrollbar extends StatefulWidget { ...@@ -969,8 +969,8 @@ class RawScrollbar extends StatefulWidget {
/// scrollbar dragging for multiple independent ListViews: /// scrollbar dragging for multiple independent ListViews:
/// ///
/// ```dart /// ```dart
/// final ScrollController _controllerOne = ScrollController(); /// final ScrollController controllerOne = ScrollController();
/// final ScrollController _controllerTwo = ScrollController(); /// final ScrollController controllerTwo = ScrollController();
/// ///
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// return Column( /// return Column(
...@@ -978,9 +978,9 @@ class RawScrollbar extends StatefulWidget { ...@@ -978,9 +978,9 @@ class RawScrollbar extends StatefulWidget {
/// SizedBox( /// SizedBox(
/// height: 200, /// height: 200,
/// child: CupertinoScrollbar( /// child: CupertinoScrollbar(
/// controller: _controllerOne, /// controller: controllerOne,
/// child: ListView.builder( /// child: ListView.builder(
/// controller: _controllerOne, /// controller: controllerOne,
/// itemCount: 120, /// itemCount: 120,
/// itemBuilder: (BuildContext context, int index) => Text('item $index'), /// itemBuilder: (BuildContext context, int index) => Text('item $index'),
/// ), /// ),
...@@ -989,9 +989,9 @@ class RawScrollbar extends StatefulWidget { ...@@ -989,9 +989,9 @@ class RawScrollbar extends StatefulWidget {
/// SizedBox( /// SizedBox(
/// height: 200, /// height: 200,
/// child: CupertinoScrollbar( /// child: CupertinoScrollbar(
/// controller: _controllerTwo, /// controller: controllerTwo,
/// child: ListView.builder( /// child: ListView.builder(
/// controller: _controllerTwo, /// controller: controllerTwo,
/// itemCount: 120, /// itemCount: 120,
/// itemBuilder: (BuildContext context, int index) => Text('list 2 item $index'), /// itemBuilder: (BuildContext context, int index) => Text('list 2 item $index'),
/// ), /// ),
...@@ -1030,8 +1030,8 @@ class RawScrollbar extends StatefulWidget { ...@@ -1030,8 +1030,8 @@ class RawScrollbar extends StatefulWidget {
/// {@tool snippet} /// {@tool snippet}
/// ///
/// ```dart /// ```dart
/// final ScrollController _controllerOne = ScrollController(); /// final ScrollController controllerOne = ScrollController();
/// final ScrollController _controllerTwo = ScrollController(); /// final ScrollController controllerTwo = ScrollController();
/// ///
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// return Column( /// return Column(
...@@ -1040,9 +1040,9 @@ class RawScrollbar extends StatefulWidget { ...@@ -1040,9 +1040,9 @@ class RawScrollbar extends StatefulWidget {
/// height: 200, /// height: 200,
/// child: Scrollbar( /// child: Scrollbar(
/// thumbVisibility: true, /// thumbVisibility: true,
/// controller: _controllerOne, /// controller: controllerOne,
/// child: ListView.builder( /// child: ListView.builder(
/// controller: _controllerOne, /// controller: controllerOne,
/// itemCount: 120, /// itemCount: 120,
/// itemBuilder: (BuildContext context, int index) { /// itemBuilder: (BuildContext context, int index) {
/// return Text('item $index'); /// return Text('item $index');
...@@ -1054,9 +1054,9 @@ class RawScrollbar extends StatefulWidget { ...@@ -1054,9 +1054,9 @@ class RawScrollbar extends StatefulWidget {
/// height: 200, /// height: 200,
/// child: CupertinoScrollbar( /// child: CupertinoScrollbar(
/// thumbVisibility: true, /// thumbVisibility: true,
/// controller: _controllerTwo, /// controller: controllerTwo,
/// child: SingleChildScrollView( /// child: SingleChildScrollView(
/// controller: _controllerTwo, /// controller: controllerTwo,
/// child: const SizedBox( /// child: const SizedBox(
/// height: 2000, /// height: 2000,
/// width: 500, /// width: 500,
...@@ -1112,8 +1112,8 @@ class RawScrollbar extends StatefulWidget { ...@@ -1112,8 +1112,8 @@ class RawScrollbar extends StatefulWidget {
/// {@tool snippet} /// {@tool snippet}
/// ///
/// ```dart /// ```dart
/// final ScrollController _controllerOne = ScrollController(); /// final ScrollController controllerOne = ScrollController();
/// final ScrollController _controllerTwo = ScrollController(); /// final ScrollController controllerTwo = ScrollController();
/// ///
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// return Column( /// return Column(
...@@ -1122,9 +1122,9 @@ class RawScrollbar extends StatefulWidget { ...@@ -1122,9 +1122,9 @@ class RawScrollbar extends StatefulWidget {
/// height: 200, /// height: 200,
/// child: Scrollbar( /// child: Scrollbar(
/// thumbVisibility: true, /// thumbVisibility: true,
/// controller: _controllerOne, /// controller: controllerOne,
/// child: ListView.builder( /// child: ListView.builder(
/// controller: _controllerOne, /// controller: controllerOne,
/// itemCount: 120, /// itemCount: 120,
/// itemBuilder: (BuildContext context, int index) { /// itemBuilder: (BuildContext context, int index) {
/// return Text('item $index'); /// return Text('item $index');
...@@ -1136,9 +1136,9 @@ class RawScrollbar extends StatefulWidget { ...@@ -1136,9 +1136,9 @@ class RawScrollbar extends StatefulWidget {
/// height: 200, /// height: 200,
/// child: CupertinoScrollbar( /// child: CupertinoScrollbar(
/// thumbVisibility: true, /// thumbVisibility: true,
/// controller: _controllerTwo, /// controller: controllerTwo,
/// child: SingleChildScrollView( /// child: SingleChildScrollView(
/// controller: _controllerTwo, /// controller: controllerTwo,
/// child: const SizedBox( /// child: const SizedBox(
/// height: 2000, /// height: 2000,
/// width: 500, /// width: 500,
......
...@@ -557,6 +557,7 @@ const String _dartPluginRegistryTemplate = ''' ...@@ -557,6 +557,7 @@ const String _dartPluginRegistryTemplate = '''
// ignore_for_file: directives_ordering // ignore_for_file: directives_ordering
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: depend_on_referenced_packages
{{#methodChannelPlugins}} {{#methodChannelPlugins}}
import 'package:{{name}}/{{file}}'; import 'package:{{name}}/{{file}}';
......
...@@ -55,7 +55,7 @@ dev_dependencies: ...@@ -55,7 +55,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your # activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint # package. See that file for information about deactivating specific lint
# rules and activating additional ones. # rules and activating additional ones.
flutter_lints: ^1.0.0 flutter_lints: ^2.0.0
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
......
...@@ -31,7 +31,7 @@ dependencies: ...@@ -31,7 +31,7 @@ dependencies:
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
flutter_lints: ^1.0.0 flutter_lints: ^2.0.0
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
......
...@@ -14,7 +14,7 @@ dependencies: ...@@ -14,7 +14,7 @@ dependencies:
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
flutter_lints: ^1.0.0 flutter_lints: ^2.0.0
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
......
...@@ -28,7 +28,7 @@ dev_dependencies: ...@@ -28,7 +28,7 @@ dev_dependencies:
{{/withFfiPluginHook}} {{/withFfiPluginHook}}
flutter_test: flutter_test:
sdk: flutter sdk: flutter
flutter_lints: ^1.0.0 flutter_lints: ^2.0.0
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
......
...@@ -19,7 +19,7 @@ dev_dependencies: ...@@ -19,7 +19,7 @@ dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
flutter_lints: ^1.0.0 flutter_lints: ^2.0.0
flutter: flutter:
uses-material-design: true uses-material-design: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment