Revert flutter/flutter#19592 (#19861)

It was causing problems rolling Flutter into Fuchsia
This commit is contained in:
Todd Volkert
2018-07-27 08:44:39 -07:00
committed by GitHub
parent 8b05629658
commit 00aac68e2d
575 changed files with 41035 additions and 41036 deletions

View File

@@ -456,7 +456,7 @@ class GlobalMaterialLocalizations implements MaterialLocalizations {
/// Most internationalized apps will use [GlobalMaterialLocalizations.delegates]
/// as the value of [MaterialApp.localizationsDelegates] to include
/// the localizations for both the material and widget libraries.
static const LocalizationsDelegate<MaterialLocalizations> delegate = _MaterialLocalizationsDelegate();
static const LocalizationsDelegate<MaterialLocalizations> delegate = const _MaterialLocalizationsDelegate();
/// A value for [MaterialApp.localizationsDelegates] that's typically used by
/// internationalized apps.
@@ -477,13 +477,13 @@ class GlobalMaterialLocalizations implements MaterialLocalizations {
/// // ...
/// )
/// ```
static const List<LocalizationsDelegate<dynamic>> delegates = <LocalizationsDelegate<dynamic>>[
static const List<LocalizationsDelegate<dynamic>> delegates = const <LocalizationsDelegate<dynamic>>[
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
];
}
const Map<String, TimeOfDayFormat> _icuTimeOfDayToEnum = <String, TimeOfDayFormat>{
const Map<String, TimeOfDayFormat> _icuTimeOfDayToEnum = const <String, TimeOfDayFormat>{
'HH:mm': TimeOfDayFormat.HH_colon_mm,
'HH.mm': TimeOfDayFormat.HH_dot_mm,
"HH 'h' mm": TimeOfDayFormat.frenchCanadian,
@@ -538,7 +538,7 @@ class _MaterialLocalizationsDelegate extends LocalizationsDelegate<MaterialLocal
// Watch out: this list must match the one in the GlobalMaterialLocalizations
// class doc and the list we test, see test/translations_test.dart.
static const List<String> _supportedLanguages = <String>[
static const List<String> _supportedLanguages = const <String>[
'ar', // Arabic
'bg', // Bulgarian
'bs', // Bosnian

View File

@@ -31,7 +31,7 @@ class GlobalWidgetsLocalizations implements WidgetsLocalizations {
}
// See http://en.wikipedia.org/wiki/Right-to-left
static const List<String> _rtlLanguages = <String>[
static const List<String> _rtlLanguages = const <String>[
'ar', // Arabic
'fa', // Farsi
'he', // Hebrew
@@ -60,7 +60,7 @@ class GlobalWidgetsLocalizations implements WidgetsLocalizations {
/// to create an instance of this class.
///
/// [WidgetsApp] automatically adds this value to [WidgetApp.localizationsDelegates].
static const LocalizationsDelegate<WidgetsLocalizations> delegate = _WidgetsLocalizationsDelegate();
static const LocalizationsDelegate<WidgetsLocalizations> delegate = const _WidgetsLocalizationsDelegate();
}
class _WidgetsLocalizationsDelegate extends LocalizationsDelegate<WidgetsLocalizations> {

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: ValueKey<String>('outer')),
const LocalizationTracker(key: const ValueKey<String>('outer')),
new Localizations(
locale: const Locale('zh', 'CN'),
delegates: GlobalMaterialLocalizations.delegates,
child: const LocalizationTracker(key: ValueKey<String>('inner')),
child: const LocalizationTracker(key: const ValueKey<String>('inner')),
),
],
),
@@ -32,8 +32,8 @@ void main() {
await tester.pumpWidget(
new MaterialApp(
supportedLocales: const <Locale>[
Locale('en', 'US'),
Locale('es', 'ES'),
const Locale('en', 'US'),
const Locale('es', 'ES'),
],
localizationsDelegates: <LocalizationsDelegate<dynamic>>[
new _DummyLocalizationsDelegate(),
@@ -56,8 +56,8 @@ void main() {
GlobalMaterialLocalizations.delegate,
],
supportedLocales: const <Locale>[
Locale('es', 'ES'),
Locale('zh'),
const Locale('es', 'ES'),
const 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>[
Locale('en', 'US'),
Locale('fr', 'CA'),
const Locale('en', 'US'),
const 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>[
Locale('en', 'US'),
const 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>[
Locale('en', 'US'),
Locale('fr', 'CA'),
const Locale('en', 'US'),
const 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>[
Locale('en', 'US'),
Locale('es', 'es'),
const Locale('en', 'US'),
const Locale('es', 'es'),
],
}) {
return new MaterialApp(
@@ -164,9 +164,9 @@ void main() {
const FooMaterialLocalizationsDelegate(supportedLanguage: 'de', backButtonTooltip: 'DE'),
],
supportedLocales: const <Locale>[
Locale('en', ''),
Locale('fr', ''),
Locale('de', ''),
const Locale('en', ''),
const Locale('fr', ''),
const 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 = <Locale>[
Locale('en', 'GB'), // HH
Locale('es', 'ES'), // H
const List<Locale> locales = const <Locale>[
const Locale('en', 'GB'), // HH
const 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 = <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'];
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'];
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>[
Locale('en', 'US'),
Locale('en', 'GB'),
const Locale('en', 'US'),
const 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 = Locale('en', 'US');
const Locale locale = const Locale('en', 'US');
BuildContext pageContext;
await tester.pumpWidget(
@@ -483,8 +483,8 @@ void main() {
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: const <Locale>[
Locale('en', 'GB'),
Locale('ar', 'EG'),
const Locale('en', 'GB'),
const Locale('ar', 'EG'),
],
buildContent: (BuildContext context) {
pageContext = context;
@@ -527,9 +527,9 @@ void main() {
await tester.pumpWidget(
buildFrame(
supportedLocales: const <Locale>[
Locale('zh', 'CN'),
Locale('en', 'GB'),
Locale('en', 'CA'),
const Locale('zh', 'CN'),
const Locale('en', 'GB'),
const 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.
OnlyRTLDefaultWidgetsLocalizationsDelegate(),
const OnlyRTLDefaultWidgetsLocalizationsDelegate(),
],
child: new Builder(
builder: (BuildContext context) {