Unverified Commit 3118ae19 authored by Konstantin Scheglov's avatar Konstantin Scheglov Committed by GitHub

Fix new prefer_const_constructors after analyzer fix. (#39917)

parent 02344c9c
......@@ -42,7 +42,7 @@ class _ImageLoaderState extends State<ImageLoader> {
void initState() {
// This is not an image, but we don't care since we're using a faked
// http client.
final NetworkImage image = NetworkImage('https://github.com/flutter/flutter');
const NetworkImage image = NetworkImage('https://github.com/flutter/flutter');
final ImageStream stream = image.resolve(ImageConfiguration.empty);
ImageStreamListener listener;
listener = ImageStreamListener(
......
......@@ -5,7 +5,7 @@
import 'package:flutter/widgets.dart';
void main() {
runApp(Center(
child: const Text('Hello, World', textDirection: TextDirection.ltr),
runApp(const Center(
child: Text('Hello, World', textDirection: TextDirection.ltr),
));
}
......@@ -184,8 +184,8 @@ class _FocusDemoState extends State<FocusDemo> {
decoration: InputDecoration(labelText: 'Enter Text', filled: true),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
const Padding(
padding: EdgeInsets.all(8.0),
child: TextField(
decoration: InputDecoration(
border: OutlineInputBorder(),
......
......@@ -82,8 +82,8 @@ class _HoverDemoState extends State<HoverDemo> {
decoration: InputDecoration(labelText: 'Enter Text', filled: true),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
const Padding(
padding: EdgeInsets.all(8.0),
child: TextField(
autofocus: false,
decoration: InputDecoration(
......
......@@ -139,7 +139,7 @@ class FruitPage extends StatelessWidget {
padding: const EdgeInsets.symmetric(vertical: 16),
child: Row(
children: <Widget>[
CircleAvatar(
const CircleAvatar(
backgroundImage: ExactAssetImage(
'people/square/trevor.png',
package: 'flutter_gallery_assets',
......
......@@ -26,8 +26,7 @@ void main() {
});
testWidgets('Color filter - sepia', (WidgetTester tester) async {
// TODO(dnfield): This should be const. https://github.com/dart-lang/sdk/issues/37503
final ColorFilter sepia = ColorFilter.matrix(<double>[
const ColorFilter sepia = ColorFilter.matrix(<double>[
0.39, 0.769, 0.189, 0, 0, //
0.349, 0.686, 0.168, 0, 0, //
0.272, 0.534, 0.131, 0, 0, //
......
......@@ -652,10 +652,10 @@ void main() {
}
await tester.pumpWidget(
Directionality(
const Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: const Text('Hello World', key: ValueKey<String>('Text'))
child: Text('Hello World', key: ValueKey<String>('Text'))
),
),
);
......
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