Skip to content

Commit a3a82cb

Browse files
committed
refactor: remove JsonKey annotations
- Remove JsonKey annotation - Generate *.g.dart files
1 parent 297433f commit a3a82cb

27 files changed

+601
-48
lines changed

lib/src/models/auth/user.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class User extends Equatable {
4242
final String? email;
4343

4444
/// The role of the user.
45-
@JsonKey(unknownEnumValue: JsonKey.nullForUndefinedEnumValue)
45+
4646
final UserRole role;
4747

4848
/// The date and time the user account was created.

lib/src/models/auth/user.g.dart

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/models/core/feed_item_action.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import 'package:equatable/equatable.dart';
2+
import 'package:ht_shared/ht_shared.dart' show FeedItem;
23
import 'package:ht_shared/src/models/core/content_type.dart';
4+
import 'package:ht_shared/src/models/core/core.dart' show FeedItem;
5+
import 'package:ht_shared/src/models/core/feed_item.dart' show FeedItem;
6+
import 'package:ht_shared/src/models/models.dart' show FeedItem;
37
import 'package:json_annotation/json_annotation.dart';
48
import 'package:meta/meta.dart';
59

@@ -92,7 +96,7 @@ class OpenInternalContent extends FeedItemAction {
9296
final String contentId;
9397

9498
/// The type of the internal content (e.g., headline, category, source).
95-
@JsonKey(unknownEnumValue: JsonKey.nullForUndefinedEnumValue)
99+
96100
final ContentType contentType;
97101

98102
@override
@@ -135,7 +139,7 @@ class ShowInterstitialThenOpenInternalContent extends FeedItemAction {
135139
final String contentId;
136140

137141
/// The type of the internal content (e.g., headline, category, source).
138-
@JsonKey(unknownEnumValue: JsonKey.nullForUndefinedEnumValue)
142+
139143
final ContentType contentType;
140144

141145
@override

lib/src/models/core/feed_item_action.g.dart

Lines changed: 91 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/models/entities/source.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Source extends FeedItem {
5454
/// The type of the source (e.g., newsAgency, blog).
5555
/// If an unknown value is encountered during deserialization,
5656
/// this field will be set to null.
57-
@JsonKey(unknownEnumValue: JsonKey.nullForUndefinedEnumValue)
57+
5858
final SourceType? sourceType;
5959

6060
/// The language code of the source (e.g., 'en', 'fr').

lib/src/models/entities/source.g.dart

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/models/feed_decorators/ad.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Ad extends FeedItem {
6363

6464
/// The type of the ad, indicating its visual format.
6565
/// Will be null if an unknown value is encountered during deserialization.
66-
@JsonKey(unknownEnumValue: JsonKey.nullForUndefinedEnumValue)
66+
6767
final AdType? adType;
6868

6969
/// An optional identifier indicating the intended placement or slot

lib/src/models/feed_decorators/ad.g.dart

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/models/feed_decorators/engagement_content.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class EngagementContent extends FeedItem {
5151

5252
/// The type of engagement content.
5353
/// Will be null if an unknown value is encountered during deserialization.
54-
@JsonKey(unknownEnumValue: JsonKey.nullForUndefinedEnumValue)
54+
5555
final EngagementContentType? engagementContentType;
5656

5757
/// The text for the call-to-action button or link.

lib/src/models/feed_decorators/engagement_content.g.dart

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)