@@ -104,6 +104,8 @@ void main() {
104
104
final stream = valueNotifier.toValueStream ();
105
105
106
106
expect (stream.value, 0 );
107
+ expect (stream.valueOrNull, 0 );
108
+ expect (stream.hasValue, isTrue);
107
109
expect (
108
110
stream,
109
111
emitsInOrder ([1 , 2 , 3 ]),
@@ -120,6 +122,8 @@ void main() {
120
122
final stream = valueNotifier.toValueStream (replayValue: true );
121
123
122
124
expect (stream.value, 0 );
125
+ expect (stream.valueOrNull, 0 );
126
+ expect (stream.hasValue, isTrue);
123
127
expect (
124
128
stream,
125
129
emitsInOrder ([0 , 1 , 2 , 3 ]),
@@ -298,15 +302,23 @@ void main() {
298
302
});
299
303
300
304
test ('Has no error' , () {
305
+ final notReplay = () => ValueNotifier (0 ).toValueStream ();
301
306
expect (
302
- () => ValueNotifier ( 0 ). toValueStream ().error,
307
+ () => notReplay ().error,
303
308
throwsA (anything),
304
309
);
310
+ expect (notReplay ().errorOrNull, isNull);
311
+ expect (notReplay ().stackTrace, isNull);
312
+ expect (notReplay ().hasError, isFalse);
305
313
314
+ final replay = () => ValueNotifier (0 ).toValueStream (replayValue: true );
306
315
expect (
307
- () => ValueNotifier ( 0 ). toValueStream (replayValue : true ).error,
316
+ () => replay ( ).error,
308
317
throwsA (anything),
309
318
);
319
+ expect (replay ().errorOrNull, isNull);
320
+ expect (replay ().stackTrace, isNull);
321
+ expect (replay ().hasError, isFalse);
310
322
});
311
323
});
312
324
}
0 commit comments