@@ -92,9 +92,9 @@ void main() {
92
92
}
93
93
94
94
/// Set up an inbox view with lots of interesting content.
95
- Future <void > setupVarious (WidgetTester tester) async {
95
+ Future <void > setupVarious (WidgetTester tester, { int ? sub1Color} ) async {
96
96
final stream1 = eg.stream (streamId: 1 , name: 'stream 1' );
97
- final sub1 = eg.subscription (stream1);
97
+ final sub1 = eg.subscription (stream1, color : sub1Color );
98
98
final stream2 = eg.stream (streamId: 2 , name: 'stream 2' );
99
99
final sub2 = eg.subscription (stream2);
100
100
@@ -467,6 +467,24 @@ void main() {
467
467
checkAppearsUncollapsed (tester, 1 , findSectionContent);
468
468
});
469
469
470
+ testWidgets ('uncollapsed header changes background color when [subscription.color] changes' , (tester) async {
471
+ final initialColor = Colors .indigo.value;
472
+
473
+ await setupVarious (tester, sub1Color: initialColor);
474
+ checkAppearsUncollapsed (tester, 1 , find.text ('specific topic' ));
475
+
476
+ check (streamHeaderBackgroundColor (tester, 1 ))
477
+ .equals (StreamColorSwatch .light (initialColor).barBackground);
478
+
479
+ final newColor = Colors .orange.value;
480
+ store.handleEvent (SubscriptionUpdateEvent (id: 1 , streamId: 1 ,
481
+ property: SubscriptionProperty .color, value: newColor));
482
+ await tester.pump ();
483
+
484
+ check (streamHeaderBackgroundColor (tester, 1 ))
485
+ .equals (StreamColorSwatch .light (newColor).barBackground);
486
+ });
487
+
470
488
testWidgets ('collapse stream section when partially offscreen: '
471
489
'header remains sticky at top' , (tester) async {
472
490
await setupVarious (tester);
0 commit comments