forked from firka/flutter
Remove unnecessary null checks in examples/ (#118848)
This commit is contained in:
committed by
GitHub
parent
54217bd4b1
commit
98c18ca93f
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user