From 6a05885bc6ec29f9d658ea50d7f7dbedaef6ace7 Mon Sep 17 00:00:00 2001 From: bannzai Date: Sun, 10 Sep 2023 20:55:21 +0900 Subject: [PATCH] Add field of version --- lib/entity/pilll_ads.codegen.dart | 6 ++-- lib/entity/pilll_ads.codegen.freezed.dart | 39 ++++++++++++++++++----- lib/entity/pilll_ads.codegen.g.dart | 2 ++ 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/lib/entity/pilll_ads.codegen.dart b/lib/entity/pilll_ads.codegen.dart index c454209a1b..d6184242cd 100644 --- a/lib/entity/pilll_ads.codegen.dart +++ b/lib/entity/pilll_ads.codegen.dart @@ -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._(); diff --git a/lib/entity/pilll_ads.codegen.freezed.dart b/lib/entity/pilll_ads.codegen.freezed.dart index bf128e810c..f0fddb3579 100644 --- a/lib/entity/pilll_ads.codegen.freezed.dart +++ b/lib/entity/pilll_ads.codegen.freezed.dart @@ -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 toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -56,7 +58,8 @@ abstract class $PilllAdsCopyWith<$Res> { String description, String? imageURL, String destinationURL, - String hexColor}); + String hexColor, + String version}); } /// @nodoc @@ -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 @@ -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); } } @@ -127,7 +135,8 @@ abstract class _$$_PilllAdsCopyWith<$Res> implements $PilllAdsCopyWith<$Res> { String description, String? imageURL, String destinationURL, - String hexColor}); + String hexColor, + String version}); } /// @nodoc @@ -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 @@ -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, )); } } @@ -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 json) => @@ -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 @@ -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 @@ -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 json) = _$_PilllAds.fromJson; @@ -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 => diff --git a/lib/entity/pilll_ads.codegen.g.dart b/lib/entity/pilll_ads.codegen.g.dart index c056a47a70..38b5f6ac0f 100644 --- a/lib/entity/pilll_ads.codegen.g.dart +++ b/lib/entity/pilll_ads.codegen.g.dart @@ -15,6 +15,7 @@ _$_PilllAds _$$_PilllAdsFromJson(Map json) => _$_PilllAds( imageURL: json['imageURL'] as String?, destinationURL: json['destinationURL'] as String, hexColor: json['hexColor'] as String, + version: json['version'] as String? ?? "999.999.999", ); Map _$$_PilllAdsToJson(_$_PilllAds instance) => @@ -27,4 +28,5 @@ Map _$$_PilllAdsToJson(_$_PilllAds instance) => 'imageURL': instance.imageURL, 'destinationURL': instance.destinationURL, 'hexColor': instance.hexColor, + 'version': instance.version, };