From 3d321f6a9df2fd0c5a2038050b97761d37353bce Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 23 Aug 2024 15:25:04 +0300 Subject: [PATCH 01/15] fix: fix errors --- .DS_Store | Bin 8196 -> 8196 bytes README.md | 60 +-- android/settings.gradle | 2 +- .../pages/blog_post_create_screen.dart | 2 +- .../presentation/pages/diary_screen.dart | 2 + .../auth/auth_screen/auth_screen.dart | 2 +- .../my_profile_screen/my_profile_screen.dart | 424 +++++++++++++++--- pubspec.yaml | 3 +- 8 files changed, 372 insertions(+), 123 deletions(-) diff --git a/.DS_Store b/.DS_Store index 3d1c443933065e96a8a7ab8d541eedb9273ad506..4bd8225be6d1b6e8ec3d7076c9e102e1fa7f05d8 100644 GIT binary patch delta 122 zcmZp1XmOa}&nUJrU^hRb*km4o<)*9*Nerb7nG87$DV{m`$w@i+Nem1O0t^gH=?n~v zeE-1!D8j&iq;m2J!QfrcX4=dy@r`BjbK(At#T85d DQ`jWh delta 40 wcmZp1XmOa}&nUbxU^hRb@MIo=<(p3m9%i0gFH^U%LYR3oyTmt^jTP+703sg^?f?J) diff --git a/README.md b/README.md index 39b2d892..d7368d78 100644 --- a/README.md +++ b/README.md @@ -1,59 +1 @@ - -# eatvio_app -### Системные требования - -- Flutter (Channel stable, 3.19.0, on Ubuntu 22.04.3 LTS 6.2.0-39-generic, locale en_US.UTF-8) -- Android Studio (version 2023.1) -- VS Code (version 1.85.0) -- Android SDK (version 34.0.0) - устанавливается из Android Studio (Tools->SDK Manager->Android Command Line Tools) -- Эмулятор (2 available) - -### Структура приложения - -``` -. -├── android - Папка для крмпиляции Android приложения -├── assets - Медиа и шрифты -├── ios - Папка для крмпиляции iOS приложения -├── lib - Основной код - ├── main.dart - Файл из которого компилируется приложение - ├── presentation - Виджеты экранов (верстка) - ├── routes - Роутер (пути до экранов) - └── theme - Темы и оформление - └── widgets - Кастомные виджеты -├── pubspec.yaml - Пакеты - -``` - - -### Как запускать? - -Для запуска на эмуляторе в программе VS Code скомпилируйте и запустите файл main.dart (предварительно необходимо установить эмулятор в Android Studio или подключите устройство в режиме разработчика через USB) - -Для тестирования на устройствах Android в корневой папке проекта выполните команду - -`# flutter build apk` - -после чего `.apk` файл скомпилируется в директории `build/app/outputs/flutter-apk/app-release.apk` - -Данный файл установит приложение на устройство с актуальной версией OS - -### Библиотеки и инструменты - - - **flutter_bloc** - контроль состояний - - **cached_network_image** - кеширование картинок из веба - - **flutter_svg** - работа с изображениями - - **equatable** - сравнение без оператора "==" - - **validators** - валидация - - **hive** - локальная бд (1) - - **hive_flutter** - локальная бд (2) - - **isar_flutter_libs** - локальная бд (3) - - **path_provider** - динамичкские пути до файлов - - **fl_chart** - построение графиков - - **flutter_spinkit** - прелоадеры - - **flutter_dotenv** - переменные окружения - - -### Поддержка - -Telegram: @maxx_kim (https://t.me/maxx_kim) +# eatvio_app \ No newline at end of file diff --git a/android/settings.gradle b/android/settings.gradle index 83b4cf1d..5a6de5ce 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -19,7 +19,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "7.3.1" apply false - id "org.jetbrains.kotlin.android" version "1.9.10" apply false + id "org.jetbrains.kotlin.android" version "2.0.20" apply false } include ":app" 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 e1414dbe..d8fc116e 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 @@ -78,7 +78,7 @@ class _BlogPostCreateScreenState extends State { floatingActionButton: SizedBox( width: MediaQuery.of(context).size.width - 32, child: FloatingActionButton.extended( - heroTag: 'nextButtonRegistration', + heroTag: 'createBlogPost', highlightElevation: 0, elevation: 0, focusElevation: 0, diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 7556fece..b8635ec6 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -201,6 +201,7 @@ class DiaryScreen extends StatelessWidget { width: MediaQuery.of(context).size.width, padding: EdgeInsets.only(left: 4, right: 4), child: FloatingActionButton.extended( + heroTag: 'endDayButton', highlightElevation: 0, elevation: 0, focusElevation: 0, @@ -264,6 +265,7 @@ class DiaryScreen extends StatelessWidget { width: MediaQuery.of(context).size.width, padding: EdgeInsets.only(left: 4, right: 4), child: FloatingActionButton.extended( + heroTag: 'addProduct', highlightElevation: 0, elevation: 0, focusElevation: 0, diff --git a/lib/presentation/auth/auth_screen/auth_screen.dart b/lib/presentation/auth/auth_screen/auth_screen.dart index bd662937..2c738524 100644 --- a/lib/presentation/auth/auth_screen/auth_screen.dart +++ b/lib/presentation/auth/auth_screen/auth_screen.dart @@ -126,7 +126,7 @@ class _AuthScreenState extends State { height: 48, width: MediaQuery.of(context).size.width - 32, child: FloatingActionButton.extended( - heroTag: 'nextButtonRegistration', + heroTag: 'authButton', highlightElevation: 0, elevation: 0, focusElevation: 0, diff --git a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart index 306099e8..d10b70ab 100644 --- a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart +++ b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart @@ -1,24 +1,23 @@ import 'dart:convert'; +import 'dart:math'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:carousel_slider_plus/carousel_slider_plus.dart'; import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/widgets/app_bar/appbar_subtitle.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; +import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; +import 'package:intl/intl.dart'; + import 'bloc/my_profile_bloc.dart'; import 'models/my_profile_model.dart'; class MyProfileScreen extends StatelessWidget { - int valuteToInt(String value) { - // Преобразование строки в целое число - return int.tryParse(value) ?? 0; // Возвращает 0, если преобразование не удалось - } - static Widget builder(BuildContext context) { return BlocProvider( create: (context) => MyProfileBloc( @@ -193,7 +192,7 @@ class MyProfileScreen extends StatelessWidget { _buildCarousel(BuildContext contex, MyProfileLoadedState state) { return CarouselSlider( - options: CarouselOptions(height: 370), + options: CarouselOptions(height: 340), items: [1, 2, 3].map((chartType) { return Builder( builder: (BuildContext context) { @@ -210,11 +209,11 @@ class MyProfileScreen extends StatelessWidget { ), ), SizedBox(height: 50.v), - // _buildChart( - // context, - // state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], - // state.chartDates, - // ), + _buildChart( + context, + state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], + state.chartDates, + ), ], ), ); @@ -228,14 +227,14 @@ class MyProfileScreen extends StatelessWidget { ), ), SizedBox(height: 50.v), - // _buildChart( - // context, - // _bodyMassIndex( - // state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], - // state.userDetails?['height'].toInt() ?? 160, - // ), - // state.chartDates, - // ), + _buildChart( + context, + _bodyMassIndex( + state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], + state.userDetails?['height'].toInt() ?? 160, + ), + state.chartDates, + ), ], ); case 3: //График обхватов @@ -250,7 +249,7 @@ class MyProfileScreen extends StatelessWidget { ), ), SizedBox(height: 30.v), - // _buildCircumferenceChart(context, state.circumferences, state.chartDates), + _buildCircumferenceChart(context, state.circumferences, state.chartDates), _buildChartLegend(), ], ), @@ -296,34 +295,354 @@ class MyProfileScreen extends StatelessWidget { ); } - // Widget _buildChart(BuildContext context, List chartPoints, List? dates) { - // // Проверяем, что у нас есть 4 элемента в обоих списках - // if (chartPoints.length != 4 || (dates != null && dates.length != 4)) { - // return Center(child: Text('Должно быть ровно 4 точки и 4 даты.')); - // } + _buildChart(BuildContext context, List chartPoints, List? dates) { + List spots = []; + for (int i = 0; i < 4; i++) { + spots.add( + FlSpot((i * 10 / 10) + 1, chartPoints[i]), + ); + } - // // Преобразуем данные в список точек для графика - // List chartData = List.generate(4, (index) { - // return ChartData(dates![index], chartPoints[index]); - // }); + Widget bottomTitleWidgets(double value, TitleMeta meta, double chartWidth, List? dates) { + if (value % 1 != 0) { + return Container(); + } + final style = TextStyle( + color: Colors.blue, + fontWeight: FontWeight.bold, + fontSize: min(13, 13 * chartWidth / 300), + ); + int index = value.toInt(); + if (index >= 0 && index < dates!.length) { + // Проверка на допустимый индекс в массиве dates + String formattedDate = DateFormat('dd.MM').format(DateTime.parse(dates[index])); + return SideTitleWidget( + axisSide: meta.axisSide, + space: 16, + child: Text(formattedDate, style: style), + ); + } else { + return Container(); + } + } - // return Container( - // height: 300, // Задайте нужную высоту для графика - // child: SfCartesianChart( - // title: ChartTitle(text: 'График значений'), - // primaryXAxis: CategoryAxis(), - // series: >[ - // // Изменяем на CartesianSeries - // LineSeries( - // dataSource: chartData, - // xValueMapper: (ChartData data, _) => data.date, - // yValueMapper: (ChartData data, _) => data.value, - // dataLabelSettings: DataLabelSettings(isVisible: true), - // ), - // ], - // ), - // ); - // } + Widget leftTitleWidgets(double value, TitleMeta meta, double chartWidth) { + final style = TextStyle( + color: Colors.blue, + fontWeight: FontWeight.bold, + fontSize: min(18, 18 * chartWidth / 300), + ); + return SideTitleWidget( + axisSide: meta.axisSide, + space: 16, + child: Text(meta.formattedValue, style: style), + ); + } + + return Padding( + padding: const EdgeInsets.only( + left: 12, + right: 20, + ), + child: AspectRatio( + aspectRatio: 1, + child: LayoutBuilder( + builder: (context, constraints) { + return LineChart( + LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + maxContentWidth: 100, + // tooltipBgColor: Colors.black, + getTooltipItems: mapSpots(), + ), + handleBuiltInTouches: true, + getTouchLineStart: (data, index) => 0, + ), + lineBarsData: [ + LineChartBarData( + color: Colors.pink, + spots: spots, + isCurved: true, + isStrokeCapRound: true, + barWidth: 3, + belowBarData: BarAreaData( + show: false, + ), + dotData: const FlDotData(show: false), + ), + ], + minY: chartPoints.reduce((value, element) => value < element ? value : element), + maxY: chartPoints.reduce((value, element) => value > element ? value : element), + minX: 1, + maxX: 4, + titlesData: FlTitlesData( + leftTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + getTitlesWidget: (value, meta) => leftTitleWidgets(value, meta, constraints.maxWidth), + reservedSize: 56, + ), + drawBelowEverything: true, + ), + rightTitles: const AxisTitles( + sideTitles: SideTitles(showTitles: false), + ), + bottomTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + getTitlesWidget: (value, meta) => bottomTitleWidgets(value, meta, constraints.maxWidth, dates), + reservedSize: 36, + interval: 1, + ), + drawBelowEverything: true, + ), + topTitles: const AxisTitles( + sideTitles: SideTitles(showTitles: false), + ), + ), + gridData: FlGridData( + show: true, + drawHorizontalLine: true, + drawVerticalLine: true, + horizontalInterval: 1.5, + verticalInterval: 5, + checkToShowHorizontalLine: valuteToInt(), + getDrawingHorizontalLine: (_) => FlLine( + color: Colors.blue.withOpacity(1), + dashArray: [8, 2], + strokeWidth: 0.8, + ), + getDrawingVerticalLine: (_) => FlLine( + color: Colors.blue.withOpacity(1), + dashArray: [8, 2], + strokeWidth: 0.8, + ), + checkToShowVerticalLine: valuteToInt(), + ), + borderData: FlBorderData(show: false), + ), + ); + }, + ), + ), + ); + } + + valuteToInt() { + return (value) { + return value.toInt() == 0; + }; + } + + List Function(List) mapSpots() { + return (touchedSpots) { + return touchedSpots.map((LineBarSpot touchedSpot) { + final textStyle = TextStyle( + color: touchedSpot.bar.gradient?.colors[0] ?? touchedSpot.bar.color, + fontWeight: FontWeight.bold, + fontSize: 14, + ); + return LineTooltipItem( + '${touchedSpot.x}, ${touchedSpot.y.toStringAsFixed(2)}', + textStyle, + ); + }).toList(); + }; + } + + _buildCircumferenceChart(BuildContext context, chartPoints, List? dates) { +// Определение осей графика + final chestCircumferences = chartPoints.values.map((e) => e['chest_circumference']).toList(); + List spotsChest = []; + for (int i = 0; i < 4; i++) { + chestCircumferences[i] = chestCircumferences[i] * 10 / 10; + spotsChest.add( + FlSpot((i * 10 / 10) + 1, chestCircumferences[i] * 10 / 10), + ); + } + final waistCircumferences = chartPoints.values.map((e) => e['waist_circumference']).toList(); + List spotsWaist = []; + for (int i = 0; i < 4; i++) { + waistCircumferences[i] = waistCircumferences[i] * 10 / 10; + spotsWaist.add( + FlSpot((i * 10 / 10) + 1, waistCircumferences[i] * 10 / 10), + ); + } + final hipCircumferences = chartPoints.values.map((e) => e['hip_circumference']).toList(); + List spotsHip = []; + for (int i = 0; i < 4; i++) { + hipCircumferences[i] = hipCircumferences[i] * 10 / 10; + spotsHip.add( + FlSpot((i * 10 / 10) + 1, hipCircumferences[i]), + ); + } + + final allCircumferences = [...chestCircumferences, ...hipCircumferences, ...waistCircumferences]; + + Widget bottomTitleWidgets(double value, TitleMeta meta, double chartWidth, List? dates) { + if (value % 1 != 0) { + return Container(); + } + final style = TextStyle( + color: Colors.blue, + fontWeight: FontWeight.bold, + fontSize: min(13, 13 * chartWidth / 300), + ); + int index = value.toInt(); + if (index >= 0 && index < dates!.length) { + // Проверка на допустимый индекс в массиве dates + String formattedDate = DateFormat('dd.MM').format(DateTime.parse(dates[index])); + return SideTitleWidget( + axisSide: meta.axisSide, + space: 16, + child: Text(formattedDate, style: style), + ); + } else { + return Container(); + } + } + + Widget leftTitleWidgets(double value, TitleMeta meta, double chartWidth) { + final style = TextStyle( + color: Colors.blue, + fontWeight: FontWeight.bold, + fontSize: min(18, 18 * chartWidth / 300), + ); + return SideTitleWidget( + axisSide: meta.axisSide, + space: 16, + child: Text(meta.formattedValue, style: style), + ); + } + + return Padding( + padding: const EdgeInsets.only( + left: 12, + right: 20, + ), + child: AspectRatio( + aspectRatio: 1, + child: LayoutBuilder( + builder: (context, constraints) { + return LineChart( + LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + maxContentWidth: 100, + // tooltipBgColor: Colors.black, + getTooltipItems: mapTouchedSpots(), + ), + handleBuiltInTouches: true, + getTouchLineStart: (data, index) => 0, + ), + lineBarsData: [ + LineChartBarData( + color: Colors.pink, + spots: spotsChest, + isCurved: true, + isStrokeCapRound: true, + barWidth: 3, + belowBarData: BarAreaData( + show: false, + ), + dotData: const FlDotData(show: false), + ), + LineChartBarData( + color: Colors.green, + spots: spotsWaist, + isCurved: true, + isStrokeCapRound: true, + barWidth: 3, + belowBarData: BarAreaData( + show: false, + ), + dotData: const FlDotData(show: false), + ), + LineChartBarData( + color: Colors.purple, + spots: spotsHip, + isCurved: true, + isStrokeCapRound: true, + barWidth: 3, + belowBarData: BarAreaData( + show: false, + ), + dotData: const FlDotData(show: false), + ), + ], + minY: allCircumferences.reduce((value, element) => value < element ? value : element), + maxY: allCircumferences.reduce((value, element) => value > element ? value : element), + minX: 1, + maxX: 4, + titlesData: FlTitlesData( + leftTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + getTitlesWidget: (value, meta) => leftTitleWidgets(value, meta, constraints.maxWidth), + reservedSize: 56, + ), + drawBelowEverything: true, + ), + rightTitles: const AxisTitles( + sideTitles: SideTitles(showTitles: false), + ), + bottomTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + getTitlesWidget: (value, meta) => bottomTitleWidgets(value, meta, constraints.maxWidth, dates), + reservedSize: 36, + interval: 1, + ), + drawBelowEverything: true, + ), + topTitles: const AxisTitles( + sideTitles: SideTitles(showTitles: false), + ), + ), + gridData: FlGridData( + show: true, + drawHorizontalLine: true, + drawVerticalLine: true, + horizontalInterval: 1.5, + verticalInterval: 5, + checkToShowHorizontalLine: valuteToInt(), + getDrawingHorizontalLine: (_) => FlLine( + color: Colors.blue.withOpacity(1), + dashArray: [8, 2], + strokeWidth: 0.8, + ), + getDrawingVerticalLine: (_) => FlLine( + color: Colors.blue.withOpacity(1), + dashArray: [8, 2], + strokeWidth: 0.8, + ), + checkToShowVerticalLine: valuteToInt(), + ), + borderData: FlBorderData(show: false), + ), + ); + }, + ), + ), + ); + } + + List Function(List) mapTouchedSpots() { + return (touchedSpots) { + return touchedSpots.map((LineBarSpot touchedSpot) { + final textStyle = TextStyle( + color: touchedSpot.bar.gradient?.colors[0] ?? touchedSpot.bar.color, + fontWeight: FontWeight.bold, + fontSize: 14, + ); + return LineTooltipItem( + '${touchedSpot.x}, ${touchedSpot.y.toStringAsFixed(2)}', + textStyle, + ); + }).toList(); + }; + } /// Section Widget _buildPlans(BuildContext context, List? plans, List? imagePaths, List? states) { @@ -643,16 +962,3 @@ class MyProfileScreen extends StatelessWidget { }; } } - -class ChartData { - final String date; - final double value; - - ChartData(this.date, this.value); - - valuteToInt() { - return (value) { - return value.toInt() == 0; - }; - } -} diff --git a/pubspec.yaml b/pubspec.yaml index 08cdef1d..d4b409ba 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,7 +23,6 @@ dependencies: freezed_annotation: ^2.4.4 json_annotation: ^4.9.0 validators: ^3.0.0 - isar_flutter_libs: ^3.1.0 path_provider: ^2.1.4 fl_chart: ^0.68.0 flutter_spinkit: ^5.2.1 @@ -45,7 +44,7 @@ dependencies: badges: ^3.1.2 google_fonts: ^6.2.1 location: ^6.0.2 - # syncfusion_flutter_charts: ^26.2.9 + syncfusion_flutter_charts: ^26.2.10 table_calendar: ^3.1.2 flutter_keyboard_visibility: ^6.0.0 share_plus: ^10.0.0 From 024856ffe30037f8deb923a44f2a7298c2c18d71 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 23 Aug 2024 15:31:37 +0300 Subject: [PATCH 02/15] fix(navigation): remove animation between pages --- lib/app_router.dart | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/app_router.dart b/lib/app_router.dart index 83485d40..57923180 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -62,32 +62,42 @@ class AppRouter { }, routes: [ GoRoute( + pageBuilder: (context, state) => NoTransitionPage(child: MyProfileScreen()), path: '/my-profile-screen', name: 'myProfileScreen', redirect: (context, state) async { await context.read().runInitialization(); return null; }, - builder: (context, state) => MyProfileScreen(), + // builder: (context, state) => MyProfileScreen(), ), GoRoute( + pageBuilder: (context, state) => NoTransitionPage(child: FeedScreen()), path: '/feed-screen', name: 'feedScreen', - builder: (context, state) => FeedScreen(), + // builder: (context, state) => FeedScreen(), ), GoRoute( - path: '/diary-screen', - name: 'diaryScreen', - builder: (context, state) { - if (state.extra != null) - return DiaryScreen(diaryID: state.extra as String); - else - return DiaryScreen(diaryID: '0'); - }), + pageBuilder: (context, state) { + if (state.extra != null) + return NoTransitionPage(child: DiaryScreen(diaryID: state.extra as String)); + else + return NoTransitionPage(child: DiaryScreen(diaryID: '0')); + }, + path: '/diary-screen', + name: 'diaryScreen', + // builder: (context, state) { + // if (state.extra != null) + // return DiaryScreen(diaryID: state.extra as String); + // else + // return DiaryScreen(diaryID: '0'); + // }, + ), GoRoute( + pageBuilder: (context, state) => NoTransitionPage(child: ChatSelectScreen()), path: '/chat-select-screen', name: 'chatSelectScreen', - builder: (context, state) => ChatSelectScreen(), + // builder: (context, state) => ChatSelectScreen(), ), ], ), From 5d16db1fcceefe5d621658d830c6fac931bc2795 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 23 Aug 2024 15:33:06 +0300 Subject: [PATCH 03/15] fix: issues --- lib/features/diets/presentation/pages/about_diet_screen.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/features/diets/presentation/pages/about_diet_screen.dart b/lib/features/diets/presentation/pages/about_diet_screen.dart index 931b2eaf..42aa3bf4 100644 --- a/lib/features/diets/presentation/pages/about_diet_screen.dart +++ b/lib/features/diets/presentation/pages/about_diet_screen.dart @@ -2,13 +2,11 @@ import 'dart:io'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/core/constants/constants.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/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/locator_service.dart'; -import 'package:eatvio_app/theme/theme_helper.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; From d27171eae2b7c0f6582a4a4977006b364a45f310 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 26 Aug 2024 12:12:21 +0300 Subject: [PATCH 04/15] feat(chat): add sound --- assets/audio/recive_message.wav | Bin 0 -> 10732 bytes assets/audio/send_message.wav | Bin 0 -> 31066 bytes .../bloc/chat_room_cubit/chat_room_cubit.dart | 4 +- .../chat/presentation/pages/chat_screen.dart | 1 + .../presentation/pages/diary_screen.dart | 54 +++++++++--------- pubspec.yaml | 2 + 6 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 assets/audio/recive_message.wav create mode 100644 assets/audio/send_message.wav diff --git a/assets/audio/recive_message.wav b/assets/audio/recive_message.wav new file mode 100644 index 0000000000000000000000000000000000000000..db342a8f62b9e0ed42581e412bb0921a2040f332 GIT binary patch literal 10732 zcmW++1$Y!k8=hG^jY9$nA;H~?yF+m;Qi?-?BE|V}DDIvj#VIZYij)=!MFNE)L4p$@ zKypdW?{;VAf9bQ&$=>bm%xCYX-P^ZmlTm??Z<_aRJ!0(S#Bf3g#nI|0AxryEB9U-1 zZ1Cj4S8&Zx(M>cH9mO|dh!`xs#W6ul6r=w;8!r}!4PuYDDY8T~sZQFG@5lr)hpZ-t z$vJYFoFym8F>(U$U%nk7hsbuaoXjNC$ZRr+^dZej1rkS!l42x`BB$QZ*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cmV?d00001 diff --git a/assets/audio/send_message.wav b/assets/audio/send_message.wav new file mode 100644 index 0000000000000000000000000000000000000000..ec643aa1097124a9c577bbed8495b3b1d5f8aa2f GIT binary patch literal 31066 zcmYkE1)NmX`~T0qGh1|bOM}uO0uqXeAcBGjDx!jffr*HLl#~e)A|Mh9f`9@_sGvxf zbayu_?9SYK{_oG6@4kNjy|0;_xpB^upC``QZTCQ{R_)#~=85Ky-}^$J*URKF#&{g} z%rRzIN6+{skLmvG>(Ac7J>|`9<}UM@nPfVcJIqo05y!`Nq77_yv&YV}-`ZE~dp5V( zU!%kO<@a+urAIP-=n#ivaBqkX|XVn4Lg>~dS#3^c9Ho#svR4rAvrLzsG# z`O2&^Y2Gwb$dolxOfU17{mGU!{Y(#2)s!^dxc-~DWuEu0d2Rfd*U3xr&T-ce+r%!h z#mrv&i5+Ig+6QesY+<+BsA*!JF(+&TTftVbE5h%>zVe*gdwJZE17byTdc#3+7p*8MC!)etX>xw-dv?;XM0+$wVHV%_HWjeaAMo z744Gnz2M2<4!hVE4u1_g+GA#+=?yn4z4=}l`#^ZWPBLBW3t>kaLk{!8BjI_|-7Ca= z-Azt2C-lR%;UnRW;Gdvlm}-mIhr%brG4`;%7QPTZ5mpEv45r6g#U6?`i~kzi5}y?= zwd3qdcA@F&jkSlvuHK?ZH-A7lIh+^S5$)%dimXcgHphb8bMkb^^>U61*@h=|^beVa zwvbImCt=tkwm*Gk`pnFc_L=DXl)7pC(iW%einjA7*{b0Wb`1JB5DpD;g=NFrbzuV03Tv!RR@EVC2Eb3cp6u zSCMhHYxMb){o#!GfM|)xEAcL-Tyh?-U&ijt&VJXV{$_ftY52B(+>8h|#h1rzP{wYH zHO$Oz@A1-u*|F`hLBZN^dwg@OSNM|63_b~V1wVvuh2O^ii{Bm|jQ<^f)V$!Qnv}R7 zYZw#`7YEbB&0)!4a_qKvG26m44*rV&XnyhTw;jWgwx~D6`_g|nX=UWD@cA&^zvTaB zs{21hk3>$Iy(U-mQuMH2&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O9QjQTvHQ1fU!CtvB` zaWBqwP1cKF7BLWk({!qbW)T| zG^g&B-rP&R;iT!bqIbEzdKDd%T{;g{RB-Xnd5AQinnD`YyJm3n>$)_mI3o(3?}<}~uFe}Zx1&o4Bm|Qr zBrk`(8dp?En$DXgp)4IsH*Pj3Ls6jdoX$0;WazXY{^ZA^!^usf=tncS_~ZOdR^x0@ zJV}erU!0{lk964T5L)BAam2Iu()fBR3nkoj=f~<|I2+KtS#lFq!XACs^O{-DJ4+Xh z?wmU#S?Rh)kk<4q>v{cl7$-jE3Gyw;)^V<}bY0ImorpV!a-zrCv8WJV!a~Wy$;9z4 zTCzrPGSwY!Tt_Eg_;KUwyk<}o7u}Lc7FCK_PWDb_(uAwfrBCthcys>bM%BB%iw5zR zHJa|v8qaCR`G>gGGgZUjByesosz>L=@tEIu4{PDhSISwYrI+_ { privateChatChannel.subscribe(); privateChatChannel.bind('App\\Events\\ChatMessageUpdated').listen((event) { - print(jsonDecode(event.data)); + AudioPlayer().play((AssetSource('audio/recive_message.wav'))); List messagesList = [ ChatMessageModel.fromJson(jsonDecode(event.data)['message']), ...(state as ChatRoomStateLoaded).chatMessages, @@ -147,6 +148,7 @@ class ChatRoomCubit extends Cubit { data: data, files: files, ); + AudioPlayer().play((AssetSource('audio/send_message.wav'))); } @override diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index eed575cb..e5c2a4cd 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:audioplayers/audioplayers.dart'; 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'; diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index b8635ec6..cd87acff 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -18,7 +18,7 @@ import 'package:flutter/services.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; import 'package:image_picker/image_picker.dart'; -// import 'package:syncfusion_flutter_charts/charts.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; class DiaryScreen extends StatelessWidget { final String? diaryID; @@ -136,30 +136,30 @@ class DiaryScreen extends StatelessWidget { Text( "от дневной суточной нормы", ), - // Transform.rotate( - // angle: -1.5708, - // child: ClipRect( - // child: Align( - // alignment: Alignment.centerRight, - // widthFactor: 0.5, - // child: SfCircularChart( - // series: [ - // RadialBarSeries( - // dataSource: state.chartDataCounted, - // xValueMapper: (NutritionData data, _) => data.category, - // yValueMapper: (NutritionData data, _) => data.nutrition, - // pointColorMapper: (NutritionData data, _) => data.color, - // trackColor: Color.fromRGBO(59, 130, 246, 1), - // trackOpacity: 0.1, - // gap: "8%", - // radius: "110%", - // innerRadius: '20%', // Измените значение по вашему усмотрению - // ) - // ], - // ), - // ), - // ), - // ), + Transform.rotate( + angle: -1.5708, + child: ClipRect( + child: Align( + alignment: Alignment.centerRight, + widthFactor: 0.5, + child: SfCircularChart( + series: [ + RadialBarSeries( + dataSource: state.chartDataCounted, + xValueMapper: (NutritionData data, _) => data.category, + yValueMapper: (NutritionData data, _) => data.nutrition, + pointColorMapper: (NutritionData data, _) => data.color, + trackColor: Color.fromRGBO(59, 130, 246, 1), + trackOpacity: 0.1, + gap: "8%", + radius: "110%", + innerRadius: '20%', // Измените значение по вашему усмотрению + ) + ], + ), + ), + ), + ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -901,7 +901,7 @@ class DiaryScreen extends StatelessWidget { }; } - /* _buildComment(BuildContext context, DiaryStateLoaded state) { + _buildComment(BuildContext context, DiaryStateLoaded state) { return Container( padding: EdgeInsets.symmetric( horizontal: 24.h, @@ -934,7 +934,7 @@ class DiaryScreen extends StatelessWidget { ], ), ); - } */ + } _buildWakupRetire(BuildContext context, DiaryStateLoaded state) { return Container( diff --git a/pubspec.yaml b/pubspec.yaml index d4b409ba..1cb02791 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -50,6 +50,7 @@ dependencies: share_plus: ^10.0.0 flutter_html: 3.0.0-beta.2 file_picker: ^8.1.1 + audioplayers: ^5.2.1 dev_dependencies: build_runner: ^2.4.11 @@ -65,3 +66,4 @@ flutter: assets: - assets/ - assets/images/ + - assets/audio/ From cfa89c363b3fa61a33684001d520b0a69a754c77 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 26 Aug 2024 12:22:14 +0300 Subject: [PATCH 05/15] feat(chat): add sound+analyze --- .../initialization_state.freezed.dart | 31 +-- .../selection_popup_model.freezed.dart | 17 +- .../user_registration_model.freezed.dart | 21 +-- .../new_messages_state.freezed.dart | 31 +-- .../notifications_state.freezed.dart | 31 +-- .../models/calendar_model.freezed.dart | 21 +-- .../bloc/calendar_state.freezed.dart | 31 +-- .../models/chat_message_model.freezed.dart | 21 +-- .../models/chat_messages_model.freezed.dart | 23 +-- .../chat/models/chat_meta_model.freezed.dart | 21 +-- .../chat/models/chat_room_model.freezed.dart | 23 +-- .../chat_room_preview_model.freezed.dart | 111 ++--------- .../chat_room_settings_model.freezed.dart | 21 +-- .../chat/models/chat_user_model.freezed.dart | 21 +-- .../models/websocket_info_model.freezed.dart | 21 +-- .../bloc/chat_room_cubit/chat_room_cubit.dart | 4 +- .../chat_room_state.freezed.dart | 33 +--- .../chat_select_state.freezed.dart | 31 +-- .../chat/presentation/pages/chat_screen.dart | 2 - .../diary/models/diary_model.freezed.dart | 23 +-- lib/features/diary/models/meal.freezed.dart | 21 +-- lib/features/diary/models/photo.freezed.dart | 21 +-- .../diary/models/portion.freezed.dart | 21 +-- .../diary/models/product.freezed.dart | 21 +-- lib/features/diary/models/state.freezed.dart | 21 +-- .../bloc/diary_state.freezed.dart | 45 +---- .../feed/models/comment_model.freezed.dart | 109 ++--------- .../diets_pagination_model.freezed.dart | 176 ++++-------------- .../models/feed_blog_post_model.freezed.dart | 23 +-- ...feed_blog_post_settings_model.freezed.dart | 23 +-- .../feed/models/recipes_model.freezed.dart | 65 ++----- .../recipes_pagination_model.freezed.dart | 21 +-- .../comments_state.freezed.dart | 33 +--- .../bloc/diets_cubit/diets_state.freezed.dart | 33 +--- .../bloc/feed_cubit/feed_state.freezed.dart | 31 +-- .../recipes_cubit/recipes_state.freezed.dart | 31 +-- .../feed/services/feed_service.g.dart | 4 +- .../profile/models/profile_model.freezed.dart | 69 ++----- .../profile_cubit/profile_state.freezed.dart | 33 +--- .../recipes/models/ingredient.freezed.dart | 21 +-- .../recipes/models/recipe_model.freezed.dart | 21 +-- lib/features/recipes/models/step.freezed.dart | 21 +-- .../bloc/recipe_create_state.freezed.dart | 39 +--- .../models/location_model.freezed.dart | 21 +-- .../registration_state.freezed.dart | 19 +- 45 files changed, 249 insertions(+), 1232 deletions(-) diff --git a/lib/core/initialization_cubit/initialization_state.freezed.dart b/lib/core/initialization_cubit/initialization_state.freezed.dart index b0535c68..3364e440 100644 --- a/lib/core/initialization_cubit/initialization_state.freezed.dart +++ b/lib/core/initialization_cubit/initialization_state.freezed.dart @@ -84,9 +84,6 @@ 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 @@ -103,9 +100,6 @@ 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 @@ -224,9 +218,6 @@ 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 @@ -348,8 +339,6 @@ 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({ @@ -388,9 +377,7 @@ class _$InitializationStateSuccessImpl implements InitializationStateSuccess { @override int get hashCode => Object.hash(runtimeType, client); - /// Create a copy of InitializationState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> @@ -478,10 +465,7 @@ abstract class InitializationStateSuccess implements InitializationState { _$InitializationStateSuccessImpl; PusherChannelsClient get client; - - /// Create a copy of InitializationState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$InitializationStateSuccessImplCopyWith<_$InitializationStateSuccessImpl> get copyWith => throw _privateConstructorUsedError; } @@ -506,8 +490,6 @@ 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({ @@ -547,9 +529,7 @@ class _$InitializationStateErrorImpl implements InitializationStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of InitializationState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> @@ -636,10 +616,7 @@ abstract class InitializationStateError implements InitializationState { _$InitializationStateErrorImpl; String get errorMessage; - - /// Create a copy of InitializationState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart index 97ab368c..917785c7 100644 --- a/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart +++ b/lib/data/models/selectionPopupModel/selection_popup_model.freezed.dart @@ -21,9 +21,7 @@ mixin _$SelectionPopupModel { dynamic get value => throw _privateConstructorUsedError; bool get isSelected => throw _privateConstructorUsedError; - /// Create a copy of SelectionPopupModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $SelectionPopupModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -47,8 +45,6 @@ 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({ @@ -97,8 +93,6 @@ 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({ @@ -165,9 +159,7 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel { int get hashCode => Object.hash(runtimeType, id, title, const DeepCollectionEquality().hash(value), isSelected); - /// Create a copy of SelectionPopupModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => @@ -190,11 +182,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart b/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart index fd835a26..4a15327c 100644 --- a/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart +++ b/lib/data/models/userRegistrationModel/user_registration_model.freezed.dart @@ -68,12 +68,8 @@ mixin _$UserRegistrationSheet { @JsonKey(name: 'activity_coefficient') double get activityCoefficient => throw _privateConstructorUsedError; - /// Serializes this UserRegistrationSheet to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of UserRegistrationSheet - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $UserRegistrationSheetCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -125,8 +121,6 @@ class _$UserRegistrationSheetCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of UserRegistrationSheet - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -319,8 +313,6 @@ class __$$UserRegistrationSheetImplCopyWithImpl<$Res> $Res Function(_$UserRegistrationSheetImpl) _then) : super(_value, _then); - /// Create a copy of UserRegistrationSheet - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -635,7 +627,7 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { other.activityCoefficient == activityCoefficient)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hashAll([ runtimeType, @@ -668,9 +660,7 @@ class _$UserRegistrationSheetImpl implements _UserRegistrationSheet { activityCoefficient ]); - /// Create a copy of UserRegistrationSheet - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> @@ -797,11 +787,8 @@ abstract class _UserRegistrationSheet implements UserRegistrationSheet { @override @JsonKey(name: 'activity_coefficient') double get activityCoefficient; - - /// Create a copy of UserRegistrationSheet - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$UserRegistrationSheetImplCopyWith<_$UserRegistrationSheetImpl> get copyWith => throw _privateConstructorUsedError; } 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 7c5d7ffd..02a1c4bd 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,9 +84,6 @@ 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 @@ -103,9 +100,6 @@ 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 @@ -221,9 +215,6 @@ 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 @@ -344,8 +335,6 @@ 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({ @@ -385,9 +374,7 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded { @override int get hashCode => Object.hash(runtimeType, messagesCount); - /// Create a copy of NewMessagesState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> @@ -474,10 +461,7 @@ abstract class NewMessagesStateLoaded implements NewMessagesState { _$NewMessagesStateLoadedImpl; int get messagesCount; - - /// Create a copy of NewMessagesState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -500,8 +484,6 @@ 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({ @@ -541,9 +523,7 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of NewMessagesState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> @@ -630,10 +610,7 @@ abstract class NewMessagesStateError implements NewMessagesState { _$NewMessagesStateErrorImpl; String get errorMessage; - - /// Create a copy of NewMessagesState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } 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 2b969b98..0deeebbd 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 @@ -84,9 +84,6 @@ 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 @@ -103,9 +100,6 @@ 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 @@ -223,9 +217,6 @@ 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 @@ -347,8 +338,6 @@ 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({ @@ -388,9 +377,7 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { @override int get hashCode => Object.hash(runtimeType, notificationsCount); - /// Create a copy of NotificationsState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> @@ -477,10 +464,7 @@ abstract class NotificationsStateLoaded implements NotificationsState { {required final int notificationsCount}) = _$NotificationsStateLoadedImpl; int get notificationsCount; - - /// Create a copy of NotificationsState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -505,8 +489,6 @@ 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({ @@ -546,9 +528,7 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of NotificationsState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> @@ -635,10 +615,7 @@ abstract class NotificationsStateError implements NotificationsState { _$NotificationsStateErrorImpl; String get errorMessage; - - /// Create a copy of NotificationsState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/models/calendar_model.freezed.dart b/lib/features/calendar/models/calendar_model.freezed.dart index d10fc8f2..5e47f848 100644 --- a/lib/features/calendar/models/calendar_model.freezed.dart +++ b/lib/features/calendar/models/calendar_model.freezed.dart @@ -25,12 +25,8 @@ mixin _$CalendarModel { throw _privateConstructorUsedError; Object? get diary => throw _privateConstructorUsedError; - /// Serializes this CalendarModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of CalendarModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $CalendarModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -57,8 +53,6 @@ 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({ @@ -103,8 +97,6 @@ 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({ @@ -165,7 +157,7 @@ class _$CalendarModelImpl implements _CalendarModel { const DeepCollectionEquality().equals(other.diary, diary)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -173,9 +165,7 @@ class _$CalendarModelImpl implements _CalendarModel { is_current_day_included_in_the_chosen_diet_progression, const DeepCollectionEquality().hash(diary)); - /// Create a copy of CalendarModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => @@ -205,11 +195,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$CalendarModelImplCopyWith<_$CalendarModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart index 0e7bdbcd..c71d5226 100644 --- a/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart +++ b/lib/features/calendar/presentation/bloc/calendar_state.freezed.dart @@ -84,9 +84,6 @@ 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 @@ -103,9 +100,6 @@ 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 @@ -220,9 +214,6 @@ 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 @@ -341,8 +332,6 @@ 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({ @@ -390,9 +379,7 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded { int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_calendarList)); - /// Create a copy of CalendarState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => @@ -480,10 +467,7 @@ abstract class CalendarStateLoaded implements CalendarState { _$CalendarStateLoadedImpl; List get calendarList; - - /// Create a copy of CalendarState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -505,8 +489,6 @@ 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({ @@ -546,9 +528,7 @@ class _$CalendarStateErrorImpl implements CalendarStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of CalendarState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => @@ -635,10 +615,7 @@ abstract class CalendarStateError implements CalendarState { _$CalendarStateErrorImpl; String get errorMessage; - - /// Create a copy of CalendarState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/chat_message_model.freezed.dart b/lib/features/chat/models/chat_message_model.freezed.dart index 8f921425..76a91cbc 100644 --- a/lib/features/chat/models/chat_message_model.freezed.dart +++ b/lib/features/chat/models/chat_message_model.freezed.dart @@ -29,12 +29,8 @@ mixin _$ChatMessageModel { @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; - /// Serializes this ChatMessageModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of ChatMessageModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $ChatMessageModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -63,8 +59,6 @@ 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({ @@ -123,8 +117,6 @@ 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({ @@ -215,14 +207,12 @@ class _$ChatMessageModelImpl implements _ChatMessageModel { other.updatedAt == updatedAt)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, id, data, const DeepCollectionEquality().hash(_mediaData), authorId, updatedAt); - /// Create a copy of ChatMessageModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith => @@ -262,11 +252,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$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 852b33e4..a970241c 100644 --- a/lib/features/chat/models/chat_messages_model.freezed.dart +++ b/lib/features/chat/models/chat_messages_model.freezed.dart @@ -24,12 +24,8 @@ mixin _$ChatMessagesModel { List get messagesList => throw _privateConstructorUsedError; ChatMetaModel get meta => throw _privateConstructorUsedError; - /// Serializes this ChatMessagesModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of ChatMessagesModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $ChatMessagesModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -57,8 +53,6 @@ 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({ @@ -77,8 +71,6 @@ 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 { @@ -112,8 +104,6 @@ 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({ @@ -172,14 +162,12 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel { (identical(other.meta, meta) || other.meta == meta)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_messagesList), meta); - /// Create a copy of ChatMessagesModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith => @@ -208,11 +196,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$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 e8e4e96b..11ecb9e2 100644 --- a/lib/features/chat/models/chat_meta_model.freezed.dart +++ b/lib/features/chat/models/chat_meta_model.freezed.dart @@ -23,12 +23,8 @@ mixin _$ChatMetaModel { @JsonKey(name: "last_page") int get lastPage => throw _privateConstructorUsedError; - /// Serializes this ChatMetaModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of ChatMetaModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $ChatMetaModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -52,8 +48,6 @@ 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({ @@ -87,8 +81,6 @@ 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({ @@ -130,13 +122,11 @@ class _$ChatMetaModelImpl implements _ChatMetaModel { other.lastPage == lastPage)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, lastPage); - /// Create a copy of ChatMetaModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatMetaModelImplCopyWith<_$ChatMetaModelImpl> get copyWith => @@ -161,11 +151,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$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 6afb3a94..5a0b6e62 100644 --- a/lib/features/chat/models/chat_room_model.freezed.dart +++ b/lib/features/chat/models/chat_room_model.freezed.dart @@ -26,12 +26,8 @@ mixin _$ChatRoomModel { throw _privateConstructorUsedError; Map get users => throw _privateConstructorUsedError; - /// Serializes this ChatRoomModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of ChatRoomModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $ChatRoomModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -61,8 +57,6 @@ 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({ @@ -86,8 +80,6 @@ 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 { @@ -124,8 +116,6 @@ 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({ @@ -191,14 +181,12 @@ class _$ChatRoomModelImpl implements _ChatRoomModel { const DeepCollectionEquality().equals(other._users, _users)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, id, chatRoomSettings, const DeepCollectionEquality().hash(_users)); - /// Create a copy of ChatRoomModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatRoomModelImplCopyWith<_$ChatRoomModelImpl> get copyWith => @@ -229,11 +217,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$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 4b006cf0..8d41bd4b 100644 --- a/lib/features/chat/models/chat_room_preview_model.freezed.dart +++ b/lib/features/chat/models/chat_room_preview_model.freezed.dart @@ -23,12 +23,8 @@ mixin _$ChatRoomPreviewModel { @JsonKey(name: "chatRooms") List get chatRooms => throw _privateConstructorUsedError; - /// Serializes this ChatRoomPreviewModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of ChatRoomPreviewModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $ChatRoomPreviewModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -53,8 +49,6 @@ 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({ @@ -88,8 +82,6 @@ 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({ @@ -137,14 +129,12 @@ class _$ChatRoomPreviewModelImpl implements _ChatRoomPreviewModel { .equals(other._chatRooms, _chatRooms)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); - /// Create a copy of ChatRoomPreviewModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> @@ -171,11 +161,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$ChatRoomPreviewModelImplCopyWith<_$ChatRoomPreviewModelImpl> get copyWith => throw _privateConstructorUsedError; } @@ -195,12 +182,8 @@ mixin _$ChatRoom { @JsonKey(name: "users") Users get users => throw _privateConstructorUsedError; - /// Serializes this ChatRoom to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of ChatRoom - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $ChatRoomCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -229,8 +212,6 @@ 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({ @@ -259,8 +240,6 @@ 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 { @@ -296,8 +275,6 @@ 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({ @@ -370,14 +347,12 @@ class _$ChatRoomImpl implements _ChatRoom { (identical(other.users, users) || other.users == users)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, id, roomName, const DeepCollectionEquality().hash(lastMessage), users); - /// Create a copy of ChatRoom - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => @@ -413,11 +388,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$ChatRoomImplCopyWith<_$ChatRoomImpl> get copyWith => throw _privateConstructorUsedError; } @@ -443,12 +415,8 @@ mixin _$LastMessageClass { @JsonKey(name: "updated_at") DateTime get updatedAt => throw _privateConstructorUsedError; - /// Serializes this LastMessageClass to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of LastMessageClass - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $LastMessageClassCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -480,8 +448,6 @@ 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({ @@ -553,8 +519,6 @@ 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({ @@ -669,7 +633,7 @@ class _$LastMessageClassImpl implements _LastMessageClass { other.updatedAt == updatedAt)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -681,9 +645,7 @@ class _$LastMessageClassImpl implements _LastMessageClass { readByToUser, updatedAt); - /// Create a copy of LastMessageClass - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => @@ -734,11 +696,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$LastMessageClassImplCopyWith<_$LastMessageClassImpl> get copyWith => throw _privateConstructorUsedError; } @@ -754,12 +713,8 @@ mixin _$Users { @JsonKey(name: "to_chat_user") ChatUser get toChatUser => throw _privateConstructorUsedError; - /// Serializes this Users to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Users - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $UsersCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -786,8 +741,6 @@ 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({ @@ -806,8 +759,6 @@ 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 { @@ -816,8 +767,6 @@ 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 { @@ -852,8 +801,6 @@ 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({ @@ -906,13 +853,11 @@ class _$UsersImpl implements _Users { other.toChatUser == toChatUser)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, fromChatUser, toChatUser); - /// Create a copy of Users - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$UsersImplCopyWith<_$UsersImpl> get copyWith => @@ -940,11 +885,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$UsersImplCopyWith<_$UsersImpl> get copyWith => throw _privateConstructorUsedError; } @@ -964,12 +906,8 @@ mixin _$ChatUser { @JsonKey(name: "profile_photo_url") String get profilePhotoUrl => throw _privateConstructorUsedError; - /// Serializes this ChatUser to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of ChatUser - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $ChatUserCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -996,8 +934,6 @@ 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({ @@ -1050,8 +986,6 @@ 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({ @@ -1124,14 +1058,12 @@ class _$ChatUserImpl implements _ChatUser { other.profilePhotoUrl == profilePhotoUrl)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); - /// Create a copy of ChatUser - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatUserImplCopyWith<_$ChatUserImpl> get copyWith => @@ -1169,11 +1101,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$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 9d12eefa..4f217556 100644 --- a/lib/features/chat/models/chat_room_settings_model.freezed.dart +++ b/lib/features/chat/models/chat_room_settings_model.freezed.dart @@ -30,12 +30,8 @@ mixin _$ChatRoomSettingsModel { @JsonKey(name: 'updated_at') String get updatedAt => throw _privateConstructorUsedError; - /// Serializes this ChatRoomSettingsModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of ChatRoomSettingsModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $ChatRoomSettingsModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -65,8 +61,6 @@ 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({ @@ -127,8 +121,6 @@ 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({ @@ -210,14 +202,12 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel { other.updatedAt == updatedAt)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, id, roomName, state, accessLevel, updatedAt); - /// Create a copy of ChatRoomSettingsModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl> @@ -257,11 +247,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$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 94718168..095c09e2 100644 --- a/lib/features/chat/models/chat_user_model.freezed.dart +++ b/lib/features/chat/models/chat_user_model.freezed.dart @@ -27,12 +27,8 @@ mixin _$ChatUserModel { @JsonKey(name: 'profile_photo_url') String? get profilePhotoUrl => throw _privateConstructorUsedError; - /// Serializes this ChatUserModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of ChatUserModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $ChatUserModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -60,8 +56,6 @@ 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({ @@ -114,8 +108,6 @@ 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({ @@ -186,14 +178,12 @@ class _$ChatUserModelImpl implements _ChatUserModel { other.profilePhotoUrl == profilePhotoUrl)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, id, name, profilePhotoPath, profilePhotoUrl); - /// Create a copy of ChatUserModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatUserModelImplCopyWith<_$ChatUserModelImpl> get copyWith => @@ -228,11 +218,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$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 9cddabee..cd383a2b 100644 --- a/lib/features/chat/models/websocket_info_model.freezed.dart +++ b/lib/features/chat/models/websocket_info_model.freezed.dart @@ -27,12 +27,8 @@ mixin _$WebsocketInfoModel { @JsonKey(name: 'user_id') int get userId => throw _privateConstructorUsedError; - /// Serializes this WebsocketInfoModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of WebsocketInfoModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $WebsocketInfoModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -61,8 +57,6 @@ 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({ @@ -121,8 +115,6 @@ 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({ @@ -199,14 +191,12 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { (identical(other.userId, userId) || other.userId == userId)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, key, host, port, cluster, userId); - /// Create a copy of WebsocketInfoModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => @@ -244,11 +234,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$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 77e10e9d..9140a6bd 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 @@ -66,7 +66,7 @@ class ChatRoomCubit extends Cubit { final chatMessages = await chatRepository.getChatMessages(chatId, currentPage); lastPage = chatMessages.meta.lastPage; - await subscribeToChatChannel(initCubit: initializationCubit, chatId: chatId); + await _subscribeToChatChannel(initCubit: initializationCubit, chatId: chatId); emit(ChatRoomState.loaded( chatRoom: chatRoom, @@ -80,7 +80,7 @@ class ChatRoomCubit extends Cubit { } } - Future subscribeToChatChannel({ + Future _subscribeToChatChannel({ required InitializationCubit initCubit, required String chatId, }) async { 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 4695b4ad..43bf9df9 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,9 +90,6 @@ 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 @@ -109,9 +106,6 @@ 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 @@ -232,9 +226,6 @@ 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 @@ -365,8 +356,6 @@ 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({ @@ -395,8 +384,6 @@ 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 { @@ -455,9 +442,7 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded { int get hashCode => Object.hash(runtimeType, chatRoom, const DeepCollectionEquality().hash(_chatMessages), isTyping, isLoading); - /// Create a copy of ChatRoomState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => @@ -556,10 +541,7 @@ abstract class ChatRoomStateLoaded implements ChatRoomState { List get chatMessages; bool get isTyping; bool get isLoading; - - /// Create a copy of ChatRoomState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -581,8 +563,6 @@ 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({ @@ -622,9 +602,7 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of ChatRoomState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => @@ -717,10 +695,7 @@ abstract class ChatRoomStateError implements ChatRoomState { _$ChatRoomStateErrorImpl; String get errorMessage; - - /// Create a copy of ChatRoomState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } 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 99fa9054..9a05918d 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,9 +84,6 @@ 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 @@ -103,9 +100,6 @@ 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 @@ -222,9 +216,6 @@ 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 @@ -343,8 +334,6 @@ 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({ @@ -384,9 +373,7 @@ class _$ChatSelectStateErrorImpl implements ChatSelectStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of ChatSelectState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> @@ -474,10 +461,7 @@ abstract class ChatSelectStateError implements ChatSelectState { _$ChatSelectStateErrorImpl; String get errorMessage; - - /// Create a copy of ChatSelectState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$ChatSelectStateErrorImplCopyWith<_$ChatSelectStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } @@ -500,8 +484,6 @@ 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({ @@ -548,9 +530,7 @@ class _$ChatSelectStateLoadedImpl implements ChatSelectStateLoaded { int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_chatRooms)); - /// Create a copy of ChatSelectState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ChatSelectStateLoadedImplCopyWith<_$ChatSelectStateLoadedImpl> @@ -637,10 +617,7 @@ abstract class ChatSelectStateLoaded implements ChatSelectState { {required final List chatRooms}) = _$ChatSelectStateLoadedImpl; List get chatRooms; - - /// Create a copy of ChatSelectState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$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 e5c2a4cd..a95c93fd 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -1,6 +1,4 @@ import 'dart:io'; - -import 'package:audioplayers/audioplayers.dart'; 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'; diff --git a/lib/features/diary/models/diary_model.freezed.dart b/lib/features/diary/models/diary_model.freezed.dart index ceabd5db..a02a4621 100644 --- a/lib/features/diary/models/diary_model.freezed.dart +++ b/lib/features/diary/models/diary_model.freezed.dart @@ -29,12 +29,8 @@ mixin _$DiaryModel { DateTime? get wakeup => throw _privateConstructorUsedError; DateTime? get retire => throw _privateConstructorUsedError; - /// Serializes this DiaryModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of DiaryModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $DiaryModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -68,8 +64,6 @@ 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({ @@ -118,8 +112,6 @@ 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 { @@ -159,8 +151,6 @@ 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({ @@ -270,7 +260,7 @@ class _$DiaryModelImpl implements _DiaryModel { (identical(other.retire, retire) || other.retire == retire)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -283,9 +273,7 @@ class _$DiaryModelImpl implements _DiaryModel { wakeup, retire); - /// Create a copy of DiaryModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => @@ -329,11 +317,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$DiaryModelImplCopyWith<_$DiaryModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/meal.freezed.dart b/lib/features/diary/models/meal.freezed.dart index 2bd6c478..2c249b06 100644 --- a/lib/features/diary/models/meal.freezed.dart +++ b/lib/features/diary/models/meal.freezed.dart @@ -28,12 +28,8 @@ mixin _$Meal { List get portions => throw _privateConstructorUsedError; List get photos => throw _privateConstructorUsedError; - /// Serializes this Meal to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Meal - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $MealCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -62,8 +58,6 @@ 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({ @@ -132,8 +126,6 @@ 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({ @@ -240,7 +232,7 @@ class _$MealImpl implements _Meal { const DeepCollectionEquality().equals(other._photos, _photos)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -252,9 +244,7 @@ class _$MealImpl implements _Meal { const DeepCollectionEquality().hash(_portions), const DeepCollectionEquality().hash(_photos)); - /// Create a copy of Meal - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$MealImplCopyWith<_$MealImpl> get copyWith => @@ -294,11 +284,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$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 8f5e0152..2d9c70bd 100644 --- a/lib/features/diary/models/photo.freezed.dart +++ b/lib/features/diary/models/photo.freezed.dart @@ -25,12 +25,8 @@ mixin _$Photo { String get originalName => throw _privateConstructorUsedError; String get path => throw _privateConstructorUsedError; - /// Serializes this Photo to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Photo - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $PhotoCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -55,8 +51,6 @@ 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({ @@ -102,8 +96,6 @@ 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({ @@ -163,13 +155,11 @@ class _$PhotoImpl implements _Photo { (identical(other.path, path) || other.path == path)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, id, originalName, path); - /// Create a copy of Photo - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => @@ -198,11 +188,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$PhotoImplCopyWith<_$PhotoImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/portion.freezed.dart b/lib/features/diary/models/portion.freezed.dart index 4bef02d4..77627c29 100644 --- a/lib/features/diary/models/portion.freezed.dart +++ b/lib/features/diary/models/portion.freezed.dart @@ -26,12 +26,8 @@ mixin _$Portion { String get portion => throw _privateConstructorUsedError; bool get from_diet => throw _privateConstructorUsedError; - /// Serializes this Portion to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Portion - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $PortionCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -58,8 +54,6 @@ 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({ @@ -117,8 +111,6 @@ 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({ @@ -197,14 +189,12 @@ class _$PortionImpl implements _Portion { other.from_diet == from_diet)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, id, product_name, quantity, portion, from_diet); - /// Create a copy of Portion - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$PortionImplCopyWith<_$PortionImpl> get copyWith => @@ -238,11 +228,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$PortionImplCopyWith<_$PortionImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/product.freezed.dart b/lib/features/diary/models/product.freezed.dart index 610656fb..d30ada33 100644 --- a/lib/features/diary/models/product.freezed.dart +++ b/lib/features/diary/models/product.freezed.dart @@ -23,12 +23,8 @@ mixin _$Product { int get id => throw _privateConstructorUsedError; String get name => throw _privateConstructorUsedError; - /// Serializes this Product to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Product - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $ProductCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -50,8 +46,6 @@ 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({ @@ -89,8 +83,6 @@ 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({ @@ -137,13 +129,11 @@ class _$ProductImpl implements _Product { (identical(other.name, name) || other.name == name)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, id, name); - /// Create a copy of Product - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ProductImplCopyWith<_$ProductImpl> get copyWith => @@ -167,11 +157,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$ProductImplCopyWith<_$ProductImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/models/state.freezed.dart b/lib/features/diary/models/state.freezed.dart index 6b9c50fb..599ec29f 100644 --- a/lib/features/diary/models/state.freezed.dart +++ b/lib/features/diary/models/state.freezed.dart @@ -23,12 +23,8 @@ 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; - - /// Create a copy of State - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $StateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -50,8 +46,6 @@ 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({ @@ -89,8 +83,6 @@ 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({ @@ -140,14 +132,12 @@ class _$StateImpl implements _State { other.has_chosen_plan == has_chosen_plan)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, has_chosen_diet, has_chosen_plan); - /// Create a copy of State - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$StateImplCopyWith<_$StateImpl> get copyWith => @@ -172,11 +162,8 @@ 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(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$StateImplCopyWith<_$StateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/diary/presentation/bloc/diary_state.freezed.dart b/lib/features/diary/presentation/bloc/diary_state.freezed.dart index 98d7019f..5a9bbc12 100644 --- a/lib/features/diary/presentation/bloc/diary_state.freezed.dart +++ b/lib/features/diary/presentation/bloc/diary_state.freezed.dart @@ -174,9 +174,6 @@ 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 @@ -193,9 +190,6 @@ 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 @@ -403,8 +397,6 @@ 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({ @@ -443,9 +435,7 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { @override int get hashCode => Object.hash(runtimeType, id); - /// Create a copy of DiaryState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => @@ -621,10 +611,7 @@ abstract class DiaryStateLoading implements DiaryState { const factory DiaryStateLoading({final int? id}) = _$DiaryStateLoadingImpl; int? get id; - - /// Create a copy of DiaryState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$DiaryStateLoadingImplCopyWith<_$DiaryStateLoadingImpl> get copyWith => throw _privateConstructorUsedError; } @@ -679,8 +666,6 @@ 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({ @@ -834,8 +819,6 @@ 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 { @@ -844,8 +827,6 @@ 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 { @@ -854,8 +835,6 @@ 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 { @@ -1121,9 +1100,7 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { const DeepCollectionEquality().hash(_chartDataCounted) ]); - /// Create a copy of DiaryState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => @@ -1443,10 +1420,7 @@ abstract class DiaryStateLoaded implements DiaryState { bool get isLoading; bool get isAdded; List? get chartDataCounted; - - /// Create a copy of DiaryState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$DiaryStateLoadedImplCopyWith<_$DiaryStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1468,8 +1442,6 @@ 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({ @@ -1509,9 +1481,7 @@ class _$DiaryStateErrorImpl implements DiaryStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of DiaryState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => @@ -1688,10 +1658,7 @@ abstract class DiaryStateError implements DiaryState { _$DiaryStateErrorImpl; String get errorMessage; - - /// Create a copy of DiaryState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$DiaryStateErrorImplCopyWith<_$DiaryStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/comment_model.freezed.dart b/lib/features/feed/models/comment_model.freezed.dart index 9dc150e4..3f088135 100644 --- a/lib/features/feed/models/comment_model.freezed.dart +++ b/lib/features/feed/models/comment_model.freezed.dart @@ -27,12 +27,8 @@ mixin _$Comment { @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; - /// Serializes this Comment to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Comment - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $CommentCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -60,8 +56,6 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> // 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({ @@ -85,8 +79,6 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> ) as $Val); } - /// Create a copy of Comment - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $LinksCopyWith<$Res> get links { @@ -95,8 +87,6 @@ class _$CommentCopyWithImpl<$Res, $Val extends Comment> }); } - /// Create a copy of Comment - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $MetaCopyWith<$Res> get meta { @@ -132,8 +122,6 @@ class __$$CommentImplCopyWithImpl<$Res> _$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({ @@ -201,14 +189,12 @@ class _$CommentImpl implements _Comment { (identical(other.meta, meta) || other.meta == meta)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_data), links, meta); - /// Create a copy of Comment - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$CommentImplCopyWith<_$CommentImpl> get copyWith => @@ -239,11 +225,8 @@ abstract class _Comment implements Comment { @override @JsonKey(name: "meta") Meta get meta; - - /// Create a copy of Comment - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$CommentImplCopyWith<_$CommentImpl> get copyWith => throw _privateConstructorUsedError; } @@ -265,12 +248,8 @@ mixin _$Datum { @JsonKey(name: "children_comments") List get childrenComments => throw _privateConstructorUsedError; - /// Serializes this Datum to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Datum - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $DatumCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -297,8 +276,6 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of Datum - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -356,8 +333,6 @@ class __$$DatumImplCopyWithImpl<$Res> _$DatumImpl _value, $Res Function(_$DatumImpl) _then) : super(_value, _then); - /// Create a copy of Datum - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -449,7 +424,7 @@ class _$DatumImpl implements _Datum { .equals(other._childrenComments, _childrenComments)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -459,9 +434,7 @@ class _$DatumImpl implements _Datum { body, const DeepCollectionEquality().hash(_childrenComments)); - /// Create a copy of Datum - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$DatumImplCopyWith<_$DatumImpl> get copyWith => @@ -502,11 +475,8 @@ abstract class _Datum implements Datum { @override @JsonKey(name: "children_comments") List get childrenComments; - - /// Create a copy of Datum - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$DatumImplCopyWith<_$DatumImpl> get copyWith => throw _privateConstructorUsedError; } @@ -526,12 +496,8 @@ mixin _$Links { @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) + @JsonKey(ignore: true) $LinksCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -557,8 +523,6 @@ class _$LinksCopyWithImpl<$Res, $Val extends Links> // 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({ @@ -610,8 +574,6 @@ class __$$LinksImplCopyWithImpl<$Res> _$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({ @@ -682,7 +644,7 @@ class _$LinksImpl implements _Links { const DeepCollectionEquality().equals(other.next, next)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -691,9 +653,7 @@ class _$LinksImpl implements _Links { 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) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$LinksImplCopyWith<_$LinksImpl> get copyWith => @@ -728,11 +688,8 @@ abstract class _Links implements Links { @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) + @JsonKey(ignore: true) _$$LinksImplCopyWith<_$LinksImpl> get copyWith => throw _privateConstructorUsedError; } @@ -760,12 +717,8 @@ mixin _$Meta { @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) + @JsonKey(ignore: true) $MetaCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -795,8 +748,6 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> // 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({ @@ -871,8 +822,6 @@ class __$$MetaImplCopyWithImpl<$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({ @@ -992,14 +941,12 @@ class _$MetaImpl implements _Meta { (identical(other.total, total) || other.total == total)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, currentPage, from, lastPage, const DeepCollectionEquality().hash(_links), path, perPage, to, total); - /// Create a copy of Meta - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$MetaImplCopyWith<_$MetaImpl> get copyWith => @@ -1050,11 +997,8 @@ abstract class _Meta implements Meta { @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) + @JsonKey(ignore: true) _$$MetaImplCopyWith<_$MetaImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1072,12 +1016,8 @@ mixin _$Link { @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) + @JsonKey(ignore: true) $LinkCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1102,8 +1042,6 @@ class _$LinkCopyWithImpl<$Res, $Val extends Link> // 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({ @@ -1148,8 +1086,6 @@ class __$$LinkImplCopyWithImpl<$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({ @@ -1210,13 +1146,11 @@ class _$LinkImpl implements _Link { (identical(other.active, active) || other.active == active)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @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) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$LinkImplCopyWith<_$LinkImpl> get copyWith => @@ -1247,11 +1181,8 @@ abstract class _Link implements Link { @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) + @JsonKey(ignore: true) _$$LinkImplCopyWith<_$LinkImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/diets_pagination_model.freezed.dart b/lib/features/feed/models/diets_pagination_model.freezed.dart index 5fa7d5dc..2c402671 100644 --- a/lib/features/feed/models/diets_pagination_model.freezed.dart +++ b/lib/features/feed/models/diets_pagination_model.freezed.dart @@ -27,12 +27,8 @@ mixin _$DietsPagination { @JsonKey(name: "meta") Meta get meta => throw _privateConstructorUsedError; - /// Serializes this DietsPagination to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of DietsPagination - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $DietsPaginationCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -62,8 +58,6 @@ class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of DietsPagination - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -87,8 +81,6 @@ class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> ) as $Val); } - /// Create a copy of DietsPagination - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $LinksCopyWith<$Res> get links { @@ -97,8 +89,6 @@ class _$DietsPaginationCopyWithImpl<$Res, $Val extends DietsPagination> }); } - /// Create a copy of DietsPagination - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $MetaCopyWith<$Res> get meta { @@ -135,8 +125,6 @@ class __$$DietsPaginationImplCopyWithImpl<$Res> _$DietsPaginationImpl _value, $Res Function(_$DietsPaginationImpl) _then) : super(_value, _then); - /// Create a copy of DietsPagination - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -204,14 +192,12 @@ class _$DietsPaginationImpl implements _DietsPagination { (identical(other.meta, meta) || other.meta == meta)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_data), links, meta); - /// Create a copy of DietsPagination - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => @@ -244,11 +230,8 @@ abstract class _DietsPagination implements DietsPagination { @override @JsonKey(name: "meta") Meta get meta; - - /// Create a copy of DietsPagination - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$DietsPaginationImplCopyWith<_$DietsPaginationImpl> get copyWith => throw _privateConstructorUsedError; } @@ -285,12 +268,8 @@ mixin _$Datum { @JsonKey(name: "total_comments") int get totalComments => throw _privateConstructorUsedError; - /// Serializes this Datum to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Datum - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $DatumCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -328,8 +307,6 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of Datum - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -398,8 +375,6 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum> ) as $Val); } - /// Create a copy of Datum - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $TypeCopyWith<$Res> get type { @@ -408,8 +383,6 @@ class _$DatumCopyWithImpl<$Res, $Val extends Datum> }); } - /// Create a copy of Datum - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $AuthorCopyWith<$Res> get author { @@ -455,8 +428,6 @@ class __$$DatumImplCopyWithImpl<$Res> _$DatumImpl _value, $Res Function(_$DatumImpl) _then) : super(_value, _then); - /// Create a copy of Datum - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -620,7 +591,7 @@ class _$DatumImpl implements _Datum { other.totalComments == totalComments)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -637,9 +608,7 @@ class _$DatumImpl implements _Datum { totalViews, totalComments); - /// Create a copy of Datum - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$DatumImplCopyWith<_$DatumImpl> get copyWith => @@ -708,11 +677,8 @@ abstract class _Datum implements Datum { @override @JsonKey(name: "total_comments") int get totalComments; - - /// Create a copy of Datum - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$DatumImplCopyWith<_$DatumImpl> get copyWith => throw _privateConstructorUsedError; } @@ -732,12 +698,8 @@ mixin _$Author { @JsonKey(name: "author_is_me") bool get authorIsMe => throw _privateConstructorUsedError; - /// Serializes this Author to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Author - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $AuthorCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -763,8 +725,6 @@ class _$AuthorCopyWithImpl<$Res, $Val extends Author> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of Author - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -816,8 +776,6 @@ class __$$AuthorImplCopyWithImpl<$Res> _$AuthorImpl _value, $Res Function(_$AuthorImpl) _then) : super(_value, _then); - /// Create a copy of Author - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -892,14 +850,12 @@ class _$AuthorImpl implements _Author { other.authorIsMe == authorIsMe)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, authorSlug, authorName, authorProfileIcon, authorIsMe); - /// Create a copy of Author - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => @@ -936,11 +892,8 @@ abstract class _Author implements Author { @override @JsonKey(name: "author_is_me") bool get authorIsMe; - - /// Create a copy of Author - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$AuthorImplCopyWith<_$AuthorImpl> get copyWith => throw _privateConstructorUsedError; } @@ -960,12 +913,8 @@ mixin _$DailySchedule { @JsonKey(name: "quantity") int get quantity => throw _privateConstructorUsedError; - /// Serializes this DailySchedule to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of DailySchedule - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $DailyScheduleCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -993,8 +942,6 @@ class _$DailyScheduleCopyWithImpl<$Res, $Val extends DailySchedule> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of DailySchedule - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1047,8 +994,6 @@ class __$$DailyScheduleImplCopyWithImpl<$Res> _$DailyScheduleImpl _value, $Res Function(_$DailyScheduleImpl) _then) : super(_value, _then); - /// Create a copy of DailySchedule - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1120,13 +1065,11 @@ class _$DailyScheduleImpl implements _DailySchedule { other.quantity == quantity)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, name, uniq, portion, quantity); - /// Create a copy of DailySchedule - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => @@ -1163,11 +1106,8 @@ abstract class _DailySchedule implements DailySchedule { @override @JsonKey(name: "quantity") int get quantity; - - /// Create a copy of DailySchedule - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$DailyScheduleImplCopyWith<_$DailyScheduleImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1187,12 +1127,8 @@ mixin _$Type { @JsonKey(name: "meat") bool? get meat => throw _privateConstructorUsedError; - /// Serializes this Type to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Type - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $TypeCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1218,8 +1154,6 @@ class _$TypeCopyWithImpl<$Res, $Val extends Type> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of Type - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1270,8 +1204,6 @@ class __$$TypeImplCopyWithImpl<$Res> __$$TypeImplCopyWithImpl(_$TypeImpl _value, $Res Function(_$TypeImpl) _then) : super(_value, _then); - /// Create a copy of Type - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1342,13 +1274,11 @@ class _$TypeImpl implements _Type { (identical(other.meat, meat) || other.meat == meat)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, alko, veg, corb, meat); - /// Create a copy of Type - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$TypeImplCopyWith<_$TypeImpl> get copyWith => @@ -1383,11 +1313,8 @@ abstract class _Type implements Type { @override @JsonKey(name: "meat") bool? get meat; - - /// Create a copy of Type - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$TypeImplCopyWith<_$TypeImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1407,12 +1334,8 @@ mixin _$Links { @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) + @JsonKey(ignore: true) $LinksCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1438,8 +1361,6 @@ class _$LinksCopyWithImpl<$Res, $Val extends Links> // 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({ @@ -1491,8 +1412,6 @@ class __$$LinksImplCopyWithImpl<$Res> _$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({ @@ -1563,7 +1482,7 @@ class _$LinksImpl implements _Links { const DeepCollectionEquality().equals(other.next, next)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -1572,9 +1491,7 @@ class _$LinksImpl implements _Links { 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) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$LinksImplCopyWith<_$LinksImpl> get copyWith => @@ -1609,11 +1526,8 @@ abstract class _Links implements Links { @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) + @JsonKey(ignore: true) _$$LinksImplCopyWith<_$LinksImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1641,12 +1555,8 @@ mixin _$Meta { @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) + @JsonKey(ignore: true) $MetaCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1676,8 +1586,6 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta> // 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({ @@ -1752,8 +1660,6 @@ class __$$MetaImplCopyWithImpl<$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({ @@ -1873,14 +1779,12 @@ class _$MetaImpl implements _Meta { (identical(other.total, total) || other.total == total)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, currentPage, from, lastPage, const DeepCollectionEquality().hash(_links), path, perPage, to, total); - /// Create a copy of Meta - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$MetaImplCopyWith<_$MetaImpl> get copyWith => @@ -1931,11 +1835,8 @@ abstract class _Meta implements Meta { @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) + @JsonKey(ignore: true) _$$MetaImplCopyWith<_$MetaImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1953,12 +1854,8 @@ mixin _$Link { @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) + @JsonKey(ignore: true) $LinkCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1983,8 +1880,6 @@ class _$LinkCopyWithImpl<$Res, $Val extends Link> // 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({ @@ -2029,8 +1924,6 @@ class __$$LinkImplCopyWithImpl<$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({ @@ -2091,13 +1984,11 @@ class _$LinkImpl implements _Link { (identical(other.active, active) || other.active == active)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @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) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$LinkImplCopyWith<_$LinkImpl> get copyWith => @@ -2128,11 +2019,8 @@ abstract class _Link implements Link { @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) + @JsonKey(ignore: true) _$$LinkImplCopyWith<_$LinkImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/feed_blog_post_model.freezed.dart b/lib/features/feed/models/feed_blog_post_model.freezed.dart index 89087373..08d5527a 100644 --- a/lib/features/feed/models/feed_blog_post_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_model.freezed.dart @@ -41,12 +41,8 @@ mixin _$FeedBlogPostModel { @JsonKey(name: "was_liked_by_me") bool get wasLikedByMe => throw _privateConstructorUsedError; - /// Serializes this FeedBlogPostModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of FeedBlogPostModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $FeedBlogPostModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -85,8 +81,6 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of FeedBlogPostModel - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -160,8 +154,6 @@ class _$FeedBlogPostModelCopyWithImpl<$Res, $Val extends FeedBlogPostModel> ) as $Val); } - /// Create a copy of FeedBlogPostModel - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $AuthorCopyWith<$Res> get author { @@ -206,8 +198,6 @@ class __$$FeedBlogPostModelImplCopyWithImpl<$Res> $Res Function(_$FeedBlogPostModelImpl) _then) : super(_value, _then); - /// Create a copy of FeedBlogPostModel - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -370,7 +360,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { other.wasLikedByMe == wasLikedByMe)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -388,9 +378,7 @@ class _$FeedBlogPostModelImpl implements _FeedBlogPostModel { totalComments, wasLikedByMe); - /// Create a copy of FeedBlogPostModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => @@ -458,11 +446,8 @@ abstract class _FeedBlogPostModel implements FeedBlogPostModel { @override @JsonKey(name: "was_liked_by_me") bool get wasLikedByMe; - - /// Create a copy of FeedBlogPostModel - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$FeedBlogPostModelImplCopyWith<_$FeedBlogPostModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart b/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart index 9bddceae..c680d82e 100644 --- a/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart +++ b/lib/features/feed/models/feed_blog_post_settings_model.freezed.dart @@ -26,12 +26,8 @@ mixin _$FeedBlogPostSettingsModel { throw _privateConstructorUsedError; Meta get meta => throw _privateConstructorUsedError; - /// Serializes this FeedBlogPostSettingsModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of FeedBlogPostSettingsModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $FeedBlogPostSettingsModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -60,8 +56,6 @@ class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of FeedBlogPostSettingsModel - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -80,8 +74,6 @@ class _$FeedBlogPostSettingsModelCopyWithImpl<$Res, ) as $Val); } - /// Create a copy of FeedBlogPostSettingsModel - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $MetaCopyWith<$Res> get meta { @@ -118,8 +110,6 @@ class __$$FeedBlogPostSettingsModelImplCopyWithImpl<$Res> $Res Function(_$FeedBlogPostSettingsModelImpl) _then) : super(_value, _then); - /// Create a copy of FeedBlogPostSettingsModel - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -179,14 +169,12 @@ class _$FeedBlogPostSettingsModelImpl implements _FeedBlogPostSettingsModel { (identical(other.meta, meta) || other.meta == meta)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList), meta); - /// Create a copy of FeedBlogPostSettingsModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> @@ -215,11 +203,8 @@ abstract class _FeedBlogPostSettingsModel implements FeedBlogPostSettingsModel { List get feedBlogPostList; @override Meta get meta; - - /// Create a copy of FeedBlogPostSettingsModel - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$FeedBlogPostSettingsModelImplCopyWith<_$FeedBlogPostSettingsModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/recipes_model.freezed.dart b/lib/features/feed/models/recipes_model.freezed.dart index 9dd4f54e..26cd55e3 100644 --- a/lib/features/feed/models/recipes_model.freezed.dart +++ b/lib/features/feed/models/recipes_model.freezed.dart @@ -45,12 +45,8 @@ mixin _$Recipes { int get viewsCount => throw _privateConstructorUsedError; Author get author => throw _privateConstructorUsedError; - /// Serializes this Recipes to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Recipes - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $RecipesCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -91,8 +87,6 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of Recipes - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -186,8 +180,6 @@ class _$RecipesCopyWithImpl<$Res, $Val extends Recipes> ) as $Val); } - /// Create a copy of Recipes - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $AuthorCopyWith<$Res> get author { @@ -235,8 +227,6 @@ class __$$RecipesImplCopyWithImpl<$Res> _$RecipesImpl _value, $Res Function(_$RecipesImpl) _then) : super(_value, _then); - /// Create a copy of Recipes - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -450,7 +440,7 @@ class _$RecipesImpl implements _Recipes { (identical(other.author, author) || other.author == author)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -472,9 +462,7 @@ class _$RecipesImpl implements _Recipes { viewsCount, author); - /// Create a copy of Recipes - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => @@ -551,11 +539,8 @@ abstract class _Recipes implements Recipes { int get viewsCount; @override Author get author; - - /// Create a copy of Recipes - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$RecipesImplCopyWith<_$RecipesImpl> get copyWith => throw _privateConstructorUsedError; } @@ -570,12 +555,8 @@ mixin _$Ingredient { String? get unit => throw _privateConstructorUsedError; String get portion => throw _privateConstructorUsedError; - /// Serializes this Ingredient to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Ingredient - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $IngredientCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -599,8 +580,6 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of Ingredient - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -644,8 +623,6 @@ class __$$IngredientImplCopyWithImpl<$Res> _$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) : super(_value, _then); - /// Create a copy of Ingredient - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -701,13 +678,11 @@ class _$IngredientImpl implements _Ingredient { (identical(other.portion, portion) || other.portion == portion)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, name, unit, portion); - /// Create a copy of Ingredient - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => @@ -736,11 +711,8 @@ abstract class _Ingredient implements Ingredient { String? get unit; @override String get portion; - - /// Create a copy of Ingredient - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => throw _privateConstructorUsedError; } @@ -754,12 +726,8 @@ mixin _$Step { String get image => throw _privateConstructorUsedError; String get description => throw _privateConstructorUsedError; - /// Serializes this Step to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Step - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $StepCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -781,8 +749,6 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of Step - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -819,8 +785,6 @@ class __$$StepImplCopyWithImpl<$Res> __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) : super(_value, _then); - /// Create a copy of Step - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -868,13 +832,11 @@ class _$StepImpl implements _Step { other.description == description)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, image, description); - /// Create a copy of Step - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$StepImplCopyWith<_$StepImpl> get copyWith => @@ -899,11 +861,8 @@ abstract class _Step implements Step { String get image; @override String get description; - - /// Create a copy of Step - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$StepImplCopyWith<_$StepImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/models/recipes_pagination_model.freezed.dart b/lib/features/feed/models/recipes_pagination_model.freezed.dart index ca8e9f92..2f0d43fb 100644 --- a/lib/features/feed/models/recipes_pagination_model.freezed.dart +++ b/lib/features/feed/models/recipes_pagination_model.freezed.dart @@ -23,12 +23,8 @@ mixin _$RecipesPagination { @JsonKey(name: 'data') List get recipesList => throw _privateConstructorUsedError; - /// Serializes this RecipesPagination to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of RecipesPagination - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $RecipesPaginationCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -52,8 +48,6 @@ class _$RecipesPaginationCopyWithImpl<$Res, $Val extends RecipesPagination> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of RecipesPagination - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -87,8 +81,6 @@ class __$$RecipesPaginationImplCopyWithImpl<$Res> $Res Function(_$RecipesPaginationImpl) _then) : super(_value, _then); - /// Create a copy of RecipesPagination - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -136,14 +128,12 @@ class _$RecipesPaginationImpl implements _RecipesPagination { .equals(other._recipesList, _recipesList)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_recipesList)); - /// Create a copy of RecipesPagination - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => @@ -169,11 +159,8 @@ abstract class _RecipesPagination implements RecipesPagination { @override @JsonKey(name: 'data') List get recipesList; - - /// Create a copy of RecipesPagination - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$RecipesPaginationImplCopyWith<_$RecipesPaginationImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart index 297a668c..da3d0345 100644 --- a/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/comments_cubit/comments_state.freezed.dart @@ -84,9 +84,6 @@ class _$CommentsStateCopyWithImpl<$Res, $Val extends CommentsState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; - - /// Create a copy of CommentsState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -103,9 +100,6 @@ class __$$CommentsStateImplCopyWithImpl<$Res> __$$CommentsStateImplCopyWithImpl( _$CommentsStateImpl _value, $Res Function(_$CommentsStateImpl) _then) : super(_value, _then); - - /// Create a copy of CommentsState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -220,9 +214,6 @@ class __$$CommentsStateLoadingImplCopyWithImpl<$Res> __$$CommentsStateLoadingImplCopyWithImpl(_$CommentsStateLoadingImpl _value, $Res Function(_$CommentsStateLoadingImpl) _then) : super(_value, _then); - - /// Create a copy of CommentsState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -343,8 +334,6 @@ class __$$CommentsStateLoadedImplCopyWithImpl<$Res> $Res Function(_$CommentsStateLoadedImpl) _then) : super(_value, _then); - /// Create a copy of CommentsState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -358,8 +347,6 @@ class __$$CommentsStateLoadedImplCopyWithImpl<$Res> )); } - /// Create a copy of CommentsState - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $CommentCopyWith<$Res> get comment { @@ -393,9 +380,7 @@ class _$CommentsStateLoadedImpl implements CommentsStateLoaded { @override int get hashCode => Object.hash(runtimeType, comment); - /// Create a copy of CommentsState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => @@ -482,10 +467,7 @@ abstract class CommentsStateLoaded implements CommentsState { _$CommentsStateLoadedImpl; Comment get comment; - - /// Create a copy of CommentsState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$CommentsStateLoadedImplCopyWith<_$CommentsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -507,8 +489,6 @@ class __$$CommentsStateErrorImplCopyWithImpl<$Res> $Res Function(_$CommentsStateErrorImpl) _then) : super(_value, _then); - /// Create a copy of CommentsState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -548,9 +528,7 @@ class _$CommentsStateErrorImpl implements CommentsStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of CommentsState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => @@ -637,10 +615,7 @@ abstract class CommentsStateError implements CommentsState { _$CommentsStateErrorImpl; String get errorMessage; - - /// Create a copy of CommentsState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$CommentsStateErrorImplCopyWith<_$CommentsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart b/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart index dd30f73d..adff30f5 100644 --- a/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/diets_cubit/diets_state.freezed.dart @@ -84,9 +84,6 @@ class _$DietsStateCopyWithImpl<$Res, $Val extends DietsState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; - - /// Create a copy of DietsState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -103,9 +100,6 @@ class __$$DietsStateImplCopyWithImpl<$Res> __$$DietsStateImplCopyWithImpl( _$DietsStateImpl _value, $Res Function(_$DietsStateImpl) _then) : super(_value, _then); - - /// Create a copy of DietsState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -220,9 +214,6 @@ class __$$DietsStateLoadingImplCopyWithImpl<$Res> __$$DietsStateLoadingImplCopyWithImpl(_$DietsStateLoadingImpl _value, $Res Function(_$DietsStateLoadingImpl) _then) : super(_value, _then); - - /// Create a copy of DietsState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -342,8 +333,6 @@ class __$$DietsStateLoadedImplCopyWithImpl<$Res> $Res Function(_$DietsStateLoadedImpl) _then) : super(_value, _then); - /// Create a copy of DietsState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -357,8 +346,6 @@ class __$$DietsStateLoadedImplCopyWithImpl<$Res> )); } - /// Create a copy of DietsState - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $DietsPaginationCopyWith<$Res> get diets { @@ -392,9 +379,7 @@ class _$DietsStateLoadedImpl implements DietsStateLoaded { @override int get hashCode => Object.hash(runtimeType, diets); - /// Create a copy of DietsState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => @@ -481,10 +466,7 @@ abstract class DietsStateLoaded implements DietsState { _$DietsStateLoadedImpl; DietsPagination get diets; - - /// Create a copy of DietsState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$DietsStateLoadedImplCopyWith<_$DietsStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -506,8 +488,6 @@ class __$$DietsStateErrorImplCopyWithImpl<$Res> _$DietsStateErrorImpl _value, $Res Function(_$DietsStateErrorImpl) _then) : super(_value, _then); - /// Create a copy of DietsState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -547,9 +527,7 @@ class _$DietsStateErrorImpl implements DietsStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of DietsState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => @@ -636,10 +614,7 @@ abstract class DietsStateError implements DietsState { _$DietsStateErrorImpl; String get errorMessage; - - /// Create a copy of DietsState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$DietsStateErrorImplCopyWith<_$DietsStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart b/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart index 70cb30d4..779dcdb5 100644 --- a/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/feed_cubit/feed_state.freezed.dart @@ -87,9 +87,6 @@ class _$FeedStateCopyWithImpl<$Res, $Val extends FeedState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; - - /// Create a copy of FeedState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -106,9 +103,6 @@ class __$$FeedStateImplCopyWithImpl<$Res> __$$FeedStateImplCopyWithImpl( _$FeedStateImpl _value, $Res Function(_$FeedStateImpl) _then) : super(_value, _then); - - /// Create a copy of FeedState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -227,9 +221,6 @@ class __$$FeedStateLoadingImplCopyWithImpl<$Res> __$$FeedStateLoadingImplCopyWithImpl(_$FeedStateLoadingImpl _value, $Res Function(_$FeedStateLoadingImpl) _then) : super(_value, _then); - - /// Create a copy of FeedState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -351,8 +342,6 @@ class __$$FeedStateLoadedImplCopyWithImpl<$Res> _$FeedStateLoadedImpl _value, $Res Function(_$FeedStateLoadedImpl) _then) : super(_value, _then); - /// Create a copy of FeedState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -412,9 +401,7 @@ class _$FeedStateLoadedImpl implements FeedStateLoaded { int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_feedBlogPostList), isLoading); - /// Create a copy of FeedState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => @@ -507,10 +494,7 @@ abstract class FeedStateLoaded implements FeedState { List get feedBlogPostList; bool get isLoading; - - /// Create a copy of FeedState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$FeedStateLoadedImplCopyWith<_$FeedStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -532,8 +516,6 @@ class __$$FeedStateErrorImplCopyWithImpl<$Res> _$FeedStateErrorImpl _value, $Res Function(_$FeedStateErrorImpl) _then) : super(_value, _then); - /// Create a copy of FeedState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -573,9 +555,7 @@ class _$FeedStateErrorImpl implements FeedStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of FeedState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => @@ -666,10 +646,7 @@ abstract class FeedStateError implements FeedState { _$FeedStateErrorImpl; String get errorMessage; - - /// Create a copy of FeedState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$FeedStateErrorImplCopyWith<_$FeedStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart index 056ef8be..e8aa88e0 100644 --- a/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart +++ b/lib/features/feed/presentation/bloc/recipes_cubit/recipes_state.freezed.dart @@ -84,9 +84,6 @@ class _$RecipesStateCopyWithImpl<$Res, $Val extends RecipesState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; - - /// Create a copy of RecipesState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -103,9 +100,6 @@ class __$$RecipesStateImplCopyWithImpl<$Res> __$$RecipesStateImplCopyWithImpl( _$RecipesStateImpl _value, $Res Function(_$RecipesStateImpl) _then) : super(_value, _then); - - /// Create a copy of RecipesState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -220,9 +214,6 @@ class __$$RecipesStateLoadingImplCopyWithImpl<$Res> __$$RecipesStateLoadingImplCopyWithImpl(_$RecipesStateLoadingImpl _value, $Res Function(_$RecipesStateLoadingImpl) _then) : super(_value, _then); - - /// Create a copy of RecipesState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -341,8 +332,6 @@ class __$$RecipesStateLoadedImplCopyWithImpl<$Res> $Res Function(_$RecipesStateLoadedImpl) _then) : super(_value, _then); - /// Create a copy of RecipesState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -389,9 +378,7 @@ class _$RecipesStateLoadedImpl implements RecipesStateLoaded { int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_recipesList)); - /// Create a copy of RecipesState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => @@ -478,10 +465,7 @@ abstract class RecipesStateLoaded implements RecipesState { _$RecipesStateLoadedImpl; List get recipesList; - - /// Create a copy of RecipesState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$RecipesStateLoadedImplCopyWith<_$RecipesStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -503,8 +487,6 @@ class __$$RecipesStateErrorImplCopyWithImpl<$Res> $Res Function(_$RecipesStateErrorImpl) _then) : super(_value, _then); - /// Create a copy of RecipesState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -544,9 +526,7 @@ class _$RecipesStateErrorImpl implements RecipesStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of RecipesState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => @@ -633,10 +613,7 @@ abstract class RecipesStateError implements RecipesState { _$RecipesStateErrorImpl; String get errorMessage; - - /// Create a copy of RecipesState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$RecipesStateErrorImplCopyWith<_$RecipesStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/feed/services/feed_service.g.dart b/lib/features/feed/services/feed_service.g.dart index ab608334..6ae8ffef 100644 --- a/lib/features/feed/services/feed_service.g.dart +++ b/lib/features/feed/services/feed_service.g.dart @@ -390,7 +390,9 @@ class _FeedService implements FeedService { } RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || requestOptions.responseType == ResponseType.stream)) { + if (T != dynamic && + !(requestOptions.responseType == ResponseType.bytes || + requestOptions.responseType == ResponseType.stream)) { if (T == String) { requestOptions.responseType = ResponseType.plain; } else { diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart index 5319ba7c..bd65ac7b 100644 --- a/lib/features/profile/models/profile_model.freezed.dart +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -41,12 +41,8 @@ mixin _$Profile { @JsonKey(name: "initedPlan") List get initedPlan => throw _privateConstructorUsedError; - /// Serializes this Profile to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Profile - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $ProfileCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -81,8 +77,6 @@ class _$ProfileCopyWithImpl<$Res, $Val extends Profile> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of Profile - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -141,8 +135,6 @@ class _$ProfileCopyWithImpl<$Res, $Val extends Profile> ) as $Val); } - /// Create a copy of Profile - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $UserCopyWith<$Res> get user { @@ -151,8 +143,6 @@ class _$ProfileCopyWithImpl<$Res, $Val extends Profile> }); } - /// Create a copy of Profile - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $UserDetailsCopyWith<$Res> get userDetails { @@ -195,8 +185,6 @@ class __$$ProfileImplCopyWithImpl<$Res> _$ProfileImpl _value, $Res Function(_$ProfileImpl) _then) : super(_value, _then); - /// Create a copy of Profile - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -394,7 +382,7 @@ class _$ProfileImpl implements _Profile { .equals(other._initedPlan, _initedPlan)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -409,9 +397,7 @@ class _$ProfileImpl implements _Profile { const DeepCollectionEquality().hash(_requestedPlan), const DeepCollectionEquality().hash(_initedPlan)); - /// Create a copy of Profile - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ProfileImplCopyWith<_$ProfileImpl> get copyWith => @@ -475,11 +461,8 @@ abstract class _Profile implements Profile { @override @JsonKey(name: "initedPlan") List get initedPlan; - - /// Create a copy of Profile - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$ProfileImplCopyWith<_$ProfileImpl> get copyWith => throw _privateConstructorUsedError; } @@ -521,12 +504,8 @@ mixin _$User { @JsonKey(name: "detailz") UserDetails get detailz => throw _privateConstructorUsedError; - /// Serializes this User to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of User - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $UserCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -565,8 +544,6 @@ class _$UserCopyWithImpl<$Res, $Val extends User> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of User - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -650,8 +627,6 @@ class _$UserCopyWithImpl<$Res, $Val extends User> ) as $Val); } - /// Create a copy of User - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $UserDetailsCopyWith<$Res> get detailz { @@ -696,8 +671,6 @@ class __$$UserImplCopyWithImpl<$Res> __$$UserImplCopyWithImpl(_$UserImpl _value, $Res Function(_$UserImpl) _then) : super(_value, _then); - /// Create a copy of User - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -889,7 +862,7 @@ class _$UserImpl implements _User { (identical(other.detailz, detailz) || other.detailz == detailz)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -909,9 +882,7 @@ class _$UserImpl implements _User { profilePhotoUrl, detailz); - /// Create a copy of User - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$UserImplCopyWith<_$UserImpl> get copyWith => @@ -994,11 +965,8 @@ abstract class _User implements User { @override @JsonKey(name: "detailz") UserDetails get detailz; - - /// Create a copy of User - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$UserImplCopyWith<_$UserImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1068,12 +1036,8 @@ mixin _$UserDetails { @JsonKey(name: "activity_coefficient") double get activityCoefficient => throw _privateConstructorUsedError; - /// Serializes this UserDetails to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of UserDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $UserDetailsCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1126,8 +1090,6 @@ class _$UserDetailsCopyWithImpl<$Res, $Val extends UserDetails> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of UserDetails - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1330,8 +1292,6 @@ class __$$UserDetailsImplCopyWithImpl<$Res> _$UserDetailsImpl _value, $Res Function(_$UserDetailsImpl) _then) : super(_value, _then); - /// Create a copy of UserDetails - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1673,7 +1633,7 @@ class _$UserDetailsImpl implements _UserDetails { other.activityCoefficient == activityCoefficient)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hashAll([ runtimeType, @@ -1708,9 +1668,7 @@ class _$UserDetailsImpl implements _UserDetails { activityCoefficient ]); - /// Create a copy of UserDetails - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$UserDetailsImplCopyWith<_$UserDetailsImpl> get copyWith => @@ -1852,11 +1810,8 @@ abstract class _UserDetails implements UserDetails { @override @JsonKey(name: "activity_coefficient") double get activityCoefficient; - - /// Create a copy of UserDetails - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$UserDetailsImplCopyWith<_$UserDetailsImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart index c06a0c0d..f36c6545 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart @@ -84,9 +84,6 @@ class _$ProfileStateCopyWithImpl<$Res, $Val extends ProfileState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; - - /// Create a copy of ProfileState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -103,9 +100,6 @@ class __$$ProfileStateImplCopyWithImpl<$Res> __$$ProfileStateImplCopyWithImpl( _$ProfileStateImpl _value, $Res Function(_$ProfileStateImpl) _then) : super(_value, _then); - - /// Create a copy of ProfileState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -220,9 +214,6 @@ class __$$ProfileStateLoadingImplCopyWithImpl<$Res> __$$ProfileStateLoadingImplCopyWithImpl(_$ProfileStateLoadingImpl _value, $Res Function(_$ProfileStateLoadingImpl) _then) : super(_value, _then); - - /// Create a copy of ProfileState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -343,8 +334,6 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> $Res Function(_$ProfileStateLoadedImpl) _then) : super(_value, _then); - /// Create a copy of ProfileState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -358,8 +347,6 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> )); } - /// Create a copy of ProfileState - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $ProfileCopyWith<$Res> get profile { @@ -393,9 +380,7 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { @override int get hashCode => Object.hash(runtimeType, profile); - /// Create a copy of ProfileState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => @@ -482,10 +467,7 @@ abstract class ProfileStateLoaded implements ProfileState { _$ProfileStateLoadedImpl; Profile get profile; - - /// Create a copy of ProfileState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -507,8 +489,6 @@ class __$$ProfileStateErrorImplCopyWithImpl<$Res> $Res Function(_$ProfileStateErrorImpl) _then) : super(_value, _then); - /// Create a copy of ProfileState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -548,9 +528,7 @@ class _$ProfileStateErrorImpl implements ProfileStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of ProfileState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => @@ -637,10 +615,7 @@ abstract class ProfileStateError implements ProfileState { _$ProfileStateErrorImpl; String get errorMessage; - - /// Create a copy of ProfileState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$ProfileStateErrorImplCopyWith<_$ProfileStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/ingredient.freezed.dart b/lib/features/recipes/models/ingredient.freezed.dart index 2bf96fb3..63f3facb 100644 --- a/lib/features/recipes/models/ingredient.freezed.dart +++ b/lib/features/recipes/models/ingredient.freezed.dart @@ -24,12 +24,8 @@ mixin _$Ingredient { String get unit => throw _privateConstructorUsedError; String get portion => throw _privateConstructorUsedError; - /// Serializes this Ingredient to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Ingredient - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $IngredientCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -53,8 +49,6 @@ class _$IngredientCopyWithImpl<$Res, $Val extends Ingredient> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of Ingredient - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -98,8 +92,6 @@ class __$$IngredientImplCopyWithImpl<$Res> _$IngredientImpl _value, $Res Function(_$IngredientImpl) _then) : super(_value, _then); - /// Create a copy of Ingredient - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -155,13 +147,11 @@ class _$IngredientImpl implements _Ingredient { (identical(other.portion, portion) || other.portion == portion)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, name, unit, portion); - /// Create a copy of Ingredient - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => @@ -190,11 +180,8 @@ abstract class _Ingredient implements Ingredient { String get unit; @override String get portion; - - /// Create a copy of Ingredient - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$IngredientImplCopyWith<_$IngredientImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/recipe_model.freezed.dart b/lib/features/recipes/models/recipe_model.freezed.dart index 691ac1f3..fb93e70a 100644 --- a/lib/features/recipes/models/recipe_model.freezed.dart +++ b/lib/features/recipes/models/recipe_model.freezed.dart @@ -30,12 +30,8 @@ mixin _$RecipeModel { String? get image => throw _privateConstructorUsedError; int? get cooking_time => throw _privateConstructorUsedError; - /// Serializes this RecipeModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of RecipeModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $RecipeModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -68,8 +64,6 @@ class _$RecipeModelCopyWithImpl<$Res, $Val extends RecipeModel> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of RecipeModel - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -152,8 +146,6 @@ class __$$RecipeModelImplCopyWithImpl<$Res> _$RecipeModelImpl _value, $Res Function(_$RecipeModelImpl) _then) : super(_value, _then); - /// Create a copy of RecipeModel - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -287,7 +279,7 @@ class _$RecipeModelImpl implements _RecipeModel { other.cooking_time == cooking_time)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, @@ -301,9 +293,7 @@ class _$RecipeModelImpl implements _RecipeModel { image, cooking_time); - /// Create a copy of RecipeModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => @@ -350,11 +340,8 @@ abstract class _RecipeModel implements RecipeModel { String? get image; @override int? get cooking_time; - - /// Create a copy of RecipeModel - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$RecipeModelImplCopyWith<_$RecipeModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/models/step.freezed.dart b/lib/features/recipes/models/step.freezed.dart index 040dd5aa..c2014f4f 100644 --- a/lib/features/recipes/models/step.freezed.dart +++ b/lib/features/recipes/models/step.freezed.dart @@ -23,12 +23,8 @@ mixin _$Step { String? get image => throw _privateConstructorUsedError; String? get description => throw _privateConstructorUsedError; - /// Serializes this Step to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of Step - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $StepCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -50,8 +46,6 @@ class _$StepCopyWithImpl<$Res, $Val extends Step> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of Step - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -88,8 +82,6 @@ class __$$StepImplCopyWithImpl<$Res> __$$StepImplCopyWithImpl(_$StepImpl _value, $Res Function(_$StepImpl) _then) : super(_value, _then); - /// Create a copy of Step - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -137,13 +129,11 @@ class _$StepImpl implements _Step { other.description == description)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, image, description); - /// Create a copy of Step - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$StepImplCopyWith<_$StepImpl> get copyWith => @@ -167,11 +157,8 @@ abstract class _Step implements Step { String? get image; @override String? get description; - - /// Create a copy of Step - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$StepImplCopyWith<_$StepImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart index e15a1a52..9acea107 100644 --- a/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart +++ b/lib/features/recipes/presentation/bloc/recipe_create_state.freezed.dart @@ -147,9 +147,6 @@ class _$RecipeCreateStateCopyWithImpl<$Res, $Val extends RecipeCreateState> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; - - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -166,9 +163,6 @@ class __$$RecipeCreateStateImplCopyWithImpl<$Res> __$$RecipeCreateStateImplCopyWithImpl(_$RecipeCreateStateImpl _value, $Res Function(_$RecipeCreateStateImpl) _then) : super(_value, _then); - - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -349,9 +343,6 @@ class __$$RecipeCreateStateLoadingImplCopyWithImpl<$Res> _$RecipeCreateStateLoadingImpl _value, $Res Function(_$RecipeCreateStateLoadingImpl) _then) : super(_value, _then); - - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. } /// @nodoc @@ -560,8 +551,6 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> $Res Function(_$RecipeCreateStateLoadedImpl) _then) : super(_value, _then); - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -670,8 +659,6 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> )); } - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $RecipeModelCopyWith<$Res>? get recipe { @@ -684,8 +671,6 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> }); } - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get selectedType { @@ -694,8 +679,6 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> }); } - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get selectedCookingTime { @@ -705,8 +688,6 @@ class __$$RecipeCreateStateLoadedImplCopyWithImpl<$Res> }); } - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $SelectionPopupModelCopyWith<$Res> get selectedStatus { @@ -906,9 +887,7 @@ class _$RecipeCreateStateLoadedImpl implements RecipeCreateStateLoaded { selectedStatus ]); - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> @@ -1157,10 +1136,7 @@ abstract class RecipeCreateStateLoaded implements RecipeCreateState { SelectionPopupModel get selectedType; SelectionPopupModel get selectedCookingTime; SelectionPopupModel get selectedStatus; - - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$RecipeCreateStateLoadedImplCopyWith<_$RecipeCreateStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1184,8 +1160,6 @@ class __$$RecipeCreateStateErrorImplCopyWithImpl<$Res> $Res Function(_$RecipeCreateStateErrorImpl) _then) : super(_value, _then); - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1225,9 +1199,7 @@ class _$RecipeCreateStateErrorImpl implements RecipeCreateStateError { @override int get hashCode => Object.hash(runtimeType, errorMessage); - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> @@ -1377,10 +1349,7 @@ abstract class RecipeCreateStateError implements RecipeCreateState { _$RecipeCreateStateErrorImpl; String get errorMessage; - - /// Create a copy of RecipeCreateState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$RecipeCreateStateErrorImplCopyWith<_$RecipeCreateStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/registration/models/location_model.freezed.dart b/lib/features/registration/models/location_model.freezed.dart index 95f81d60..f640ca2e 100644 --- a/lib/features/registration/models/location_model.freezed.dart +++ b/lib/features/registration/models/location_model.freezed.dart @@ -24,12 +24,8 @@ mixin _$LocationModel { @JsonKey(name: 'response_body') String get responseBody => throw _privateConstructorUsedError; - /// Serializes this LocationModel to a JSON map. Map toJson() => throw _privateConstructorUsedError; - - /// Create a copy of LocationModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $LocationModelCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -55,8 +51,6 @@ class _$LocationModelCopyWithImpl<$Res, $Val extends LocationModel> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of LocationModel - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -97,8 +91,6 @@ class __$$LocationModelImplCopyWithImpl<$Res> _$LocationModelImpl _value, $Res Function(_$LocationModelImpl) _then) : super(_value, _then); - /// Create a copy of LocationModel - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -157,14 +149,12 @@ class _$LocationModelImpl implements _LocationModel { other.responseBody == responseBody)); } - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_locations), responseBody); - /// Create a copy of LocationModel - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => @@ -192,11 +182,8 @@ abstract class _LocationModel implements LocationModel { @override @JsonKey(name: 'response_body') String get responseBody; - - /// Create a copy of LocationModel - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$LocationModelImplCopyWith<_$LocationModelImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart index ae0a9706..dcb49236 100644 --- a/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart +++ b/lib/features/registration/presentation/bloc/registration_cubit/registration_state.freezed.dart @@ -18,9 +18,7 @@ final _privateConstructorUsedError = UnsupportedError( mixin _$RegistrationState { UserRegistrationSheet get sheet => throw _privateConstructorUsedError; - /// Create a copy of RegistrationState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) $RegistrationStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -46,8 +44,6 @@ class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> // ignore: unused_field final $Res Function($Val) _then; - /// Create a copy of RegistrationState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -61,8 +57,6 @@ class _$RegistrationStateCopyWithImpl<$Res, $Val extends RegistrationState> ) as $Val); } - /// Create a copy of RegistrationState - /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $UserRegistrationSheetCopyWith<$Res> get sheet { @@ -94,8 +88,6 @@ class __$$RegistrationStateImplCopyWithImpl<$Res> $Res Function(_$RegistrationStateImpl) _then) : super(_value, _then); - /// Create a copy of RegistrationState - /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -134,9 +126,7 @@ class _$RegistrationStateImpl implements _RegistrationState { @override int get hashCode => Object.hash(runtimeType, sheet); - /// Create a copy of RegistrationState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => @@ -150,11 +140,8 @@ abstract class _RegistrationState implements RegistrationState { @override UserRegistrationSheet get sheet; - - /// Create a copy of RegistrationState - /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(includeFromJson: false, includeToJson: false) + @JsonKey(ignore: true) _$$RegistrationStateImplCopyWith<_$RegistrationStateImpl> get copyWith => throw _privateConstructorUsedError; } From 603728549da7e0479bc471fe8497a93c8f28f7dd Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 26 Aug 2024 10:43:43 +0000 Subject: [PATCH 06/15] fix: analyze --- lib/features/diary/presentation/pages/diary_screen.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index cd87acff..d79b4aab 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -901,7 +901,7 @@ class DiaryScreen extends StatelessWidget { }; } - _buildComment(BuildContext context, DiaryStateLoaded state) { + /* _buildComment(BuildContext context, DiaryStateLoaded state) { return Container( padding: EdgeInsets.symmetric( horizontal: 24.h, @@ -934,7 +934,7 @@ class DiaryScreen extends StatelessWidget { ], ), ); - } + } */ _buildWakupRetire(BuildContext context, DiaryStateLoaded state) { return Container( From cea81abd2113250a79755cb2b26a916aecc6500a Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 26 Aug 2024 15:04:07 +0300 Subject: [PATCH 07/15] refactor(token): add token storage, remove hive --- lib/core/app_export.dart | 2 - lib/core/token_storage.dart | 14 +++-- lib/core/utils/pref_utils.dart | 34 ------------ lib/data/models/tokenModel/token_model.dart | 10 ---- lib/main.dart | 52 +++++++------------ .../auth/auth_screen/auth_screen.dart | 3 -- .../bloc/diet_create_bloc.dart | 6 +-- .../diet_edit_screen/bloc/diet_edit_bloc.dart | 8 ++- .../bloc/diet_select_bloc.dart | 8 ++- .../diet_show_screen/bloc/diet_show_bloc.dart | 14 ++--- .../bloc/blog_post_create_bloc.dart | 8 ++- .../bloc/blog_post_edit_bloc.dart | 8 ++- .../bloc/glossary_screen_bloc.dart | 12 ++--- .../bloc/plan_create_bloc.dart | 6 +-- .../plan_edit_screen/bloc/plan_edit_bloc.dart | 8 ++- .../bloc/plan_select_bloc.dart | 6 +-- .../plan_show_screen/bloc/plan_show_bloc.dart | 14 ++--- .../bloc/my_profile_bloc.dart | 16 ++---- .../bloc/recipe_edit_bloc.dart | 21 +++----- .../bloc/recipe_select_bloc.dart | 6 +-- .../bloc/recipe_show_bloc.dart | 36 +++++-------- .../bloc/subscribers_bloc.dart | 8 ++- lib/theme/bloc/theme_bloc.dart | 20 ------- lib/theme/bloc/theme_event.dart | 15 ------ lib/theme/bloc/theme_state.dart | 15 ------ lib/theme/theme_helper.dart | 2 +- lib/widgets/custom_expandable_list.dart | 5 +- lib/widgets/custom_navigation_menu.dart | 8 ++- pubspec.yaml | 4 +- 29 files changed, 98 insertions(+), 271 deletions(-) delete mode 100644 lib/core/utils/pref_utils.dart delete mode 100644 lib/data/models/tokenModel/token_model.dart delete mode 100644 lib/theme/bloc/theme_bloc.dart delete mode 100644 lib/theme/bloc/theme_event.dart delete mode 100644 lib/theme/bloc/theme_state.dart diff --git a/lib/core/app_export.dart b/lib/core/app_export.dart index 76a79551..41302e56 100644 --- a/lib/core/app_export.dart +++ b/lib/core/app_export.dart @@ -12,6 +12,4 @@ 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/bloc/theme_bloc.dart'; export '../theme/custom_button_style.dart'; diff --git a/lib/core/token_storage.dart b/lib/core/token_storage.dart index 1179241b..c73e2aba 100644 --- a/lib/core/token_storage.dart +++ b/lib/core/token_storage.dart @@ -1,6 +1,6 @@ import 'package:dio/dio.dart'; import 'package:eatvio_app/locator_service.dart'; -import 'package:hive_flutter/hive_flutter.dart'; +import 'package:flutter_secure_storage/flutter_secure_storage.dart'; abstract class TokenStorage { static _addTokenToDioHeader(String token) { @@ -8,22 +8,20 @@ abstract class TokenStorage { } static haveTokenInStorage() async { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (await FlutterSecureStorage().read(key: 'token') == null) { return false; } else { - _addTokenToDioHeader(token); + _addTokenToDioHeader((await FlutterSecureStorage().read(key: 'token'))!); return true; } } - static Future getTokenFromStorage() async => (await Hive.openBox('token')).get('token'); + static Future getTokenFromStorage() async => (await FlutterSecureStorage().read(key: 'token'))!; static saveTokenInStorage(String token) async { - (await Hive.openBox('token')).put('token', token); + await FlutterSecureStorage().write(key: 'token', value: token); _addTokenToDioHeader(token); } - static removeTokenInStorage() async => (await Hive.openBox('token')).delete('token'); + static removeTokenInStorage() async => (await FlutterSecureStorage().delete(key: 'token')); } diff --git a/lib/core/utils/pref_utils.dart b/lib/core/utils/pref_utils.dart deleted file mode 100644 index 9c49a3d2..00000000 --- a/lib/core/utils/pref_utils.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:shared_preferences/shared_preferences.dart'; - -class PrefUtils { - static SharedPreferences? _sharedPreferences; - - PrefUtils() { - // init(); - SharedPreferences.getInstance().then((value) { - _sharedPreferences = value; - }); - } - - Future init() async { - _sharedPreferences ??= await SharedPreferences.getInstance(); - print('SharedPreference Initialized'); - } - - ///will clear all the data stored in preference - void clearPreferencesData() async { - _sharedPreferences!.clear(); - } - - Future setThemeData(String value) { - return _sharedPreferences!.setString('themeData', value); - } - - String getThemeData() { - try { - return _sharedPreferences!.getString('themeData')!; - } catch (e) { - return 'primary'; - } - } -} diff --git a/lib/data/models/tokenModel/token_model.dart b/lib/data/models/tokenModel/token_model.dart deleted file mode 100644 index ce310e2e..00000000 --- a/lib/data/models/tokenModel/token_model.dart +++ /dev/null @@ -1,10 +0,0 @@ -import 'package:hive/hive.dart'; - -/// https://pub.dev/packages/flutter_secure_storage TODO replace hive to secure_storage for token storage -@HiveType(typeId: 0) -class TokenModel { - @HiveField(0) - String token; - - TokenModel({required this.token}); -} diff --git a/lib/main.dart b/lib/main.dart index 34f37ccf..e031d6a6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -17,11 +17,8 @@ import 'package:eatvio_app/presentation/profile/my_profile_screen/models/my_prof import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:hive_flutter/hive_flutter.dart'; import 'package:intl/date_symbol_data_local.dart'; import 'package:keyboard_dismisser/keyboard_dismisser.dart'; -import 'package:path_provider/path_provider.dart'; - import 'core/app_export.dart'; var globalMessengerKey = GlobalKey(); @@ -29,15 +26,11 @@ var globalMessengerKey = GlobalKey(); void main() async { WidgetsFlutterBinding.ensureInitialized(); await di.init(); - final appDocumentDir = await getApplicationDocumentsDirectory(); - final path = appDocumentDir.path; - await Hive.initFlutter(path); SystemChrome.setPreferredOrientations([ DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight, DeviceOrientation.portraitUp, ]); - await PrefUtils().init(); initializeDateFormatting().then((_) => runApp(MyApp())); } @@ -49,7 +42,6 @@ class MyApp extends StatelessWidget { BlocProvider(create: (context) => sl()), BlocProvider(create: (context) => sl()), BlocProvider(create: (context) => sl()), - BlocProvider(create: (context) => ThemeBloc(ThemeState(themeType: PrefUtils().getThemeData()))), BlocProvider(create: (context) => sl()..loadFeedBlogPostList()), BlocProvider(create: (context) => sl()..loadRecipesList()), BlocProvider(create: (context) => sl()..loadDiets()), @@ -61,31 +53,27 @@ class MyApp extends StatelessWidget { ], child: BlocListener( listener: (BuildContext context, InitializationState state) {}, - child: BlocBuilder( - builder: (context, state) { - return KeyboardDismisser( - gestures: [ - GestureType.onTap, - GestureType.onPanUpdateDownDirection, - ], - child: MaterialApp.router( - theme: theme, - routerConfig: AppRouter.appRouter, - debugShowCheckedModeBanner: false, - localizationsDelegates: [ - AppLocalizationDelegate(), - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - ], - supportedLocales: [ - Locale( - 'ru', - ), - ], + child: KeyboardDismisser( + gestures: [ + GestureType.onTap, + GestureType.onPanUpdateDownDirection, + ], + child: MaterialApp.router( + theme: theme, + routerConfig: AppRouter.appRouter, + debugShowCheckedModeBanner: false, + localizationsDelegates: [ + AppLocalizationDelegate(), + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + supportedLocales: [ + Locale( + 'ru', ), - ); - }, + ], + ), ), ), ); diff --git a/lib/presentation/auth/auth_screen/auth_screen.dart b/lib/presentation/auth/auth_screen/auth_screen.dart index 2c738524..502eff15 100644 --- a/lib/presentation/auth/auth_screen/auth_screen.dart +++ b/lib/presentation/auth/auth_screen/auth_screen.dart @@ -6,7 +6,6 @@ import 'package:eatvio_app/widgets/app_bar/appbar_title_image.dart'; import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import 'package:url_launcher/url_launcher.dart'; import 'package:validators/validators.dart'; @@ -167,9 +166,7 @@ class _AuthScreenState extends State { print(response.statusCode); if (response.statusCode == 200) { var res = await jsonDecode(response.body); - final box = await Hive.openBox('token'); final token = res['token']; - box.put('token', token); await TokenStorage.saveTokenInStorage(token); GoRouter.of(context).go('/my-profile-screen'); } else { diff --git a/lib/presentation/diets/diet_create_screen/bloc/diet_create_bloc.dart b/lib/presentation/diets/diet_create_screen/bloc/diet_create_bloc.dart index 65ea65b9..db2f02a9 100644 --- a/lib/presentation/diets/diet_create_screen/bloc/diet_create_bloc.dart +++ b/lib/presentation/diets/diet_create_screen/bloc/diet_create_bloc.dart @@ -2,11 +2,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/diets/diet_create_screen/models/diet_create_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import '/core/app_export.dart'; @@ -25,9 +25,7 @@ class DietCreateBloc extends Bloc { DietCreateInitialEvent event, Emitter emit, ) async { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } if (state is DietCreateLoadedState) { diff --git a/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_bloc.dart b/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_bloc.dart index 81e034a1..5f92e25b 100644 --- a/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_bloc.dart +++ b/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_bloc.dart @@ -2,11 +2,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/diets/diet_edit_screen/models/diet_edit_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import '/core/app_export.dart'; @@ -26,16 +26,14 @@ class DietEditBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final String? dietID = state.dietModelObj?.dietID; final response = await http.get( Uri.parse(baseUrl + '/api/diets/show/$dietID'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); if (response.statusCode == 200) { diff --git a/lib/presentation/diets/diet_select_screen/bloc/diet_select_bloc.dart b/lib/presentation/diets/diet_select_screen/bloc/diet_select_bloc.dart index 56dabcf2..6910f250 100644 --- a/lib/presentation/diets/diet_select_screen/bloc/diet_select_bloc.dart +++ b/lib/presentation/diets/diet_select_screen/bloc/diet_select_bloc.dart @@ -3,11 +3,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/diets/diet_select_screen/models/diet_select_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; @@ -27,15 +27,13 @@ class DietSelectBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final response = await http.get( Uri.parse(baseUrl + '/api/diets/index'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); print('Got response'); diff --git a/lib/presentation/diets/diet_show_screen/bloc/diet_show_bloc.dart b/lib/presentation/diets/diet_show_screen/bloc/diet_show_bloc.dart index 3d0551a2..b680d054 100644 --- a/lib/presentation/diets/diet_show_screen/bloc/diet_show_bloc.dart +++ b/lib/presentation/diets/diet_show_screen/bloc/diet_show_bloc.dart @@ -2,11 +2,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/diets/diet_show_screen/models/diet_show_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import '/core/app_export.dart'; @@ -26,16 +26,14 @@ class DietBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final String? dietID = state.dietModelObj?.dietID; final response = await http.get( Uri.parse(baseUrl + '/api/diets/show/$dietID'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); if (response.statusCode == 200) { @@ -62,16 +60,14 @@ class DietBloc extends Bloc { } FutureOr _deleteEntry(DeleteEntry event, Emitter emit) async { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final int id = event.id; final response = await http.post( Uri.parse(baseUrl + '/api/diets/delete/$id'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); if (response.statusCode == 200) { diff --git a/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart b/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart index 798b771c..0cfd4cc4 100644 --- a/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart +++ b/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart @@ -2,12 +2,12 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/presentation/feed/blog_post_create_screen/models/blog_post_create_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:image_picker/image_picker.dart'; import '/core/app_export.dart'; @@ -27,9 +27,7 @@ class BlogPostCreateBloc extends Bloc BlogPostCreateInitialEvent event, Emitter emit, ) async { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } if (state is BlogPostCreateLoadedState) { @@ -46,7 +44,7 @@ class BlogPostCreateBloc extends Bloc } else { emit( BlogPostCreateLoadedState( - token: token, + token: await TokenStorage.getTokenFromStorage(), title: TextEditingController(), description: TextEditingController(), youtubeURL: TextEditingController(), diff --git a/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart b/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart index c9c6bf9c..813a66d0 100644 --- a/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart +++ b/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart @@ -2,11 +2,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/feed/blog_post_edit_screen/models/blog_post_edit_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import '/core/app_export.dart'; @@ -26,16 +26,14 @@ class BlogPostEditBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final String? blog_postID = state.blog_postModelObj?.blog_postID; final response = await http.get( Uri.parse(baseUrl + '/api/blogPosts/show/$blog_postID'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); if (response.statusCode == 200) { diff --git a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_bloc.dart b/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_bloc.dart index 3bae9e80..c45d5569 100644 --- a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_bloc.dart +++ b/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_bloc.dart @@ -2,11 +2,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/glossary/glossary_screen/models/glossary_screen_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import '/core/app_export.dart'; @@ -26,15 +26,13 @@ class GlossaryBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final responseProductGroups = await http.get( Uri.parse(baseUrl + '/api/glossaries/group/index'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); if (responseProductGroups.statusCode == 200) { @@ -54,12 +52,12 @@ class GlossaryBloc extends Bloc { List productGroupsModel = _fillProductGroups(dataProductGroups); emit( GlossaryLoadedState( - token: token, + token: await TokenStorage.getTokenFromStorage(), productGroups: productGroupsModel, productList: [], ), ); - await _getProductListById(token, emit, productGroupsModel[0].id); + await _getProductListById(await TokenStorage.getTokenFromStorage(), emit, productGroupsModel[0].id); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку diff --git a/lib/presentation/plans/plan_create_screen/bloc/plan_create_bloc.dart b/lib/presentation/plans/plan_create_screen/bloc/plan_create_bloc.dart index 3cab0f65..871c2dc1 100644 --- a/lib/presentation/plans/plan_create_screen/bloc/plan_create_bloc.dart +++ b/lib/presentation/plans/plan_create_screen/bloc/plan_create_bloc.dart @@ -2,11 +2,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/plans/plan_create_screen/models/plan_create_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import '/core/app_export.dart'; @@ -25,9 +25,7 @@ class PlanCreateBloc extends Bloc { PlanCreateInitialEvent event, Emitter emit, ) async { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } if (state is PlanCreateLoadedState) { diff --git a/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart b/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart index 5987b6bd..656e671c 100644 --- a/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart +++ b/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart @@ -2,11 +2,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/plans/plan_edit_screen/models/plan_edit_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import '/core/app_export.dart'; @@ -26,16 +26,14 @@ class PlanEditBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final String? planID = state.planModelObj?.planID; final response = await http.get( Uri.parse(baseUrl + '/api/plans/show/$planID'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); if (response.statusCode == 200) { diff --git a/lib/presentation/plans/plan_select_screen/bloc/plan_select_bloc.dart b/lib/presentation/plans/plan_select_screen/bloc/plan_select_bloc.dart index dcf60700..fa32b77f 100644 --- a/lib/presentation/plans/plan_select_screen/bloc/plan_select_bloc.dart +++ b/lib/presentation/plans/plan_select_screen/bloc/plan_select_bloc.dart @@ -3,11 +3,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/plans/plan_select_screen/models/plan_select_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; @@ -27,9 +27,7 @@ class PlanSelectBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final response = await http.get( diff --git a/lib/presentation/plans/plan_show_screen/bloc/plan_show_bloc.dart b/lib/presentation/plans/plan_show_screen/bloc/plan_show_bloc.dart index ad9a7a43..f09463a9 100644 --- a/lib/presentation/plans/plan_show_screen/bloc/plan_show_bloc.dart +++ b/lib/presentation/plans/plan_show_screen/bloc/plan_show_bloc.dart @@ -2,11 +2,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/plans/plan_show_screen/models/plan_show_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import '/core/app_export.dart'; @@ -26,16 +26,14 @@ class PlanBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final String? planID = state.planModelObj?.planID; final response = await http.get( Uri.parse(baseUrl + '/api/plans/show/$planID'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); if (response.statusCode == 200) { @@ -62,16 +60,14 @@ class PlanBloc extends Bloc { } FutureOr _deleteEntry(DeleteEntry event, Emitter emit) async { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final int id = event.id; final response = await http.post( Uri.parse(baseUrl + '/api/plans/delete/$id'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); if (response.statusCode == 200) { diff --git a/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart b/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart index 8b01f618..4678416e 100644 --- a/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart +++ b/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart @@ -3,11 +3,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/profile/my_profile_screen/models/my_profile_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import 'package:image_picker/image_picker.dart'; @@ -28,9 +28,7 @@ class MyProfileBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } //final token = @@ -38,7 +36,7 @@ class MyProfileBloc extends Bloc { final response = await http.get( Uri.parse(baseUrl + '/api/profile/index'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); if (response.statusCode == 200) { @@ -48,10 +46,6 @@ class MyProfileBloc extends Bloc { data.containsKey('userDetails') && data.containsKey('chartPoints') && data.containsKey('circumferences')) { - final avatarBox = await Hive.openBox('avatar'); - final avatar = data['user']['profile_photo_path']; - print(avatar); - avatarBox.put('avatar', avatar); if (state is MyProfileLoadedState) { var currentState = state as MyProfileLoadedState; var plans = [] @@ -69,7 +63,7 @@ class MyProfileBloc extends Bloc { user: data['user'], userDetails: data['userDetails'], plans: plans, - token: token, + token: await TokenStorage.getTokenFromStorage(), chestCircumferenceController: TextEditingController(), waistCircumferenceController: TextEditingController(), hipCircumferenceController: TextEditingController(), @@ -172,7 +166,7 @@ class MyProfileBloc extends Bloc { user: data['user'], userDetails: data['userDetails'], plans: plans, - token: token, + token: await TokenStorage.getTokenFromStorage(), chestCircumferenceController: TextEditingController(), waistCircumferenceController: TextEditingController(), hipCircumferenceController: TextEditingController(), diff --git a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart b/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart index 560c75ee..fa817935 100644 --- a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart +++ b/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart @@ -2,11 +2,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/recipe/recipe_edit_screen/models/recipe_edit_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import '/core/app_export.dart'; @@ -29,16 +29,14 @@ class RecipeEditBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final String? recipeID = state.recipeModelObj?.recipeID; final response = await http.get( Uri.parse(baseUrl + '/api/recipes/show/$recipeID'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); if (response.statusCode == 200) { @@ -79,7 +77,7 @@ class RecipeEditBloc extends Bloc { emit( RecipeEditLoadedState( - token: token, + token: await TokenStorage.getTokenFromStorage(), recipe: data, title: TextEditingController(text: data['title']), description: TextEditingController(text: data['description']), @@ -191,17 +189,14 @@ class RecipeEditBloc extends Bloc { } _fetchTags(int id) async { - final box = await Hive.openBox('token'); - final token = box.get('token'); - - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final response = await http.get( Uri.parse(baseUrl + '/api/recipes/getTags/$id'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); final data = jsonDecode(response.body); @@ -210,9 +205,7 @@ class RecipeEditBloc extends Bloc { FutureOr _reloadScreen(RecipeEditEvent? event, Emitter emit) async { print('Reloading..'); - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } if (state is RecipeEditLoadedState) { diff --git a/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart b/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart index 399e20f8..21f14634 100644 --- a/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart +++ b/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart @@ -2,12 +2,12 @@ import 'dart:async'; import 'package:dio/dio.dart'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/presentation/recipe/recipe_select_screen/models/recipe_select_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:image_picker/image_picker.dart'; import '/core/app_export.dart'; @@ -26,9 +26,7 @@ class RecipeSelectBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final response = await sl().get(baseUrl + '/api/recipes/index'); diff --git a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart b/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart index ac2d9a9a..2ae1d76d 100644 --- a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart +++ b/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart @@ -2,12 +2,12 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/feed/blog_post_screen/models/comment_model.dart'; import 'package:eatvio_app/presentation/recipe/recipe_show_screen/models/recipe_show_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import 'package:intl/intl.dart'; @@ -29,16 +29,14 @@ class RecipeBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final String? recipeID = state.recipeModelObj?.recipeID; final response = await http.get( Uri.parse(baseUrl + '/api/recipes/show/$recipeID'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); if (response.statusCode == 200) { @@ -60,7 +58,7 @@ class RecipeBloc extends Bloc { } else { emit( RecipeLoadedState( - token: token, + token: await TokenStorage.getTokenFromStorage(), recipe: data, steps: data['steps'], author: await _fetchAuthor(data['id']), @@ -85,16 +83,14 @@ class RecipeBloc extends Bloc { } FutureOr _deleteEntry(DeleteEntry event, Emitter emit) async { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final int id = event.id; final response = await http.post( Uri.parse(baseUrl + '/api/recipes/delete/$id'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); if (response.statusCode == 200) { @@ -122,17 +118,14 @@ class RecipeBloc extends Bloc { } _fetchAuthor(int id) async { - final box = await Hive.openBox('token'); - final token = box.get('token'); - - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final response = await http.get( Uri.parse(baseUrl + '/api/recipes/getAuthor/$id'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); final data = jsonDecode(response.body); @@ -140,15 +133,13 @@ class RecipeBloc extends Bloc { } Future _fetchComments(int id) async { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final response = await http.get( Uri.parse(baseUrl + '/api/recipes/getComments/$id'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); final data = jsonDecode(response.body); @@ -156,17 +147,14 @@ class RecipeBloc extends Bloc { } _fetchTags(int id) async { - final box = await Hive.openBox('token'); - final token = box.get('token'); - - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final response = await http.get( Uri.parse(baseUrl + '/api/recipes/getTags/$id'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); final data = jsonDecode(response.body); diff --git a/lib/presentation/users/subscribers_screen/bloc/subscribers_bloc.dart b/lib/presentation/users/subscribers_screen/bloc/subscribers_bloc.dart index a48d6198..f29ace07 100644 --- a/lib/presentation/users/subscribers_screen/bloc/subscribers_bloc.dart +++ b/lib/presentation/users/subscribers_screen/bloc/subscribers_bloc.dart @@ -3,11 +3,11 @@ import 'dart:async'; import 'dart:convert'; import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/users/subscribers_screen/models/subscribers_model.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import '/core/app_export.dart'; @@ -26,15 +26,13 @@ class SubscribersBloc extends Bloc { Emitter emit, ) async { try { - final box = await Hive.openBox('token'); - final token = box.get('token'); - if (token == null) { + if (!await TokenStorage.haveTokenInStorage()) { AppRouter.navigatorKey.currentContext?.goNamed('authScreen'); } final response = await http.get( Uri.parse(baseUrl + '/api/profile/subscribers'), headers: { - 'Authorization': 'Bearer $token', + 'Authorization': 'Bearer ${await TokenStorage.getTokenFromStorage()}', }, ); print('Got response'); diff --git a/lib/theme/bloc/theme_bloc.dart b/lib/theme/bloc/theme_bloc.dart deleted file mode 100644 index ae2863bd..00000000 --- a/lib/theme/bloc/theme_bloc.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:equatable/equatable.dart'; -import 'package:flutter/material.dart'; - -import '../../core/app_export.dart'; - -part 'theme_event.dart'; -part 'theme_state.dart'; - -class ThemeBloc extends Bloc { - ThemeBloc(ThemeState initialState) : super(initialState) { - on(_changeTheme); - } - - _changeTheme( - ThemeChangeEvent event, - Emitter emit, - ) async { - emit(state.copyWith(themeType: event.themeType)); - } -} diff --git a/lib/theme/bloc/theme_event.dart b/lib/theme/bloc/theme_event.dart deleted file mode 100644 index 700cbdec..00000000 --- a/lib/theme/bloc/theme_event.dart +++ /dev/null @@ -1,15 +0,0 @@ -part of 'theme_bloc.dart'; - -@immutable -abstract class ThemeEvent extends Equatable {} - -class ThemeChangeEvent extends ThemeEvent { - ThemeChangeEvent({required this.themeType}) : super() { - PrefUtils().setThemeData(themeType); - } - - final String themeType; - - @override - List get props => []; -} diff --git a/lib/theme/bloc/theme_state.dart b/lib/theme/bloc/theme_state.dart deleted file mode 100644 index 191bcfe4..00000000 --- a/lib/theme/bloc/theme_state.dart +++ /dev/null @@ -1,15 +0,0 @@ -part of 'theme_bloc.dart'; - -@immutable -class ThemeState extends Equatable { - ThemeState({required this.themeType}); - - final String themeType; - - @override - List get props => [themeType]; - - ThemeState copyWith({String? themeType}) { - return ThemeState(themeType: themeType ?? this.themeType); - } -} diff --git a/lib/theme/theme_helper.dart b/lib/theme/theme_helper.dart index b33d056b..20fa5474 100644 --- a/lib/theme/theme_helper.dart +++ b/lib/theme/theme_helper.dart @@ -7,7 +7,7 @@ import '../../core/app_export.dart'; /// Helper class for managing themes and colors. class ThemeHelper { // The current app theme - var _appTheme = PrefUtils().getThemeData(); + var _appTheme = 'primary'; // A map of custom color themes supported by the app Map _supportedCustomColor = { diff --git a/lib/widgets/custom_expandable_list.dart b/lib/widgets/custom_expandable_list.dart index 5678f3e4..2489c0d7 100644 --- a/lib/widgets/custom_expandable_list.dart +++ b/lib/widgets/custom_expandable_list.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart'; import 'package:eatvio_app/widgets/custom_hyper_switch.dart'; import 'package:eatvio_app/widgets/custom_hypo_switch.dart'; @@ -8,7 +9,6 @@ import 'package:eatvio_app/widgets/next_step_button.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; import 'package:intl/intl.dart'; @@ -384,8 +384,7 @@ class _ExpandableListState extends State { } Future _getTokenFromBox() async { - final box = await Hive.openBox('token'); - return box.get('token'); + return await TokenStorage.getTokenFromStorage(); } String _buildApiUrl() { diff --git a/lib/widgets/custom_navigation_menu.dart b/lib/widgets/custom_navigation_menu.dart index eece5f8f..4bc712d8 100644 --- a/lib/widgets/custom_navigation_menu.dart +++ b/lib/widgets/custom_navigation_menu.dart @@ -1,8 +1,8 @@ import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/token_storage.dart'; import 'package:eatvio_app/widgets/custom_navigation_menu_item.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; -import 'package:hive/hive.dart'; import 'package:http/http.dart' as http; class CustomNavigationMenu extends StatelessWidget { @@ -61,8 +61,7 @@ class CustomNavigationMenu extends StatelessWidget { _onTapLogout(BuildContext context) { return () async { - final box = await Hive.openBox('token'); - final token = box.get('token'); + final token = await TokenStorage.getTokenFromStorage(); final response = await http.post( Uri.parse(baseUrl + '/api/profile/logout'), headers: { @@ -71,8 +70,7 @@ _onTapLogout(BuildContext context) { ); if (response.statusCode == 204) { - print(response.statusCode); - box.delete('token'); // Удаляем токен из Hive + await TokenStorage.removeTokenInStorage(); GoRouter.of(context).go('/auth-screen'); } }; diff --git a/pubspec.yaml b/pubspec.yaml index 1cb02791..e5f44648 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,10 +13,8 @@ dependencies: flutter_localizations: sdk: flutter + flutter_secure_storage: ^9.2.2 flutter_bloc: ^8.1.6 - shared_preferences: ^2.3.2 - hive: ^2.2.3 - hive_flutter: ^1.1.0 cached_network_image: ^3.4.1 flutter_svg: ^2.0.10 equatable: ^2.0.5 From a4c28e5ddf1f533dbb43b9c7fd0b50d1e5ac3ce8 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 26 Aug 2024 15:10:42 +0300 Subject: [PATCH 08/15] fix: analyze --- lib/core/app_export.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/core/app_export.dart b/lib/core/app_export.dart index 41302e56..88b3fe01 100644 --- a/lib/core/app_export.dart +++ b/lib/core/app_export.dart @@ -3,7 +3,6 @@ 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/pref_utils.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'; From 0a2eae682488ae1dea8ba5fcdb19dc3e5813494e Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 26 Aug 2024 15:35:01 +0300 Subject: [PATCH 09/15] fix(chat): image and clear search bar --- .../chat/presentation/pages/chat_screen.dart | 34 +++++++++++-------- .../pages/chat_select_screen.dart | 1 + .../widgets/chat_search_bar_widget.dart | 9 ++++- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index a95c93fd..3f809e28 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -59,23 +59,29 @@ class _ChatScreenState extends State { centerTitle: false, title: Row( children: [ - Container( - width: 40, - height: 40, - alignment: Alignment.center, - decoration: BoxDecoration( - color: Color(0xFFEBF4FF), - shape: BoxShape.circle, + if (state.chatRoom.users['to_chat_user']!.profilePhotoUrl != null) + CircleAvatar( + radius: 20, + foregroundImage: NetworkImage(state.chatRoom.users['to_chat_user']!.profilePhotoUrl!), ), - child: Text( - state.chatRoom.users['to_chat_user']!.name.split(' ').first[0] + state.chatRoom.users['to_chat_user']!.name.split(' ')[1][0], - style: TextStyle( - color: Color(0xFF7F9CF5), - fontWeight: FontWeight.w400, - fontSize: 20, + if (state.chatRoom.users['to_chat_user']!.profilePhotoUrl == null) + Container( + width: 40, + height: 40, + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFEBF4FF), + shape: BoxShape.circle, + ), + child: Text( + state.chatRoom.users['to_chat_user']!.name.split(' ').first[0] + state.chatRoom.users['to_chat_user']!.name.split(' ')[1][0], + style: TextStyle( + color: Color(0xFF7F9CF5), + fontWeight: FontWeight.w400, + fontSize: 20, + ), ), ), - ), SizedBox(width: 16), Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/features/chat/presentation/pages/chat_select_screen.dart b/lib/features/chat/presentation/pages/chat_select_screen.dart index bdb3d9ce..74925e29 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen.dart @@ -39,6 +39,7 @@ class _ChatSelectScreenState extends State { title: Padding( padding: const EdgeInsets.only(top: 8), child: ChatSearchBarWidget( + onSuffixIconTap: () => context.read().getChatRooms(), onChanged: (query) { if (query.length > 2) { EasyDebounce.debounce( 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 d2baebb1..62199d0f 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/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart'; import 'package:flutter/material.dart'; class ChatSearchBarWidget extends StatelessWidget { @@ -25,6 +26,7 @@ class ChatSearchBarWidget extends StatelessWidget { this.filled = true, this.validator, this.onChanged, + required this.onSuffixIconTap, }) : super(key: key); final Alignment? alignment; @@ -69,6 +71,8 @@ class ChatSearchBarWidget extends StatelessWidget { final Function(String)? onChanged; + final Function() onSuffixIconTap; + @override Widget build(BuildContext context) { return searchViewWidget(context); @@ -111,7 +115,10 @@ class ChatSearchBarWidget extends StatelessWidget { ), suffixIcon: suffix ?? IconButton( - onPressed: () => controller!.clear(), + onPressed: () { + controller!.clear(); + onSuffixIconTap(); + }, icon: Icon( Icons.clear, color: Colors.grey.shade600, From ec19861eb2a0f93d92bce6a44126d498fb4c747d Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 26 Aug 2024 16:41:19 +0300 Subject: [PATCH 10/15] feat(profile): add profile model --- .../profile/models/profile_model.dart | 30 +- .../profile/models/profile_model.freezed.dart | 382 ++++++++++++++++-- .../profile/models/profile_model.g.dart | 32 +- .../bloc/profile_cubit/profile_cubit.dart | 19 +- .../bloc/profile_cubit/profile_state.dart | 2 +- .../profile_cubit/profile_state.freezed.dart | 46 +-- .../repositories/profile_repository.dart | 10 +- .../profile/services/profile_service.dart | 5 +- .../profile/services/profile_service.g.dart | 41 +- 9 files changed, 479 insertions(+), 88 deletions(-) diff --git a/lib/features/profile/models/profile_model.dart b/lib/features/profile/models/profile_model.dart index 8ecf3b4f..e7dd87f1 100644 --- a/lib/features/profile/models/profile_model.dart +++ b/lib/features/profile/models/profile_model.dart @@ -1,24 +1,38 @@ import 'package:freezed_annotation/freezed_annotation.dart'; - part 'profile_model.freezed.dart'; part 'profile_model.g.dart'; @freezed -class Profile with _$Profile { - const factory Profile({ +class ProfileModel with _$ProfileModel { + const factory ProfileModel({ @JsonKey(name: "user") required User user, @JsonKey(name: "chartPoints") required List chartPoints, @JsonKey(name: "userDetails") required UserDetails userDetails, - @JsonKey(name: "circumferences") required List circumferences, + @JsonKey(name: "circumferences") required List circumferences, @JsonKey(name: "finishedPlans") required List finishedPlans, @JsonKey(name: "rejectedPlans") required List rejectedPlans, @JsonKey(name: "startedPlan") required List startedPlan, @JsonKey(name: "paidPlan") required List paidPlan, @JsonKey(name: "requestedPlan") required List requestedPlan, @JsonKey(name: "initedPlan") required List initedPlan, - }) = _Profile; + }) = _ProfileModel; - factory Profile.fromJson(Map json) => _$ProfileFromJson(json); + factory ProfileModel.fromJson(Map json) => _$ProfileModelFromJson(json); +} + +@freezed +class Circumference with _$Circumference { + const factory Circumference({ + @JsonKey(name: "id") required int id, + @JsonKey(name: "user_id") required int userId, + @JsonKey(name: "chest_circumference") required int chestCircumference, + @JsonKey(name: "waist_circumference") required int waistCircumference, + @JsonKey(name: "hip_circumference") required int hipCircumference, + @JsonKey(name: "created_at") required DateTime createdAt, + @JsonKey(name: "updated_at") required DateTime updatedAt, + }) = _Circumference; + + factory Circumference.fromJson(Map json) => _$CircumferenceFromJson(json); } @freezed @@ -41,7 +55,7 @@ class User with _$User { @JsonKey(name: "detailz") required UserDetails detailz, }) = _User; - factory User.fromJson(Map json) => _$UserFromJson(json); + factory User.fromJson(Map json) => _$UserFromJson(json); } @freezed @@ -78,5 +92,5 @@ class UserDetails with _$UserDetails { @JsonKey(name: "activity_coefficient") required double activityCoefficient, }) = _UserDetails; - factory UserDetails.fromJson(Map json) => _$UserDetailsFromJson(json); + factory UserDetails.fromJson(Map json) => _$UserDetailsFromJson(json); } diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart index bd65ac7b..29d3b3c4 100644 --- a/lib/features/profile/models/profile_model.freezed.dart +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -14,12 +14,12 @@ 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'); -Profile _$ProfileFromJson(Map json) { - return _Profile.fromJson(json); +ProfileModel _$ProfileModelFromJson(Map json) { + return _ProfileModel.fromJson(json); } /// @nodoc -mixin _$Profile { +mixin _$ProfileModel { @JsonKey(name: "user") User get user => throw _privateConstructorUsedError; @JsonKey(name: "chartPoints") @@ -27,7 +27,7 @@ mixin _$Profile { @JsonKey(name: "userDetails") UserDetails get userDetails => throw _privateConstructorUsedError; @JsonKey(name: "circumferences") - List get circumferences => throw _privateConstructorUsedError; + List get circumferences => throw _privateConstructorUsedError; @JsonKey(name: "finishedPlans") List get finishedPlans => throw _privateConstructorUsedError; @JsonKey(name: "rejectedPlans") @@ -43,19 +43,21 @@ mixin _$Profile { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $ProfileCopyWith get copyWith => throw _privateConstructorUsedError; + $ProfileModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class $ProfileCopyWith<$Res> { - factory $ProfileCopyWith(Profile value, $Res Function(Profile) then) = - _$ProfileCopyWithImpl<$Res, Profile>; +abstract class $ProfileModelCopyWith<$Res> { + factory $ProfileModelCopyWith( + ProfileModel value, $Res Function(ProfileModel) then) = + _$ProfileModelCopyWithImpl<$Res, ProfileModel>; @useResult $Res call( {@JsonKey(name: "user") User user, @JsonKey(name: "chartPoints") List chartPoints, @JsonKey(name: "userDetails") UserDetails userDetails, - @JsonKey(name: "circumferences") List circumferences, + @JsonKey(name: "circumferences") List circumferences, @JsonKey(name: "finishedPlans") List finishedPlans, @JsonKey(name: "rejectedPlans") List rejectedPlans, @JsonKey(name: "startedPlan") List startedPlan, @@ -68,9 +70,9 @@ abstract class $ProfileCopyWith<$Res> { } /// @nodoc -class _$ProfileCopyWithImpl<$Res, $Val extends Profile> - implements $ProfileCopyWith<$Res> { - _$ProfileCopyWithImpl(this._value, this._then); +class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> + implements $ProfileModelCopyWith<$Res> { + _$ProfileModelCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -107,7 +109,7 @@ class _$ProfileCopyWithImpl<$Res, $Val extends Profile> circumferences: null == circumferences ? _value.circumferences : circumferences // ignore: cast_nullable_to_non_nullable - as List, + as List, finishedPlans: null == finishedPlans ? _value.finishedPlans : finishedPlans // ignore: cast_nullable_to_non_nullable @@ -153,17 +155,18 @@ class _$ProfileCopyWithImpl<$Res, $Val extends Profile> } /// @nodoc -abstract class _$$ProfileImplCopyWith<$Res> implements $ProfileCopyWith<$Res> { - factory _$$ProfileImplCopyWith( - _$ProfileImpl value, $Res Function(_$ProfileImpl) then) = - __$$ProfileImplCopyWithImpl<$Res>; +abstract class _$$ProfileModelImplCopyWith<$Res> + implements $ProfileModelCopyWith<$Res> { + factory _$$ProfileModelImplCopyWith( + _$ProfileModelImpl value, $Res Function(_$ProfileModelImpl) then) = + __$$ProfileModelImplCopyWithImpl<$Res>; @override @useResult $Res call( {@JsonKey(name: "user") User user, @JsonKey(name: "chartPoints") List chartPoints, @JsonKey(name: "userDetails") UserDetails userDetails, - @JsonKey(name: "circumferences") List circumferences, + @JsonKey(name: "circumferences") List circumferences, @JsonKey(name: "finishedPlans") List finishedPlans, @JsonKey(name: "rejectedPlans") List rejectedPlans, @JsonKey(name: "startedPlan") List startedPlan, @@ -178,11 +181,11 @@ abstract class _$$ProfileImplCopyWith<$Res> implements $ProfileCopyWith<$Res> { } /// @nodoc -class __$$ProfileImplCopyWithImpl<$Res> - extends _$ProfileCopyWithImpl<$Res, _$ProfileImpl> - implements _$$ProfileImplCopyWith<$Res> { - __$$ProfileImplCopyWithImpl( - _$ProfileImpl _value, $Res Function(_$ProfileImpl) _then) +class __$$ProfileModelImplCopyWithImpl<$Res> + extends _$ProfileModelCopyWithImpl<$Res, _$ProfileModelImpl> + implements _$$ProfileModelImplCopyWith<$Res> { + __$$ProfileModelImplCopyWithImpl( + _$ProfileModelImpl _value, $Res Function(_$ProfileModelImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -199,7 +202,7 @@ class __$$ProfileImplCopyWithImpl<$Res> Object? requestedPlan = null, Object? initedPlan = null, }) { - return _then(_$ProfileImpl( + return _then(_$ProfileModelImpl( user: null == user ? _value.user : user // ignore: cast_nullable_to_non_nullable @@ -215,7 +218,7 @@ class __$$ProfileImplCopyWithImpl<$Res> circumferences: null == circumferences ? _value._circumferences : circumferences // ignore: cast_nullable_to_non_nullable - as List, + as List, finishedPlans: null == finishedPlans ? _value._finishedPlans : finishedPlans // ignore: cast_nullable_to_non_nullable @@ -246,13 +249,13 @@ class __$$ProfileImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$ProfileImpl implements _Profile { - const _$ProfileImpl( +class _$ProfileModelImpl implements _ProfileModel { + const _$ProfileModelImpl( {@JsonKey(name: "user") required this.user, @JsonKey(name: "chartPoints") required final List chartPoints, @JsonKey(name: "userDetails") required this.userDetails, @JsonKey(name: "circumferences") - required final List circumferences, + required final List circumferences, @JsonKey(name: "finishedPlans") required final List finishedPlans, @JsonKey(name: "rejectedPlans") @@ -271,8 +274,8 @@ class _$ProfileImpl implements _Profile { _requestedPlan = requestedPlan, _initedPlan = initedPlan; - factory _$ProfileImpl.fromJson(Map json) => - _$$ProfileImplFromJson(json); + factory _$ProfileModelImpl.fromJson(Map json) => + _$$ProfileModelImplFromJson(json); @override @JsonKey(name: "user") @@ -289,10 +292,10 @@ class _$ProfileImpl implements _Profile { @override @JsonKey(name: "userDetails") final UserDetails userDetails; - final List _circumferences; + final List _circumferences; @override @JsonKey(name: "circumferences") - List get circumferences { + List get circumferences { if (_circumferences is EqualUnmodifiableListView) return _circumferences; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_circumferences); @@ -354,14 +357,14 @@ class _$ProfileImpl implements _Profile { @override String toString() { - return 'Profile(user: $user, chartPoints: $chartPoints, userDetails: $userDetails, circumferences: $circumferences, finishedPlans: $finishedPlans, rejectedPlans: $rejectedPlans, startedPlan: $startedPlan, paidPlan: $paidPlan, requestedPlan: $requestedPlan, initedPlan: $initedPlan)'; + return 'ProfileModel(user: $user, chartPoints: $chartPoints, userDetails: $userDetails, circumferences: $circumferences, finishedPlans: $finishedPlans, rejectedPlans: $rejectedPlans, startedPlan: $startedPlan, paidPlan: $paidPlan, requestedPlan: $requestedPlan, initedPlan: $initedPlan)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$ProfileImpl && + other is _$ProfileModelImpl && (identical(other.user, user) || other.user == user) && const DeepCollectionEquality() .equals(other._chartPoints, _chartPoints) && @@ -400,24 +403,24 @@ class _$ProfileImpl implements _Profile { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ProfileImplCopyWith<_$ProfileImpl> get copyWith => - __$$ProfileImplCopyWithImpl<_$ProfileImpl>(this, _$identity); + _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => + __$$ProfileModelImplCopyWithImpl<_$ProfileModelImpl>(this, _$identity); @override Map toJson() { - return _$$ProfileImplToJson( + return _$$ProfileModelImplToJson( this, ); } } -abstract class _Profile implements Profile { - const factory _Profile( +abstract class _ProfileModel implements ProfileModel { + const factory _ProfileModel( {@JsonKey(name: "user") required final User user, @JsonKey(name: "chartPoints") required final List chartPoints, @JsonKey(name: "userDetails") required final UserDetails userDetails, @JsonKey(name: "circumferences") - required final List circumferences, + required final List circumferences, @JsonKey(name: "finishedPlans") required final List finishedPlans, @JsonKey(name: "rejectedPlans") @@ -427,9 +430,10 @@ abstract class _Profile implements Profile { @JsonKey(name: "requestedPlan") required final List requestedPlan, @JsonKey(name: "initedPlan") - required final List initedPlan}) = _$ProfileImpl; + required final List initedPlan}) = _$ProfileModelImpl; - factory _Profile.fromJson(Map json) = _$ProfileImpl.fromJson; + factory _ProfileModel.fromJson(Map json) = + _$ProfileModelImpl.fromJson; @override @JsonKey(name: "user") @@ -442,7 +446,7 @@ abstract class _Profile implements Profile { UserDetails get userDetails; @override @JsonKey(name: "circumferences") - List get circumferences; + List get circumferences; @override @JsonKey(name: "finishedPlans") List get finishedPlans; @@ -463,7 +467,297 @@ abstract class _Profile implements Profile { List get initedPlan; @override @JsonKey(ignore: true) - _$$ProfileImplCopyWith<_$ProfileImpl> get copyWith => + _$$ProfileModelImplCopyWith<_$ProfileModelImpl> get copyWith => + throw _privateConstructorUsedError; +} + +Circumference _$CircumferenceFromJson(Map json) { + return _Circumference.fromJson(json); +} + +/// @nodoc +mixin _$Circumference { + @JsonKey(name: "id") + int get id => throw _privateConstructorUsedError; + @JsonKey(name: "user_id") + int get userId => throw _privateConstructorUsedError; + @JsonKey(name: "chest_circumference") + int get chestCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "waist_circumference") + int get waistCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "hip_circumference") + int get hipCircumference => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") + DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") + DateTime get updatedAt => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $CircumferenceCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $CircumferenceCopyWith<$Res> { + factory $CircumferenceCopyWith( + Circumference value, $Res Function(Circumference) then) = + _$CircumferenceCopyWithImpl<$Res, Circumference>; + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "chest_circumference") int chestCircumference, + @JsonKey(name: "waist_circumference") int waistCircumference, + @JsonKey(name: "hip_circumference") int hipCircumference, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt}); +} + +/// @nodoc +class _$CircumferenceCopyWithImpl<$Res, $Val extends Circumference> + implements $CircumferenceCopyWith<$Res> { + _$CircumferenceCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? chestCircumference = null, + Object? waistCircumference = null, + Object? hipCircumference = null, + Object? createdAt = null, + Object? updatedAt = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + chestCircumference: null == chestCircumference + ? _value.chestCircumference + : chestCircumference // ignore: cast_nullable_to_non_nullable + as int, + waistCircumference: null == waistCircumference + ? _value.waistCircumference + : waistCircumference // ignore: cast_nullable_to_non_nullable + as int, + hipCircumference: null == hipCircumference + ? _value.hipCircumference + : hipCircumference // ignore: cast_nullable_to_non_nullable + as int, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$CircumferenceImplCopyWith<$Res> + implements $CircumferenceCopyWith<$Res> { + factory _$$CircumferenceImplCopyWith( + _$CircumferenceImpl value, $Res Function(_$CircumferenceImpl) then) = + __$$CircumferenceImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "chest_circumference") int chestCircumference, + @JsonKey(name: "waist_circumference") int waistCircumference, + @JsonKey(name: "hip_circumference") int hipCircumference, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt}); +} + +/// @nodoc +class __$$CircumferenceImplCopyWithImpl<$Res> + extends _$CircumferenceCopyWithImpl<$Res, _$CircumferenceImpl> + implements _$$CircumferenceImplCopyWith<$Res> { + __$$CircumferenceImplCopyWithImpl( + _$CircumferenceImpl _value, $Res Function(_$CircumferenceImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? chestCircumference = null, + Object? waistCircumference = null, + Object? hipCircumference = null, + Object? createdAt = null, + Object? updatedAt = null, + }) { + return _then(_$CircumferenceImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + chestCircumference: null == chestCircumference + ? _value.chestCircumference + : chestCircumference // ignore: cast_nullable_to_non_nullable + as int, + waistCircumference: null == waistCircumference + ? _value.waistCircumference + : waistCircumference // ignore: cast_nullable_to_non_nullable + as int, + hipCircumference: null == hipCircumference + ? _value.hipCircumference + : hipCircumference // ignore: cast_nullable_to_non_nullable + as int, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$CircumferenceImpl implements _Circumference { + const _$CircumferenceImpl( + {@JsonKey(name: "id") required this.id, + @JsonKey(name: "user_id") required this.userId, + @JsonKey(name: "chest_circumference") required this.chestCircumference, + @JsonKey(name: "waist_circumference") required this.waistCircumference, + @JsonKey(name: "hip_circumference") required this.hipCircumference, + @JsonKey(name: "created_at") required this.createdAt, + @JsonKey(name: "updated_at") required this.updatedAt}); + + factory _$CircumferenceImpl.fromJson(Map json) => + _$$CircumferenceImplFromJson(json); + + @override + @JsonKey(name: "id") + final int id; + @override + @JsonKey(name: "user_id") + final int userId; + @override + @JsonKey(name: "chest_circumference") + final int chestCircumference; + @override + @JsonKey(name: "waist_circumference") + final int waistCircumference; + @override + @JsonKey(name: "hip_circumference") + final int hipCircumference; + @override + @JsonKey(name: "created_at") + final DateTime createdAt; + @override + @JsonKey(name: "updated_at") + final DateTime updatedAt; + + @override + String toString() { + return 'Circumference(id: $id, userId: $userId, chestCircumference: $chestCircumference, waistCircumference: $waistCircumference, hipCircumference: $hipCircumference, createdAt: $createdAt, updatedAt: $updatedAt)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$CircumferenceImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.userId, userId) || other.userId == userId) && + (identical(other.chestCircumference, chestCircumference) || + other.chestCircumference == chestCircumference) && + (identical(other.waistCircumference, waistCircumference) || + other.waistCircumference == waistCircumference) && + (identical(other.hipCircumference, hipCircumference) || + other.hipCircumference == hipCircumference) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, id, userId, chestCircumference, + waistCircumference, hipCircumference, createdAt, updatedAt); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$CircumferenceImplCopyWith<_$CircumferenceImpl> get copyWith => + __$$CircumferenceImplCopyWithImpl<_$CircumferenceImpl>(this, _$identity); + + @override + Map toJson() { + return _$$CircumferenceImplToJson( + this, + ); + } +} + +abstract class _Circumference implements Circumference { + const factory _Circumference( + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "user_id") required final int userId, + @JsonKey(name: "chest_circumference") + required final int chestCircumference, + @JsonKey(name: "waist_circumference") + required final int waistCircumference, + @JsonKey(name: "hip_circumference") required final int hipCircumference, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") + required final DateTime updatedAt}) = _$CircumferenceImpl; + + factory _Circumference.fromJson(Map json) = + _$CircumferenceImpl.fromJson; + + @override + @JsonKey(name: "id") + int get id; + @override + @JsonKey(name: "user_id") + int get userId; + @override + @JsonKey(name: "chest_circumference") + int get chestCircumference; + @override + @JsonKey(name: "waist_circumference") + int get waistCircumference; + @override + @JsonKey(name: "hip_circumference") + int get hipCircumference; + @override + @JsonKey(name: "created_at") + DateTime get createdAt; + @override + @JsonKey(name: "updated_at") + DateTime get updatedAt; + @override + @JsonKey(ignore: true) + _$$CircumferenceImplCopyWith<_$CircumferenceImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/features/profile/models/profile_model.g.dart b/lib/features/profile/models/profile_model.g.dart index e7943fdf..7197b817 100644 --- a/lib/features/profile/models/profile_model.g.dart +++ b/lib/features/profile/models/profile_model.g.dart @@ -6,13 +6,15 @@ part of 'profile_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_$ProfileImpl _$$ProfileImplFromJson(Map json) => - _$ProfileImpl( +_$ProfileModelImpl _$$ProfileModelImplFromJson(Map json) => + _$ProfileModelImpl( user: User.fromJson(json['user'] as Map), chartPoints: json['chartPoints'] as List, userDetails: UserDetails.fromJson(json['userDetails'] as Map), - circumferences: json['circumferences'] as List, + circumferences: (json['circumferences'] as List) + .map((e) => Circumference.fromJson(e as Map)) + .toList(), finishedPlans: json['finishedPlans'] as List, rejectedPlans: json['rejectedPlans'] as List, startedPlan: json['startedPlan'] as List, @@ -21,7 +23,7 @@ _$ProfileImpl _$$ProfileImplFromJson(Map json) => initedPlan: json['initedPlan'] as List, ); -Map _$$ProfileImplToJson(_$ProfileImpl instance) => +Map _$$ProfileModelImplToJson(_$ProfileModelImpl instance) => { 'user': instance.user, 'chartPoints': instance.chartPoints, @@ -35,6 +37,28 @@ Map _$$ProfileImplToJson(_$ProfileImpl instance) => 'initedPlan': instance.initedPlan, }; +_$CircumferenceImpl _$$CircumferenceImplFromJson(Map json) => + _$CircumferenceImpl( + id: (json['id'] as num).toInt(), + userId: (json['user_id'] as num).toInt(), + chestCircumference: (json['chest_circumference'] as num).toInt(), + waistCircumference: (json['waist_circumference'] as num).toInt(), + hipCircumference: (json['hip_circumference'] as num).toInt(), + createdAt: DateTime.parse(json['created_at'] as String), + updatedAt: DateTime.parse(json['updated_at'] as String), + ); + +Map _$$CircumferenceImplToJson(_$CircumferenceImpl instance) => + { + 'id': instance.id, + 'user_id': instance.userId, + 'chest_circumference': instance.chestCircumference, + 'waist_circumference': instance.waistCircumference, + 'hip_circumference': instance.hipCircumference, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + }; + _$UserImpl _$$UserImplFromJson(Map json) => _$UserImpl( id: (json['id'] as num).toInt(), name: json['name'] as String, diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index 452c1895..a1ee1be7 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -5,11 +5,26 @@ import 'package:eatvio_app/features/profile/repositories/profile_repository.dart class ProfileCubit extends Cubit { final ProfileRepository profileRepository; - ProfileCubit({required this.profileRepository}) : super(const ProfileState.loading()); + ProfileCubit({ + required this.profileRepository, + }) : super(const ProfileState.loading()); getProfileBySlug(String slug) async { try { - emit(ProfileState.loaded(profile: await profileRepository.getProfileBySlug(slug))); + emit(ProfileState.loaded( + profile: await profileRepository.getProfileBySlug(slug), + )); + } catch (e) { + emit(ProfileState.error(errorMessage: e.toString())); + print(e); + } + } + + getMyProfile() async { + try { + emit(ProfileState.loaded( + profile: await profileRepository.getMyProfile(), + )); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); print(e); diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart index 1b6ee5ad..1f06bfe4 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.dart @@ -10,7 +10,7 @@ abstract class ProfileState with _$ProfileState { const factory ProfileState.loading() = ProfileStateLoading; const factory ProfileState.loaded({ - required Profile profile, + required ProfileModel profile, }) = ProfileStateLoaded; const factory ProfileState.error({ diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart index f36c6545..2658d2e2 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_state.freezed.dart @@ -20,7 +20,7 @@ mixin _$ProfileState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(Profile profile) loaded, + required TResult Function(ProfileModel profile) loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; @@ -28,7 +28,7 @@ mixin _$ProfileState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(Profile profile)? loaded, + TResult? Function(ProfileModel profile)? loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -36,7 +36,7 @@ mixin _$ProfileState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(Profile profile)? loaded, + TResult Function(ProfileModel profile)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -126,7 +126,7 @@ class _$ProfileStateImpl implements _ProfileState { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(Profile profile) loaded, + required TResult Function(ProfileModel profile) loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -137,7 +137,7 @@ class _$ProfileStateImpl implements _ProfileState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(Profile profile)? loaded, + TResult? Function(ProfileModel profile)? loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -148,7 +148,7 @@ class _$ProfileStateImpl implements _ProfileState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(Profile profile)? loaded, + TResult Function(ProfileModel profile)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -241,7 +241,7 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(Profile profile) loaded, + required TResult Function(ProfileModel profile) loaded, required TResult Function(String errorMessage) error, }) { return loading(); @@ -252,7 +252,7 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(Profile profile)? loaded, + TResult? Function(ProfileModel profile)? loaded, TResult? Function(String errorMessage)? error, }) { return loading?.call(); @@ -263,7 +263,7 @@ class _$ProfileStateLoadingImpl implements ProfileStateLoading { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(Profile profile)? loaded, + TResult Function(ProfileModel profile)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -321,9 +321,9 @@ abstract class _$$ProfileStateLoadedImplCopyWith<$Res> { $Res Function(_$ProfileStateLoadedImpl) then) = __$$ProfileStateLoadedImplCopyWithImpl<$Res>; @useResult - $Res call({Profile profile}); + $Res call({ProfileModel profile}); - $ProfileCopyWith<$Res> get profile; + $ProfileModelCopyWith<$Res> get profile; } /// @nodoc @@ -343,14 +343,14 @@ class __$$ProfileStateLoadedImplCopyWithImpl<$Res> profile: null == profile ? _value.profile : profile // ignore: cast_nullable_to_non_nullable - as Profile, + as ProfileModel, )); } @override @pragma('vm:prefer-inline') - $ProfileCopyWith<$Res> get profile { - return $ProfileCopyWith<$Res>(_value.profile, (value) { + $ProfileModelCopyWith<$Res> get profile { + return $ProfileModelCopyWith<$Res>(_value.profile, (value) { return _then(_value.copyWith(profile: value)); }); } @@ -362,7 +362,7 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { const _$ProfileStateLoadedImpl({required this.profile}); @override - final Profile profile; + final ProfileModel profile; @override String toString() { @@ -392,7 +392,7 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(Profile profile) loaded, + required TResult Function(ProfileModel profile) loaded, required TResult Function(String errorMessage) error, }) { return loaded(profile); @@ -403,7 +403,7 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(Profile profile)? loaded, + TResult? Function(ProfileModel profile)? loaded, TResult? Function(String errorMessage)? error, }) { return loaded?.call(profile); @@ -414,7 +414,7 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(Profile profile)? loaded, + TResult Function(ProfileModel profile)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -463,10 +463,10 @@ class _$ProfileStateLoadedImpl implements ProfileStateLoaded { } abstract class ProfileStateLoaded implements ProfileState { - const factory ProfileStateLoaded({required final Profile profile}) = + const factory ProfileStateLoaded({required final ProfileModel profile}) = _$ProfileStateLoadedImpl; - Profile get profile; + ProfileModel get profile; @JsonKey(ignore: true) _$$ProfileStateLoadedImplCopyWith<_$ProfileStateLoadedImpl> get copyWith => throw _privateConstructorUsedError; @@ -540,7 +540,7 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult when( TResult Function() $default, { required TResult Function() loading, - required TResult Function(Profile profile) loaded, + required TResult Function(ProfileModel profile) loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -551,7 +551,7 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? loading, - TResult? Function(Profile profile)? loaded, + TResult? Function(ProfileModel profile)? loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -562,7 +562,7 @@ class _$ProfileStateErrorImpl implements ProfileStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? loading, - TResult Function(Profile profile)? loaded, + TResult Function(ProfileModel profile)? loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { diff --git a/lib/features/profile/repositories/profile_repository.dart b/lib/features/profile/repositories/profile_repository.dart index af15d704..b9dbdf1e 100644 --- a/lib/features/profile/repositories/profile_repository.dart +++ b/lib/features/profile/repositories/profile_repository.dart @@ -6,11 +6,19 @@ class ProfileRepository { ProfileRepository({required this.profileService}); - Future getProfileBySlug(String slug) async { + Future getProfileBySlug(String slug) async { try { return await profileService.getProfileBySlug(slug: slug); } catch (e) { rethrow; } } + + Future getMyProfile() async { + try { + return await profileService.getMyProfile(); + } catch (e) { + rethrow; + } + } } diff --git a/lib/features/profile/services/profile_service.dart b/lib/features/profile/services/profile_service.dart index e9863ca2..5f5657b9 100644 --- a/lib/features/profile/services/profile_service.dart +++ b/lib/features/profile/services/profile_service.dart @@ -9,7 +9,10 @@ abstract class ProfileService { factory ProfileService(Dio dio, {String baseUrl}) = _ProfileService; @GET('/api/profile/show/{slug}') - Future getProfileBySlug({ + Future getProfileBySlug({ @Path() required String slug, }); + + @GET('/api/profile/index') + Future getMyProfile(); } diff --git a/lib/features/profile/services/profile_service.g.dart b/lib/features/profile/services/profile_service.g.dart index 79ebdb24..bc096fdf 100644 --- a/lib/features/profile/services/profile_service.g.dart +++ b/lib/features/profile/services/profile_service.g.dart @@ -22,12 +22,12 @@ class _ProfileService implements ProfileService { final ParseErrorLogger? errorLogger; @override - Future getProfileBySlug({required String slug}) async { + Future getProfileBySlug({required String slug}) async { final _extra = {}; final queryParameters = {}; final _headers = {}; const Map? _data = null; - final _options = _setStreamType(Options( + final _options = _setStreamType(Options( method: 'GET', headers: _headers, extra: _extra, @@ -44,9 +44,42 @@ class _ProfileService implements ProfileService { baseUrl, ))); final _result = await _dio.fetch>(_options); - late Profile _value; + late ProfileModel _value; try { - _value = Profile.fromJson(_result.data!); + _value = ProfileModel.fromJson(_result.data!); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + + @override + Future getMyProfile() async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType(Options( + method: 'GET', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/index', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late ProfileModel _value; + try { + _value = ProfileModel.fromJson(_result.data!); } on Object catch (e, s) { errorLogger?.logError(e, s, _options); rethrow; From 7e919d8f4c55da2dad608bb6f8f4884488079e26 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Tue, 27 Aug 2024 16:59:37 +0300 Subject: [PATCH 11/15] feat(profile): Replaced the diet and calendar icons, reduced the height of the bottom nav bar, added the first version of the measurements graph, added the time of the chat message and changed the design slightly --- assets/icons/calendar.svg | 29 + assets/icons/diets.svg | 24 + lib/app_router.dart | 3 +- .../profile_avatar_cubit.dart | 22 + .../profile_avatar_state.dart | 19 + .../profile_avatar_state.freezed.dart | 630 ++++++++++++++++++ .../widgets/bottom_navigation_bar_widget.dart | 247 ++++--- .../widgets/chat_bubble_widget.dart | 29 +- .../widgets/chat_search_bar_widget.dart | 1 - .../bloc/profile_cubit/profile_cubit.dart | 16 + .../presentation/pages/profile_screen.dart | 134 +++- .../repositories/profile_repository.dart | 18 + .../profile/services/profile_service.dart | 7 + .../profile/services/profile_service.g.dart | 50 ++ lib/locator_service.dart | 2 + lib/main.dart | 2 + lib/widgets/custom_navigation_menu.dart | 4 +- pubspec.yaml | 3 +- 18 files changed, 1102 insertions(+), 138 deletions(-) create mode 100644 assets/icons/calendar.svg create mode 100644 assets/icons/diets.svg create mode 100644 lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart create mode 100644 lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart create mode 100644 lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart diff --git a/assets/icons/calendar.svg b/assets/icons/calendar.svg new file mode 100644 index 00000000..e9d97952 --- /dev/null +++ b/assets/icons/calendar.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/diets.svg b/assets/icons/diets.svg new file mode 100644 index 00000000..7714b3fa --- /dev/null +++ b/assets/icons/diets.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/lib/app_router.dart b/lib/app_router.dart index 57923180..3a662763 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -24,7 +24,6 @@ import 'package:eatvio_app/presentation/diets/diet_select_screen/diet_select_scr 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_profile_screen.dart'; import 'package:eatvio_app/presentation/profile/my_profile_screen/my_settings_screen.dart'; import 'package:eatvio_app/presentation/recipe/recipe_select_screen/recipe_select_screen.dart'; import 'package:flutter/material.dart'; @@ -62,7 +61,7 @@ class AppRouter { }, routes: [ GoRoute( - pageBuilder: (context, state) => NoTransitionPage(child: MyProfileScreen()), + pageBuilder: (context, state) => NoTransitionPage(child: ProfileScreen()), path: '/my-profile-screen', name: 'myProfileScreen', redirect: (context, state) async { 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 new file mode 100644 index 00000000..e2bfd48b --- /dev/null +++ b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart @@ -0,0 +1,22 @@ +import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart'; +import 'package:eatvio_app/features/profile/repositories/profile_repository.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +class ProfileAvatarCubit extends Cubit { + final ProfileRepository profileRepository; + + ProfileAvatarCubit({ + required this.profileRepository, + }) : super(const ProfileAvatarState.loading()); + + getMyProfile() async { + try { + emit(ProfileAvatarState.loaded( + profile: await profileRepository.getMyProfile(), + )); + } catch (e) { + emit(ProfileAvatarState.error(errorMessage: e.toString())); + print(e); + } + } +} \ No newline at end of file diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart new file mode 100644 index 00000000..fe90fb6f --- /dev/null +++ b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart @@ -0,0 +1,19 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'profile_avatar_state.freezed.dart'; + +@freezed +abstract class ProfileAvatarState with _$ProfileAvatarState { + const factory ProfileAvatarState() = _ProfileAvatarState; + + const factory ProfileAvatarState.loading() = ProfileAvatarStateLoading; + + const factory ProfileAvatarState.loaded({ + required ProfileModel profile, + }) = ProfileAvatarStateLoaded; + + const factory ProfileAvatarState.error({ + required String errorMessage, + }) = ProfileAvatarStateError; +} 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 new file mode 100644 index 00000000..5d8de7ff --- /dev/null +++ b/lib/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.freezed.dart @@ -0,0 +1,630 @@ +// 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 'profile_avatar_state.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'); + +/// @nodoc +mixin _$ProfileAvatarState { + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(ProfileModel profile) loaded, + required TResult Function(String errorMessage) error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(ProfileModel profile)? loaded, + TResult? Function(String errorMessage)? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(ProfileModel profile)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map( + TResult Function(_ProfileAvatarState value) $default, { + required TResult Function(ProfileAvatarStateLoading value) loading, + required TResult Function(ProfileAvatarStateLoaded value) loaded, + required TResult Function(ProfileAvatarStateError value) error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_ProfileAvatarState value)? $default, { + TResult? Function(ProfileAvatarStateLoading value)? loading, + TResult? Function(ProfileAvatarStateLoaded value)? loaded, + TResult? Function(ProfileAvatarStateError value)? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap( + TResult Function(_ProfileAvatarState value)? $default, { + TResult Function(ProfileAvatarStateLoading value)? loading, + TResult Function(ProfileAvatarStateLoaded value)? loaded, + TResult Function(ProfileAvatarStateError value)? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ProfileAvatarStateCopyWith<$Res> { + factory $ProfileAvatarStateCopyWith( + ProfileAvatarState value, $Res Function(ProfileAvatarState) then) = + _$ProfileAvatarStateCopyWithImpl<$Res, ProfileAvatarState>; +} + +/// @nodoc +class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState> + implements $ProfileAvatarStateCopyWith<$Res> { + _$ProfileAvatarStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$ProfileAvatarStateImplCopyWith<$Res> { + factory _$$ProfileAvatarStateImplCopyWith(_$ProfileAvatarStateImpl value, + $Res Function(_$ProfileAvatarStateImpl) then) = + __$$ProfileAvatarStateImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$ProfileAvatarStateImplCopyWithImpl<$Res> + extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateImpl> + implements _$$ProfileAvatarStateImplCopyWith<$Res> { + __$$ProfileAvatarStateImplCopyWithImpl(_$ProfileAvatarStateImpl _value, + $Res Function(_$ProfileAvatarStateImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ProfileAvatarStateImpl implements _ProfileAvatarState { + const _$ProfileAvatarStateImpl(); + + @override + String toString() { + return 'ProfileAvatarState()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ProfileAvatarStateImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(ProfileModel profile) loaded, + required TResult Function(String errorMessage) error, + }) { + return $default(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(ProfileModel profile)? loaded, + TResult? Function(String errorMessage)? error, + }) { + return $default?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(ProfileModel profile)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if ($default != null) { + return $default(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_ProfileAvatarState value) $default, { + required TResult Function(ProfileAvatarStateLoading value) loading, + required TResult Function(ProfileAvatarStateLoaded value) loaded, + required TResult Function(ProfileAvatarStateError value) error, + }) { + return $default(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_ProfileAvatarState value)? $default, { + TResult? Function(ProfileAvatarStateLoading value)? loading, + TResult? Function(ProfileAvatarStateLoaded value)? loaded, + TResult? Function(ProfileAvatarStateError value)? error, + }) { + return $default?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_ProfileAvatarState value)? $default, { + TResult Function(ProfileAvatarStateLoading value)? loading, + TResult Function(ProfileAvatarStateLoaded value)? loaded, + TResult Function(ProfileAvatarStateError value)? error, + required TResult orElse(), + }) { + if ($default != null) { + return $default(this); + } + return orElse(); + } +} + +abstract class _ProfileAvatarState implements ProfileAvatarState { + const factory _ProfileAvatarState() = _$ProfileAvatarStateImpl; +} + +/// @nodoc +abstract class _$$ProfileAvatarStateLoadingImplCopyWith<$Res> { + factory _$$ProfileAvatarStateLoadingImplCopyWith( + _$ProfileAvatarStateLoadingImpl value, + $Res Function(_$ProfileAvatarStateLoadingImpl) then) = + __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res> + extends _$ProfileAvatarStateCopyWithImpl<$Res, + _$ProfileAvatarStateLoadingImpl> + implements _$$ProfileAvatarStateLoadingImplCopyWith<$Res> { + __$$ProfileAvatarStateLoadingImplCopyWithImpl( + _$ProfileAvatarStateLoadingImpl _value, + $Res Function(_$ProfileAvatarStateLoadingImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$ProfileAvatarStateLoadingImpl implements ProfileAvatarStateLoading { + const _$ProfileAvatarStateLoadingImpl(); + + @override + String toString() { + return 'ProfileAvatarState.loading()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProfileAvatarStateLoadingImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(ProfileModel profile) loaded, + required TResult Function(String errorMessage) error, + }) { + return loading(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(ProfileModel profile)? loaded, + TResult? Function(String errorMessage)? error, + }) { + return loading?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(ProfileModel profile)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (loading != null) { + return loading(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_ProfileAvatarState value) $default, { + required TResult Function(ProfileAvatarStateLoading value) loading, + required TResult Function(ProfileAvatarStateLoaded value) loaded, + required TResult Function(ProfileAvatarStateError value) error, + }) { + return loading(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_ProfileAvatarState value)? $default, { + TResult? Function(ProfileAvatarStateLoading value)? loading, + TResult? Function(ProfileAvatarStateLoaded value)? loaded, + TResult? Function(ProfileAvatarStateError value)? error, + }) { + return loading?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_ProfileAvatarState value)? $default, { + TResult Function(ProfileAvatarStateLoading value)? loading, + TResult Function(ProfileAvatarStateLoaded value)? loaded, + TResult Function(ProfileAvatarStateError value)? error, + required TResult orElse(), + }) { + if (loading != null) { + return loading(this); + } + return orElse(); + } +} + +abstract class ProfileAvatarStateLoading implements ProfileAvatarState { + const factory ProfileAvatarStateLoading() = _$ProfileAvatarStateLoadingImpl; +} + +/// @nodoc +abstract class _$$ProfileAvatarStateLoadedImplCopyWith<$Res> { + factory _$$ProfileAvatarStateLoadedImplCopyWith( + _$ProfileAvatarStateLoadedImpl value, + $Res Function(_$ProfileAvatarStateLoadedImpl) then) = + __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res>; + @useResult + $Res call({ProfileModel profile}); + + $ProfileModelCopyWith<$Res> get profile; +} + +/// @nodoc +class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res> + extends _$ProfileAvatarStateCopyWithImpl<$Res, + _$ProfileAvatarStateLoadedImpl> + implements _$$ProfileAvatarStateLoadedImplCopyWith<$Res> { + __$$ProfileAvatarStateLoadedImplCopyWithImpl( + _$ProfileAvatarStateLoadedImpl _value, + $Res Function(_$ProfileAvatarStateLoadedImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? profile = null, + }) { + return _then(_$ProfileAvatarStateLoadedImpl( + profile: null == profile + ? _value.profile + : profile // ignore: cast_nullable_to_non_nullable + as ProfileModel, + )); + } + + @override + @pragma('vm:prefer-inline') + $ProfileModelCopyWith<$Res> get profile { + return $ProfileModelCopyWith<$Res>(_value.profile, (value) { + return _then(_value.copyWith(profile: value)); + }); + } +} + +/// @nodoc + +class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded { + const _$ProfileAvatarStateLoadedImpl({required this.profile}); + + @override + final ProfileModel profile; + + @override + String toString() { + return 'ProfileAvatarState.loaded(profile: $profile)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProfileAvatarStateLoadedImpl && + (identical(other.profile, profile) || other.profile == profile)); + } + + @override + int get hashCode => Object.hash(runtimeType, profile); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> + get copyWith => __$$ProfileAvatarStateLoadedImplCopyWithImpl< + _$ProfileAvatarStateLoadedImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(ProfileModel profile) loaded, + required TResult Function(String errorMessage) error, + }) { + return loaded(profile); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(ProfileModel profile)? loaded, + TResult? Function(String errorMessage)? error, + }) { + return loaded?.call(profile); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(ProfileModel profile)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (loaded != null) { + return loaded(profile); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_ProfileAvatarState value) $default, { + required TResult Function(ProfileAvatarStateLoading value) loading, + required TResult Function(ProfileAvatarStateLoaded value) loaded, + required TResult Function(ProfileAvatarStateError value) error, + }) { + return loaded(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_ProfileAvatarState value)? $default, { + TResult? Function(ProfileAvatarStateLoading value)? loading, + TResult? Function(ProfileAvatarStateLoaded value)? loaded, + TResult? Function(ProfileAvatarStateError value)? error, + }) { + return loaded?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_ProfileAvatarState value)? $default, { + TResult Function(ProfileAvatarStateLoading value)? loading, + TResult Function(ProfileAvatarStateLoaded value)? loaded, + TResult Function(ProfileAvatarStateError value)? error, + required TResult orElse(), + }) { + if (loaded != null) { + return loaded(this); + } + return orElse(); + } +} + +abstract class ProfileAvatarStateLoaded implements ProfileAvatarState { + const factory ProfileAvatarStateLoaded( + {required final ProfileModel profile}) = _$ProfileAvatarStateLoadedImpl; + + ProfileModel get profile; + @JsonKey(ignore: true) + _$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$ProfileAvatarStateErrorImplCopyWith<$Res> { + factory _$$ProfileAvatarStateErrorImplCopyWith( + _$ProfileAvatarStateErrorImpl value, + $Res Function(_$ProfileAvatarStateErrorImpl) then) = + __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res>; + @useResult + $Res call({String errorMessage}); +} + +/// @nodoc +class __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res> + extends _$ProfileAvatarStateCopyWithImpl<$Res, + _$ProfileAvatarStateErrorImpl> + implements _$$ProfileAvatarStateErrorImplCopyWith<$Res> { + __$$ProfileAvatarStateErrorImplCopyWithImpl( + _$ProfileAvatarStateErrorImpl _value, + $Res Function(_$ProfileAvatarStateErrorImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? errorMessage = null, + }) { + return _then(_$ProfileAvatarStateErrorImpl( + errorMessage: null == errorMessage + ? _value.errorMessage + : errorMessage // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError { + const _$ProfileAvatarStateErrorImpl({required this.errorMessage}); + + @override + final String errorMessage; + + @override + String toString() { + return 'ProfileAvatarState.error(errorMessage: $errorMessage)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProfileAvatarStateErrorImpl && + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); + } + + @override + int get hashCode => Object.hash(runtimeType, errorMessage); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl> + get copyWith => __$$ProfileAvatarStateErrorImplCopyWithImpl< + _$ProfileAvatarStateErrorImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function(ProfileModel profile) loaded, + required TResult Function(String errorMessage) error, + }) { + return error(errorMessage); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function(ProfileModel profile)? loaded, + TResult? Function(String errorMessage)? error, + }) { + return error?.call(errorMessage); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function(ProfileModel profile)? loaded, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (error != null) { + return error(errorMessage); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_ProfileAvatarState value) $default, { + required TResult Function(ProfileAvatarStateLoading value) loading, + required TResult Function(ProfileAvatarStateLoaded value) loaded, + required TResult Function(ProfileAvatarStateError value) error, + }) { + return error(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_ProfileAvatarState value)? $default, { + TResult? Function(ProfileAvatarStateLoading value)? loading, + TResult? Function(ProfileAvatarStateLoaded value)? loaded, + TResult? Function(ProfileAvatarStateError value)? error, + }) { + return error?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_ProfileAvatarState value)? $default, { + TResult Function(ProfileAvatarStateLoading value)? loading, + TResult Function(ProfileAvatarStateLoaded value)? loaded, + TResult Function(ProfileAvatarStateError value)? error, + required TResult orElse(), + }) { + if (error != null) { + return error(this); + } + return orElse(); + } +} + +abstract class ProfileAvatarStateError implements ProfileAvatarState { + const factory ProfileAvatarStateError({required final String errorMessage}) = + _$ProfileAvatarStateErrorImpl; + + String get errorMessage; + @JsonKey(ignore: true) + _$$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 b3f74075..a7e12393 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 @@ -4,6 +4,8 @@ import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/new_ 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/widgets/custom_navigation_menu.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -68,119 +70,154 @@ class _BottomNavigationBarWidgetState extends State { Widget build(BuildContext context) { return Scaffold( body: widget.child, - bottomNavigationBar: BottomNavigationBar( - type: BottomNavigationBarType.fixed, - onTap: _onItemTapped, - selectedFontSize: 12, - unselectedFontSize: 12, - selectedItemColor: appTheme.blueA400, - currentIndex: currentBottomNavBarIndex, - items: [ - BottomNavigationBarItem( - label: '', - icon: SvgPicture.asset( - ImageConstant.imgLogo, - ), - ), - BottomNavigationBarItem( - label: 'Лента', - icon: SvgPicture.asset( - colorFilter: ColorFilter.mode(Colors.grey, BlendMode.srcIn), - width: 24, - height: 24, - ImageConstant.icnFeed, - ), - activeIcon: SvgPicture.asset( - ImageConstant.icnFeed, - width: 24, - height: 24, - colorFilter: ColorFilter.mode( - appTheme.blueA400, - BlendMode.srcIn, + bottomNavigationBar: SizedBox( + height: 58, + child: BottomNavigationBar( + type: BottomNavigationBarType.fixed, + onTap: _onItemTapped, + selectedFontSize: 10, + unselectedFontSize: 10, + selectedItemColor: appTheme.blueA400, + currentIndex: currentBottomNavBarIndex, + items: [ + BottomNavigationBarItem( + label: '', + icon: SvgPicture.asset( + ImageConstant.imgLogo, + height: 32, ), ), - ), - BottomNavigationBarItem( - label: "diary".tr, - icon: SvgPicture.asset( - colorFilter: ColorFilter.mode(Colors.grey, BlendMode.srcIn), - ImageConstant.icnDiary, - width: 24, - height: 24, - ), - activeIcon: SvgPicture.asset( - ImageConstant.icnDiary, - width: 24, - height: 24, - colorFilter: ColorFilter.mode( - appTheme.blueA400, - BlendMode.srcIn, + BottomNavigationBarItem( + label: 'Лента', + icon: Padding( + padding: const EdgeInsets.only(bottom: 2), + child: SvgPicture.asset( + colorFilter: ColorFilter.mode(Colors.grey, BlendMode.srcIn), + width: 20, + height: 20, + ImageConstant.icnFeed, + ), + ), + activeIcon: Padding( + padding: const EdgeInsets.only(bottom: 2), + child: SvgPicture.asset( + ImageConstant.icnFeed, + width: 20, + height: 20, + colorFilter: ColorFilter.mode( + appTheme.blueA400, + BlendMode.srcIn, + ), + ), ), ), - ), - BottomNavigationBarItem( - label: "chat".tr, - icon: BlocBuilder( - builder: (BuildContext context, NewMessagesState state) { - return badges.Badge( - position: badges.BadgePosition.topEnd(), - badgeContent: Text( - (state is NewMessagesStateLoaded) ? state.messagesCount.toString() : '0', - style: TextStyle( - color: Colors.white, + BottomNavigationBarItem( + label: "diary".tr, + icon: Padding( + padding: const EdgeInsets.only(bottom: 2), + child: SvgPicture.asset( + colorFilter: ColorFilter.mode(Colors.grey, BlendMode.srcIn), + ImageConstant.icnDiary, + width: 20, + height: 20, + ), + ), + activeIcon: Padding( + padding: const EdgeInsets.only(bottom: 2), + child: SvgPicture.asset( + ImageConstant.icnDiary, + width: 20, + height: 20, + colorFilter: ColorFilter.mode( + appTheme.blueA400, + BlendMode.srcIn, + ), + ), + ), + ), + BottomNavigationBarItem( + label: "chat".tr, + icon: BlocBuilder( + builder: (BuildContext context, NewMessagesState state) { + return badges.Badge( + position: badges.BadgePosition.topEnd(), + badgeAnimation: badges.BadgeAnimation.fade(), + badgeContent: Text( + (state is NewMessagesStateLoaded) ? state.messagesCount.toString() : '0', + style: TextStyle( + color: Colors.white, + fontSize: 8, + ), ), - ), - child: SvgPicture.asset( - ImageConstant.icnChat, - width: 24, - height: 24, - colorFilter: currentBottomNavBarIndex == 3 - ? ColorFilter.mode( - appTheme.blueA400, - BlendMode.srcIn, - ) - : ColorFilter.mode(Colors.grey, BlendMode.srcIn), - ), - ); - }, - ), - ), - BottomNavigationBarItem( - label: '', - icon: BlocBuilder( - builder: (BuildContext context, NotificationsState state) { - return badges.Badge( - position: badges.BadgePosition.topEnd(), - badgeContent: Text( - (state is NotificationsStateLoaded) ? state.notificationsCount.toString() : '0', - style: TextStyle( - color: Colors.white, + child: Padding( + padding: const EdgeInsets.only(bottom: 2), + child: SvgPicture.asset( + ImageConstant.icnChat, + width: 20, + height: 20, + colorFilter: currentBottomNavBarIndex == 3 + ? ColorFilter.mode( + appTheme.blueA400, + BlendMode.srcIn, + ) + : ColorFilter.mode(Colors.grey, BlendMode.srcIn), + ), ), - ), - child: SvgPicture.asset( - ImageConstant.icnBell, - colorFilter: currentBottomNavBarIndex == 4 - ? ColorFilter.mode( - appTheme.blueA400, - BlendMode.srcIn, - ) - : ColorFilter.mode(Colors.grey, BlendMode.srcIn), - width: 24, - height: 24, - ), - ); - }, + ); + }, + ), ), - ), - BottomNavigationBarItem( - label: '', - icon: Image.asset( - ImageConstant.imgEllipse1, - width: 32, - height: 32, + BottomNavigationBarItem( + label: 'Уведомления', + icon: BlocBuilder( + builder: (BuildContext context, NotificationsState state) { + return badges.Badge( + position: badges.BadgePosition.topEnd(), + badgeAnimation: badges.BadgeAnimation.fade(), + badgeContent: Text( + (state is NotificationsStateLoaded) ? state.notificationsCount.toString() : '0', + style: TextStyle( + color: Colors.white, + fontSize: 8, + ), + ), + child: Padding( + padding: const EdgeInsets.only(bottom: 2), + child: SvgPicture.asset( + ImageConstant.icnBell, + colorFilter: currentBottomNavBarIndex == 4 + ? ColorFilter.mode( + appTheme.blueA400, + BlendMode.srcIn, + ) + : ColorFilter.mode(Colors.grey, BlendMode.srcIn), + width: 20, + height: 20, + ), + ), + ); + }, + ), ), - ), - ], + 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, + ); + }, + ), + ), + ], + ), ), ); } diff --git a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart index f65fb3bc..eeba8f1e 100644 --- a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart @@ -1,8 +1,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:dismissible_page/dismissible_page.dart'; -import 'package:eatvio_app/core/constants/constants.dart'; +import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart'; -import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -29,12 +28,17 @@ class ChatBubbleWidget extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( color: isCurrentUser ? Color(0xFF7F9CF5) : Colors.white, - borderRadius: BorderRadiusStyle.circleBorder17, + borderRadius: mediaData.length > 0 + ? BorderRadius.circular(24) + : BorderRadius.horizontal( + left: isCurrentUser ? Radius.circular(32) : Radius.circular(16), + right: isCurrentUser ? Radius.circular(16) : Radius.circular(24), + ), ), child: Padding( - padding: const EdgeInsets.all(12), + padding: mediaData.length > 0 ? EdgeInsets.all(8) : EdgeInsets.only(top: 8, bottom: 8, left: isCurrentUser ? 16 : 8, right: isCurrentUser ? 8 : 16), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: isCurrentUser ? CrossAxisAlignment.end : CrossAxisAlignment.start, children: [ if (mediaData.isNotEmpty) CustomScrollView( @@ -86,7 +90,7 @@ class ChatBubbleWidget extends StatelessWidget { tag: baseUrl + '/storage/' + '${mediaData[index]}', transitionOnUserGestures: true, child: ClipRRect( - borderRadius: BorderRadiusStyle.roundedBorder8, + borderRadius: BorderRadius.circular(16), child: CachedNetworkImage( imageUrl: baseUrl + '/storage/' + '${mediaData[index]}', ), @@ -103,10 +107,17 @@ class ChatBubbleWidget extends StatelessWidget { if (text.isNotEmpty) Text( text, - style: TextStyle( - color: isCurrentUser ? Colors.white : Color(0xFF323F4B), - ), + 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, + ), + ), ], ), ), 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 62199d0f..4889fdfd 100644 --- a/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_search_bar_widget.dart @@ -1,5 +1,4 @@ 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:flutter/material.dart'; class ChatSearchBarWidget extends StatelessWidget { diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index a1ee1be7..34f6385e 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -30,4 +30,20 @@ class ProfileCubit extends Cubit { print(e); } } + + addCircumference({ + required int chestCircumference, + required int waistCircumference, + required int hipCircumference, + }) async { + try { + await profileRepository.addCircumference( + chestCircumference: chestCircumference, + waistCircumference: waistCircumference, + hipCircumference: hipCircumference, + ); + } catch (e) { + emit(ProfileState.error(errorMessage: e.toString())); + } + } } diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index d4cec48f..5bd5154a 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -1,46 +1,84 @@ import 'package:eatvio_app/core/app_export.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; +import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_state.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; -class ProfileScreen extends StatelessWidget { - final Author author; +class ProfileScreen extends StatefulWidget { + final Author? author; - const ProfileScreen({super.key, required this.author}); + const ProfileScreen({super.key, this.author}); + + @override + State createState() => _ProfileScreenState(); +} + +class _ProfileScreenState extends State { + List chartData = []; @override Widget build(BuildContext context) { return BlocProvider( - create: (BuildContext context) => sl()..getProfileBySlug(author.authorSlug), + create: (BuildContext context) { + if (widget.author == null) + return sl()..getMyProfile(); + else + return sl()..getProfileBySlug(widget.author!.authorSlug); + }, child: BlocBuilder( builder: (BuildContext context, ProfileState state) { if (state is ProfileStateLoaded) { + chartData = state.profile.circumferences; return Scaffold( appBar: AppBar( - centerTitle: true, - title: Text( - state.profile.user.name, - style: TextStyle( - color: Colors.black, - fontSize: 24, - fontWeight: FontWeight.w400, - height: 1, - ), - ), + centerTitle: false, + title: Text(state.profile.user.name), ), body: SingleChildScrollView( - padding: EdgeInsets.all(16), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Center( + Padding( + padding: const EdgeInsets.only(left: 16, bottom: 32), child: CircleAvatar( - maxRadius: 128, - minRadius: 128, + radius: 32, backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl), ), ), + SfCartesianChart( + margin: EdgeInsets.zero, + enableAxisAnimation: true, + enableSideBySideSeriesPlacement: true, + legend: const Legend( + isVisible: true, + opacity: 0.7, + position: LegendPosition.bottom, + ), + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + ), + primaryXAxis: DateTimeAxis( + dateFormat: DateFormat.MMMd('ru'), + axisLine: AxisLine( + width: 1, + ), + ), + primaryYAxis: NumericAxis( + labelFormat: '{value} см', + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineAreaSeries(), + tooltipBehavior: TooltipBehavior(enable: true), + ), ], ), ), @@ -67,4 +105,64 @@ class ProfileScreen extends StatelessWidget { ), ); } + + List> _getSplineAreaSeries() { + final Color seriesColor1 = Colors.red; + final Color seriesColor2 = Colors.blue; + final Color seriesColor3 = Colors.green; + + return >[ + SplineSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: seriesColor1, + height: 12, + width: 12, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: chartData, + color: seriesColor1, + name: 'Грудь', + xValueMapper: (Circumference value, int index) => value.createdAt, + yValueMapper: (Circumference value, int index) => value.chestCircumference, + ), + SplineSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: seriesColor2, + height: 12, + width: 12, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: chartData, + color: seriesColor2, + name: 'Талия', + xValueMapper: (Circumference value, int index) => value.createdAt, + yValueMapper: (Circumference value, int index) => value.waistCircumference, + ), + SplineSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: seriesColor3, + height: 12, + width: 12, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: chartData, + color: seriesColor3, + name: 'Бёдра', + xValueMapper: (Circumference value, int index) => value.createdAt, + yValueMapper: (Circumference value, int index) => value.hipCircumference, + ), + ]; + } } diff --git a/lib/features/profile/repositories/profile_repository.dart b/lib/features/profile/repositories/profile_repository.dart index b9dbdf1e..a57be856 100644 --- a/lib/features/profile/repositories/profile_repository.dart +++ b/lib/features/profile/repositories/profile_repository.dart @@ -21,4 +21,22 @@ class ProfileRepository { rethrow; } } + + Future addCircumference({ + required int chestCircumference, + required int waistCircumference, + required int hipCircumference, + }) async { + try { + return (await profileService.addCircumference( + chestCircumference: chestCircumference, + waistCircumference: waistCircumference, + hipCircumference: hipCircumference, + )) + .values + .first; + } catch (e) { + rethrow; + } + } } diff --git a/lib/features/profile/services/profile_service.dart b/lib/features/profile/services/profile_service.dart index 5f5657b9..dc9f2864 100644 --- a/lib/features/profile/services/profile_service.dart +++ b/lib/features/profile/services/profile_service.dart @@ -15,4 +15,11 @@ abstract class ProfileService { @GET('/api/profile/index') Future getMyProfile(); + + @POST('/api/profile/addCircumference') + Future> addCircumference({ + @Part(name: 'chest_circumference') required int chestCircumference, + @Part(name: 'waist_circumference') required int waistCircumference, + @Part(name: 'hip_circumference') required int hipCircumference, + }); } diff --git a/lib/features/profile/services/profile_service.g.dart b/lib/features/profile/services/profile_service.g.dart index bc096fdf..7b2969ad 100644 --- a/lib/features/profile/services/profile_service.g.dart +++ b/lib/features/profile/services/profile_service.g.dart @@ -87,6 +87,56 @@ class _ProfileService implements ProfileService { return _value; } + @override + Future> addCircumference({ + required int chestCircumference, + required int waistCircumference, + required int hipCircumference, + }) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = FormData(); + _data.fields.add(MapEntry( + 'chest_circumference', + chestCircumference.toString(), + )); + _data.fields.add(MapEntry( + 'waist_circumference', + waistCircumference.toString(), + )); + _data.fields.add(MapEntry( + 'hip_circumference', + hipCircumference.toString(), + )); + final _options = _setStreamType>(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/addCircumference', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late Map _value; + try { + _value = _result.data!.map((k, dynamic v) => + MapEntry(k, Circumference.fromJson(v as Map))); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + RequestOptions _setStreamType(RequestOptions requestOptions) { if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || diff --git a/lib/locator_service.dart b/lib/locator_service.dart index f0a28808..a73d21f1 100644 --- a/lib/locator_service.dart +++ b/lib/locator_service.dart @@ -3,6 +3,7 @@ import 'package:eatvio_app/core/constants/constants.dart'; import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.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/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart'; import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_cubit.dart'; import 'package:eatvio_app/features/calendar/repositories/calendar_repository.dart'; import 'package:eatvio_app/features/calendar/services/calendar_service.dart'; @@ -45,6 +46,7 @@ Future init() async { sl.registerFactory(() => DiaryBloc(diaryRepository: sl())); sl.registerFactory(() => CalendarCubit(calendarRepository: sl())); sl.registerFactory(() => ProfileCubit(profileRepository: sl())); + sl.registerFactory(() => ProfileAvatarCubit(profileRepository: sl())); sl.registerFactory(() => RecipeCreateCubit(recipeRepository: sl())); sl.registerFactory(() => DietsCubit(feedRepository: sl())); sl.registerFactory(() => CommentsCubit(feedRepository: sl())); diff --git a/lib/main.dart b/lib/main.dart index e031d6a6..a0867795 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,6 +3,7 @@ import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart'; import 'package:eatvio_app/core/initialization_cubit/initialization_state.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/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart'; import 'package:eatvio_app/features/calendar/presentation/bloc/calendar_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_select_cubit/chat_select_cubit.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_bloc.dart'; @@ -42,6 +43,7 @@ class MyApp extends StatelessWidget { BlocProvider(create: (context) => sl()), BlocProvider(create: (context) => sl()), BlocProvider(create: (context) => sl()), + BlocProvider(create: (context) => sl()..getMyProfile()), BlocProvider(create: (context) => sl()..loadFeedBlogPostList()), BlocProvider(create: (context) => sl()..loadRecipesList()), BlocProvider(create: (context) => sl()..loadDiets()), diff --git a/lib/widgets/custom_navigation_menu.dart b/lib/widgets/custom_navigation_menu.dart index 4bc712d8..c3222e62 100644 --- a/lib/widgets/custom_navigation_menu.dart +++ b/lib/widgets/custom_navigation_menu.dart @@ -24,7 +24,7 @@ class CustomNavigationMenu extends StatelessWidget { onTap: () => GoRouter.of(context).push('/recipe-select-screen'), ), MenuItem( - icon: ImageConstant.icnVeggies, + icon: 'assets/icons/diets.svg', text: 'Мои диеты', onTap: () => GoRouter.of(context).push('/diet-select-screen'), ), @@ -34,7 +34,7 @@ class CustomNavigationMenu extends StatelessWidget { onTap: () => GoRouter.of(context).push('/plan-select-screen'), ), MenuItem( - icon: ImageConstant.icnPlans, + icon: 'assets/icons/calendar.svg', text: 'Календарь', onTap: () => GoRouter.of(context).push('/calendar-screen'), ), diff --git a/pubspec.yaml b/pubspec.yaml index e5f44648..514eb4a2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,7 +42,7 @@ dependencies: badges: ^3.1.2 google_fonts: ^6.2.1 location: ^6.0.2 - syncfusion_flutter_charts: ^26.2.10 + syncfusion_flutter_charts: ^26.2.11 table_calendar: ^3.1.2 flutter_keyboard_visibility: ^6.0.0 share_plus: ^10.0.0 @@ -65,3 +65,4 @@ flutter: - assets/ - assets/images/ - assets/audio/ + - assets/icons/ From ef3bdafd90b28267ebedcc7389e5b4063386df14 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 28 Aug 2024 10:39:03 +0300 Subject: [PATCH 12/15] fix: chat message input size --- lib/features/chat/presentation/pages/chat_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index 3f809e28..fac8c5eb 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -219,7 +219,7 @@ class _ChatScreenState extends State { ), SizedBox(width: 8), SizedBox( - width: mediaQueryData.size.width - 96, + width: MediaQuery.of(context).size.width - 96, child: TextFormField( controller: textEditingController, maxLines: 5, From b61f9cf717342c7726921ff0341fe98a25d4afa1 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 28 Aug 2024 11:48:46 +0300 Subject: [PATCH 13/15] fix: chat grey rectangle --- lib/features/chat/presentation/widgets/chat_entry_widget.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/features/chat/presentation/widgets/chat_entry_widget.dart b/lib/features/chat/presentation/widgets/chat_entry_widget.dart index 0054e8f2..b496047d 100644 --- a/lib/features/chat/presentation/widgets/chat_entry_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_entry_widget.dart @@ -95,6 +95,7 @@ class _ChatEntryWidgetState extends State { } buildAvatarByUsername(String username) { + username = username.trim(); return Container( width: 48, height: 48, From fda601106aca97841da8c639d9a33e0e8c60518f Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 28 Aug 2024 12:58:31 +0300 Subject: [PATCH 14/15] feat(menu): add menu screen, method for add weight --- lib/app_router.dart | 21 +- .../widgets/bottom_navigation_bar_widget.dart | 17 +- .../menu/presentation/pages/menu_screen.dart | 96 +++++++ .../pages/notifications_screen.dart | 14 + .../profile/models/profile_model.dart | 15 +- .../profile/models/profile_model.freezed.dart | 259 +++++++++++++++++- .../profile/models/profile_model.g.dart | 22 +- .../bloc/profile_cubit/profile_cubit.dart | 14 + .../presentation/pages/profile_screen.dart | 97 +------ .../widgets/circumference_chart_widget.dart | 107 ++++++++ .../repositories/profile_repository.dart | 14 + .../profile/services/profile_service.dart | 5 + .../profile/services/profile_service.g.dart | 38 +++ lib/widgets/custom_navigation_menu.dart | 77 ------ 14 files changed, 589 insertions(+), 207 deletions(-) create mode 100644 lib/features/menu/presentation/pages/menu_screen.dart create mode 100644 lib/features/notifications/presentation/pages/notifications_screen.dart create mode 100644 lib/features/profile/presentation/widgets/circumference_chart_widget.dart delete mode 100644 lib/widgets/custom_navigation_menu.dart diff --git a/lib/app_router.dart b/lib/app_router.dart index 3a662763..f872ddc9 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -13,6 +13,8 @@ import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:eatvio_app/features/feed/models/feed_blog_post_model.dart'; 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/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'; @@ -68,13 +70,11 @@ class AppRouter { await context.read().runInitialization(); return null; }, - // builder: (context, state) => MyProfileScreen(), ), GoRoute( pageBuilder: (context, state) => NoTransitionPage(child: FeedScreen()), path: '/feed-screen', name: 'feedScreen', - // builder: (context, state) => FeedScreen(), ), GoRoute( pageBuilder: (context, state) { @@ -85,18 +85,21 @@ class AppRouter { }, path: '/diary-screen', name: 'diaryScreen', - // builder: (context, state) { - // if (state.extra != null) - // return DiaryScreen(diaryID: state.extra as String); - // else - // return DiaryScreen(diaryID: '0'); - // }, ), GoRoute( pageBuilder: (context, state) => NoTransitionPage(child: ChatSelectScreen()), path: '/chat-select-screen', name: 'chatSelectScreen', - // builder: (context, state) => ChatSelectScreen(), + ), + GoRoute( + pageBuilder: (context, state) => NoTransitionPage(child: NotificationsScreen()), + path: '/notifications-screen', + name: 'notificationsScreen', + ), + GoRoute( + pageBuilder: (context, state) => NoTransitionPage(child: MenuScreen()), + path: '/menu-screen', + name: 'menuScreen', ), ], ), 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 a7e12393..356d3cc7 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 @@ -6,7 +6,6 @@ import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/noti 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/widgets/custom_navigation_menu.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:go_router/go_router.dart'; @@ -46,22 +45,10 @@ class _BottomNavigationBarWidgetState extends State { GoRouter.of(context).replace('/chat-select-screen'); break; case 4: + GoRouter.of(context).replace('/notifications-screen'); break; case 5: - final RenderBox overlay = Overlay.of(context).context.findRenderObject() as RenderBox; - final size = overlay.size; - showMenu( - context: context, - color: Colors.white, - shadowColor: Colors.white, - surfaceTintColor: Colors.white, - items: [ - PopupMenuItem( - child: CustomNavigationMenu(), - ), - ], - position: RelativeRect.fromLTRB(size.width, size.height, 0, 0), - ); + GoRouter.of(context).replace('/menu-screen'); break; } } diff --git a/lib/features/menu/presentation/pages/menu_screen.dart b/lib/features/menu/presentation/pages/menu_screen.dart new file mode 100644 index 00000000..d7074834 --- /dev/null +++ b/lib/features/menu/presentation/pages/menu_screen.dart @@ -0,0 +1,96 @@ +import 'package:dio/dio.dart'; +import 'package:eatvio_app/core/constants/constants.dart'; +import 'package:eatvio_app/core/token_storage.dart'; +import 'package:eatvio_app/core/utils/image_constant.dart'; +import 'package:eatvio_app/locator_service.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:go_router/go_router.dart'; + +class MenuScreen extends StatelessWidget { + const MenuScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Меню'), + ), + body: SingleChildScrollView( + child: Column( + children: [ + _tile( + title: 'Настройки профиля', + leading: ImageConstant.icnProfileSettings, + onTap: () => GoRouter.of(context).push('/my-settings-screen'), + ), + _tile( + leading: ImageConstant.icnRecipes, + title: 'Мои рецепты', + onTap: () => GoRouter.of(context).push('/recipe-select-screen'), + ), + _tile( + leading: 'assets/icons/diets.svg', + title: 'Мои диеты', + onTap: () => GoRouter.of(context).push('/diet-select-screen'), + ), + _tile( + leading: ImageConstant.icnPlans, + title: 'Мои планы', + onTap: () => GoRouter.of(context).push('/plan-select-screen'), + ), + _tile( + leading: 'assets/icons/calendar.svg', + title: 'Календарь', + onTap: () => GoRouter.of(context).push('/calendar-screen'), + ), + _tile( + leading: ImageConstant.icnGlossary, + title: 'Глоссарий', + onTap: () => GoRouter.of(context).push('/glossary-screen'), + ), + _tile( + leading: ImageConstant.icnSupport, + title: 'Поддержка', + onTap: () {}, + ), + _tile( + leading: ImageConstant.icnExit, + title: 'Выход', + onTap: _onTapLogout(context), + ), + ], + ), + ), + ); + } + + _tile({ + required String title, + required String leading, + required Function() onTap, + }) { + return ListTile( + onTap: onTap, + leading: SvgPicture.asset( + leading, + height: 24, + width: 24, + ), + title: Text(title), + ); + } + + _onTapLogout(BuildContext context) { + return () async { + final response = await sl().post( + baseUrl + '/api/profile/logout', + ); + + if (response.statusCode == 204) { + await TokenStorage.removeTokenInStorage(); + GoRouter.of(context).go('/auth-screen'); + } + }; + } +} diff --git a/lib/features/notifications/presentation/pages/notifications_screen.dart b/lib/features/notifications/presentation/pages/notifications_screen.dart new file mode 100644 index 00000000..6d979118 --- /dev/null +++ b/lib/features/notifications/presentation/pages/notifications_screen.dart @@ -0,0 +1,14 @@ +import 'package:flutter/material.dart'; + +class NotificationsScreen extends StatelessWidget { + const NotificationsScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Уведомления'), + ), + ); + } +} diff --git a/lib/features/profile/models/profile_model.dart b/lib/features/profile/models/profile_model.dart index e7dd87f1..742c9c90 100644 --- a/lib/features/profile/models/profile_model.dart +++ b/lib/features/profile/models/profile_model.dart @@ -6,7 +6,7 @@ part 'profile_model.g.dart'; class ProfileModel with _$ProfileModel { const factory ProfileModel({ @JsonKey(name: "user") required User user, - @JsonKey(name: "chartPoints") required List chartPoints, + @JsonKey(name: "chartPoints") required List chartPoints, @JsonKey(name: "userDetails") required UserDetails userDetails, @JsonKey(name: "circumferences") required List circumferences, @JsonKey(name: "finishedPlans") required List finishedPlans, @@ -94,3 +94,16 @@ class UserDetails with _$UserDetails { factory UserDetails.fromJson(Map json) => _$UserDetailsFromJson(json); } + +@freezed +class ChartPoint with _$ChartPoint { + const factory ChartPoint({ + @JsonKey(name: "id") required int id, + @JsonKey(name: "user_id") required int userId, + @JsonKey(name: "weight") required int weight, + @JsonKey(name: "created_at") required DateTime createdAt, + @JsonKey(name: "updated_at") required DateTime updatedAt, + }) = _ChartPoint; + + factory ChartPoint.fromJson(Map json) => _$ChartPointFromJson(json); +} diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart index 29d3b3c4..4fe3b775 100644 --- a/lib/features/profile/models/profile_model.freezed.dart +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -23,7 +23,7 @@ mixin _$ProfileModel { @JsonKey(name: "user") User get user => throw _privateConstructorUsedError; @JsonKey(name: "chartPoints") - List get chartPoints => throw _privateConstructorUsedError; + List get chartPoints => throw _privateConstructorUsedError; @JsonKey(name: "userDetails") UserDetails get userDetails => throw _privateConstructorUsedError; @JsonKey(name: "circumferences") @@ -55,7 +55,7 @@ abstract class $ProfileModelCopyWith<$Res> { @useResult $Res call( {@JsonKey(name: "user") User user, - @JsonKey(name: "chartPoints") List chartPoints, + @JsonKey(name: "chartPoints") List chartPoints, @JsonKey(name: "userDetails") UserDetails userDetails, @JsonKey(name: "circumferences") List circumferences, @JsonKey(name: "finishedPlans") List finishedPlans, @@ -101,7 +101,7 @@ class _$ProfileModelCopyWithImpl<$Res, $Val extends ProfileModel> chartPoints: null == chartPoints ? _value.chartPoints : chartPoints // ignore: cast_nullable_to_non_nullable - as List, + as List, userDetails: null == userDetails ? _value.userDetails : userDetails // ignore: cast_nullable_to_non_nullable @@ -164,7 +164,7 @@ abstract class _$$ProfileModelImplCopyWith<$Res> @useResult $Res call( {@JsonKey(name: "user") User user, - @JsonKey(name: "chartPoints") List chartPoints, + @JsonKey(name: "chartPoints") List chartPoints, @JsonKey(name: "userDetails") UserDetails userDetails, @JsonKey(name: "circumferences") List circumferences, @JsonKey(name: "finishedPlans") List finishedPlans, @@ -210,7 +210,7 @@ class __$$ProfileModelImplCopyWithImpl<$Res> chartPoints: null == chartPoints ? _value._chartPoints : chartPoints // ignore: cast_nullable_to_non_nullable - as List, + as List, userDetails: null == userDetails ? _value.userDetails : userDetails // ignore: cast_nullable_to_non_nullable @@ -252,7 +252,7 @@ class __$$ProfileModelImplCopyWithImpl<$Res> class _$ProfileModelImpl implements _ProfileModel { const _$ProfileModelImpl( {@JsonKey(name: "user") required this.user, - @JsonKey(name: "chartPoints") required final List chartPoints, + @JsonKey(name: "chartPoints") required final List chartPoints, @JsonKey(name: "userDetails") required this.userDetails, @JsonKey(name: "circumferences") required final List circumferences, @@ -280,10 +280,10 @@ class _$ProfileModelImpl implements _ProfileModel { @override @JsonKey(name: "user") final User user; - final List _chartPoints; + final List _chartPoints; @override @JsonKey(name: "chartPoints") - List get chartPoints { + List get chartPoints { if (_chartPoints is EqualUnmodifiableListView) return _chartPoints; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_chartPoints); @@ -417,7 +417,7 @@ class _$ProfileModelImpl implements _ProfileModel { abstract class _ProfileModel implements ProfileModel { const factory _ProfileModel( {@JsonKey(name: "user") required final User user, - @JsonKey(name: "chartPoints") required final List chartPoints, + @JsonKey(name: "chartPoints") required final List chartPoints, @JsonKey(name: "userDetails") required final UserDetails userDetails, @JsonKey(name: "circumferences") required final List circumferences, @@ -440,7 +440,7 @@ abstract class _ProfileModel implements ProfileModel { User get user; @override @JsonKey(name: "chartPoints") - List get chartPoints; + List get chartPoints; @override @JsonKey(name: "userDetails") UserDetails get userDetails; @@ -2109,3 +2109,242 @@ abstract class _UserDetails implements UserDetails { _$$UserDetailsImplCopyWith<_$UserDetailsImpl> get copyWith => throw _privateConstructorUsedError; } + +ChartPoint _$ChartPointFromJson(Map json) { + return _ChartPoint.fromJson(json); +} + +/// @nodoc +mixin _$ChartPoint { + @JsonKey(name: "id") + int get id => throw _privateConstructorUsedError; + @JsonKey(name: "user_id") + int get userId => throw _privateConstructorUsedError; + @JsonKey(name: "weight") + int get weight => throw _privateConstructorUsedError; + @JsonKey(name: "created_at") + DateTime get createdAt => throw _privateConstructorUsedError; + @JsonKey(name: "updated_at") + DateTime get updatedAt => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $ChartPointCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ChartPointCopyWith<$Res> { + factory $ChartPointCopyWith( + ChartPoint value, $Res Function(ChartPoint) then) = + _$ChartPointCopyWithImpl<$Res, ChartPoint>; + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "weight") int weight, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt}); +} + +/// @nodoc +class _$ChartPointCopyWithImpl<$Res, $Val extends ChartPoint> + implements $ChartPointCopyWith<$Res> { + _$ChartPointCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? weight = null, + Object? createdAt = null, + Object? updatedAt = null, + }) { + return _then(_value.copyWith( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + weight: null == weight + ? _value.weight + : weight // ignore: cast_nullable_to_non_nullable + as int, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$ChartPointImplCopyWith<$Res> + implements $ChartPointCopyWith<$Res> { + factory _$$ChartPointImplCopyWith( + _$ChartPointImpl value, $Res Function(_$ChartPointImpl) then) = + __$$ChartPointImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: "id") int id, + @JsonKey(name: "user_id") int userId, + @JsonKey(name: "weight") int weight, + @JsonKey(name: "created_at") DateTime createdAt, + @JsonKey(name: "updated_at") DateTime updatedAt}); +} + +/// @nodoc +class __$$ChartPointImplCopyWithImpl<$Res> + extends _$ChartPointCopyWithImpl<$Res, _$ChartPointImpl> + implements _$$ChartPointImplCopyWith<$Res> { + __$$ChartPointImplCopyWithImpl( + _$ChartPointImpl _value, $Res Function(_$ChartPointImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? id = null, + Object? userId = null, + Object? weight = null, + Object? createdAt = null, + Object? updatedAt = null, + }) { + return _then(_$ChartPointImpl( + id: null == id + ? _value.id + : id // ignore: cast_nullable_to_non_nullable + as int, + userId: null == userId + ? _value.userId + : userId // ignore: cast_nullable_to_non_nullable + as int, + weight: null == weight + ? _value.weight + : weight // ignore: cast_nullable_to_non_nullable + as int, + createdAt: null == createdAt + ? _value.createdAt + : createdAt // ignore: cast_nullable_to_non_nullable + as DateTime, + updatedAt: null == updatedAt + ? _value.updatedAt + : updatedAt // ignore: cast_nullable_to_non_nullable + as DateTime, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$ChartPointImpl implements _ChartPoint { + const _$ChartPointImpl( + {@JsonKey(name: "id") required this.id, + @JsonKey(name: "user_id") required this.userId, + @JsonKey(name: "weight") required this.weight, + @JsonKey(name: "created_at") required this.createdAt, + @JsonKey(name: "updated_at") required this.updatedAt}); + + factory _$ChartPointImpl.fromJson(Map json) => + _$$ChartPointImplFromJson(json); + + @override + @JsonKey(name: "id") + final int id; + @override + @JsonKey(name: "user_id") + final int userId; + @override + @JsonKey(name: "weight") + final int weight; + @override + @JsonKey(name: "created_at") + final DateTime createdAt; + @override + @JsonKey(name: "updated_at") + final DateTime updatedAt; + + @override + String toString() { + return 'ChartPoint(id: $id, userId: $userId, weight: $weight, createdAt: $createdAt, updatedAt: $updatedAt)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ChartPointImpl && + (identical(other.id, id) || other.id == id) && + (identical(other.userId, userId) || other.userId == userId) && + (identical(other.weight, weight) || other.weight == weight) && + (identical(other.createdAt, createdAt) || + other.createdAt == createdAt) && + (identical(other.updatedAt, updatedAt) || + other.updatedAt == updatedAt)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => + Object.hash(runtimeType, id, userId, weight, createdAt, updatedAt); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$ChartPointImplCopyWith<_$ChartPointImpl> get copyWith => + __$$ChartPointImplCopyWithImpl<_$ChartPointImpl>(this, _$identity); + + @override + Map toJson() { + return _$$ChartPointImplToJson( + this, + ); + } +} + +abstract class _ChartPoint implements ChartPoint { + const factory _ChartPoint( + {@JsonKey(name: "id") required final int id, + @JsonKey(name: "user_id") required final int userId, + @JsonKey(name: "weight") required final int weight, + @JsonKey(name: "created_at") required final DateTime createdAt, + @JsonKey(name: "updated_at") required final DateTime updatedAt}) = + _$ChartPointImpl; + + factory _ChartPoint.fromJson(Map json) = + _$ChartPointImpl.fromJson; + + @override + @JsonKey(name: "id") + int get id; + @override + @JsonKey(name: "user_id") + int get userId; + @override + @JsonKey(name: "weight") + int get weight; + @override + @JsonKey(name: "created_at") + DateTime get createdAt; + @override + @JsonKey(name: "updated_at") + DateTime get updatedAt; + @override + @JsonKey(ignore: true) + _$$ChartPointImplCopyWith<_$ChartPointImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/features/profile/models/profile_model.g.dart b/lib/features/profile/models/profile_model.g.dart index 7197b817..5f3293aa 100644 --- a/lib/features/profile/models/profile_model.g.dart +++ b/lib/features/profile/models/profile_model.g.dart @@ -9,7 +9,9 @@ part of 'profile_model.dart'; _$ProfileModelImpl _$$ProfileModelImplFromJson(Map json) => _$ProfileModelImpl( user: User.fromJson(json['user'] as Map), - chartPoints: json['chartPoints'] as List, + chartPoints: (json['chartPoints'] as List) + .map((e) => ChartPoint.fromJson(e as Map)) + .toList(), userDetails: UserDetails.fromJson(json['userDetails'] as Map), circumferences: (json['circumferences'] as List) @@ -161,3 +163,21 @@ Map _$$UserDetailsImplToJson(_$UserDetailsImpl instance) => 'is_bedtime_fillable': instance.isBedtimeFillable, 'activity_coefficient': instance.activityCoefficient, }; + +_$ChartPointImpl _$$ChartPointImplFromJson(Map json) => + _$ChartPointImpl( + id: (json['id'] as num).toInt(), + userId: (json['user_id'] as num).toInt(), + weight: (json['weight'] as num).toInt(), + createdAt: DateTime.parse(json['created_at'] as String), + updatedAt: DateTime.parse(json['updated_at'] as String), + ); + +Map _$$ChartPointImplToJson(_$ChartPointImpl instance) => + { + 'id': instance.id, + 'user_id': instance.userId, + 'weight': instance.weight, + 'created_at': instance.createdAt.toIso8601String(), + 'updated_at': instance.updatedAt.toIso8601String(), + }; diff --git a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart index 34f6385e..0a08e8de 100644 --- a/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart +++ b/lib/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart @@ -44,6 +44,20 @@ class ProfileCubit extends Cubit { ); } catch (e) { emit(ProfileState.error(errorMessage: e.toString())); + print(e); + } + } + + addWeight({ + required int weight, + }) async { + try { + await profileRepository.addWeight( + weight: weight, + ); + } catch (e) { + emit(ProfileState.error(errorMessage: e.toString())); + print(e); } } } diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index 5bd5154a..a6a78342 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -3,10 +3,9 @@ import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_state.dart'; +import 'package:eatvio_app/features/profile/presentation/widgets/circumference_chart_widget.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; -import 'package:syncfusion_flutter_charts/charts.dart'; class ProfileScreen extends StatefulWidget { final Author? author; @@ -35,8 +34,7 @@ class _ProfileScreenState extends State { chartData = state.profile.circumferences; return Scaffold( appBar: AppBar( - centerTitle: false, - title: Text(state.profile.user.name), + toolbarHeight: 0, ), body: SingleChildScrollView( child: Column( @@ -49,36 +47,7 @@ class _ProfileScreenState extends State { backgroundImage: NetworkImage(state.profile.user.profilePhotoUrl), ), ), - SfCartesianChart( - margin: EdgeInsets.zero, - enableAxisAnimation: true, - enableSideBySideSeriesPlacement: true, - legend: const Legend( - isVisible: true, - opacity: 0.7, - position: LegendPosition.bottom, - ), - plotAreaBorderWidth: 0, - trackballBehavior: TrackballBehavior( - enable: true, - activationMode: ActivationMode.singleTap, - ), - primaryXAxis: DateTimeAxis( - dateFormat: DateFormat.MMMd('ru'), - axisLine: AxisLine( - width: 1, - ), - ), - primaryYAxis: NumericAxis( - labelFormat: '{value} см', - axisLine: AxisLine( - width: 1, - ), - majorTickLines: MajorTickLines(size: 0), - ), - series: _getSplineAreaSeries(), - tooltipBehavior: TooltipBehavior(enable: true), - ), + CircumferenceChartWidget(chartData: chartData), ], ), ), @@ -105,64 +74,4 @@ class _ProfileScreenState extends State { ), ); } - - List> _getSplineAreaSeries() { - final Color seriesColor1 = Colors.red; - final Color seriesColor2 = Colors.blue; - final Color seriesColor3 = Colors.green; - - return >[ - SplineSeries( - markerSettings: MarkerSettings( - isVisible: true, - color: seriesColor1, - height: 12, - width: 12, - ), - dataLabelSettings: DataLabelSettings( - labelAlignment: ChartDataLabelAlignment.top, - isVisible: true, - ), - dataSource: chartData, - color: seriesColor1, - name: 'Грудь', - xValueMapper: (Circumference value, int index) => value.createdAt, - yValueMapper: (Circumference value, int index) => value.chestCircumference, - ), - SplineSeries( - markerSettings: MarkerSettings( - isVisible: true, - color: seriesColor2, - height: 12, - width: 12, - ), - dataLabelSettings: DataLabelSettings( - labelAlignment: ChartDataLabelAlignment.top, - isVisible: true, - ), - dataSource: chartData, - color: seriesColor2, - name: 'Талия', - xValueMapper: (Circumference value, int index) => value.createdAt, - yValueMapper: (Circumference value, int index) => value.waistCircumference, - ), - SplineSeries( - markerSettings: MarkerSettings( - isVisible: true, - color: seriesColor3, - height: 12, - width: 12, - ), - dataLabelSettings: DataLabelSettings( - labelAlignment: ChartDataLabelAlignment.top, - isVisible: true, - ), - dataSource: chartData, - color: seriesColor3, - name: 'Бёдра', - xValueMapper: (Circumference value, int index) => value.createdAt, - yValueMapper: (Circumference value, int index) => value.hipCircumference, - ), - ]; - } } diff --git a/lib/features/profile/presentation/widgets/circumference_chart_widget.dart b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart new file mode 100644 index 00000000..a4a6af7a --- /dev/null +++ b/lib/features/profile/presentation/widgets/circumference_chart_widget.dart @@ -0,0 +1,107 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart'; +import 'package:flutter/material.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; +import 'package:intl/intl.dart'; + +class CircumferenceChartWidget extends StatelessWidget { + final List chartData; + + const CircumferenceChartWidget({ + super.key, + required this.chartData, + }); + + @override + Widget build(BuildContext context) { + return SfCartesianChart( + margin: EdgeInsets.zero, + enableAxisAnimation: true, + enableSideBySideSeriesPlacement: true, + legend: const Legend( + isVisible: true, + opacity: 0.7, + position: LegendPosition.bottom, + ), + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + ), + primaryXAxis: DateTimeAxis( + dateFormat: DateFormat.MMMd('ru'), + axisLine: AxisLine( + width: 1, + ), + ), + primaryYAxis: NumericAxis( + labelFormat: '{value} см', + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), + ); + } + + List> _getSplineSeries() { + final Color seriesColor1 = Colors.red; + final Color seriesColor2 = Colors.blue; + final Color seriesColor3 = Colors.green; + + return >[ + SplineSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: seriesColor1, + height: 12, + width: 12, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: chartData, + color: seriesColor1, + name: 'Грудь', + xValueMapper: (Circumference value, int index) => value.createdAt, + yValueMapper: (Circumference value, int index) => value.chestCircumference, + ), + SplineSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: seriesColor2, + height: 12, + width: 12, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: chartData, + color: seriesColor2, + name: 'Талия', + xValueMapper: (Circumference value, int index) => value.createdAt, + yValueMapper: (Circumference value, int index) => value.waistCircumference, + ), + SplineSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: seriesColor3, + height: 12, + width: 12, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: chartData, + color: seriesColor3, + name: 'Бёдра', + xValueMapper: (Circumference value, int index) => value.createdAt, + yValueMapper: (Circumference value, int index) => value.hipCircumference, + ), + ]; + } +} diff --git a/lib/features/profile/repositories/profile_repository.dart b/lib/features/profile/repositories/profile_repository.dart index a57be856..e859c8d6 100644 --- a/lib/features/profile/repositories/profile_repository.dart +++ b/lib/features/profile/repositories/profile_repository.dart @@ -39,4 +39,18 @@ class ProfileRepository { rethrow; } } + + Future addWeight({ + required int weight, + }) async { + try { + return (await profileService.addWeight( + weight: weight, + )) + .values + .first; + } catch (e) { + rethrow; + } + } } diff --git a/lib/features/profile/services/profile_service.dart b/lib/features/profile/services/profile_service.dart index dc9f2864..9966a82d 100644 --- a/lib/features/profile/services/profile_service.dart +++ b/lib/features/profile/services/profile_service.dart @@ -22,4 +22,9 @@ abstract class ProfileService { @Part(name: 'waist_circumference') required int waistCircumference, @Part(name: 'hip_circumference') required int hipCircumference, }); + + @POST('/api/profile/addWeight') + Future> addWeight({ + @Part() required int weight, + }); } diff --git a/lib/features/profile/services/profile_service.g.dart b/lib/features/profile/services/profile_service.g.dart index 7b2969ad..96b65b4d 100644 --- a/lib/features/profile/services/profile_service.g.dart +++ b/lib/features/profile/services/profile_service.g.dart @@ -137,6 +137,44 @@ class _ProfileService implements ProfileService { return _value; } + @override + Future> addWeight({required int weight}) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = FormData(); + _data.fields.add(MapEntry( + 'weight', + weight.toString(), + )); + final _options = _setStreamType>(Options( + method: 'POST', + headers: _headers, + extra: _extra, + ) + .compose( + _dio.options, + '/api/profile/addWeight', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late Map _value; + try { + _value = _result.data!.map((k, dynamic v) => + MapEntry(k, ChartPoint.fromJson(v as Map))); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + RequestOptions _setStreamType(RequestOptions requestOptions) { if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || diff --git a/lib/widgets/custom_navigation_menu.dart b/lib/widgets/custom_navigation_menu.dart deleted file mode 100644 index c3222e62..00000000 --- a/lib/widgets/custom_navigation_menu.dart +++ /dev/null @@ -1,77 +0,0 @@ -import 'package:eatvio_app/core/app_export.dart'; -import 'package:eatvio_app/core/token_storage.dart'; -import 'package:eatvio_app/widgets/custom_navigation_menu_item.dart'; -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; -import 'package:http/http.dart' as http; - -class CustomNavigationMenu extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Container( - color: Colors.white, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - MenuItem( - icon: ImageConstant.icnProfileSettings, - text: 'Настройки профиля', - onTap: () => GoRouter.of(context).push('/my-settings-screen'), - ), - MenuItem( - icon: ImageConstant.icnRecipes, - text: 'Мои рецепты', - onTap: () => GoRouter.of(context).push('/recipe-select-screen'), - ), - MenuItem( - icon: 'assets/icons/diets.svg', - text: 'Мои диеты', - onTap: () => GoRouter.of(context).push('/diet-select-screen'), - ), - MenuItem( - icon: ImageConstant.icnPlans, - text: 'Мои планы', - onTap: () => GoRouter.of(context).push('/plan-select-screen'), - ), - MenuItem( - icon: 'assets/icons/calendar.svg', - text: 'Календарь', - onTap: () => GoRouter.of(context).push('/calendar-screen'), - ), - MenuItem( - icon: ImageConstant.icnGlossary, - text: 'Глоссарий', - onTap: () => GoRouter.of(context).push('/glossary-screen'), - ), - MenuItem( - icon: ImageConstant.icnSupport, - text: 'Поддержка', - onTap: () {}, - ), - MenuItem( - icon: ImageConstant.icnExit, - text: 'Выход', - onTap: _onTapLogout(context), - ), - ], - ), - ); - } -} - -_onTapLogout(BuildContext context) { - return () async { - final token = await TokenStorage.getTokenFromStorage(); - final response = await http.post( - Uri.parse(baseUrl + '/api/profile/logout'), - headers: { - 'Authorization': 'Bearer $token', - }, - ); - - if (response.statusCode == 204) { - await TokenStorage.removeTokenInStorage(); - GoRouter.of(context).go('/auth-screen'); - } - }; -} From f994589baa0f3e984a84510ce2a97559e107790b Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 28 Aug 2024 15:55:08 +0300 Subject: [PATCH 15/15] feat(profile): add weight and imt charts, menu add dividers --- .../initialization_cubit.dart | 2 +- .../notifications_cubit.dart | 11 ++- .../notifications_state.dart | 1 + .../notifications_state.freezed.dart | 87 ++++++++++++++----- .../menu/presentation/pages/menu_screen.dart | 23 +++++ .../pages/notifications_screen.dart | 21 ++++- .../profile/models/profile_model.dart | 1 + .../profile/models/profile_model.freezed.dart | 27 +++++- .../profile/models/profile_model.g.dart | 2 + .../presentation/pages/profile_screen.dart | 6 ++ .../widgets/imt_chart_widget.dart | 69 +++++++++++++++ .../widgets/weight_chart_widget.dart | 69 +++++++++++++++ 12 files changed, 287 insertions(+), 32 deletions(-) create mode 100644 lib/features/profile/presentation/widgets/imt_chart_widget.dart create mode 100644 lib/features/profile/presentation/widgets/weight_chart_widget.dart diff --git a/lib/core/initialization_cubit/initialization_cubit.dart b/lib/core/initialization_cubit/initialization_cubit.dart index 29a42f69..518abeba 100644 --- a/lib/core/initialization_cubit/initialization_cubit.dart +++ b/lib/core/initialization_cubit/initialization_cubit.dart @@ -27,7 +27,7 @@ class InitializationCubit extends Cubit { privateNotificationChannel.subscribe(); privateNotificationChannel.bindToAll().listen((event) { - sl().incrementCounter(); + sl().incrementCounter(event.name); }); } 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 ba5634cc..8a22b6d5 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 @@ -3,11 +3,18 @@ import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/noti class NotificationsCubit extends Cubit { int _notificationsCount = 0; + List notifications = []; NotificationsCubit() : super(const NotificationsState.empty()); - incrementCounter() { + incrementCounter(String data) { _notificationsCount++; - emit(NotificationsState.loaded(notificationsCount: _notificationsCount)); + notifications.add(data); + emit( + NotificationsState.loaded( + notifications: notifications, + notificationsCount: _notificationsCount, + ), + ); } } diff --git a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.dart b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.dart index 0f20a051..d44c7b2b 100644 --- a/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.dart +++ b/lib/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.dart @@ -9,6 +9,7 @@ abstract class NotificationsState with _$NotificationsState { const factory NotificationsState.empty() = NotificationsStateEmpty; const factory NotificationsState.loaded({ + required List notifications, required int notificationsCount, }) = NotificationsStateLoaded; 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 0deeebbd..4ba18f06 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 @@ -20,7 +20,9 @@ mixin _$NotificationsState { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) => throw _privateConstructorUsedError; @@ -28,7 +30,8 @@ mixin _$NotificationsState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) => throw _privateConstructorUsedError; @@ -36,7 +39,8 @@ mixin _$NotificationsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) => @@ -126,7 +130,9 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return $default(); @@ -137,7 +143,8 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return $default?.call(); @@ -148,7 +155,8 @@ class _$NotificationsStateImpl implements _NotificationsState { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -244,7 +252,9 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return empty(); @@ -255,7 +265,8 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return empty?.call(); @@ -266,7 +277,8 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { @@ -325,7 +337,7 @@ abstract class _$$NotificationsStateLoadedImplCopyWith<$Res> { $Res Function(_$NotificationsStateLoadedImpl) then) = __$$NotificationsStateLoadedImplCopyWithImpl<$Res>; @useResult - $Res call({int notificationsCount}); + $Res call({List notifications, int notificationsCount}); } /// @nodoc @@ -341,9 +353,14 @@ class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ + Object? notifications = null, Object? notificationsCount = null, }) { return _then(_$NotificationsStateLoadedImpl( + notifications: null == notifications + ? _value._notifications + : notifications // ignore: cast_nullable_to_non_nullable + as List, notificationsCount: null == notificationsCount ? _value.notificationsCount : notificationsCount // ignore: cast_nullable_to_non_nullable @@ -355,14 +372,25 @@ class __$$NotificationsStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { - const _$NotificationsStateLoadedImpl({required this.notificationsCount}); + const _$NotificationsStateLoadedImpl( + {required final List notifications, + required this.notificationsCount}) + : _notifications = notifications; + + final List _notifications; + @override + List get notifications { + if (_notifications is EqualUnmodifiableListView) return _notifications; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_notifications); + } @override final int notificationsCount; @override String toString() { - return 'NotificationsState.loaded(notificationsCount: $notificationsCount)'; + return 'NotificationsState.loaded(notifications: $notifications, notificationsCount: $notificationsCount)'; } @override @@ -370,12 +398,15 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$NotificationsStateLoadedImpl && + const DeepCollectionEquality() + .equals(other._notifications, _notifications) && (identical(other.notificationsCount, notificationsCount) || other.notificationsCount == notificationsCount)); } @override - int get hashCode => Object.hash(runtimeType, notificationsCount); + int get hashCode => Object.hash(runtimeType, + const DeepCollectionEquality().hash(_notifications), notificationsCount); @JsonKey(ignore: true) @override @@ -389,10 +420,12 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { - return loaded(notificationsCount); + return loaded(notifications, notificationsCount); } @override @@ -400,10 +433,11 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { - return loaded?.call(notificationsCount); + return loaded?.call(notifications, notificationsCount); } @override @@ -411,12 +445,13 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { if (loaded != null) { - return loaded(notificationsCount); + return loaded(notifications, notificationsCount); } return orElse(); } @@ -461,8 +496,10 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded { abstract class NotificationsStateLoaded implements NotificationsState { const factory NotificationsStateLoaded( - {required final int notificationsCount}) = _$NotificationsStateLoadedImpl; + {required final List notifications, + required final int notificationsCount}) = _$NotificationsStateLoadedImpl; + List get notifications; int get notificationsCount; @JsonKey(ignore: true) _$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl> @@ -540,7 +577,9 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult when( TResult Function() $default, { required TResult Function() empty, - required TResult Function(int notificationsCount) loaded, + required TResult Function( + List notifications, int notificationsCount) + loaded, required TResult Function(String errorMessage) error, }) { return error(errorMessage); @@ -551,7 +590,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult? whenOrNull( TResult? Function()? $default, { TResult? Function()? empty, - TResult? Function(int notificationsCount)? loaded, + TResult? Function(List notifications, int notificationsCount)? + loaded, TResult? Function(String errorMessage)? error, }) { return error?.call(errorMessage); @@ -562,7 +602,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError { TResult maybeWhen( TResult Function()? $default, { TResult Function()? empty, - TResult Function(int notificationsCount)? loaded, + TResult Function(List notifications, int notificationsCount)? + loaded, TResult Function(String errorMessage)? error, required TResult orElse(), }) { diff --git a/lib/features/menu/presentation/pages/menu_screen.dart b/lib/features/menu/presentation/pages/menu_screen.dart index d7074834..010bf6d3 100644 --- a/lib/features/menu/presentation/pages/menu_screen.dart +++ b/lib/features/menu/presentation/pages/menu_screen.dart @@ -24,36 +24,43 @@ class MenuScreen extends StatelessWidget { leading: ImageConstant.icnProfileSettings, onTap: () => GoRouter.of(context).push('/my-settings-screen'), ), + _divider(context), _tile( leading: ImageConstant.icnRecipes, title: 'Мои рецепты', onTap: () => GoRouter.of(context).push('/recipe-select-screen'), ), + _divider(context), _tile( leading: 'assets/icons/diets.svg', title: 'Мои диеты', onTap: () => GoRouter.of(context).push('/diet-select-screen'), ), + _divider(context), _tile( leading: ImageConstant.icnPlans, title: 'Мои планы', onTap: () => GoRouter.of(context).push('/plan-select-screen'), ), + _divider(context), _tile( leading: 'assets/icons/calendar.svg', title: 'Календарь', onTap: () => GoRouter.of(context).push('/calendar-screen'), ), + _divider(context), _tile( leading: ImageConstant.icnGlossary, title: 'Глоссарий', onTap: () => GoRouter.of(context).push('/glossary-screen'), ), + _divider(context), _tile( leading: ImageConstant.icnSupport, title: 'Поддержка', onTap: () {}, ), + _divider(context), _tile( leading: ImageConstant.icnExit, title: 'Выход', @@ -78,6 +85,22 @@ class MenuScreen extends StatelessWidget { width: 24, ), title: Text(title), + trailing: Icon( + Icons.arrow_forward_ios_rounded, + size: 12, + color: Colors.black38, + ), + ); + } + + _divider(BuildContext context) { + return Container( + height: 0.4, + width: MediaQuery.of(context).size.width - 32, + decoration: BoxDecoration( + color: Colors.black26, + borderRadius: BorderRadius.circular(16), + ), ); } diff --git a/lib/features/notifications/presentation/pages/notifications_screen.dart b/lib/features/notifications/presentation/pages/notifications_screen.dart index 6d979118..10947cbf 100644 --- a/lib/features/notifications/presentation/pages/notifications_screen.dart +++ b/lib/features/notifications/presentation/pages/notifications_screen.dart @@ -1,3 +1,6 @@ +import 'package:eatvio_app/core/app_export.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:flutter/material.dart'; class NotificationsScreen extends StatelessWidget { @@ -5,10 +8,20 @@ class NotificationsScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Уведомления'), - ), + return BlocBuilder( + builder: (BuildContext context, NotificationsState state) { + return Scaffold( + appBar: AppBar( + title: Text('Уведомления'), + ), + body: SingleChildScrollView( + padding: EdgeInsets.all(16), + child: Text( + state is NotificationsStateLoaded ? state.notifications.toString() : 'Уведомлений нет', + ), + ), + ); + }, ); } } diff --git a/lib/features/profile/models/profile_model.dart b/lib/features/profile/models/profile_model.dart index 742c9c90..6c72a1fa 100644 --- a/lib/features/profile/models/profile_model.dart +++ b/lib/features/profile/models/profile_model.dart @@ -101,6 +101,7 @@ class ChartPoint with _$ChartPoint { @JsonKey(name: "id") required int id, @JsonKey(name: "user_id") required int userId, @JsonKey(name: "weight") required int weight, + @JsonKey(name: "bmi") required String bmi, @JsonKey(name: "created_at") required DateTime createdAt, @JsonKey(name: "updated_at") required DateTime updatedAt, }) = _ChartPoint; diff --git a/lib/features/profile/models/profile_model.freezed.dart b/lib/features/profile/models/profile_model.freezed.dart index 4fe3b775..0e5607b4 100644 --- a/lib/features/profile/models/profile_model.freezed.dart +++ b/lib/features/profile/models/profile_model.freezed.dart @@ -2122,6 +2122,8 @@ mixin _$ChartPoint { int get userId => throw _privateConstructorUsedError; @JsonKey(name: "weight") int get weight => throw _privateConstructorUsedError; + @JsonKey(name: "bmi") + String get bmi => throw _privateConstructorUsedError; @JsonKey(name: "created_at") DateTime get createdAt => throw _privateConstructorUsedError; @JsonKey(name: "updated_at") @@ -2143,6 +2145,7 @@ abstract class $ChartPointCopyWith<$Res> { {@JsonKey(name: "id") int id, @JsonKey(name: "user_id") int userId, @JsonKey(name: "weight") int weight, + @JsonKey(name: "bmi") String bmi, @JsonKey(name: "created_at") DateTime createdAt, @JsonKey(name: "updated_at") DateTime updatedAt}); } @@ -2163,6 +2166,7 @@ class _$ChartPointCopyWithImpl<$Res, $Val extends ChartPoint> Object? id = null, Object? userId = null, Object? weight = null, + Object? bmi = null, Object? createdAt = null, Object? updatedAt = null, }) { @@ -2179,6 +2183,10 @@ class _$ChartPointCopyWithImpl<$Res, $Val extends ChartPoint> ? _value.weight : weight // ignore: cast_nullable_to_non_nullable as int, + bmi: null == bmi + ? _value.bmi + : bmi // ignore: cast_nullable_to_non_nullable + as String, createdAt: null == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable @@ -2203,6 +2211,7 @@ abstract class _$$ChartPointImplCopyWith<$Res> {@JsonKey(name: "id") int id, @JsonKey(name: "user_id") int userId, @JsonKey(name: "weight") int weight, + @JsonKey(name: "bmi") String bmi, @JsonKey(name: "created_at") DateTime createdAt, @JsonKey(name: "updated_at") DateTime updatedAt}); } @@ -2221,6 +2230,7 @@ class __$$ChartPointImplCopyWithImpl<$Res> Object? id = null, Object? userId = null, Object? weight = null, + Object? bmi = null, Object? createdAt = null, Object? updatedAt = null, }) { @@ -2237,6 +2247,10 @@ class __$$ChartPointImplCopyWithImpl<$Res> ? _value.weight : weight // ignore: cast_nullable_to_non_nullable as int, + bmi: null == bmi + ? _value.bmi + : bmi // ignore: cast_nullable_to_non_nullable + as String, createdAt: null == createdAt ? _value.createdAt : createdAt // ignore: cast_nullable_to_non_nullable @@ -2256,6 +2270,7 @@ class _$ChartPointImpl implements _ChartPoint { {@JsonKey(name: "id") required this.id, @JsonKey(name: "user_id") required this.userId, @JsonKey(name: "weight") required this.weight, + @JsonKey(name: "bmi") required this.bmi, @JsonKey(name: "created_at") required this.createdAt, @JsonKey(name: "updated_at") required this.updatedAt}); @@ -2272,6 +2287,9 @@ class _$ChartPointImpl implements _ChartPoint { @JsonKey(name: "weight") final int weight; @override + @JsonKey(name: "bmi") + final String bmi; + @override @JsonKey(name: "created_at") final DateTime createdAt; @override @@ -2280,7 +2298,7 @@ class _$ChartPointImpl implements _ChartPoint { @override String toString() { - return 'ChartPoint(id: $id, userId: $userId, weight: $weight, createdAt: $createdAt, updatedAt: $updatedAt)'; + return 'ChartPoint(id: $id, userId: $userId, weight: $weight, bmi: $bmi, createdAt: $createdAt, updatedAt: $updatedAt)'; } @override @@ -2291,6 +2309,7 @@ class _$ChartPointImpl implements _ChartPoint { (identical(other.id, id) || other.id == id) && (identical(other.userId, userId) || other.userId == userId) && (identical(other.weight, weight) || other.weight == weight) && + (identical(other.bmi, bmi) || other.bmi == bmi) && (identical(other.createdAt, createdAt) || other.createdAt == createdAt) && (identical(other.updatedAt, updatedAt) || @@ -2300,7 +2319,7 @@ class _$ChartPointImpl implements _ChartPoint { @JsonKey(ignore: true) @override int get hashCode => - Object.hash(runtimeType, id, userId, weight, createdAt, updatedAt); + Object.hash(runtimeType, id, userId, weight, bmi, createdAt, updatedAt); @JsonKey(ignore: true) @override @@ -2321,6 +2340,7 @@ abstract class _ChartPoint implements ChartPoint { {@JsonKey(name: "id") required final int id, @JsonKey(name: "user_id") required final int userId, @JsonKey(name: "weight") required final int weight, + @JsonKey(name: "bmi") required final String bmi, @JsonKey(name: "created_at") required final DateTime createdAt, @JsonKey(name: "updated_at") required final DateTime updatedAt}) = _$ChartPointImpl; @@ -2338,6 +2358,9 @@ abstract class _ChartPoint implements ChartPoint { @JsonKey(name: "weight") int get weight; @override + @JsonKey(name: "bmi") + String get bmi; + @override @JsonKey(name: "created_at") DateTime get createdAt; @override diff --git a/lib/features/profile/models/profile_model.g.dart b/lib/features/profile/models/profile_model.g.dart index 5f3293aa..af1c1c4d 100644 --- a/lib/features/profile/models/profile_model.g.dart +++ b/lib/features/profile/models/profile_model.g.dart @@ -169,6 +169,7 @@ _$ChartPointImpl _$$ChartPointImplFromJson(Map json) => id: (json['id'] as num).toInt(), userId: (json['user_id'] as num).toInt(), weight: (json['weight'] as num).toInt(), + bmi: json['bmi'] as String, createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), ); @@ -178,6 +179,7 @@ Map _$$ChartPointImplToJson(_$ChartPointImpl instance) => 'id': instance.id, 'user_id': instance.userId, 'weight': instance.weight, + 'bmi': instance.bmi, 'created_at': instance.createdAt.toIso8601String(), 'updated_at': instance.updatedAt.toIso8601String(), }; diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index a6a78342..e9e37c56 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -4,6 +4,8 @@ import 'package:eatvio_app/features/profile/models/profile_model.dart'; import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_cubit.dart'; import 'package:eatvio_app/features/profile/presentation/bloc/profile_cubit/profile_state.dart'; import 'package:eatvio_app/features/profile/presentation/widgets/circumference_chart_widget.dart'; +import 'package:eatvio_app/features/profile/presentation/widgets/imt_chart_widget.dart'; +import 'package:eatvio_app/features/profile/presentation/widgets/weight_chart_widget.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:flutter/material.dart'; @@ -18,6 +20,7 @@ class ProfileScreen extends StatefulWidget { class _ProfileScreenState extends State { List chartData = []; + List chartPoints = []; @override Widget build(BuildContext context) { @@ -32,6 +35,7 @@ class _ProfileScreenState extends State { builder: (BuildContext context, ProfileState state) { if (state is ProfileStateLoaded) { chartData = state.profile.circumferences; + chartPoints = state.profile.chartPoints; return Scaffold( appBar: AppBar( toolbarHeight: 0, @@ -48,6 +52,8 @@ class _ProfileScreenState extends State { ), ), CircumferenceChartWidget(chartData: chartData), + WeightChartWidget(chartPoints: chartPoints), + ImtChartWidget(chartPoints: chartPoints), ], ), ), diff --git a/lib/features/profile/presentation/widgets/imt_chart_widget.dart b/lib/features/profile/presentation/widgets/imt_chart_widget.dart new file mode 100644 index 00000000..275a5810 --- /dev/null +++ b/lib/features/profile/presentation/widgets/imt_chart_widget.dart @@ -0,0 +1,69 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart' as ProfileModel; +import 'package:flutter/material.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; +import 'package:intl/intl.dart'; + +class ImtChartWidget extends StatelessWidget { + final List chartPoints; + + const ImtChartWidget({ + super.key, + required this.chartPoints, + }); + + @override + Widget build(BuildContext context) { + return SfCartesianChart( + margin: EdgeInsets.zero, + enableAxisAnimation: true, + enableSideBySideSeriesPlacement: true, + legend: const Legend( + isVisible: true, + opacity: 0.7, + position: LegendPosition.bottom, + ), + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + ), + primaryXAxis: DateTimeAxis( + dateFormat: DateFormat.MMMd('ru'), + axisLine: AxisLine( + width: 1, + ), + ), + primaryYAxis: NumericAxis( + labelFormat: '{value} кг', + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), + ); + } + + List> _getSplineSeries() { + return >[ + SplineSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: Colors.blue, + height: 12, + width: 12, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: chartPoints, + color: Colors.blue, + name: 'ИМТ', + xValueMapper: (ProfileModel.ChartPoint value, int index) => value.createdAt, + yValueMapper: (ProfileModel.ChartPoint value, int index) => double.parse(value.bmi), + ), + ]; + } +} diff --git a/lib/features/profile/presentation/widgets/weight_chart_widget.dart b/lib/features/profile/presentation/widgets/weight_chart_widget.dart new file mode 100644 index 00000000..eabad3ec --- /dev/null +++ b/lib/features/profile/presentation/widgets/weight_chart_widget.dart @@ -0,0 +1,69 @@ +import 'package:eatvio_app/features/profile/models/profile_model.dart' as ProfileModel; +import 'package:flutter/material.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; +import 'package:intl/intl.dart'; + +class WeightChartWidget extends StatelessWidget { + final List chartPoints; + + const WeightChartWidget({ + super.key, + required this.chartPoints, + }); + + @override + Widget build(BuildContext context) { + return SfCartesianChart( + margin: EdgeInsets.zero, + enableAxisAnimation: true, + enableSideBySideSeriesPlacement: true, + legend: const Legend( + isVisible: true, + opacity: 0.7, + position: LegendPosition.bottom, + ), + plotAreaBorderWidth: 0, + trackballBehavior: TrackballBehavior( + enable: true, + activationMode: ActivationMode.singleTap, + ), + primaryXAxis: DateTimeAxis( + dateFormat: DateFormat.MMMd('ru'), + axisLine: AxisLine( + width: 1, + ), + ), + primaryYAxis: NumericAxis( + labelFormat: '{value} кг', + axisLine: AxisLine( + width: 1, + ), + majorTickLines: MajorTickLines(size: 0), + ), + series: _getSplineSeries(), + tooltipBehavior: TooltipBehavior(enable: true), + ); + } + + List> _getSplineSeries() { + return >[ + SplineSeries( + markerSettings: MarkerSettings( + isVisible: true, + color: Colors.blue, + height: 12, + width: 12, + ), + dataLabelSettings: DataLabelSettings( + labelAlignment: ChartDataLabelAlignment.top, + isVisible: true, + ), + dataSource: chartPoints, + color: Colors.blue, + name: 'Вес', + xValueMapper: (ProfileModel.ChartPoint value, int index) => value.createdAt, + yValueMapper: (ProfileModel.ChartPoint value, int index) => value.weight, + ), + ]; + } +}