forked from eatvio/eatvio_app
fix(blog posts, diets, plans, recipies): changed name of json field for descriptions of models
This commit is contained in:
@@ -25,7 +25,7 @@ class Diet with _$Diet {
|
||||
@JsonKey(name: "duration") required int duration,
|
||||
@JsonKey(name: "state") required DietState state,
|
||||
@JsonKey(name: "type") required DietType type,
|
||||
@JsonKey(name: "details") required String details,
|
||||
@JsonKey(name: "description_md") required String details,
|
||||
@JsonKey(name: "daily_schedule") required Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
||||
@JsonKey(name: "author") required Author author,
|
||||
@JsonKey(name: "total_likes") required int totalLikes,
|
||||
|
||||
@@ -285,7 +285,7 @@ mixin _$Diet {
|
||||
DietState get state => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "type")
|
||||
DietType get type => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "details")
|
||||
@JsonKey(name: "description_md")
|
||||
String get details => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "daily_schedule")
|
||||
Map<int, Map<int, Map<int, DailySchedule>>> get dailySchedule =>
|
||||
@@ -326,7 +326,7 @@ abstract class $DietCopyWith<$Res> {
|
||||
@JsonKey(name: "duration") int duration,
|
||||
@JsonKey(name: "state") DietState state,
|
||||
@JsonKey(name: "type") DietType type,
|
||||
@JsonKey(name: "details") String details,
|
||||
@JsonKey(name: "description_md") String details,
|
||||
@JsonKey(name: "daily_schedule")
|
||||
Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
||||
@JsonKey(name: "author") Author author,
|
||||
@@ -491,7 +491,7 @@ abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> {
|
||||
@JsonKey(name: "duration") int duration,
|
||||
@JsonKey(name: "state") DietState state,
|
||||
@JsonKey(name: "type") DietType type,
|
||||
@JsonKey(name: "details") String details,
|
||||
@JsonKey(name: "description_md") String details,
|
||||
@JsonKey(name: "daily_schedule")
|
||||
Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
||||
@JsonKey(name: "author") Author author,
|
||||
@@ -629,7 +629,7 @@ class _$DietImpl implements _Diet {
|
||||
@JsonKey(name: "duration") required this.duration,
|
||||
@JsonKey(name: "state") required this.state,
|
||||
@JsonKey(name: "type") required this.type,
|
||||
@JsonKey(name: "details") required this.details,
|
||||
@JsonKey(name: "description_md") required this.details,
|
||||
@JsonKey(name: "daily_schedule")
|
||||
required final Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
||||
@JsonKey(name: "author") required this.author,
|
||||
@@ -665,7 +665,7 @@ class _$DietImpl implements _Diet {
|
||||
@JsonKey(name: "type")
|
||||
final DietType type;
|
||||
@override
|
||||
@JsonKey(name: "details")
|
||||
@JsonKey(name: "description_md")
|
||||
final String details;
|
||||
final Map<int, Map<int, Map<int, DailySchedule>>> _dailySchedule;
|
||||
@override
|
||||
@@ -785,7 +785,7 @@ abstract class _Diet implements Diet {
|
||||
@JsonKey(name: "duration") required final int duration,
|
||||
@JsonKey(name: "state") required final DietState state,
|
||||
@JsonKey(name: "type") required final DietType type,
|
||||
@JsonKey(name: "details") required final String details,
|
||||
@JsonKey(name: "description_md") required final String details,
|
||||
@JsonKey(name: "daily_schedule")
|
||||
required final Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
||||
@JsonKey(name: "author") required final Author author,
|
||||
@@ -819,7 +819,7 @@ abstract class _Diet implements Diet {
|
||||
@JsonKey(name: "type")
|
||||
DietType get type;
|
||||
@override
|
||||
@JsonKey(name: "details")
|
||||
@JsonKey(name: "description_md")
|
||||
String get details;
|
||||
@override
|
||||
@JsonKey(name: "daily_schedule")
|
||||
|
||||
@@ -32,7 +32,7 @@ _$DietImpl _$$DietImplFromJson(Map<String, dynamic> json) => _$DietImpl(
|
||||
duration: (json['duration'] as num).toInt(),
|
||||
state: $enumDecode(_$DietStateEnumMap, json['state']),
|
||||
type: DietType.fromJson(json['type'] as Map<String, dynamic>),
|
||||
details: json['details'] as String,
|
||||
details: json['description_md'] as String,
|
||||
dailySchedule: (json['daily_schedule'] as Map<String, dynamic>).map(
|
||||
(k, e) => MapEntry(
|
||||
int.parse(k),
|
||||
@@ -70,7 +70,7 @@ Map<String, dynamic> _$$DietImplToJson(
|
||||
'duration': instance.duration,
|
||||
'state': _$DietStateEnumMap[instance.state]!,
|
||||
'type': instance.type,
|
||||
'details': instance.details,
|
||||
'description_md': instance.details,
|
||||
'daily_schedule': instance.dailySchedule.map(
|
||||
(k, e) => MapEntry(
|
||||
k.toString(),
|
||||
|
||||
@@ -58,7 +58,7 @@ class PacketOptions with _$PacketOptions {
|
||||
@JsonKey(name: "items") required List<String> items,
|
||||
@JsonKey(name: "price") required dynamic price,
|
||||
@JsonKey(name: "short") required String short,
|
||||
@JsonKey(name: "description") required String description,
|
||||
@JsonKey(name: "description_md") required String description,
|
||||
}) = _PacketOptions;
|
||||
|
||||
factory PacketOptions.fromJson(Map<String, dynamic> json) => _$PacketOptionsFromJson(json);
|
||||
|
||||
@@ -1036,7 +1036,7 @@ mixin _$PacketOptions {
|
||||
dynamic get price => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "short")
|
||||
String get short => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: "description")
|
||||
@JsonKey(name: "description_md")
|
||||
String get description => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this PacketOptions to a JSON map.
|
||||
@@ -1060,7 +1060,7 @@ abstract class $PacketOptionsCopyWith<$Res> {
|
||||
@JsonKey(name: "items") List<String> items,
|
||||
@JsonKey(name: "price") dynamic price,
|
||||
@JsonKey(name: "short") String short,
|
||||
@JsonKey(name: "description") String description,
|
||||
@JsonKey(name: "description_md") String description,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1125,7 +1125,7 @@ abstract class _$$PacketOptionsImplCopyWith<$Res>
|
||||
@JsonKey(name: "items") List<String> items,
|
||||
@JsonKey(name: "price") dynamic price,
|
||||
@JsonKey(name: "short") String short,
|
||||
@JsonKey(name: "description") String description,
|
||||
@JsonKey(name: "description_md") String description,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1182,7 +1182,7 @@ class _$PacketOptionsImpl implements _PacketOptions {
|
||||
@JsonKey(name: "items") required final List<String> items,
|
||||
@JsonKey(name: "price") required this.price,
|
||||
@JsonKey(name: "short") required this.short,
|
||||
@JsonKey(name: "description") required this.description,
|
||||
@JsonKey(name: "description_md") required this.description,
|
||||
}) : _items = items;
|
||||
|
||||
factory _$PacketOptionsImpl.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -1204,7 +1204,7 @@ class _$PacketOptionsImpl implements _PacketOptions {
|
||||
@JsonKey(name: "short")
|
||||
final String short;
|
||||
@override
|
||||
@JsonKey(name: "description")
|
||||
@JsonKey(name: "description_md")
|
||||
final String description;
|
||||
|
||||
@override
|
||||
@@ -1253,7 +1253,7 @@ abstract class _PacketOptions implements PacketOptions {
|
||||
@JsonKey(name: "items") required final List<String> items,
|
||||
@JsonKey(name: "price") required final dynamic price,
|
||||
@JsonKey(name: "short") required final String short,
|
||||
@JsonKey(name: "description") required final String description,
|
||||
@JsonKey(name: "description_md") required final String description,
|
||||
}) = _$PacketOptionsImpl;
|
||||
|
||||
factory _PacketOptions.fromJson(Map<String, dynamic> json) =
|
||||
@@ -1269,7 +1269,7 @@ abstract class _PacketOptions implements PacketOptions {
|
||||
@JsonKey(name: "short")
|
||||
String get short;
|
||||
@override
|
||||
@JsonKey(name: "description")
|
||||
@JsonKey(name: "description_md")
|
||||
String get description;
|
||||
|
||||
/// Create a copy of PacketOptions
|
||||
|
||||
@@ -93,7 +93,7 @@ _$PacketOptionsImpl _$$PacketOptionsImplFromJson(Map<String, dynamic> json) =>
|
||||
items: (json['items'] as List<dynamic>).map((e) => e as String).toList(),
|
||||
price: json['price'],
|
||||
short: json['short'] as String,
|
||||
description: json['description'] as String,
|
||||
description: json['description_md'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) =>
|
||||
@@ -101,7 +101,7 @@ Map<String, dynamic> _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) =>
|
||||
'items': instance.items,
|
||||
'price': instance.price,
|
||||
'short': instance.short,
|
||||
'description': instance.description,
|
||||
'description_md': instance.description,
|
||||
};
|
||||
|
||||
_$PlanTypeImpl _$$PlanTypeImplFromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -35,21 +35,14 @@ class Recipe with _$Recipe {
|
||||
|
||||
@freezed
|
||||
class Ingredient with _$Ingredient {
|
||||
const factory Ingredient({
|
||||
required String name,
|
||||
String? unit,
|
||||
required String portion,
|
||||
}) = _Ingredient;
|
||||
const factory Ingredient({required String name, String? unit, required String portion}) = _Ingredient;
|
||||
|
||||
factory Ingredient.fromJson(Map<String, Object?> json) => _$IngredientFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class Step with _$Step {
|
||||
const factory Step({
|
||||
required String image,
|
||||
required String description,
|
||||
}) = _Step;
|
||||
const factory Step({required String image, @JsonKey(name: 'description_md') required String description}) = _Step;
|
||||
|
||||
factory Step.fromJson(Map<String, Object?> json) => _$StepFromJson(json);
|
||||
}
|
||||
|
||||
@@ -929,6 +929,7 @@ Step _$StepFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$Step {
|
||||
String get image => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'description_md')
|
||||
String get description => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this Step to a JSON map.
|
||||
@@ -945,7 +946,10 @@ abstract class $StepCopyWith<$Res> {
|
||||
factory $StepCopyWith(Step value, $Res Function(Step) then) =
|
||||
_$StepCopyWithImpl<$Res, Step>;
|
||||
@useResult
|
||||
$Res call({String image, String description});
|
||||
$Res call({
|
||||
String image,
|
||||
@JsonKey(name: 'description_md') String description,
|
||||
});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -989,7 +993,10 @@ abstract class _$$StepImplCopyWith<$Res> implements $StepCopyWith<$Res> {
|
||||
) = __$$StepImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({String image, String description});
|
||||
$Res call({
|
||||
String image,
|
||||
@JsonKey(name: 'description_md') String description,
|
||||
});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1024,7 +1031,10 @@ class __$$StepImplCopyWithImpl<$Res>
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$StepImpl implements _Step {
|
||||
const _$StepImpl({required this.image, required this.description});
|
||||
const _$StepImpl({
|
||||
required this.image,
|
||||
@JsonKey(name: 'description_md') required this.description,
|
||||
});
|
||||
|
||||
factory _$StepImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$StepImplFromJson(json);
|
||||
@@ -1032,6 +1042,7 @@ class _$StepImpl implements _Step {
|
||||
@override
|
||||
final String image;
|
||||
@override
|
||||
@JsonKey(name: 'description_md')
|
||||
final String description;
|
||||
|
||||
@override
|
||||
@@ -1070,7 +1081,7 @@ class _$StepImpl implements _Step {
|
||||
abstract class _Step implements Step {
|
||||
const factory _Step({
|
||||
required final String image,
|
||||
required final String description,
|
||||
@JsonKey(name: 'description_md') required final String description,
|
||||
}) = _$StepImpl;
|
||||
|
||||
factory _Step.fromJson(Map<String, dynamic> json) = _$StepImpl.fromJson;
|
||||
@@ -1078,6 +1089,7 @@ abstract class _Step implements Step {
|
||||
@override
|
||||
String get image;
|
||||
@override
|
||||
@JsonKey(name: 'description_md')
|
||||
String get description;
|
||||
|
||||
/// Create a copy of Step
|
||||
|
||||
@@ -78,11 +78,11 @@ Map<String, dynamic> _$$IngredientImplToJson(_$IngredientImpl instance) =>
|
||||
|
||||
_$StepImpl _$$StepImplFromJson(Map<String, dynamic> json) => _$StepImpl(
|
||||
image: json['image'] as String,
|
||||
description: json['description'] as String,
|
||||
description: json['description_md'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$StepImplToJson(_$StepImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'image': instance.image,
|
||||
'description': instance.description,
|
||||
'description_md': instance.description,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user