File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed
Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import 'package:json_annotation/json_annotation.dart';
99/// {@template engagement_content_type}
1010/// Defines the specific type or purpose of an [EngagementContent] item.
1111/// {@endtemplate}
12- @JsonEnum (fieldRename: FieldRename .kebab )
12+ @JsonEnum (fieldRename: FieldRename .snake )
1313enum EngagementContentType {
1414 /// A call-to-action to sign up for an account.
1515 signUp,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import 'package:json_annotation/json_annotation.dart';
1313/// This enum guides the UI on how to render the list of items
1414/// contained within a SuggestedContent model.
1515/// {@endtemplate}
16- @JsonEnum (fieldRename: FieldRename .kebab )
16+ @JsonEnum (fieldRename: FieldRename .snake )
1717enum SuggestedContentDisplayType {
1818 /// Displays content items in a horizontally scrollable list of cards.
1919 horizontalCardList,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import 'package:json_annotation/json_annotation.dart';
33/// Defines the types of engagement content templates available.
44/// The string value of the enum (e.g., 'rate-app') will be used as the ID
55/// to link rules in AppConfig to specific EngagementContentTemplate instances.
6- @JsonEnum (fieldRename: FieldRename .kebab )
6+ @JsonEnum (fieldRename: FieldRename .snake )
77enum EngagementTemplateType {
88 /// Prompt to rate the application.
99 rateApp,
@@ -24,7 +24,7 @@ enum EngagementTemplateType {
2424/// Defines the types of suggested content templates available.
2525/// The string value of the enum (e.g., 'categories-to-follow') will be used as the ID
2626/// to link rules in AppConfig to specific SuggestedContentTemplate instances.
27- @JsonEnum (fieldRename: FieldRename .kebab )
27+ @JsonEnum (fieldRename: FieldRename .snake )
2828enum SuggestionTemplateType {
2929 /// Suggest categories to follow.
3030 categoriesToFollow,
Original file line number Diff line number Diff line change 11import 'package:equatable/equatable.dart' ;
22import 'package:json_annotation/json_annotation.dart' ;
3+ import 'package:meta/meta.dart' ;
34
45part 'feed_display_preferences.g.dart' ;
56
@@ -30,7 +31,13 @@ enum HeadlineImageStyle {
3031/// {@template feed_display_preferences}
3132/// User preferences for how feeds are displayed.
3233/// {@endtemplate}
33- @JsonSerializable ()
34+ @immutable
35+ @JsonSerializable (
36+ fieldRename: FieldRename .snake,
37+ explicitToJson: true ,
38+ includeIfNull: false ,
39+ checked: true ,
40+ )
3441class FeedDisplayPreferences extends Equatable {
3542 /// {@macro feed_display_preferences}
3643 const FeedDisplayPreferences ({
@@ -45,9 +52,11 @@ class FeedDisplayPreferences extends Equatable {
4552 _$FeedDisplayPreferencesFromJson (json);
4653
4754 /// How densely headline information should be presented.
55+ @JsonKey (unknownEnumValue: JsonKey .nullForUndefinedEnumValue)
4856 final HeadlineDensity headlineDensity;
4957
5058 /// How images should be displayed in the headline feed.
59+ @JsonKey (unknownEnumValue: JsonKey .nullForUndefinedEnumValue)
5160 final HeadlineImageStyle headlineImageStyle;
5261
5362 /// Whether to show the source name directly in the headline feed item.
You can’t perform that action at this time.
0 commit comments