Skip to content

Commit

Permalink
Add field of version
Browse files Browse the repository at this point in the history
  • Loading branch information
bannzai committed Sep 10, 2023
1 parent 23a3902 commit 6a05885
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
6 changes: 4 additions & 2 deletions lib/entity/pilll_ads.codegen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ class PilllAds with _$PilllAds {
fromJson: NonNullTimestampConverter.timestampToDateTime,
toJson: NonNullTimestampConverter.dateTimeToTimestamp,
)
required DateTime startDateTime,
required DateTime startDateTime,
@JsonKey(
fromJson: NonNullTimestampConverter.timestampToDateTime,
toJson: NonNullTimestampConverter.dateTimeToTimestamp,
)
required DateTime endDateTime,
required DateTime endDateTime,
required String description,
required String? imageURL,
required String destinationURL,
required String hexColor,
// このフィールドの値より高い場合には、広告を表示しないので超すことは無い値をデフォルト値としている
@Default("999.999.999") String version,
}) = _PilllAds;
PilllAds._();

Expand Down
39 changes: 31 additions & 8 deletions lib/entity/pilll_ads.codegen.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ mixin _$PilllAds {
String get description => throw _privateConstructorUsedError;
String? get imageURL => throw _privateConstructorUsedError;
String get destinationURL => throw _privateConstructorUsedError;
String get hexColor => throw _privateConstructorUsedError;
String get hexColor =>
throw _privateConstructorUsedError; // このフィールドの値より高い場合には、広告を表示しないので超すことは無い値をデフォルト値としている
String get version => throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
Expand All @@ -56,7 +58,8 @@ abstract class $PilllAdsCopyWith<$Res> {
String description,
String? imageURL,
String destinationURL,
String hexColor});
String hexColor,
String version});
}

/// @nodoc
Expand All @@ -78,6 +81,7 @@ class _$PilllAdsCopyWithImpl<$Res, $Val extends PilllAds>
Object? imageURL = freezed,
Object? destinationURL = null,
Object? hexColor = null,
Object? version = null,
}) {
return _then(_value.copyWith(
startDateTime: null == startDateTime
Expand All @@ -104,6 +108,10 @@ class _$PilllAdsCopyWithImpl<$Res, $Val extends PilllAds>
? _value.hexColor
: hexColor // ignore: cast_nullable_to_non_nullable
as String,
version: null == version
? _value.version
: version // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
Expand All @@ -127,7 +135,8 @@ abstract class _$$_PilllAdsCopyWith<$Res> implements $PilllAdsCopyWith<$Res> {
String description,
String? imageURL,
String destinationURL,
String hexColor});
String hexColor,
String version});
}

/// @nodoc
Expand All @@ -147,6 +156,7 @@ class __$$_PilllAdsCopyWithImpl<$Res>
Object? imageURL = freezed,
Object? destinationURL = null,
Object? hexColor = null,
Object? version = null,
}) {
return _then(_$_PilllAds(
startDateTime: null == startDateTime
Expand All @@ -173,6 +183,10 @@ class __$$_PilllAdsCopyWithImpl<$Res>
? _value.hexColor
: hexColor // ignore: cast_nullable_to_non_nullable
as String,
version: null == version
? _value.version
: version // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
Expand All @@ -193,7 +207,8 @@ class _$_PilllAds extends _PilllAds {
required this.description,
required this.imageURL,
required this.destinationURL,
required this.hexColor})
required this.hexColor,
this.version = "999.999.999"})
: super._();

factory _$_PilllAds.fromJson(Map<String, dynamic> json) =>
Expand All @@ -217,10 +232,14 @@ class _$_PilllAds extends _PilllAds {
final String destinationURL;
@override
final String hexColor;
// このフィールドの値より高い場合には、広告を表示しないので超すことは無い値をデフォルト値としている
@override
@JsonKey()
final String version;

@override
String toString() {
return 'PilllAds(startDateTime: $startDateTime, endDateTime: $endDateTime, description: $description, imageURL: $imageURL, destinationURL: $destinationURL, hexColor: $hexColor)';
return 'PilllAds(startDateTime: $startDateTime, endDateTime: $endDateTime, description: $description, imageURL: $imageURL, destinationURL: $destinationURL, hexColor: $hexColor, version: $version)';
}

@override
Expand All @@ -239,13 +258,14 @@ class _$_PilllAds extends _PilllAds {
(identical(other.destinationURL, destinationURL) ||
other.destinationURL == destinationURL) &&
(identical(other.hexColor, hexColor) ||
other.hexColor == hexColor));
other.hexColor == hexColor) &&
(identical(other.version, version) || other.version == version));
}

@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(runtimeType, startDateTime, endDateTime,
description, imageURL, destinationURL, hexColor);
description, imageURL, destinationURL, hexColor, version);

@JsonKey(ignore: true)
@override
Expand Down Expand Up @@ -274,7 +294,8 @@ abstract class _PilllAds extends PilllAds {
required final String description,
required final String? imageURL,
required final String destinationURL,
required final String hexColor}) = _$_PilllAds;
required final String hexColor,
final String version}) = _$_PilllAds;
_PilllAds._() : super._();

factory _PilllAds.fromJson(Map<String, dynamic> json) = _$_PilllAds.fromJson;
Expand All @@ -297,6 +318,8 @@ abstract class _PilllAds extends PilllAds {
String get destinationURL;
@override
String get hexColor;
@override // このフィールドの値より高い場合には、広告を表示しないので超すことは無い値をデフォルト値としている
String get version;
@override
@JsonKey(ignore: true)
_$$_PilllAdsCopyWith<_$_PilllAds> get copyWith =>
Expand Down
2 changes: 2 additions & 0 deletions lib/entity/pilll_ads.codegen.g.dart

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

0 comments on commit 6a05885

Please sign in to comment.