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:
@@ -1 +1,30 @@
|
||||
{"flutter":{"platforms":{"android":{"default":{"projectId":"eatvio-3467b","appId":"1:613980912922:android:4de95e5f2d50ba69ecc0a3","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"eatvio-3467b","appId":"1:613980912922:ios:c557d140a1212e63ecc0a3","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"eatvio-3467b","configurations":{"android":"1:613980912922:android:4de95e5f2d50ba69ecc0a3","ios":"1:613980912922:ios:c557d140a1212e63ecc0a3"}}}}}}
|
||||
{
|
||||
"flutter": {
|
||||
"platforms": {
|
||||
"android": {
|
||||
"default": {
|
||||
"projectId": "eatvio-3467b",
|
||||
"appId": "1:613980912922:android:4de95e5f2d50ba69ecc0a3",
|
||||
"fileOutput": "android/app/google-services.json"
|
||||
}
|
||||
},
|
||||
"ios": {
|
||||
"default": {
|
||||
"projectId": "eatvio-3467b",
|
||||
"appId": "1:613980912922:ios:c557d140a1212e63ecc0a3",
|
||||
"uploadDebugSymbols": false,
|
||||
"fileOutput": "ios/Runner/GoogleService-Info.plist"
|
||||
}
|
||||
},
|
||||
"dart": {
|
||||
"lib/firebase_options.dart": {
|
||||
"projectId": "eatvio-3467b",
|
||||
"configurations": {
|
||||
"android": "1:613980912922:android:4de95e5f2d50ba69ecc0a3",
|
||||
"ios": "1:613980912922:ios:c557d140a1212e63ecc0a3"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// String baseUrl = 'https://eatvio.ru';
|
||||
String baseUrl = 'https://dev2.eatvio.com';
|
||||
String baseUrl = 'https://eatvio.ru';
|
||||
// String baseUrl = 'https://dev2.eatvio.com';
|
||||
|
||||
const List<int> durationValues = [7, 14, 21];
|
||||
|
||||
|
||||
@@ -68,8 +68,7 @@ class BlogPostRepository {
|
||||
) async {
|
||||
FormData formData = FormData.fromMap({
|
||||
'title': title,
|
||||
'description': description,
|
||||
'state': 'active',
|
||||
'description_md': description,
|
||||
'video_url': videoUrl,
|
||||
'image': image != null
|
||||
? await MultipartFile.fromFile((await ImageCompressUtility.compressFile(File(image.path))).path, filename: image.name)
|
||||
|
||||
@@ -13,7 +13,7 @@ abstract class BlogPostService {
|
||||
@Body() required FormData formData,
|
||||
});
|
||||
|
||||
@POST('/api/blogPosts/update/{id}')
|
||||
@POST('/api/blogPosts/update/published/{id}')
|
||||
@MultiPart()
|
||||
Future<void> updateBlogPost({
|
||||
@Path('id') required int id,
|
||||
|
||||
@@ -59,7 +59,7 @@ class _BlogPostService implements BlogPostService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/api/blogPosts/update/${id}',
|
||||
'/api/blogPosts/update/published/${id}',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
/*
|
||||
import 'package:eatvio_app/features/blog_post_create/models/blog_post_create_credentials_model.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:retrofit/retrofit.dart';
|
||||
|
||||
part 'blog_service.g.dart';
|
||||
|
||||
@RestApi()
|
||||
abstract class BlogService {
|
||||
factory BlogService(Dio dio, {String baseUrl}) = _BlogService;
|
||||
|
||||
@POST('/blog_post/create')
|
||||
Future<BlogPostCreateCredentialsModel> createBlogPost(
|
||||
BlogPostCreateCredentialsModel model);
|
||||
}
|
||||
*/
|
||||
@@ -36,7 +36,7 @@ class CreateDietRepository {
|
||||
|
||||
dietMap.addAll({
|
||||
'name': name,
|
||||
'details': details,
|
||||
'description_md': details,
|
||||
'duration': duration,
|
||||
'type[meat]': meatType,
|
||||
'type[carb]': carbType,
|
||||
@@ -115,7 +115,7 @@ class CreateDietRepository {
|
||||
dietMap.addAll({'name': name});
|
||||
}
|
||||
if (details != null) {
|
||||
dietMap.addAll({'details': details});
|
||||
dietMap.addAll({'description_md': details});
|
||||
}
|
||||
if (duration != null) {
|
||||
dietMap.addAll({'duration': duration});
|
||||
|
||||
@@ -27,7 +27,7 @@ class CreatePlanModel with _$CreatePlanModel {
|
||||
'duration': duration,
|
||||
'state': state,
|
||||
'type': type,
|
||||
'details': details,
|
||||
'description_md': details,
|
||||
'image': image != null ? await MultipartFile.fromFile((await ImageCompressUtility.compressFile(File(image!.path))).path, filename: image!.name) : null,
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class RecipeCreateModel with _$RecipeCreateModel {
|
||||
const factory RecipeCreateModel({
|
||||
required String title,
|
||||
required String state,
|
||||
required String description,
|
||||
@JsonKey(name: 'description_md') required String description,
|
||||
required RecipeType type,
|
||||
@JsonKey(name: 'video_url') String? videoUrl,
|
||||
@JsonKey(name: 'cooking_time') String? cookingTime,
|
||||
|
||||
@@ -23,6 +23,7 @@ RecipeCreateModel _$RecipeCreateModelFromJson(Map<String, dynamic> json) {
|
||||
mixin _$RecipeCreateModel {
|
||||
String get title => throw _privateConstructorUsedError;
|
||||
String get state => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'description_md')
|
||||
String get description => throw _privateConstructorUsedError;
|
||||
RecipeType get type => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'video_url')
|
||||
@@ -58,7 +59,7 @@ abstract class $RecipeCreateModelCopyWith<$Res> {
|
||||
$Res call({
|
||||
String title,
|
||||
String state,
|
||||
String description,
|
||||
@JsonKey(name: 'description_md') String description,
|
||||
RecipeType type,
|
||||
@JsonKey(name: 'video_url') String? videoUrl,
|
||||
@JsonKey(name: 'cooking_time') String? cookingTime,
|
||||
@@ -179,7 +180,7 @@ abstract class _$$RecipeCreateModelImplCopyWith<$Res>
|
||||
$Res call({
|
||||
String title,
|
||||
String state,
|
||||
String description,
|
||||
@JsonKey(name: 'description_md') String description,
|
||||
RecipeType type,
|
||||
@JsonKey(name: 'video_url') String? videoUrl,
|
||||
@JsonKey(name: 'cooking_time') String? cookingTime,
|
||||
@@ -292,7 +293,7 @@ class _$RecipeCreateModelImpl implements _RecipeCreateModel {
|
||||
const _$RecipeCreateModelImpl({
|
||||
required this.title,
|
||||
required this.state,
|
||||
required this.description,
|
||||
@JsonKey(name: 'description_md') required this.description,
|
||||
required this.type,
|
||||
@JsonKey(name: 'video_url') this.videoUrl,
|
||||
@JsonKey(name: 'cooking_time') this.cookingTime,
|
||||
@@ -314,6 +315,7 @@ class _$RecipeCreateModelImpl implements _RecipeCreateModel {
|
||||
@override
|
||||
final String state;
|
||||
@override
|
||||
@JsonKey(name: 'description_md')
|
||||
final String description;
|
||||
@override
|
||||
final RecipeType type;
|
||||
@@ -427,7 +429,7 @@ abstract class _RecipeCreateModel implements RecipeCreateModel {
|
||||
const factory _RecipeCreateModel({
|
||||
required final String title,
|
||||
required final String state,
|
||||
required final String description,
|
||||
@JsonKey(name: 'description_md') required final String description,
|
||||
required final RecipeType type,
|
||||
@JsonKey(name: 'video_url') final String? videoUrl,
|
||||
@JsonKey(name: 'cooking_time') final String? cookingTime,
|
||||
@@ -447,6 +449,7 @@ abstract class _RecipeCreateModel implements RecipeCreateModel {
|
||||
@override
|
||||
String get state;
|
||||
@override
|
||||
@JsonKey(name: 'description_md')
|
||||
String get description;
|
||||
@override
|
||||
RecipeType get type;
|
||||
|
||||
@@ -11,7 +11,7 @@ _$RecipeCreateModelImpl _$$RecipeCreateModelImplFromJson(
|
||||
) => _$RecipeCreateModelImpl(
|
||||
title: json['title'] as String,
|
||||
state: json['state'] as String,
|
||||
description: json['description'] as String,
|
||||
description: json['description_md'] as String,
|
||||
type: $enumDecode(_$RecipeTypeEnumMap, json['type']),
|
||||
videoUrl: json['video_url'] as String?,
|
||||
cookingTime: json['cooking_time'] as String?,
|
||||
@@ -34,7 +34,7 @@ Map<String, dynamic> _$$RecipeCreateModelImplToJson(
|
||||
) => <String, dynamic>{
|
||||
'title': instance.title,
|
||||
'state': instance.state,
|
||||
'description': instance.description,
|
||||
'description_md': instance.description,
|
||||
'type': _$RecipeTypeEnumMap[instance.type]!,
|
||||
'video_url': instance.videoUrl,
|
||||
'cooking_time': instance.cookingTime,
|
||||
|
||||
@@ -43,13 +43,13 @@ class RecipeRepository {
|
||||
if (step != null) {
|
||||
if ((step.image == null || (step.image?.isEmpty ?? true)) && step.description != null) {
|
||||
stepsMap.add({
|
||||
'description': step.description ?? "",
|
||||
'description_md': step.description ?? "",
|
||||
});
|
||||
} else if (step.image != null && (step.image?.isNotEmpty ?? false)) {
|
||||
final image = await ImageCompressUtility.compressFile(File(step.image ?? ''));
|
||||
final multipartFile = await MultipartFile.fromFile(image.path);
|
||||
stepsMap.add({
|
||||
'description': step.description ?? "",
|
||||
'description_md': step.description ?? "",
|
||||
'image': multipartFile,
|
||||
});
|
||||
}
|
||||
@@ -60,7 +60,7 @@ class RecipeRepository {
|
||||
'state': 'active',
|
||||
'title': recipe.title,
|
||||
'tags': recipe.tags,
|
||||
'description': recipe.description,
|
||||
'description_md': recipe.description,
|
||||
'video_url': recipe.video_url,
|
||||
'ingredients': ingredientsMap,
|
||||
'steps': stepsMap,
|
||||
|
||||
@@ -36,16 +36,17 @@ class _ExpandableTextState extends State<ExpandableText> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Stack(
|
||||
children: [
|
||||
Html(
|
||||
data: widget.text,
|
||||
style: {
|
||||
"*": Style(
|
||||
margin: Margins.all(0),
|
||||
color: Colors.black87,
|
||||
maxLines: isExpanded ? null : widget.maxLines,
|
||||
textOverflow: TextOverflow.clip,
|
||||
),
|
||||
},
|
||||
Text(
|
||||
widget.text,
|
||||
style: TextStyles.textMMediumAuto.copyWith(color: appTheme.black),
|
||||
// style: {
|
||||
// "*": Style(
|
||||
// margin: Margins.all(0),
|
||||
// color: Colors.black87,
|
||||
// maxLines: isExpanded ? null : widget.maxLines,
|
||||
// textOverflow: TextOverflow.clip,
|
||||
// ),
|
||||
// },
|
||||
),
|
||||
if (!isExpanded)
|
||||
Positioned.fill(
|
||||
@@ -57,11 +58,7 @@ class _ExpandableTextState extends State<ExpandableText> {
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Colors.white.withValues(alpha: 0.0),
|
||||
Colors.white.withValues(alpha: 0.6),
|
||||
Colors.white,
|
||||
],
|
||||
colors: [Colors.white.withValues(alpha: 0.0), Colors.white.withValues(alpha: 0.6), Colors.white],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -77,10 +74,7 @@ class _ExpandableTextState extends State<ExpandableText> {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
isExpanded ? s.hide : s.expand,
|
||||
style: TextStyles.textMMedium.copyWith(color: appTheme.blueA400),
|
||||
),
|
||||
Text(isExpanded ? s.hide : s.expand, style: TextStyles.textMMedium.copyWith(color: appTheme.blueA400)),
|
||||
Transform.rotate(angle: isExpanded ? math.pi : 0, child: SvgPicture.asset('assets/icons/arrow_down.svg', width: 12, height: 12)),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -67,9 +67,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
|
||||
void _scrollToBottom() {
|
||||
_jumped = true;
|
||||
scrollController.jumpTo(
|
||||
scrollController.position.maxScrollExtent,
|
||||
);
|
||||
scrollController.jumpTo(scrollController.position.maxScrollExtent);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -78,12 +76,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
return BlocProvider(
|
||||
create: (context) => recipeCubit..getRecipe(widget.recipe.slug),
|
||||
child: BlocProvider<CommentsCubit>(
|
||||
create: (BuildContext context) => commentsCubit
|
||||
..getComments(
|
||||
widget.recipe.slug.toString(),
|
||||
CommentSourceType.recipe,
|
||||
true,
|
||||
),
|
||||
create: (BuildContext context) => commentsCubit..getComments(widget.recipe.slug.toString(), CommentSourceType.recipe, true),
|
||||
child: BlocConsumer<CommentsCubit, CommentsState>(
|
||||
listener: (BuildContext context, CommentsState commentsState) {
|
||||
if (commentsState is CommentsStateLoaded) {
|
||||
@@ -106,14 +99,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
resizeToAvoidBottomInset: true,
|
||||
bottomSheet: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 12) + (Platform.isIOS ? const EdgeInsets.only(bottom: 16) : EdgeInsets.zero),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
color: Colors.black.withValues(alpha: 0.1),
|
||||
),
|
||||
),
|
||||
),
|
||||
decoration: BoxDecoration(color: Colors.white, border: Border(top: BorderSide(color: Colors.black.withValues(alpha: 0.1)))),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
@@ -133,17 +119,10 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: appTheme.blueA400,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
decoration: BoxDecoration(color: appTheme.blueA400, shape: BoxShape.circle),
|
||||
height: 32,
|
||||
width: 32,
|
||||
child: Icon(
|
||||
Icons.close_rounded,
|
||||
size: 18,
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Icon(Icons.close_rounded, size: 18, color: Colors.white),
|
||||
),
|
||||
),
|
||||
if (replyId != null) SizedBox(width: 8),
|
||||
@@ -159,22 +138,12 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
maxLines: 5,
|
||||
minLines: 1,
|
||||
keyboardType: TextInputType.multiline,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.black,
|
||||
height: 1.2,
|
||||
),
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w400, color: Colors.black, height: 1.2),
|
||||
decoration: InputDecoration(
|
||||
isDense: false, // убираем true, чтобы padding учитывался корректно
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), // вертикальный паддинг увеличен
|
||||
hintText: 'Комментарий',
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
height: 1.2,
|
||||
color: Color(0xFFAEAEB2),
|
||||
),
|
||||
hintStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w400, height: 1.2, color: Color(0xFFAEAEB2)),
|
||||
filled: true,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
@@ -214,7 +183,10 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(color: textEditingController.text.length > 2 ? appTheme.blueA400 : Colors.grey, shape: BoxShape.circle),
|
||||
decoration: BoxDecoration(
|
||||
color: textEditingController.text.length > 2 ? appTheme.blueA400 : Colors.grey,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
height: 32,
|
||||
width: 32,
|
||||
child: Icon(Icons.send_rounded, size: 18, color: Colors.white),
|
||||
@@ -244,22 +216,14 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
path: 'recipe/${widget.recipe.slug}',
|
||||
slug: widget.recipe.slug,
|
||||
),
|
||||
anchor: Aligned(
|
||||
shiftToWithinBound: AxisFlag(x: true, y: true),
|
||||
follower: Alignment.topRight,
|
||||
target: Alignment.bottomRight,
|
||||
),
|
||||
anchor: Aligned(shiftToWithinBound: AxisFlag(x: true, y: true), follower: Alignment.topRight, target: Alignment.bottomRight),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
isMoreOptionsVisible = !isMoreOptionsVisible;
|
||||
});
|
||||
},
|
||||
icon: SvgPicture.asset(
|
||||
'assets/icons/more_button.svg',
|
||||
width: 20,
|
||||
height: 20,
|
||||
),
|
||||
icon: SvgPicture.asset('assets/icons/more_button.svg', width: 20, height: 20),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -294,10 +258,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
children: [
|
||||
SvgPicture.asset('assets/icons/eye.svg', width: 18, height: 12),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
widget.recipe.viewsCount.toString(),
|
||||
style: TextStyles.textXSSemibold.copyWith(color: appTheme.black),
|
||||
),
|
||||
Text(widget.recipe.viewsCount.toString(), style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||
],
|
||||
backgroundColor: appTheme.whiteA700,
|
||||
),
|
||||
@@ -361,17 +322,11 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
SizedBox(height: 16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Text(
|
||||
s.about_recipe,
|
||||
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
|
||||
),
|
||||
child: Text(s.about_recipe, style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black)),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
InfoRow(
|
||||
recipe: widget.recipe,
|
||||
type: ProductType.recipe,
|
||||
),
|
||||
if (widget.recipe.videoUrl != null)
|
||||
InfoRow(recipe: widget.recipe, type: ProductType.recipe),
|
||||
if (widget.recipe.videoUrl != null && widget.recipe.videoUrl!.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 16, bottom: 12, top: 12),
|
||||
child: GestureDetector(
|
||||
@@ -389,44 +344,26 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
s.check_out_video_recipe,
|
||||
style: TextStyles.textMSemibold.copyWith(
|
||||
color: appTheme.black,
|
||||
),
|
||||
),
|
||||
Text(s.check_out_video_recipe, style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||
SizedBox(width: 12),
|
||||
SvgPicture.asset('assets/icons/play_icon.svg', width: 16, height: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
ExpandableText(
|
||||
text: widget.recipe.description,
|
||||
),
|
||||
ExpandableText(text: widget.recipe.description),
|
||||
SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: AuthorCard(
|
||||
author: widget.recipe.author,
|
||||
title: s.recipe_author,
|
||||
),
|
||||
child: AuthorCard(author: widget.recipe.author, title: s.recipe_author),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
if (widget.recipe.ingredients?.isNotEmpty == true)
|
||||
IngredientsWidget(
|
||||
recipe: widget.recipe,
|
||||
),
|
||||
if (widget.recipe.steps?.isNotEmpty == true) ...[
|
||||
SizedBox(height: 12),
|
||||
StepsWidget(
|
||||
recipe: widget.recipe,
|
||||
),
|
||||
],
|
||||
if (widget.recipe.ingredients?.isNotEmpty == true) IngredientsWidget(recipe: widget.recipe),
|
||||
if (widget.recipe.steps?.isNotEmpty == true) ...[SizedBox(height: 12), StepsWidget(recipe: widget.recipe)],
|
||||
SizedBox(height: 8),
|
||||
MainBackgroundBouble(
|
||||
padding: EdgeInsets.symmetric(vertical: 16),
|
||||
@@ -437,20 +374,13 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
recipeState.recipe.commentsCount.toString() + ' ' + getCommentForm(widget.recipe.commentsCount, s),
|
||||
style: TextStyles.textMMedium.copyWith(
|
||||
color: appTheme.gray500,
|
||||
),
|
||||
style: TextStyles.textMMedium.copyWith(color: appTheme.gray500),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
if (state is CommentsStateLoading) const Loader(),
|
||||
if (state is CommentsStateLoaded)
|
||||
CommentsWidget(
|
||||
id: widget.recipe.slug,
|
||||
commentSourceType: CommentSourceType.recipe,
|
||||
comment: state.comment,
|
||||
replyId: replyId,
|
||||
),
|
||||
CommentsWidget(id: widget.recipe.slug, commentSourceType: CommentSourceType.recipe, comment: state.comment, replyId: replyId),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -479,29 +409,19 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
path: 'recipe/${widget.recipe.slug}',
|
||||
slug: widget.recipe.slug,
|
||||
),
|
||||
anchor: Aligned(
|
||||
shiftToWithinBound: AxisFlag(x: true, y: true),
|
||||
follower: Alignment.topRight,
|
||||
target: Alignment.bottomRight,
|
||||
),
|
||||
anchor: Aligned(shiftToWithinBound: AxisFlag(x: true, y: true), follower: Alignment.topRight, target: Alignment.bottomRight),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
isMoreOptionsVisible = !isMoreOptionsVisible;
|
||||
});
|
||||
},
|
||||
icon: SvgPicture.asset(
|
||||
'assets/icons/more_button.svg',
|
||||
width: 20,
|
||||
height: 20,
|
||||
),
|
||||
icon: SvgPicture.asset('assets/icons/more_button.svg', width: 20, height: 20),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: DataErrorWidget(
|
||||
onReload: () => context.read<AboutRecipeCubit>().getRecipe(widget.recipe.slug, index: widget.index),
|
||||
),
|
||||
body: DataErrorWidget(onReload: () => context.read<AboutRecipeCubit>().getRecipe(widget.recipe.slug, index: widget.index)),
|
||||
);
|
||||
}
|
||||
return Scaffold(
|
||||
@@ -523,22 +443,14 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
||||
path: 'recipe/${widget.recipe.slug}',
|
||||
slug: widget.recipe.slug,
|
||||
),
|
||||
anchor: Aligned(
|
||||
shiftToWithinBound: AxisFlag(x: true, y: true),
|
||||
follower: Alignment.topRight,
|
||||
target: Alignment.bottomRight,
|
||||
),
|
||||
anchor: Aligned(shiftToWithinBound: AxisFlag(x: true, y: true), follower: Alignment.topRight, target: Alignment.bottomRight),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
isMoreOptionsVisible = !isMoreOptionsVisible;
|
||||
});
|
||||
},
|
||||
icon: SvgPicture.asset(
|
||||
'assets/icons/more_button.svg',
|
||||
width: 20,
|
||||
height: 20,
|
||||
),
|
||||
icon: SvgPicture.asset('assets/icons/more_button.svg', width: 20, height: 20),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: eatvio_app
|
||||
description: A new Flutter project.
|
||||
version: 1.0.50+2
|
||||
version: 1.0.50+3
|
||||
publish_to: 'none'
|
||||
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user