Skip to content

Commit

Permalink
Make granted/max points nullable again (#56)
Browse files Browse the repository at this point in the history
Co-authored-by: Leo Farias <leoafarias@gmail.com>
  • Loading branch information
Rexios80 and leoafarias authored Dec 3, 2024
1 parent 429adf7 commit a917968
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/src/models/package_score_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> tags;
Expand Down
12 changes: 6 additions & 6 deletions lib/src/models/package_score_model.mapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class PackageScoreMapper extends ClassMapperBase<PackageScore> {
@override
final String id = 'PackageScore';

static int _$grantedPoints(PackageScore v) => v.grantedPoints;
static int? _$grantedPoints(PackageScore v) => v.grantedPoints;
static const Field<PackageScore, int> _f$grantedPoints =
Field('grantedPoints', _$grantedPoints);
static int _$maxPoints(PackageScore v) => v.maxPoints;
static int? _$maxPoints(PackageScore v) => v.maxPoints;
static const Field<PackageScore, int> _f$maxPoints =
Field('maxPoints', _$maxPoints);
static int _$likeCount(PackageScore v) => v.likeCount;
Expand Down Expand Up @@ -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<String>? 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,
Expand Down

0 comments on commit a917968

Please sign in to comment.