|
1 | | - |
2 | | -import 'package:flutter/widgets.dart'; |
3 | | - |
4 | | -import '../api/model/model.dart'; |
5 | | - |
6 | | -// ignore_for_file: constant_identifier_names |
7 | | - |
8 | | -/// Identifiers for Zulip's custom icons. |
9 | | -/// |
10 | | -/// Use these with the [Icon] widget, in the same way as one uses |
11 | | -/// the members of the [Icons] class from Flutter's Material library. |
12 | | -abstract final class ZulipIcons { |
13 | | - // Generated code; do not edit. |
14 | | - // |
15 | | - // To add a new icon, or otherwise edit the set of icons: |
16 | | - // |
17 | | - // * Add an SVG file in `assets/icons/`, |
18 | | - // or otherwise edit the SVG files there. |
19 | | - // The files' names (before ".svg") should be valid Dart identifiers. |
20 | | - // |
21 | | - // * Then run the command `tools/icons/build-icon-font`. |
22 | | - // That will update this file and the generated icon font, |
23 | | - // `assets/icons/ZulipIcons.ttf`. |
24 | | - // |
25 | | - // BEGIN GENERATED ICON DATA |
| 1 | + |
| 2 | +import 'package:flutter/widgets.dart'; |
| 3 | + |
| 4 | +import '../api/model/model.dart'; |
| 5 | + |
| 6 | +// ignore_for_file: constant_identifier_names |
| 7 | + |
| 8 | +/// Identifiers for Zulip's custom icons. |
| 9 | +/// |
| 10 | +/// Use these with the [Icon] widget, in the same way as one uses |
| 11 | +/// the members of the [Icons] class from Flutter's Material library. |
| 12 | +abstract final class ZulipIcons { |
| 13 | + // Generated code; do not edit. |
| 14 | + // |
| 15 | + // To add a new icon, or otherwise edit the set of icons: |
| 16 | + // |
| 17 | + // * Add an SVG file in `assets/icons/`, |
| 18 | + // or otherwise edit the SVG files there. |
| 19 | + // The files' names (before ".svg") should be valid Dart identifiers. |
| 20 | + // |
| 21 | + // * Then run the command `tools/icons/build-icon-font`. |
| 22 | + // That will update this file and the generated icon font, |
| 23 | + // `assets/icons/ZulipIcons.ttf`. |
| 24 | + // |
| 25 | + // BEGIN GENERATED ICON DATA |
26 | 26 |
|
27 | 27 | /// The Zulip custom icon "arrow_down". |
28 | 28 | static const IconData arrow_down = IconData(0xf101, fontFamily: "Zulip Icons"); |
@@ -198,34 +198,39 @@ abstract final class ZulipIcons { |
198 | 198 | /// The Zulip custom icon "unmute". |
199 | 199 | static const IconData unmute = IconData(0xf13a, fontFamily: "Zulip Icons"); |
200 | 200 |
|
201 | | - // END GENERATED ICON DATA |
202 | | -} |
203 | | - |
204 | | -IconData iconDataForStream(ZulipStream stream) { |
205 | | - // TODO: these icons aren't quite right yet; |
206 | | - // see this message and the one after it: |
207 | | - // https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/design.3A.20.23F117.20.22Inbox.22.20screen/near/1680637 |
208 | | - return switch(stream) { |
209 | | - ZulipStream(isWebPublic: true) => ZulipIcons.globe, |
210 | | - ZulipStream(inviteOnly: true) => ZulipIcons.lock, |
211 | | - ZulipStream() => ZulipIcons.hash_sign, |
212 | | - }; |
213 | | -} |
214 | | - |
215 | | -IconData? iconDataForTopicVisibilityPolicy(UserTopicVisibilityPolicy policy) { |
216 | | - switch (policy) { |
217 | | - case UserTopicVisibilityPolicy.muted: |
218 | | - return ZulipIcons.mute; |
219 | | - case UserTopicVisibilityPolicy.unmuted: |
220 | | - return ZulipIcons.unmute; |
221 | | - case UserTopicVisibilityPolicy.followed: |
222 | | - return ZulipIcons.follow; |
223 | | - case UserTopicVisibilityPolicy.none: |
224 | | - return null; |
225 | | - case UserTopicVisibilityPolicy.unknown: |
226 | | - // This case is unreachable (or should be) because we keep `unknown` out |
227 | | - // of our data structures. We plan to remove the `unknown` case in #1074. |
228 | | - assert(false); |
229 | | - return null; |
230 | | - } |
231 | | -} |
| 201 | + /// The Zulip custom icon "video". |
| 202 | + static const IconData video = IconData(0xf13b, fontFamily: "Zulip Icons"); |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | + // END GENERATED ICON DATA |
| 207 | +} |
| 208 | + |
| 209 | +IconData iconDataForStream(ZulipStream stream) { |
| 210 | + // TODO: these icons aren't quite right yet; |
| 211 | + // see this message and the one after it: |
| 212 | + // https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/design.3A.20.23F117.20.22Inbox.22.20screen/near/1680637 |
| 213 | + return switch(stream) { |
| 214 | + ZulipStream(isWebPublic: true) => ZulipIcons.globe, |
| 215 | + ZulipStream(inviteOnly: true) => ZulipIcons.lock, |
| 216 | + ZulipStream() => ZulipIcons.hash_sign, |
| 217 | + }; |
| 218 | +} |
| 219 | + |
| 220 | +IconData? iconDataForTopicVisibilityPolicy(UserTopicVisibilityPolicy policy) { |
| 221 | + switch (policy) { |
| 222 | + case UserTopicVisibilityPolicy.muted: |
| 223 | + return ZulipIcons.mute; |
| 224 | + case UserTopicVisibilityPolicy.unmuted: |
| 225 | + return ZulipIcons.unmute; |
| 226 | + case UserTopicVisibilityPolicy.followed: |
| 227 | + return ZulipIcons.follow; |
| 228 | + case UserTopicVisibilityPolicy.none: |
| 229 | + return null; |
| 230 | + case UserTopicVisibilityPolicy.unknown: |
| 231 | + // This case is unreachable (or should be) because we keep `unknown` out |
| 232 | + // of our data structures. We plan to remove the `unknown` case in #1074. |
| 233 | + assert(false); |
| 234 | + return null; |
| 235 | + } |
| 236 | +} |
0 commit comments