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