From a917968beb1cc153008444d7ed6e6c4ee4fa2a04 Mon Sep 17 00:00:00 2001 From: Rexios Date: Tue, 3 Dec 2024 12:18:19 -0500 Subject: [PATCH] Make granted/max points nullable again (#56) Co-authored-by: Leo Farias --- lib/src/models/package_score_model.dart | 4 ++-- lib/src/models/package_score_model.mapper.dart | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/src/models/package_score_model.dart b/lib/src/models/package_score_model.dart index 349f1ee..2eba891 100644 --- a/lib/src/models/package_score_model.dart +++ b/lib/src/models/package_score_model.dart @@ -4,8 +4,8 @@ part 'package_score_model.mapper.dart'; @MappableClass() class PackageScore with PackageScoreMappable { - final int grantedPoints; - final int maxPoints; + final int? grantedPoints; + final int? maxPoints; final int likeCount; final double? popularityScore; final List tags; diff --git a/lib/src/models/package_score_model.mapper.dart b/lib/src/models/package_score_model.mapper.dart index 10d888a..ce773bc 100644 --- a/lib/src/models/package_score_model.mapper.dart +++ b/lib/src/models/package_score_model.mapper.dart @@ -20,10 +20,10 @@ class PackageScoreMapper extends ClassMapperBase { @override final String id = 'PackageScore'; - static int _$grantedPoints(PackageScore v) => v.grantedPoints; + static int? _$grantedPoints(PackageScore v) => v.grantedPoints; static const Field _f$grantedPoints = Field('grantedPoints', _$grantedPoints); - static int _$maxPoints(PackageScore v) => v.maxPoints; + static int? _$maxPoints(PackageScore v) => v.maxPoints; static const Field _f$maxPoints = Field('maxPoints', _$maxPoints); static int _$likeCount(PackageScore v) => v.likeCount; @@ -136,15 +136,15 @@ class _PackageScoreCopyWithImpl<$R, $Out> (v) => call(tags: v)); @override $R call( - {int? grantedPoints, - int? maxPoints, + {Object? grantedPoints = $none, + Object? maxPoints = $none, int? likeCount, Object? popularityScore = $none, List? tags, DateTime? lastUpdated}) => $apply(FieldCopyWithData({ - if (grantedPoints != null) #grantedPoints: grantedPoints, - if (maxPoints != null) #maxPoints: maxPoints, + if (grantedPoints != $none) #grantedPoints: grantedPoints, + if (maxPoints != $none) #maxPoints: maxPoints, if (likeCount != null) #likeCount: likeCount, if (popularityScore != $none) #popularityScore: popularityScore, if (tags != null) #tags: tags,