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://eatvio.ru';
|
||||||
String baseUrl = 'https://dev2.eatvio.com';
|
// String baseUrl = 'https://dev2.eatvio.com';
|
||||||
|
|
||||||
const List<int> durationValues = [7, 14, 21];
|
const List<int> durationValues = [7, 14, 21];
|
||||||
|
|
||||||
|
|||||||
@@ -68,8 +68,7 @@ class BlogPostRepository {
|
|||||||
) async {
|
) async {
|
||||||
FormData formData = FormData.fromMap({
|
FormData formData = FormData.fromMap({
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': description,
|
'description_md': description,
|
||||||
'state': 'active',
|
|
||||||
'video_url': videoUrl,
|
'video_url': videoUrl,
|
||||||
'image': image != null
|
'image': image != null
|
||||||
? await MultipartFile.fromFile((await ImageCompressUtility.compressFile(File(image.path))).path, filename: image.name)
|
? await MultipartFile.fromFile((await ImageCompressUtility.compressFile(File(image.path))).path, filename: image.name)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ abstract class BlogPostService {
|
|||||||
@Body() required FormData formData,
|
@Body() required FormData formData,
|
||||||
});
|
});
|
||||||
|
|
||||||
@POST('/api/blogPosts/update/{id}')
|
@POST('/api/blogPosts/update/published/{id}')
|
||||||
@MultiPart()
|
@MultiPart()
|
||||||
Future<void> updateBlogPost({
|
Future<void> updateBlogPost({
|
||||||
@Path('id') required int id,
|
@Path('id') required int id,
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class _BlogPostService implements BlogPostService {
|
|||||||
)
|
)
|
||||||
.compose(
|
.compose(
|
||||||
_dio.options,
|
_dio.options,
|
||||||
'/api/blogPosts/update/${id}',
|
'/api/blogPosts/update/published/${id}',
|
||||||
queryParameters: queryParameters,
|
queryParameters: queryParameters,
|
||||||
data: _data,
|
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({
|
dietMap.addAll({
|
||||||
'name': name,
|
'name': name,
|
||||||
'details': details,
|
'description_md': details,
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
'type[meat]': meatType,
|
'type[meat]': meatType,
|
||||||
'type[carb]': carbType,
|
'type[carb]': carbType,
|
||||||
@@ -115,7 +115,7 @@ class CreateDietRepository {
|
|||||||
dietMap.addAll({'name': name});
|
dietMap.addAll({'name': name});
|
||||||
}
|
}
|
||||||
if (details != null) {
|
if (details != null) {
|
||||||
dietMap.addAll({'details': details});
|
dietMap.addAll({'description_md': details});
|
||||||
}
|
}
|
||||||
if (duration != null) {
|
if (duration != null) {
|
||||||
dietMap.addAll({'duration': duration});
|
dietMap.addAll({'duration': duration});
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class CreatePlanModel with _$CreatePlanModel {
|
|||||||
'duration': duration,
|
'duration': duration,
|
||||||
'state': state,
|
'state': state,
|
||||||
'type': type,
|
'type': type,
|
||||||
'details': details,
|
'description_md': details,
|
||||||
'image': image != null ? await MultipartFile.fromFile((await ImageCompressUtility.compressFile(File(image!.path))).path, filename: image!.name) : null,
|
'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({
|
const factory RecipeCreateModel({
|
||||||
required String title,
|
required String title,
|
||||||
required String state,
|
required String state,
|
||||||
required String description,
|
@JsonKey(name: 'description_md') required String description,
|
||||||
required RecipeType type,
|
required RecipeType type,
|
||||||
@JsonKey(name: 'video_url') String? videoUrl,
|
@JsonKey(name: 'video_url') String? videoUrl,
|
||||||
@JsonKey(name: 'cooking_time') String? cookingTime,
|
@JsonKey(name: 'cooking_time') String? cookingTime,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ RecipeCreateModel _$RecipeCreateModelFromJson(Map<String, dynamic> json) {
|
|||||||
mixin _$RecipeCreateModel {
|
mixin _$RecipeCreateModel {
|
||||||
String get title => throw _privateConstructorUsedError;
|
String get title => throw _privateConstructorUsedError;
|
||||||
String get state => throw _privateConstructorUsedError;
|
String get state => throw _privateConstructorUsedError;
|
||||||
|
@JsonKey(name: 'description_md')
|
||||||
String get description => throw _privateConstructorUsedError;
|
String get description => throw _privateConstructorUsedError;
|
||||||
RecipeType get type => throw _privateConstructorUsedError;
|
RecipeType get type => throw _privateConstructorUsedError;
|
||||||
@JsonKey(name: 'video_url')
|
@JsonKey(name: 'video_url')
|
||||||
@@ -58,7 +59,7 @@ abstract class $RecipeCreateModelCopyWith<$Res> {
|
|||||||
$Res call({
|
$Res call({
|
||||||
String title,
|
String title,
|
||||||
String state,
|
String state,
|
||||||
String description,
|
@JsonKey(name: 'description_md') String description,
|
||||||
RecipeType type,
|
RecipeType type,
|
||||||
@JsonKey(name: 'video_url') String? videoUrl,
|
@JsonKey(name: 'video_url') String? videoUrl,
|
||||||
@JsonKey(name: 'cooking_time') String? cookingTime,
|
@JsonKey(name: 'cooking_time') String? cookingTime,
|
||||||
@@ -179,7 +180,7 @@ abstract class _$$RecipeCreateModelImplCopyWith<$Res>
|
|||||||
$Res call({
|
$Res call({
|
||||||
String title,
|
String title,
|
||||||
String state,
|
String state,
|
||||||
String description,
|
@JsonKey(name: 'description_md') String description,
|
||||||
RecipeType type,
|
RecipeType type,
|
||||||
@JsonKey(name: 'video_url') String? videoUrl,
|
@JsonKey(name: 'video_url') String? videoUrl,
|
||||||
@JsonKey(name: 'cooking_time') String? cookingTime,
|
@JsonKey(name: 'cooking_time') String? cookingTime,
|
||||||
@@ -292,7 +293,7 @@ class _$RecipeCreateModelImpl implements _RecipeCreateModel {
|
|||||||
const _$RecipeCreateModelImpl({
|
const _$RecipeCreateModelImpl({
|
||||||
required this.title,
|
required this.title,
|
||||||
required this.state,
|
required this.state,
|
||||||
required this.description,
|
@JsonKey(name: 'description_md') required this.description,
|
||||||
required this.type,
|
required this.type,
|
||||||
@JsonKey(name: 'video_url') this.videoUrl,
|
@JsonKey(name: 'video_url') this.videoUrl,
|
||||||
@JsonKey(name: 'cooking_time') this.cookingTime,
|
@JsonKey(name: 'cooking_time') this.cookingTime,
|
||||||
@@ -314,6 +315,7 @@ class _$RecipeCreateModelImpl implements _RecipeCreateModel {
|
|||||||
@override
|
@override
|
||||||
final String state;
|
final String state;
|
||||||
@override
|
@override
|
||||||
|
@JsonKey(name: 'description_md')
|
||||||
final String description;
|
final String description;
|
||||||
@override
|
@override
|
||||||
final RecipeType type;
|
final RecipeType type;
|
||||||
@@ -427,7 +429,7 @@ abstract class _RecipeCreateModel implements RecipeCreateModel {
|
|||||||
const factory _RecipeCreateModel({
|
const factory _RecipeCreateModel({
|
||||||
required final String title,
|
required final String title,
|
||||||
required final String state,
|
required final String state,
|
||||||
required final String description,
|
@JsonKey(name: 'description_md') required final String description,
|
||||||
required final RecipeType type,
|
required final RecipeType type,
|
||||||
@JsonKey(name: 'video_url') final String? videoUrl,
|
@JsonKey(name: 'video_url') final String? videoUrl,
|
||||||
@JsonKey(name: 'cooking_time') final String? cookingTime,
|
@JsonKey(name: 'cooking_time') final String? cookingTime,
|
||||||
@@ -447,6 +449,7 @@ abstract class _RecipeCreateModel implements RecipeCreateModel {
|
|||||||
@override
|
@override
|
||||||
String get state;
|
String get state;
|
||||||
@override
|
@override
|
||||||
|
@JsonKey(name: 'description_md')
|
||||||
String get description;
|
String get description;
|
||||||
@override
|
@override
|
||||||
RecipeType get type;
|
RecipeType get type;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ _$RecipeCreateModelImpl _$$RecipeCreateModelImplFromJson(
|
|||||||
) => _$RecipeCreateModelImpl(
|
) => _$RecipeCreateModelImpl(
|
||||||
title: json['title'] as String,
|
title: json['title'] as String,
|
||||||
state: json['state'] as String,
|
state: json['state'] as String,
|
||||||
description: json['description'] as String,
|
description: json['description_md'] as String,
|
||||||
type: $enumDecode(_$RecipeTypeEnumMap, json['type']),
|
type: $enumDecode(_$RecipeTypeEnumMap, json['type']),
|
||||||
videoUrl: json['video_url'] as String?,
|
videoUrl: json['video_url'] as String?,
|
||||||
cookingTime: json['cooking_time'] as String?,
|
cookingTime: json['cooking_time'] as String?,
|
||||||
@@ -34,7 +34,7 @@ Map<String, dynamic> _$$RecipeCreateModelImplToJson(
|
|||||||
) => <String, dynamic>{
|
) => <String, dynamic>{
|
||||||
'title': instance.title,
|
'title': instance.title,
|
||||||
'state': instance.state,
|
'state': instance.state,
|
||||||
'description': instance.description,
|
'description_md': instance.description,
|
||||||
'type': _$RecipeTypeEnumMap[instance.type]!,
|
'type': _$RecipeTypeEnumMap[instance.type]!,
|
||||||
'video_url': instance.videoUrl,
|
'video_url': instance.videoUrl,
|
||||||
'cooking_time': instance.cookingTime,
|
'cooking_time': instance.cookingTime,
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ class RecipeRepository {
|
|||||||
if (step != null) {
|
if (step != null) {
|
||||||
if ((step.image == null || (step.image?.isEmpty ?? true)) && step.description != null) {
|
if ((step.image == null || (step.image?.isEmpty ?? true)) && step.description != null) {
|
||||||
stepsMap.add({
|
stepsMap.add({
|
||||||
'description': step.description ?? "",
|
'description_md': step.description ?? "",
|
||||||
});
|
});
|
||||||
} else if (step.image != null && (step.image?.isNotEmpty ?? false)) {
|
} else if (step.image != null && (step.image?.isNotEmpty ?? false)) {
|
||||||
final image = await ImageCompressUtility.compressFile(File(step.image ?? ''));
|
final image = await ImageCompressUtility.compressFile(File(step.image ?? ''));
|
||||||
final multipartFile = await MultipartFile.fromFile(image.path);
|
final multipartFile = await MultipartFile.fromFile(image.path);
|
||||||
stepsMap.add({
|
stepsMap.add({
|
||||||
'description': step.description ?? "",
|
'description_md': step.description ?? "",
|
||||||
'image': multipartFile,
|
'image': multipartFile,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ class RecipeRepository {
|
|||||||
'state': 'active',
|
'state': 'active',
|
||||||
'title': recipe.title,
|
'title': recipe.title,
|
||||||
'tags': recipe.tags,
|
'tags': recipe.tags,
|
||||||
'description': recipe.description,
|
'description_md': recipe.description,
|
||||||
'video_url': recipe.video_url,
|
'video_url': recipe.video_url,
|
||||||
'ingredients': ingredientsMap,
|
'ingredients': ingredientsMap,
|
||||||
'steps': stepsMap,
|
'steps': stepsMap,
|
||||||
|
|||||||
@@ -36,16 +36,17 @@ class _ExpandableTextState extends State<ExpandableText> {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Html(
|
Text(
|
||||||
data: widget.text,
|
widget.text,
|
||||||
style: {
|
style: TextStyles.textMMediumAuto.copyWith(color: appTheme.black),
|
||||||
"*": Style(
|
// style: {
|
||||||
margin: Margins.all(0),
|
// "*": Style(
|
||||||
color: Colors.black87,
|
// margin: Margins.all(0),
|
||||||
maxLines: isExpanded ? null : widget.maxLines,
|
// color: Colors.black87,
|
||||||
textOverflow: TextOverflow.clip,
|
// maxLines: isExpanded ? null : widget.maxLines,
|
||||||
),
|
// textOverflow: TextOverflow.clip,
|
||||||
},
|
// ),
|
||||||
|
// },
|
||||||
),
|
),
|
||||||
if (!isExpanded)
|
if (!isExpanded)
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
@@ -57,11 +58,7 @@ class _ExpandableTextState extends State<ExpandableText> {
|
|||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
begin: Alignment.topCenter,
|
begin: Alignment.topCenter,
|
||||||
end: Alignment.bottomCenter,
|
end: Alignment.bottomCenter,
|
||||||
colors: [
|
colors: [Colors.white.withValues(alpha: 0.0), Colors.white.withValues(alpha: 0.6), Colors.white],
|
||||||
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(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(isExpanded ? s.hide : s.expand, style: TextStyles.textMMedium.copyWith(color: appTheme.blueA400)),
|
||||||
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)),
|
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: "duration") required int duration,
|
||||||
@JsonKey(name: "state") required DietState state,
|
@JsonKey(name: "state") required DietState state,
|
||||||
@JsonKey(name: "type") required DietType type,
|
@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: "daily_schedule") required Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
||||||
@JsonKey(name: "author") required Author author,
|
@JsonKey(name: "author") required Author author,
|
||||||
@JsonKey(name: "total_likes") required int totalLikes,
|
@JsonKey(name: "total_likes") required int totalLikes,
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ mixin _$Diet {
|
|||||||
DietState get state => throw _privateConstructorUsedError;
|
DietState get state => throw _privateConstructorUsedError;
|
||||||
@JsonKey(name: "type")
|
@JsonKey(name: "type")
|
||||||
DietType get type => throw _privateConstructorUsedError;
|
DietType get type => throw _privateConstructorUsedError;
|
||||||
@JsonKey(name: "details")
|
@JsonKey(name: "description_md")
|
||||||
String get details => throw _privateConstructorUsedError;
|
String get details => throw _privateConstructorUsedError;
|
||||||
@JsonKey(name: "daily_schedule")
|
@JsonKey(name: "daily_schedule")
|
||||||
Map<int, Map<int, Map<int, DailySchedule>>> get dailySchedule =>
|
Map<int, Map<int, Map<int, DailySchedule>>> get dailySchedule =>
|
||||||
@@ -326,7 +326,7 @@ abstract class $DietCopyWith<$Res> {
|
|||||||
@JsonKey(name: "duration") int duration,
|
@JsonKey(name: "duration") int duration,
|
||||||
@JsonKey(name: "state") DietState state,
|
@JsonKey(name: "state") DietState state,
|
||||||
@JsonKey(name: "type") DietType type,
|
@JsonKey(name: "type") DietType type,
|
||||||
@JsonKey(name: "details") String details,
|
@JsonKey(name: "description_md") String details,
|
||||||
@JsonKey(name: "daily_schedule")
|
@JsonKey(name: "daily_schedule")
|
||||||
Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
||||||
@JsonKey(name: "author") Author author,
|
@JsonKey(name: "author") Author author,
|
||||||
@@ -491,7 +491,7 @@ abstract class _$$DietImplCopyWith<$Res> implements $DietCopyWith<$Res> {
|
|||||||
@JsonKey(name: "duration") int duration,
|
@JsonKey(name: "duration") int duration,
|
||||||
@JsonKey(name: "state") DietState state,
|
@JsonKey(name: "state") DietState state,
|
||||||
@JsonKey(name: "type") DietType type,
|
@JsonKey(name: "type") DietType type,
|
||||||
@JsonKey(name: "details") String details,
|
@JsonKey(name: "description_md") String details,
|
||||||
@JsonKey(name: "daily_schedule")
|
@JsonKey(name: "daily_schedule")
|
||||||
Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
||||||
@JsonKey(name: "author") Author author,
|
@JsonKey(name: "author") Author author,
|
||||||
@@ -629,7 +629,7 @@ class _$DietImpl implements _Diet {
|
|||||||
@JsonKey(name: "duration") required this.duration,
|
@JsonKey(name: "duration") required this.duration,
|
||||||
@JsonKey(name: "state") required this.state,
|
@JsonKey(name: "state") required this.state,
|
||||||
@JsonKey(name: "type") required this.type,
|
@JsonKey(name: "type") required this.type,
|
||||||
@JsonKey(name: "details") required this.details,
|
@JsonKey(name: "description_md") required this.details,
|
||||||
@JsonKey(name: "daily_schedule")
|
@JsonKey(name: "daily_schedule")
|
||||||
required final Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
required final Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
||||||
@JsonKey(name: "author") required this.author,
|
@JsonKey(name: "author") required this.author,
|
||||||
@@ -665,7 +665,7 @@ class _$DietImpl implements _Diet {
|
|||||||
@JsonKey(name: "type")
|
@JsonKey(name: "type")
|
||||||
final DietType type;
|
final DietType type;
|
||||||
@override
|
@override
|
||||||
@JsonKey(name: "details")
|
@JsonKey(name: "description_md")
|
||||||
final String details;
|
final String details;
|
||||||
final Map<int, Map<int, Map<int, DailySchedule>>> _dailySchedule;
|
final Map<int, Map<int, Map<int, DailySchedule>>> _dailySchedule;
|
||||||
@override
|
@override
|
||||||
@@ -785,7 +785,7 @@ abstract class _Diet implements Diet {
|
|||||||
@JsonKey(name: "duration") required final int duration,
|
@JsonKey(name: "duration") required final int duration,
|
||||||
@JsonKey(name: "state") required final DietState state,
|
@JsonKey(name: "state") required final DietState state,
|
||||||
@JsonKey(name: "type") required final DietType type,
|
@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")
|
@JsonKey(name: "daily_schedule")
|
||||||
required final Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
required final Map<int, Map<int, Map<int, DailySchedule>>> dailySchedule,
|
||||||
@JsonKey(name: "author") required final Author author,
|
@JsonKey(name: "author") required final Author author,
|
||||||
@@ -819,7 +819,7 @@ abstract class _Diet implements Diet {
|
|||||||
@JsonKey(name: "type")
|
@JsonKey(name: "type")
|
||||||
DietType get type;
|
DietType get type;
|
||||||
@override
|
@override
|
||||||
@JsonKey(name: "details")
|
@JsonKey(name: "description_md")
|
||||||
String get details;
|
String get details;
|
||||||
@override
|
@override
|
||||||
@JsonKey(name: "daily_schedule")
|
@JsonKey(name: "daily_schedule")
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ _$DietImpl _$$DietImplFromJson(Map<String, dynamic> json) => _$DietImpl(
|
|||||||
duration: (json['duration'] as num).toInt(),
|
duration: (json['duration'] as num).toInt(),
|
||||||
state: $enumDecode(_$DietStateEnumMap, json['state']),
|
state: $enumDecode(_$DietStateEnumMap, json['state']),
|
||||||
type: DietType.fromJson(json['type'] as Map<String, dynamic>),
|
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(
|
dailySchedule: (json['daily_schedule'] as Map<String, dynamic>).map(
|
||||||
(k, e) => MapEntry(
|
(k, e) => MapEntry(
|
||||||
int.parse(k),
|
int.parse(k),
|
||||||
@@ -70,7 +70,7 @@ Map<String, dynamic> _$$DietImplToJson(
|
|||||||
'duration': instance.duration,
|
'duration': instance.duration,
|
||||||
'state': _$DietStateEnumMap[instance.state]!,
|
'state': _$DietStateEnumMap[instance.state]!,
|
||||||
'type': instance.type,
|
'type': instance.type,
|
||||||
'details': instance.details,
|
'description_md': instance.details,
|
||||||
'daily_schedule': instance.dailySchedule.map(
|
'daily_schedule': instance.dailySchedule.map(
|
||||||
(k, e) => MapEntry(
|
(k, e) => MapEntry(
|
||||||
k.toString(),
|
k.toString(),
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class PacketOptions with _$PacketOptions {
|
|||||||
@JsonKey(name: "items") required List<String> items,
|
@JsonKey(name: "items") required List<String> items,
|
||||||
@JsonKey(name: "price") required dynamic price,
|
@JsonKey(name: "price") required dynamic price,
|
||||||
@JsonKey(name: "short") required String short,
|
@JsonKey(name: "short") required String short,
|
||||||
@JsonKey(name: "description") required String description,
|
@JsonKey(name: "description_md") required String description,
|
||||||
}) = _PacketOptions;
|
}) = _PacketOptions;
|
||||||
|
|
||||||
factory PacketOptions.fromJson(Map<String, dynamic> json) => _$PacketOptionsFromJson(json);
|
factory PacketOptions.fromJson(Map<String, dynamic> json) => _$PacketOptionsFromJson(json);
|
||||||
|
|||||||
@@ -1036,7 +1036,7 @@ mixin _$PacketOptions {
|
|||||||
dynamic get price => throw _privateConstructorUsedError;
|
dynamic get price => throw _privateConstructorUsedError;
|
||||||
@JsonKey(name: "short")
|
@JsonKey(name: "short")
|
||||||
String get short => throw _privateConstructorUsedError;
|
String get short => throw _privateConstructorUsedError;
|
||||||
@JsonKey(name: "description")
|
@JsonKey(name: "description_md")
|
||||||
String get description => throw _privateConstructorUsedError;
|
String get description => throw _privateConstructorUsedError;
|
||||||
|
|
||||||
/// Serializes this PacketOptions to a JSON map.
|
/// Serializes this PacketOptions to a JSON map.
|
||||||
@@ -1060,7 +1060,7 @@ abstract class $PacketOptionsCopyWith<$Res> {
|
|||||||
@JsonKey(name: "items") List<String> items,
|
@JsonKey(name: "items") List<String> items,
|
||||||
@JsonKey(name: "price") dynamic price,
|
@JsonKey(name: "price") dynamic price,
|
||||||
@JsonKey(name: "short") String short,
|
@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: "items") List<String> items,
|
||||||
@JsonKey(name: "price") dynamic price,
|
@JsonKey(name: "price") dynamic price,
|
||||||
@JsonKey(name: "short") String short,
|
@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: "items") required final List<String> items,
|
||||||
@JsonKey(name: "price") required this.price,
|
@JsonKey(name: "price") required this.price,
|
||||||
@JsonKey(name: "short") required this.short,
|
@JsonKey(name: "short") required this.short,
|
||||||
@JsonKey(name: "description") required this.description,
|
@JsonKey(name: "description_md") required this.description,
|
||||||
}) : _items = items;
|
}) : _items = items;
|
||||||
|
|
||||||
factory _$PacketOptionsImpl.fromJson(Map<String, dynamic> json) =>
|
factory _$PacketOptionsImpl.fromJson(Map<String, dynamic> json) =>
|
||||||
@@ -1204,7 +1204,7 @@ class _$PacketOptionsImpl implements _PacketOptions {
|
|||||||
@JsonKey(name: "short")
|
@JsonKey(name: "short")
|
||||||
final String short;
|
final String short;
|
||||||
@override
|
@override
|
||||||
@JsonKey(name: "description")
|
@JsonKey(name: "description_md")
|
||||||
final String description;
|
final String description;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -1253,7 +1253,7 @@ abstract class _PacketOptions implements PacketOptions {
|
|||||||
@JsonKey(name: "items") required final List<String> items,
|
@JsonKey(name: "items") required final List<String> items,
|
||||||
@JsonKey(name: "price") required final dynamic price,
|
@JsonKey(name: "price") required final dynamic price,
|
||||||
@JsonKey(name: "short") required final String short,
|
@JsonKey(name: "short") required final String short,
|
||||||
@JsonKey(name: "description") required final String description,
|
@JsonKey(name: "description_md") required final String description,
|
||||||
}) = _$PacketOptionsImpl;
|
}) = _$PacketOptionsImpl;
|
||||||
|
|
||||||
factory _PacketOptions.fromJson(Map<String, dynamic> json) =
|
factory _PacketOptions.fromJson(Map<String, dynamic> json) =
|
||||||
@@ -1269,7 +1269,7 @@ abstract class _PacketOptions implements PacketOptions {
|
|||||||
@JsonKey(name: "short")
|
@JsonKey(name: "short")
|
||||||
String get short;
|
String get short;
|
||||||
@override
|
@override
|
||||||
@JsonKey(name: "description")
|
@JsonKey(name: "description_md")
|
||||||
String get description;
|
String get description;
|
||||||
|
|
||||||
/// Create a copy of PacketOptions
|
/// 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(),
|
items: (json['items'] as List<dynamic>).map((e) => e as String).toList(),
|
||||||
price: json['price'],
|
price: json['price'],
|
||||||
short: json['short'] as String,
|
short: json['short'] as String,
|
||||||
description: json['description'] as String,
|
description: json['description_md'] as String,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) =>
|
Map<String, dynamic> _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) =>
|
||||||
@@ -101,7 +101,7 @@ Map<String, dynamic> _$$PacketOptionsImplToJson(_$PacketOptionsImpl instance) =>
|
|||||||
'items': instance.items,
|
'items': instance.items,
|
||||||
'price': instance.price,
|
'price': instance.price,
|
||||||
'short': instance.short,
|
'short': instance.short,
|
||||||
'description': instance.description,
|
'description_md': instance.description,
|
||||||
};
|
};
|
||||||
|
|
||||||
_$PlanTypeImpl _$$PlanTypeImplFromJson(Map<String, dynamic> json) =>
|
_$PlanTypeImpl _$$PlanTypeImplFromJson(Map<String, dynamic> json) =>
|
||||||
|
|||||||
@@ -35,21 +35,14 @@ class Recipe with _$Recipe {
|
|||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class Ingredient with _$Ingredient {
|
class Ingredient with _$Ingredient {
|
||||||
const factory Ingredient({
|
const factory Ingredient({required String name, String? unit, required String portion}) = _Ingredient;
|
||||||
required String name,
|
|
||||||
String? unit,
|
|
||||||
required String portion,
|
|
||||||
}) = _Ingredient;
|
|
||||||
|
|
||||||
factory Ingredient.fromJson(Map<String, Object?> json) => _$IngredientFromJson(json);
|
factory Ingredient.fromJson(Map<String, Object?> json) => _$IngredientFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
class Step with _$Step {
|
class Step with _$Step {
|
||||||
const factory Step({
|
const factory Step({required String image, @JsonKey(name: 'description_md') required String description}) = _Step;
|
||||||
required String image,
|
|
||||||
required String description,
|
|
||||||
}) = _Step;
|
|
||||||
|
|
||||||
factory Step.fromJson(Map<String, Object?> json) => _$StepFromJson(json);
|
factory Step.fromJson(Map<String, Object?> json) => _$StepFromJson(json);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -929,6 +929,7 @@ Step _$StepFromJson(Map<String, dynamic> json) {
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
mixin _$Step {
|
mixin _$Step {
|
||||||
String get image => throw _privateConstructorUsedError;
|
String get image => throw _privateConstructorUsedError;
|
||||||
|
@JsonKey(name: 'description_md')
|
||||||
String get description => throw _privateConstructorUsedError;
|
String get description => throw _privateConstructorUsedError;
|
||||||
|
|
||||||
/// Serializes this Step to a JSON map.
|
/// Serializes this Step to a JSON map.
|
||||||
@@ -945,7 +946,10 @@ abstract class $StepCopyWith<$Res> {
|
|||||||
factory $StepCopyWith(Step value, $Res Function(Step) then) =
|
factory $StepCopyWith(Step value, $Res Function(Step) then) =
|
||||||
_$StepCopyWithImpl<$Res, Step>;
|
_$StepCopyWithImpl<$Res, Step>;
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({String image, String description});
|
$Res call({
|
||||||
|
String image,
|
||||||
|
@JsonKey(name: 'description_md') String description,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -989,7 +993,10 @@ abstract class _$$StepImplCopyWith<$Res> implements $StepCopyWith<$Res> {
|
|||||||
) = __$$StepImplCopyWithImpl<$Res>;
|
) = __$$StepImplCopyWithImpl<$Res>;
|
||||||
@override
|
@override
|
||||||
@useResult
|
@useResult
|
||||||
$Res call({String image, String description});
|
$Res call({
|
||||||
|
String image,
|
||||||
|
@JsonKey(name: 'description_md') String description,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @nodoc
|
/// @nodoc
|
||||||
@@ -1024,7 +1031,10 @@ class __$$StepImplCopyWithImpl<$Res>
|
|||||||
/// @nodoc
|
/// @nodoc
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class _$StepImpl implements _Step {
|
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) =>
|
factory _$StepImpl.fromJson(Map<String, dynamic> json) =>
|
||||||
_$$StepImplFromJson(json);
|
_$$StepImplFromJson(json);
|
||||||
@@ -1032,6 +1042,7 @@ class _$StepImpl implements _Step {
|
|||||||
@override
|
@override
|
||||||
final String image;
|
final String image;
|
||||||
@override
|
@override
|
||||||
|
@JsonKey(name: 'description_md')
|
||||||
final String description;
|
final String description;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -1070,7 +1081,7 @@ class _$StepImpl implements _Step {
|
|||||||
abstract class _Step implements Step {
|
abstract class _Step implements Step {
|
||||||
const factory _Step({
|
const factory _Step({
|
||||||
required final String image,
|
required final String image,
|
||||||
required final String description,
|
@JsonKey(name: 'description_md') required final String description,
|
||||||
}) = _$StepImpl;
|
}) = _$StepImpl;
|
||||||
|
|
||||||
factory _Step.fromJson(Map<String, dynamic> json) = _$StepImpl.fromJson;
|
factory _Step.fromJson(Map<String, dynamic> json) = _$StepImpl.fromJson;
|
||||||
@@ -1078,6 +1089,7 @@ abstract class _Step implements Step {
|
|||||||
@override
|
@override
|
||||||
String get image;
|
String get image;
|
||||||
@override
|
@override
|
||||||
|
@JsonKey(name: 'description_md')
|
||||||
String get description;
|
String get description;
|
||||||
|
|
||||||
/// Create a copy of Step
|
/// Create a copy of Step
|
||||||
|
|||||||
@@ -78,11 +78,11 @@ Map<String, dynamic> _$$IngredientImplToJson(_$IngredientImpl instance) =>
|
|||||||
|
|
||||||
_$StepImpl _$$StepImplFromJson(Map<String, dynamic> json) => _$StepImpl(
|
_$StepImpl _$$StepImplFromJson(Map<String, dynamic> json) => _$StepImpl(
|
||||||
image: json['image'] as String,
|
image: json['image'] as String,
|
||||||
description: json['description'] as String,
|
description: json['description_md'] as String,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$$StepImplToJson(_$StepImpl instance) =>
|
Map<String, dynamic> _$$StepImplToJson(_$StepImpl instance) =>
|
||||||
<String, dynamic>{
|
<String, dynamic>{
|
||||||
'image': instance.image,
|
'image': instance.image,
|
||||||
'description': instance.description,
|
'description_md': instance.description,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -67,9 +67,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
|||||||
|
|
||||||
void _scrollToBottom() {
|
void _scrollToBottom() {
|
||||||
_jumped = true;
|
_jumped = true;
|
||||||
scrollController.jumpTo(
|
scrollController.jumpTo(scrollController.position.maxScrollExtent);
|
||||||
scrollController.position.maxScrollExtent,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -78,12 +76,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
|||||||
return BlocProvider(
|
return BlocProvider(
|
||||||
create: (context) => recipeCubit..getRecipe(widget.recipe.slug),
|
create: (context) => recipeCubit..getRecipe(widget.recipe.slug),
|
||||||
child: BlocProvider<CommentsCubit>(
|
child: BlocProvider<CommentsCubit>(
|
||||||
create: (BuildContext context) => commentsCubit
|
create: (BuildContext context) => commentsCubit..getComments(widget.recipe.slug.toString(), CommentSourceType.recipe, true),
|
||||||
..getComments(
|
|
||||||
widget.recipe.slug.toString(),
|
|
||||||
CommentSourceType.recipe,
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
child: BlocConsumer<CommentsCubit, CommentsState>(
|
child: BlocConsumer<CommentsCubit, CommentsState>(
|
||||||
listener: (BuildContext context, CommentsState commentsState) {
|
listener: (BuildContext context, CommentsState commentsState) {
|
||||||
if (commentsState is CommentsStateLoaded) {
|
if (commentsState is CommentsStateLoaded) {
|
||||||
@@ -106,14 +99,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
|||||||
resizeToAvoidBottomInset: true,
|
resizeToAvoidBottomInset: true,
|
||||||
bottomSheet: Container(
|
bottomSheet: Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 12) + (Platform.isIOS ? const EdgeInsets.only(bottom: 16) : EdgeInsets.zero),
|
padding: EdgeInsets.symmetric(vertical: 12) + (Platform.isIOS ? const EdgeInsets.only(bottom: 16) : EdgeInsets.zero),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: Colors.white, border: Border(top: BorderSide(color: Colors.black.withValues(alpha: 0.1)))),
|
||||||
color: Colors.white,
|
|
||||||
border: Border(
|
|
||||||
top: BorderSide(
|
|
||||||
color: Colors.black.withValues(alpha: 0.1),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -133,17 +119,10 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
|||||||
FocusManager.instance.primaryFocus?.unfocus();
|
FocusManager.instance.primaryFocus?.unfocus();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: appTheme.blueA400, shape: BoxShape.circle),
|
||||||
color: appTheme.blueA400,
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
height: 32,
|
height: 32,
|
||||||
width: 32,
|
width: 32,
|
||||||
child: Icon(
|
child: Icon(Icons.close_rounded, size: 18, color: Colors.white),
|
||||||
Icons.close_rounded,
|
|
||||||
size: 18,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (replyId != null) SizedBox(width: 8),
|
if (replyId != null) SizedBox(width: 8),
|
||||||
@@ -159,22 +138,12 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
|||||||
maxLines: 5,
|
maxLines: 5,
|
||||||
minLines: 1,
|
minLines: 1,
|
||||||
keyboardType: TextInputType.multiline,
|
keyboardType: TextInputType.multiline,
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w400, color: Colors.black, height: 1.2),
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
color: Colors.black,
|
|
||||||
height: 1.2,
|
|
||||||
),
|
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
isDense: false, // убираем true, чтобы padding учитывался корректно
|
isDense: false, // убираем true, чтобы padding учитывался корректно
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), // вертикальный паддинг увеличен
|
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), // вертикальный паддинг увеличен
|
||||||
hintText: 'Комментарий',
|
hintText: 'Комментарий',
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w400, height: 1.2, color: Color(0xFFAEAEB2)),
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
height: 1.2,
|
|
||||||
color: Color(0xFFAEAEB2),
|
|
||||||
),
|
|
||||||
filled: true,
|
filled: true,
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
@@ -214,7 +183,10 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
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,
|
height: 32,
|
||||||
width: 32,
|
width: 32,
|
||||||
child: Icon(Icons.send_rounded, size: 18, color: Colors.white),
|
child: Icon(Icons.send_rounded, size: 18, color: Colors.white),
|
||||||
@@ -244,22 +216,14 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
|||||||
path: 'recipe/${widget.recipe.slug}',
|
path: 'recipe/${widget.recipe.slug}',
|
||||||
slug: widget.recipe.slug,
|
slug: widget.recipe.slug,
|
||||||
),
|
),
|
||||||
anchor: Aligned(
|
anchor: Aligned(shiftToWithinBound: AxisFlag(x: true, y: true), follower: Alignment.topRight, target: Alignment.bottomRight),
|
||||||
shiftToWithinBound: AxisFlag(x: true, y: true),
|
|
||||||
follower: Alignment.topRight,
|
|
||||||
target: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
isMoreOptionsVisible = !isMoreOptionsVisible;
|
isMoreOptionsVisible = !isMoreOptionsVisible;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
icon: SvgPicture.asset(
|
icon: SvgPicture.asset('assets/icons/more_button.svg', width: 20, height: 20),
|
||||||
'assets/icons/more_button.svg',
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -294,10 +258,7 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
|||||||
children: [
|
children: [
|
||||||
SvgPicture.asset('assets/icons/eye.svg', width: 18, height: 12),
|
SvgPicture.asset('assets/icons/eye.svg', width: 18, height: 12),
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
Text(
|
Text(widget.recipe.viewsCount.toString(), style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
|
||||||
widget.recipe.viewsCount.toString(),
|
|
||||||
style: TextStyles.textXSSemibold.copyWith(color: appTheme.black),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
backgroundColor: appTheme.whiteA700,
|
backgroundColor: appTheme.whiteA700,
|
||||||
),
|
),
|
||||||
@@ -361,17 +322,11 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
|||||||
SizedBox(height: 16),
|
SizedBox(height: 16),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: Text(
|
child: Text(s.about_recipe, style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black)),
|
||||||
s.about_recipe,
|
|
||||||
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(height: 12),
|
SizedBox(height: 12),
|
||||||
InfoRow(
|
InfoRow(recipe: widget.recipe, type: ProductType.recipe),
|
||||||
recipe: widget.recipe,
|
if (widget.recipe.videoUrl != null && widget.recipe.videoUrl!.isNotEmpty)
|
||||||
type: ProductType.recipe,
|
|
||||||
),
|
|
||||||
if (widget.recipe.videoUrl != null)
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 16, bottom: 12, top: 12),
|
padding: const EdgeInsets.only(left: 16, bottom: 12, top: 12),
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
@@ -389,44 +344,26 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(s.check_out_video_recipe, style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
|
||||||
s.check_out_video_recipe,
|
|
||||||
style: TextStyles.textMSemibold.copyWith(
|
|
||||||
color: appTheme.black,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 12),
|
SizedBox(width: 12),
|
||||||
SvgPicture.asset('assets/icons/play_icon.svg', width: 16, height: 16),
|
SvgPicture.asset('assets/icons/play_icon.svg', width: 16, height: 16),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ExpandableText(
|
ExpandableText(text: widget.recipe.description),
|
||||||
text: widget.recipe.description,
|
|
||||||
),
|
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: AuthorCard(
|
child: AuthorCard(author: widget.recipe.author, title: s.recipe_author),
|
||||||
author: widget.recipe.author,
|
|
||||||
title: s.recipe_author,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox(height: 16),
|
SizedBox(height: 16),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 12),
|
SizedBox(height: 12),
|
||||||
if (widget.recipe.ingredients?.isNotEmpty == true)
|
if (widget.recipe.ingredients?.isNotEmpty == true) IngredientsWidget(recipe: widget.recipe),
|
||||||
IngredientsWidget(
|
if (widget.recipe.steps?.isNotEmpty == true) ...[SizedBox(height: 12), StepsWidget(recipe: widget.recipe)],
|
||||||
recipe: widget.recipe,
|
|
||||||
),
|
|
||||||
if (widget.recipe.steps?.isNotEmpty == true) ...[
|
|
||||||
SizedBox(height: 12),
|
|
||||||
StepsWidget(
|
|
||||||
recipe: widget.recipe,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
SizedBox(height: 8),
|
SizedBox(height: 8),
|
||||||
MainBackgroundBouble(
|
MainBackgroundBouble(
|
||||||
padding: EdgeInsets.symmetric(vertical: 16),
|
padding: EdgeInsets.symmetric(vertical: 16),
|
||||||
@@ -437,20 +374,13 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
|||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Text(
|
child: Text(
|
||||||
recipeState.recipe.commentsCount.toString() + ' ' + getCommentForm(widget.recipe.commentsCount, s),
|
recipeState.recipe.commentsCount.toString() + ' ' + getCommentForm(widget.recipe.commentsCount, s),
|
||||||
style: TextStyles.textMMedium.copyWith(
|
style: TextStyles.textMMedium.copyWith(color: appTheme.gray500),
|
||||||
color: appTheme.gray500,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 16),
|
SizedBox(height: 16),
|
||||||
if (state is CommentsStateLoading) const Loader(),
|
if (state is CommentsStateLoading) const Loader(),
|
||||||
if (state is CommentsStateLoaded)
|
if (state is CommentsStateLoaded)
|
||||||
CommentsWidget(
|
CommentsWidget(id: widget.recipe.slug, commentSourceType: CommentSourceType.recipe, comment: state.comment, replyId: replyId),
|
||||||
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}',
|
path: 'recipe/${widget.recipe.slug}',
|
||||||
slug: widget.recipe.slug,
|
slug: widget.recipe.slug,
|
||||||
),
|
),
|
||||||
anchor: Aligned(
|
anchor: Aligned(shiftToWithinBound: AxisFlag(x: true, y: true), follower: Alignment.topRight, target: Alignment.bottomRight),
|
||||||
shiftToWithinBound: AxisFlag(x: true, y: true),
|
|
||||||
follower: Alignment.topRight,
|
|
||||||
target: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
isMoreOptionsVisible = !isMoreOptionsVisible;
|
isMoreOptionsVisible = !isMoreOptionsVisible;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
icon: SvgPicture.asset(
|
icon: SvgPicture.asset('assets/icons/more_button.svg', width: 20, height: 20),
|
||||||
'assets/icons/more_button.svg',
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: DataErrorWidget(
|
body: DataErrorWidget(onReload: () => context.read<AboutRecipeCubit>().getRecipe(widget.recipe.slug, index: widget.index)),
|
||||||
onReload: () => context.read<AboutRecipeCubit>().getRecipe(widget.recipe.slug, index: widget.index),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@@ -523,22 +443,14 @@ class _AboutRecipeScreenState extends State<AboutRecipeScreen> {
|
|||||||
path: 'recipe/${widget.recipe.slug}',
|
path: 'recipe/${widget.recipe.slug}',
|
||||||
slug: widget.recipe.slug,
|
slug: widget.recipe.slug,
|
||||||
),
|
),
|
||||||
anchor: Aligned(
|
anchor: Aligned(shiftToWithinBound: AxisFlag(x: true, y: true), follower: Alignment.topRight, target: Alignment.bottomRight),
|
||||||
shiftToWithinBound: AxisFlag(x: true, y: true),
|
|
||||||
follower: Alignment.topRight,
|
|
||||||
target: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
isMoreOptionsVisible = !isMoreOptionsVisible;
|
isMoreOptionsVisible = !isMoreOptionsVisible;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
icon: SvgPicture.asset(
|
icon: SvgPicture.asset('assets/icons/more_button.svg', width: 20, height: 20),
|
||||||
'assets/icons/more_button.svg',
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: eatvio_app
|
name: eatvio_app
|
||||||
description: A new Flutter project.
|
description: A new Flutter project.
|
||||||
version: 1.0.50+2
|
version: 1.0.50+3
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user