re-re-enable lint unnecessary_const (#20103)

This commit is contained in:
Alexandre Ardhuin
2018-08-02 12:02:32 +02:00
committed by GitHub
parent ffbaa97b50
commit eda03e2586
561 changed files with 41037 additions and 41036 deletions

View File

@@ -11,11 +11,11 @@ void main() {
await tester.pumpWidget(new MaterialApp( // Creates the outer Localizations widget.
home: new ListView(
children: <Widget>[
const LocalizationTracker(key: const ValueKey<String>('outer')),
const LocalizationTracker(key: ValueKey<String>('outer')),
new Localizations(
locale: const Locale('zh', 'CN'),
delegates: GlobalMaterialLocalizations.delegates,
child: const LocalizationTracker(key: const ValueKey<String>('inner')),
child: const LocalizationTracker(key: ValueKey<String>('inner')),
),
],
),
@@ -32,8 +32,8 @@ void main() {
await tester.pumpWidget(
new MaterialApp(
supportedLocales: const <Locale>[
const Locale('en', 'US'),
const Locale('es', 'ES'),
Locale('en', 'US'),
Locale('es', 'ES'),
],
localizationsDelegates: <LocalizationsDelegate<dynamic>>[
new _DummyLocalizationsDelegate(),
@@ -56,8 +56,8 @@ void main() {
GlobalMaterialLocalizations.delegate,
],
supportedLocales: const <Locale>[
const Locale('es', 'ES'),
const Locale('zh'),
Locale('es', 'ES'),
Locale('zh'),
],
home: new Container(),
)

View File

@@ -99,8 +99,8 @@ void main() {
await tester.pumpWidget(new MaterialApp(
locale: const Locale('en', 'US'),
supportedLocales: const <Locale>[
const Locale('en', 'US'),
const Locale('fr', 'CA'),
Locale('en', 'US'),
Locale('fr', 'CA'),
],
localizationsDelegates: GlobalMaterialLocalizations.delegates,
home: new Material(
@@ -144,7 +144,7 @@ void main() {
await tester.pumpWidget(new MaterialApp(
locale: const Locale('en', 'US'),
supportedLocales: const <Locale>[
const Locale('en', 'US'),
Locale('en', 'US'),
],
home: new Material(
child: new Builder(
@@ -182,8 +182,8 @@ void main() {
await tester.pumpWidget(new MaterialApp(
locale: const Locale('en', 'US'),
supportedLocales: const <Locale>[
const Locale('en', 'US'),
const Locale('fr', 'CA'),
Locale('en', 'US'),
Locale('fr', 'CA'),
],
localizationsDelegates: GlobalMaterialLocalizations.delegates,
home: new Material(

View File

@@ -43,8 +43,8 @@ Widget buildFrame({
WidgetBuilder buildContent,
LocaleResolutionCallback localeResolutionCallback,
Iterable<Locale> supportedLocales = const <Locale>[
const Locale('en', 'US'),
const Locale('es', 'es'),
Locale('en', 'US'),
Locale('es', 'es'),
],
}) {
return new MaterialApp(
@@ -164,9 +164,9 @@ void main() {
const FooMaterialLocalizationsDelegate(supportedLanguage: 'de', backButtonTooltip: 'DE'),
],
supportedLocales: const <Locale>[
const Locale('en', ''),
const Locale('fr', ''),
const Locale('de', ''),
Locale('en', ''),
Locale('fr', ''),
Locale('de', ''),
],
buildContent: (BuildContext context) {
// Should always be 'foo', no matter what the locale is

View File

@@ -106,9 +106,9 @@ void main() {
});
testWidgets('uses two-ring 24-hour dial for H and HH hour formats', (WidgetTester tester) async {
const List<Locale> locales = const <Locale>[
const Locale('en', 'GB'), // HH
const Locale('es', 'ES'), // H
const List<Locale> locales = <Locale>[
Locale('en', 'GB'), // HH
Locale('es', 'ES'), // H
];
for (Locale locale in locales) {
// Tap along the segment stretching from the center to the edge at
@@ -126,9 +126,9 @@ void main() {
}
});
const List<String> labels12To11 = const <String>['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'];
const List<String> labels12To11TwoDigit = const <String>['12', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11'];
const List<String> labels00To23 = const <String>['00', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'];
const List<String> labels12To11 = <String>['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'];
const List<String> labels12To11TwoDigit = <String>['12', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11'];
const List<String> labels00To23 = <String>['00', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'];
Future<Null> mediaQueryBoilerplate(WidgetTester tester, bool alwaysUse24HourFormat) async {
await tester.pumpWidget(

View File

@@ -142,8 +142,8 @@ Widget buildFrame({
WidgetBuilder buildContent,
LocaleResolutionCallback localeResolutionCallback,
List<Locale> supportedLocales = const <Locale>[
const Locale('en', 'US'),
const Locale('en', 'GB'),
Locale('en', 'US'),
Locale('en', 'GB'),
],
}) {
return new WidgetsApp(
@@ -202,7 +202,7 @@ void main() {
});
testWidgets('Localizations.localeFor in a WidgetsApp with an explicit locale', (WidgetTester tester) async {
const Locale locale = const Locale('en', 'US');
const Locale locale = Locale('en', 'US');
BuildContext pageContext;
await tester.pumpWidget(
@@ -483,8 +483,8 @@ void main() {
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: const <Locale>[
const Locale('en', 'GB'),
const Locale('ar', 'EG'),
Locale('en', 'GB'),
Locale('ar', 'EG'),
],
buildContent: (BuildContext context) {
pageContext = context;
@@ -527,9 +527,9 @@ void main() {
await tester.pumpWidget(
buildFrame(
supportedLocales: const <Locale>[
const Locale('zh', 'CN'),
const Locale('en', 'GB'),
const Locale('en', 'CA'),
Locale('zh', 'CN'),
Locale('en', 'GB'),
Locale('en', 'CA'),
],
buildContent: (BuildContext context) {
return new Text(Localizations.localeOf(context).toString());
@@ -608,7 +608,7 @@ void main() {
context: context,
delegates: const <OnlyRTLDefaultWidgetsLocalizationsDelegate>[
// Override: no matter what the locale, textDirection is always RTL.
const OnlyRTLDefaultWidgetsLocalizationsDelegate(),
OnlyRTLDefaultWidgetsLocalizationsDelegate(),
],
child: new Builder(
builder: (BuildContext context) {