implicit-casts: false (#47199)
This commit is contained in:
committed by
Flutter GitHub Bot
parent
2b4b6eef5d
commit
c235998acf
@@ -53,10 +53,10 @@ Future<void> main(List<String> arguments) async {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
final String arbPathString = results['arb-dir'];
|
||||
final String outputFileString = results['output-localization-file'];
|
||||
final String templateArbFileName = results['template-arb-file'];
|
||||
final String classNameString = results['output-class'];
|
||||
final String arbPathString = results['arb-dir'] as String;
|
||||
final String outputFileString = results['output-localization-file'] as String;
|
||||
final String templateArbFileName = results['template-arb-file'] as String;
|
||||
final String classNameString = results['output-class'] as String;
|
||||
|
||||
const local.LocalFileSystem fs = local.LocalFileSystem();
|
||||
final LocalizationsGenerator localizationsGenerator = LocalizationsGenerator(fs);
|
||||
|
||||
@@ -599,8 +599,8 @@ class LocalizationsGenerator {
|
||||
for (File file in fileSystemEntityList) {
|
||||
final String filePath = file.path;
|
||||
if (arbFilenameRE.hasMatch(filePath)) {
|
||||
final Map<String, dynamic> arbContents = json.decode(file.readAsStringSync());
|
||||
String localeString = arbContents['@@locale'];
|
||||
final Map<String, dynamic> arbContents = json.decode(file.readAsStringSync()) as Map<String, dynamic>;
|
||||
String localeString = arbContents['@@locale'] as String;
|
||||
if (localeString == null) {
|
||||
final RegExpMatch arbFileMatch = arbFilenameLocaleRE.firstMatch(filePath);
|
||||
if (arbFileMatch == null) {
|
||||
@@ -653,7 +653,7 @@ class LocalizationsGenerator {
|
||||
void generateClassMethods() {
|
||||
Map<String, dynamic> bundle;
|
||||
try {
|
||||
bundle = json.decode(templateArbFile.readAsStringSync());
|
||||
bundle = json.decode(templateArbFile.readAsStringSync()) as Map<String, dynamic>;
|
||||
} on FileSystemException catch (e) {
|
||||
throw FileSystemException('Unable to read input arb file: $e');
|
||||
} on FormatException catch (e) {
|
||||
@@ -669,7 +669,7 @@ class LocalizationsGenerator {
|
||||
'Invalid key format: $key \n It has to be in camel case, cannot start '
|
||||
'with a number, and cannot contain non-alphanumeric characters.'
|
||||
);
|
||||
if (pluralValueRE.hasMatch(bundle[key]))
|
||||
if (pluralValueRE.hasMatch(bundle[key] as String))
|
||||
classMethods.add(genPluralMethod(bundle, key));
|
||||
else
|
||||
classMethods.add(genSimpleMethod(bundle, key));
|
||||
|
||||
Reference in New Issue
Block a user