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.