File tree Expand file tree Collapse file tree 3 files changed +6
-18
lines changed
packages/flutter_tools/test/integration.shard/test_data Expand file tree Collapse file tree 3 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -217,19 +217,6 @@ const String lookupFunctionTemplate = '''
217
217
}''' ;
218
218
219
219
const String lookupFunctionDeferredLoadingTemplate = '''
220
- /// Lazy load the library for web, on other platforms we return the
221
- /// localizations synchronously.
222
- Future<@(class)> _loadLibraryForWeb(
223
- Future<dynamic> Function() loadLibrary,
224
- @(class) Function() localizationClosure,
225
- ) {
226
- if (kIsWeb) {
227
- return loadLibrary().then((dynamic _) => localizationClosure());
228
- } else {
229
- return SynchronousFuture<@(class)>(localizationClosure());
230
- }
231
- }
232
-
233
220
Future<@(class)> @(lookupName)(Locale locale) {
234
221
@(lookupBody)
235
222
assert(false, '@(class).delegate failed to load unsupported locale "\$ locale"');
@@ -243,7 +230,7 @@ const String lookupBodyTemplate = '''@(lookupAllCodesSpecified)
243
230
244
231
const String switchClauseTemplate = '''case '@(case)': return @(localeClass)();''' ;
245
232
246
- const String switchClauseDeferredLoadingTemplate = '''case '@(case)': return _loadLibraryForWeb( @(library).loadLibrary, ( ) => @(library).@(localeClass)());''' ;
233
+ const String switchClauseDeferredLoadingTemplate = '''case '@(case)': return @(library).loadLibrary().then((dynamic _ ) => @(library).@(localeClass)());''' ;
247
234
248
235
const String nestedSwitchTemplate = '''case '@(languageCode)': {
249
236
switch (locale.@(code)) {
Original file line number Diff line number Diff line change @@ -1006,7 +1006,7 @@ import 'output-localization-file_zh.dart';
1006
1006
''' ));
1007
1007
});
1008
1008
1009
- test ('imports are deferred when useDeferredImports are set' , () {
1009
+ test ('imports are deferred and loaded when useDeferredImports are set' , () {
1010
1010
fs.currentDirectory.childDirectory ('lib' ).childDirectory ('l10n' )..createSync (recursive: true )
1011
1011
..childFile (defaultTemplateArbFileName).writeAsStringSync (singleMessageArbFileString);
1012
1012
@@ -1033,6 +1033,7 @@ import 'output-localization-file_zh.dart';
1033
1033
'''
1034
1034
import 'output-localization-file_en.dart' deferred as output-localization-file_en;
1035
1035
''' ));
1036
+ expect (localizationsFile, contains ('output-localization-file_en.loadLibrary()' ));
1036
1037
});
1037
1038
1038
1039
group ('DateTime tests' , () {
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ class Home extends StatelessWidget {
94
94
final List<String> results = [];
95
95
return Row(
96
96
children: <Widget>[
97
- ResultBuilder (
97
+ LocaleBuilder (
98
98
test: 'supportedLocales',
99
99
callback: (BuildContext context) {
100
100
results.add('--- supportedLocales tests ---');
@@ -254,8 +254,8 @@ class Home extends StatelessWidget {
254
254
]);
255
255
},
256
256
),
257
- Builder (
258
- builder : (BuildContext context) {
257
+ LocaleBuilder (
258
+ callback : (BuildContext context) {
259
259
try {
260
260
int n = 0;
261
261
for (final String result in results) {
You can’t perform that action at this time.
0 commit comments