forked from eatvio/eatvio_app
merge
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart';
|
||||
import 'package:eatvio_app/core/token_storage.dart';
|
||||
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart';
|
||||
import 'package:eatvio_app/features/chat/presentation/pages/chat_screen.dart';
|
||||
import 'package:eatvio_app/features/chat/presentation/pages/chat_select_screen/chat_select_screen.dart';
|
||||
import 'package:eatvio_app/features/diary/presentation/pages/diary_screen.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/pages/registration_screen.dart';
|
||||
import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart';
|
||||
import 'package:eatvio_app/presentation/diary/diary_edit_screen/diary_edit_screen.dart';
|
||||
import 'package:eatvio_app/presentation/diets/diet_create_screen/diet_create_screen.dart';
|
||||
import 'package:eatvio_app/presentation/diets/diet_select_screen/diet_select_screen.dart';
|
||||
import 'package:eatvio_app/features/blog_post_create/presentation/pages/blog_post_create_screen.dart';
|
||||
import 'package:eatvio_app/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart';
|
||||
import 'package:eatvio_app/features/blog_post/presentation/pages/blog_post_screen.dart';
|
||||
import 'package:eatvio_app/features/feed/presentation/pages/feed_screen.dart';
|
||||
@@ -14,24 +16,9 @@ import 'package:eatvio_app/presentation/plans/plan_select_screen/plan_select_scr
|
||||
import 'package:eatvio_app/presentation/profile/my_profile_screen/my_profile_screen.dart';
|
||||
import 'package:eatvio_app/presentation/profile/my_profile_screen/my_settings_screen.dart';
|
||||
import 'package:eatvio_app/presentation/recipe/recipe_select_screen/recipe_select_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/additional_information_screen/additional_information_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/allergies_screen/allergies_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/blood_pressure_screen/blood_pressure_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/body_circumferences_screen/body_circumferences_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/city_of_living_screen/city_of_living_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/credentials_screen/credentials_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/date_of_birth_screen/date_of_birth_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/favorite_foods_screen/favorite_foods_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/favorite_sports_screen/favorite_sports_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/gender_screen/gender_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/height_screen/height_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/language_select_screen/language_select_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/medicine_intake_screen/medicine_intake_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/name_screen/name_screen.dart';
|
||||
import 'package:eatvio_app/presentation/registration/weight_screen/weight_screen.dart';
|
||||
import 'package:eatvio_app/widgets/bottom_navigation_bar_widget.dart';
|
||||
import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
class AppRouter {
|
||||
@@ -78,11 +65,6 @@ class AppRouter {
|
||||
name: 'feedScreen',
|
||||
builder: (context, state) => FeedScreen(),
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: 'blog-post-create-screen',
|
||||
name: 'blogPostCreateScreen',
|
||||
builder: (context, state) => BlogPostCreateScreen.builder(context),
|
||||
),
|
||||
GoRoute(
|
||||
path: 'blog-post-screen',
|
||||
name: 'blogPostScreen',
|
||||
|
||||
@@ -8,6 +8,6 @@ part 'calendar_service.g.dart';
|
||||
abstract class CalendarService {
|
||||
factory CalendarService(Dio dio, {String baseUrl}) = _CalendarService;
|
||||
|
||||
@GET('/calendar/index')
|
||||
@GET('/api/calendar/index')
|
||||
Future<Map<String, CalendarModel>> getCalendar();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class _CalendarService implements CalendarService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/calendar/index',
|
||||
'/api/calendar/index',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
|
||||
@@ -7,7 +7,8 @@ part 'photo.g.dart';
|
||||
class Photo with _$Photo {
|
||||
const factory Photo({
|
||||
required int id,
|
||||
required String original_name,
|
||||
@JsonKey(name: 'original_name')
|
||||
required String originalName,
|
||||
required String path,
|
||||
}) = _Photo;
|
||||
|
||||
|
||||
@@ -21,7 +21,8 @@ Photo _$PhotoFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$Photo {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
String get original_name => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'original_name')
|
||||
String get originalName => throw _privateConstructorUsedError;
|
||||
String get path => throw _privateConstructorUsedError;
|
||||
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -34,7 +35,10 @@ abstract class $PhotoCopyWith<$Res> {
|
||||
factory $PhotoCopyWith(Photo value, $Res Function(Photo) then) =
|
||||
_$PhotoCopyWithImpl<$Res, Photo>;
|
||||
@useResult
|
||||
$Res call({int id, String original_name, String path});
|
||||
$Res call(
|
||||
{int id,
|
||||
@JsonKey(name: 'original_name') String originalName,
|
||||
String path});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -51,7 +55,7 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo>
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? original_name = null,
|
||||
Object? originalName = null,
|
||||
Object? path = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
@@ -59,9 +63,9 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo>
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
original_name: null == original_name
|
||||
? _value.original_name
|
||||
: original_name // ignore: cast_nullable_to_non_nullable
|
||||
originalName: null == originalName
|
||||
? _value.originalName
|
||||
: originalName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
path: null == path
|
||||
? _value.path
|
||||
@@ -78,7 +82,10 @@ abstract class _$$PhotoImplCopyWith<$Res> implements $PhotoCopyWith<$Res> {
|
||||
__$$PhotoImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({int id, String original_name, String path});
|
||||
$Res call(
|
||||
{int id,
|
||||
@JsonKey(name: 'original_name') String originalName,
|
||||
String path});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -93,7 +100,7 @@ class __$$PhotoImplCopyWithImpl<$Res>
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? original_name = null,
|
||||
Object? originalName = null,
|
||||
Object? path = null,
|
||||
}) {
|
||||
return _then(_$PhotoImpl(
|
||||
@@ -101,9 +108,9 @@ class __$$PhotoImplCopyWithImpl<$Res>
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
original_name: null == original_name
|
||||
? _value.original_name
|
||||
: original_name // ignore: cast_nullable_to_non_nullable
|
||||
originalName: null == originalName
|
||||
? _value.originalName
|
||||
: originalName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
path: null == path
|
||||
? _value.path
|
||||
@@ -117,7 +124,9 @@ class __$$PhotoImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$PhotoImpl implements _Photo {
|
||||
const _$PhotoImpl(
|
||||
{required this.id, required this.original_name, required this.path});
|
||||
{required this.id,
|
||||
@JsonKey(name: 'original_name') required this.originalName,
|
||||
required this.path});
|
||||
|
||||
factory _$PhotoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$PhotoImplFromJson(json);
|
||||
@@ -125,13 +134,14 @@ class _$PhotoImpl implements _Photo {
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
final String original_name;
|
||||
@JsonKey(name: 'original_name')
|
||||
final String originalName;
|
||||
@override
|
||||
final String path;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Photo(id: $id, original_name: $original_name, path: $path)';
|
||||
return 'Photo(id: $id, originalName: $originalName, path: $path)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -140,14 +150,14 @@ class _$PhotoImpl implements _Photo {
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$PhotoImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.original_name, original_name) ||
|
||||
other.original_name == original_name) &&
|
||||
(identical(other.originalName, originalName) ||
|
||||
other.originalName == originalName) &&
|
||||
(identical(other.path, path) || other.path == path));
|
||||
}
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, original_name, path);
|
||||
int get hashCode => Object.hash(runtimeType, id, originalName, path);
|
||||
|
||||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@@ -166,7 +176,7 @@ class _$PhotoImpl implements _Photo {
|
||||
abstract class _Photo implements Photo {
|
||||
const factory _Photo(
|
||||
{required final int id,
|
||||
required final String original_name,
|
||||
@JsonKey(name: 'original_name') required final String originalName,
|
||||
required final String path}) = _$PhotoImpl;
|
||||
|
||||
factory _Photo.fromJson(Map<String, dynamic> json) = _$PhotoImpl.fromJson;
|
||||
@@ -174,7 +184,8 @@ abstract class _Photo implements Photo {
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
String get original_name;
|
||||
@JsonKey(name: 'original_name')
|
||||
String get originalName;
|
||||
@override
|
||||
String get path;
|
||||
@override
|
||||
|
||||
@@ -8,13 +8,13 @@ part of 'photo.dart';
|
||||
|
||||
_$PhotoImpl _$$PhotoImplFromJson(Map<String, dynamic> json) => _$PhotoImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
original_name: json['original_name'] as String,
|
||||
originalName: json['original_name'] as String,
|
||||
path: json['path'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$PhotoImplToJson(_$PhotoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'original_name': instance.original_name,
|
||||
'original_name': instance.originalName,
|
||||
'path': instance.path,
|
||||
};
|
||||
|
||||
@@ -11,7 +11,6 @@ import 'package:image_picker/image_picker.dart';
|
||||
import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:convert';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
|
||||
part 'diary_event.dart';
|
||||
|
||||
@@ -144,7 +143,7 @@ class DiaryBloc extends Bloc<DiaryEvent, DiaryState> {
|
||||
) async {
|
||||
final responseChart = await http.get(
|
||||
Uri.parse(
|
||||
dotenv.env['SERVER_ROOT']! + '/diary/$diaryID/dailyNutritionData/',
|
||||
baseUrl + '/api/' + '/diary/$diaryID/dailyNutritionData/',
|
||||
),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -613,6 +613,7 @@ abstract class _$$DiaryStateLoadedImplCopyWith<$Res> {
|
||||
|
||||
$DiaryModelCopyWith<$Res> get diary;
|
||||
$MealCopyWith<$Res> get currentMeal;
|
||||
$SelectionPopupModelCopyWith<$Res> get portionController;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -786,6 +787,15 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
|
||||
return _then(_value.copyWith(currentMeal: value));
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$SelectionPopupModelCopyWith<$Res> get portionController {
|
||||
return $SelectionPopupModelCopyWith<$Res>(_value.portionController,
|
||||
(value) {
|
||||
return _then(_value.copyWith(portionController: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
@@ -17,7 +17,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:syncfusion_flutter_charts/charts.dart';
|
||||
@@ -111,35 +110,80 @@ class DiaryScreen extends StatelessWidget {
|
||||
|
||||
_buildNutritionChart(BuildContext context, DiaryStateLoaded state) {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 16.h, vertical: 16.h),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 24.h,
|
||||
vertical: 12.v,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.5),
|
||||
spreadRadius: 2,
|
||||
blurRadius: 5,
|
||||
offset: Offset(0, 3),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: SfCircularChart(
|
||||
title: ChartTitle(text: 'График КБЖУ'),
|
||||
legend: Legend(isVisible: true),
|
||||
series: <CircularSeries>[
|
||||
RadialBarSeries<NutritionData, String>(
|
||||
dataSource: state.chartData,
|
||||
xValueMapper: (NutritionData data, _) => data.category,
|
||||
yValueMapper: (NutritionData data, _) => data.nutrition,
|
||||
pointColorMapper: (NutritionData data, _) => data.color,
|
||||
)
|
||||
],
|
||||
));
|
||||
margin: EdgeInsets.symmetric(horizontal: 16.h, vertical: 16.h),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 24.h,
|
||||
vertical: 12.v,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.5),
|
||||
spreadRadius: 2,
|
||||
blurRadius: 5,
|
||||
offset: Offset(0, 3),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"График КБЖУ",
|
||||
style: theme.textTheme.titleMedium,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Transform.rotate(
|
||||
angle: -1.5708,
|
||||
child: ClipRect(
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
widthFactor: 0.5,
|
||||
child: SfCircularChart(
|
||||
legend: Legend(isVisible: false),
|
||||
series: <CircularSeries>[
|
||||
RadialBarSeries<NutritionData, String>(
|
||||
dataSource: state.chartData,
|
||||
xValueMapper: (NutritionData data, _) => data.category,
|
||||
yValueMapper: (NutritionData data, _) => data.nutrition,
|
||||
pointColorMapper: (NutritionData data, _) => data.color,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
SizedBox(height: 16.0),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Калории'),
|
||||
Text('Белки'),
|
||||
Text('Жиры'),
|
||||
Text('Углеводы'),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'${state.chartData![0].nutrition.toStringAsFixed(1)}'), // Калории
|
||||
Text(
|
||||
'${state.chartData![1].nutrition.toStringAsFixed(1)}'), // Белки
|
||||
Text(
|
||||
'${state.chartData![2].nutrition.toStringAsFixed(1)}'), // Жиры
|
||||
Text(
|
||||
'${state.chartData![3].nutrition.toStringAsFixed(1)}'), // Углеводы
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_buildEndDay(BuildContext context) {
|
||||
@@ -759,7 +803,7 @@ class DiaryScreen extends StatelessWidget {
|
||||
borderRadius: BorderRadiusStyle.roundedBorder5,
|
||||
),
|
||||
child: Image.network(
|
||||
dotenv.env['STORAGE_URL']! + photo.path,
|
||||
baseUrl + '/storage/' + photo.path,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
|
||||
@@ -12,46 +12,46 @@ part 'diary_service.g.dart';
|
||||
abstract class DiaryService {
|
||||
factory DiaryService(Dio dio, {String baseUrl}) = _DiaryService;
|
||||
|
||||
@GET('/diary/index')
|
||||
@GET('/api/diary/index')
|
||||
Future<Map<String, int>> getDiaryID();
|
||||
|
||||
@GET('/diary/{id}/show/')
|
||||
@GET('/api/diary/{id}/show/')
|
||||
Future<Map<String, DiaryModel>> getDiary(@Path() int id);
|
||||
|
||||
@GET('/diary/{id}/dailyNutritionData/')
|
||||
@GET('/api/diary/{id}/dailyNutritionData/')
|
||||
Future<dynamic> getChart(@Path() int id);
|
||||
|
||||
@GET('/diary/product_nutritional_values/filter')
|
||||
@GET('/api/diary/product_nutritional_values/filter')
|
||||
Future<Map<String, List<Product>>> getInputProduct(
|
||||
@Query('name') String name);
|
||||
|
||||
@POST('/diary/{diary_id}/meal/{meal_id}/satiety/fill')
|
||||
@POST('/api/diary/{diary_id}/meal/{meal_id}/satiety/fill')
|
||||
Future<Map<String, int>> sendSatietyData(
|
||||
@Path() int diary_id,
|
||||
@Path() int meal_id,
|
||||
@Query('satiety') int satiety,
|
||||
);
|
||||
|
||||
@POST('/diary/{diary_id}/meal/{meal_id}/mood/fill')
|
||||
@POST('/api/diary/{diary_id}/meal/{meal_id}/mood/fill')
|
||||
Future<Map<String, int>> sendMoodData(
|
||||
@Path() int diary_id,
|
||||
@Path() int meal_id,
|
||||
@Query('mood') int mood,
|
||||
);
|
||||
|
||||
@POST('/diary/{diary_id}/wakeup/fill')
|
||||
@POST('/api/diary/{diary_id}/wakeup/fill')
|
||||
Future<DiaryModel> sendWakeupData(
|
||||
@Path() int diary_id,
|
||||
@Query('wakeup') String wakeup,
|
||||
);
|
||||
|
||||
@POST('/diary/{diary_id}/retire/fill')
|
||||
@POST('/api/diary/{diary_id}/retire/fill')
|
||||
Future<DiaryModel> sendRetireData(
|
||||
@Path() int diary_id,
|
||||
@Query('retire') String retire,
|
||||
);
|
||||
|
||||
@POST('/diary/{diary_id}/meal/{meal_id}/portions/create')
|
||||
@POST('/api/diary/{diary_id}/meal/{meal_id}/portions/create')
|
||||
Future<Map<String, Portion>> sendPortionData(
|
||||
@Path() int diary_id,
|
||||
@Path() int meal_id,
|
||||
@@ -60,14 +60,14 @@ abstract class DiaryService {
|
||||
@Query('quantity') int quantity,
|
||||
);
|
||||
|
||||
@POST('/diary/{diary_id}/meal/{meal_id}/photo/upload')
|
||||
@POST('/api/diary/{diary_id}/meal/{meal_id}/photo/upload')
|
||||
Future<void> uploadImage(
|
||||
@Path() int diary_id,
|
||||
@Path() int meal_id,
|
||||
@Part() File photo,
|
||||
);
|
||||
|
||||
@POST('/diary/product_nutritional_values/sendToModeration')
|
||||
@POST('/api/diary/product_nutritional_values/sendToModeration')
|
||||
Future<Map<String, String>> sendModerationData(
|
||||
@Query('name') String product_name,
|
||||
@Query('energy_on_100gr') double energy_on_100gr,
|
||||
@@ -76,7 +76,7 @@ abstract class DiaryService {
|
||||
@Query('carbohydrates_on_100gr') double carbohydrates_on_100gr,
|
||||
);
|
||||
|
||||
@POST('/diary/{diary_id}/finishDay')
|
||||
@POST('/api/diary/{diary_id}/finishDay')
|
||||
Future<void> sendFinishDay(
|
||||
@Path() int diary_id,
|
||||
@Query('wakeUp') String wakeup,
|
||||
@@ -84,14 +84,14 @@ abstract class DiaryService {
|
||||
@Query('comment') String comment,
|
||||
);
|
||||
|
||||
@DELETE('/diary/{diary_id}/meal/{meal_id}/portions/{portion_id}/delete')
|
||||
@DELETE('/api/diary/{diary_id}/meal/{meal_id}/portions/{portion_id}/delete')
|
||||
Future<void> sendRemovePortionData(
|
||||
@Path() int diary_id,
|
||||
@Path() int meal_id,
|
||||
@Path() int portion_id,
|
||||
);
|
||||
|
||||
@DELETE('/diary/{diary_id}/meal/{meal_id}/photo/delete')
|
||||
@DELETE('/api/diary/{diary_id}/meal/{meal_id}/photo/delete')
|
||||
Future<void> sendRemovePhotoData(
|
||||
@Path() int diary_id,
|
||||
@Path() int meal_id,
|
||||
|
||||
@@ -32,7 +32,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/index',
|
||||
'/api/diary/index',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -59,7 +59,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/${id}/show/',
|
||||
'/api/diary/${id}/show/',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -86,7 +86,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/${id}/dailyNutritionData/',
|
||||
'/api/diary/${id}/dailyNutritionData/',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -113,7 +113,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/product_nutritional_values/filter',
|
||||
'/api/diary/product_nutritional_values/filter',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -148,7 +148,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/${diary_id}/meal/${meal_id}/satiety/fill',
|
||||
'/api/diary/${diary_id}/meal/${meal_id}/satiety/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -179,7 +179,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/${diary_id}/meal/${meal_id}/mood/fill',
|
||||
'/api/diary/${diary_id}/meal/${meal_id}/mood/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -209,7 +209,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/${diary_id}/wakeup/fill',
|
||||
'/api/diary/${diary_id}/wakeup/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -239,7 +239,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/${diary_id}/retire/fill',
|
||||
'/api/diary/${diary_id}/retire/fill',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -276,7 +276,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/${diary_id}/meal/${meal_id}/portions/create',
|
||||
'/api/diary/${diary_id}/meal/${meal_id}/portions/create',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -314,7 +314,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/${diary_id}/meal/${meal_id}/photo/upload',
|
||||
'/api/diary/${diary_id}/meal/${meal_id}/photo/upload',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -351,7 +351,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/product_nutritional_values/sendToModeration',
|
||||
'/api/diary/product_nutritional_values/sendToModeration',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -386,7 +386,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/${diary_id}/finishDay',
|
||||
'/api/diary/${diary_id}/finishDay',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -414,7 +414,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/${diary_id}/meal/${meal_id}/portions/${portion_id}/delete',
|
||||
'/api/diary/${diary_id}/meal/${meal_id}/portions/${portion_id}/delete',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
@@ -446,7 +446,7 @@ class _DiaryService implements DiaryService {
|
||||
)
|
||||
.compose(
|
||||
_dio.options,
|
||||
'/diary/${diary_id}/meal/${meal_id}/photo/delete',
|
||||
'/api/diary/${diary_id}/meal/${meal_id}/photo/delete',
|
||||
queryParameters: queryParameters,
|
||||
data: _data,
|
||||
)
|
||||
|
||||
@@ -1,15 +1,23 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:eatvio_app/core/constants/constants.dart';
|
||||
import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart';
|
||||
import 'package:eatvio_app/features/blog_post/presentation/bloc/blog_post_cubit.dart';
|
||||
import 'package:eatvio_app/features/blog_post/repositories/blog_post_repository.dart';
|
||||
import 'package:eatvio_app/features/blog_post/services/blog_post_service.dart';
|
||||
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_cubit.dart';
|
||||
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart';
|
||||
import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart';
|
||||
import 'package:eatvio_app/features/chat/repositories/chat_repository.dart';
|
||||
import 'package:eatvio_app/features/chat/services/chat_service.dart';
|
||||
import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart';
|
||||
import 'package:eatvio_app/features/diary/repositories/diary_repository.dart';
|
||||
import 'package:eatvio_app/features/diary/services/diary_service.dart';
|
||||
import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart';
|
||||
import 'package:eatvio_app/features/feed/repositories/feed_repository.dart';
|
||||
import 'package:eatvio_app/features/feed/services/feed_service.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:eatvio_app/features/registration/presentation/bloc/registration_cubit/registration_cubit.dart';
|
||||
import 'package:eatvio_app/features/registration/repositories/registration_repository.dart';
|
||||
import 'package:eatvio_app/features/registration/services/registration_service.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
|
||||
final sl = GetIt.instance;
|
||||
@@ -23,8 +31,7 @@ Future<void> init() async {
|
||||
sl.registerFactory<RegistrationCubit>(() => RegistrationCubit(registrationRepository: sl()));
|
||||
sl.registerFactory<ChatRoomCubit>(() => ChatRoomCubit(chatRepository: sl(), initializationCubit: sl()));
|
||||
sl.registerFactory<FeedCubit>(() => FeedCubit(feedRepository: sl()));
|
||||
sl.registerFactory<BlogPostCubit>(
|
||||
() => BlogPostCubit(blogPostRepository: sl()));
|
||||
sl.registerFactory<BlogPostCubit>(() => BlogPostCubit(blogPostRepository: sl()));
|
||||
sl.registerFactory<DiaryBloc>(() => DiaryBloc(diaryRepository: sl()));
|
||||
|
||||
// Repository
|
||||
@@ -32,8 +39,7 @@ Future<void> init() async {
|
||||
sl.registerLazySingleton<FeedRepository>(() => FeedRepository(feedService: sl()));
|
||||
sl.registerLazySingleton<BlogPostRepository>(() => BlogPostRepository(blogPostService: sl()));
|
||||
sl.registerLazySingleton<RegistrationRepository>(() => RegistrationRepository(registrationService: sl()));
|
||||
sl.registerLazySingleton<DiaryRepository>(
|
||||
() => DiaryRepository(diaryService: sl()));
|
||||
sl.registerLazySingleton<DiaryRepository>(() => DiaryRepository(diaryService: sl()));
|
||||
|
||||
// Services
|
||||
sl.registerLazySingleton<ChatService>(() => ChatService(sl()));
|
||||
|
||||
@@ -44,6 +44,7 @@ dependencies:
|
||||
lazy_load_scrollview: ^1.3.0
|
||||
badges: ^3.1.2
|
||||
google_fonts: ^6.2.1
|
||||
syncfusion_flutter_charts: ^26.1.42
|
||||
|
||||
dev_dependencies:
|
||||
build_runner: ^2.4.11
|
||||
|
||||
Reference in New Issue
Block a user