Simplify assertion in AsyncSnapshot
(#135899)
Simplify assertion in `AsyncSnapshot`. Fixes #135731.
This commit is contained in:
parent
90ea6eef7e
commit
dcd24ef0fa
@ -200,7 +200,7 @@ class AsyncSnapshot<T> {
|
||||
/// and optionally either [data] or [error] with an optional [stackTrace]
|
||||
/// (but not both data and error).
|
||||
const AsyncSnapshot._(this.connectionState, this.data, this.error, this.stackTrace)
|
||||
: assert(!(data != null && error != null)),
|
||||
: assert(data == null || error == null),
|
||||
assert(stackTrace == null || error != null);
|
||||
|
||||
/// Creates an [AsyncSnapshot] in [ConnectionState.none] with null data and error.
|
||||
|
Loading…
x
Reference in New Issue
Block a user