Skip to content

Commit

Permalink
Merge pull request #45 from poppingmoon/emoji-role
Browse files Browse the repository at this point in the history
roleIdsThatCanBeUsedThisEmojiAsReactionを追加
  • Loading branch information
shiosyakeyakini-info authored Mar 30, 2024
2 parents fed9bf1 + b2ce6b6 commit 1bc0d04
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 29 deletions.
2 changes: 1 addition & 1 deletion lib/src/data/emoji_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class EmojiResponse with _$EmojiResponse {
String? license,
@Default(false) bool isSensitive,
@Default(false) bool localOnly,
//TODO: roleIdsThatCanBeUsedThisEmojiAsReaction
List<String>? roleIdsThatCanBeUsedThisEmojiAsReaction,
}) = _EmojiResponse;

factory EmojiResponse.fromJson(Map<String, dynamic> json) =>
Expand Down
70 changes: 54 additions & 16 deletions lib/src/data/emoji_response.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ mixin _$EmojiResponse {
String? get license => throw _privateConstructorUsedError;
bool get isSensitive => throw _privateConstructorUsedError;
bool get localOnly => throw _privateConstructorUsedError;
List<String>? get roleIdsThatCanBeUsedThisEmojiAsReaction =>
throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
Expand All @@ -52,7 +54,8 @@ abstract class $EmojiResponseCopyWith<$Res> {
@NullableUriConverter() Uri? url,
String? license,
bool isSensitive,
bool localOnly});
bool localOnly,
List<String>? roleIdsThatCanBeUsedThisEmojiAsReaction});
}

/// @nodoc
Expand All @@ -77,6 +80,7 @@ class _$EmojiResponseCopyWithImpl<$Res, $Val extends EmojiResponse>
Object? license = freezed,
Object? isSensitive = null,
Object? localOnly = null,
Object? roleIdsThatCanBeUsedThisEmojiAsReaction = freezed,
}) {
return _then(_value.copyWith(
id: null == id
Expand Down Expand Up @@ -115,6 +119,11 @@ class _$EmojiResponseCopyWithImpl<$Res, $Val extends EmojiResponse>
? _value.localOnly
: localOnly // ignore: cast_nullable_to_non_nullable
as bool,
roleIdsThatCanBeUsedThisEmojiAsReaction: freezed ==
roleIdsThatCanBeUsedThisEmojiAsReaction
? _value.roleIdsThatCanBeUsedThisEmojiAsReaction
: roleIdsThatCanBeUsedThisEmojiAsReaction // ignore: cast_nullable_to_non_nullable
as List<String>?,
) as $Val);
}
}
Expand All @@ -136,7 +145,8 @@ abstract class _$$EmojiResponseImplCopyWith<$Res>
@NullableUriConverter() Uri? url,
String? license,
bool isSensitive,
bool localOnly});
bool localOnly,
List<String>? roleIdsThatCanBeUsedThisEmojiAsReaction});
}

/// @nodoc
Expand All @@ -159,6 +169,7 @@ class __$$EmojiResponseImplCopyWithImpl<$Res>
Object? license = freezed,
Object? isSensitive = null,
Object? localOnly = null,
Object? roleIdsThatCanBeUsedThisEmojiAsReaction = freezed,
}) {
return _then(_$EmojiResponseImpl(
id: null == id
Expand Down Expand Up @@ -197,6 +208,11 @@ class __$$EmojiResponseImplCopyWithImpl<$Res>
? _value.localOnly
: localOnly // ignore: cast_nullable_to_non_nullable
as bool,
roleIdsThatCanBeUsedThisEmojiAsReaction: freezed ==
roleIdsThatCanBeUsedThisEmojiAsReaction
? _value._roleIdsThatCanBeUsedThisEmojiAsReaction
: roleIdsThatCanBeUsedThisEmojiAsReaction // ignore: cast_nullable_to_non_nullable
as List<String>?,
));
}
}
Expand All @@ -213,8 +229,11 @@ class _$EmojiResponseImpl implements _EmojiResponse {
@NullableUriConverter() required this.url,
this.license,
this.isSensitive = false,
this.localOnly = false})
: _aliases = aliases;
this.localOnly = false,
final List<String>? roleIdsThatCanBeUsedThisEmojiAsReaction})
: _aliases = aliases,
_roleIdsThatCanBeUsedThisEmojiAsReaction =
roleIdsThatCanBeUsedThisEmojiAsReaction;

factory _$EmojiResponseImpl.fromJson(Map<String, dynamic> json) =>
_$$EmojiResponseImplFromJson(json);
Expand Down Expand Up @@ -247,10 +266,20 @@ class _$EmojiResponseImpl implements _EmojiResponse {
@override
@JsonKey()
final bool localOnly;
final List<String>? _roleIdsThatCanBeUsedThisEmojiAsReaction;
@override
List<String>? get roleIdsThatCanBeUsedThisEmojiAsReaction {
final value = _roleIdsThatCanBeUsedThisEmojiAsReaction;
if (value == null) return null;
if (_roleIdsThatCanBeUsedThisEmojiAsReaction is EqualUnmodifiableListView)
return _roleIdsThatCanBeUsedThisEmojiAsReaction;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}

@override
String toString() {
return 'EmojiResponse(id: $id, aliases: $aliases, name: $name, category: $category, host: $host, url: $url, license: $license, isSensitive: $isSensitive, localOnly: $localOnly)';
return 'EmojiResponse(id: $id, aliases: $aliases, name: $name, category: $category, host: $host, url: $url, license: $license, isSensitive: $isSensitive, localOnly: $localOnly, roleIdsThatCanBeUsedThisEmojiAsReaction: $roleIdsThatCanBeUsedThisEmojiAsReaction)';
}

@override
Expand All @@ -269,7 +298,10 @@ class _$EmojiResponseImpl implements _EmojiResponse {
(identical(other.isSensitive, isSensitive) ||
other.isSensitive == isSensitive) &&
(identical(other.localOnly, localOnly) ||
other.localOnly == localOnly));
other.localOnly == localOnly) &&
const DeepCollectionEquality().equals(
other._roleIdsThatCanBeUsedThisEmojiAsReaction,
_roleIdsThatCanBeUsedThisEmojiAsReaction));
}

@JsonKey(ignore: true)
Expand All @@ -284,7 +316,9 @@ class _$EmojiResponseImpl implements _EmojiResponse {
url,
license,
isSensitive,
localOnly);
localOnly,
const DeepCollectionEquality()
.hash(_roleIdsThatCanBeUsedThisEmojiAsReaction));

@JsonKey(ignore: true)
@override
Expand All @@ -302,15 +336,17 @@ class _$EmojiResponseImpl implements _EmojiResponse {

abstract class _EmojiResponse implements EmojiResponse {
const factory _EmojiResponse(
{required final String id,
final List<String> aliases,
required final String name,
final String? category,
final String? host,
@NullableUriConverter() required final Uri? url,
final String? license,
final bool isSensitive,
final bool localOnly}) = _$EmojiResponseImpl;
{required final String id,
final List<String> aliases,
required final String name,
final String? category,
final String? host,
@NullableUriConverter() required final Uri? url,
final String? license,
final bool isSensitive,
final bool localOnly,
final List<String>? roleIdsThatCanBeUsedThisEmojiAsReaction}) =
_$EmojiResponseImpl;

factory _EmojiResponse.fromJson(Map<String, dynamic> json) =
_$EmojiResponseImpl.fromJson;
Expand All @@ -335,6 +371,8 @@ abstract class _EmojiResponse implements EmojiResponse {
@override
bool get localOnly;
@override
List<String>? get roleIdsThatCanBeUsedThisEmojiAsReaction;
@override
@JsonKey(ignore: true)
_$$EmojiResponseImplCopyWith<_$EmojiResponseImpl> get copyWith =>
throw _privateConstructorUsedError;
Expand Down
6 changes: 6 additions & 0 deletions lib/src/data/emoji_response.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/data/emojis_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class Emoji with _$Emoji {
required String name,
String? category,
@UriConverter() required Uri url,
bool? localOnly,
@Default(false) bool isSensitive,
List<String>? roleIdsThatCanBeUsedThisEmojiAsReaction,
}) = _Emoji;

factory Emoji.fromJson(Map<String, Object?> json) => _$EmojiFromJson(json);
Expand Down
84 changes: 72 additions & 12 deletions lib/src/data/emojis_response.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ mixin _$Emoji {
String? get category => throw _privateConstructorUsedError;
@UriConverter()
Uri get url => throw _privateConstructorUsedError;
bool? get localOnly => throw _privateConstructorUsedError;
bool get isSensitive => throw _privateConstructorUsedError;
List<String>? get roleIdsThatCanBeUsedThisEmojiAsReaction =>
throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
Expand All @@ -187,7 +190,9 @@ abstract class $EmojiCopyWith<$Res> {
String name,
String? category,
@UriConverter() Uri url,
bool isSensitive});
bool? localOnly,
bool isSensitive,
List<String>? roleIdsThatCanBeUsedThisEmojiAsReaction});
}

/// @nodoc
Expand All @@ -207,7 +212,9 @@ class _$EmojiCopyWithImpl<$Res, $Val extends Emoji>
Object? name = null,
Object? category = freezed,
Object? url = null,
Object? localOnly = freezed,
Object? isSensitive = null,
Object? roleIdsThatCanBeUsedThisEmojiAsReaction = freezed,
}) {
return _then(_value.copyWith(
aliases: null == aliases
Expand All @@ -226,10 +233,19 @@ class _$EmojiCopyWithImpl<$Res, $Val extends Emoji>
? _value.url
: url // ignore: cast_nullable_to_non_nullable
as Uri,
localOnly: freezed == localOnly
? _value.localOnly
: localOnly // ignore: cast_nullable_to_non_nullable
as bool?,
isSensitive: null == isSensitive
? _value.isSensitive
: isSensitive // ignore: cast_nullable_to_non_nullable
as bool,
roleIdsThatCanBeUsedThisEmojiAsReaction: freezed ==
roleIdsThatCanBeUsedThisEmojiAsReaction
? _value.roleIdsThatCanBeUsedThisEmojiAsReaction
: roleIdsThatCanBeUsedThisEmojiAsReaction // ignore: cast_nullable_to_non_nullable
as List<String>?,
) as $Val);
}
}
Expand All @@ -246,7 +262,9 @@ abstract class _$$EmojiImplCopyWith<$Res> implements $EmojiCopyWith<$Res> {
String name,
String? category,
@UriConverter() Uri url,
bool isSensitive});
bool? localOnly,
bool isSensitive,
List<String>? roleIdsThatCanBeUsedThisEmojiAsReaction});
}

/// @nodoc
Expand All @@ -264,7 +282,9 @@ class __$$EmojiImplCopyWithImpl<$Res>
Object? name = null,
Object? category = freezed,
Object? url = null,
Object? localOnly = freezed,
Object? isSensitive = null,
Object? roleIdsThatCanBeUsedThisEmojiAsReaction = freezed,
}) {
return _then(_$EmojiImpl(
aliases: null == aliases
Expand All @@ -283,10 +303,19 @@ class __$$EmojiImplCopyWithImpl<$Res>
? _value.url
: url // ignore: cast_nullable_to_non_nullable
as Uri,
localOnly: freezed == localOnly
? _value.localOnly
: localOnly // ignore: cast_nullable_to_non_nullable
as bool?,
isSensitive: null == isSensitive
? _value.isSensitive
: isSensitive // ignore: cast_nullable_to_non_nullable
as bool,
roleIdsThatCanBeUsedThisEmojiAsReaction: freezed ==
roleIdsThatCanBeUsedThisEmojiAsReaction
? _value._roleIdsThatCanBeUsedThisEmojiAsReaction
: roleIdsThatCanBeUsedThisEmojiAsReaction // ignore: cast_nullable_to_non_nullable
as List<String>?,
));
}
}
Expand All @@ -299,8 +328,12 @@ class _$EmojiImpl implements _Emoji {
required this.name,
this.category,
@UriConverter() required this.url,
this.isSensitive = false})
: _aliases = aliases;
this.localOnly,
this.isSensitive = false,
final List<String>? roleIdsThatCanBeUsedThisEmojiAsReaction})
: _aliases = aliases,
_roleIdsThatCanBeUsedThisEmojiAsReaction =
roleIdsThatCanBeUsedThisEmojiAsReaction;

factory _$EmojiImpl.fromJson(Map<String, dynamic> json) =>
_$$EmojiImplFromJson(json);
Expand All @@ -321,12 +354,24 @@ class _$EmojiImpl implements _Emoji {
@UriConverter()
final Uri url;
@override
final bool? localOnly;
@override
@JsonKey()
final bool isSensitive;
final List<String>? _roleIdsThatCanBeUsedThisEmojiAsReaction;
@override
List<String>? get roleIdsThatCanBeUsedThisEmojiAsReaction {
final value = _roleIdsThatCanBeUsedThisEmojiAsReaction;
if (value == null) return null;
if (_roleIdsThatCanBeUsedThisEmojiAsReaction is EqualUnmodifiableListView)
return _roleIdsThatCanBeUsedThisEmojiAsReaction;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}

@override
String toString() {
return 'Emoji(aliases: $aliases, name: $name, category: $category, url: $url, isSensitive: $isSensitive)';
return 'Emoji(aliases: $aliases, name: $name, category: $category, url: $url, localOnly: $localOnly, isSensitive: $isSensitive, roleIdsThatCanBeUsedThisEmojiAsReaction: $roleIdsThatCanBeUsedThisEmojiAsReaction)';
}

@override
Expand All @@ -339,8 +384,13 @@ class _$EmojiImpl implements _Emoji {
(identical(other.category, category) ||
other.category == category) &&
(identical(other.url, url) || other.url == url) &&
(identical(other.localOnly, localOnly) ||
other.localOnly == localOnly) &&
(identical(other.isSensitive, isSensitive) ||
other.isSensitive == isSensitive));
other.isSensitive == isSensitive) &&
const DeepCollectionEquality().equals(
other._roleIdsThatCanBeUsedThisEmojiAsReaction,
_roleIdsThatCanBeUsedThisEmojiAsReaction));
}

@JsonKey(ignore: true)
Expand All @@ -351,7 +401,10 @@ class _$EmojiImpl implements _Emoji {
name,
category,
url,
isSensitive);
localOnly,
isSensitive,
const DeepCollectionEquality()
.hash(_roleIdsThatCanBeUsedThisEmojiAsReaction));

@JsonKey(ignore: true)
@override
Expand All @@ -369,11 +422,14 @@ class _$EmojiImpl implements _Emoji {

abstract class _Emoji implements Emoji {
const factory _Emoji(
{required final List<String> aliases,
required final String name,
final String? category,
@UriConverter() required final Uri url,
final bool isSensitive}) = _$EmojiImpl;
{required final List<String> aliases,
required final String name,
final String? category,
@UriConverter() required final Uri url,
final bool? localOnly,
final bool isSensitive,
final List<String>? roleIdsThatCanBeUsedThisEmojiAsReaction}) =
_$EmojiImpl;

factory _Emoji.fromJson(Map<String, dynamic> json) = _$EmojiImpl.fromJson;

Expand All @@ -387,8 +443,12 @@ abstract class _Emoji implements Emoji {
@UriConverter()
Uri get url;
@override
bool? get localOnly;
@override
bool get isSensitive;
@override
List<String>? get roleIdsThatCanBeUsedThisEmojiAsReaction;
@override
@JsonKey(ignore: true)
_$$EmojiImplCopyWith<_$EmojiImpl> get copyWith =>
throw _privateConstructorUsedError;
Expand Down
Loading

0 comments on commit 1bc0d04

Please sign in to comment.