11import 'dart:async' ;
22
3+ import 'package:flutter/foundation.dart' ;
34import 'package:flutter/widgets.dart' ;
45import 'package:rxdart/rxdart.dart' ;
56import 'package:rxdart_ext/rxdart_ext.dart' ;
@@ -46,7 +47,7 @@ class RxStreamBuilder<T> extends StatefulWidget {
4647 @override
4748 _RxStreamBuilderState <T > createState () => _RxStreamBuilderState ();
4849
49- /// Get latest value from stream or return `null` .
50+ /// Get latest value from stream or throw an [ArgumentError] .
5051 @visibleForTesting
5152 static T getInitialData <T >(ValueStream <T > stream) {
5253 if (stream is StateStream <T >) {
@@ -55,7 +56,7 @@ class RxStreamBuilder<T> extends StatefulWidget {
5556 if (stream.hasValue) {
5657 return stream.value;
5758 }
58- throw ArgumentError .value (stream, 'stream' , 'does not have value' );
59+ throw ArgumentError .value (stream, 'stream' , 'has no value' );
5960 }
6061}
6162
@@ -123,4 +124,12 @@ class _RxStreamBuilderState<T> extends State<RxStreamBuilder<T>> {
123124 subscription? .cancel ();
124125 subscription = null ;
125126 }
127+
128+ @override
129+ void debugFillProperties (DiagnosticPropertiesBuilder properties) {
130+ super .debugFillProperties (properties);
131+ properties.add (DiagnosticsProperty .lazy ('value' , () => value));
132+ properties.add (DiagnosticsProperty ('subscription' , subscription));
133+ properties.add (DiagnosticsProperty ('stream' , widget._stream));
134+ }
126135}
0 commit comments