From dcd24ef0facd709b61f484b4a887e2e3a75f5a73 Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Fri, 6 Oct 2023 21:58:05 -0300 Subject: [PATCH] Simplify assertion in `AsyncSnapshot` (#135899) Simplify assertion in `AsyncSnapshot`. Fixes #135731. --- packages/flutter/lib/src/widgets/async.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/widgets/async.dart b/packages/flutter/lib/src/widgets/async.dart index b8aed1f94fc8d..d521bc3d19d31 100644 --- a/packages/flutter/lib/src/widgets/async.dart +++ b/packages/flutter/lib/src/widgets/async.dart @@ -200,7 +200,7 @@ class AsyncSnapshot { /// 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.