|  | 
| 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"); | 
| @@ -201,36 +201,34 @@ abstract final class ZulipIcons { | 
| 201 | 201 |   /// The Zulip custom icon "video". | 
| 202 | 202 |   static const IconData video = IconData(0xf13b, fontFamily: "Zulip Icons"); | 
| 203 | 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 |  | -} | 
|  | 204 | +  // END GENERATED ICON DATA | 
|  | 205 | +} | 
|  | 206 | + | 
|  | 207 | +IconData iconDataForStream(ZulipStream stream) { | 
|  | 208 | +  // TODO: these icons aren't quite right yet; | 
|  | 209 | +  //   see this message and the one after it: | 
|  | 210 | +  //   https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/design.3A.20.23F117.20.22Inbox.22.20screen/near/1680637 | 
|  | 211 | +  return switch(stream) { | 
|  | 212 | +    ZulipStream(isWebPublic: true) => ZulipIcons.globe, | 
|  | 213 | +    ZulipStream(inviteOnly: true) => ZulipIcons.lock, | 
|  | 214 | +    ZulipStream() => ZulipIcons.hash_sign, | 
|  | 215 | +  }; | 
|  | 216 | +} | 
|  | 217 | + | 
|  | 218 | +IconData? iconDataForTopicVisibilityPolicy(UserTopicVisibilityPolicy policy) { | 
|  | 219 | +  switch (policy) { | 
|  | 220 | +    case UserTopicVisibilityPolicy.muted: | 
|  | 221 | +      return ZulipIcons.mute; | 
|  | 222 | +    case UserTopicVisibilityPolicy.unmuted: | 
|  | 223 | +      return ZulipIcons.unmute; | 
|  | 224 | +    case UserTopicVisibilityPolicy.followed: | 
|  | 225 | +      return ZulipIcons.follow; | 
|  | 226 | +    case UserTopicVisibilityPolicy.none: | 
|  | 227 | +      return null; | 
|  | 228 | +    case UserTopicVisibilityPolicy.unknown: | 
|  | 229 | +      // This case is unreachable (or should be) because we keep `unknown` out | 
|  | 230 | +      // of our data structures. We plan to remove the `unknown` case in #1074. | 
|  | 231 | +      assert(false); | 
|  | 232 | +      return null; | 
|  | 233 | +  } | 
|  | 234 | +} | 
0 commit comments