Increase the strictness of our requiring explicit types (#7585)

...now that we have generic methods, their types need to be specified too.
This commit is contained in:
Ian Hickson
2017-01-23 01:04:31 -08:00
committed by GitHub
parent 99822088a7
commit 63aa1397a3
63 changed files with 134 additions and 127 deletions

View File

@@ -137,12 +137,12 @@ class CalculationManager {
// the root bundle (see https://github.com/flutter/flutter/issues/3294).
// However, the loading process is asynchronous, so the UI will not block
// while the file is loaded.
rootBundle.loadString('services/data.json').then((String data) {
rootBundle.loadString('services/data.json').then<Null>((String data) {
if (isRunning) {
CalculationMessage message = new CalculationMessage(data, _receivePort.sendPort);
final CalculationMessage message = new CalculationMessage(data, _receivePort.sendPort);
// Spawn an isolate to JSON-parse the file contents. The JSON parsing
// is synchronous, so if done in the main isolate, the UI would block.
Isolate.spawn(_calculate, message).then((Isolate isolate) {
Isolate.spawn(_calculate, message).then<Null>((Isolate isolate) {
if (!isRunning) {
isolate.kill(priority: Isolate.IMMEDIATE);
} else {

View File

@@ -4,7 +4,7 @@
import 'package:flutter/material.dart';
typedef Widget TextTransformer(String name, String text);
typedef Widget _TextTransformer(String name, String text);
// From https://en.wikiquote.org/wiki/2001:_A_Space_Odyssey_(film)
const String _kDialogText = '''
@@ -84,7 +84,7 @@ class _StyledTextDemoState extends State<StyledTextDemo> {
_toText = toStyledText;
}
TextTransformer _toText;
_TextTransformer _toText;
void _handleTap() {
setState(() {
@@ -95,7 +95,7 @@ class _StyledTextDemoState extends State<StyledTextDemo> {
@override
Widget build(BuildContext context) {
List<Widget> lines = _kNameLines
.map((List<String> nameAndText) => Function.apply(_toText, nameAndText))
.map<Widget>((List<String> nameAndText) => _toText(nameAndText[0], nameAndText[1]))
.toList();
List<Widget> children = <Widget>[];