File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 1
1
2
2
import 'package:flutter/widgets.dart' ;
3
3
4
+ import '../api/model/model.dart' ;
5
+
4
6
// ignore_for_file: constant_identifier_names
5
7
6
8
/// Identifiers for Zulip's custom icons.
@@ -63,3 +65,14 @@ abstract final class ZulipIcons {
63
65
64
66
// END GENERATED ICON DATA
65
67
}
68
+
69
+ IconData iconDataForStream (ZulipStream stream) {
70
+ // TODO: these icons aren't quite right yet;
71
+ // see this message and the one after it:
72
+ // https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/design.3A.20.23F117.20.22Inbox.22.20screen/near/1680637
73
+ return switch (stream) {
74
+ ZulipStream (isWebPublic: true ) => ZulipIcons .globe,
75
+ ZulipStream (inviteOnly: true ) => ZulipIcons .lock,
76
+ ZulipStream () => ZulipIcons .hash_sign,
77
+ };
78
+ }
Original file line number Diff line number Diff line change @@ -385,13 +385,7 @@ class _StreamHeaderItem extends _HeaderItem {
385
385
});
386
386
387
387
@override get title => subscription.name;
388
- @override get icon => switch (subscription) {
389
- // TODO these icons aren't quite right yet; see this message and the following:
390
- // https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/design.3A.20.23F117.20.22Inbox.22.20screen/near/1680637
391
- Subscription (isWebPublic: true ) => ZulipIcons .globe,
392
- Subscription (inviteOnly: true ) => ZulipIcons .lock,
393
- Subscription () => ZulipIcons .hash_sign,
394
- };
388
+ @override get icon => iconDataForStream (subscription);
395
389
@override get collapsedIconColor => subscription.colorSwatch ().iconOnPlainBackground;
396
390
@override get uncollapsedIconColor => subscription.colorSwatch ().iconOnBarBackground;
397
391
@override get uncollapsedBackgroundColor =>
Original file line number Diff line number Diff line change @@ -88,12 +88,8 @@ class MessageListAppBarTitle extends StatelessWidget {
88
88
final Narrow narrow;
89
89
90
90
Widget _buildStreamRow (ZulipStream ? stream, String text) {
91
- final icon = switch (stream) {
92
- ZulipStream (isWebPublic: true ) => ZulipIcons .globe,
93
- ZulipStream (inviteOnly: true ) => ZulipIcons .lock,
94
- ZulipStream () => ZulipIcons .hash_sign,
95
- null => null , // A null [Icon.icon] makes a blank space.
96
- };
91
+ // A null [Icon.icon] makes a blank space.
92
+ final icon = (stream != null ) ? iconDataForStream (stream) : null ;
97
93
return Row (
98
94
mainAxisSize: MainAxisSize .min,
99
95
// TODO(design): The vertical alignment of the stream privacy icon is a bit ad hoc.
You can’t perform that action at this time.
0 commit comments