Prefer void to null (#22977)
* Future<void> main * Future<void>.delayed * prefer_void_to_Null * address review comments
This commit is contained in:
committed by
GitHub
parent
5efe095895
commit
0fb84e96c7
@@ -136,12 +136,12 @@ class CalculationManager {
|
||||
// isolates do not have access to the root bundle. However, the loading
|
||||
// process is asynchronous, so the UI will not block while the file is
|
||||
// loaded.
|
||||
rootBundle.loadString('services/data.json').then<Null>((String data) {
|
||||
rootBundle.loadString('services/data.json').then<void>((String data) {
|
||||
if (isRunning) {
|
||||
final CalculationMessage message = 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<CalculationMessage>(_calculate, message).then<Null>((Isolate isolate) {
|
||||
Isolate.spawn<CalculationMessage>(_calculate, message).then<void>((Isolate isolate) {
|
||||
if (!isRunning) {
|
||||
isolate.kill(priority: Isolate.immediate);
|
||||
} else {
|
||||
|
||||
@@ -16,7 +16,7 @@ void main() {
|
||||
final Finder finder = find.byType(GestureDemo);
|
||||
|
||||
MaterialColor getSwatch() => tester.state<GestureDemoState>(finder).swatch;
|
||||
Future<Null> tap() async {
|
||||
Future<void> tap() async {
|
||||
final Offset topLeft = tester.getTopLeft(finder);
|
||||
await tester.tapAt(tester.getSize(finder).center(topLeft));
|
||||
await tester.pump(const Duration(seconds: 1));
|
||||
|
||||
Reference in New Issue
Block a user