File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Expand file tree Collapse file tree 3 files changed +15
-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,13 @@ abstract final class ZulipIcons {
63
65
64
66
// END GENERATED ICON DATA
65
67
}
68
+
69
+ IconData iconDataFromStream (ZulipStream stream) {
70
+ // TODO: these icons aren't quite right yet; see:
71
+ // https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/design.3A.20.23F117.20.22Inbox.22.20screen/near/1680637
72
+ return switch (stream) {
73
+ ZulipStream (isWebPublic: true ) => ZulipIcons .globe,
74
+ ZulipStream (inviteOnly: true ) => ZulipIcons .lock,
75
+ ZulipStream () => ZulipIcons .hash_sign,
76
+ };
77
+ }
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 => iconDataFromStream (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 @@ -82,12 +82,8 @@ class MessageListAppBarTitle extends StatelessWidget {
82
82
final Narrow narrow;
83
83
84
84
Widget _buildStreamRow (ZulipStream ? stream, String text) {
85
- final icon = switch (stream) {
86
- ZulipStream (isWebPublic: true ) => ZulipIcons .globe,
87
- ZulipStream (inviteOnly: true ) => ZulipIcons .lock,
88
- ZulipStream () => ZulipIcons .hash_sign,
89
- null => null , // A null [Icon.icon] makes a blank space.
90
- };
85
+ // A null [Icon.icon] makes a blank space.
86
+ final icon = (stream != null ) ? iconDataFromStream (stream) : null ;
91
87
return Row (
92
88
mainAxisSize: MainAxisSize .min,
93
89
// 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