Skip to content

Commit

Permalink
Merge pull request #29 from poppingmoon/jm-meta
Browse files Browse the repository at this point in the history
JoinMisskeyInstanceInfoにmetaを追加
  • Loading branch information
shiosyakeyakini-info authored Mar 30, 2024
2 parents 72450c0 + 1071a6c commit 91d4c3f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 18 deletions.
1 change: 1 addition & 0 deletions lib/src/data/join_misskey_instances.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class JoinMisskeyInstanceInfo with _$JoinMisskeyInstanceInfo {
@Default(false) bool icon,
// ignore: invalid_annotation_target
@JsonKey(name: "nodeinfo") JoinMisskeyNodeInfo? nodeInfo,
Map<String, dynamic>? meta,
}) = _JoinMisskeyInstanceInfo;

factory JoinMisskeyInstanceInfo.fromJson(Map<String, dynamic> json) =>
Expand Down
64 changes: 46 additions & 18 deletions lib/src/data/join_misskey_instances.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ mixin _$JoinMisskeyInstanceInfo {
throw _privateConstructorUsedError; // ignore: invalid_annotation_target
@JsonKey(name: "nodeinfo")
JoinMisskeyNodeInfo? get nodeInfo => throw _privateConstructorUsedError;
Map<String, dynamic>? get meta => throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
Expand All @@ -459,7 +460,8 @@ abstract class $JoinMisskeyInstanceInfoCopyWith<$Res> {
bool banner,
bool background,
bool icon,
@JsonKey(name: "nodeinfo") JoinMisskeyNodeInfo? nodeInfo});
@JsonKey(name: "nodeinfo") JoinMisskeyNodeInfo? nodeInfo,
Map<String, dynamic>? meta});

$JoinMisskeyNodeInfoCopyWith<$Res>? get nodeInfo;
}
Expand Down Expand Up @@ -488,6 +490,7 @@ class _$JoinMisskeyInstanceInfoCopyWithImpl<$Res,
Object? background = null,
Object? icon = null,
Object? nodeInfo = freezed,
Object? meta = freezed,
}) {
return _then(_value.copyWith(
url: null == url
Expand Down Expand Up @@ -530,6 +533,10 @@ class _$JoinMisskeyInstanceInfoCopyWithImpl<$Res,
? _value.nodeInfo
: nodeInfo // ignore: cast_nullable_to_non_nullable
as JoinMisskeyNodeInfo?,
meta: freezed == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>?,
) as $Val);
}

Expand Down Expand Up @@ -565,7 +572,8 @@ abstract class _$$JoinMisskeyInstanceInfoImplCopyWith<$Res>
bool banner,
bool background,
bool icon,
@JsonKey(name: "nodeinfo") JoinMisskeyNodeInfo? nodeInfo});
@JsonKey(name: "nodeinfo") JoinMisskeyNodeInfo? nodeInfo,
Map<String, dynamic>? meta});

@override
$JoinMisskeyNodeInfoCopyWith<$Res>? get nodeInfo;
Expand Down Expand Up @@ -594,6 +602,7 @@ class __$$JoinMisskeyInstanceInfoImplCopyWithImpl<$Res>
Object? background = null,
Object? icon = null,
Object? nodeInfo = freezed,
Object? meta = freezed,
}) {
return _then(_$JoinMisskeyInstanceInfoImpl(
url: null == url
Expand Down Expand Up @@ -636,6 +645,10 @@ class __$$JoinMisskeyInstanceInfoImplCopyWithImpl<$Res>
? _value.nodeInfo
: nodeInfo // ignore: cast_nullable_to_non_nullable
as JoinMisskeyNodeInfo?,
meta: freezed == meta
? _value._meta
: meta // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>?,
));
}
}
Expand All @@ -653,8 +666,10 @@ class _$JoinMisskeyInstanceInfoImpl implements _JoinMisskeyInstanceInfo {
this.banner = false,
this.background = false,
this.icon = false,
@JsonKey(name: "nodeinfo") this.nodeInfo})
: _langs = langs;
@JsonKey(name: "nodeinfo") this.nodeInfo,
final Map<String, dynamic>? meta})
: _langs = langs,
_meta = meta;

factory _$JoinMisskeyInstanceInfoImpl.fromJson(Map<String, dynamic> json) =>
_$$JoinMisskeyInstanceInfoImplFromJson(json);
Expand Down Expand Up @@ -690,10 +705,19 @@ class _$JoinMisskeyInstanceInfoImpl implements _JoinMisskeyInstanceInfo {
@override
@JsonKey(name: "nodeinfo")
final JoinMisskeyNodeInfo? nodeInfo;
final Map<String, dynamic>? _meta;
@override
Map<String, dynamic>? get meta {
final value = _meta;
if (value == null) return null;
if (_meta is EqualUnmodifiableMapView) return _meta;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(value);
}

@override
String toString() {
return 'JoinMisskeyInstanceInfo(url: $url, name: $name, langs: $langs, description: $description, isAlive: $isAlive, value: $value, banner: $banner, background: $background, icon: $icon, nodeInfo: $nodeInfo)';
return 'JoinMisskeyInstanceInfo(url: $url, name: $name, langs: $langs, description: $description, isAlive: $isAlive, value: $value, banner: $banner, background: $background, icon: $icon, nodeInfo: $nodeInfo, meta: $meta)';
}

@override
Expand All @@ -713,7 +737,8 @@ class _$JoinMisskeyInstanceInfoImpl implements _JoinMisskeyInstanceInfo {
other.background == background) &&
(identical(other.icon, icon) || other.icon == icon) &&
(identical(other.nodeInfo, nodeInfo) ||
other.nodeInfo == nodeInfo));
other.nodeInfo == nodeInfo) &&
const DeepCollectionEquality().equals(other._meta, _meta));
}

@JsonKey(ignore: true)
Expand All @@ -729,7 +754,8 @@ class _$JoinMisskeyInstanceInfoImpl implements _JoinMisskeyInstanceInfo {
banner,
background,
icon,
nodeInfo);
nodeInfo,
const DeepCollectionEquality().hash(_meta));

@JsonKey(ignore: true)
@override
Expand All @@ -748,17 +774,17 @@ class _$JoinMisskeyInstanceInfoImpl implements _JoinMisskeyInstanceInfo {

abstract class _JoinMisskeyInstanceInfo implements JoinMisskeyInstanceInfo {
const factory _JoinMisskeyInstanceInfo(
{required final String url,
required final String name,
required final List<String> langs,
required final String? description,
required final bool isAlive,
required final double value,
final bool banner,
final bool background,
final bool icon,
@JsonKey(name: "nodeinfo") final JoinMisskeyNodeInfo? nodeInfo}) =
_$JoinMisskeyInstanceInfoImpl;
{required final String url,
required final String name,
required final List<String> langs,
required final String? description,
required final bool isAlive,
required final double value,
final bool banner,
final bool background,
final bool icon,
@JsonKey(name: "nodeinfo") final JoinMisskeyNodeInfo? nodeInfo,
final Map<String, dynamic>? meta}) = _$JoinMisskeyInstanceInfoImpl;

factory _JoinMisskeyInstanceInfo.fromJson(Map<String, dynamic> json) =
_$JoinMisskeyInstanceInfoImpl.fromJson;
Expand All @@ -785,6 +811,8 @@ abstract class _JoinMisskeyInstanceInfo implements JoinMisskeyInstanceInfo {
@JsonKey(name: "nodeinfo")
JoinMisskeyNodeInfo? get nodeInfo;
@override
Map<String, dynamic>? get meta;
@override
@JsonKey(ignore: true)
_$$JoinMisskeyInstanceInfoImplCopyWith<_$JoinMisskeyInstanceInfoImpl>
get copyWith => throw _privateConstructorUsedError;
Expand Down
2 changes: 2 additions & 0 deletions lib/src/data/join_misskey_instances.g.dart

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

0 comments on commit 91d4c3f

Please sign in to comment.