Unverified Commit dcd24ef0 authored by Mateus Felipe C. C. Pinto's avatar Mateus Felipe C. C. Pinto Committed by GitHub

Simplify assertion in `AsyncSnapshot` (#135899)

Simplify assertion in `AsyncSnapshot`.

Fixes #135731.
parent 90ea6eef
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment