diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml
index 0fd6fdd1..3ab485dc 100644
--- a/.gitea/workflows/test.yml
+++ b/.gitea/workflows/test.yml
@@ -3,7 +3,7 @@ name: Eatvio App Android Test
on: [ pull_request ]
env:
- flutter_version: "3.22.0"
+ flutter_version: "3.24.2"
java_version: "17.x"
flutter_channel: "stable"
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 7652369e..bc059244 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -26,7 +26,7 @@ if (flutterVersionName == null) {
android {
namespace = "com.eatvioapp.app"
compileSdk = flutter.compileSdkVersion
- ndkVersion = flutter.ndkVersion
+ ndkVersion = "25.1.8937393"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
diff --git a/assets/icons/chat.svg b/assets/icons/chat.svg
new file mode 100644
index 00000000..01f615fe
--- /dev/null
+++ b/assets/icons/chat.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/comment.svg b/assets/icons/comment.svg
new file mode 100644
index 00000000..60b1e584
--- /dev/null
+++ b/assets/icons/comment.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/copy.svg b/assets/icons/copy.svg
new file mode 100644
index 00000000..4ddffa65
--- /dev/null
+++ b/assets/icons/copy.svg
@@ -0,0 +1,19 @@
+
+
+
+
diff --git a/assets/icons/diary.svg b/assets/icons/diary.svg
new file mode 100644
index 00000000..3ddc00d2
--- /dev/null
+++ b/assets/icons/diary.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/exit.svg b/assets/icons/exit.svg
new file mode 100644
index 00000000..11e622be
--- /dev/null
+++ b/assets/icons/exit.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/favorite_blog_posts.svg b/assets/icons/favorite_blog_posts.svg
new file mode 100644
index 00000000..b4c30bc7
--- /dev/null
+++ b/assets/icons/favorite_blog_posts.svg
@@ -0,0 +1,22 @@
+
+
+
+
diff --git a/assets/icons/favorite_recipes.svg b/assets/icons/favorite_recipes.svg
new file mode 100644
index 00000000..028fb5b3
--- /dev/null
+++ b/assets/icons/favorite_recipes.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/feed.svg b/assets/icons/feed.svg
new file mode 100644
index 00000000..3cefd68a
--- /dev/null
+++ b/assets/icons/feed.svg
@@ -0,0 +1,19 @@
+
+
+
+
diff --git a/assets/icons/filter.svg b/assets/icons/filter.svg
new file mode 100644
index 00000000..7f5491ff
--- /dev/null
+++ b/assets/icons/filter.svg
@@ -0,0 +1,67 @@
+
+
+
+
diff --git a/assets/icons/finance.svg b/assets/icons/finance.svg
new file mode 100644
index 00000000..3bb33357
--- /dev/null
+++ b/assets/icons/finance.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/glosasry.svg b/assets/icons/glosasry.svg
new file mode 100644
index 00000000..1cb5ba2c
--- /dev/null
+++ b/assets/icons/glosasry.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/like.svg b/assets/icons/like.svg
new file mode 100644
index 00000000..11397221
--- /dev/null
+++ b/assets/icons/like.svg
@@ -0,0 +1,42 @@
+
+
+
+
diff --git a/assets/icons/like_filled.svg b/assets/icons/like_filled.svg
new file mode 100644
index 00000000..e39670c3
--- /dev/null
+++ b/assets/icons/like_filled.svg
@@ -0,0 +1,42 @@
+
+
+
+
diff --git a/assets/icons/meat.svg b/assets/icons/meat.svg
new file mode 100644
index 00000000..5205a78c
--- /dev/null
+++ b/assets/icons/meat.svg
@@ -0,0 +1,20 @@
+
+
+
+
diff --git a/assets/icons/my_blog_posts.svg b/assets/icons/my_blog_posts.svg
new file mode 100644
index 00000000..4dd28718
--- /dev/null
+++ b/assets/icons/my_blog_posts.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/my_diets.svg b/assets/icons/my_diets.svg
new file mode 100644
index 00000000..7714b3fa
--- /dev/null
+++ b/assets/icons/my_diets.svg
@@ -0,0 +1,24 @@
+
+
+
+
diff --git a/assets/icons/my_plans.svg b/assets/icons/my_plans.svg
new file mode 100644
index 00000000..5e100f69
--- /dev/null
+++ b/assets/icons/my_plans.svg
@@ -0,0 +1,35 @@
+
+
+
+
diff --git a/assets/icons/my_rating.svg b/assets/icons/my_rating.svg
new file mode 100644
index 00000000..8b5e069f
--- /dev/null
+++ b/assets/icons/my_rating.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/my_recipes.svg b/assets/icons/my_recipes.svg
new file mode 100644
index 00000000..246014c5
--- /dev/null
+++ b/assets/icons/my_recipes.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/notifications.svg b/assets/icons/notifications.svg
new file mode 100644
index 00000000..fe550083
--- /dev/null
+++ b/assets/icons/notifications.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/paste.svg b/assets/icons/paste.svg
new file mode 100644
index 00000000..a6fe95bf
--- /dev/null
+++ b/assets/icons/paste.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/profile_settings.svg b/assets/icons/profile_settings.svg
new file mode 100644
index 00000000..b3852d07
--- /dev/null
+++ b/assets/icons/profile_settings.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/send.svg b/assets/icons/send.svg
new file mode 100644
index 00000000..d4b7b65e
--- /dev/null
+++ b/assets/icons/send.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/share.svg b/assets/icons/share.svg
new file mode 100644
index 00000000..711847c2
--- /dev/null
+++ b/assets/icons/share.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/subscribers.svg b/assets/icons/subscribers.svg
new file mode 100644
index 00000000..4006d4b4
--- /dev/null
+++ b/assets/icons/subscribers.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/time.svg b/assets/icons/time.svg
new file mode 100644
index 00000000..5037d404
--- /dev/null
+++ b/assets/icons/time.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/views.svg b/assets/icons/views.svg
new file mode 100644
index 00000000..60ff0928
--- /dev/null
+++ b/assets/icons/views.svg
@@ -0,0 +1,23 @@
+
+
+
+
diff --git a/assets/icons/Консультации.svg b/assets/icons/Консультации.svg
new file mode 100644
index 00000000..0bb87eaa
--- /dev/null
+++ b/assets/icons/Консультации.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/Шаги.svg b/assets/icons/Шаги.svg
new file mode 100644
index 00000000..14563821
--- /dev/null
+++ b/assets/icons/Шаги.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/калорийность.svg b/assets/icons/калорийность.svg
new file mode 100644
index 00000000..329d1bda
--- /dev/null
+++ b/assets/icons/калорийность.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/легкая.svg b/assets/icons/легкая.svg
new file mode 100644
index 00000000..1f752bc3
--- /dev/null
+++ b/assets/icons/легкая.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/овощи.svg b/assets/icons/овощи.svg
new file mode 100644
index 00000000..3d0d4eba
--- /dev/null
+++ b/assets/icons/овощи.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/поддержание формы.svg b/assets/icons/поддержание формы.svg
new file mode 100644
index 00000000..eb3aca15
--- /dev/null
+++ b/assets/icons/поддержание формы.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/поддержка.svg b/assets/icons/поддержка.svg
new file mode 100644
index 00000000..84b48d66
--- /dev/null
+++ b/assets/icons/поддержка.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/похудения.svg b/assets/icons/похудения.svg
new file mode 100644
index 00000000..680582a8
--- /dev/null
+++ b/assets/icons/похудения.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/углеводная.svg b/assets/icons/углеводная.svg
new file mode 100644
index 00000000..3926c874
--- /dev/null
+++ b/assets/icons/углеводная.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/улучшение самочувствия.svg b/assets/icons/улучшение самочувствия.svg
new file mode 100644
index 00000000..0a66c836
--- /dev/null
+++ b/assets/icons/улучшение самочувствия.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/формирование пище.svg b/assets/icons/формирование пище.svg
new file mode 100644
index 00000000..a50c9209
--- /dev/null
+++ b/assets/icons/формирование пище.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/хорошее.svg b/assets/icons/хорошее.svg
new file mode 100644
index 00000000..430bea61
--- /dev/null
+++ b/assets/icons/хорошее.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/хорошеее.svg b/assets/icons/хорошеее.svg
new file mode 100644
index 00000000..8f45b384
--- /dev/null
+++ b/assets/icons/хорошеее.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/icons/этапы шаги.svg b/assets/icons/этапы шаги.svg
new file mode 100644
index 00000000..8bb51a1c
--- /dev/null
+++ b/assets/icons/этапы шаги.svg
@@ -0,0 +1,18 @@
+
+
+
+
diff --git a/assets/rive_animations/loading.riv b/assets/rive_animations/loading.riv
new file mode 100644
index 00000000..d328f26d
Binary files /dev/null and b/assets/rive_animations/loading.riv differ
diff --git a/flutter_01.log b/flutter_01.log
deleted file mode 100644
index f7f3c20d..00000000
--- a/flutter_01.log
+++ /dev/null
@@ -1,97 +0,0 @@
-Flutter crash report.
-Please report a bug at https://github.com/flutter/flutter/issues.
-
-## command
-
-flutter analyze
-
-## exception
-
-PathNotFoundException: PathNotFoundException: Cannot open file, path = '/home/alex/snap/flutter/common/flutter/version' (OS Error: No such file or directory, errno = 2)
-
-```
-#0 _File.throwIfError (dart:io/file_impl.dart:675:7)
-#1 _File.openSync (dart:io/file_impl.dart:490:5)
-#2 _File.readAsBytesSync (dart:io/file_impl.dart:574:18)
-#3 _File.readAsStringSync (dart:io/file_impl.dart:624:18)
-#4 ForwardingFile.readAsStringSync (package:file/src/forwarding/forwarding_file.dart:99:16)
-#5 ErrorHandlingFile.readAsStringSync. (package:flutter_tools/src/base/error_handling_io.dart:217:22)
-#6 _runSync (package:flutter_tools/src/base/error_handling_io.dart:587:14)
-#7 ErrorHandlingFile.readAsStringSync (package:flutter_tools/src/base/error_handling_io.dart:216:12)
-#8 _DefaultPub.get (package:flutter_tools/src/dart/pub.dart:302:58)
-#9 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1724:17)
-
-#10 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1394:27)
-
-#11 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19)
-
-#12 CommandRunner.runCommand (package:args/command_runner.dart:212:13)
-
-#13 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:372:9)
-
-#14 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19)
-
-#15 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:308:5)
-
-#16 run.. (package:flutter_tools/runner.dart:130:9)
-
-#17 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19)
-
-#18 main (package:flutter_tools/executable.dart:93:3)
-
-```
-
-## flutter doctor
-
-```
-[!] Flutter (Channel [user-branch], 0.0.0-unknown, on Ubuntu 24.04 LTS 6.8.0-38-generic, locale ru_RU.UTF-8)
- ! Flutter version 0.0.0-unknown on channel [user-branch] at /home/alex/snap/flutter/common/flutter
- Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
- If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
- Cannot resolve current version, possibly due to local changes.
- Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
- ! Upstream repository unknown source is not a standard remote.
- Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
- • Framework revision (), 1970-01-01 03:00:00.000
- • Engine revision edd8546116
- • Dart version 3.4.3
- • DevTools version 2.34.3
- • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
-
-[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
- • Android SDK at /home/alex/Android/Sdk
- • Platform android-35, build-tools 35.0.0
- • Java binary at: /snap/android-studio/161/jbr/bin/java
- • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
- • All Android licenses accepted.
-
-[✓] Chrome - develop for the web
- • Chrome at google-chrome
-
-[✓] Linux toolchain - develop for Linux desktop
- • clang version 10.0.0-4ubuntu1
- • cmake version 3.16.3
- • ninja version 1.10.0
- • pkg-config version 0.29.1
-
-[✓] Android Studio (version 2024.1)
- • Android Studio at /snap/android-studio/161
- • Flutter plugin version 80.0.2
- • Dart plugin can be installed from:
- 🔨 https://plugins.jetbrains.com/plugin/6351-dart
- • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
-
-[✓] VS Code (version 1.91.1)
- • VS Code at /usr/share/code
- • Flutter extension version 3.92.0
-
-[✓] Connected device (3 available)
- • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 15 (API 35) (emulator)
- • Linux (desktop) • linux • linux-x64 • Ubuntu 24.04 LTS 6.8.0-38-generic
- • Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.126
-
-[✓] Network resources
- • All expected network resources are available.
-
-! Doctor found issues in 1 category.
-```
diff --git a/lib/app_router.dart b/lib/app_router.dart
index f872ddc9..e54fe2da 100644
--- a/lib/app_router.dart
+++ b/lib/app_router.dart
@@ -15,19 +15,28 @@ import 'package:eatvio_app/features/feed/models/recipes_model.dart';
import 'package:eatvio_app/features/feed/presentation/pages/feed_screen.dart';
import 'package:eatvio_app/features/menu/presentation/pages/menu_screen.dart';
import 'package:eatvio_app/features/notifications/presentation/pages/notifications_screen.dart';
+import 'package:eatvio_app/features/plans/models/plan_pagination_model.dart';
+import 'package:eatvio_app/features/plans/presentation/pages/about_plan_screen.dart';
import 'package:eatvio_app/features/profile/presentation/pages/profile_screen.dart';
import 'package:eatvio_app/features/recipes/presentation/pages/about_recipes_screen.dart';
import 'package:eatvio_app/features/recipes/presentation/pages/recipe_create_screen.dart';
import 'package:eatvio_app/features/recipes/presentation/pages/recipe_edit_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/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/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart';
-import 'package:eatvio_app/presentation/glossary/glossary_screen/glossary_screen.dart';
-import 'package:eatvio_app/presentation/plans/plan_select_screen/plan_select_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/features/settings/entities/settings_entity.dart';
+import 'package:eatvio_app/features/settings/presentation/pages/change_password_screen.dart';
+import 'package:eatvio_app/features/settings/presentation/pages/general_info_screen.dart';
+import 'package:eatvio_app/features/settings/presentation/pages/other_info_screen.dart';
+import 'package:eatvio_app/features/settings/presentation/pages/physical_activity_screen.dart';
+import 'package:eatvio_app/features/settings/presentation/pages/physical_form_screen.dart';
+import 'package:eatvio_app/features/settings/presentation/pages/pressure_screen.dart';
+import 'package:eatvio_app/features/settings/presentation/pages/settings_screen.dart';
+import 'package:eatvio_app/old/auth/auth_screen/auth_screen.dart';
+import 'package:eatvio_app/old/diets/diet_create_screen/diet_create_screen.dart';
+import 'package:eatvio_app/old/diets/diet_select_screen/diet_select_screen.dart';
+import 'package:eatvio_app/old/glossary/glossary_screen/glossary_screen.dart';
+import 'package:eatvio_app/old/plans/plan_select_screen/plan_select_screen.dart';
+import 'package:eatvio_app/old/profile/my_profile_screen/my_settings_screen.dart';
+import 'package:eatvio_app/old/recipe/recipe_select_screen/recipe_select_screen.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
@@ -103,6 +112,13 @@ class AppRouter {
),
],
),
+ GoRoute(
+ path: '/about-plan-screen',
+ name: 'aboutPlanScreen',
+ builder: (context, state) => AboutPlanScreen(
+ planModel: state.extra as PlanModel,
+ ),
+ ),
GoRoute(
path: '/about-recipes-screen',
name: 'aboutRecipesScreen',
@@ -133,7 +149,7 @@ class AppRouter {
path: '/about-diet-screen',
name: 'aboutDietScreen',
builder: (context, state) => AboutDietScreen(
- datum: state.extra as Datum,
+ diet: state.extra as Diet,
),
),
GoRoute(
@@ -146,19 +162,60 @@ class AppRouter {
name: 'blogPostScreen',
builder: (context, state) => BlogPostScreen(blogPost: state.extra as FeedBlogPostModel),
),
- GoRoute(
- path: '/blog-post-edit-screen',
- name: 'blogPostEditScreen',
- builder: (context, state) => BlogPostEditScreen.builder(
- context,
- state.extra,
- ),
- ),
GoRoute(
path: '/chat-screen',
name: 'chatScreen',
builder: (context, state) => ChatScreen(chatId: state.extra as String),
),
+ GoRoute(
+ path: '/settings-screen',
+ name: 'settingsScreen',
+ builder: (context, state) => SettingsScreen(),
+ routes: [
+ GoRoute(
+ path: 'general-info-screen',
+ name: 'generalInfoScreen',
+ builder: (context, state) => GeneralInfoScreen(
+ settingsEntity: state.extra as SettingsEntity,
+ ),
+ ),
+ GoRoute(
+ path: 'other-info-screen',
+ name: 'otherInfoScreen',
+ builder: (context, state) => OtherInfoScreen(
+ settingsEntity: state.extra as SettingsEntity,
+ ),
+ ),
+ GoRoute(
+ path: 'physical-activity-screen',
+ name: 'physicalActivityScreen',
+ builder: (context, state) => PhysicalActivityScreen(
+ settingsEntity: state.extra as SettingsEntity,
+ ),
+ ),
+ GoRoute(
+ path: 'physical-form-screen',
+ name: 'physicalFormScreen',
+ builder: (context, state) => PhysicalFormScreen(
+ settingsEntity: state.extra as SettingsEntity,
+ ),
+ ),
+ GoRoute(
+ path: 'pressure-screen',
+ name: 'pressureScreen',
+ builder: (context, state) => PressureScreen(
+ settingsEntity: state.extra as SettingsEntity,
+ ),
+ ),
+ GoRoute(
+ path: 'change-password-screen',
+ name: 'changePasswordScreen',
+ builder: (context, state) => ChangePasswordScreen(
+ settingsEntity: state.extra as SettingsEntity,
+ ),
+ ),
+ ],
+ ),
GoRoute(
path: '/my-settings-screen',
name: 'mySettingsScreen',
diff --git a/lib/core/app_export.dart b/lib/core/app_export.dart
deleted file mode 100644
index 88b3fe01..00000000
--- a/lib/core/app_export.dart
+++ /dev/null
@@ -1,14 +0,0 @@
-export 'package:eatvio_app/core/constants/constants.dart';
-export 'package:eatvio_app/core/errors/exceptions.dart';
-export 'package:eatvio_app/core/utils/date_time_utils.dart';
-export 'package:eatvio_app/core/utils/image_constant.dart';
-export 'package:eatvio_app/core/utils/logger.dart';
-export 'package:eatvio_app/core/utils/size_utils.dart';
-export 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart';
-export 'package:eatvio_app/localization/app_localization.dart';
-export 'package:eatvio_app/theme/app_decoration.dart';
-export 'package:eatvio_app/theme/custom_text_style.dart';
-export 'package:eatvio_app/theme/theme_helper.dart';
-export 'package:eatvio_app/widgets/custom_image_view.dart';
-export 'package:flutter_bloc/flutter_bloc.dart';
-export '../theme/custom_button_style.dart';
diff --git a/lib/core/constants/constants.dart b/lib/core/const.dart
similarity index 100%
rename from lib/core/constants/constants.dart
rename to lib/core/const.dart
diff --git a/lib/core/errors/exceptions.dart b/lib/core/errors/exceptions.dart
deleted file mode 100644
index 7cbb3f19..00000000
--- a/lib/core/errors/exceptions.dart
+++ /dev/null
@@ -1,25 +0,0 @@
-import 'package:eatvio_app/main.dart';
-import 'package:flutter/material.dart';
-
-class ServerException implements Exception {}
-
-class CacheException implements Exception {}
-
-class NetworkException implements Exception {}
-
-///can be used for throwing [NoInternetException]
-class NoInternetException implements Exception {
- late String _message;
-
- NoInternetException([String message = 'NoInternetException Occurred']) {
- if (globalMessengerKey.currentState != null) {
- globalMessengerKey.currentState!.showSnackBar(SnackBar(content: Text(message)));
- }
- this._message = message;
- }
-
- @override
- String toString() {
- return _message;
- }
-}
diff --git a/lib/core/errors/failures.dart b/lib/core/errors/failures.dart
deleted file mode 100644
index a96b786a..00000000
--- a/lib/core/errors/failures.dart
+++ /dev/null
@@ -1,8 +0,0 @@
-abstract class Failure {}
-
-// General failures
-class ServerFailure extends Failure {}
-
-class CacheFailure extends Failure {}
-
-class NetworkFailure extends Failure {}
diff --git a/lib/core/initialization_cubit/initialization_cubit.dart b/lib/core/initialization_cubit/initialization_cubit.dart
index 518abeba..da7588cd 100644
--- a/lib/core/initialization_cubit/initialization_cubit.dart
+++ b/lib/core/initialization_cubit/initialization_cubit.dart
@@ -1,11 +1,12 @@
import 'package:dart_pusher_channels/dart_pusher_channels.dart';
-import 'package:eatvio_app/core/app_export.dart';
+import 'package:eatvio_app/core/const.dart';
import 'package:eatvio_app/core/initialization_cubit/initialization_state.dart';
import 'package:eatvio_app/core/token_storage.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/repositories/chat_repository.dart';
import 'package:eatvio_app/locator_service.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
class InitializationCubit extends Cubit {
final ChatRepository chatRepository;
diff --git a/lib/core/initialization_cubit/initialization_state.freezed.dart b/lib/core/initialization_cubit/initialization_state.freezed.dart
index 3364e440..b0535c68 100644
--- a/lib/core/initialization_cubit/initialization_state.freezed.dart
+++ b/lib/core/initialization_cubit/initialization_state.freezed.dart
@@ -84,6 +84,9 @@ class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
+
+ /// Create a copy of InitializationState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -100,6 +103,9 @@ class __$$InitializationStateImplCopyWithImpl<$Res>
__$$InitializationStateImplCopyWithImpl(_$InitializationStateImpl _value,
$Res Function(_$InitializationStateImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of InitializationState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -218,6 +224,9 @@ class __$$InitializationStateLoadingImplCopyWithImpl<$Res>
_$InitializationStateLoadingImpl _value,
$Res Function(_$InitializationStateLoadingImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of InitializationState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -339,6 +348,8 @@ class __$$InitializationStateSuccessImplCopyWithImpl<$Res>
$Res Function(_$InitializationStateSuccessImpl) _then)
: super(_value, _then);
+ /// Create a copy of InitializationState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -377,7 +388,9 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess {
@override
int get hashCode => Object.hash(runtimeType, client);
- @JsonKey(ignore: true)
+ /// Create a copy of InitializationState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl>
@@ -465,7 +478,10 @@ abstract class InitializationStateSuccess implements InitializationState {
_$InitializationStateSuccessImpl;
PusherChannelsClient get client;
- @JsonKey(ignore: true)
+
+ /// Create a copy of InitializationState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl>
get copyWith => throw _privateConstructorUsedError;
}
@@ -490,6 +506,8 @@ class __$$InitializationStateErrorImplCopyWithImpl<$Res>
$Res Function(_$InitializationStateErrorImpl) _then)
: super(_value, _then);
+ /// Create a copy of InitializationState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -529,7 +547,9 @@ class _$InitializationStateErrorImpl implements InitializationStateError {
@override
int get hashCode => Object.hash(runtimeType, errorMessage);
- @JsonKey(ignore: true)
+ /// Create a copy of InitializationState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl>
@@ -616,7 +636,10 @@ abstract class InitializationStateError implements InitializationState {
_$InitializationStateErrorImpl;
String get errorMessage;
- @JsonKey(ignore: true)
+
+ /// Create a copy of InitializationState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl>
get copyWith => throw _privateConstructorUsedError;
}
diff --git a/lib/core/models/pagination_model.dart b/lib/core/models/pagination_model.dart
new file mode 100644
index 00000000..d54863b6
--- /dev/null
+++ b/lib/core/models/pagination_model.dart
@@ -0,0 +1,43 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part 'pagination_model.freezed.dart';
+part 'pagination_model.g.dart';
+
+@freezed
+class Links with _$Links {
+ const factory Links({
+ @JsonKey(name: "first") required String first,
+ @JsonKey(name: "last") required String last,
+ @JsonKey(name: "prev") required dynamic prev,
+ @JsonKey(name: "next") required dynamic next,
+ }) = _Links;
+
+ factory Links.fromJson(Map json) => _$LinksFromJson(json);
+}
+
+@freezed
+class Meta with _$Meta {
+ const factory Meta({
+ @JsonKey(name: "current_page") required int currentPage,
+ @JsonKey(name: "from") required dynamic from,
+ @JsonKey(name: "last_page") required int lastPage,
+ @JsonKey(name: "links") required List links,
+ @JsonKey(name: "path") String? path,
+ @JsonKey(name: "per_page") required int perPage,
+ @JsonKey(name: "to") required dynamic to,
+ @JsonKey(name: "total") required int total,
+ }) = _Meta;
+
+ factory Meta.fromJson(Map json) => _$MetaFromJson(json);
+}
+
+@freezed
+class Link with _$Link {
+ const factory Link({
+ @JsonKey(name: "url") String? url,
+ @JsonKey(name: "label") String? label,
+ @JsonKey(name: "active") bool? active,
+ }) = _Link;
+
+ factory Link.fromJson(Map json) => _$LinkFromJson(json);
+}
diff --git a/lib/core/models/pagination_model.freezed.dart b/lib/core/models/pagination_model.freezed.dart
new file mode 100644
index 00000000..35f2c080
--- /dev/null
+++ b/lib/core/models/pagination_model.freezed.dart
@@ -0,0 +1,768 @@
+// coverage:ignore-file
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: type=lint
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
+
+part of 'pagination_model.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+
+final _privateConstructorUsedError = UnsupportedError(
+ 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
+
+Links _$LinksFromJson(Map json) {
+ return _Links.fromJson(json);
+}
+
+/// @nodoc
+mixin _$Links {
+ @JsonKey(name: "first")
+ String get first => throw _privateConstructorUsedError;
+ @JsonKey(name: "last")
+ String get last => throw _privateConstructorUsedError;
+ @JsonKey(name: "prev")
+ dynamic get prev => throw _privateConstructorUsedError;
+ @JsonKey(name: "next")
+ dynamic get next => throw _privateConstructorUsedError;
+
+ /// Serializes this Links to a JSON map.
+ Map toJson() => throw _privateConstructorUsedError;
+
+ /// Create a copy of Links
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ $LinksCopyWith get copyWith => throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $LinksCopyWith<$Res> {
+ factory $LinksCopyWith(Links value, $Res Function(Links) then) =
+ _$LinksCopyWithImpl<$Res, Links>;
+ @useResult
+ $Res call(
+ {@JsonKey(name: "first") String first,
+ @JsonKey(name: "last") String last,
+ @JsonKey(name: "prev") dynamic prev,
+ @JsonKey(name: "next") dynamic next});
+}
+
+/// @nodoc
+class _$LinksCopyWithImpl<$Res, $Val extends Links>
+ implements $LinksCopyWith<$Res> {
+ _$LinksCopyWithImpl(this._value, this._then);
+
+ // ignore: unused_field
+ final $Val _value;
+ // ignore: unused_field
+ final $Res Function($Val) _then;
+
+ /// Create a copy of Links
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? first = null,
+ Object? last = null,
+ Object? prev = freezed,
+ Object? next = freezed,
+ }) {
+ return _then(_value.copyWith(
+ first: null == first
+ ? _value.first
+ : first // ignore: cast_nullable_to_non_nullable
+ as String,
+ last: null == last
+ ? _value.last
+ : last // ignore: cast_nullable_to_non_nullable
+ as String,
+ prev: freezed == prev
+ ? _value.prev
+ : prev // ignore: cast_nullable_to_non_nullable
+ as dynamic,
+ next: freezed == next
+ ? _value.next
+ : next // ignore: cast_nullable_to_non_nullable
+ as dynamic,
+ ) as $Val);
+ }
+}
+
+/// @nodoc
+abstract class _$$LinksImplCopyWith<$Res> implements $LinksCopyWith<$Res> {
+ factory _$$LinksImplCopyWith(
+ _$LinksImpl value, $Res Function(_$LinksImpl) then) =
+ __$$LinksImplCopyWithImpl<$Res>;
+ @override
+ @useResult
+ $Res call(
+ {@JsonKey(name: "first") String first,
+ @JsonKey(name: "last") String last,
+ @JsonKey(name: "prev") dynamic prev,
+ @JsonKey(name: "next") dynamic next});
+}
+
+/// @nodoc
+class __$$LinksImplCopyWithImpl<$Res>
+ extends _$LinksCopyWithImpl<$Res, _$LinksImpl>
+ implements _$$LinksImplCopyWith<$Res> {
+ __$$LinksImplCopyWithImpl(
+ _$LinksImpl _value, $Res Function(_$LinksImpl) _then)
+ : super(_value, _then);
+
+ /// Create a copy of Links
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? first = null,
+ Object? last = null,
+ Object? prev = freezed,
+ Object? next = freezed,
+ }) {
+ return _then(_$LinksImpl(
+ first: null == first
+ ? _value.first
+ : first // ignore: cast_nullable_to_non_nullable
+ as String,
+ last: null == last
+ ? _value.last
+ : last // ignore: cast_nullable_to_non_nullable
+ as String,
+ prev: freezed == prev
+ ? _value.prev
+ : prev // ignore: cast_nullable_to_non_nullable
+ as dynamic,
+ next: freezed == next
+ ? _value.next
+ : next // ignore: cast_nullable_to_non_nullable
+ as dynamic,
+ ));
+ }
+}
+
+/// @nodoc
+@JsonSerializable()
+class _$LinksImpl implements _Links {
+ const _$LinksImpl(
+ {@JsonKey(name: "first") required this.first,
+ @JsonKey(name: "last") required this.last,
+ @JsonKey(name: "prev") required this.prev,
+ @JsonKey(name: "next") required this.next});
+
+ factory _$LinksImpl.fromJson(Map json) =>
+ _$$LinksImplFromJson(json);
+
+ @override
+ @JsonKey(name: "first")
+ final String first;
+ @override
+ @JsonKey(name: "last")
+ final String last;
+ @override
+ @JsonKey(name: "prev")
+ final dynamic prev;
+ @override
+ @JsonKey(name: "next")
+ final dynamic next;
+
+ @override
+ String toString() {
+ return 'Links(first: $first, last: $last, prev: $prev, next: $next)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$LinksImpl &&
+ (identical(other.first, first) || other.first == first) &&
+ (identical(other.last, last) || other.last == last) &&
+ const DeepCollectionEquality().equals(other.prev, prev) &&
+ const DeepCollectionEquality().equals(other.next, next));
+ }
+
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ int get hashCode => Object.hash(
+ runtimeType,
+ first,
+ last,
+ const DeepCollectionEquality().hash(prev),
+ const DeepCollectionEquality().hash(next));
+
+ /// Create a copy of Links
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$LinksImplCopyWith<_$LinksImpl> get copyWith =>
+ __$$LinksImplCopyWithImpl<_$LinksImpl>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$$LinksImplToJson(
+ this,
+ );
+ }
+}
+
+abstract class _Links implements Links {
+ const factory _Links(
+ {@JsonKey(name: "first") required final String first,
+ @JsonKey(name: "last") required final String last,
+ @JsonKey(name: "prev") required final dynamic prev,
+ @JsonKey(name: "next") required final dynamic next}) = _$LinksImpl;
+
+ factory _Links.fromJson(Map json) = _$LinksImpl.fromJson;
+
+ @override
+ @JsonKey(name: "first")
+ String get first;
+ @override
+ @JsonKey(name: "last")
+ String get last;
+ @override
+ @JsonKey(name: "prev")
+ dynamic get prev;
+ @override
+ @JsonKey(name: "next")
+ dynamic get next;
+
+ /// Create a copy of Links
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ _$$LinksImplCopyWith<_$LinksImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+Meta _$MetaFromJson(Map json) {
+ return _Meta.fromJson(json);
+}
+
+/// @nodoc
+mixin _$Meta {
+ @JsonKey(name: "current_page")
+ int get currentPage => throw _privateConstructorUsedError;
+ @JsonKey(name: "from")
+ dynamic get from => throw _privateConstructorUsedError;
+ @JsonKey(name: "last_page")
+ int get lastPage => throw _privateConstructorUsedError;
+ @JsonKey(name: "links")
+ List get links => throw _privateConstructorUsedError;
+ @JsonKey(name: "path")
+ String? get path => throw _privateConstructorUsedError;
+ @JsonKey(name: "per_page")
+ int get perPage => throw _privateConstructorUsedError;
+ @JsonKey(name: "to")
+ dynamic get to => throw _privateConstructorUsedError;
+ @JsonKey(name: "total")
+ int get total => throw _privateConstructorUsedError;
+
+ /// Serializes this Meta to a JSON map.
+ Map toJson() => throw _privateConstructorUsedError;
+
+ /// Create a copy of Meta
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ $MetaCopyWith get copyWith => throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $MetaCopyWith<$Res> {
+ factory $MetaCopyWith(Meta value, $Res Function(Meta) then) =
+ _$MetaCopyWithImpl<$Res, Meta>;
+ @useResult
+ $Res call(
+ {@JsonKey(name: "current_page") int currentPage,
+ @JsonKey(name: "from") dynamic from,
+ @JsonKey(name: "last_page") int lastPage,
+ @JsonKey(name: "links") List links,
+ @JsonKey(name: "path") String? path,
+ @JsonKey(name: "per_page") int perPage,
+ @JsonKey(name: "to") dynamic to,
+ @JsonKey(name: "total") int total});
+}
+
+/// @nodoc
+class _$MetaCopyWithImpl<$Res, $Val extends Meta>
+ implements $MetaCopyWith<$Res> {
+ _$MetaCopyWithImpl(this._value, this._then);
+
+ // ignore: unused_field
+ final $Val _value;
+ // ignore: unused_field
+ final $Res Function($Val) _then;
+
+ /// Create a copy of Meta
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? currentPage = null,
+ Object? from = freezed,
+ Object? lastPage = null,
+ Object? links = null,
+ Object? path = freezed,
+ Object? perPage = null,
+ Object? to = freezed,
+ Object? total = null,
+ }) {
+ return _then(_value.copyWith(
+ currentPage: null == currentPage
+ ? _value.currentPage
+ : currentPage // ignore: cast_nullable_to_non_nullable
+ as int,
+ from: freezed == from
+ ? _value.from
+ : from // ignore: cast_nullable_to_non_nullable
+ as dynamic,
+ lastPage: null == lastPage
+ ? _value.lastPage
+ : lastPage // ignore: cast_nullable_to_non_nullable
+ as int,
+ links: null == links
+ ? _value.links
+ : links // ignore: cast_nullable_to_non_nullable
+ as List,
+ path: freezed == path
+ ? _value.path
+ : path // ignore: cast_nullable_to_non_nullable
+ as String?,
+ perPage: null == perPage
+ ? _value.perPage
+ : perPage // ignore: cast_nullable_to_non_nullable
+ as int,
+ to: freezed == to
+ ? _value.to
+ : to // ignore: cast_nullable_to_non_nullable
+ as dynamic,
+ total: null == total
+ ? _value.total
+ : total // ignore: cast_nullable_to_non_nullable
+ as int,
+ ) as $Val);
+ }
+}
+
+/// @nodoc
+abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> {
+ factory _$$MetaImplCopyWith(
+ _$MetaImpl value, $Res Function(_$MetaImpl) then) =
+ __$$MetaImplCopyWithImpl<$Res>;
+ @override
+ @useResult
+ $Res call(
+ {@JsonKey(name: "current_page") int currentPage,
+ @JsonKey(name: "from") dynamic from,
+ @JsonKey(name: "last_page") int lastPage,
+ @JsonKey(name: "links") List links,
+ @JsonKey(name: "path") String? path,
+ @JsonKey(name: "per_page") int perPage,
+ @JsonKey(name: "to") dynamic to,
+ @JsonKey(name: "total") int total});
+}
+
+/// @nodoc
+class __$$MetaImplCopyWithImpl<$Res>
+ extends _$MetaCopyWithImpl<$Res, _$MetaImpl>
+ implements _$$MetaImplCopyWith<$Res> {
+ __$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then)
+ : super(_value, _then);
+
+ /// Create a copy of Meta
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? currentPage = null,
+ Object? from = freezed,
+ Object? lastPage = null,
+ Object? links = null,
+ Object? path = freezed,
+ Object? perPage = null,
+ Object? to = freezed,
+ Object? total = null,
+ }) {
+ return _then(_$MetaImpl(
+ currentPage: null == currentPage
+ ? _value.currentPage
+ : currentPage // ignore: cast_nullable_to_non_nullable
+ as int,
+ from: freezed == from
+ ? _value.from
+ : from // ignore: cast_nullable_to_non_nullable
+ as dynamic,
+ lastPage: null == lastPage
+ ? _value.lastPage
+ : lastPage // ignore: cast_nullable_to_non_nullable
+ as int,
+ links: null == links
+ ? _value._links
+ : links // ignore: cast_nullable_to_non_nullable
+ as List,
+ path: freezed == path
+ ? _value.path
+ : path // ignore: cast_nullable_to_non_nullable
+ as String?,
+ perPage: null == perPage
+ ? _value.perPage
+ : perPage // ignore: cast_nullable_to_non_nullable
+ as int,
+ to: freezed == to
+ ? _value.to
+ : to // ignore: cast_nullable_to_non_nullable
+ as dynamic,
+ total: null == total
+ ? _value.total
+ : total // ignore: cast_nullable_to_non_nullable
+ as int,
+ ));
+ }
+}
+
+/// @nodoc
+@JsonSerializable()
+class _$MetaImpl implements _Meta {
+ const _$MetaImpl(
+ {@JsonKey(name: "current_page") required this.currentPage,
+ @JsonKey(name: "from") required this.from,
+ @JsonKey(name: "last_page") required this.lastPage,
+ @JsonKey(name: "links") required final List links,
+ @JsonKey(name: "path") this.path,
+ @JsonKey(name: "per_page") required this.perPage,
+ @JsonKey(name: "to") required this.to,
+ @JsonKey(name: "total") required this.total})
+ : _links = links;
+
+ factory _$MetaImpl.fromJson(Map json) =>
+ _$$MetaImplFromJson(json);
+
+ @override
+ @JsonKey(name: "current_page")
+ final int currentPage;
+ @override
+ @JsonKey(name: "from")
+ final dynamic from;
+ @override
+ @JsonKey(name: "last_page")
+ final int lastPage;
+ final List _links;
+ @override
+ @JsonKey(name: "links")
+ List get links {
+ if (_links is EqualUnmodifiableListView) return _links;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableListView(_links);
+ }
+
+ @override
+ @JsonKey(name: "path")
+ final String? path;
+ @override
+ @JsonKey(name: "per_page")
+ final int perPage;
+ @override
+ @JsonKey(name: "to")
+ final dynamic to;
+ @override
+ @JsonKey(name: "total")
+ final int total;
+
+ @override
+ String toString() {
+ return 'Meta(currentPage: $currentPage, from: $from, lastPage: $lastPage, links: $links, path: $path, perPage: $perPage, to: $to, total: $total)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$MetaImpl &&
+ (identical(other.currentPage, currentPage) ||
+ other.currentPage == currentPage) &&
+ const DeepCollectionEquality().equals(other.from, from) &&
+ (identical(other.lastPage, lastPage) ||
+ other.lastPage == lastPage) &&
+ const DeepCollectionEquality().equals(other._links, _links) &&
+ (identical(other.path, path) || other.path == path) &&
+ (identical(other.perPage, perPage) || other.perPage == perPage) &&
+ const DeepCollectionEquality().equals(other.to, to) &&
+ (identical(other.total, total) || other.total == total));
+ }
+
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ int get hashCode => Object.hash(
+ runtimeType,
+ currentPage,
+ const DeepCollectionEquality().hash(from),
+ lastPage,
+ const DeepCollectionEquality().hash(_links),
+ path,
+ perPage,
+ const DeepCollectionEquality().hash(to),
+ total);
+
+ /// Create a copy of Meta
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$MetaImplCopyWith<_$MetaImpl> get copyWith =>
+ __$$MetaImplCopyWithImpl<_$MetaImpl>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$$MetaImplToJson(
+ this,
+ );
+ }
+}
+
+abstract class _Meta implements Meta {
+ const factory _Meta(
+ {@JsonKey(name: "current_page") required final int currentPage,
+ @JsonKey(name: "from") required final dynamic from,
+ @JsonKey(name: "last_page") required final int lastPage,
+ @JsonKey(name: "links") required final List links,
+ @JsonKey(name: "path") final String? path,
+ @JsonKey(name: "per_page") required final int perPage,
+ @JsonKey(name: "to") required final dynamic to,
+ @JsonKey(name: "total") required final int total}) = _$MetaImpl;
+
+ factory _Meta.fromJson(Map json) = _$MetaImpl.fromJson;
+
+ @override
+ @JsonKey(name: "current_page")
+ int get currentPage;
+ @override
+ @JsonKey(name: "from")
+ dynamic get from;
+ @override
+ @JsonKey(name: "last_page")
+ int get lastPage;
+ @override
+ @JsonKey(name: "links")
+ List get links;
+ @override
+ @JsonKey(name: "path")
+ String? get path;
+ @override
+ @JsonKey(name: "per_page")
+ int get perPage;
+ @override
+ @JsonKey(name: "to")
+ dynamic get to;
+ @override
+ @JsonKey(name: "total")
+ int get total;
+
+ /// Create a copy of Meta
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ _$$MetaImplCopyWith<_$MetaImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+Link _$LinkFromJson(Map json) {
+ return _Link.fromJson(json);
+}
+
+/// @nodoc
+mixin _$Link {
+ @JsonKey(name: "url")
+ String? get url => throw _privateConstructorUsedError;
+ @JsonKey(name: "label")
+ String? get label => throw _privateConstructorUsedError;
+ @JsonKey(name: "active")
+ bool? get active => throw _privateConstructorUsedError;
+
+ /// Serializes this Link to a JSON map.
+ Map toJson() => throw _privateConstructorUsedError;
+
+ /// Create a copy of Link
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ $LinkCopyWith get copyWith => throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $LinkCopyWith<$Res> {
+ factory $LinkCopyWith(Link value, $Res Function(Link) then) =
+ _$LinkCopyWithImpl<$Res, Link>;
+ @useResult
+ $Res call(
+ {@JsonKey(name: "url") String? url,
+ @JsonKey(name: "label") String? label,
+ @JsonKey(name: "active") bool? active});
+}
+
+/// @nodoc
+class _$LinkCopyWithImpl<$Res, $Val extends Link>
+ implements $LinkCopyWith<$Res> {
+ _$LinkCopyWithImpl(this._value, this._then);
+
+ // ignore: unused_field
+ final $Val _value;
+ // ignore: unused_field
+ final $Res Function($Val) _then;
+
+ /// Create a copy of Link
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? url = freezed,
+ Object? label = freezed,
+ Object? active = freezed,
+ }) {
+ return _then(_value.copyWith(
+ url: freezed == url
+ ? _value.url
+ : url // ignore: cast_nullable_to_non_nullable
+ as String?,
+ label: freezed == label
+ ? _value.label
+ : label // ignore: cast_nullable_to_non_nullable
+ as String?,
+ active: freezed == active
+ ? _value.active
+ : active // ignore: cast_nullable_to_non_nullable
+ as bool?,
+ ) as $Val);
+ }
+}
+
+/// @nodoc
+abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$Res> {
+ factory _$$LinkImplCopyWith(
+ _$LinkImpl value, $Res Function(_$LinkImpl) then) =
+ __$$LinkImplCopyWithImpl<$Res>;
+ @override
+ @useResult
+ $Res call(
+ {@JsonKey(name: "url") String? url,
+ @JsonKey(name: "label") String? label,
+ @JsonKey(name: "active") bool? active});
+}
+
+/// @nodoc
+class __$$LinkImplCopyWithImpl<$Res>
+ extends _$LinkCopyWithImpl<$Res, _$LinkImpl>
+ implements _$$LinkImplCopyWith<$Res> {
+ __$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then)
+ : super(_value, _then);
+
+ /// Create a copy of Link
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? url = freezed,
+ Object? label = freezed,
+ Object? active = freezed,
+ }) {
+ return _then(_$LinkImpl(
+ url: freezed == url
+ ? _value.url
+ : url // ignore: cast_nullable_to_non_nullable
+ as String?,
+ label: freezed == label
+ ? _value.label
+ : label // ignore: cast_nullable_to_non_nullable
+ as String?,
+ active: freezed == active
+ ? _value.active
+ : active // ignore: cast_nullable_to_non_nullable
+ as bool?,
+ ));
+ }
+}
+
+/// @nodoc
+@JsonSerializable()
+class _$LinkImpl implements _Link {
+ const _$LinkImpl(
+ {@JsonKey(name: "url") this.url,
+ @JsonKey(name: "label") this.label,
+ @JsonKey(name: "active") this.active});
+
+ factory _$LinkImpl.fromJson(Map json) =>
+ _$$LinkImplFromJson(json);
+
+ @override
+ @JsonKey(name: "url")
+ final String? url;
+ @override
+ @JsonKey(name: "label")
+ final String? label;
+ @override
+ @JsonKey(name: "active")
+ final bool? active;
+
+ @override
+ String toString() {
+ return 'Link(url: $url, label: $label, active: $active)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$LinkImpl &&
+ (identical(other.url, url) || other.url == url) &&
+ (identical(other.label, label) || other.label == label) &&
+ (identical(other.active, active) || other.active == active));
+ }
+
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ int get hashCode => Object.hash(runtimeType, url, label, active);
+
+ /// Create a copy of Link
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$LinkImplCopyWith<_$LinkImpl> get copyWith =>
+ __$$LinkImplCopyWithImpl<_$LinkImpl>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$$LinkImplToJson(
+ this,
+ );
+ }
+}
+
+abstract class _Link implements Link {
+ const factory _Link(
+ {@JsonKey(name: "url") final String? url,
+ @JsonKey(name: "label") final String? label,
+ @JsonKey(name: "active") final bool? active}) = _$LinkImpl;
+
+ factory _Link.fromJson(Map json) = _$LinkImpl.fromJson;
+
+ @override
+ @JsonKey(name: "url")
+ String? get url;
+ @override
+ @JsonKey(name: "label")
+ String? get label;
+ @override
+ @JsonKey(name: "active")
+ bool? get active;
+
+ /// Create a copy of Link
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ _$$LinkImplCopyWith<_$LinkImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
diff --git a/lib/core/models/pagination_model.g.dart b/lib/core/models/pagination_model.g.dart
new file mode 100644
index 00000000..610d19b2
--- /dev/null
+++ b/lib/core/models/pagination_model.g.dart
@@ -0,0 +1,60 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'pagination_model.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+_$LinksImpl _$$LinksImplFromJson(Map json) => _$LinksImpl(
+ first: json['first'] as String,
+ last: json['last'] as String,
+ prev: json['prev'],
+ next: json['next'],
+ );
+
+Map _$$LinksImplToJson(_$LinksImpl instance) =>
+ {
+ 'first': instance.first,
+ 'last': instance.last,
+ 'prev': instance.prev,
+ 'next': instance.next,
+ };
+
+_$MetaImpl _$$MetaImplFromJson(Map json) => _$MetaImpl(
+ currentPage: (json['current_page'] as num).toInt(),
+ from: json['from'],
+ lastPage: (json['last_page'] as num).toInt(),
+ links: (json['links'] as List)
+ .map((e) => Link.fromJson(e as Map))
+ .toList(),
+ path: json['path'] as String?,
+ perPage: (json['per_page'] as num).toInt(),
+ to: json['to'],
+ total: (json['total'] as num).toInt(),
+ );
+
+Map _$$MetaImplToJson(_$MetaImpl instance) =>
+ {
+ 'current_page': instance.currentPage,
+ 'from': instance.from,
+ 'last_page': instance.lastPage,
+ 'links': instance.links,
+ 'path': instance.path,
+ 'per_page': instance.perPage,
+ 'to': instance.to,
+ 'total': instance.total,
+ };
+
+_$LinkImpl _$$LinkImplFromJson(Map json) => _$LinkImpl(
+ url: json['url'] as String?,
+ label: json['label'] as String?,
+ active: json['active'] as bool?,
+ );
+
+Map _$$LinkImplToJson(_$LinkImpl instance) =>
+ {
+ 'url': instance.url,
+ 'label': instance.label,
+ 'active': instance.active,
+ };
diff --git a/lib/core/utils/date_time_utils.dart b/lib/core/utils/date_time_utils.dart
index efa7b572..574799cd 100644
--- a/lib/core/utils/date_time_utils.dart
+++ b/lib/core/utils/date_time_utils.dart
@@ -4,7 +4,6 @@ import 'package:intl/intl.dart';
const String dateTimeFormatPattern = 'dd/MM/yyyy';
extension DateTimeExtension on DateTime {
- /// Return a string representing [date] formatted according to our locale
String format([
String pattern = dateTimeFormatPattern,
String? locale,
diff --git a/lib/core/utils/logger.dart b/lib/core/utils/logger.dart
deleted file mode 100644
index dab50c2a..00000000
--- a/lib/core/utils/logger.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-class Logger {
- static LogMode _logMode = LogMode.debug;
-
- static void init(LogMode mode) {
- Logger._logMode = mode;
- }
-
- static void log(dynamic data, {StackTrace? stackTrace}) {
- if (_logMode == LogMode.debug) {
- print("Error: $data$stackTrace");
- }
- }
-}
-
-enum LogMode { debug, live }
diff --git a/lib/core/utils/progress_dialog_utils.dart b/lib/core/utils/progress_dialog_utils.dart
deleted file mode 100644
index ced3347c..00000000
--- a/lib/core/utils/progress_dialog_utils.dart
+++ /dev/null
@@ -1,33 +0,0 @@
-import 'package:eatvio_app/app_router.dart';
-import 'package:flutter/material.dart';
-
-class ProgressDialogUtils {
- static bool isProgressVisible = false;
-
- ///common method for showing progress dialog
- static void showProgressDialog({BuildContext? context, isCancellable = false}) async {
- if (!isProgressVisible && AppRouter.navigatorKey.currentState?.overlay?.context != null) {
- showDialog(
- barrierDismissible: isCancellable,
- context: AppRouter.navigatorKey.currentState!.overlay!.context,
- builder: (BuildContext context) {
- return Center(
- child: CircularProgressIndicator.adaptive(
- strokeWidth: 4,
- valueColor: AlwaysStoppedAnimation(
- Colors.white,
- ),
- ),
- );
- },
- );
- isProgressVisible = true;
- }
- }
-
- ///common method for hiding progress dialog
- static void hideProgressDialog() {
- if (isProgressVisible) Navigator.pop(AppRouter.navigatorKey.currentState!.overlay!.context);
- isProgressVisible = false;
- }
-}
diff --git a/lib/core/utils/size_utils.dart b/lib/core/utils/size_utils.dart
deleted file mode 100644
index 04f09c8a..00000000
--- a/lib/core/utils/size_utils.dart
+++ /dev/null
@@ -1,52 +0,0 @@
-import 'package:flutter/material.dart';
-
-// This functions are responsible to make UI responsive across all the mobile devices.
-
-MediaQueryData mediaQueryData = MediaQueryData.fromView(
- WidgetsBinding.instance.platformDispatcher.views.single,
-);
-
-// These are the Viewport values of your Figma Design.
-// These are used in the code as a reference to create your UI Responsively.
-const num FIGMA_DESIGN_WIDTH = 375;
-const num FIGMA_DESIGN_HEIGHT = 812;
-const num FIGMA_DESIGN_STATUS_BAR = 0;
-
-///This extension is used to set padding/margin (for the top and bottom side) & height of the screen or widget according to the Viewport height.
-extension ResponsiveExtension on num {
- ///This method is used to get device viewport width.
- get _width {
- return mediaQueryData.size.width;
- }
-
- ///This method is used to get device viewport height.
- get _height {
- num statusBar = mediaQueryData.viewPadding.top;
- num bottomBar = mediaQueryData.viewPadding.bottom;
- num screenHeight = mediaQueryData.size.height - statusBar - bottomBar;
- return screenHeight;
- }
-
- ///This method is used to set padding/margin (for the left and Right side) & width of the screen or widget according to the Viewport width.
- double get h => ((this * _width) / FIGMA_DESIGN_WIDTH);
-
- ///This method is used to set padding/margin (for the top and bottom side) & height of the screen or widget according to the Viewport height.
- double get v => (this * _height) / (FIGMA_DESIGN_HEIGHT - FIGMA_DESIGN_STATUS_BAR);
-
- ///This method is used to set smallest px in image height and width
- double get adaptSize {
- var height = v;
- var width = h;
- return height < width ? height.toDoubleValue() : width.toDoubleValue();
- }
-
- ///This method is used to set text font size according to Viewport
- double get fSize => adaptSize;
-}
-
-extension FormatExtension on double {
- /// Return a [double] value with formatted according to provided fractionDigits
- double toDoubleValue({int fractionDigits = 2}) {
- return double.parse(this.toStringAsFixed(fractionDigits));
- }
-}
diff --git a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart
index 917785c7..97ab368c 100644
--- a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart
+++ b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart
@@ -21,7 +21,9 @@ mixin _$SelectionPopupModel {
dynamic get value => throw _privateConstructorUsedError;
bool get isSelected => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+ /// Create a copy of SelectionPopupModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$SelectionPopupModelCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -45,6 +47,8 @@ class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of SelectionPopupModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -93,6 +97,8 @@ class __$$SelectionPopupModelImplCopyWithImpl<$Res>
$Res Function(_$SelectionPopupModelImpl) _then)
: super(_value, _then);
+ /// Create a copy of SelectionPopupModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -159,7 +165,9 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel {
int get hashCode => Object.hash(runtimeType, id, title,
const DeepCollectionEquality().hash(value), isSelected);
- @JsonKey(ignore: true)
+ /// Create a copy of SelectionPopupModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith =>
@@ -182,8 +190,11 @@ abstract class _SelectionPopupModel implements SelectionPopupModel {
dynamic get value;
@override
bool get isSelected;
+
+ /// Create a copy of SelectionPopupModel
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/blog_post/presentation/pages/blog_post_screen.dart b/lib/features/blog_post/presentation/pages/blog_post_screen.dart
index 27d8901a..7c27ab09 100644
--- a/lib/features/blog_post/presentation/pages/blog_post_screen.dart
+++ b/lib/features/blog_post/presentation/pages/blog_post_screen.dart
@@ -1,16 +1,19 @@
import 'dart:io';
-
import 'package:cached_network_image/cached_network_image.dart';
-import 'package:eatvio_app/core/app_export.dart';
-import 'package:eatvio_app/features/feed/models/comment_model.dart';
+import 'package:eatvio_app/core/const.dart';
+import 'package:eatvio_app/core/utils/date_time_utils.dart';
import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart';
import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart';
import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_state.dart';
import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart';
+import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart';
import 'package:eatvio_app/locator_service.dart';
-import 'package:flutter/cupertino.dart';
+import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:flutter_html/flutter_html.dart';
import 'package:go_router/go_router.dart';
+import 'package:rive/rive.dart';
import 'package:share_plus/share_plus.dart';
class BlogPostScreen extends StatefulWidget {
@@ -31,7 +34,6 @@ class _BlogPostScreenState extends State {
@override
void initState() {
- commentsCubit.getBlogPostComments(widget.blogPost.id);
isLiked = widget.blogPost.wasLikedByMe;
totalLikes = widget.blogPost.totalLikes;
super.initState();
@@ -40,8 +42,20 @@ class _BlogPostScreenState extends State {
@override
Widget build(BuildContext context) {
return BlocProvider(
- create: (BuildContext context) => commentsCubit,
- child: BlocBuilder(
+ create: (BuildContext context) => commentsCubit
+ ..getComments(
+ widget.blogPost.id.toString(),
+ CommentSourceType.blogPost,
+ true,
+ ),
+ child: BlocConsumer(
+ listener: (BuildContext context, CommentsState state) {
+ if (state is CommentsStateLoaded) {
+ setState(() {
+ replyId = state.replyId;
+ });
+ }
+ },
builder: (BuildContext context, CommentsState state) {
return Scaffold(
resizeToAvoidBottomInset: true,
@@ -61,6 +75,7 @@ class _BlogPostScreenState extends State {
if (replyId != null)
GestureDetector(
onTap: () {
+ context.read().setReplyId(null);
setState(() {
replyId = null;
textEditingController.clear();
@@ -83,7 +98,7 @@ class _BlogPostScreenState extends State {
),
if (replyId != null) SizedBox(width: 8),
SizedBox(
- width: mediaQueryData.size.width - (replyId == null ? 64 : 104),
+ width: MediaQuery.of(context).size.width - (replyId == null ? 64 : 104),
child: TextFormField(
onChanged: (_) {
setState(() {});
@@ -137,11 +152,13 @@ class _BlogPostScreenState extends State {
GestureDetector(
onTap: () {
if (textEditingController.text.length > 2) {
- commentsCubit.sendBlogPostComment(
- id: widget.blogPost.id,
+ commentsCubit.sendComment(
+ id: widget.blogPost.id.toString(),
commentText: textEditingController.text,
parentCommentId: replyId,
+ commentSourceType: CommentSourceType.blogPost,
);
+ context.read().setReplyId(null);
setState(() {
textEditingController.clear();
replyId = null;
@@ -215,22 +232,18 @@ class _BlogPostScreenState extends State {
),
),
),
- if (widget.blogPost.description.isNotEmpty) SizedBox(height: 12),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Align(
- alignment: Alignment.centerLeft,
- child: Text(
- widget.blogPost.description,
- style: TextStyle(
- color: Colors.black,
- fontSize: 14,
- fontWeight: FontWeight.w400,
- height: 1,
- ),
+ if (widget.blogPost.description.isNotEmpty)
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 8),
+ child: Html(
+ data: widget.blogPost.description,
+ style: {
+ "*": Style(
+ color: Colors.black87,
+ ),
+ },
),
),
- ),
SizedBox(height: 8),
CachedNetworkImage(
imageUrl: baseUrl + '/storage/' + (widget.blogPost.image),
@@ -308,9 +321,21 @@ class _BlogPostScreenState extends State {
if (state is CommentsStateLoading)
Padding(
padding: const EdgeInsets.all(32),
- child: CupertinoActivityIndicator(),
+ child: SizedBox(
+ height: 32,
+ width: 32,
+ child: RiveAnimation.asset(
+ 'assets/rive_animations/loading.riv',
+ ),
+ ),
+ ),
+ if (state is CommentsStateLoaded)
+ CommentsWidget(
+ id: widget.blogPost.id.toString(),
+ commentSourceType: CommentSourceType.blogPost,
+ comment: state.comment,
+ replyId: replyId,
),
- if (state is CommentsStateLoaded) _buildComments(state.comment),
],
),
),
@@ -320,102 +345,6 @@ class _BlogPostScreenState extends State {
);
}
- _buildComments(Comment comment) {
- return Column(
- children: [
- for (int i = 0; i < comment.data.length; i++) ...[
- _comment(comment.data[i]),
- if (comment.data[i].childrenComments.isNotEmpty)
- for (int j = 0; j < comment.data[i].childrenComments.length; j++)
- Padding(
- padding: EdgeInsets.only(left: 40),
- child: _comment(
- comment.data[i].childrenComments[j],
- 12,
- ),
- ),
- SizedBox(height: 8),
- ],
- ],
- );
- }
-
- _comment(Datum datum, [double radius = 16]) {
- return Container(
- width: MediaQuery.of(context).size.width,
- decoration: BoxDecoration(
- color: replyId == datum.id ? appTheme.blueA400.withOpacity(0.1) : Colors.white,
- borderRadius: BorderRadius.circular(16),
- ),
- child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- CircleAvatar(
- foregroundImage: NetworkImage(datum.authorProfileIcon),
- radius: radius,
- ),
- SizedBox(width: 8),
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.start,
- children: [
- Text(
- datum.authorName,
- style: TextStyle(
- height: 1,
- color: Colors.grey.shade600,
- fontWeight: FontWeight.w500,
- ),
- ),
- SizedBox(width: 4),
- Text(
- datum.body,
- style: TextStyle(
- height: 1,
- color: Colors.black,
- ),
- ),
- SizedBox(height: 4),
- Row(
- children: [
- Text(
- widget.blogPost.createdAt.format('dd MMMM', 'ru'),
- style: TextStyle(
- color: Colors.grey.shade600,
- fontSize: 12,
- fontWeight: FontWeight.w400,
- height: 1,
- ),
- ),
- SizedBox(width: 16),
- GestureDetector(
- onTap: () {
- setState(() {
- replyId = datum.id;
- });
- },
- child: Text(
- 'Ответить',
- style: TextStyle(
- height: 1,
- fontSize: 12,
- color: Colors.grey.shade800,
- fontWeight: FontWeight.w500,
- ),
- ),
- ),
- ],
- ),
- ],
- ),
- ],
- ),
- ),
- );
- }
-
_iconButton({required IconData icon, String? text, Function()? onTap, Color? iconColor, Color? backgroundColor, Color? textColor}) {
return InkWell(
onTap: onTap ?? () {},
diff --git a/lib/features/blog_post_create/presentation/pages/blog_post_create_screen.dart b/lib/features/blog_post_create/presentation/pages/blog_post_create_screen.dart
index d8fc116e..baf87e0f 100644
--- a/lib/features/blog_post_create/presentation/pages/blog_post_create_screen.dart
+++ b/lib/features/blog_post_create/presentation/pages/blog_post_create_screen.dart
@@ -1,15 +1,15 @@
import 'dart:async';
import 'dart:io';
-
-import 'package:eatvio_app/core/app_export.dart';
+import 'package:eatvio_app/old/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart';
+import 'package:eatvio_app/old/feed/blog_post_create_screen/models/blog_post_create_model.dart';
+import 'package:eatvio_app/theme/app_decoration.dart';
+import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:eatvio_app/widgets/custom_text_form_field.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:image_picker/image_picker.dart';
-import '../../../../presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart';
-import '../../../../presentation/feed/blog_post_create_screen/models/blog_post_create_model.dart';
-
class BlogPostCreateScreen extends StatefulWidget {
const BlogPostCreateScreen({Key? key}) : super(key: key);
@@ -122,9 +122,10 @@ class _BlogPostCreateScreenState extends State {
SizedBox(height: 16),
if (state.image == null) Text('Ссылка на видео'),
if (state.image == null) SizedBox(height: 8),
- if (state.image == null) CustomTextFormField(
- controller: state.youtubeURL,
- ),
+ if (state.image == null)
+ CustomTextFormField(
+ controller: state.youtubeURL,
+ ),
SizedBox(height: 80),
],
),
diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_cubit.dart b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_cubit.dart
index 8b2a0f5a..6f31b94b 100644
--- a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_cubit.dart
+++ b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_cubit.dart
@@ -1,5 +1,5 @@
-import 'package:eatvio_app/core/app_export.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
class NewMessagesCubit extends Cubit {
int _messagesCount = 0;
diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart
index 02a1c4bd..7c5d7ffd 100644
--- a/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart
+++ b/lib/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_state.freezed.dart
@@ -84,6 +84,9 @@ class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
+
+ /// Create a copy of NewMessagesState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -100,6 +103,9 @@ class __$$NewMessagesStateImplCopyWithImpl<$Res>
__$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value,
$Res Function(_$NewMessagesStateImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of NewMessagesState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -215,6 +221,9 @@ class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res>
__$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value,
$Res Function(_$NewMessagesStateEmptyImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of NewMessagesState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -335,6 +344,8 @@ class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res>
$Res Function(_$NewMessagesStateLoadedImpl) _then)
: super(_value, _then);
+ /// Create a copy of NewMessagesState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -374,7 +385,9 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded {
@override
int get hashCode => Object.hash(runtimeType, messagesCount);
- @JsonKey(ignore: true)
+ /// Create a copy of NewMessagesState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl>
@@ -461,7 +474,10 @@ abstract class NewMessagesStateLoaded implements NewMessagesState {
_$NewMessagesStateLoadedImpl;
int get messagesCount;
- @JsonKey(ignore: true)
+
+ /// Create a copy of NewMessagesState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl>
get copyWith => throw _privateConstructorUsedError;
}
@@ -484,6 +500,8 @@ class __$$NewMessagesStateErrorImplCopyWithImpl<$Res>
$Res Function(_$NewMessagesStateErrorImpl) _then)
: super(_value, _then);
+ /// Create a copy of NewMessagesState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -523,7 +541,9 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError {
@override
int get hashCode => Object.hash(runtimeType, errorMessage);
- @JsonKey(ignore: true)
+ /// Create a copy of NewMessagesState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl>
@@ -610,7 +630,10 @@ abstract class NewMessagesStateError implements NewMessagesState {
_$NewMessagesStateErrorImpl;
String get errorMessage;
- @JsonKey(ignore: true)
+
+ /// Create a copy of NewMessagesState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl>
get copyWith => throw _privateConstructorUsedError;
}
diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart
index 8a22b6d5..d862efa7 100644
--- a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart
+++ b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart
@@ -1,5 +1,5 @@
-import 'package:eatvio_app/core/app_export.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
class NotificationsCubit extends Cubit {
int _notificationsCount = 0;
diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart
index 4ba18f06..d634b318 100644
--- a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart
+++ b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.freezed.dart
@@ -88,6 +88,9 @@ class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
+
+ /// Create a copy of NotificationsState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -104,6 +107,9 @@ class __$$NotificationsStateImplCopyWithImpl<$Res>
__$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value,
$Res Function(_$NotificationsStateImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of NotificationsState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -225,6 +231,9 @@ class __$$NotificationsStateEmptyImplCopyWithImpl<$Res>
_$NotificationsStateEmptyImpl _value,
$Res Function(_$NotificationsStateEmptyImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of NotificationsState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -350,6 +359,8 @@ class __$$NotificationsStateLoadedImplCopyWithImpl<$Res>
$Res Function(_$NotificationsStateLoadedImpl) _then)
: super(_value, _then);
+ /// Create a copy of NotificationsState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -408,7 +419,9 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded {
int get hashCode => Object.hash(runtimeType,
const DeepCollectionEquality().hash(_notifications), notificationsCount);
- @JsonKey(ignore: true)
+ /// Create a copy of NotificationsState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl>
@@ -501,7 +514,10 @@ abstract class NotificationsStateLoaded implements NotificationsState {
List get notifications;
int get notificationsCount;
- @JsonKey(ignore: true)
+
+ /// Create a copy of NotificationsState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl>
get copyWith => throw _privateConstructorUsedError;
}
@@ -526,6 +542,8 @@ class __$$NotificationsStateErrorImplCopyWithImpl<$Res>
$Res Function(_$NotificationsStateErrorImpl) _then)
: super(_value, _then);
+ /// Create a copy of NotificationsState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -565,7 +583,9 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError {
@override
int get hashCode => Object.hash(runtimeType, errorMessage);
- @JsonKey(ignore: true)
+ /// Create a copy of NotificationsState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl>
@@ -656,7 +676,10 @@ abstract class NotificationsStateError implements NotificationsState {
_$NotificationsStateErrorImpl;
String get errorMessage;
- @JsonKey(ignore: true)
+
+ /// Create a copy of NotificationsState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl>
get copyWith => throw _privateConstructorUsedError;
}
diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart
index e2bfd48b..c6d83825 100644
--- a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart
+++ b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart
@@ -19,4 +19,4 @@ class ProfileAvatarCubit extends Cubit {
print(e);
}
}
-}
\ No newline at end of file
+}
diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart
index 5d8de7ff..b629d579 100644
--- a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart
+++ b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart
@@ -84,6 +84,9 @@ class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
+
+ /// Create a copy of ProfileAvatarState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -100,6 +103,9 @@ class __$$ProfileAvatarStateImplCopyWithImpl<$Res>
__$$ProfileAvatarStateImplCopyWithImpl(_$ProfileAvatarStateImpl _value,
$Res Function(_$ProfileAvatarStateImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of ProfileAvatarState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -217,6 +223,9 @@ class __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res>
_$ProfileAvatarStateLoadingImpl _value,
$Res Function(_$ProfileAvatarStateLoadingImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of ProfileAvatarState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -340,6 +349,8 @@ class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res>
$Res Function(_$ProfileAvatarStateLoadedImpl) _then)
: super(_value, _then);
+ /// Create a copy of ProfileAvatarState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -353,6 +364,8 @@ class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res>
));
}
+ /// Create a copy of ProfileAvatarState
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ProfileModelCopyWith<$Res> get profile {
@@ -386,7 +399,9 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded {
@override
int get hashCode => Object.hash(runtimeType, profile);
- @JsonKey(ignore: true)
+ /// Create a copy of ProfileAvatarState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl>
@@ -473,7 +488,10 @@ abstract class ProfileAvatarStateLoaded implements ProfileAvatarState {
{required final ProfileModel profile}) = _$ProfileAvatarStateLoadedImpl;
ProfileModel get profile;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ProfileAvatarState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl>
get copyWith => throw _privateConstructorUsedError;
}
@@ -498,6 +516,8 @@ class __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res>
$Res Function(_$ProfileAvatarStateErrorImpl) _then)
: super(_value, _then);
+ /// Create a copy of ProfileAvatarState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -537,7 +557,9 @@ class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError {
@override
int get hashCode => Object.hash(runtimeType, errorMessage);
- @JsonKey(ignore: true)
+ /// Create a copy of ProfileAvatarState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl>
@@ -624,7 +646,10 @@ abstract class ProfileAvatarStateError implements ProfileAvatarState {
_$ProfileAvatarStateErrorImpl;
String get errorMessage;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ProfileAvatarState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl>
get copyWith => throw _privateConstructorUsedError;
}
diff --git a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart
index 356d3cc7..ce8a8bca 100644
--- a/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart
+++ b/lib/features/bottom_navigation_bar/presentation/widgets/bottom_navigation_bar_widget.dart
@@ -1,12 +1,16 @@
import 'package:badges/badges.dart' as badges;
-import 'package:eatvio_app/core/app_export.dart';
+import 'package:eatvio_app/core/utils/image_constant.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/new_messages_cubit/new_messages_state.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_cubit.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart';
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart';
+import 'package:eatvio_app/generated/l10n.dart';
+import 'package:eatvio_app/locator_service.dart';
+import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
@@ -55,6 +59,7 @@ class _BottomNavigationBarWidgetState extends State {
@override
Widget build(BuildContext context) {
+ final s = S.of(context);
return Scaffold(
body: widget.child,
bottomNavigationBar: SizedBox(
@@ -69,9 +74,22 @@ class _BottomNavigationBarWidgetState extends State {
items: [
BottomNavigationBarItem(
label: '',
- icon: SvgPicture.asset(
- ImageConstant.imgLogo,
- height: 32,
+ icon: BlocProvider(
+ create: (context) => sl()..getMyProfile(),
+ child: BlocBuilder(
+ builder: (BuildContext context, ProfileAvatarState state) {
+ if (state is ProfileAvatarStateLoaded) {
+ return CircleAvatar(
+ backgroundImage: NetworkImage(state.profile.profilePhotoUrl),
+ radius: 16,
+ );
+ }
+ return CircleAvatar(
+ radius: 16,
+ backgroundColor: Colors.black12,
+ );
+ },
+ ),
),
),
BottomNavigationBarItem(
@@ -99,7 +117,7 @@ class _BottomNavigationBarWidgetState extends State {
),
),
BottomNavigationBarItem(
- label: "diary".tr,
+ label: s.diary,
icon: Padding(
padding: const EdgeInsets.only(bottom: 2),
child: SvgPicture.asset(
@@ -123,7 +141,7 @@ class _BottomNavigationBarWidgetState extends State {
),
),
BottomNavigationBarItem(
- label: "chat".tr,
+ label: s.chat,
icon: BlocBuilder(
builder: (BuildContext context, NewMessagesState state) {
return badges.Badge(
@@ -188,19 +206,9 @@ class _BottomNavigationBarWidgetState extends State {
),
BottomNavigationBarItem(
label: '',
- icon: BlocBuilder(
- builder: (BuildContext context, ProfileAvatarState state) {
- if (state is ProfileAvatarStateLoaded && state.profile.user.profilePhotoUrl.isNotEmpty) {
- return CircleAvatar(
- backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl),
- radius: 16,
- );
- }
- return CircleAvatar(
- radius: 16,
- backgroundColor: Colors.black12,
- );
- },
+ icon: SvgPicture.asset(
+ ImageConstant.imgLogo,
+ height: 32,
),
),
],
diff --git a/lib/features/calendar/models/calendar_entry_model.dart b/lib/features/calendar/models/calendar_entry_model.dart
index 0973f979..32a6d1bd 100644
--- a/lib/features/calendar/models/calendar_entry_model.dart
+++ b/lib/features/calendar/models/calendar_entry_model.dart
@@ -16,7 +16,6 @@ class CalendarEntryModel {
date = date;
status = status;
id = id;
- is_current_day_included_in_the_chosen_diet_progression =
- is_current_day_included_in_the_chosen_diet_progression;
+ is_current_day_included_in_the_chosen_diet_progression = is_current_day_included_in_the_chosen_diet_progression;
}
}
diff --git a/lib/features/calendar/models/calendar_model.dart b/lib/features/calendar/models/calendar_model.dart
index 4d74a87a..29e822e2 100644
--- a/lib/features/calendar/models/calendar_model.dart
+++ b/lib/features/calendar/models/calendar_model.dart
@@ -1,6 +1,7 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'calendar_model.freezed.dart';
+
part 'calendar_model.g.dart';
@freezed
diff --git a/lib/features/calendar/models/calendar_model.freezed.dart b/lib/features/calendar/models/calendar_model.freezed.dart
index 5e47f848..d10fc8f2 100644
--- a/lib/features/calendar/models/calendar_model.freezed.dart
+++ b/lib/features/calendar/models/calendar_model.freezed.dart
@@ -25,8 +25,12 @@ mixin _$CalendarModel {
throw _privateConstructorUsedError;
Object? get diary => throw _privateConstructorUsedError;
+ /// Serializes this CalendarModel to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of CalendarModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$CalendarModelCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -53,6 +57,8 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of CalendarModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -97,6 +103,8 @@ class __$$CalendarModelImplCopyWithImpl<$Res>
_$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then)
: super(_value, _then);
+ /// Create a copy of CalendarModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -157,7 +165,7 @@ class _$CalendarModelImpl implements _CalendarModel {
const DeepCollectionEquality().equals(other.diary, diary));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
@@ -165,7 +173,9 @@ class _$CalendarModelImpl implements _CalendarModel {
is_current_day_included_in_the_chosen_diet_progression,
const DeepCollectionEquality().hash(diary));
- @JsonKey(ignore: true)
+ /// Create a copy of CalendarModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith =>
@@ -195,8 +205,11 @@ abstract class _CalendarModel implements CalendarModel {
bool get is_current_day_included_in_the_chosen_diet_progression;
@override
Object? get diary;
+
+ /// Create a copy of CalendarModel
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/calendar/presentation/bloc/calendar_cubit.dart b/lib/features/calendar/presentation/bloc/calendar_cubit.dart
index cfbc5b07..01a16da9 100644
--- a/lib/features/calendar/presentation/bloc/calendar_cubit.dart
+++ b/lib/features/calendar/presentation/bloc/calendar_cubit.dart
@@ -1,6 +1,6 @@
-import 'package:eatvio_app/core/app_export.dart';
import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_state.dart';
import 'package:eatvio_app/features/calendar/repositories/calendar_repository.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
class CalendarCubit extends Cubit {
final CalendarRepository calendarRepository;
diff --git a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart
index c71d5226..0e7bdbcd 100644
--- a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart
+++ b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart
@@ -84,6 +84,9 @@ class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
+
+ /// Create a copy of CalendarState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -100,6 +103,9 @@ class __$$CalendarStateImplCopyWithImpl<$Res>
__$$CalendarStateImplCopyWithImpl(
_$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of CalendarState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -214,6 +220,9 @@ class __$$CalendarStateLoadingImplCopyWithImpl<$Res>
__$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value,
$Res Function(_$CalendarStateLoadingImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of CalendarState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -332,6 +341,8 @@ class __$$CalendarStateLoadedImplCopyWithImpl<$Res>
$Res Function(_$CalendarStateLoadedImpl) _then)
: super(_value, _then);
+ /// Create a copy of CalendarState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -379,7 +390,9 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded {
int get hashCode => Object.hash(
runtimeType, const DeepCollectionEquality().hash(_calendarList));
- @JsonKey(ignore: true)
+ /// Create a copy of CalendarState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith =>
@@ -467,7 +480,10 @@ abstract class CalendarStateLoaded implements CalendarState {
_$CalendarStateLoadedImpl;
List get calendarList;
- @JsonKey(ignore: true)
+
+ /// Create a copy of CalendarState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -489,6 +505,8 @@ class __$$CalendarStateErrorImplCopyWithImpl<$Res>
$Res Function(_$CalendarStateErrorImpl) _then)
: super(_value, _then);
+ /// Create a copy of CalendarState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -528,7 +546,9 @@ class _$CalendarStateErrorImpl implements CalendarStateError {
@override
int get hashCode => Object.hash(runtimeType, errorMessage);
- @JsonKey(ignore: true)
+ /// Create a copy of CalendarState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith =>
@@ -615,7 +635,10 @@ abstract class CalendarStateError implements CalendarState {
_$CalendarStateErrorImpl;
String get errorMessage;
- @JsonKey(ignore: true)
+
+ /// Create a copy of CalendarState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/calendar/presentation/pages/calendar_screen.dart b/lib/features/calendar/presentation/pages/calendar_screen.dart
index bcd365c2..be3f22ed 100644
--- a/lib/features/calendar/presentation/pages/calendar_screen.dart
+++ b/lib/features/calendar/presentation/pages/calendar_screen.dart
@@ -1,47 +1,58 @@
-// ignore_for_file: unused_local_variable
-
import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_cubit.dart';
import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_state.dart';
-import 'package:eatvio_app/core/app_export.dart';
+import 'package:eatvio_app/locator_service.dart';
+import 'package:eatvio_app/theme/app_decoration.dart';
+import 'package:eatvio_app/theme/custom_text_style.dart';
+import 'package:eatvio_app/theme/theme_helper.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:go_router/go_router.dart';
import 'package:intl/intl.dart';
-import 'package:flutter/material.dart';
-import 'package:flutter/cupertino.dart';
-import 'package:flutter_form_builder/flutter_form_builder.dart';
+import 'package:rive/rive.dart';
-// ignore: must_be_immutable
class CalendarScreen extends StatelessWidget {
CalendarScreen({Key? key}) : super(key: key);
+
Widget build(BuildContext context) {
- return BlocBuilder(
- builder: (context, state) {
- if (state is CalendarStateLoaded) {
- return _buildCalendar(context, state);
- } else if (state is CalendarStateLoading) {
- return Scaffold(
- body: Center(
- child: CupertinoActivityIndicator(),
- ),
- );
- } else if (state is CalendarStateError) {
- return Scaffold(
- body: Padding(
- padding: const EdgeInsets.all(16),
- child: Center(
- child: Text(state.errorMessage),
+ return BlocProvider(
+ create: (context) => sl()..loadCalendarList(),
+ child: BlocBuilder(
+ builder: (context, state) {
+ if (state is CalendarStateLoaded) {
+ return _buildCalendar(context, state);
+ } else if (state is CalendarStateLoading) {
+ return Scaffold(
+ body: Center(
+ child: SizedBox(
+ height: 32,
+ width: 32,
+ child: RiveAnimation.asset(
+ 'assets/rive_animations/loading.riv',
+ ),
+ ),
),
- ),
- );
- } else
- return Scaffold(
- body: Padding(
- padding: const EdgeInsets.all(16),
- child: Center(
- child: Text("Неопределенная ошибка"),
+ );
+ } else if (state is CalendarStateError) {
+ return Scaffold(
+ body: Padding(
+ padding: const EdgeInsets.all(16),
+ child: Center(
+ child: Text(state.errorMessage),
+ ),
),
- ),
- );
- },
+ );
+ } else
+ return Scaffold(
+ body: Padding(
+ padding: const EdgeInsets.all(16),
+ child: Center(
+ child: Text("Неопределенная ошибка"),
+ ),
+ ),
+ );
+ },
+ ),
);
}
@@ -62,12 +73,12 @@ class CalendarScreen extends StatelessWidget {
Expanded(
child: SingleChildScrollView(
child: Padding(
- padding: EdgeInsets.only(bottom: 5.v),
+ padding: EdgeInsets.only(bottom: 8),
child: Column(
children: [
- SizedBox(height: 20.v),
+ SizedBox(height: 24),
_buildCalendarBody(context, state),
- SizedBox(height: 20.v),
+ SizedBox(height: 24),
],
),
),
@@ -88,7 +99,7 @@ class CalendarScreen extends StatelessWidget {
physics: NeverScrollableScrollPhysics(),
separatorBuilder: (context, index) {
return SizedBox(
- height: 2.v,
+ height: 4,
);
},
itemCount: state.calendarList.length,
@@ -102,8 +113,7 @@ class CalendarScreen extends StatelessWidget {
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadiusStyle.circleBorder8,
- color: state.calendarList[index]
- .is_current_day_included_in_the_chosen_diet_progression
+ color: state.calendarList[index].is_current_day_included_in_the_chosen_diet_progression
? Color.fromRGBO(59, 130, 246, .2)
: Color.fromRGBO(126, 136, 151, .1),
),
@@ -119,37 +129,29 @@ class CalendarScreen extends StatelessWidget {
formatDate(state.calendarList[index].date),
style: theme.textTheme.titleMedium,
),
- SizedBox(height: 2.v),
- if (state.calendarList[index]
- .is_current_day_included_in_the_chosen_diet_progression)
+ SizedBox(height: 4),
+ if (state.calendarList[index].is_current_day_included_in_the_chosen_diet_progression)
Container(
- padding: EdgeInsets.all(
- 4.0), // Отступы внутри контейнера
+ padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
- borderRadius: BorderRadius.circular(
- 24.0), // Закругленные углы
+ borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
'Посмотреть диету на день',
- style: CustomTextStyles
- .titleSmallBold, // Предполагается, что текст белый
+ style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
- if (!state.calendarList[index]
- .is_current_day_included_in_the_chosen_diet_progression)
+ if (!state.calendarList[index].is_current_day_included_in_the_chosen_diet_progression)
Container(
- padding: EdgeInsets.all(
- 4.0), // Отступы внутри контейнера
+ padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(108, 117, 125, 1),
- borderRadius: BorderRadius.circular(
- 24.0), // Закругленные углы
+ borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
'Cкоро',
- style: CustomTextStyles
- .titleSmallBold, // Предполагается, что текст белый
+ style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
],
@@ -186,53 +188,42 @@ class CalendarScreen extends StatelessWidget {
formatDate(state.calendarList[index].date),
style: theme.textTheme.titleMedium,
),
- SizedBox(height: 2.v),
+ SizedBox(height: 4),
Row(children: [
Container(
- padding: EdgeInsets.all(
- 4.0), // Отступы внутри контейнера
+ padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
- color: diary['state'] == 'finished'
- ? Color.fromRGBO(1, 154, 62, 1)
- : Color.fromRGBO(154, 74, 1, 1),
- borderRadius: BorderRadius.circular(
- 24.0), // Закругленные углы
+ color: diary['state'] == 'finished' ? Color.fromRGBO(1, 154, 62, 1) : Color.fromRGBO(154, 74, 1, 1),
+ borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
_getStateText(diary['state'] ?? ''),
- style: CustomTextStyles
- .titleSmallBold, // Предполагается, что текст белый
+ style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
SizedBox(width: 4),
if (diary['state'] == 'started')
Container(
- padding: EdgeInsets.all(
- 4.0), // Отступы внутри контейнера
+ padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
- borderRadius: BorderRadius.circular(
- 24.0), // Закругленные углы
+ borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
'Заполнить отчет',
- style: CustomTextStyles
- .titleSmallBold, // Предполагается, что текст белый
+ style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
if (diary['state'] == 'finished')
Container(
- padding: EdgeInsets.all(
- 4.0), // Отступы внутри контейнера
+ padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
- borderRadius: BorderRadius.circular(
- 24.0), // Закругленные углы
+ borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
'Изменить отчет',
- style: CustomTextStyles
- .titleSmallBold, // Предполагается, что текст белый
+ style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
]),
diff --git a/lib/features/chat/models/chat_message_model.freezed.dart b/lib/features/chat/models/chat_message_model.freezed.dart
index 76a91cbc..8f921425 100644
--- a/lib/features/chat/models/chat_message_model.freezed.dart
+++ b/lib/features/chat/models/chat_message_model.freezed.dart
@@ -29,8 +29,12 @@ mixin _$ChatMessageModel {
@JsonKey(name: 'updated_at')
String get updatedAt => throw _privateConstructorUsedError;
+ /// Serializes this ChatMessageModel to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatMessageModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$ChatMessageModelCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -59,6 +63,8 @@ class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of ChatMessageModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -117,6 +123,8 @@ class __$$ChatMessageModelImplCopyWithImpl<$Res>
$Res Function(_$ChatMessageModelImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatMessageModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -207,12 +215,14 @@ class _$ChatMessageModelImpl implements _ChatMessageModel {
other.updatedAt == updatedAt));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, data,
const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt);
- @JsonKey(ignore: true)
+ /// Create a copy of ChatMessageModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith =>
@@ -252,8 +262,11 @@ abstract class _ChatMessageModel implements ChatMessageModel {
@override
@JsonKey(name: 'updated_at')
String get updatedAt;
+
+ /// Create a copy of ChatMessageModel
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/chat/models/chat_messages_model.freezed.dart b/lib/features/chat/models/chat_messages_model.freezed.dart
index a970241c..852b33e4 100644
--- a/lib/features/chat/models/chat_messages_model.freezed.dart
+++ b/lib/features/chat/models/chat_messages_model.freezed.dart
@@ -24,8 +24,12 @@ mixin _$ChatMessagesModel {
List get messagesList => throw _privateConstructorUsedError;
ChatMetaModel get meta => throw _privateConstructorUsedError;
+ /// Serializes this ChatMessagesModel to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatMessagesModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$ChatMessagesModelCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -53,6 +57,8 @@ class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of ChatMessagesModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -71,6 +77,8 @@ class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel>
) as $Val);
}
+ /// Create a copy of ChatMessagesModel
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ChatMetaModelCopyWith<$Res> get meta {
@@ -104,6 +112,8 @@ class __$$ChatMessagesModelImplCopyWithImpl<$Res>
$Res Function(_$ChatMessagesModelImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatMessagesModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -162,12 +172,14 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel {
(identical(other.meta, meta) || other.meta == meta));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, const DeepCollectionEquality().hash(_messagesList), meta);
- @JsonKey(ignore: true)
+ /// Create a copy of ChatMessagesModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith =>
@@ -196,8 +208,11 @@ abstract class _ChatMessagesModel implements ChatMessagesModel {
List get messagesList;
@override
ChatMetaModel get meta;
+
+ /// Create a copy of ChatMessagesModel
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/chat/models/chat_meta_model.freezed.dart b/lib/features/chat/models/chat_meta_model.freezed.dart
index 11ecb9e2..e8e4e96b 100644
--- a/lib/features/chat/models/chat_meta_model.freezed.dart
+++ b/lib/features/chat/models/chat_meta_model.freezed.dart
@@ -23,8 +23,12 @@ mixin _$ChatMetaModel {
@JsonKey(name: "last_page")
int get lastPage => throw _privateConstructorUsedError;
+ /// Serializes this ChatMetaModel to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatMetaModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$ChatMetaModelCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -48,6 +52,8 @@ class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of ChatMetaModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -81,6 +87,8 @@ class __$$ChatMetaModelImplCopyWithImpl<$Res>
_$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatMetaModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -122,11 +130,13 @@ class _$ChatMetaModelImpl implements _ChatMetaModel {
other.lastPage == lastPage));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, lastPage);
- @JsonKey(ignore: true)
+ /// Create a copy of ChatMetaModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith =>
@@ -151,8 +161,11 @@ abstract class _ChatMetaModel implements ChatMetaModel {
@override
@JsonKey(name: "last_page")
int get lastPage;
+
+ /// Create a copy of ChatMetaModel
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/chat/models/chat_room_model.freezed.dart b/lib/features/chat/models/chat_room_model.freezed.dart
index 5a0b6e62..6afb3a94 100644
--- a/lib/features/chat/models/chat_room_model.freezed.dart
+++ b/lib/features/chat/models/chat_room_model.freezed.dart
@@ -26,8 +26,12 @@ mixin _$ChatRoomModel {
throw _privateConstructorUsedError;
Map get users => throw _privateConstructorUsedError;
+ /// Serializes this ChatRoomModel to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatRoomModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$ChatRoomModelCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -57,6 +61,8 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of ChatRoomModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -80,6 +86,8 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel>
) as $Val);
}
+ /// Create a copy of ChatRoomModel
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings {
@@ -116,6 +124,8 @@ class __$$ChatRoomModelImplCopyWithImpl<$Res>
_$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatRoomModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -181,12 +191,14 @@ class _$ChatRoomModelImpl implements _ChatRoomModel {
const DeepCollectionEquality().equals(other._users, _users));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, chatRoomSettings,
const DeepCollectionEquality().hash(_users));
- @JsonKey(ignore: true)
+ /// Create a copy of ChatRoomModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith =>
@@ -217,8 +229,11 @@ abstract class _ChatRoomModel implements ChatRoomModel {
ChatRoomSettingsModel get chatRoomSettings;
@override
Map get users;
+
+ /// Create a copy of ChatRoomModel
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/chat/models/chat_room_preview_model.freezed.dart b/lib/features/chat/models/chat_room_preview_model.freezed.dart
index 8d41bd4b..4b006cf0 100644
--- a/lib/features/chat/models/chat_room_preview_model.freezed.dart
+++ b/lib/features/chat/models/chat_room_preview_model.freezed.dart
@@ -23,8 +23,12 @@ mixin _$ChatRoomPreviewModel {
@JsonKey(name: "chatRooms")
List get chatRooms => throw _privateConstructorUsedError;
+ /// Serializes this ChatRoomPreviewModel to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatRoomPreviewModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$ChatRoomPreviewModelCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -49,6 +53,8 @@ class _$ChatRoomPreviewModelCopyWithImpl<$Res,
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of ChatRoomPreviewModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -82,6 +88,8 @@ class __$$ChatRoomPreviewModelImplCopyWithImpl<$Res>
$Res Function(_$ChatRoomPreviewModelImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatRoomPreviewModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -129,12 +137,14 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel {
.equals(other._chatRooms, _chatRooms));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms));
- @JsonKey(ignore: true)
+ /// Create a copy of ChatRoomPreviewModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl>
@@ -161,8 +171,11 @@ abstract class _ChatRoomPreviewModel implements ChatRoomPreviewModel {
@override
@JsonKey(name: "chatRooms")
List get chatRooms;
+
+ /// Create a copy of ChatRoomPreviewModel
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl>
get copyWith => throw _privateConstructorUsedError;
}
@@ -182,8 +195,12 @@ mixin _$ChatRoom {
@JsonKey(name: "users")
Users get users => throw _privateConstructorUsedError;
+ /// Serializes this ChatRoom to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatRoom
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$ChatRoomCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -212,6 +229,8 @@ class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of ChatRoom
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -240,6 +259,8 @@ class _$ChatRoomCopyWithImpl<$Res, $Val extends ChatRoom>
) as $Val);
}
+ /// Create a copy of ChatRoom
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$UsersCopyWith<$Res> get users {
@@ -275,6 +296,8 @@ class __$$ChatRoomImplCopyWithImpl<$Res>
_$ChatRoomImpl _value, $Res Function(_$ChatRoomImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatRoom
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -347,12 +370,14 @@ class _$ChatRoomImpl implements _ChatRoom {
(identical(other.users, users) || other.users == users));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, roomName,
const DeepCollectionEquality().hash(lastMessage), users);
- @JsonKey(ignore: true)
+ /// Create a copy of ChatRoom
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith =>
@@ -388,8 +413,11 @@ abstract class _ChatRoom implements ChatRoom {
@override
@JsonKey(name: "users")
Users get users;
+
+ /// Create a copy of ChatRoom
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -415,8 +443,12 @@ mixin _$LastMessageClass {
@JsonKey(name: "updated_at")
DateTime get updatedAt => throw _privateConstructorUsedError;
+ /// Serializes this LastMessageClass to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of LastMessageClass
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$LastMessageClassCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -448,6 +480,8 @@ class _$LastMessageClassCopyWithImpl<$Res, $Val extends LastMessageClass>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of LastMessageClass
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -519,6 +553,8 @@ class __$$LastMessageClassImplCopyWithImpl<$Res>
$Res Function(_$LastMessageClassImpl) _then)
: super(_value, _then);
+ /// Create a copy of LastMessageClass
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -633,7 +669,7 @@ class _$LastMessageClassImpl implements _LastMessageClass {
other.updatedAt == updatedAt));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
@@ -645,7 +681,9 @@ class _$LastMessageClassImpl implements _LastMessageClass {
readByToUser,
updatedAt);
- @JsonKey(ignore: true)
+ /// Create a copy of LastMessageClass
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith =>
@@ -696,8 +734,11 @@ abstract class _LastMessageClass implements LastMessageClass {
@override
@JsonKey(name: "updated_at")
DateTime get updatedAt;
+
+ /// Create a copy of LastMessageClass
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -713,8 +754,12 @@ mixin _$Users {
@JsonKey(name: "to_chat_user")
ChatUser get toChatUser => throw _privateConstructorUsedError;
+ /// Serializes this Users to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of Users
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$UsersCopyWith get copyWith => throw _privateConstructorUsedError;
}
@@ -741,6 +786,8 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of Users
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -759,6 +806,8 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users>
) as $Val);
}
+ /// Create a copy of Users
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ChatUserCopyWith<$Res> get fromChatUser {
@@ -767,6 +816,8 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users>
});
}
+ /// Create a copy of Users
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ChatUserCopyWith<$Res> get toChatUser {
@@ -801,6 +852,8 @@ class __$$UsersImplCopyWithImpl<$Res>
_$UsersImpl _value, $Res Function(_$UsersImpl) _then)
: super(_value, _then);
+ /// Create a copy of Users
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -853,11 +906,13 @@ class _$UsersImpl implements _Users {
other.toChatUser == toChatUser));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, fromChatUser, toChatUser);
- @JsonKey(ignore: true)
+ /// Create a copy of Users
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$UsersImplCopyWith<_$UsersImpl> get copyWith =>
@@ -885,8 +940,11 @@ abstract class _Users implements Users {
@override
@JsonKey(name: "to_chat_user")
ChatUser get toChatUser;
+
+ /// Create a copy of Users
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$UsersImplCopyWith<_$UsersImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -906,8 +964,12 @@ mixin _$ChatUser {
@JsonKey(name: "profile_photo_url")
String get profilePhotoUrl => throw _privateConstructorUsedError;
+ /// Serializes this ChatUser to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatUser
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$ChatUserCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -934,6 +996,8 @@ class _$ChatUserCopyWithImpl<$Res, $Val extends ChatUser>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of ChatUser
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -986,6 +1050,8 @@ class __$$ChatUserImplCopyWithImpl<$Res>
_$ChatUserImpl _value, $Res Function(_$ChatUserImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatUser
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -1058,12 +1124,14 @@ class _$ChatUserImpl implements _ChatUser {
other.profilePhotoUrl == profilePhotoUrl));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl);
- @JsonKey(ignore: true)
+ /// Create a copy of ChatUser
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith =>
@@ -1101,8 +1169,11 @@ abstract class _ChatUser implements ChatUser {
@override
@JsonKey(name: "profile_photo_url")
String get profilePhotoUrl;
+
+ /// Create a copy of ChatUser
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/chat/models/chat_room_settings_model.freezed.dart b/lib/features/chat/models/chat_room_settings_model.freezed.dart
index 4f217556..9d12eefa 100644
--- a/lib/features/chat/models/chat_room_settings_model.freezed.dart
+++ b/lib/features/chat/models/chat_room_settings_model.freezed.dart
@@ -30,8 +30,12 @@ mixin _$ChatRoomSettingsModel {
@JsonKey(name: 'updated_at')
String get updatedAt => throw _privateConstructorUsedError;
+ /// Serializes this ChatRoomSettingsModel to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatRoomSettingsModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$ChatRoomSettingsModelCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -61,6 +65,8 @@ class _$ChatRoomSettingsModelCopyWithImpl<$Res,
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of ChatRoomSettingsModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -121,6 +127,8 @@ class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res>
$Res Function(_$ChatRoomSettingsModelImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatRoomSettingsModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -202,12 +210,14 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel {
other.updatedAt == updatedAt));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt);
- @JsonKey(ignore: true)
+ /// Create a copy of ChatRoomSettingsModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl>
@@ -247,8 +257,11 @@ abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel {
@override
@JsonKey(name: 'updated_at')
String get updatedAt;
+
+ /// Create a copy of ChatRoomSettingsModel
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl>
get copyWith => throw _privateConstructorUsedError;
}
diff --git a/lib/features/chat/models/chat_user_model.freezed.dart b/lib/features/chat/models/chat_user_model.freezed.dart
index 095c09e2..94718168 100644
--- a/lib/features/chat/models/chat_user_model.freezed.dart
+++ b/lib/features/chat/models/chat_user_model.freezed.dart
@@ -27,8 +27,12 @@ mixin _$ChatUserModel {
@JsonKey(name: 'profile_photo_url')
String? get profilePhotoUrl => throw _privateConstructorUsedError;
+ /// Serializes this ChatUserModel to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatUserModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$ChatUserModelCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -56,6 +60,8 @@ class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of ChatUserModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -108,6 +114,8 @@ class __$$ChatUserModelImplCopyWithImpl<$Res>
_$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatUserModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -178,12 +186,14 @@ class _$ChatUserModelImpl implements _ChatUserModel {
other.profilePhotoUrl == profilePhotoUrl));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl);
- @JsonKey(ignore: true)
+ /// Create a copy of ChatUserModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith =>
@@ -218,8 +228,11 @@ abstract class _ChatUserModel implements ChatUserModel {
@override
@JsonKey(name: 'profile_photo_url')
String? get profilePhotoUrl;
+
+ /// Create a copy of ChatUserModel
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/chat/models/websocket_info_model.freezed.dart b/lib/features/chat/models/websocket_info_model.freezed.dart
index cd383a2b..9cddabee 100644
--- a/lib/features/chat/models/websocket_info_model.freezed.dart
+++ b/lib/features/chat/models/websocket_info_model.freezed.dart
@@ -27,8 +27,12 @@ mixin _$WebsocketInfoModel {
@JsonKey(name: 'user_id')
int get userId => throw _privateConstructorUsedError;
+ /// Serializes this WebsocketInfoModel to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of WebsocketInfoModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$WebsocketInfoModelCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -57,6 +61,8 @@ class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of WebsocketInfoModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -115,6 +121,8 @@ class __$$WebsocketInfoModelImplCopyWithImpl<$Res>
$Res Function(_$WebsocketInfoModelImpl) _then)
: super(_value, _then);
+ /// Create a copy of WebsocketInfoModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -191,12 +199,14 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel {
(identical(other.userId, userId) || other.userId == userId));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, key, host, port, cluster, userId);
- @JsonKey(ignore: true)
+ /// Create a copy of WebsocketInfoModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith =>
@@ -234,8 +244,11 @@ abstract class _WebsocketInfoModel implements WebsocketInfoModel {
@override
@JsonKey(name: 'user_id')
int get userId;
+
+ /// Create a copy of WebsocketInfoModel
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart
index 9140a6bd..413ff885 100644
--- a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart
+++ b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart
@@ -4,7 +4,7 @@ import 'dart:io';
import 'package:audioplayers/audioplayers.dart';
import 'package:dart_pusher_channels/dart_pusher_channels.dart';
import 'package:easy_debounce/easy_debounce.dart';
-import 'package:eatvio_app/core/constants/constants.dart';
+import 'package:eatvio_app/core/const.dart';
import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart';
import 'package:eatvio_app/core/initialization_cubit/initialization_state.dart';
import 'package:eatvio_app/core/token_storage.dart';
diff --git a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart
index 43bf9df9..4695b4ad 100644
--- a/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart
+++ b/lib/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.freezed.dart
@@ -90,6 +90,9 @@ class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
+
+ /// Create a copy of ChatRoomState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -106,6 +109,9 @@ class __$$ChatRoomStateImplCopyWithImpl<$Res>
__$$ChatRoomStateImplCopyWithImpl(
_$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of ChatRoomState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -226,6 +232,9 @@ class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res>
__$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value,
$Res Function(_$ChatRoomStateLoadingImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of ChatRoomState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -356,6 +365,8 @@ class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res>
$Res Function(_$ChatRoomStateLoadedImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatRoomState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -384,6 +395,8 @@ class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res>
));
}
+ /// Create a copy of ChatRoomState
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ChatRoomModelCopyWith<$Res> get chatRoom {
@@ -442,7 +455,9 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded {
int get hashCode => Object.hash(runtimeType, chatRoom,
const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading);
- @JsonKey(ignore: true)
+ /// Create a copy of ChatRoomState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith =>
@@ -541,7 +556,10 @@ abstract class ChatRoomStateLoaded implements ChatRoomState {
List get chatMessages;
bool get isTyping;
bool get isLoading;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatRoomState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -563,6 +581,8 @@ class __$$ChatRoomStateErrorImplCopyWithImpl<$Res>
$Res Function(_$ChatRoomStateErrorImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatRoomState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -602,7 +622,9 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError {
@override
int get hashCode => Object.hash(runtimeType, errorMessage);
- @JsonKey(ignore: true)
+ /// Create a copy of ChatRoomState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith =>
@@ -695,7 +717,10 @@ abstract class ChatRoomStateError implements ChatRoomState {
_$ChatRoomStateErrorImpl;
String get errorMessage;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatRoomState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart
index fc92f22d..d3edddc8 100644
--- a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart
+++ b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart
@@ -1,6 +1,6 @@
-import 'package:eatvio_app/core/app_export.dart';
import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.dart';
import 'package:eatvio_app/features/chat/repositories/chat_repository.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
class ChatSelectCubit extends Cubit {
final ChatRepository chatRepository;
diff --git a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart
index 9a05918d..99fa9054 100644
--- a/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart
+++ b/lib/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.freezed.dart
@@ -84,6 +84,9 @@ class _$ChatSelectStateCopyWithImpl<$Res, $Val extends ChatSelectState>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
+
+ /// Create a copy of ChatSelectState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -100,6 +103,9 @@ class __$$ChatSelectStateImplCopyWithImpl<$Res>
__$$ChatSelectStateImplCopyWithImpl(
_$ChatSelectStateImpl _value, $Res Function(_$ChatSelectStateImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of ChatSelectState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -216,6 +222,9 @@ class __$$ChatSelectStateLoadingImplCopyWithImpl<$Res>
_$ChatSelectStateLoadingImpl _value,
$Res Function(_$ChatSelectStateLoadingImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of ChatSelectState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -334,6 +343,8 @@ class __$$ChatSelectStateErrorImplCopyWithImpl<$Res>
$Res Function(_$ChatSelectStateErrorImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatSelectState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -373,7 +384,9 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError {
@override
int get hashCode => Object.hash(runtimeType, errorMessage);
- @JsonKey(ignore: true)
+ /// Create a copy of ChatSelectState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl>
@@ -461,7 +474,10 @@ abstract class ChatSelectStateError implements ChatSelectState {
_$ChatSelectStateErrorImpl;
String get errorMessage;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatSelectState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl>
get copyWith => throw _privateConstructorUsedError;
}
@@ -484,6 +500,8 @@ class __$$ChatSelectStateLoadedImplCopyWithImpl<$Res>
$Res Function(_$ChatSelectStateLoadedImpl) _then)
: super(_value, _then);
+ /// Create a copy of ChatSelectState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -530,7 +548,9 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded {
int get hashCode =>
Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms));
- @JsonKey(ignore: true)
+ /// Create a copy of ChatSelectState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl>
@@ -617,7 +637,10 @@ abstract class ChatSelectStateLoaded implements ChatSelectState {
{required final List chatRooms}) = _$ChatSelectStateLoadedImpl;
List get chatRooms;
- @JsonKey(ignore: true)
+
+ /// Create a copy of ChatSelectState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl>
get copyWith => throw _privateConstructorUsedError;
}
diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart
index fac8c5eb..2e96d007 100644
--- a/lib/features/chat/presentation/pages/chat_screen.dart
+++ b/lib/features/chat/presentation/pages/chat_screen.dart
@@ -1,13 +1,16 @@
import 'dart:io';
-import 'package:eatvio_app/core/app_export.dart';
+
import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart';
import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.dart';
import 'package:eatvio_app/features/chat/presentation/widgets/chat_bubble_widget.dart';
import 'package:eatvio_app/locator_service.dart';
+import 'package:eatvio_app/theme/custom_text_style.dart';
+import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:file_picker/file_picker.dart';
-import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
-import 'package:lazy_load_scrollview/lazy_load_scrollview.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:intl/intl.dart';
+import 'package:rive/rive.dart';
class ChatScreen extends StatefulWidget {
final String chatId;
@@ -25,6 +28,24 @@ class _ChatScreenState extends State {
final scrollController = ScrollController();
final TextEditingController textEditingController = TextEditingController();
+ @override
+ void initState() {
+ scrollController.addListener(_onScroll);
+ super.initState();
+ }
+
+ _onScroll() {
+ if (scrollController.offset >= scrollController.position.maxScrollExtent && !scrollController.position.outOfRange) {
+ context.read().loadNextPage(widget.chatId);
+ }
+ }
+
+ @override
+ void dispose() {
+ scrollController.dispose();
+ super.dispose();
+ }
+
Widget build(BuildContext context) {
return BlocProvider(
create: (BuildContext context) => sl()..initChat(widget.chatId),
@@ -42,7 +63,13 @@ class _ChatScreenState extends State {
} else {
return Scaffold(
body: Center(
- child: CupertinoActivityIndicator(),
+ child: SizedBox(
+ height: 32,
+ width: 32,
+ child: RiveAnimation.asset(
+ 'assets/rive_animations/loading.riv',
+ ),
+ ),
),
);
}
@@ -116,40 +143,52 @@ class _ChatScreenState extends State {
child: Container(
color: Color(0xFFF0F2F5),
width: double.maxFinite,
- child: LazyLoadScrollView(
- onEndOfPage: () => context.read().loadNextPage(widget.chatId),
- isLoading: state.isLoading,
- scrollOffset: MediaQuery.of(context).size.height.toInt(),
- child: CustomScrollView(
- physics: BouncingScrollPhysics(),
- controller: scrollController,
- reverse: true,
- slivers: [
- SliverPadding(
- padding: EdgeInsets.symmetric(vertical: 16),
- sliver: SliverList(
- delegate: SliverChildBuilderDelegate(
- (context, index) {
- if (index < state.chatMessages.length) {
- return ChatBubbleWidget(
- sendTime: state.chatMessages[index].updatedAt,
- text: state.chatMessages[index].data.trim(),
- isCurrentUser: state.chatRoom.users['to_chat_user']!.id != state.chatMessages[index].authorId,
- mediaData: state.chatMessages[index].mediaData ?? [],
- );
- } else {
- return Padding(
- padding: const EdgeInsets.all(8),
- child: Center(child: CupertinoActivityIndicator()),
- );
- }
- },
- childCount: state.chatMessages.length + (state.isLoading ? 1 : 0),
- ),
+ child: CustomScrollView(
+ physics: BouncingScrollPhysics(),
+ controller: scrollController,
+ reverse: true,
+ slivers: [
+ SliverPadding(
+ padding: EdgeInsets.symmetric(vertical: 16),
+ sliver: SliverList(
+ delegate: SliverChildBuilderDelegate(
+ (context, index) {
+ if (index < state.chatMessages.length) {
+ return Column(
+ children: [
+ if ((index + 1 != state.chatMessages.length &&
+ DateTime.parse(state.chatMessages[index].updatedAt).day !=
+ DateTime.parse(state.chatMessages[index + 1].updatedAt).day) ||
+ index + 1 == state.chatMessages.length)
+ _messageDate(state.chatMessages[index].updatedAt),
+ ChatBubbleWidget(
+ sendTime: state.chatMessages[index].updatedAt,
+ text: state.chatMessages[index].data.trim(),
+ isCurrentUser: state.chatRoom.users['to_chat_user']!.id != state.chatMessages[index].authorId,
+ mediaData: state.chatMessages[index].mediaData ?? [],
+ ),
+ ],
+ );
+ } else {
+ return Padding(
+ padding: const EdgeInsets.all(8),
+ child: Center(
+ child: SizedBox(
+ height: 32,
+ width: 32,
+ child: RiveAnimation.asset(
+ 'assets/rive_animations/loading.riv',
+ ),
+ ),
+ ),
+ );
+ }
+ },
+ childCount: state.chatMessages.length + (state.isLoading ? 1 : 0),
),
),
- ],
- ),
+ ),
+ ],
),
),
),
@@ -298,4 +337,20 @@ class _ChatScreenState extends State {
),
);
}
+
+ _messageDate(String date) {
+ return Padding(
+ padding: const EdgeInsets.symmetric(vertical: 8),
+ child: Text(
+ DateFormat.MMMMd('RU').format(
+ DateTime.parse(date),
+ ),
+ style: const TextStyle(
+ height: 1,
+ color: Color(0xFF8393A1),
+ fontWeight: FontWeight.w500,
+ ),
+ ),
+ );
+ }
}
diff --git a/lib/features/chat/presentation/pages/chat_select_screen.dart b/lib/features/chat/presentation/pages/chat_select_screen.dart
index 74925e29..b4660cf2 100644
--- a/lib/features/chat/presentation/pages/chat_select_screen.dart
+++ b/lib/features/chat/presentation/pages/chat_select_screen.dart
@@ -1,11 +1,12 @@
import 'package:easy_debounce/easy_debounce.dart';
-import 'package:eatvio_app/core/app_export.dart';
import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart';
import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_state.dart';
import 'package:eatvio_app/features/chat/presentation/widgets/chat_entry_widget.dart';
import 'package:eatvio_app/features/chat/presentation/widgets/chat_search_bar_widget.dart';
-import 'package:flutter/cupertino.dart';
+import 'package:eatvio_app/locator_service.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:rive/rive.dart';
class ChatSelectScreen extends StatefulWidget {
const ChatSelectScreen({Key? key}) : super(key: key);
@@ -15,58 +16,62 @@ class ChatSelectScreen extends StatefulWidget {
}
class _ChatSelectScreenState extends State {
+ final ChatSelectCubit chatSelectCubit = sl();
final searchController = TextEditingController();
Widget build(BuildContext context) {
- return BlocBuilder(
- builder: (context, state) {
- return Scaffold(
- appBar: AppBar(
- backgroundColor: Colors.white,
- toolbarHeight: 0,
- ),
- body: NestedScrollView(
- headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
- return [
- SliverPadding(
- padding: const EdgeInsets.only(top: 8),
- sliver: SliverAppBar(
- automaticallyImplyLeading: false,
- stretchTriggerOffset: 1,
- scrolledUnderElevation: 0,
- floating: true,
- snap: true,
- title: Padding(
- padding: const EdgeInsets.only(top: 8),
- child: ChatSearchBarWidget(
- onSuffixIconTap: () => context.read().getChatRooms(),
- onChanged: (query) {
- if (query.length > 2) {
- EasyDebounce.debounce(
- 'searchChatRoom',
- Duration(milliseconds: 300),
- () => context.read().getChatRooms(query: query),
- );
- } else {
- context.read().getChatRooms();
- }
- },
- controller: searchController,
- fillColor: Color(0xFFF0F2F5),
- hintText: "Поиск",
- hintStyle: TextStyle(
- color: Color(0xFF7B8794),
+ return BlocProvider(
+ create: (context) => chatSelectCubit..getChatRooms(),
+ child: BlocBuilder(
+ builder: (context, state) {
+ return Scaffold(
+ appBar: AppBar(
+ backgroundColor: Colors.white,
+ toolbarHeight: 0,
+ ),
+ body: NestedScrollView(
+ headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
+ return [
+ SliverPadding(
+ padding: const EdgeInsets.only(top: 8),
+ sliver: SliverAppBar(
+ automaticallyImplyLeading: false,
+ stretchTriggerOffset: 1,
+ scrolledUnderElevation: 0,
+ floating: true,
+ snap: true,
+ title: Padding(
+ padding: const EdgeInsets.only(top: 8),
+ child: ChatSearchBarWidget(
+ onSuffixIconTap: () => context.read().getChatRooms(),
+ onChanged: (query) {
+ if (query.length > 2) {
+ EasyDebounce.debounce(
+ 'searchChatRoom',
+ Duration(milliseconds: 300),
+ () => context.read().getChatRooms(query: query),
+ );
+ } else {
+ context.read().getChatRooms();
+ }
+ },
+ controller: searchController,
+ fillColor: Color(0xFFF0F2F5),
+ hintText: "Поиск",
+ hintStyle: TextStyle(
+ color: Color(0xFF7B8794),
+ ),
),
),
),
),
- ),
- ];
- },
- body: stateBuilder(state),
- ),
- );
- },
+ ];
+ },
+ body: stateBuilder(state),
+ ),
+ );
+ },
+ ),
);
}
@@ -74,7 +79,13 @@ class _ChatSelectScreenState extends State {
if (state is ChatSelectStateLoading) {
return Scaffold(
body: Center(
- child: CupertinoActivityIndicator(),
+ child: SizedBox(
+ height: 32,
+ width: 32,
+ child: RiveAnimation.asset(
+ 'assets/rive_animations/loading.riv',
+ ),
+ ),
),
);
} else if (state is ChatSelectStateLoaded) {
@@ -87,7 +98,13 @@ class _ChatSelectScreenState extends State {
} else {
return Scaffold(
body: Center(
- child: CupertinoActivityIndicator(),
+ child: SizedBox(
+ height: 32,
+ width: 32,
+ child: RiveAnimation.asset(
+ 'assets/rive_animations/loading.riv',
+ ),
+ ),
),
);
}
diff --git a/lib/features/chat/presentation/pages/photo_view_screen.dart b/lib/features/chat/presentation/pages/photo_view_screen.dart
index a070103d..4bc71ee9 100644
--- a/lib/features/chat/presentation/pages/photo_view_screen.dart
+++ b/lib/features/chat/presentation/pages/photo_view_screen.dart
@@ -1,6 +1,7 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:dismissible_page/dismissible_page.dart';
-import 'package:eatvio_app/core/app_export.dart';
+import 'package:eatvio_app/core/const.dart';
+import 'package:eatvio_app/theme/app_decoration.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:photo_view/photo_view.dart';
diff --git a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart
index eeba8f1e..79e3269a 100644
--- a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart
+++ b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart
@@ -1,6 +1,7 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:dismissible_page/dismissible_page.dart';
-import 'package:eatvio_app/core/app_export.dart';
+import 'package:eatvio_app/core/const.dart';
+import 'package:eatvio_app/core/utils/date_time_utils.dart';
import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
@@ -51,7 +52,7 @@ class ChatBubbleWidget extends StatelessWidget {
!mediaData[index].toString().contains('.jpg') &&
!mediaData[index].toString().contains('.jpeg')) {
return ListTile(
- contentPadding: EdgeInsets.zero,
+ contentPadding: EdgeInsets.all(4),
horizontalTitleGap: 8,
onTap: () async {
if (!await launchUrl(Uri.parse(baseUrl + '/storage/' + mediaData[index].toString()))) {
@@ -60,17 +61,17 @@ class ChatBubbleWidget extends StatelessWidget {
},
leading: Icon(
Icons.file_copy_outlined,
- color: Color(0xFF2F80ED),
+ color: Colors.white,
),
trailing: Icon(
Icons.download_outlined,
- color: Color(0xFF2F80ED),
+ color: Colors.white,
),
title: Text(
mediaData[index].toString().replaceAll('chat_files/', ''),
maxLines: 2,
style: TextStyle(
- color: Color(0xFF323F4B),
+ color: Colors.white,
fontSize: 12,
overflow: TextOverflow.ellipsis,
),
@@ -110,12 +111,15 @@ class ChatBubbleWidget extends StatelessWidget {
style: TextStyle(color: isCurrentUser ? Colors.white : Color(0xFF323F4B), height: 1),
),
SizedBox(height: 4),
- Text(
- DateTime.parse(sendTime).format('hh:mm'),
- style: TextStyle(
- color: isCurrentUser ? Colors.white.withOpacity(0.4) : Color(0xFF323F4B).withOpacity(0.4),
- height: 1,
- fontSize: 10,
+ Padding(
+ padding: mediaData.length > 0 ? const EdgeInsets.only(right: 8, top: 4, left: 8) : EdgeInsets.zero,
+ child: Text(
+ DateTime.parse(sendTime).format('hh:mm'),
+ style: TextStyle(
+ color: isCurrentUser ? Colors.white.withOpacity(0.4) : Color(0xFF323F4B).withOpacity(0.4),
+ height: 1,
+ fontSize: 10,
+ ),
),
),
],
diff --git a/lib/features/chat/presentation/widgets/chat_entry_widget.dart b/lib/features/chat/presentation/widgets/chat_entry_widget.dart
index b496047d..e8150dc1 100644
--- a/lib/features/chat/presentation/widgets/chat_entry_widget.dart
+++ b/lib/features/chat/presentation/widgets/chat_entry_widget.dart
@@ -1,5 +1,7 @@
-import 'package:eatvio_app/core/app_export.dart';
+import 'package:eatvio_app/core/utils/date_time_utils.dart';
import 'package:eatvio_app/features/chat/models/chat_room_preview_model.dart';
+import 'package:eatvio_app/theme/custom_text_style.dart';
+import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
diff --git a/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart b/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart
index 4889fdfd..3480c923 100644
--- a/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart
+++ b/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart
@@ -1,4 +1,5 @@
-import 'package:eatvio_app/core/app_export.dart';
+import 'package:eatvio_app/theme/custom_text_style.dart';
+import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:flutter/material.dart';
class ChatSearchBarWidget extends StatelessWidget {
@@ -78,7 +79,7 @@ class ChatSearchBarWidget extends StatelessWidget {
}
searchViewWidget(BuildContext context) => SizedBox(
- width: width ?? double.maxFinite,
+ width: width ?? MediaQuery.of(context).size.width,
child: TextFormField(
controller: controller,
focusNode: focusNode,
@@ -123,10 +124,6 @@ class ChatSearchBarWidget extends StatelessWidget {
color: Colors.grey.shade600,
),
),
- suffixIconConstraints: suffixConstraints ??
- BoxConstraints(
- maxHeight: 40.v,
- ),
isDense: true,
contentPadding: EdgeInsets.all(16),
fillColor: fillColor ?? appTheme.gray100,
diff --git a/lib/features/chat/repositories/chat_repository.dart b/lib/features/chat/repositories/chat_repository.dart
index 0f0be7de..f83fa563 100644
--- a/lib/features/chat/repositories/chat_repository.dart
+++ b/lib/features/chat/repositories/chat_repository.dart
@@ -1,11 +1,12 @@
import 'dart:io';
+
import 'package:dio/dio.dart';
-import 'package:eatvio_app/features/chat/models/chat_room_preview_model.dart';
-import 'package:http_parser/http_parser.dart';
import 'package:eatvio_app/features/chat/models/chat_messages_model.dart';
import 'package:eatvio_app/features/chat/models/chat_room_model.dart';
+import 'package:eatvio_app/features/chat/models/chat_room_preview_model.dart';
import 'package:eatvio_app/features/chat/models/websocket_info_model.dart';
import 'package:eatvio_app/features/chat/services/chat_service.dart';
+import 'package:http_parser/http_parser.dart';
class ChatRepository {
final ChatService chatService;
diff --git a/lib/features/diary/models/diary_model.dart b/lib/features/diary/models/diary_model.dart
index d9abc3a9..8c152997 100644
--- a/lib/features/diary/models/diary_model.dart
+++ b/lib/features/diary/models/diary_model.dart
@@ -4,6 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
import './meal.dart';
part 'diary_model.freezed.dart';
+
part 'diary_model.g.dart';
@freezed
diff --git a/lib/features/diary/models/diary_model.freezed.dart b/lib/features/diary/models/diary_model.freezed.dart
index a02a4621..ceabd5db 100644
--- a/lib/features/diary/models/diary_model.freezed.dart
+++ b/lib/features/diary/models/diary_model.freezed.dart
@@ -29,8 +29,12 @@ mixin _$DiaryModel {
DateTime? get wakeup => throw _privateConstructorUsedError;
DateTime? get retire => throw _privateConstructorUsedError;
+ /// Serializes this DiaryModel to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of DiaryModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$DiaryModelCopyWith get copyWith =>
throw _privateConstructorUsedError;
}
@@ -64,6 +68,8 @@ class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of DiaryModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -112,6 +118,8 @@ class _$DiaryModelCopyWithImpl<$Res, $Val extends DiaryModel>
) as $Val);
}
+ /// Create a copy of DiaryModel
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$StateCopyWith<$Res> get state {
@@ -151,6 +159,8 @@ class __$$DiaryModelImplCopyWithImpl<$Res>
_$DiaryModelImpl _value, $Res Function(_$DiaryModelImpl) _then)
: super(_value, _then);
+ /// Create a copy of DiaryModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -260,7 +270,7 @@ class _$DiaryModelImpl implements _DiaryModel {
(identical(other.retire, retire) || other.retire == retire));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
@@ -273,7 +283,9 @@ class _$DiaryModelImpl implements _DiaryModel {
wakeup,
retire);
- @JsonKey(ignore: true)
+ /// Create a copy of DiaryModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith =>
@@ -317,8 +329,11 @@ abstract class _DiaryModel implements DiaryModel {
DateTime? get wakeup;
@override
DateTime? get retire;
+
+ /// Create a copy of DiaryModel
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/diary/models/meal.dart b/lib/features/diary/models/meal.dart
index 415242c6..b5e12d83 100644
--- a/lib/features/diary/models/meal.dart
+++ b/lib/features/diary/models/meal.dart
@@ -4,6 +4,7 @@ import './photo.dart';
import './portion.dart';
part 'meal.freezed.dart';
+
part 'meal.g.dart';
@freezed
diff --git a/lib/features/diary/models/meal.freezed.dart b/lib/features/diary/models/meal.freezed.dart
index 2c249b06..2bd6c478 100644
--- a/lib/features/diary/models/meal.freezed.dart
+++ b/lib/features/diary/models/meal.freezed.dart
@@ -28,8 +28,12 @@ mixin _$Meal {
List get portions => throw _privateConstructorUsedError;
List get photos => throw _privateConstructorUsedError;
+ /// Serializes this Meal to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of Meal
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$MealCopyWith get copyWith => throw _privateConstructorUsedError;
}
@@ -58,6 +62,8 @@ class _$MealCopyWithImpl<$Res, $Val extends Meal>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of Meal
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -126,6 +132,8 @@ class __$$MealImplCopyWithImpl<$Res>
__$$MealImplCopyWithImpl(_$MealImpl _value, $Res Function(_$MealImpl) _then)
: super(_value, _then);
+ /// Create a copy of Meal
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -232,7 +240,7 @@ class _$MealImpl implements _Meal {
const DeepCollectionEquality().equals(other._photos, _photos));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
@@ -244,7 +252,9 @@ class _$MealImpl implements _Meal {
const DeepCollectionEquality().hash(_portions),
const DeepCollectionEquality().hash(_photos));
- @JsonKey(ignore: true)
+ /// Create a copy of Meal
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$MealImplCopyWith<_$MealImpl> get copyWith =>
@@ -284,8 +294,11 @@ abstract class _Meal implements Meal {
List get portions;
@override
List get photos;
+
+ /// Create a copy of Meal
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$MealImplCopyWith<_$MealImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/diary/models/photo.freezed.dart b/lib/features/diary/models/photo.freezed.dart
index 2d9c70bd..8f5e0152 100644
--- a/lib/features/diary/models/photo.freezed.dart
+++ b/lib/features/diary/models/photo.freezed.dart
@@ -25,8 +25,12 @@ mixin _$Photo {
String get originalName => throw _privateConstructorUsedError;
String get path => throw _privateConstructorUsedError;
+ /// Serializes this Photo to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of Photo
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$PhotoCopyWith get copyWith => throw _privateConstructorUsedError;
}
@@ -51,6 +55,8 @@ class _$PhotoCopyWithImpl<$Res, $Val extends Photo>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of Photo
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -96,6 +102,8 @@ class __$$PhotoImplCopyWithImpl<$Res>
_$PhotoImpl _value, $Res Function(_$PhotoImpl) _then)
: super(_value, _then);
+ /// Create a copy of Photo
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -155,11 +163,13 @@ class _$PhotoImpl implements _Photo {
(identical(other.path, path) || other.path == path));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, originalName, path);
- @JsonKey(ignore: true)
+ /// Create a copy of Photo
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PhotoImplCopyWith<_$PhotoImpl> get copyWith =>
@@ -188,8 +198,11 @@ abstract class _Photo implements Photo {
String get originalName;
@override
String get path;
+
+ /// Create a copy of Photo
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$PhotoImplCopyWith<_$PhotoImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/diary/models/portion.dart b/lib/features/diary/models/portion.dart
index 59ad837d..f829dcf9 100644
--- a/lib/features/diary/models/portion.dart
+++ b/lib/features/diary/models/portion.dart
@@ -1,6 +1,7 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'portion.freezed.dart';
+
part 'portion.g.dart';
@freezed
diff --git a/lib/features/diary/models/portion.freezed.dart b/lib/features/diary/models/portion.freezed.dart
index 77627c29..4bef02d4 100644
--- a/lib/features/diary/models/portion.freezed.dart
+++ b/lib/features/diary/models/portion.freezed.dart
@@ -26,8 +26,12 @@ mixin _$Portion {
String get portion => throw _privateConstructorUsedError;
bool get from_diet => throw _privateConstructorUsedError;
+ /// Serializes this Portion to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of Portion
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$PortionCopyWith get copyWith => throw _privateConstructorUsedError;
}
@@ -54,6 +58,8 @@ class _$PortionCopyWithImpl<$Res, $Val extends Portion>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of Portion
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -111,6 +117,8 @@ class __$$PortionImplCopyWithImpl<$Res>
_$PortionImpl _value, $Res Function(_$PortionImpl) _then)
: super(_value, _then);
+ /// Create a copy of Portion
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -189,12 +197,14 @@ class _$PortionImpl implements _Portion {
other.from_diet == from_diet));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, id, product_name, quantity, portion, from_diet);
- @JsonKey(ignore: true)
+ /// Create a copy of Portion
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PortionImplCopyWith<_$PortionImpl> get copyWith =>
@@ -228,8 +238,11 @@ abstract class _Portion implements Portion {
String get portion;
@override
bool get from_diet;
+
+ /// Create a copy of Portion
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$PortionImplCopyWith<_$PortionImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/diary/models/product.dart b/lib/features/diary/models/product.dart
index 050b97de..48b1de0e 100644
--- a/lib/features/diary/models/product.dart
+++ b/lib/features/diary/models/product.dart
@@ -1,6 +1,7 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'product.freezed.dart';
+
part 'product.g.dart';
@freezed
diff --git a/lib/features/diary/models/product.freezed.dart b/lib/features/diary/models/product.freezed.dart
index d30ada33..610656fb 100644
--- a/lib/features/diary/models/product.freezed.dart
+++ b/lib/features/diary/models/product.freezed.dart
@@ -23,8 +23,12 @@ mixin _$Product {
int get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
+ /// Serializes this Product to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of Product
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$ProductCopyWith get copyWith => throw _privateConstructorUsedError;
}
@@ -46,6 +50,8 @@ class _$ProductCopyWithImpl<$Res, $Val extends Product>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of Product
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -83,6 +89,8 @@ class __$$ProductImplCopyWithImpl<$Res>
_$ProductImpl _value, $Res Function(_$ProductImpl) _then)
: super(_value, _then);
+ /// Create a copy of Product
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -129,11 +137,13 @@ class _$ProductImpl implements _Product {
(identical(other.name, name) || other.name == name));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, name);
- @JsonKey(ignore: true)
+ /// Create a copy of Product
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ProductImplCopyWith<_$ProductImpl> get copyWith =>
@@ -157,8 +167,11 @@ abstract class _Product implements Product {
int get id;
@override
String get name;
+
+ /// Create a copy of Product
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$ProductImplCopyWith<_$ProductImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/diary/models/state.dart b/lib/features/diary/models/state.dart
index 874592ed..b1da05c4 100644
--- a/lib/features/diary/models/state.dart
+++ b/lib/features/diary/models/state.dart
@@ -1,6 +1,7 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'state.freezed.dart';
+
part 'state.g.dart';
@freezed
diff --git a/lib/features/diary/models/state.freezed.dart b/lib/features/diary/models/state.freezed.dart
index 599ec29f..6b9c50fb 100644
--- a/lib/features/diary/models/state.freezed.dart
+++ b/lib/features/diary/models/state.freezed.dart
@@ -23,8 +23,12 @@ mixin _$State {
bool get has_chosen_diet => throw _privateConstructorUsedError;
bool get has_chosen_plan => throw _privateConstructorUsedError;
+ /// Serializes this State to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
+
+ /// Create a copy of State
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
$StateCopyWith get copyWith => throw _privateConstructorUsedError;
}
@@ -46,6 +50,8 @@ class _$StateCopyWithImpl<$Res, $Val extends State>
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of State
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -83,6 +89,8 @@ class __$$StateImplCopyWithImpl<$Res>
_$StateImpl _value, $Res Function(_$StateImpl) _then)
: super(_value, _then);
+ /// Create a copy of State
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -132,12 +140,14 @@ class _$StateImpl implements _State {
other.has_chosen_plan == has_chosen_plan));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode =>
Object.hash(runtimeType, has_chosen_diet, has_chosen_plan);
- @JsonKey(ignore: true)
+ /// Create a copy of State
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$StateImplCopyWith<_$StateImpl> get copyWith =>
@@ -162,8 +172,11 @@ abstract class _State implements State {
bool get has_chosen_diet;
@override
bool get has_chosen_plan;
+
+ /// Create a copy of State
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$StateImplCopyWith<_$StateImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/diary/presentation/bloc/diary_bloc.dart b/lib/features/diary/presentation/bloc/diary_bloc.dart
index 747f9ee8..cee99a34 100644
--- a/lib/features/diary/presentation/bloc/diary_bloc.dart
+++ b/lib/features/diary/presentation/bloc/diary_bloc.dart
@@ -1,5 +1,6 @@
import 'dart:async';
+import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart';
import 'package:eatvio_app/features/diary/models/diary_model.dart';
import 'package:eatvio_app/features/diary/models/meal.dart';
import 'package:eatvio_app/features/diary/models/product.dart';
@@ -7,11 +8,10 @@ import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart';
import 'package:eatvio_app/features/diary/repositories/diary_repository.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart';
-import '/core/app_export.dart';
-
part 'diary_event.dart';
/// A bloc that manages the state of a Diary according to the event that is dispatched to it.
diff --git a/lib/features/diary/presentation/bloc/diary_event.dart b/lib/features/diary/presentation/bloc/diary_event.dart
index cfc1bedf..33c168d7 100644
--- a/lib/features/diary/presentation/bloc/diary_event.dart
+++ b/lib/features/diary/presentation/bloc/diary_event.dart
@@ -182,6 +182,7 @@ class RefreshEvent extends DiaryEvent {
class ConfirmPortion extends DiaryEvent {
ConfirmPortion(this.id);
+
int id;
@override
diff --git a/lib/features/diary/presentation/bloc/diary_state.freezed.dart b/lib/features/diary/presentation/bloc/diary_state.freezed.dart
index 5a9bbc12..98d7019f 100644
--- a/lib/features/diary/presentation/bloc/diary_state.freezed.dart
+++ b/lib/features/diary/presentation/bloc/diary_state.freezed.dart
@@ -174,6 +174,9 @@ class _$DiaryStateCopyWithImpl<$Res, $Val extends DiaryState>
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
+
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -190,6 +193,9 @@ class __$$DiaryStateImplCopyWithImpl<$Res>
__$$DiaryStateImplCopyWithImpl(
_$DiaryStateImpl _value, $Res Function(_$DiaryStateImpl) _then)
: super(_value, _then);
+
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
}
/// @nodoc
@@ -397,6 +403,8 @@ class __$$DiaryStateLoadingImplCopyWithImpl<$Res>
$Res Function(_$DiaryStateLoadingImpl) _then)
: super(_value, _then);
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -435,7 +443,9 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading {
@override
int get hashCode => Object.hash(runtimeType, id);
- @JsonKey(ignore: true)
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith =>
@@ -611,7 +621,10 @@ abstract class DiaryStateLoading implements DiaryState {
const factory DiaryStateLoading({final int? id}) = _$DiaryStateLoadingImpl;
int? get id;
- @JsonKey(ignore: true)
+
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -666,6 +679,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
$Res Function(_$DiaryStateLoadedImpl) _then)
: super(_value, _then);
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -819,6 +834,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
));
}
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$DiaryModelCopyWith<$Res> get diary {
@@ -827,6 +844,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
});
}
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$MealCopyWith<$Res> get currentMeal {
@@ -835,6 +854,8 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res>
});
}
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SelectionPopupModelCopyWith<$Res> get portionController {
@@ -1100,7 +1121,9 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded {
const DeepCollectionEquality().hash(_chartDataCounted)
]);
- @JsonKey(ignore: true)
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith =>
@@ -1420,7 +1443,10 @@ abstract class DiaryStateLoaded implements DiaryState {
bool get isLoading;
bool get isAdded;
List? get chartDataCounted;
- @JsonKey(ignore: true)
+
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -1442,6 +1468,8 @@ class __$$DiaryStateErrorImplCopyWithImpl<$Res>
_$DiaryStateErrorImpl _value, $Res Function(_$DiaryStateErrorImpl) _then)
: super(_value, _then);
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -1481,7 +1509,9 @@ class _$DiaryStateErrorImpl implements DiaryStateError {
@override
int get hashCode => Object.hash(runtimeType, errorMessage);
- @JsonKey(ignore: true)
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith =>
@@ -1658,7 +1688,10 @@ abstract class DiaryStateError implements DiaryState {
_$DiaryStateErrorImpl;
String get errorMessage;
- @JsonKey(ignore: true)
+
+ /// Create a copy of DiaryState
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
_$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith =>
throw _privateConstructorUsedError;
}
diff --git a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart
index 6c9f3a12..53b20dee 100644
--- a/lib/features/diary/presentation/pages/diary_recommendations_scree.dart
+++ b/lib/features/diary/presentation/pages/diary_recommendations_scree.dart
@@ -3,11 +3,10 @@
import 'package:eatvio_app/features/diary/models/portion.dart';
import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart';
import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart';
-import 'package:eatvio_app/core/app_export.dart';
-
import 'package:flutter/material.dart';
-import 'package:flutter/cupertino.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
+import 'package:rive/rive.dart';
// ignore: must_be_immutable
class DiaryRecommendationsScreen extends StatelessWidget {
@@ -29,7 +28,13 @@ class DiaryRecommendationsScreen extends StatelessWidget {
} else if (state is DiaryStateLoading) {
return Scaffold(
body: Center(
- child: CupertinoActivityIndicator(),
+ child: SizedBox(
+ height: 32,
+ width: 32,
+ child: RiveAnimation.asset(
+ 'assets/rive_animations/loading.riv',
+ ),
+ ),
),
);
} else if (state is DiaryStateError) {
@@ -74,7 +79,7 @@ class DiaryRecommendationsScreen extends StatelessWidget {
Expanded(
child: SingleChildScrollView(
child: Padding(
- padding: EdgeInsets.only(bottom: 5.v),
+ padding: EdgeInsets.only(bottom: 9),
child: Column(
children: [
Scaffold(
diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart
index d79b4aab..aaa06ad8 100644
--- a/lib/features/diary/presentation/pages/diary_screen.dart
+++ b/lib/features/diary/presentation/pages/diary_screen.dart
@@ -1,6 +1,6 @@
-// ignore_for_file: unused_local_variable
-
import 'package:carousel_slider_plus/carousel_slider_plus.dart';
+import 'package:eatvio_app/core/const.dart';
+import 'package:eatvio_app/data/models/selectionPopupModel/selection_popup_model.dart';
import 'package:eatvio_app/features/diary/models/diary_model.dart';
import 'package:eatvio_app/features/diary/models/meal.dart';
import 'package:eatvio_app/features/diary/models/photo.dart';
@@ -8,16 +8,19 @@ import 'package:eatvio_app/features/diary/models/portion.dart';
import 'package:eatvio_app/features/diary/models/product.dart';
import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart';
import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart';
-import 'package:eatvio_app/core/app_export.dart';
-import 'package:eatvio_app/widgets/custom_edit_text_form_field.dart';
-import 'package:eatvio_app/widgets/custom_edit_drop_down.dart';
+import 'package:eatvio_app/locator_service.dart';
+import 'package:eatvio_app/theme/app_decoration.dart';
+import 'package:eatvio_app/theme/custom_text_style.dart';
+import 'package:eatvio_app/theme/theme_helper.dart';
+import 'package:eatvio_app/widgets/custom_drop_down.dart';
import 'package:eatvio_app/widgets/custom_scale_element.dart';
-
+import 'package:eatvio_app/widgets/custom_text_form_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-import 'package:flutter/cupertino.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:image_picker/image_picker.dart';
+import 'package:rive/rive.dart' as rive;
import 'package:syncfusion_flutter_charts/charts.dart';
class DiaryScreen extends StatelessWidget {
@@ -32,35 +35,44 @@ class DiaryScreen extends StatelessWidget {
if (diaryID != "0") {
context.read().add(LoadDiaryById(diaryID));
}
- return BlocBuilder(
- builder: (context, state) {
- if (state is DiaryStateLoaded) {
- return _buildDiary(context, state);
- } else if (state is DiaryStateLoading) {
- return Scaffold(
- body: Center(
- child: CupertinoActivityIndicator(),
- ),
- );
- } else if (state is DiaryStateError) {
- return Scaffold(
- body: Padding(
- padding: const EdgeInsets.all(16),
- child: Center(
- child: Text(state.errorMessage),
+ return BlocProvider(
+ create: (context) => sl()..add(LoadDiary()),
+ child: BlocBuilder(
+ builder: (context, state) {
+ if (state is DiaryStateLoaded) {
+ return _buildDiary(context, state);
+ } else if (state is DiaryStateLoading) {
+ return Scaffold(
+ body: Center(
+ child: SizedBox(
+ height: 32,
+ width: 32,
+ child: rive.RiveAnimation.asset(
+ 'assets/rive_animations/loading.riv',
+ ),
+ ),
),
- ),
- );
- } else
- return Scaffold(
- body: Padding(
- padding: const EdgeInsets.all(16),
- child: Center(
- child: Text("Неопределенная ошибка"),
+ );
+ } else if (state is DiaryStateError) {
+ return Scaffold(
+ body: Padding(
+ padding: const EdgeInsets.all(16),
+ child: Center(
+ child: Text(state.errorMessage),
+ ),
),
- ),
- );
- },
+ );
+ } else
+ return Scaffold(
+ body: Padding(
+ padding: const EdgeInsets.all(16),
+ child: Center(
+ child: Text("Неопределенная ошибка"),
+ ),
+ ),
+ );
+ },
+ ),
);
}
@@ -85,19 +97,19 @@ class DiaryScreen extends StatelessWidget {
Expanded(
child: SingleChildScrollView(
child: Padding(
- padding: EdgeInsets.only(bottom: 5.v),
+ padding: EdgeInsets.only(bottom: 8),
child: Column(
children: [
_buildHeaderRow(context, state),
- SizedBox(height: 8.v),
+ SizedBox(height: 8),
_buildWakupRetire(context, state),
- SizedBox(height: 8.v),
+ SizedBox(height: 8),
_buildMeal(context, state),
- SizedBox(height: 8.v),
+ SizedBox(height: 8),
_buildMood(context, state),
- SizedBox(height: 8.v),
+ SizedBox(height: 8),
_buildNutritionChart(context, state),
- SizedBox(height: 8.v),
+ SizedBox(height: 8),
// _buildComment(context, state),
// SizedBox(height: 8.v),
_buildEndDay(context),
@@ -119,8 +131,8 @@ class DiaryScreen extends StatelessWidget {
_buildNutritionChart(BuildContext context, DiaryStateLoaded state) {
return Container(
padding: EdgeInsets.symmetric(
- horizontal: 24.h,
- vertical: 12.v,
+ horizontal: 24,
+ vertical: 12,
),
decoration: BoxDecoration(
color: Colors.white,
@@ -177,13 +189,13 @@ class DiaryScreen extends StatelessWidget {
children: [
Text(
'${state.chartData['dailyNutritionIntake']['carbohydrates'].toStringAsFixed(1)} из ${state.chartData['dailyNutritionRecommendation']['carbohydrates'].toStringAsFixed(1)} грамм'),
- SizedBox(height: 8.v),
+ SizedBox(height: 8),
Text(
'${state.chartData['dailyNutritionIntake']['fats'].toStringAsFixed(1)} из ${state.chartData['dailyNutritionRecommendation']['fats'].toStringAsFixed(1)} грамм'),
- SizedBox(height: 8.v),
+ SizedBox(height: 8),
Text(
'${state.chartData['dailyNutritionIntake']['proteins'].toStringAsFixed(1)} из ${state.chartData['dailyNutritionRecommendation']['proteins'].toStringAsFixed(1)} грамм'),
- SizedBox(height: 8.v),
+ SizedBox(height: 8),
Text(
'${state.chartData['dailyNutritionIntake']['energy'].toStringAsFixed(1)} из ${state.chartData['dailyNutritionRecommendation']['energy'].toStringAsFixed(1)} Ккал'),
],
@@ -229,8 +241,8 @@ class DiaryScreen extends StatelessWidget {
final day = state.diary.id;
return Container(
padding: EdgeInsets.symmetric(
- horizontal: 24.h,
- vertical: 12.v,
+ horizontal: 24,
+ vertical: 12,
),
decoration: BoxDecoration(
color: Colors.white,
@@ -240,7 +252,7 @@ class DiaryScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
- padding: EdgeInsets.only(top: 1.v),
+ padding: EdgeInsets.only(top: 4),
child: Column(
children: [
Align(
@@ -296,10 +308,10 @@ class DiaryScreen extends StatelessWidget {
children: [
if (!isLoading)
Container(
- margin: EdgeInsets.symmetric(horizontal: 10.h),
+ margin: EdgeInsets.symmetric(horizontal: 12),
padding: EdgeInsets.symmetric(
- horizontal: 40.h,
- vertical: 80.v,
+ horizontal: 32,
+ vertical: 64,
),
decoration: AppDecoration.fillGray.copyWith(
borderRadius: BorderRadiusStyle.roundedBorder5,
@@ -310,8 +322,8 @@ class DiaryScreen extends StatelessWidget {
children: [
Padding(
padding: EdgeInsets.only(
- left: 7.h,
- top: 5.v,
+ left: 8,
+ top: 8,
),
child: Text(
"Добавить фото",
@@ -328,16 +340,22 @@ class DiaryScreen extends StatelessWidget {
),
if (isLoading)
Container(
- margin: EdgeInsets.symmetric(horizontal: 10.h),
+ margin: EdgeInsets.symmetric(horizontal: 12),
padding: EdgeInsets.symmetric(
- horizontal: 40.h,
- vertical: 80.v,
+ horizontal: 32,
+ vertical: 64,
),
decoration: AppDecoration.fillGray.copyWith(
borderRadius: BorderRadiusStyle.roundedBorder5,
),
child: Center(
- child: CircularProgressIndicator(color: appTheme.blueGray300), // Замените на свой прелоадер при необходимости
+ child: SizedBox(
+ height: 32,
+ width: 32,
+ child: rive.RiveAnimation.asset(
+ 'assets/rive_animations/loading.riv',
+ ),
+ ),
),
),
],
@@ -364,11 +382,10 @@ class DiaryScreen extends StatelessWidget {
_buildMeal(BuildContext context, DiaryStateLoaded state) {
final digitsOnly = FilteringTextInputFormatter.digitsOnly;
List _options = state.autocompleteList.map((Product item) => item.name).toList();
- FocusNode focusNodeName = FocusNode();
return Container(
padding: EdgeInsets.symmetric(
- horizontal: 24.h,
- vertical: 12.v,
+ horizontal: 24,
+ vertical: 12,
),
decoration: BoxDecoration(
color: Colors.white,
@@ -378,7 +395,7 @@ class DiaryScreen extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
Padding(
- padding: EdgeInsets.symmetric(horizontal: 10.h),
+ padding: EdgeInsets.symmetric(horizontal: 12),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@@ -389,7 +406,7 @@ class DiaryScreen extends StatelessWidget {
Expanded(
// Adding Expanded widget
child: Padding(
- padding: EdgeInsets.symmetric(horizontal: 10.h),
+ padding: EdgeInsets.symmetric(horizontal: 12),
child: ConstrainedBox(
constraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width - 260,
@@ -409,9 +426,9 @@ class DiaryScreen extends StatelessWidget {
],
),
),
- SizedBox(height: 20.v),
+ SizedBox(height: 24),
Padding(
- padding: EdgeInsets.symmetric(horizontal: 10.h),
+ padding: EdgeInsets.symmetric(horizontal: 12),
child: BlocSelector(
selector: (state) {
if (state is DiaryStateLoaded)
@@ -423,18 +440,18 @@ class DiaryScreen extends StatelessWidget {
return CustomDropDown(
items: state.mealList,
contentPadding: EdgeInsets.symmetric(
- horizontal: 10.h,
- vertical: 9.v,
+ horizontal: 12,
+ vertical: 12,
),
- defaultValue: state.mealList[0],
+ // defaultValue: state.mealList[0],
onChanged: changeMeal(context, state),
);
},
),
),
- SizedBox(height: 20.v),
+ SizedBox(height: 24),
Padding(
- padding: EdgeInsets.symmetric(horizontal: 10.h),
+ padding: EdgeInsets.symmetric(horizontal: 12),
child: RawAutocomplete(
optionsBuilder: buildOptions(_options),
fieldViewBuilder: (
@@ -483,25 +500,25 @@ class DiaryScreen extends StatelessWidget {
},
),
),
- SizedBox(height: 20.v),
+ SizedBox(height: 24),
if (state.moderationExpanded)
Padding(
- padding: EdgeInsets.symmetric(horizontal: 10.h),
+ padding: EdgeInsets.symmetric(horizontal: 12),
child: GestureDetector(
onTap: () => openCaloriesDialog(context, state),
child: Text("Отправить на модерацию"),
),
),
- SizedBox(height: 20.v),
+ SizedBox(height: 24),
Padding(
- padding: EdgeInsets.symmetric(horizontal: 10.h),
+ padding: EdgeInsets.symmetric(horizontal: 12),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CustomTextFormField(
- width: 150.h,
+ width: 128,
hintText: "Кол-во",
textInputAction: TextInputAction.done,
// focusNode: focusNodeQuantity,
@@ -510,7 +527,7 @@ class DiaryScreen extends StatelessWidget {
inputFormatters: [digitsOnly],
),
Padding(
- padding: EdgeInsets.only(left: 30.h),
+ padding: EdgeInsets.only(left: 32),
child: BlocSelector(
selector: (state) {
if (state is DiaryStateLoaded) {
@@ -521,7 +538,7 @@ class DiaryScreen extends StatelessWidget {
builder: (context, diary) {
return CustomDropDown(
items: state.portionList,
- defaultValue: state.portionController,
+ // defaultValue: state.portionController,
onChanged: changePortion(context, state),
);
},
@@ -531,21 +548,21 @@ class DiaryScreen extends StatelessWidget {
),
),
),
- SizedBox(height: 24.v),
+ SizedBox(height: 24),
_buildAddProduct(context, state),
- SizedBox(height: 24.v),
+ SizedBox(height: 24),
if (!state.diary.state.has_chosen_diet) ...state.portions.map((portion) => _buildProduct(context, portion)).toList(),
if (state.diary.state.has_chosen_diet) ...state.portions.map((portion) => _buildProductDiet(context, portion)).toList(),
- SizedBox(height: 24.v),
+ SizedBox(height: 24),
_buildCarousel(context, state),
- SizedBox(height: 24.v),
+ SizedBox(height: 24),
_buildAddPhoto(context, state),
- SizedBox(height: 24.v),
+ SizedBox(height: 24),
Text(
"Ваша сытость после приёма пищи",
style: CustomTextStyles.bodyMediumBlack900,
),
- SizedBox(height: 15.v),
+ SizedBox(height: 16),
BlocBuilder(
builder: (context, state) {
if (state is DiaryStateLoaded) {
@@ -610,25 +627,25 @@ class DiaryScreen extends StatelessWidget {
hintText: "Название",
controller: state.product_nameController,
),
- SizedBox(height: 10.v),
+ SizedBox(height: 12),
CustomTextFormField(
hintText: "Энергетическая ценность на 100",
keyboardType: TextInputType.number,
controller: state.caloriesController,
),
- SizedBox(height: 10.v),
+ SizedBox(height: 12),
CustomTextFormField(
hintText: "Белки на 100г",
keyboardType: TextInputType.number,
controller: state.proteinsController,
),
- SizedBox(height: 10.v),
+ SizedBox(height: 12),
CustomTextFormField(
hintText: "Жиры на 100г",
keyboardType: TextInputType.number,
controller: state.fatsController,
),
- SizedBox(height: 10.v),
+ SizedBox(height: 12),
CustomTextFormField(
hintText: "Углеводы на 100г",
keyboardType: TextInputType.number,
@@ -744,10 +761,10 @@ class DiaryScreen extends StatelessWidget {
_buildProduct(BuildContext context, Portion portion) {
return Container(
- margin: EdgeInsets.symmetric(horizontal: 10.h),
+ margin: EdgeInsets.symmetric(horizontal: 12),
padding: EdgeInsets.symmetric(
- horizontal: 8.h,
- vertical: 6.v,
+ horizontal: 8,
+ vertical: 8,
),
decoration: AppDecoration.fillGray.copyWith(
borderRadius: BorderRadiusStyle.roundedBorder5,
@@ -758,8 +775,8 @@ class DiaryScreen extends StatelessWidget {
children: [
Padding(
padding: EdgeInsets.only(
- left: 7.h,
- top: 5.v,
+ left: 8,
+ top: 8,
),
child: Text(
portion.product_name.length > 8 ? portion.product_name.substring(0, 8) : portion.product_name,
@@ -768,12 +785,12 @@ class DiaryScreen extends StatelessWidget {
),
Padding(
padding: EdgeInsets.only(
- left: 20.h,
- top: 3.v,
- bottom: 3.v,
+ left: 24,
+ top: 4,
+ bottom: 4,
),
child: Text(
- portion.quantity.toString() + ' ' + portion.portion.toString().tr,
+ portion.quantity.toString() + ' ' + portion.portion.toString(),
),
),
Spacer(),
@@ -795,12 +812,12 @@ class DiaryScreen extends StatelessWidget {
_buildProductDiet(BuildContext context, Portion portion) {
return Container(
margin: EdgeInsets.symmetric(
- horizontal: 10.h,
- vertical: 4.h,
+ horizontal: 12,
+ vertical: 4,
),
padding: EdgeInsets.symmetric(
- horizontal: 8.h,
- vertical: 6.v,
+ horizontal: 8,
+ vertical: 8,
),
decoration: AppDecoration.fillGray.copyWith(
borderRadius: BorderRadiusStyle.roundedBorder5,
@@ -815,8 +832,8 @@ class DiaryScreen extends StatelessWidget {
),
Padding(
padding: EdgeInsets.only(
- left: 7.h,
- top: 5.v,
+ left: 8,
+ top: 8,
),
child: Text(
portion.product_name.length > 18 ? portion.product_name.substring(0, 18) : portion.product_name,
@@ -826,12 +843,12 @@ class DiaryScreen extends StatelessWidget {
Spacer(),
Padding(
padding: EdgeInsets.only(
- left: 20.h,
- top: 3.v,
- bottom: 3.v,
+ left: 24,
+ top: 4,
+ bottom: 4,
),
child: Text(
- portion.quantity.toString() + ' ' + portion.portion.toString().tr,
+ portion.quantity.toString() + ' ' + portion.portion.toString(),
),
),
],
@@ -843,7 +860,7 @@ class DiaryScreen extends StatelessWidget {
return Stack(
children: [
Container(
- margin: EdgeInsets.symmetric(horizontal: 10.h, vertical: 10.h),
+ margin: EdgeInsets.symmetric(horizontal: 12, vertical: 12),
decoration: AppDecoration.fillGray.copyWith(
borderRadius: BorderRadiusStyle.roundedBorder5,
),
@@ -857,7 +874,7 @@ class DiaryScreen extends StatelessWidget {
left: 0,
right: 0,
child: Container(
- height: 50.h, // Высота затемненной области
+ height: 64, // Высота затемненной области
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
@@ -939,8 +956,8 @@ class DiaryScreen extends StatelessWidget {
_buildWakupRetire(BuildContext context, DiaryStateLoaded state) {
return Container(
padding: EdgeInsets.symmetric(
- horizontal: 24.h,
- vertical: 12.v,
+ horizontal: 24,
+ vertical: 12,
),
decoration: BoxDecoration(
color: Colors.white,
@@ -966,7 +983,7 @@ class DiaryScreen extends StatelessWidget {
padding: const EdgeInsets.only(left: 16.0),
child: Column(
children: [
- SizedBox(height: 20.v),
+ SizedBox(height: 24),
GestureDetector(
onTap: () => _selectWakeupTime(context, state),
child: AbsorbPointer(
@@ -977,7 +994,7 @@ class DiaryScreen extends StatelessWidget {
),
),
),
- SizedBox(height: 20.v),
+ SizedBox(height: 24),
GestureDetector(
onTap: () => _selectRetireTime(context, state),
child: AbsorbPointer(
@@ -988,7 +1005,7 @@ class DiaryScreen extends StatelessWidget {
),
),
),
- SizedBox(height: 20.v),
+ SizedBox(height: 24),
],
),
),
@@ -1045,8 +1062,8 @@ class DiaryScreen extends StatelessWidget {
_buildMood(BuildContext context, DiaryStateLoaded state) {
return Container(
padding: EdgeInsets.symmetric(
- horizontal: 24.h,
- vertical: 12.v,
+ horizontal: 24,
+ vertical: 12,
),
decoration: BoxDecoration(
color: Colors.white,
diff --git a/lib/features/diets/presentation/pages/about_diet_screen.dart b/lib/features/diets/presentation/pages/about_diet_screen.dart
index 42aa3bf4..7dd66a37 100644
--- a/lib/features/diets/presentation/pages/about_diet_screen.dart
+++ b/lib/features/diets/presentation/pages/about_diet_screen.dart
@@ -1,22 +1,25 @@
import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
-import 'package:eatvio_app/core/app_export.dart';
-import 'package:eatvio_app/features/feed/models/comment_model.dart';
-import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart' as Diets;
+import 'package:eatvio_app/core/const.dart';
+import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart';
import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_state.dart';
+import 'package:eatvio_app/features/feed/presentation/widgets/comments_widget.dart';
import 'package:eatvio_app/locator_service.dart';
-import 'package:flutter/cupertino.dart';
+import 'package:eatvio_app/theme/theme_helper.dart';
import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:flutter_html/flutter_html.dart';
import 'package:go_router/go_router.dart';
+import 'package:rive/rive.dart';
class AboutDietScreen extends StatefulWidget {
- final Diets.Datum datum;
+ final Diet diet;
late final List selectedIndexes;
- AboutDietScreen({super.key, required this.datum}) {
- selectedIndexes = List.generate(datum.dailySchedule.length, (_) => 0);
+ AboutDietScreen({super.key, required this.diet}) {
+ selectedIndexes = List.generate(diet.dailySchedule.length, (_) => 0);
}
@override
@@ -28,17 +31,23 @@ class _AboutDietScreenState extends State {
int? replyId;
final textEditingController = TextEditingController();
- @override
- void initState() {
- super.initState();
- commentsCubit.getDietsComments(widget.datum.id);
- }
-
@override
Widget build(BuildContext context) {
return BlocProvider(
- create: (BuildContext context) => commentsCubit,
- child: BlocBuilder(
+ create: (BuildContext context) => commentsCubit
+ ..getComments(
+ widget.diet.id.toString(),
+ CommentSourceType.diet,
+ true,
+ ),
+ child: BlocConsumer(
+ listener: (BuildContext context, CommentsState state) {
+ if (state is CommentsStateLoaded) {
+ setState(() {
+ replyId = state.replyId;
+ });
+ }
+ },
builder: (BuildContext context, CommentsState state) {
return Scaffold(
resizeToAvoidBottomInset: true,
@@ -80,6 +89,7 @@ class _AboutDietScreenState extends State {
if (replyId != null)
GestureDetector(
onTap: () {
+ context.read().setReplyId(null);
setState(() {
replyId = null;
textEditingController.clear();
@@ -156,11 +166,13 @@ class _AboutDietScreenState extends State {
GestureDetector(
onTap: () {
if (textEditingController.text.length > 2) {
- commentsCubit.sendDietsComment(
- id: widget.datum.id,
+ commentsCubit.sendComment(
+ id: widget.diet.id.toString(),
commentText: textEditingController.text,
parentCommentId: replyId,
+ commentSourceType: CommentSourceType.diet,
);
+ context.read().setReplyId(null);
setState(() {
textEditingController.clear();
replyId = null;
@@ -187,30 +199,11 @@ class _AboutDietScreenState extends State {
],
),
),
- // floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
- // floatingActionButton: SizedBox(
- // width: MediaQuery.of(context).size.width - 32,
- // child: FloatingActionButton.extended(
- // heroTag: 'nextButtonRegistration',
- // highlightElevation: 0,
- // elevation: 0,
- // focusElevation: 0,
- // shape: RoundedRectangleBorder(
- // borderRadius: BorderRadius.circular(16),
- // ),
- // backgroundColor: appTheme.greenA700,
- // onPressed: () {},
- // label: Text(
- // 'Начать диету',
- // style: theme.textTheme.titleSmall,
- // ),
- // ),
- // ),
appBar: AppBar(
actions: [
InkWell(
borderRadius: BorderRadius.circular(16),
- onTap: () => GoRouter.of(context).pushNamed('profileScreen', extra: widget.datum.author),
+ onTap: () => GoRouter.of(context).pushNamed('profileScreen', extra: widget.diet.author),
child: Ink(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
@@ -219,11 +212,11 @@ class _AboutDietScreenState extends State {
CircleAvatar(
maxRadius: 16,
minRadius: 16,
- backgroundImage: NetworkImage(widget.datum.author.authorProfileIcon),
+ backgroundImage: NetworkImage(widget.diet.author.authorProfileIcon),
),
SizedBox(height: 4),
Text(
- widget.datum.author.authorName,
+ widget.diet.author.authorName,
style: TextStyle(
color: Colors.black,
fontSize: 14,
@@ -245,7 +238,7 @@ class _AboutDietScreenState extends State {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
- widget.datum.name,
+ widget.diet.name,
style: TextStyle(
color: Colors.black,
fontSize: 24,
@@ -262,7 +255,7 @@ class _AboutDietScreenState extends State {
Icon(Icons.timer_outlined),
SizedBox(width: 4),
Text(
- widget.datum.duration.toString() + ' дней',
+ widget.diet.duration.toString() + ' дней',
style: TextStyle(
color: Colors.black,
fontSize: 12,
@@ -273,22 +266,21 @@ class _AboutDietScreenState extends State {
],
),
),
- SizedBox(height: 12),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Text(
- widget.datum.details,
- style: TextStyle(
- color: Colors.black,
- fontSize: 14,
- fontWeight: FontWeight.w400,
- height: 1.2,
+ if (widget.diet.details.isNotEmpty)
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 8),
+ child: Html(
+ data: widget.diet.details,
+ style: {
+ "*": Style(
+ color: Colors.black87,
+ ),
+ },
),
),
- ),
SizedBox(height: 12),
CachedNetworkImage(
- imageUrl: baseUrl + '/storage/' + widget.datum.image,
+ imageUrl: baseUrl + '/storage/' + widget.diet.image,
),
SizedBox(height: 12),
ListView.separated(
@@ -296,7 +288,7 @@ class _AboutDietScreenState extends State {
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
- return _dayOfPlan(widget.datum.dailySchedule[index], index);
+ return _dayOfPlan(widget.diet.dailySchedule[index], index);
},
separatorBuilder: (context, index) => Padding(
padding: const EdgeInsets.symmetric(vertical: 16),
@@ -308,14 +300,25 @@ class _AboutDietScreenState extends State {
),
),
),
- itemCount: widget.datum.dailySchedule.length,
+ itemCount: widget.diet.dailySchedule.length,
),
SizedBox(height: 32),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Container(
+ height: 0.4,
+ decoration: BoxDecoration(
+ color: Colors.grey,
+ borderRadius: BorderRadius.circular(16),
+ ),
+ ),
+ ),
+ SizedBox(height: 8),
Container(
padding: EdgeInsets.symmetric(horizontal: 16),
alignment: Alignment.centerLeft,
child: Text(
- widget.datum.totalComments.toString() + ' КОММЕНТАРИЕВ',
+ widget.diet.totalComments.toString() + ' КОММЕНТАРИЕВ',
style: TextStyle(
fontSize: 12,
color: appTheme.gray500,
@@ -327,9 +330,21 @@ class _AboutDietScreenState extends State {
if (state is CommentsStateLoading)
Padding(
padding: const EdgeInsets.all(32),
- child: CupertinoActivityIndicator(),
+ child: SizedBox(
+ height: 32,
+ width: 32,
+ child: RiveAnimation.asset(
+ 'assets/rive_animations/loading.riv',
+ ),
+ ),
+ ),
+ if (state is CommentsStateLoaded)
+ CommentsWidget(
+ id: widget.diet.id.toString(),
+ commentSourceType: CommentSourceType.diet,
+ comment: state.comment,
+ replyId: replyId,
),
- if (state is CommentsStateLoaded) _buildComments(state.comment),
],
),
),
@@ -339,7 +354,7 @@ class _AboutDietScreenState extends State {
);
}
- _dayOfPlan(List> day, int dayNumber) {
+ _dayOfPlan(List> day, int dayNumber) {
_choiceChipWidget(int index) {
return ChoiceChip(
selectedColor: appTheme.blueA400,
@@ -410,7 +425,7 @@ class _AboutDietScreenState extends State {
);
}
- _daily(Diets.DailySchedule daily) {
+ _daily(DailySchedule daily) {
return Row(
children: [
Text(
@@ -435,101 +450,4 @@ class _AboutDietScreenState extends State {
],
);
}
-
- _buildComments(Comment comment) {
- return Column(
- children: [
- for (int i = 0; i < comment.data.length; i++) ...[
- _comment(comment.data[i]),
- if (comment.data[i].childrenComments.isNotEmpty)
- for (int j = 0; j < comment.data[i].childrenComments.length; j++)
- Padding(
- padding: EdgeInsets.only(left: 40),
- child: _comment(
- comment.data[i].childrenComments[j],
- 12,
- ),
- ),
- SizedBox(height: 8),
- ],
- ],
- );
- }
-
- _comment(Datum datum, [double radius = 16]) {
- return Container(
- width: MediaQuery.of(context).size.width,
- decoration: BoxDecoration(
- color: replyId == datum.id ? appTheme.blueA400.withOpacity(0.1) : Colors.white,
- borderRadius: BorderRadius.circular(16),
- ),
- child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- CircleAvatar(
- foregroundImage: NetworkImage(datum.authorProfileIcon),
- radius: radius,
- ),
- SizedBox(width: 8),
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.start,
- children: [
- Text(
- datum.authorName,
- style: TextStyle(
- height: 1,
- color: Colors.grey.shade600,
- fontWeight: FontWeight.w500,
- ),
- ),
- SizedBox(width: 4),
- Text(
- datum.body,
- style: TextStyle(
- height: 1,
- color: Colors.black,
- ),
- ),
- SizedBox(height: 4),
- Row(
- children: [
- Text(
- '99 августа',
- // datum.createdAt.format('dd MMMM', 'ru'),
- style: TextStyle(
- color: Colors.grey.shade600,
- fontSize: 12,
- fontWeight: FontWeight.w400,
- height: 1,
- ),
- ),
- SizedBox(width: 16),
- GestureDetector(
- onTap: () {
- setState(() {
- replyId = datum.id;
- });
- },
- child: Text(
- 'Ответить',
- style: TextStyle(
- height: 1,
- fontSize: 12,
- color: Colors.grey.shade800,
- fontWeight: FontWeight.w500,
- ),
- ),
- ),
- ],
- ),
- ],
- ),
- ],
- ),
- ),
- );
- }
}
diff --git a/lib/features/feed/models/comment_model.dart b/lib/features/feed/models/comment_model.dart
index 4c8aa268..1fbcb145 100644
--- a/lib/features/feed/models/comment_model.dart
+++ b/lib/features/feed/models/comment_model.dart
@@ -1,67 +1,30 @@
+import 'package:eatvio_app/core/models/pagination_model.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'comment_model.freezed.dart';
part 'comment_model.g.dart';
@freezed
-class Comment with _$Comment {
- const factory Comment({
- @JsonKey(name: "data") required List data,
+class CommentModel with _$CommentModel {
+ const factory CommentModel({
+ @JsonKey(name: "data") required List data,
@JsonKey(name: "links") required Links links,
@JsonKey(name: "meta") required Meta meta,
- }) = _Comment;
+ }) = _CommentModel;
- factory Comment.fromJson(Map json) => _$CommentFromJson(json);
+ factory CommentModel.fromJson(Map json) => _$CommentModelFromJson(json);
}
@freezed
-class Datum with _$Datum {
- const factory Datum({
+class Comment with _$Comment {
+ const factory Comment({
@JsonKey(name: "id") required int id,
@JsonKey(name: "author_name") required String authorName,
@JsonKey(name: "author_profile_icon") required String authorProfileIcon,
@JsonKey(name: "body") required String body,
- @JsonKey(name: "children_comments") required List childrenComments,
- }) = _Datum;
+ @JsonKey(name: "children_comments") required List childrenComments,
+ @JsonKey(name: "created_at") required DateTime createdAt,
+ }) = _Comment;
- factory Datum.fromJson(Map json) => _$DatumFromJson(json);
-}
-
-@freezed
-class Links with _$Links {
- const factory Links({
- @JsonKey(name: "first") required String first,
- @JsonKey(name: "last") required String last,
- @JsonKey(name: "prev") required dynamic prev,
- @JsonKey(name: "next") required dynamic next,
- }) = _Links;
-
- factory Links.fromJson(Map json) => _$LinksFromJson(json);
-}
-
-@freezed
-class Meta with _$Meta {
- const factory Meta({
- @JsonKey(name: "current_page") required int currentPage,
- @JsonKey(name: "from") required int from,
- @JsonKey(name: "last_page") required int lastPage,
- @JsonKey(name: "links") required List links,
- @JsonKey(name: "path") required String path,
- @JsonKey(name: "per_page") required int perPage,
- @JsonKey(name: "to") required int to,
- @JsonKey(name: "total") required int total,
- }) = _Meta;
-
- factory Meta.fromJson(Map json) => _$MetaFromJson(json);
-}
-
-@freezed
-class Link with _$Link {
- const factory Link({
- @JsonKey(name: "url") required String? url,
- @JsonKey(name: "label") required String label,
- @JsonKey(name: "active") required bool active,
- }) = _Link;
-
- factory Link.fromJson(Map json) => _$LinkFromJson(json);
+ factory Comment.fromJson(Map json) => _$CommentFromJson(json);
}
diff --git a/lib/features/feed/models/comment_model.freezed.dart b/lib/features/feed/models/comment_model.freezed.dart
index 3f088135..4e520131 100644
--- a/lib/features/feed/models/comment_model.freezed.dart
+++ b/lib/features/feed/models/comment_model.freezed.dart
@@ -14,31 +14,37 @@ T _$identity(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
-Comment _$CommentFromJson(Map json) {
- return _Comment.fromJson(json);
+CommentModel _$CommentModelFromJson(Map json) {
+ return _CommentModel.fromJson(json);
}
/// @nodoc
-mixin _$Comment {
+mixin _$CommentModel {
@JsonKey(name: "data")
- List get data => throw _privateConstructorUsedError;
+ List get data => throw _privateConstructorUsedError;
@JsonKey(name: "links")
Links get links => throw _privateConstructorUsedError;
@JsonKey(name: "meta")
Meta get meta => throw _privateConstructorUsedError;
+ /// Serializes this CommentModel to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
- $CommentCopyWith get copyWith => throw _privateConstructorUsedError;
+
+ /// Create a copy of CommentModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ $CommentModelCopyWith get copyWith =>
+ throw _privateConstructorUsedError;
}
/// @nodoc
-abstract class $CommentCopyWith<$Res> {
- factory $CommentCopyWith(Comment value, $Res Function(Comment) then) =
- _$CommentCopyWithImpl<$Res, Comment>;
+abstract class $CommentModelCopyWith<$Res> {
+ factory $CommentModelCopyWith(
+ CommentModel value, $Res Function(CommentModel) then) =
+ _$CommentModelCopyWithImpl<$Res, CommentModel>;
@useResult
$Res call(
- {@JsonKey(name: "data") List data,
+ {@JsonKey(name: "data") List data,
@JsonKey(name: "links") Links links,
@JsonKey(name: "meta") Meta meta});
@@ -47,15 +53,17 @@ abstract class $CommentCopyWith<$Res> {
}
/// @nodoc
-class _$CommentCopyWithImpl<$Res, $Val extends Comment>
- implements $CommentCopyWith<$Res> {
- _$CommentCopyWithImpl(this._value, this._then);
+class _$CommentModelCopyWithImpl<$Res, $Val extends CommentModel>
+ implements $CommentModelCopyWith<$Res> {
+ _$CommentModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of CommentModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -67,7 +75,7 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment>
data: null == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
- as List,
+ as List,
links: null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
@@ -79,6 +87,8 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment>
) as $Val);
}
+ /// Create a copy of CommentModel
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$LinksCopyWith<$Res> get links {
@@ -87,6 +97,8 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment>
});
}
+ /// Create a copy of CommentModel
+ /// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$MetaCopyWith<$Res> get meta {
@@ -97,14 +109,15 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment>
}
/// @nodoc
-abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> {
- factory _$$CommentImplCopyWith(
- _$CommentImpl value, $Res Function(_$CommentImpl) then) =
- __$$CommentImplCopyWithImpl<$Res>;
+abstract class _$$CommentModelImplCopyWith<$Res>
+ implements $CommentModelCopyWith<$Res> {
+ factory _$$CommentModelImplCopyWith(
+ _$CommentModelImpl value, $Res Function(_$CommentModelImpl) then) =
+ __$$CommentModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
- {@JsonKey(name: "data") List data,
+ {@JsonKey(name: "data") List data,
@JsonKey(name: "links") Links links,
@JsonKey(name: "meta") Meta meta});
@@ -115,13 +128,15 @@ abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> {
}
/// @nodoc
-class __$$CommentImplCopyWithImpl<$Res>
- extends _$CommentCopyWithImpl<$Res, _$CommentImpl>
- implements _$$CommentImplCopyWith<$Res> {
- __$$CommentImplCopyWithImpl(
- _$CommentImpl _value, $Res Function(_$CommentImpl) _then)
+class __$$CommentModelImplCopyWithImpl<$Res>
+ extends _$CommentModelCopyWithImpl<$Res, _$CommentModelImpl>
+ implements _$$CommentModelImplCopyWith<$Res> {
+ __$$CommentModelImplCopyWithImpl(
+ _$CommentModelImpl _value, $Res Function(_$CommentModelImpl) _then)
: super(_value, _then);
+ /// Create a copy of CommentModel
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -129,11 +144,11 @@ class __$$CommentImplCopyWithImpl<$Res>
Object? links = null,
Object? meta = null,
}) {
- return _then(_$CommentImpl(
+ return _then(_$CommentModelImpl(
data: null == data
? _value._data
: data // ignore: cast_nullable_to_non_nullable
- as List,
+ as List,
links: null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
@@ -148,20 +163,20 @@ class __$$CommentImplCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
-class _$CommentImpl implements _Comment {
- const _$CommentImpl(
- {@JsonKey(name: "data") required final List data,
+class _$CommentModelImpl implements _CommentModel {
+ const _$CommentModelImpl(
+ {@JsonKey(name: "data") required final List data,
@JsonKey(name: "links") required this.links,
@JsonKey(name: "meta") required this.meta})
: _data = data;
- factory _$CommentImpl.fromJson(Map json) =>
- _$$CommentImplFromJson(json);
+ factory _$CommentModelImpl.fromJson(Map json) =>
+ _$$CommentModelImplFromJson(json);
- final List _data;
+ final List _data;
@override
@JsonKey(name: "data")
- List get data {
+ List get data {
if (_data is EqualUnmodifiableListView) return _data;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_data);
@@ -176,67 +191,73 @@ class _$CommentImpl implements _Comment {
@override
String toString() {
- return 'Comment(data: $data, links: $links, meta: $meta)';
+ return 'CommentModel(data: $data, links: $links, meta: $meta)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
- other is _$CommentImpl &&
+ other is _$CommentModelImpl &&
const DeepCollectionEquality().equals(other._data, _data) &&
(identical(other.links, links) || other.links == links) &&
(identical(other.meta, meta) || other.meta == meta));
}
- @JsonKey(ignore: true)
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, const DeepCollectionEquality().hash(_data), links, meta);
- @JsonKey(ignore: true)
+ /// Create a copy of CommentModel
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
- _$$CommentImplCopyWith<_$CommentImpl> get copyWith =>
- __$$CommentImplCopyWithImpl<_$CommentImpl>(this, _$identity);
+ _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith =>
+ __$$CommentModelImplCopyWithImpl<_$CommentModelImpl>(this, _$identity);
@override
Map toJson() {
- return _$$CommentImplToJson(
+ return _$$CommentModelImplToJson(
this,
);
}
}
-abstract class _Comment implements Comment {
- const factory _Comment(
- {@JsonKey(name: "data") required final List data,
+abstract class _CommentModel implements CommentModel {
+ const factory _CommentModel(
+ {@JsonKey(name: "data") required final List data,
@JsonKey(name: "links") required final Links links,
- @JsonKey(name: "meta") required final Meta meta}) = _$CommentImpl;
+ @JsonKey(name: "meta") required final Meta meta}) = _$CommentModelImpl;
- factory _Comment.fromJson(Map json) = _$CommentImpl.fromJson;
+ factory _CommentModel.fromJson(Map json) =
+ _$CommentModelImpl.fromJson;
@override
@JsonKey(name: "data")
- List get data;
+ List get data;
@override
@JsonKey(name: "links")
Links get links;
@override
@JsonKey(name: "meta")
Meta get meta;
+
+ /// Create a copy of CommentModel
+ /// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(ignore: true)
- _$$CommentImplCopyWith<_$CommentImpl> get copyWith =>
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ _$$CommentModelImplCopyWith<_$CommentModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
-Datum _$DatumFromJson(Map json) {
- return _Datum.fromJson(json);
+Comment _$CommentFromJson(Map json) {
+ return _Comment.fromJson(json);
}
/// @nodoc
-mixin _$Datum {
+mixin _$Comment {
@JsonKey(name: "id")
int get id => throw _privateConstructorUsedError;
@JsonKey(name: "author_name")
@@ -246,36 +267,45 @@ mixin _$Datum {
@JsonKey(name: "body")
String get body => throw _privateConstructorUsedError;
@JsonKey(name: "children_comments")
- List get childrenComments => throw _privateConstructorUsedError;
+ List get childrenComments => throw _privateConstructorUsedError;
+ @JsonKey(name: "created_at")
+ DateTime get createdAt => throw _privateConstructorUsedError;
+ /// Serializes this Comment to a JSON map.
Map toJson() => throw _privateConstructorUsedError;
- @JsonKey(ignore: true)
- $DatumCopyWith get copyWith => throw _privateConstructorUsedError;
+
+ /// Create a copy of Comment
+ /// with the given fields replaced by the non-null parameter values.
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ $CommentCopyWith get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
-abstract class $DatumCopyWith<$Res> {
- factory $DatumCopyWith(Datum value, $Res Function(Datum) then) =
- _$DatumCopyWithImpl<$Res, Datum>;
+abstract class $CommentCopyWith<$Res> {
+ factory $CommentCopyWith(Comment value, $Res Function(Comment) then) =
+ _$CommentCopyWithImpl<$Res, Comment>;
@useResult
$Res call(
{@JsonKey(name: "id") int id,
@JsonKey(name: "author_name") String authorName,
@JsonKey(name: "author_profile_icon") String authorProfileIcon,
@JsonKey(name: "body") String body,
- @JsonKey(name: "children_comments") List childrenComments});
+ @JsonKey(name: "children_comments") List childrenComments,
+ @JsonKey(name: "created_at") DateTime createdAt});
}
/// @nodoc
-class _$DatumCopyWithImpl<$Res, $Val extends Datum>
- implements $DatumCopyWith<$Res> {
- _$DatumCopyWithImpl(this._value, this._then);
+class _$CommentCopyWithImpl<$Res, $Val extends Comment>
+ implements $CommentCopyWith<$Res> {
+ _$CommentCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
+ /// Create a copy of Comment
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -284,6 +314,7 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum>
Object? authorProfileIcon = null,
Object? body = null,
Object? childrenComments = null,
+ Object? createdAt = null,
}) {
return _then(_value.copyWith(
id: null == id
@@ -305,16 +336,20 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum>
childrenComments: null == childrenComments
? _value.childrenComments
: childrenComments // ignore: cast_nullable_to_non_nullable
- as List,
+ as List,
+ createdAt: null == createdAt
+ ? _value.createdAt
+ : createdAt // ignore: cast_nullable_to_non_nullable
+ as DateTime,
) as $Val);
}
}
/// @nodoc
-abstract class _$$DatumImplCopyWith<$Res> implements $DatumCopyWith<$Res> {
- factory _$$DatumImplCopyWith(
- _$DatumImpl value, $Res Function(_$DatumImpl) then) =
- __$$DatumImplCopyWithImpl<$Res>;
+abstract class _$$CommentImplCopyWith<$Res> implements $CommentCopyWith<$Res> {
+ factory _$$CommentImplCopyWith(
+ _$CommentImpl value, $Res Function(_$CommentImpl) then) =
+ __$$CommentImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
@@ -322,17 +357,20 @@ abstract class _$$DatumImplCopyWith<$Res> implements $DatumCopyWith<$Res> {
@JsonKey(name: "author_name") String authorName,
@JsonKey(name: "author_profile_icon") String authorProfileIcon,
@JsonKey(name: "body") String body,
- @JsonKey(name: "children_comments") List childrenComments});
+ @JsonKey(name: "children_comments") List childrenComments,
+ @JsonKey(name: "created_at") DateTime createdAt});
}
/// @nodoc
-class __$$DatumImplCopyWithImpl<$Res>
- extends _$DatumCopyWithImpl<$Res, _$DatumImpl>
- implements _$$DatumImplCopyWith<$Res> {
- __$$DatumImplCopyWithImpl(
- _$DatumImpl _value, $Res Function(_$DatumImpl) _then)
+class __$$CommentImplCopyWithImpl<$Res>
+ extends _$CommentCopyWithImpl<$Res, _$CommentImpl>
+ implements _$$CommentImplCopyWith<$Res> {
+ __$$CommentImplCopyWithImpl(
+ _$CommentImpl _value, $Res Function(_$CommentImpl) _then)
: super(_value, _then);
+ /// Create a copy of Comment
+ /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -341,8 +379,9 @@ class __$$DatumImplCopyWithImpl<$Res>
Object? authorProfileIcon = null,
Object? body = null,
Object? childrenComments = null,
+ Object? createdAt = null,
}) {
- return _then(_$DatumImpl(
+ return _then(_$CommentImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@@ -362,25 +401,30 @@ class __$$DatumImplCopyWithImpl<$Res>
childrenComments: null == childrenComments
? _value._childrenComments
: childrenComments // ignore: cast_nullable_to_non_nullable
- as List,
+ as List,
+ createdAt: null == createdAt
+ ? _value.createdAt
+ : createdAt // ignore: cast_nullable_to_non_nullable
+ as DateTime,
));
}
}
/// @nodoc
@JsonSerializable()
-class _$DatumImpl implements _Datum {
- const _$DatumImpl(
+class _$CommentImpl implements _Comment {
+ const _$CommentImpl(
{@JsonKey(name: "id") required this.id,
@JsonKey(name: "author_name") required this.authorName,
@JsonKey(name: "author_profile_icon") required this.authorProfileIcon,
@JsonKey(name: "body") required this.body,
@JsonKey(name: "children_comments")
- required final List childrenComments})
+ required final List childrenComments,
+ @JsonKey(name: "created_at") required this.createdAt})
: _childrenComments = childrenComments;
- factory _$DatumImpl.fromJson(Map json) =>
- _$$DatumImplFromJson(json);
+ factory _$CommentImpl.fromJson(Map json) =>
+ _$$CommentImplFromJson(json);
@override
@JsonKey(name: "id")
@@ -394,26 +438,30 @@ class _$DatumImpl implements _Datum {
@override
@JsonKey(name: "body")
final String body;
- final List _childrenComments;
+ final List