@@ -108,10 +108,9 @@ class MessageGeneration {
108108 // Exclude messages with no translation and translations with no matching
109109 // original message (e.g. if we're using some messages from a larger
110110 // catalog)
111- var usableTranslations =
112- translations
113- .where ((translation) => translation.originalMessages.isNotEmpty)
114- .toList ();
111+ var usableTranslations = translations
112+ .where ((translation) => translation.originalMessages.isNotEmpty)
113+ .toList ();
115114 for (var translation in usableTranslations) {
116115 for (var original in translation.originalMessages) {
117116 original.addTranslation (locale, translation.message);
@@ -136,8 +135,10 @@ class MessageGeneration {
136135 for (var translation in usableTranslations) {
137136 // Some messages we generate as methods in this class. Simpler ones
138137 // we inline in the map from names to messages.
139- var messagesThatNeedMethods =
140- translation.originalMessages.where (_hasArguments).toSet ().toList ();
138+ var messagesThatNeedMethods = translation.originalMessages
139+ .where (_hasArguments)
140+ .toSet ()
141+ .toList ();
141142 for (var original in messagesThatNeedMethods) {
142143 output
143144 ..write (' ' )
@@ -151,17 +152,18 @@ class MessageGeneration {
151152
152153 // Now write the map of names to either the direct translation or to a
153154 // method.
154- var names = (usableTranslations
155- .expand ((translation) => translation.originalMessages)
156- .toSet ()
157- .toList ()
158- ..sort ((a, b) => a.name.compareTo (b.name)))
159- .map (
160- (original) =>
161- " '${Message .escapeString (original .name )}'"
162- ': ${_mapReference (original , locale )}' ,
163- )
164- .join (',\n ' );
155+ var names =
156+ (usableTranslations
157+ .expand ((translation) => translation.originalMessages)
158+ .toSet ()
159+ .toList ()
160+ ..sort ((a, b) => a.name.compareTo (b.name)))
161+ .map (
162+ (original) =>
163+ " '${Message .escapeString (original .name )}'"
164+ ': ${_mapReference (original , locale )}' ,
165+ )
166+ .join (',\n ' );
165167 output
166168 ..write (names)
167169 ..write ('\n };\n }\n ' );
@@ -184,7 +186,8 @@ class MessageGeneration {
184186
185187 /// [generateIndividualMessageFile] for the beginning of the file,
186188 /// parameterized by [locale] .
187- String prologue (String locale) => '''
189+ String prologue (String locale) =>
190+ '''
188191// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
189192// This is a library that provides messages for a $locale locale. All the
190193// messages from the main program should be duplicated here with the same
@@ -250,10 +253,9 @@ ${releaseMode ? overrideLookup() : ''}''';
250253 output.write ('Map<String, LibraryLoader> _deferredLibraries = {\n ' );
251254 for (var rawLocale in allLocales) {
252255 var locale = Intl .canonicalizedLocale (rawLocale);
253- var loadOperation =
254- (useDeferredLoading)
255- ? " '$locale ': ${libraryName (locale )}.loadLibrary,\n "
256- : " '$locale ': () => Future.value(null),\n " ;
256+ var loadOperation = (useDeferredLoading)
257+ ? " '$locale ': ${libraryName (locale )}.loadLibrary,\n "
258+ : " '$locale ': () => Future.value(null),\n " ;
257259 output.write (loadOperation);
258260 }
259261 output.write ('};\n ' );
@@ -273,7 +275,8 @@ ${releaseMode ? overrideLookup() : ''}''';
273275
274276 /// Constant string used in [generateLocalesImportFile] for the beginning of
275277 /// the file.
276- String get localesPrologue => """
278+ String get localesPrologue =>
279+ """
277280// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
278281// This is a library that looks up messages for specific locales by
279282// delegating to the appropriate library.
@@ -373,7 +376,8 @@ abstract class DataMapMessageGeneration extends MessageGeneration {
373376 /// We import the main file so as to get the shared code to evaluate
374377 /// the JSON data.
375378 @override
376- String get extraImports => '''
379+ String get extraImports =>
380+ '''
377381import 'dart:convert';
378382
379383import '${generatedFilePrefix }messages_all.dart' show evaluateJsonTemplate;
@@ -393,7 +397,8 @@ import '${generatedFilePrefix}messages_all.dart' show evaluateJsonTemplate;
393397 );
394398
395399 @override
396- String get mainPrologue => """${super .mainPrologue }
400+ String get mainPrologue =>
401+ """${super .mainPrologue }
397402import 'package:$intlImportPath /intl.dart';
398403""" ;
399404
@@ -472,7 +477,8 @@ String? evaluateJsonTemplate(dynamic input, List<dynamic> args) {
472477
473478 /// Constant string used in [generateFlutterImportFile] for the beginning of
474479 /// the file.
475- String get flutterPrologue => """
480+ String get flutterPrologue =>
481+ """
476482// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
477483// This is a library that looks up messages for specific locales by
478484// delegating to the appropriate library.
@@ -619,7 +625,8 @@ class JsonMessageGeneration extends DataMapMessageGeneration {
619625/// Message generator that stores translations in a constant map.
620626class CodeMapMessageGeneration extends JsonMessageGeneration {
621627 @override
622- String get extraImports => '''
628+ String get extraImports =>
629+ '''
623630${super .extraImports }
624631import 'dart:collection';
625632''' ;
@@ -753,10 +760,9 @@ class TranslatedMessage {
753760
754761 /// For backward compatibility, we still have the originalMessage API.
755762 MainMessage get originalMessage => originalMessages.first;
756- set originalMessage (MainMessage m) =>
757- originalMessages
758- ..clear ()
759- ..add (m);
763+ set originalMessage (MainMessage m) => originalMessages
764+ ..clear ()
765+ ..add (m);
760766
761767 TranslatedMessage (this .id, this .translated, this .originalMessages);
762768
0 commit comments