forked from firka/flutter
re-re-enable lint unnecessary_const (#20103)
This commit is contained in:
committed by
GitHub
parent
ffbaa97b50
commit
eda03e2586
@@ -19,8 +19,8 @@ void main() {
|
||||
await tester.pumpWidget(_boilerplate(
|
||||
const Text.rich(
|
||||
TextSpan(text: 't', children: <TextSpan>[
|
||||
const TextSpan(text: 'e'),
|
||||
const TextSpan(text: 'st'),
|
||||
TextSpan(text: 'e'),
|
||||
TextSpan(text: 'st'),
|
||||
]
|
||||
),
|
||||
)));
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:test/test.dart' hide test;
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart' show goldenFileComparator, LocalFileComparator;
|
||||
|
||||
const List<int> _kExpectedBytes = const <int>[1, 2, 3];
|
||||
const List<int> _kExpectedBytes = <int>[1, 2, 3];
|
||||
|
||||
void main() {
|
||||
MemoryFileSystem fs;
|
||||
@@ -171,14 +171,14 @@ void main() {
|
||||
group('update', () {
|
||||
test('updates existing file', () async {
|
||||
fs.file(fix('/golden.png')).writeAsBytesSync(_kExpectedBytes);
|
||||
const List<int> newBytes = const <int>[11, 12, 13];
|
||||
const List<int> newBytes = <int>[11, 12, 13];
|
||||
await comparator.update(fs.file('golden.png').uri, new Uint8List.fromList(newBytes));
|
||||
expect(fs.file(fix('/golden.png')).readAsBytesSync(), newBytes);
|
||||
});
|
||||
|
||||
test('creates non-existent file', () async {
|
||||
expect(fs.file(fix('/foo.png')).existsSync(), isFalse);
|
||||
const List<int> newBytes = const <int>[11, 12, 13];
|
||||
const List<int> newBytes = <int>[11, 12, 13];
|
||||
await comparator.update(fs.file('foo.png').uri, new Uint8List.fromList(newBytes));
|
||||
expect(fs.file(fix('/foo.png')).existsSync(), isTrue);
|
||||
expect(fs.file(fix('/foo.png')).readAsBytesSync(), newBytes);
|
||||
|
||||
@@ -359,7 +359,7 @@ void main() {
|
||||
|
||||
testWidgets('if finder finds multiple widgets', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(boilerplate(new Column(
|
||||
children: const <Widget>[const Text('hello'), const Text('world')],
|
||||
children: const <Widget>[Text('hello'), Text('world')],
|
||||
)));
|
||||
final Finder finder = find.byType(Text);
|
||||
try {
|
||||
@@ -387,7 +387,7 @@ void main() {
|
||||
group('matchesSemanticsData', () {
|
||||
testWidgets('matches SemanticsData', (WidgetTester tester) async {
|
||||
final SemanticsHandle handle = tester.ensureSemantics();
|
||||
const Key key = const Key('semantics');
|
||||
const Key key = Key('semantics');
|
||||
await tester.pumpWidget(new Semantics(
|
||||
key: key,
|
||||
namesRoute: true,
|
||||
|
||||
@@ -12,7 +12,7 @@ void main() {
|
||||
// Setup a widget that can receive focus so that we can open the keyboard.
|
||||
final Widget widget = new MaterialApp(
|
||||
home: const Material(
|
||||
child: const TextField(),
|
||||
child: TextField(),
|
||||
),
|
||||
);
|
||||
await tester.pumpWidget(widget);
|
||||
|
||||
@@ -13,9 +13,9 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:test/test.dart' as test_package;
|
||||
import 'package:test/src/frontend/async_matcher.dart' show AsyncMatcher;
|
||||
|
||||
const List<Widget> fooBarTexts = const <Text>[
|
||||
const Text('foo', textDirection: TextDirection.ltr),
|
||||
const Text('bar', textDirection: TextDirection.ltr),
|
||||
const List<Widget> fooBarTexts = <Text>[
|
||||
Text('foo', textDirection: TextDirection.ltr),
|
||||
Text('bar', textDirection: TextDirection.ltr),
|
||||
];
|
||||
|
||||
void main() {
|
||||
@@ -214,7 +214,7 @@ void main() {
|
||||
await tester.pumpWidget(new Row(
|
||||
textDirection: TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
new Column(children: const <Text>[const Text('foo', textDirection: TextDirection.ltr)]),
|
||||
new Column(children: const <Text>[Text('foo', textDirection: TextDirection.ltr)]),
|
||||
const Text('bar', textDirection: TextDirection.ltr),
|
||||
],
|
||||
));
|
||||
@@ -276,7 +276,7 @@ void main() {
|
||||
await tester.pumpWidget(new Row(
|
||||
textDirection: TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
new Column(children: const <Text>[const Text('foo', textDirection: TextDirection.ltr)]),
|
||||
new Column(children: const <Text>[Text('foo', textDirection: TextDirection.ltr)]),
|
||||
const Text('bar', textDirection: TextDirection.ltr),
|
||||
],
|
||||
));
|
||||
@@ -391,7 +391,7 @@ void main() {
|
||||
builder: (BuildContext context) {
|
||||
return new CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(
|
||||
middle: const Text('Page 2'),
|
||||
middle: Text('Page 2'),
|
||||
),
|
||||
child: new Container(),
|
||||
);
|
||||
@@ -535,7 +535,7 @@ void main() {
|
||||
await tester.pumpWidget(
|
||||
new MaterialApp(
|
||||
home: const Scaffold(
|
||||
body: const Text('hello'),
|
||||
body: Text('hello'),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -552,8 +552,8 @@ void main() {
|
||||
home: new Scaffold(
|
||||
body: new Row(
|
||||
children: const <Widget>[
|
||||
const Text('hello'),
|
||||
const Text('hello'),
|
||||
Text('hello'),
|
||||
Text('hello'),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -590,7 +590,7 @@ void main() {
|
||||
|
||||
testWidgets('Returns merged SemanticsData', (WidgetTester tester) async {
|
||||
final SemanticsHandle semanticsHandle = tester.ensureSemantics();
|
||||
const Key key = const Key('test');
|
||||
const Key key = Key('test');
|
||||
await tester.pumpWidget(
|
||||
new MaterialApp(
|
||||
home: new Scaffold(
|
||||
|
||||
Reference in New Issue
Block a user