Remove unnecessary null checks in examples/ (#118848)

This commit is contained in:
Michael Goderbauer
2023-01-19 20:06:04 -08:00
committed by GitHub
parent 54217bd4b1
commit 98c18ca93f
2 changed files with 3 additions and 22 deletions

View File

@@ -17,11 +17,7 @@ typedef OnResultListener = void Function(String result);
// in real-world applications.
class Calculator {
Calculator({ required this.onProgressListener, required this.onResultListener, String? data })
: assert(onProgressListener != null),
assert(onResultListener != null),
// In order to keep the example files smaller, we "cheat" a little and
// replicate our small json string into a 10,000-element array.
_data = _replicateJson(data, 10000);
: _data = _replicateJson(data, 10000);
final OnProgressListener onProgressListener;
final OnResultListener onResultListener;
@@ -87,9 +83,7 @@ class CalculationMessage {
// progress of the background computation.
class CalculationManager {
CalculationManager({ required this.onProgressListener, required this.onResultListener })
: assert(onProgressListener != null),
assert(onResultListener != null),
_receivePort = ReceivePort() {
: _receivePort = ReceivePort() {
_receivePort.listen(_handleMessage);
}