SlackSource.fromJson constructor

SlackSource.fromJson(
  1. Object? j
)

Implementation

factory SlackSource.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return SlackSource(
    channels: switch (json['channels']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) SlackSource_SlackChannels.fromJson(i),
      ],
      _ => throw const FormatException('"channels" is not a list'),
    },
  );
}