implicit-casts: false (#47199)

This commit is contained in:
Alexandre Ardhuin
2019-12-19 08:23:01 +01:00
committed by Flutter GitHub Bot
parent 2b4b6eef5d
commit c235998acf
21 changed files with 47 additions and 95 deletions

View File

@@ -20,7 +20,7 @@ class FastScrollLargeImagesMemoryTest extends MemoryTest {
);
@override
AndroidDevice get device => super.device;
AndroidDevice get device => super.device as AndroidDevice;
@override
int get iterationCount => 5;

View File

@@ -4,10 +4,11 @@
import 'dart:async';
import 'dart:io' show File;
import 'package:flutter/foundation.dart';
import 'package:flutter_driver/flutter_driver.dart';
import 'package:meta/meta.dart';
import 'package:path/path.dart' as path;
import 'package:flutter_driver/flutter_driver.dart';
import 'package:collection/collection.dart';
const String _kPathParent = 'test_driver/goldens/';
@@ -43,8 +44,7 @@ class DriverScreenShotTester {
Future<bool> compareScreenshots(List<int> screenshot) async {
final File file = File(_getImageFilePath());
final List<int> matcher = await file.readAsBytes();
final Function listEquals = const ListEquality<int>().equals;
return listEquals(screenshot, matcher);
return listEquals<int>(screenshot, matcher);
}
/// Returns a bytes representation of a screenshot on the current screen.

View File

@@ -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);

View File

@@ -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));