From 50fe1de6ea9e542a66dab25f15cd8f4dc2dae9fe Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 1 Nov 2024 08:28:56 +0000 Subject: [PATCH 01/18] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20.gitea/workflows/test.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 196d2aa1..0b639038 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -24,7 +24,8 @@ jobs: - name: Install Android SDK run: | apt-get update - https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip -O commandlinetools.zip + apt-get install -y openjdk-11-jdk wget + wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip -O commandlinetools.zip unzip commandlinetools.zip mkdir -p $HOME/Android/Sdk/cmdline-tools/latest mv cmdline-tools/* $HOME/Android/Sdk/cmdline-tools/latest/ From 39b43e88ec67ac3ac65f4691b72e6dadfe178c30 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 1 Nov 2024 12:14:30 +0300 Subject: [PATCH 02/18] feat(diary): fix gallery delete image --- .../diary/presentation/pages/diary_screen.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index bb9e530a..21ec0314 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -272,18 +272,18 @@ class _DiaryScreenState extends State { style: IconButton.styleFrom( backgroundColor: Colors.white, ), - onPressed: () { - setState(() { - if (currentSelectedPhotoIndex == photos.length - 1 && currentSelectedPhotoIndex != 0) { - currentSelectedPhotoIndex = photos.length - 2; - } - }); - diaryCubit.deletePhoto( + onPressed: () async { + await diaryCubit.deletePhoto( photo: photos[currentSelectedPhotoIndex], diaryId: diaryDay.id, mealId: diaryDay.meals[currentSelectedMealNumber - 1].id, date: _selectedDay.toString(), ); + setState(() { + if (currentSelectedPhotoIndex == photos.length - 1 && currentSelectedPhotoIndex != 0) { + currentSelectedPhotoIndex = photos.length - 2; + } + }); }, icon: Icon( Icons.close_rounded, From c1d45d40bc02e10de30ac42247cc17e4fe0a8c9f Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 8 Nov 2024 12:33:52 +0300 Subject: [PATCH 03/18] feat(diary): add satiety rating bar, calorie graph --- assets/icons/satiety_emoji_left.svg | 7 + assets/icons/satiety_emoji_right.svg | 11 + .../presentation/pages/diary_screen.dart | 269 ++++++++++++++++++ lib/main.dart | 2 +- pubspec.yaml | 1 + 5 files changed, 289 insertions(+), 1 deletion(-) create mode 100644 assets/icons/satiety_emoji_left.svg create mode 100644 assets/icons/satiety_emoji_right.svg diff --git a/assets/icons/satiety_emoji_left.svg b/assets/icons/satiety_emoji_left.svg new file mode 100644 index 00000000..e2a21bda --- /dev/null +++ b/assets/icons/satiety_emoji_left.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/icons/satiety_emoji_right.svg b/assets/icons/satiety_emoji_right.svg new file mode 100644 index 00000000..6791ee88 --- /dev/null +++ b/assets/icons/satiety_emoji_right.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 21ec0314..0c181902 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -11,10 +11,12 @@ import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:image_picker/image_picker.dart'; import 'package:rive/rive.dart'; +import 'package:syncfusion_flutter_charts/charts.dart'; import 'package:table_calendar/table_calendar.dart'; class DiaryScreen extends StatefulWidget { @@ -34,6 +36,7 @@ class _DiaryScreenState extends State { final productNameController = TextEditingController(); final quantityController = TextEditingController(); int currentSelectedPhotoIndex = 0; + double currentSelectedSatietyRating = 3; @override Widget build(BuildContext context) { @@ -60,6 +63,7 @@ class _DiaryScreenState extends State { _calendar(state), if (state is DiaryStateLoading) _loader(), if (state is DiaryStateLoaded) _meals(state.diary), + if (state is DiaryStateLoaded) _chart(), const SizedBox(height: 32), ], ), @@ -70,6 +74,166 @@ class _DiaryScreenState extends State { ); } + _satietyRating() { + return Padding( + padding: const EdgeInsets.only(top: 12), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + 'Ваша сытость после приёма пищи', + style: TextStyle( + fontSize: 16, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SvgPicture.asset( + 'assets/icons/satiety_emoji_left.svg', + height: 32, + width: 32, + ), + RatingBar.builder( + initialRating: 3, + itemCount: 6, + itemSize: MediaQuery.of(context).size.width / 6 - (124 / 6), + itemBuilder: (context, index) { + switch (index) { + case 0: + return Container( + width: MediaQuery.of(context).size.width / 6, + height: 16, + margin: currentSelectedSatietyRating == 1 ? EdgeInsets.symmetric(horizontal: 2) : null, + decoration: BoxDecoration( + color: Color(0xFFC82222), + border: currentSelectedSatietyRating == 1 + ? Border.all( + width: 2, + color: Color(0xFFAA3333), + strokeAlign: BorderSide.strokeAlignOutside, + ) + : null, + borderRadius: currentSelectedSatietyRating == 1 + ? BorderRadius.horizontal( + left: Radius.circular(8), + right: Radius.circular(2), + ) + : BorderRadius.horizontal( + left: Radius.circular(8), + ), + ), + ); + case 1: + return Container( + width: MediaQuery.of(context).size.width / 6, + height: 16, + margin: currentSelectedSatietyRating == 2 ? EdgeInsets.symmetric(horizontal: 2) : null, + decoration: BoxDecoration( + color: Color(0xFFFF3E3E), + border: currentSelectedSatietyRating == 2 + ? Border.all( + width: 2, + color: Color(0xFF550000), + strokeAlign: BorderSide.strokeAlignOutside, + ) + : null, + borderRadius: currentSelectedSatietyRating == 2 ? BorderRadius.circular(2) : null, + ), + ); + case 2: + return Container( + width: MediaQuery.of(context).size.width / 6, + height: 16, + margin: currentSelectedSatietyRating == 3 ? EdgeInsets.symmetric(horizontal: 2) : null, + decoration: BoxDecoration( + color: Color(0xFFF8C926), + border: currentSelectedSatietyRating == 3 + ? Border.all( + width: 2, + color: Color(0xFF8C5D00), + strokeAlign: BorderSide.strokeAlignOutside, + ) + : null, + borderRadius: currentSelectedSatietyRating == 3 ? BorderRadius.circular(2) : null, + ), + ); + case 3: + return Container( + width: MediaQuery.of(context).size.width / 6, + height: 16, + margin: currentSelectedSatietyRating == 4 ? EdgeInsets.symmetric(horizontal: 2) : null, + decoration: BoxDecoration( + color: Color(0xFFFFF3BF), + border: currentSelectedSatietyRating == 4 + ? Border.all( + width: 2, + color: Color(0xFFB5911B), + strokeAlign: BorderSide.strokeAlignOutside, + ) + : null, + borderRadius: currentSelectedSatietyRating == 4 ? BorderRadius.circular(2) : null, + ), + ); + case 4: + return Container( + width: MediaQuery.of(context).size.width / 6, + height: 16, + margin: currentSelectedSatietyRating == 5 ? EdgeInsets.symmetric(horizontal: 2) : null, + decoration: BoxDecoration( + color: Color(0xFF62E833), + border: currentSelectedSatietyRating == 5 + ? Border.all( + width: 2, + color: Color(0xFF276918), + strokeAlign: BorderSide.strokeAlignOutside, + ) + : null, + borderRadius: currentSelectedSatietyRating == 5 ? BorderRadius.circular(2) : null, + ), + ); + default: + return Container( + width: MediaQuery.of(context).size.width / 6, + height: 16, + margin: currentSelectedSatietyRating == 6 ? EdgeInsets.symmetric(horizontal: 2) : null, + decoration: BoxDecoration( + color: Color(0xFF4DCE20), + border: currentSelectedSatietyRating == 6 + ? Border.all( + width: 2, + color: Color(0xFF184D12), + strokeAlign: BorderSide.strokeAlignOutside, + ) + : null, + borderRadius: currentSelectedSatietyRating == 6 + ? BorderRadius.horizontal( + left: Radius.circular(2), + right: Radius.circular(8), + ) + : BorderRadius.horizontal( + right: Radius.circular(8), + ), + ), + ); + } + }, + onRatingUpdate: (value) => setState(() { + currentSelectedSatietyRating = value; + }), + ), + SvgPicture.asset( + 'assets/icons/satiety_emoji_right.svg', + height: 32, + width: 32, + ), + ], + ), + ], + ), + ); + } + _arrowDown() { return Container( padding: const EdgeInsets.only(top: 8, bottom: 16), @@ -189,12 +353,103 @@ class _DiaryScreenState extends State { diaryDay.meals[currentSelectedMealNumber - 1].photos, diaryDay, ), + _satietyRating(), ], ), ), ); } + _chart() { + final List chartData = [ + ChartData(1924, 200, '100%', Colors.blue), + ChartData(1925, 50, '100%', Colors.green), + ChartData(1926, 70, '100%', Colors.red), + ChartData(1926, 70, '100%', Colors.brown), + ]; + + return Container( + padding: const EdgeInsets.all(16), + margin: const EdgeInsets.only(top: 12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: Colors.white, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'Ваш КБЖУ от дневной\nсуточной нормы', + textAlign: TextAlign.center, + style: TextStyle( + color: Color(0xFF323F4B), + fontWeight: FontWeight.w500, + fontSize: 18, + height: 1, + ), + ), + Transform.rotate( + angle: -1.5708, + child: ClipRect( + child: Align( + alignment: Alignment.centerRight, + widthFactor: 0.5, + child: SfCircularChart( + series: [ + RadialBarSeries( + dataSource: chartData, + xValueMapper: (ChartData data, _) => data.x, + yValueMapper: (ChartData data, _) => data.y, + pointColorMapper: (ChartData data, _) => data.color, + trackColor: Color.fromRGBO(59, 130, 246, 1), + trackOpacity: 0.1, + gap: "8%", + radius: "110%", + innerRadius: '20%', + cornerStyle: CornerStyle.bothCurve, + ), + ], + ), + ), + ), + ), + _chartData('Калории', '0 ккал'), + const SizedBox(height: 8), + _chartData('Белки', '0 грамм'), + const SizedBox(height: 8), + _chartData('Жиры', '0 грамм'), + const SizedBox(height: 8), + _chartData('Углеводы', '0 грамм'), + ], + ), + ); + } + + _chartData(String title, String value) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + title, + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w500, + color: Color(0xFF323F4B), + ), + ), + Text( + value, + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w500, + color: Color(0xFF323F4B), + ), + ), + ], + ); + } + _showImagePicker(DiaryDayModel diaryDay) { showCupertinoModalPopup( context: context, @@ -271,6 +526,7 @@ class _DiaryScreenState extends State { child: IconButton.filled( style: IconButton.styleFrom( backgroundColor: Colors.white, + elevation: 0, ), onPressed: () async { await diaryCubit.deletePhoto( @@ -669,3 +925,16 @@ class _DiaryScreenState extends State { ); } } + +class ChartData { + int x, y; + String text; + Color color; + + ChartData( + this.x, + this.y, + this.text, + this.color, + ); +} diff --git a/lib/main.dart b/lib/main.dart index ce09857f..816adbe7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -11,7 +11,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:keyboard_dismisser/keyboard_dismisser.dart'; -Future main() async { +void main() async { WidgetsFlutterBinding.ensureInitialized(); await di.init(); runApp(MyApp()); diff --git a/pubspec.yaml b/pubspec.yaml index b589dd00..080157d0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -50,6 +50,7 @@ dependencies: rive: ^0.13.15 mask_text_input_formatter: ^2.9.0 lottie: ^3.1.3 + flutter_rating_bar: ^4.0.1 dev_dependencies: build_runner: ^2.4.13 From e3fc4811b8df61a8926d1c32dd16df052f172ba1 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 8 Nov 2024 15:08:43 +0300 Subject: [PATCH 04/18] feat(diary): change chart colors --- .../presentation/pages/diary_screen.dart | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 0c181902..2d886aa8 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -76,7 +76,7 @@ class _DiaryScreenState extends State { _satietyRating() { return Padding( - padding: const EdgeInsets.only(top: 12), + padding: const EdgeInsets.only(top: 24), child: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -362,10 +362,30 @@ class _DiaryScreenState extends State { _chart() { final List chartData = [ - ChartData(1924, 200, '100%', Colors.blue), - ChartData(1925, 50, '100%', Colors.green), - ChartData(1926, 70, '100%', Colors.red), - ChartData(1926, 70, '100%', Colors.brown), + ChartData( + 1924, + 200, + '100%', + Color(0xFFFF9500), + ), + ChartData( + 1925, + 50, + '100%', + Color(0xFFFF3B30), + ), + ChartData( + 1926, + 70, + '100%', + Color(0xFF4CD964), + ), + ChartData( + 1926, + 70, + '100%', + Color(0xFF007AFF), + ), ]; return Container( From 9b7e972268d42e6c86030fbf702c663de3ca1506 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 04:57:41 +0300 Subject: [PATCH 05/18] feat(diary): --- .../diary/presentation/bloc/diary_cubit.dart | 13 +- .../diary/presentation/bloc/diary_state.dart | 1 + .../bloc/diary_state.freezed.dart | 84 ++++++--- .../presentation/pages/diary_screen.dart | 178 ++---------------- .../widgets/satiety_rating_widget.dart | 178 ++++++++++++++++++ 5 files changed, 264 insertions(+), 190 deletions(-) create mode 100644 lib/features/diary/presentation/widgets/satiety_rating_widget.dart diff --git a/lib/features/diary/presentation/bloc/diary_cubit.dart b/lib/features/diary/presentation/bloc/diary_cubit.dart index d7f31da6..62d81086 100644 --- a/lib/features/diary/presentation/bloc/diary_cubit.dart +++ b/lib/features/diary/presentation/bloc/diary_cubit.dart @@ -10,6 +10,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; class DiaryCubit extends Cubit { final DiaryRepository diaryRepository; final GlossaryRepository glossaryRepository; + double currentSelectedSatietyRating = 3; DiaryCubit({ required this.diaryRepository, @@ -19,7 +20,12 @@ class DiaryCubit extends Cubit { getDiaryDay(String date, [bool needLoading = true]) async { if (needLoading) emit(const DiaryState.loading()); try { - emit(DiaryState.loaded(diary: await diaryRepository.getDiaryByDate(date))); + emit( + DiaryState.loaded( + diary: await diaryRepository.getDiaryByDate(date), + currentSelectedSatietyRating: currentSelectedSatietyRating, + ), + ); } catch (e) { emit(DiaryState.error(errorMessage: e.toString())); throw e; @@ -109,4 +115,9 @@ class DiaryCubit extends Cubit { ); await getDiaryDay(date, false); } + + updateCurrentSelectedSatietyRating(double value) { + currentSelectedSatietyRating = value; + emit((state as DiaryStateLoaded).copyWith(currentSelectedSatietyRating: currentSelectedSatietyRating)); + } } diff --git a/lib/features/diary/presentation/bloc/diary_state.dart b/lib/features/diary/presentation/bloc/diary_state.dart index c9b58a8d..85221b31 100644 --- a/lib/features/diary/presentation/bloc/diary_state.dart +++ b/lib/features/diary/presentation/bloc/diary_state.dart @@ -15,5 +15,6 @@ class DiaryState with _$DiaryState { const factory DiaryState.loaded({ required DiaryDayModel diary, + required double currentSelectedSatietyRating, }) = DiaryStateLoaded; } diff --git a/lib/features/diary/presentation/bloc/diary_state.freezed.dart b/lib/features/diary/presentation/bloc/diary_state.freezed.dart index 513d217d..6e0778c4 100644 --- a/lib/features/diary/presentation/bloc/diary_state.freezed.dart +++ b/lib/features/diary/presentation/bloc/diary_state.freezed.dart @@ -21,7 +21,9 @@ mixin _$DiaryState { TResult Function() $default, { required TResult Function() loading, required TResult Function(String errorMessage) error, - required TResult Function(DiaryDayModel diary) loaded, + required TResult Function( + DiaryDayModel diary, double currentSelectedSatietyRating) + loaded, }) => throw _privateConstructorUsedError; @optionalTypeArgs @@ -29,7 +31,8 @@ mixin _$DiaryState { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(String errorMessage)? error, - TResult? Function(DiaryDayModel diary)? loaded, + TResult? Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + loaded, }) => throw _privateConstructorUsedError; @optionalTypeArgs @@ -37,7 +40,8 @@ mixin _$DiaryState { TResult Function()? $default, { TResult Function()? loading, TResult Function(String errorMessage)? error, - TResult Function(DiaryDayModel diary)? loaded, + TResult Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + loaded, required TResult orElse(), }) => throw _privateConstructorUsedError; @@ -133,7 +137,9 @@ class _$DiaryStateImpl implements _DiaryState { TResult Function() $default, { required TResult Function() loading, required TResult Function(String errorMessage) error, - required TResult Function(DiaryDayModel diary) loaded, + required TResult Function( + DiaryDayModel diary, double currentSelectedSatietyRating) + loaded, }) { return $default(); } @@ -144,7 +150,8 @@ class _$DiaryStateImpl implements _DiaryState { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(String errorMessage)? error, - TResult? Function(DiaryDayModel diary)? loaded, + TResult? Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + loaded, }) { return $default?.call(); } @@ -155,7 +162,8 @@ class _$DiaryStateImpl implements _DiaryState { TResult Function()? $default, { TResult Function()? loading, TResult Function(String errorMessage)? error, - TResult Function(DiaryDayModel diary)? loaded, + TResult Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + loaded, required TResult orElse(), }) { if ($default != null) { @@ -250,7 +258,9 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { TResult Function() $default, { required TResult Function() loading, required TResult Function(String errorMessage) error, - required TResult Function(DiaryDayModel diary) loaded, + required TResult Function( + DiaryDayModel diary, double currentSelectedSatietyRating) + loaded, }) { return loading(); } @@ -261,7 +271,8 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(String errorMessage)? error, - TResult? Function(DiaryDayModel diary)? loaded, + TResult? Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + loaded, }) { return loading?.call(); } @@ -272,7 +283,8 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { TResult Function()? $default, { TResult Function()? loading, TResult Function(String errorMessage)? error, - TResult Function(DiaryDayModel diary)? loaded, + TResult Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + loaded, required TResult orElse(), }) { if (loading != null) { @@ -396,7 +408,9 @@ class _$DiaryStateErrorImpl implements DiaryStateError { TResult Function() $default, { required TResult Function() loading, required TResult Function(String errorMessage) error, - required TResult Function(DiaryDayModel diary) loaded, + required TResult Function( + DiaryDayModel diary, double currentSelectedSatietyRating) + loaded, }) { return error(errorMessage); } @@ -407,7 +421,8 @@ class _$DiaryStateErrorImpl implements DiaryStateError { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(String errorMessage)? error, - TResult? Function(DiaryDayModel diary)? loaded, + TResult? Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + loaded, }) { return error?.call(errorMessage); } @@ -418,7 +433,8 @@ class _$DiaryStateErrorImpl implements DiaryStateError { TResult Function()? $default, { TResult Function()? loading, TResult Function(String errorMessage)? error, - TResult Function(DiaryDayModel diary)? loaded, + TResult Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + loaded, required TResult orElse(), }) { if (error != null) { @@ -484,7 +500,7 @@ abstract class _$$DiaryStateLoadedImplCopyWith<$Res> { $Res Function(_$DiaryStateLoadedImpl) then) = __$$DiaryStateLoadedImplCopyWithImpl<$Res>; @useResult - $Res call({DiaryDayModel diary}); + $Res call({DiaryDayModel diary, double currentSelectedSatietyRating}); $DiaryDayModelCopyWith<$Res> get diary; } @@ -503,12 +519,17 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> @override $Res call({ Object? diary = null, + Object? currentSelectedSatietyRating = null, }) { return _then(_$DiaryStateLoadedImpl( diary: null == diary ? _value.diary : diary // ignore: cast_nullable_to_non_nullable as DiaryDayModel, + currentSelectedSatietyRating: null == currentSelectedSatietyRating + ? _value.currentSelectedSatietyRating + : currentSelectedSatietyRating // ignore: cast_nullable_to_non_nullable + as double, )); } @@ -526,14 +547,17 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> /// @nodoc class _$DiaryStateLoadedImpl implements DiaryStateLoaded { - const _$DiaryStateLoadedImpl({required this.diary}); + const _$DiaryStateLoadedImpl( + {required this.diary, required this.currentSelectedSatietyRating}); @override final DiaryDayModel diary; + @override + final double currentSelectedSatietyRating; @override String toString() { - return 'DiaryState.loaded(diary: $diary)'; + return 'DiaryState.loaded(diary: $diary, currentSelectedSatietyRating: $currentSelectedSatietyRating)'; } @override @@ -541,11 +565,16 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DiaryStateLoadedImpl && - (identical(other.diary, diary) || other.diary == diary)); + (identical(other.diary, diary) || other.diary == diary) && + (identical(other.currentSelectedSatietyRating, + currentSelectedSatietyRating) || + other.currentSelectedSatietyRating == + currentSelectedSatietyRating)); } @override - int get hashCode => Object.hash(runtimeType, diary); + int get hashCode => + Object.hash(runtimeType, diary, currentSelectedSatietyRating); /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @@ -562,9 +591,11 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { TResult Function() $default, { required TResult Function() loading, required TResult Function(String errorMessage) error, - required TResult Function(DiaryDayModel diary) loaded, + required TResult Function( + DiaryDayModel diary, double currentSelectedSatietyRating) + loaded, }) { - return loaded(diary); + return loaded(diary, currentSelectedSatietyRating); } @override @@ -573,9 +604,10 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(String errorMessage)? error, - TResult? Function(DiaryDayModel diary)? loaded, + TResult? Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + loaded, }) { - return loaded?.call(diary); + return loaded?.call(diary, currentSelectedSatietyRating); } @override @@ -584,11 +616,12 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { TResult Function()? $default, { TResult Function()? loading, TResult Function(String errorMessage)? error, - TResult Function(DiaryDayModel diary)? loaded, + TResult Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + loaded, required TResult orElse(), }) { if (loaded != null) { - return loaded(diary); + return loaded(diary, currentSelectedSatietyRating); } return orElse(); } @@ -632,10 +665,13 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { } abstract class DiaryStateLoaded implements DiaryState { - const factory DiaryStateLoaded({required final DiaryDayModel diary}) = + const factory DiaryStateLoaded( + {required final DiaryDayModel diary, + required final double currentSelectedSatietyRating}) = _$DiaryStateLoadedImpl; DiaryDayModel get diary; + double get currentSelectedSatietyRating; /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 2d886aa8..91fdbf29 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -4,6 +4,7 @@ import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/features/diary/models/diary_day_model.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_cubit.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; +import 'package:eatvio_app/features/diary/presentation/widgets/satiety_rating_widget.dart'; import 'package:eatvio_app/features/glossary/models/glossary_model.dart'; import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/theme/theme_helper.dart'; @@ -11,7 +12,6 @@ import 'package:eatvio_app/widgets/custom_text_form_field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:image_picker/image_picker.dart'; @@ -36,7 +36,6 @@ class _DiaryScreenState extends State { final productNameController = TextEditingController(); final quantityController = TextEditingController(); int currentSelectedPhotoIndex = 0; - double currentSelectedSatietyRating = 3; @override Widget build(BuildContext context) { @@ -62,7 +61,11 @@ class _DiaryScreenState extends State { children: [ _calendar(state), if (state is DiaryStateLoading) _loader(), - if (state is DiaryStateLoaded) _meals(state.diary), + if (state is DiaryStateLoaded) + _meals( + state.diary, + state.currentSelectedSatietyRating, + ), if (state is DiaryStateLoaded) _chart(), const SizedBox(height: 32), ], @@ -74,166 +77,6 @@ class _DiaryScreenState extends State { ); } - _satietyRating() { - return Padding( - padding: const EdgeInsets.only(top: 24), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - 'Ваша сытость после приёма пищи', - style: TextStyle( - fontSize: 16, - ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - SvgPicture.asset( - 'assets/icons/satiety_emoji_left.svg', - height: 32, - width: 32, - ), - RatingBar.builder( - initialRating: 3, - itemCount: 6, - itemSize: MediaQuery.of(context).size.width / 6 - (124 / 6), - itemBuilder: (context, index) { - switch (index) { - case 0: - return Container( - width: MediaQuery.of(context).size.width / 6, - height: 16, - margin: currentSelectedSatietyRating == 1 ? EdgeInsets.symmetric(horizontal: 2) : null, - decoration: BoxDecoration( - color: Color(0xFFC82222), - border: currentSelectedSatietyRating == 1 - ? Border.all( - width: 2, - color: Color(0xFFAA3333), - strokeAlign: BorderSide.strokeAlignOutside, - ) - : null, - borderRadius: currentSelectedSatietyRating == 1 - ? BorderRadius.horizontal( - left: Radius.circular(8), - right: Radius.circular(2), - ) - : BorderRadius.horizontal( - left: Radius.circular(8), - ), - ), - ); - case 1: - return Container( - width: MediaQuery.of(context).size.width / 6, - height: 16, - margin: currentSelectedSatietyRating == 2 ? EdgeInsets.symmetric(horizontal: 2) : null, - decoration: BoxDecoration( - color: Color(0xFFFF3E3E), - border: currentSelectedSatietyRating == 2 - ? Border.all( - width: 2, - color: Color(0xFF550000), - strokeAlign: BorderSide.strokeAlignOutside, - ) - : null, - borderRadius: currentSelectedSatietyRating == 2 ? BorderRadius.circular(2) : null, - ), - ); - case 2: - return Container( - width: MediaQuery.of(context).size.width / 6, - height: 16, - margin: currentSelectedSatietyRating == 3 ? EdgeInsets.symmetric(horizontal: 2) : null, - decoration: BoxDecoration( - color: Color(0xFFF8C926), - border: currentSelectedSatietyRating == 3 - ? Border.all( - width: 2, - color: Color(0xFF8C5D00), - strokeAlign: BorderSide.strokeAlignOutside, - ) - : null, - borderRadius: currentSelectedSatietyRating == 3 ? BorderRadius.circular(2) : null, - ), - ); - case 3: - return Container( - width: MediaQuery.of(context).size.width / 6, - height: 16, - margin: currentSelectedSatietyRating == 4 ? EdgeInsets.symmetric(horizontal: 2) : null, - decoration: BoxDecoration( - color: Color(0xFFFFF3BF), - border: currentSelectedSatietyRating == 4 - ? Border.all( - width: 2, - color: Color(0xFFB5911B), - strokeAlign: BorderSide.strokeAlignOutside, - ) - : null, - borderRadius: currentSelectedSatietyRating == 4 ? BorderRadius.circular(2) : null, - ), - ); - case 4: - return Container( - width: MediaQuery.of(context).size.width / 6, - height: 16, - margin: currentSelectedSatietyRating == 5 ? EdgeInsets.symmetric(horizontal: 2) : null, - decoration: BoxDecoration( - color: Color(0xFF62E833), - border: currentSelectedSatietyRating == 5 - ? Border.all( - width: 2, - color: Color(0xFF276918), - strokeAlign: BorderSide.strokeAlignOutside, - ) - : null, - borderRadius: currentSelectedSatietyRating == 5 ? BorderRadius.circular(2) : null, - ), - ); - default: - return Container( - width: MediaQuery.of(context).size.width / 6, - height: 16, - margin: currentSelectedSatietyRating == 6 ? EdgeInsets.symmetric(horizontal: 2) : null, - decoration: BoxDecoration( - color: Color(0xFF4DCE20), - border: currentSelectedSatietyRating == 6 - ? Border.all( - width: 2, - color: Color(0xFF184D12), - strokeAlign: BorderSide.strokeAlignOutside, - ) - : null, - borderRadius: currentSelectedSatietyRating == 6 - ? BorderRadius.horizontal( - left: Radius.circular(2), - right: Radius.circular(8), - ) - : BorderRadius.horizontal( - right: Radius.circular(8), - ), - ), - ); - } - }, - onRatingUpdate: (value) => setState(() { - currentSelectedSatietyRating = value; - }), - ), - SvgPicture.asset( - 'assets/icons/satiety_emoji_right.svg', - height: 32, - width: 32, - ), - ], - ), - ], - ), - ); - } - _arrowDown() { return Container( padding: const EdgeInsets.only(top: 8, bottom: 16), @@ -294,7 +137,10 @@ class _DiaryScreenState extends State { ); } - _meals(DiaryDayModel diaryDay) { + _meals( + DiaryDayModel diaryDay, + double currentSelectedSatietyRating, + ) { return Material( borderRadius: BorderRadius.circular(20), color: Colors.white, @@ -353,7 +199,9 @@ class _DiaryScreenState extends State { diaryDay.meals[currentSelectedMealNumber - 1].photos, diaryDay, ), - _satietyRating(), + SatietyRatingWidget( + currentSelectedSatietyRating: currentSelectedSatietyRating, + ), ], ), ), diff --git a/lib/features/diary/presentation/widgets/satiety_rating_widget.dart b/lib/features/diary/presentation/widgets/satiety_rating_widget.dart new file mode 100644 index 00000000..d12fa114 --- /dev/null +++ b/lib/features/diary/presentation/widgets/satiety_rating_widget.dart @@ -0,0 +1,178 @@ +import 'package:eatvio_app/features/diary/presentation/bloc/diary_cubit.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_rating_bar/flutter_rating_bar.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class SatietyRatingWidget extends StatefulWidget { + final double currentSelectedSatietyRating; + + const SatietyRatingWidget({ + super.key, + required this.currentSelectedSatietyRating, + }); + + @override + State createState() => _SatietyRatingWidgetState(); +} + +class _SatietyRatingWidgetState extends State { + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 24), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + 'Ваша сытость после приёма пищи', + style: TextStyle( + fontSize: 16, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SvgPicture.asset( + 'assets/icons/satiety_emoji_left.svg', + height: 32, + width: 32, + ), + RatingBar.builder( + initialRating: 3, + itemCount: 6, + itemSize: MediaQuery.of(context).size.width / 6 - (124 / 6), + itemBuilder: (context, index) { + switch (index) { + case 0: + return Container( + width: MediaQuery.of(context).size.width / 6, + height: 16, + margin: widget.currentSelectedSatietyRating == 1 ? EdgeInsets.symmetric(horizontal: 2) : null, + decoration: BoxDecoration( + color: Color(0xFFC82222), + border: widget.currentSelectedSatietyRating == 1 + ? Border.all( + width: 2, + color: Color(0xFFAA3333), + strokeAlign: BorderSide.strokeAlignOutside, + ) + : null, + borderRadius: widget.currentSelectedSatietyRating == 1 + ? BorderRadius.horizontal( + left: Radius.circular(8), + right: Radius.circular(2), + ) + : BorderRadius.horizontal( + left: Radius.circular(8), + ), + ), + ); + case 1: + return Container( + width: MediaQuery.of(context).size.width / 6, + height: 16, + margin: widget.currentSelectedSatietyRating == 2 ? EdgeInsets.symmetric(horizontal: 2) : null, + decoration: BoxDecoration( + color: Color(0xFFFF3E3E), + border: widget.currentSelectedSatietyRating == 2 + ? Border.all( + width: 2, + color: Color(0xFF550000), + strokeAlign: BorderSide.strokeAlignOutside, + ) + : null, + borderRadius: widget.currentSelectedSatietyRating == 2 ? BorderRadius.circular(2) : null, + ), + ); + case 2: + return Container( + width: MediaQuery.of(context).size.width / 6, + height: 16, + margin: widget.currentSelectedSatietyRating == 3 ? EdgeInsets.symmetric(horizontal: 2) : null, + decoration: BoxDecoration( + color: Color(0xFFF8C926), + border: widget.currentSelectedSatietyRating == 3 + ? Border.all( + width: 2, + color: Color(0xFF8C5D00), + strokeAlign: BorderSide.strokeAlignOutside, + ) + : null, + borderRadius: widget.currentSelectedSatietyRating == 3 ? BorderRadius.circular(2) : null, + ), + ); + case 3: + return Container( + width: MediaQuery.of(context).size.width / 6, + height: 16, + margin: widget.currentSelectedSatietyRating == 4 ? EdgeInsets.symmetric(horizontal: 2) : null, + decoration: BoxDecoration( + color: Color(0xFFFFF3BF), + border: widget.currentSelectedSatietyRating == 4 + ? Border.all( + width: 2, + color: Color(0xFFB5911B), + strokeAlign: BorderSide.strokeAlignOutside, + ) + : null, + borderRadius: widget.currentSelectedSatietyRating == 4 ? BorderRadius.circular(2) : null, + ), + ); + case 4: + return Container( + width: MediaQuery.of(context).size.width / 6, + height: 16, + margin: widget.currentSelectedSatietyRating == 5 ? EdgeInsets.symmetric(horizontal: 2) : null, + decoration: BoxDecoration( + color: Color(0xFF62E833), + border: widget.currentSelectedSatietyRating == 5 + ? Border.all( + width: 2, + color: Color(0xFF276918), + strokeAlign: BorderSide.strokeAlignOutside, + ) + : null, + borderRadius: widget.currentSelectedSatietyRating == 5 ? BorderRadius.circular(2) : null, + ), + ); + default: + return Container( + width: MediaQuery.of(context).size.width / 6, + height: 16, + margin: widget.currentSelectedSatietyRating == 6 ? EdgeInsets.symmetric(horizontal: 2) : null, + decoration: BoxDecoration( + color: Color(0xFF4DCE20), + border: widget.currentSelectedSatietyRating == 6 + ? Border.all( + width: 2, + color: Color(0xFF184D12), + strokeAlign: BorderSide.strokeAlignOutside, + ) + : null, + borderRadius: widget.currentSelectedSatietyRating == 6 + ? BorderRadius.horizontal( + left: Radius.circular(2), + right: Radius.circular(8), + ) + : BorderRadius.horizontal( + right: Radius.circular(8), + ), + ), + ); + } + }, + onRatingUpdate: (value) => context.read().updateCurrentSelectedSatietyRating(value), + ), + SvgPicture.asset( + 'assets/icons/satiety_emoji_right.svg', + height: 32, + width: 32, + ), + ], + ), + ], + ), + ); + } +} From 6f224cd3de34c1df871419b05de3e0a7abd87e74 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 04:58:36 +0300 Subject: [PATCH 06/18] feat(diary): --- hs_err_pid27368.log | 282 ++++++++++++++++++++++++++++++++++++++++++++ hs_err_pid28300.log | 282 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 564 insertions(+) create mode 100644 hs_err_pid27368.log create mode 100644 hs_err_pid28300.log diff --git a/hs_err_pid27368.log b/hs_err_pid27368.log new file mode 100644 index 00000000..7ab5d85e --- /dev/null +++ b/hs_err_pid27368.log @@ -0,0 +1,282 @@ +# +# There is insufficient memory for the Java Runtime Environment to continue. +# Native memory allocation (mmap) failed to map 230686720 bytes. Error detail: G1 virtual space +# Possible reasons: +# The system is out of physical RAM or swap space +# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap +# Possible solutions: +# Reduce memory load on the system +# Increase physical memory or swap space +# Check if swap backing store is full +# Decrease Java heap size (-Xmx/-Xms) +# Decrease number of Java threads +# Decrease Java thread stack sizes (-Xss) +# Set larger code cache with -XX:ReservedCodeCacheSize= +# JVM is running with Zero Based Compressed Oops mode in which the Java heap is +# placed in the first 32GB address space. The Java Heap base address is the +# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress +# to set the Java Heap base and to place the Java Heap above 32GB virtual address. +# This output file may be truncated or incomplete. +# +# Out of Memory Error (os_windows.cpp:3815), pid=27368, tid=23684 +# +# JRE version: (21.0.3) (build ) +# Java VM: OpenJDK 64-Bit Server VM (21.0.3+-12282718-b509.11, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) +# No core dump will be written. Minidumps are not enabled by default on client versions of Windows +# + +--------------- S U M M A R Y ------------ + +Command Line: + +Host: 13th Gen Intel(R) Core(TM) i5-13500H, 16 cores, 13G, Windows 11 , 64 bit Build 22621 (10.0.22621.4391) +Time: Mon Nov 11 00:13:50 2024 RTZ 2 (s 11 , 64 bit Build 22621 (10.0.22621.4391) elapsed time: 0.016698 seconds (0d 0h 0m 0s) + +--------------- T H R E A D --------------- + +Current thread (0x0000022ebbde7030): JavaThread "Unknown thread" [_thread_in_vm, id=23684, stack(0x0000007644700000,0x0000007644800000) (1024K)] + +Stack: [0x0000007644700000,0x0000007644800000] +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [jvm.dll+0x6cafb9] +V [jvm.dll+0x858523] +V [jvm.dll+0x85aa7e] +V [jvm.dll+0x85b163] +V [jvm.dll+0x27d356] +V [jvm.dll+0x6c7865] +V [jvm.dll+0x6bbd3a] +V [jvm.dll+0x35199b] +V [jvm.dll+0x3595d6] +V [jvm.dll+0x3aa826] +V [jvm.dll+0x3aaaf8] +V [jvm.dll+0x3240bc] +V [jvm.dll+0x324dab] +V [jvm.dll+0x81fd89] +V [jvm.dll+0x3b7c08] +V [jvm.dll+0x80921d] +V [jvm.dll+0x44c05e] +V [jvm.dll+0x44d6b1] +C [jli.dll+0x52ab] +C [ucrtbase.dll+0x29333] +C [KERNEL32.DLL+0x1259d] +C [ntdll.dll+0x5af38] + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x00007ff9018957c8, length=0, elements={ +} + +Java Threads: ( => current thread ) +Total: 0 + +Other Threads: + 0x0000022ebe1863b0 WorkerThread "GC Thread#0" [id=21692, stack(0x0000007644800000,0x0000007644900000) (1024K)] + 0x0000022ebe194f50 ConcurrentGCThread "G1 Main Marker" [id=30396, stack(0x0000007644900000,0x0000007644a00000) (1024K)] + 0x0000022ebe195bc0 WorkerThread "G1 Conc#0" [id=24760, stack(0x0000007644a00000,0x0000007644b00000) (1024K)] + +[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff901097197] +VM state: not at safepoint (not fully initialized) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x00007ff9019021c8] Heap_lock - owner thread: 0x0000022ebbde7030 + +Heap address: 0x0000000724400000, size: 3516 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) mapped at: [0x0000000000000000-0x0000000000000000-0x0000000000000000), size 0, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 1. +Narrow klass base: 0x0000000000000000, Narrow klass shift: 0, Narrow klass range: 0x0 + +GC Precious Log: + CardTable entry size: 512 + Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 + +Heap: + garbage-first heap total 0K, used 0K [0x0000000724400000, 0x0000000800000000) + region size 2048K, 0 young (0K), 0 survivors (0K) + Metaspace used 0K, committed 0K, reserved 0K + class space used 0K, committed 0K, reserved 0K + +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom + +Card table byte_map: [0x0000022ed11c0000,0x0000022ed18a0000] _byte_map_base: 0x0000022ecd89e000 + +Marking Bits: (CMBitMap*) 0x0000022ebe186ab0 + Bits: [0x0000022ed18a0000, 0x0000022ed4f90000) + +GC Heap History (0 events): +No events + +Dll operation events (1 events): +Event: 0.011 Loaded shared library C:\Program Files\Android\Android Studio\jbr\bin\java.dll + +Deoptimization events (0 events): +No events + +Classes loaded (0 events): +No events + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (0 events): +No events + +ZGC Phase Switch (0 events): +No events + +VM Operations (0 events): +No events + +Events (0 events): +No events + + +Dynamic libraries: +0x00007ff74da60000 - 0x00007ff74da6a000 C:\Program Files\Android\Android Studio\jbr\bin\java.EXE +0x00007ff9bac50000 - 0x00007ff9bae67000 C:\Windows\SYSTEM32\ntdll.dll +0x00007ff9b9530000 - 0x00007ff9b95f4000 C:\Windows\System32\KERNEL32.DLL +0x00007ff9b82d0000 - 0x00007ff9b8689000 C:\Windows\System32\KERNELBASE.dll +0x00007ff9af480000 - 0x00007ff9af517000 C:\Windows\SYSTEM32\apphelp.dll +0x00007ff9b86c0000 - 0x00007ff9b87d1000 C:\Windows\System32\ucrtbase.dll +0x00007ff9a8040000 - 0x00007ff9a805b000 C:\Program Files\Android\Android Studio\jbr\bin\VCRUNTIME140.dll +0x00007ff9a7710000 - 0x00007ff9a7728000 C:\Program Files\Android\Android Studio\jbr\bin\jli.dll +0x00007ff9ba100000 - 0x00007ff9ba2ae000 C:\Windows\System32\USER32.dll +0x00007ff9b8690000 - 0x00007ff9b86b6000 C:\Windows\System32\win32u.dll +0x00007ff9b9fb0000 - 0x00007ff9b9fd9000 C:\Windows\System32\GDI32.dll +0x00007ff9895a0000 - 0x00007ff989832000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.4391_none_2715d37f73803e96\COMCTL32.dll +0x00007ff9b7f20000 - 0x00007ff9b803b000 C:\Windows\System32\gdi32full.dll +0x00007ff9ba6a0000 - 0x00007ff9ba747000 C:\Windows\System32\msvcrt.dll +0x00007ff9b88a0000 - 0x00007ff9b893a000 C:\Windows\System32\msvcp_win.dll +0x00007ff9ba550000 - 0x00007ff9ba581000 C:\Windows\System32\IMM32.DLL +0x00007ff9aee10000 - 0x00007ff9aee1c000 C:\Program Files\Android\Android Studio\jbr\bin\vcruntime140_1.dll +0x00007ff95ff80000 - 0x00007ff96000d000 C:\Program Files\Android\Android Studio\jbr\bin\msvcp140.dll +0x00007ff900d60000 - 0x00007ff9019dd000 C:\Program Files\Android\Android Studio\jbr\bin\server\jvm.dll +0x00007ff9ba320000 - 0x00007ff9ba3d2000 C:\Windows\System32\ADVAPI32.dll +0x00007ff9b8bb0000 - 0x00007ff9b8c57000 C:\Windows\System32\sechost.dll +0x00007ff9b8040000 - 0x00007ff9b8068000 C:\Windows\System32\bcrypt.dll +0x00007ff9baac0000 - 0x00007ff9babd4000 C:\Windows\System32\RPCRT4.dll +0x00007ff9b8b30000 - 0x00007ff9b8ba1000 C:\Windows\System32\WS2_32.dll +0x00007ff9b6d70000 - 0x00007ff9b6dbd000 C:\Windows\SYSTEM32\POWRPROF.dll +0x00007ff9a4fc0000 - 0x00007ff9a4fca000 C:\Windows\SYSTEM32\VERSION.dll +0x00007ff9ad660000 - 0x00007ff9ad694000 C:\Windows\SYSTEM32\WINMM.dll +0x00007ff9b6d50000 - 0x00007ff9b6d63000 C:\Windows\SYSTEM32\UMPDC.dll +0x00007ff9b7010000 - 0x00007ff9b7028000 C:\Windows\SYSTEM32\kernel.appcore.dll +0x00007ff9ad090000 - 0x00007ff9ad09a000 C:\Program Files\Android\Android Studio\jbr\bin\jimage.dll +0x00007ff9b5790000 - 0x00007ff9b59c2000 C:\Windows\SYSTEM32\DBGHELP.DLL +0x00007ff9b9c20000 - 0x00007ff9b9faf000 C:\Windows\System32\combase.dll +0x00007ff9b9610000 - 0x00007ff9b96e7000 C:\Windows\System32\OLEAUT32.dll +0x00007ff981cc0000 - 0x00007ff981cf2000 C:\Windows\SYSTEM32\dbgcore.DLL +0x00007ff9b8250000 - 0x00007ff9b82cb000 C:\Windows\System32\bcryptPrimitives.dll +0x00007ff98b310000 - 0x00007ff98b32f000 C:\Program Files\Android\Android Studio\jbr\bin\java.dll + +dbghelp: loaded successfully - version: 4.0.5 - missing functions: none +symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Android\Android Studio\jbr\bin;C:\Windows\SYSTEM32;C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.4391_none_2715d37f73803e96;C:\Program Files\Android\Android Studio\jbr\bin\server + +VM Arguments: +java_command: +java_class_path (initial): +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 12 {product} {ergonomic} + uint ConcGCThreads = 3 {product} {ergonomic} + uint G1ConcRefinementThreads = 13 {product} {ergonomic} + size_t G1HeapRegionSize = 2097152 {product} {ergonomic} + uintx GCDrainStackTargetSize = 64 {product} {ergonomic} + size_t InitialHeapSize = 230686720 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 3686793216 {product} {ergonomic} + size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 7602480 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 3686793216 {manageable} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Environment Variables: +PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\java8path;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\7\;C:\Users\mso7nueh\AppData\Local\Microsoft\WindowsApps;C:\Users\mso7nueh\flutter\bin;C:\Program Files\tinc;C:\Users\mso7nueh\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\mso7nueh\flutter\bin\mingit\cmd;C:\Users\mso7nueh\flutter\bin\mingit\cmd +USERNAME=mso7nueh +OS=Windows_NT +PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 186 Stepping 2, GenuineIntel +TMP=C:\Users\mso7nueh\AppData\Local\Temp +TEMP=C:\Users\mso7nueh\AppData\Local\Temp + + + + +Periodic native trim disabled + +JNI global refs: +JNI global refs: 0, weak refs: 0 + +JNI global refs memory usage: 0, weak refs: 0 + +Process memory usage: +Resident Set Size: 12608K (0% of 14398328K total physical memory with 393512K free physical memory) + +OOME stack traces (most recent first): +Classloader memory used: + +--------------- S Y S T E M --------------- + +OS: + Windows 11 , 64 bit Build 22621 (10.0.22621.4391) +OS uptime: 3 days 10:18 hours +Hyper-V role detected + +CPU: total 16 (initial active 16) (8 cores per cpu, 2 threads per core) family 6 model 186 stepping 2 microcode 0x4123, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, clwb, hv, serialize, rdtscp, rdpid, fsrm, f16c, cet_ibt, cet_ss +Processor Information for processor 0 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 1 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 2 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 3 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 4 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 5 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 6 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 7 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 8 + Max Mhz: 2600, Current Mhz: 1505, Mhz Limit: 2600 +Processor Information for processor 9 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 10 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 11 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 12 + Max Mhz: 2600, Current Mhz: 1505, Mhz Limit: 2600 +Processor Information for processor 13 + Max Mhz: 2600, Current Mhz: 1505, Mhz Limit: 2600 +Processor Information for processor 14 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 15 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 + +Memory: 4k page, system-wide physical 14060M (384M free) +TotalPageFile size 30444M (AvailPageFile size 147M) +current process WorkingSet (physical memory assigned to process): 12M, peak: 12M +current process commit charge ("private bytes"): 70M, peak: 290M + +vm_info: OpenJDK 64-Bit Server VM (21.0.3+-12282718-b509.11) for windows-amd64 JRE (21.0.3+-12282718-b509.11), built on 2024-08-27T17:34:15Z by "builder" with MS VC++ 16.10 / 16.11 (VS2019) + +END. diff --git a/hs_err_pid28300.log b/hs_err_pid28300.log new file mode 100644 index 00000000..4d94482c --- /dev/null +++ b/hs_err_pid28300.log @@ -0,0 +1,282 @@ +# +# There is insufficient memory for the Java Runtime Environment to continue. +# Native memory allocation (mmap) failed to map 230686720 bytes. Error detail: G1 virtual space +# Possible reasons: +# The system is out of physical RAM or swap space +# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap +# Possible solutions: +# Reduce memory load on the system +# Increase physical memory or swap space +# Check if swap backing store is full +# Decrease Java heap size (-Xmx/-Xms) +# Decrease number of Java threads +# Decrease Java thread stack sizes (-Xss) +# Set larger code cache with -XX:ReservedCodeCacheSize= +# JVM is running with Zero Based Compressed Oops mode in which the Java heap is +# placed in the first 32GB address space. The Java Heap base address is the +# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress +# to set the Java Heap base and to place the Java Heap above 32GB virtual address. +# This output file may be truncated or incomplete. +# +# Out of Memory Error (os_windows.cpp:3815), pid=28300, tid=3288 +# +# JRE version: (21.0.3) (build ) +# Java VM: OpenJDK 64-Bit Server VM (21.0.3+-12282718-b509.11, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) +# No core dump will be written. Minidumps are not enabled by default on client versions of Windows +# + +--------------- S U M M A R Y ------------ + +Command Line: + +Host: 13th Gen Intel(R) Core(TM) i5-13500H, 16 cores, 13G, Windows 11 , 64 bit Build 22621 (10.0.22621.4391) +Time: Mon Nov 11 00:13:50 2024 RTZ 2 (s 11 , 64 bit Build 22621 (10.0.22621.4391) elapsed time: 0.014976 seconds (0d 0h 0m 0s) + +--------------- T H R E A D --------------- + +Current thread (0x0000027140fb7110): JavaThread "Unknown thread" [_thread_in_vm, id=3288, stack(0x000000cfeca00000,0x000000cfecb00000) (1024K)] + +Stack: [0x000000cfeca00000,0x000000cfecb00000] +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [jvm.dll+0x6cafb9] +V [jvm.dll+0x858523] +V [jvm.dll+0x85aa7e] +V [jvm.dll+0x85b163] +V [jvm.dll+0x27d356] +V [jvm.dll+0x6c7865] +V [jvm.dll+0x6bbd3a] +V [jvm.dll+0x35199b] +V [jvm.dll+0x3595d6] +V [jvm.dll+0x3aa826] +V [jvm.dll+0x3aaaf8] +V [jvm.dll+0x3240bc] +V [jvm.dll+0x324dab] +V [jvm.dll+0x81fd89] +V [jvm.dll+0x3b7c08] +V [jvm.dll+0x80921d] +V [jvm.dll+0x44c05e] +V [jvm.dll+0x44d6b1] +C [jli.dll+0x52ab] +C [ucrtbase.dll+0x29333] +C [KERNEL32.DLL+0x1259d] +C [ntdll.dll+0x5af38] + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x00007ff9018957c8, length=0, elements={ +} + +Java Threads: ( => current thread ) +Total: 0 + +Other Threads: + 0x00000271411d6570 WorkerThread "GC Thread#0" [id=23492, stack(0x000000cfecb00000,0x000000cfecc00000) (1024K)] + 0x00000271411e5280 ConcurrentGCThread "G1 Main Marker" [id=26024, stack(0x000000cfecc00000,0x000000cfecd00000) (1024K)] + 0x00000271411e6520 WorkerThread "G1 Conc#0" [id=6216, stack(0x000000cfecd00000,0x000000cfece00000) (1024K)] + +[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff901097197] +VM state: not at safepoint (not fully initialized) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x00007ff9019021c8] Heap_lock - owner thread: 0x0000027140fb7110 + +Heap address: 0x0000000724400000, size: 3516 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 + +CDS archive(s) mapped at: [0x0000000000000000-0x0000000000000000-0x0000000000000000), size 0, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 1. +Narrow klass base: 0x0000000000000000, Narrow klass shift: 0, Narrow klass range: 0x0 + +GC Precious Log: + CardTable entry size: 512 + Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 + +Heap: + garbage-first heap total 0K, used 0K [0x0000000724400000, 0x0000000800000000) + region size 2048K, 0 young (0K), 0 survivors (0K) + Metaspace used 0K, committed 0K, reserved 0K + class space used 0K, committed 0K, reserved 0K + +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom + +Card table byte_map: [0x0000027156130000,0x0000027156810000] _byte_map_base: 0x000002715280e000 + +Marking Bits: (CMBitMap*) 0x00000271411d6c70 + Bits: [0x0000027156810000, 0x0000027159f00000) + +GC Heap History (0 events): +No events + +Dll operation events (1 events): +Event: 0.011 Loaded shared library C:\Program Files\Android\Android Studio\jbr\bin\java.dll + +Deoptimization events (0 events): +No events + +Classes loaded (0 events): +No events + +Classes unloaded (0 events): +No events + +Classes redefined (0 events): +No events + +Internal exceptions (0 events): +No events + +ZGC Phase Switch (0 events): +No events + +VM Operations (0 events): +No events + +Events (0 events): +No events + + +Dynamic libraries: +0x00007ff74da60000 - 0x00007ff74da6a000 C:\Program Files\Android\Android Studio\jbr\bin\java.EXE +0x00007ff9bac50000 - 0x00007ff9bae67000 C:\Windows\SYSTEM32\ntdll.dll +0x00007ff9b9530000 - 0x00007ff9b95f4000 C:\Windows\System32\KERNEL32.DLL +0x00007ff9b82d0000 - 0x00007ff9b8689000 C:\Windows\System32\KERNELBASE.dll +0x00007ff9af480000 - 0x00007ff9af517000 C:\Windows\SYSTEM32\apphelp.dll +0x00007ff9b86c0000 - 0x00007ff9b87d1000 C:\Windows\System32\ucrtbase.dll +0x00007ff9a7710000 - 0x00007ff9a7728000 C:\Program Files\Android\Android Studio\jbr\bin\jli.dll +0x00007ff9a8040000 - 0x00007ff9a805b000 C:\Program Files\Android\Android Studio\jbr\bin\VCRUNTIME140.dll +0x00007ff9ba100000 - 0x00007ff9ba2ae000 C:\Windows\System32\USER32.dll +0x00007ff9895a0000 - 0x00007ff989832000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.4391_none_2715d37f73803e96\COMCTL32.dll +0x00007ff9b8690000 - 0x00007ff9b86b6000 C:\Windows\System32\win32u.dll +0x00007ff9b9fb0000 - 0x00007ff9b9fd9000 C:\Windows\System32\GDI32.dll +0x00007ff9ba6a0000 - 0x00007ff9ba747000 C:\Windows\System32\msvcrt.dll +0x00007ff9b7f20000 - 0x00007ff9b803b000 C:\Windows\System32\gdi32full.dll +0x00007ff9b88a0000 - 0x00007ff9b893a000 C:\Windows\System32\msvcp_win.dll +0x00007ff9ba550000 - 0x00007ff9ba581000 C:\Windows\System32\IMM32.DLL +0x00007ff9aee10000 - 0x00007ff9aee1c000 C:\Program Files\Android\Android Studio\jbr\bin\vcruntime140_1.dll +0x00007ff95ff80000 - 0x00007ff96000d000 C:\Program Files\Android\Android Studio\jbr\bin\msvcp140.dll +0x00007ff900d60000 - 0x00007ff9019dd000 C:\Program Files\Android\Android Studio\jbr\bin\server\jvm.dll +0x00007ff9ba320000 - 0x00007ff9ba3d2000 C:\Windows\System32\ADVAPI32.dll +0x00007ff9b8bb0000 - 0x00007ff9b8c57000 C:\Windows\System32\sechost.dll +0x00007ff9b8040000 - 0x00007ff9b8068000 C:\Windows\System32\bcrypt.dll +0x00007ff9baac0000 - 0x00007ff9babd4000 C:\Windows\System32\RPCRT4.dll +0x00007ff9b8b30000 - 0x00007ff9b8ba1000 C:\Windows\System32\WS2_32.dll +0x00007ff9ad660000 - 0x00007ff9ad694000 C:\Windows\SYSTEM32\WINMM.dll +0x00007ff9b6d70000 - 0x00007ff9b6dbd000 C:\Windows\SYSTEM32\POWRPROF.dll +0x00007ff9a4fc0000 - 0x00007ff9a4fca000 C:\Windows\SYSTEM32\VERSION.dll +0x00007ff9b6d50000 - 0x00007ff9b6d63000 C:\Windows\SYSTEM32\UMPDC.dll +0x00007ff9b7010000 - 0x00007ff9b7028000 C:\Windows\SYSTEM32\kernel.appcore.dll +0x00007ff9ad090000 - 0x00007ff9ad09a000 C:\Program Files\Android\Android Studio\jbr\bin\jimage.dll +0x00007ff9b5790000 - 0x00007ff9b59c2000 C:\Windows\SYSTEM32\DBGHELP.DLL +0x00007ff9b9c20000 - 0x00007ff9b9faf000 C:\Windows\System32\combase.dll +0x00007ff9b9610000 - 0x00007ff9b96e7000 C:\Windows\System32\OLEAUT32.dll +0x00007ff981cc0000 - 0x00007ff981cf2000 C:\Windows\SYSTEM32\dbgcore.DLL +0x00007ff9b8250000 - 0x00007ff9b82cb000 C:\Windows\System32\bcryptPrimitives.dll +0x00007ff98b310000 - 0x00007ff98b32f000 C:\Program Files\Android\Android Studio\jbr\bin\java.dll + +dbghelp: loaded successfully - version: 4.0.5 - missing functions: none +symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Android\Android Studio\jbr\bin;C:\Windows\SYSTEM32;C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.4391_none_2715d37f73803e96;C:\Program Files\Android\Android Studio\jbr\bin\server + +VM Arguments: +java_command: +java_class_path (initial): +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 12 {product} {ergonomic} + uint ConcGCThreads = 3 {product} {ergonomic} + uint G1ConcRefinementThreads = 13 {product} {ergonomic} + size_t G1HeapRegionSize = 2097152 {product} {ergonomic} + uintx GCDrainStackTargetSize = 64 {product} {ergonomic} + size_t InitialHeapSize = 230686720 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 3686793216 {product} {ergonomic} + size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} + size_t MinHeapSize = 8388608 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 7602480 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + size_t SoftMaxHeapSize = 3686793216 {manageable} {ergonomic} + bool UseCompressedOops = true {product lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags foldmultilines=false + #1: stderr all=off uptime,level,tags foldmultilines=false + +Environment Variables: +PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\java8path;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\7\;C:\Users\mso7nueh\AppData\Local\Microsoft\WindowsApps;C:\Users\mso7nueh\flutter\bin;C:\Program Files\tinc;C:\Users\mso7nueh\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\mso7nueh\flutter\bin\mingit\cmd;C:\Users\mso7nueh\flutter\bin\mingit\cmd +USERNAME=mso7nueh +OS=Windows_NT +PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 186 Stepping 2, GenuineIntel +TMP=C:\Users\mso7nueh\AppData\Local\Temp +TEMP=C:\Users\mso7nueh\AppData\Local\Temp + + + + +Periodic native trim disabled + +JNI global refs: +JNI global refs: 0, weak refs: 0 + +JNI global refs memory usage: 0, weak refs: 0 + +Process memory usage: +Resident Set Size: 12556K (0% of 14398328K total physical memory with 425408K free physical memory) + +OOME stack traces (most recent first): +Classloader memory used: + +--------------- S Y S T E M --------------- + +OS: + Windows 11 , 64 bit Build 22621 (10.0.22621.4391) +OS uptime: 3 days 10:18 hours +Hyper-V role detected + +CPU: total 16 (initial active 16) (8 cores per cpu, 2 threads per core) family 6 model 186 stepping 2 microcode 0x4123, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, clwb, hv, serialize, rdtscp, rdpid, fsrm, f16c, cet_ibt, cet_ss +Processor Information for processor 0 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 1 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 2 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 3 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 4 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 5 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 6 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 7 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 8 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 9 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 10 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 11 + Max Mhz: 2600, Current Mhz: 1505, Mhz Limit: 2600 +Processor Information for processor 12 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 13 + Max Mhz: 2600, Current Mhz: 1505, Mhz Limit: 2600 +Processor Information for processor 14 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 +Processor Information for processor 15 + Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 + +Memory: 4k page, system-wide physical 14060M (414M free) +TotalPageFile size 30444M (AvailPageFile size 175M) +current process WorkingSet (physical memory assigned to process): 12M, peak: 12M +current process commit charge ("private bytes"): 70M, peak: 290M + +vm_info: OpenJDK 64-Bit Server VM (21.0.3+-12282718-b509.11) for windows-amd64 JRE (21.0.3+-12282718-b509.11), built on 2024-08-27T17:34:15Z by "builder" with MS VC++ 16.10 / 16.11 (VS2019) + +END. From 3f1c623515a7fa679249240a0fe61af61f5e41b9 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 01:59:10 +0000 Subject: [PATCH 07/18] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20hs=5Ferr=5Fpid27368.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hs_err_pid27368.log | 282 -------------------------------------------- 1 file changed, 282 deletions(-) delete mode 100644 hs_err_pid27368.log diff --git a/hs_err_pid27368.log b/hs_err_pid27368.log deleted file mode 100644 index 7ab5d85e..00000000 --- a/hs_err_pid27368.log +++ /dev/null @@ -1,282 +0,0 @@ -# -# There is insufficient memory for the Java Runtime Environment to continue. -# Native memory allocation (mmap) failed to map 230686720 bytes. Error detail: G1 virtual space -# Possible reasons: -# The system is out of physical RAM or swap space -# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap -# Possible solutions: -# Reduce memory load on the system -# Increase physical memory or swap space -# Check if swap backing store is full -# Decrease Java heap size (-Xmx/-Xms) -# Decrease number of Java threads -# Decrease Java thread stack sizes (-Xss) -# Set larger code cache with -XX:ReservedCodeCacheSize= -# JVM is running with Zero Based Compressed Oops mode in which the Java heap is -# placed in the first 32GB address space. The Java Heap base address is the -# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress -# to set the Java Heap base and to place the Java Heap above 32GB virtual address. -# This output file may be truncated or incomplete. -# -# Out of Memory Error (os_windows.cpp:3815), pid=27368, tid=23684 -# -# JRE version: (21.0.3) (build ) -# Java VM: OpenJDK 64-Bit Server VM (21.0.3+-12282718-b509.11, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) -# No core dump will be written. Minidumps are not enabled by default on client versions of Windows -# - ---------------- S U M M A R Y ------------ - -Command Line: - -Host: 13th Gen Intel(R) Core(TM) i5-13500H, 16 cores, 13G, Windows 11 , 64 bit Build 22621 (10.0.22621.4391) -Time: Mon Nov 11 00:13:50 2024 RTZ 2 (s 11 , 64 bit Build 22621 (10.0.22621.4391) elapsed time: 0.016698 seconds (0d 0h 0m 0s) - ---------------- T H R E A D --------------- - -Current thread (0x0000022ebbde7030): JavaThread "Unknown thread" [_thread_in_vm, id=23684, stack(0x0000007644700000,0x0000007644800000) (1024K)] - -Stack: [0x0000007644700000,0x0000007644800000] -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -V [jvm.dll+0x6cafb9] -V [jvm.dll+0x858523] -V [jvm.dll+0x85aa7e] -V [jvm.dll+0x85b163] -V [jvm.dll+0x27d356] -V [jvm.dll+0x6c7865] -V [jvm.dll+0x6bbd3a] -V [jvm.dll+0x35199b] -V [jvm.dll+0x3595d6] -V [jvm.dll+0x3aa826] -V [jvm.dll+0x3aaaf8] -V [jvm.dll+0x3240bc] -V [jvm.dll+0x324dab] -V [jvm.dll+0x81fd89] -V [jvm.dll+0x3b7c08] -V [jvm.dll+0x80921d] -V [jvm.dll+0x44c05e] -V [jvm.dll+0x44d6b1] -C [jli.dll+0x52ab] -C [ucrtbase.dll+0x29333] -C [KERNEL32.DLL+0x1259d] -C [ntdll.dll+0x5af38] - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x00007ff9018957c8, length=0, elements={ -} - -Java Threads: ( => current thread ) -Total: 0 - -Other Threads: - 0x0000022ebe1863b0 WorkerThread "GC Thread#0" [id=21692, stack(0x0000007644800000,0x0000007644900000) (1024K)] - 0x0000022ebe194f50 ConcurrentGCThread "G1 Main Marker" [id=30396, stack(0x0000007644900000,0x0000007644a00000) (1024K)] - 0x0000022ebe195bc0 WorkerThread "G1 Conc#0" [id=24760, stack(0x0000007644a00000,0x0000007644b00000) (1024K)] - -[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff901097197] -VM state: not at safepoint (not fully initialized) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x00007ff9019021c8] Heap_lock - owner thread: 0x0000022ebbde7030 - -Heap address: 0x0000000724400000, size: 3516 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) mapped at: [0x0000000000000000-0x0000000000000000-0x0000000000000000), size 0, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 1. -Narrow klass base: 0x0000000000000000, Narrow klass shift: 0, Narrow klass range: 0x0 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 - -Heap: - garbage-first heap total 0K, used 0K [0x0000000724400000, 0x0000000800000000) - region size 2048K, 0 young (0K), 0 survivors (0K) - Metaspace used 0K, committed 0K, reserved 0K - class space used 0K, committed 0K, reserved 0K - -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom - -Card table byte_map: [0x0000022ed11c0000,0x0000022ed18a0000] _byte_map_base: 0x0000022ecd89e000 - -Marking Bits: (CMBitMap*) 0x0000022ebe186ab0 - Bits: [0x0000022ed18a0000, 0x0000022ed4f90000) - -GC Heap History (0 events): -No events - -Dll operation events (1 events): -Event: 0.011 Loaded shared library C:\Program Files\Android\Android Studio\jbr\bin\java.dll - -Deoptimization events (0 events): -No events - -Classes loaded (0 events): -No events - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (0 events): -No events - -ZGC Phase Switch (0 events): -No events - -VM Operations (0 events): -No events - -Events (0 events): -No events - - -Dynamic libraries: -0x00007ff74da60000 - 0x00007ff74da6a000 C:\Program Files\Android\Android Studio\jbr\bin\java.EXE -0x00007ff9bac50000 - 0x00007ff9bae67000 C:\Windows\SYSTEM32\ntdll.dll -0x00007ff9b9530000 - 0x00007ff9b95f4000 C:\Windows\System32\KERNEL32.DLL -0x00007ff9b82d0000 - 0x00007ff9b8689000 C:\Windows\System32\KERNELBASE.dll -0x00007ff9af480000 - 0x00007ff9af517000 C:\Windows\SYSTEM32\apphelp.dll -0x00007ff9b86c0000 - 0x00007ff9b87d1000 C:\Windows\System32\ucrtbase.dll -0x00007ff9a8040000 - 0x00007ff9a805b000 C:\Program Files\Android\Android Studio\jbr\bin\VCRUNTIME140.dll -0x00007ff9a7710000 - 0x00007ff9a7728000 C:\Program Files\Android\Android Studio\jbr\bin\jli.dll -0x00007ff9ba100000 - 0x00007ff9ba2ae000 C:\Windows\System32\USER32.dll -0x00007ff9b8690000 - 0x00007ff9b86b6000 C:\Windows\System32\win32u.dll -0x00007ff9b9fb0000 - 0x00007ff9b9fd9000 C:\Windows\System32\GDI32.dll -0x00007ff9895a0000 - 0x00007ff989832000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.4391_none_2715d37f73803e96\COMCTL32.dll -0x00007ff9b7f20000 - 0x00007ff9b803b000 C:\Windows\System32\gdi32full.dll -0x00007ff9ba6a0000 - 0x00007ff9ba747000 C:\Windows\System32\msvcrt.dll -0x00007ff9b88a0000 - 0x00007ff9b893a000 C:\Windows\System32\msvcp_win.dll -0x00007ff9ba550000 - 0x00007ff9ba581000 C:\Windows\System32\IMM32.DLL -0x00007ff9aee10000 - 0x00007ff9aee1c000 C:\Program Files\Android\Android Studio\jbr\bin\vcruntime140_1.dll -0x00007ff95ff80000 - 0x00007ff96000d000 C:\Program Files\Android\Android Studio\jbr\bin\msvcp140.dll -0x00007ff900d60000 - 0x00007ff9019dd000 C:\Program Files\Android\Android Studio\jbr\bin\server\jvm.dll -0x00007ff9ba320000 - 0x00007ff9ba3d2000 C:\Windows\System32\ADVAPI32.dll -0x00007ff9b8bb0000 - 0x00007ff9b8c57000 C:\Windows\System32\sechost.dll -0x00007ff9b8040000 - 0x00007ff9b8068000 C:\Windows\System32\bcrypt.dll -0x00007ff9baac0000 - 0x00007ff9babd4000 C:\Windows\System32\RPCRT4.dll -0x00007ff9b8b30000 - 0x00007ff9b8ba1000 C:\Windows\System32\WS2_32.dll -0x00007ff9b6d70000 - 0x00007ff9b6dbd000 C:\Windows\SYSTEM32\POWRPROF.dll -0x00007ff9a4fc0000 - 0x00007ff9a4fca000 C:\Windows\SYSTEM32\VERSION.dll -0x00007ff9ad660000 - 0x00007ff9ad694000 C:\Windows\SYSTEM32\WINMM.dll -0x00007ff9b6d50000 - 0x00007ff9b6d63000 C:\Windows\SYSTEM32\UMPDC.dll -0x00007ff9b7010000 - 0x00007ff9b7028000 C:\Windows\SYSTEM32\kernel.appcore.dll -0x00007ff9ad090000 - 0x00007ff9ad09a000 C:\Program Files\Android\Android Studio\jbr\bin\jimage.dll -0x00007ff9b5790000 - 0x00007ff9b59c2000 C:\Windows\SYSTEM32\DBGHELP.DLL -0x00007ff9b9c20000 - 0x00007ff9b9faf000 C:\Windows\System32\combase.dll -0x00007ff9b9610000 - 0x00007ff9b96e7000 C:\Windows\System32\OLEAUT32.dll -0x00007ff981cc0000 - 0x00007ff981cf2000 C:\Windows\SYSTEM32\dbgcore.DLL -0x00007ff9b8250000 - 0x00007ff9b82cb000 C:\Windows\System32\bcryptPrimitives.dll -0x00007ff98b310000 - 0x00007ff98b32f000 C:\Program Files\Android\Android Studio\jbr\bin\java.dll - -dbghelp: loaded successfully - version: 4.0.5 - missing functions: none -symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Android\Android Studio\jbr\bin;C:\Windows\SYSTEM32;C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.4391_none_2715d37f73803e96;C:\Program Files\Android\Android Studio\jbr\bin\server - -VM Arguments: -java_command: -java_class_path (initial): -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 12 {product} {ergonomic} - uint ConcGCThreads = 3 {product} {ergonomic} - uint G1ConcRefinementThreads = 13 {product} {ergonomic} - size_t G1HeapRegionSize = 2097152 {product} {ergonomic} - uintx GCDrainStackTargetSize = 64 {product} {ergonomic} - size_t InitialHeapSize = 230686720 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 3686793216 {product} {ergonomic} - size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 7602480 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 3686793216 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Environment Variables: -PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\java8path;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\7\;C:\Users\mso7nueh\AppData\Local\Microsoft\WindowsApps;C:\Users\mso7nueh\flutter\bin;C:\Program Files\tinc;C:\Users\mso7nueh\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\mso7nueh\flutter\bin\mingit\cmd;C:\Users\mso7nueh\flutter\bin\mingit\cmd -USERNAME=mso7nueh -OS=Windows_NT -PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 186 Stepping 2, GenuineIntel -TMP=C:\Users\mso7nueh\AppData\Local\Temp -TEMP=C:\Users\mso7nueh\AppData\Local\Temp - - - - -Periodic native trim disabled - -JNI global refs: -JNI global refs: 0, weak refs: 0 - -JNI global refs memory usage: 0, weak refs: 0 - -Process memory usage: -Resident Set Size: 12608K (0% of 14398328K total physical memory with 393512K free physical memory) - -OOME stack traces (most recent first): -Classloader memory used: - ---------------- S Y S T E M --------------- - -OS: - Windows 11 , 64 bit Build 22621 (10.0.22621.4391) -OS uptime: 3 days 10:18 hours -Hyper-V role detected - -CPU: total 16 (initial active 16) (8 cores per cpu, 2 threads per core) family 6 model 186 stepping 2 microcode 0x4123, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, clwb, hv, serialize, rdtscp, rdpid, fsrm, f16c, cet_ibt, cet_ss -Processor Information for processor 0 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 1 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 2 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 3 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 4 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 5 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 6 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 7 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 8 - Max Mhz: 2600, Current Mhz: 1505, Mhz Limit: 2600 -Processor Information for processor 9 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 10 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 11 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 12 - Max Mhz: 2600, Current Mhz: 1505, Mhz Limit: 2600 -Processor Information for processor 13 - Max Mhz: 2600, Current Mhz: 1505, Mhz Limit: 2600 -Processor Information for processor 14 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 15 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 - -Memory: 4k page, system-wide physical 14060M (384M free) -TotalPageFile size 30444M (AvailPageFile size 147M) -current process WorkingSet (physical memory assigned to process): 12M, peak: 12M -current process commit charge ("private bytes"): 70M, peak: 290M - -vm_info: OpenJDK 64-Bit Server VM (21.0.3+-12282718-b509.11) for windows-amd64 JRE (21.0.3+-12282718-b509.11), built on 2024-08-27T17:34:15Z by "builder" with MS VC++ 16.10 / 16.11 (VS2019) - -END. From cca5c28b73c651d08385a4e5a4f5312f5a584ea4 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 01:59:18 +0000 Subject: [PATCH 08/18] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20hs=5Ferr=5Fpid28300.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hs_err_pid28300.log | 282 -------------------------------------------- 1 file changed, 282 deletions(-) delete mode 100644 hs_err_pid28300.log diff --git a/hs_err_pid28300.log b/hs_err_pid28300.log deleted file mode 100644 index 4d94482c..00000000 --- a/hs_err_pid28300.log +++ /dev/null @@ -1,282 +0,0 @@ -# -# There is insufficient memory for the Java Runtime Environment to continue. -# Native memory allocation (mmap) failed to map 230686720 bytes. Error detail: G1 virtual space -# Possible reasons: -# The system is out of physical RAM or swap space -# This process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap -# Possible solutions: -# Reduce memory load on the system -# Increase physical memory or swap space -# Check if swap backing store is full -# Decrease Java heap size (-Xmx/-Xms) -# Decrease number of Java threads -# Decrease Java thread stack sizes (-Xss) -# Set larger code cache with -XX:ReservedCodeCacheSize= -# JVM is running with Zero Based Compressed Oops mode in which the Java heap is -# placed in the first 32GB address space. The Java Heap base address is the -# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress -# to set the Java Heap base and to place the Java Heap above 32GB virtual address. -# This output file may be truncated or incomplete. -# -# Out of Memory Error (os_windows.cpp:3815), pid=28300, tid=3288 -# -# JRE version: (21.0.3) (build ) -# Java VM: OpenJDK 64-Bit Server VM (21.0.3+-12282718-b509.11, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) -# No core dump will be written. Minidumps are not enabled by default on client versions of Windows -# - ---------------- S U M M A R Y ------------ - -Command Line: - -Host: 13th Gen Intel(R) Core(TM) i5-13500H, 16 cores, 13G, Windows 11 , 64 bit Build 22621 (10.0.22621.4391) -Time: Mon Nov 11 00:13:50 2024 RTZ 2 (s 11 , 64 bit Build 22621 (10.0.22621.4391) elapsed time: 0.014976 seconds (0d 0h 0m 0s) - ---------------- T H R E A D --------------- - -Current thread (0x0000027140fb7110): JavaThread "Unknown thread" [_thread_in_vm, id=3288, stack(0x000000cfeca00000,0x000000cfecb00000) (1024K)] - -Stack: [0x000000cfeca00000,0x000000cfecb00000] -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -V [jvm.dll+0x6cafb9] -V [jvm.dll+0x858523] -V [jvm.dll+0x85aa7e] -V [jvm.dll+0x85b163] -V [jvm.dll+0x27d356] -V [jvm.dll+0x6c7865] -V [jvm.dll+0x6bbd3a] -V [jvm.dll+0x35199b] -V [jvm.dll+0x3595d6] -V [jvm.dll+0x3aa826] -V [jvm.dll+0x3aaaf8] -V [jvm.dll+0x3240bc] -V [jvm.dll+0x324dab] -V [jvm.dll+0x81fd89] -V [jvm.dll+0x3b7c08] -V [jvm.dll+0x80921d] -V [jvm.dll+0x44c05e] -V [jvm.dll+0x44d6b1] -C [jli.dll+0x52ab] -C [ucrtbase.dll+0x29333] -C [KERNEL32.DLL+0x1259d] -C [ntdll.dll+0x5af38] - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x00007ff9018957c8, length=0, elements={ -} - -Java Threads: ( => current thread ) -Total: 0 - -Other Threads: - 0x00000271411d6570 WorkerThread "GC Thread#0" [id=23492, stack(0x000000cfecb00000,0x000000cfecc00000) (1024K)] - 0x00000271411e5280 ConcurrentGCThread "G1 Main Marker" [id=26024, stack(0x000000cfecc00000,0x000000cfecd00000) (1024K)] - 0x00000271411e6520 WorkerThread "G1 Conc#0" [id=6216, stack(0x000000cfecd00000,0x000000cfece00000) (1024K)] - -[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff901097197] -VM state: not at safepoint (not fully initialized) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x00007ff9019021c8] Heap_lock - owner thread: 0x0000027140fb7110 - -Heap address: 0x0000000724400000, size: 3516 MB, Compressed Oops mode: Zero based, Oop shift amount: 3 - -CDS archive(s) mapped at: [0x0000000000000000-0x0000000000000000-0x0000000000000000), size 0, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 1. -Narrow klass base: 0x0000000000000000, Narrow klass shift: 0, Narrow klass range: 0x0 - -GC Precious Log: - CardTable entry size: 512 - Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 3686 Howl Bitmap #cards 512 size 80 coarsen threshold 460 Card regions per heap region 1 cards per card region 4096 - -Heap: - garbage-first heap total 0K, used 0K [0x0000000724400000, 0x0000000800000000) - region size 2048K, 0 young (0K), 0 survivors (0K) - Metaspace used 0K, committed 0K, reserved 0K - class space used 0K, committed 0K, reserved 0K - -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, TAMS=top-at-mark-start, PB=parsable bottom - -Card table byte_map: [0x0000027156130000,0x0000027156810000] _byte_map_base: 0x000002715280e000 - -Marking Bits: (CMBitMap*) 0x00000271411d6c70 - Bits: [0x0000027156810000, 0x0000027159f00000) - -GC Heap History (0 events): -No events - -Dll operation events (1 events): -Event: 0.011 Loaded shared library C:\Program Files\Android\Android Studio\jbr\bin\java.dll - -Deoptimization events (0 events): -No events - -Classes loaded (0 events): -No events - -Classes unloaded (0 events): -No events - -Classes redefined (0 events): -No events - -Internal exceptions (0 events): -No events - -ZGC Phase Switch (0 events): -No events - -VM Operations (0 events): -No events - -Events (0 events): -No events - - -Dynamic libraries: -0x00007ff74da60000 - 0x00007ff74da6a000 C:\Program Files\Android\Android Studio\jbr\bin\java.EXE -0x00007ff9bac50000 - 0x00007ff9bae67000 C:\Windows\SYSTEM32\ntdll.dll -0x00007ff9b9530000 - 0x00007ff9b95f4000 C:\Windows\System32\KERNEL32.DLL -0x00007ff9b82d0000 - 0x00007ff9b8689000 C:\Windows\System32\KERNELBASE.dll -0x00007ff9af480000 - 0x00007ff9af517000 C:\Windows\SYSTEM32\apphelp.dll -0x00007ff9b86c0000 - 0x00007ff9b87d1000 C:\Windows\System32\ucrtbase.dll -0x00007ff9a7710000 - 0x00007ff9a7728000 C:\Program Files\Android\Android Studio\jbr\bin\jli.dll -0x00007ff9a8040000 - 0x00007ff9a805b000 C:\Program Files\Android\Android Studio\jbr\bin\VCRUNTIME140.dll -0x00007ff9ba100000 - 0x00007ff9ba2ae000 C:\Windows\System32\USER32.dll -0x00007ff9895a0000 - 0x00007ff989832000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.4391_none_2715d37f73803e96\COMCTL32.dll -0x00007ff9b8690000 - 0x00007ff9b86b6000 C:\Windows\System32\win32u.dll -0x00007ff9b9fb0000 - 0x00007ff9b9fd9000 C:\Windows\System32\GDI32.dll -0x00007ff9ba6a0000 - 0x00007ff9ba747000 C:\Windows\System32\msvcrt.dll -0x00007ff9b7f20000 - 0x00007ff9b803b000 C:\Windows\System32\gdi32full.dll -0x00007ff9b88a0000 - 0x00007ff9b893a000 C:\Windows\System32\msvcp_win.dll -0x00007ff9ba550000 - 0x00007ff9ba581000 C:\Windows\System32\IMM32.DLL -0x00007ff9aee10000 - 0x00007ff9aee1c000 C:\Program Files\Android\Android Studio\jbr\bin\vcruntime140_1.dll -0x00007ff95ff80000 - 0x00007ff96000d000 C:\Program Files\Android\Android Studio\jbr\bin\msvcp140.dll -0x00007ff900d60000 - 0x00007ff9019dd000 C:\Program Files\Android\Android Studio\jbr\bin\server\jvm.dll -0x00007ff9ba320000 - 0x00007ff9ba3d2000 C:\Windows\System32\ADVAPI32.dll -0x00007ff9b8bb0000 - 0x00007ff9b8c57000 C:\Windows\System32\sechost.dll -0x00007ff9b8040000 - 0x00007ff9b8068000 C:\Windows\System32\bcrypt.dll -0x00007ff9baac0000 - 0x00007ff9babd4000 C:\Windows\System32\RPCRT4.dll -0x00007ff9b8b30000 - 0x00007ff9b8ba1000 C:\Windows\System32\WS2_32.dll -0x00007ff9ad660000 - 0x00007ff9ad694000 C:\Windows\SYSTEM32\WINMM.dll -0x00007ff9b6d70000 - 0x00007ff9b6dbd000 C:\Windows\SYSTEM32\POWRPROF.dll -0x00007ff9a4fc0000 - 0x00007ff9a4fca000 C:\Windows\SYSTEM32\VERSION.dll -0x00007ff9b6d50000 - 0x00007ff9b6d63000 C:\Windows\SYSTEM32\UMPDC.dll -0x00007ff9b7010000 - 0x00007ff9b7028000 C:\Windows\SYSTEM32\kernel.appcore.dll -0x00007ff9ad090000 - 0x00007ff9ad09a000 C:\Program Files\Android\Android Studio\jbr\bin\jimage.dll -0x00007ff9b5790000 - 0x00007ff9b59c2000 C:\Windows\SYSTEM32\DBGHELP.DLL -0x00007ff9b9c20000 - 0x00007ff9b9faf000 C:\Windows\System32\combase.dll -0x00007ff9b9610000 - 0x00007ff9b96e7000 C:\Windows\System32\OLEAUT32.dll -0x00007ff981cc0000 - 0x00007ff981cf2000 C:\Windows\SYSTEM32\dbgcore.DLL -0x00007ff9b8250000 - 0x00007ff9b82cb000 C:\Windows\System32\bcryptPrimitives.dll -0x00007ff98b310000 - 0x00007ff98b32f000 C:\Program Files\Android\Android Studio\jbr\bin\java.dll - -dbghelp: loaded successfully - version: 4.0.5 - missing functions: none -symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Android\Android Studio\jbr\bin;C:\Windows\SYSTEM32;C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.4391_none_2715d37f73803e96;C:\Program Files\Android\Android Studio\jbr\bin\server - -VM Arguments: -java_command: -java_class_path (initial): -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 12 {product} {ergonomic} - uint ConcGCThreads = 3 {product} {ergonomic} - uint G1ConcRefinementThreads = 13 {product} {ergonomic} - size_t G1HeapRegionSize = 2097152 {product} {ergonomic} - uintx GCDrainStackTargetSize = 64 {product} {ergonomic} - size_t InitialHeapSize = 230686720 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 3686793216 {product} {ergonomic} - size_t MinHeapDeltaBytes = 2097152 {product} {ergonomic} - size_t MinHeapSize = 8388608 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 7602480 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122027880 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - size_t SoftMaxHeapSize = 3686793216 {manageable} {ergonomic} - bool UseCompressedOops = true {product lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags foldmultilines=false - #1: stderr all=off uptime,level,tags foldmultilines=false - -Environment Variables: -PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\java8path;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\7\;C:\Users\mso7nueh\AppData\Local\Microsoft\WindowsApps;C:\Users\mso7nueh\flutter\bin;C:\Program Files\tinc;C:\Users\mso7nueh\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\mso7nueh\flutter\bin\mingit\cmd;C:\Users\mso7nueh\flutter\bin\mingit\cmd -USERNAME=mso7nueh -OS=Windows_NT -PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 186 Stepping 2, GenuineIntel -TMP=C:\Users\mso7nueh\AppData\Local\Temp -TEMP=C:\Users\mso7nueh\AppData\Local\Temp - - - - -Periodic native trim disabled - -JNI global refs: -JNI global refs: 0, weak refs: 0 - -JNI global refs memory usage: 0, weak refs: 0 - -Process memory usage: -Resident Set Size: 12556K (0% of 14398328K total physical memory with 425408K free physical memory) - -OOME stack traces (most recent first): -Classloader memory used: - ---------------- S Y S T E M --------------- - -OS: - Windows 11 , 64 bit Build 22621 (10.0.22621.4391) -OS uptime: 3 days 10:18 hours -Hyper-V role detected - -CPU: total 16 (initial active 16) (8 cores per cpu, 2 threads per core) family 6 model 186 stepping 2 microcode 0x4123, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, sha, fma, vzeroupper, clflush, clflushopt, clwb, hv, serialize, rdtscp, rdpid, fsrm, f16c, cet_ibt, cet_ss -Processor Information for processor 0 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 1 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 2 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 3 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 4 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 5 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 6 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 7 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 8 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 9 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 10 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 11 - Max Mhz: 2600, Current Mhz: 1505, Mhz Limit: 2600 -Processor Information for processor 12 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 13 - Max Mhz: 2600, Current Mhz: 1505, Mhz Limit: 2600 -Processor Information for processor 14 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 -Processor Information for processor 15 - Max Mhz: 2600, Current Mhz: 2600, Mhz Limit: 2600 - -Memory: 4k page, system-wide physical 14060M (414M free) -TotalPageFile size 30444M (AvailPageFile size 175M) -current process WorkingSet (physical memory assigned to process): 12M, peak: 12M -current process commit charge ("private bytes"): 70M, peak: 290M - -vm_info: OpenJDK 64-Bit Server VM (21.0.3+-12282718-b509.11) for windows-amd64 JRE (21.0.3+-12282718-b509.11), built on 2024-08-27T17:34:15Z by "builder" with MS VC++ 16.10 / 16.11 (VS2019) - -END. From d824cbc58e71d8ae136f0dbe097b6ef31149d080 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 10:29:53 +0300 Subject: [PATCH 09/18] feat(diary): update gradle plugin --- android/.idea/caches/deviceStreaming.xml | 329 +++++++++++++++++++++++ android/.idea/gradle.xml | 14 + android/.idea/migrations.xml | 10 + android/.idea/misc.xml | 9 + android/.idea/modules.xml | 8 + android/.idea/modules/android.iml | 9 + android/.idea/runConfigurations.xml | 17 ++ android/.idea/vcs.xml | 6 + android/.idea/workspace.xml | 65 +++++ android/app/build.gradle | 2 +- android/settings.gradle | 4 +- 11 files changed, 470 insertions(+), 3 deletions(-) create mode 100644 android/.idea/caches/deviceStreaming.xml create mode 100644 android/.idea/gradle.xml create mode 100644 android/.idea/migrations.xml create mode 100644 android/.idea/misc.xml create mode 100644 android/.idea/modules.xml create mode 100644 android/.idea/modules/android.iml create mode 100644 android/.idea/runConfigurations.xml create mode 100644 android/.idea/vcs.xml create mode 100644 android/.idea/workspace.xml diff --git a/android/.idea/caches/deviceStreaming.xml b/android/.idea/caches/deviceStreaming.xml new file mode 100644 index 00000000..5a2f8669 --- /dev/null +++ b/android/.idea/caches/deviceStreaming.xml @@ -0,0 +1,329 @@ + + + + + + \ No newline at end of file diff --git a/android/.idea/gradle.xml b/android/.idea/gradle.xml new file mode 100644 index 00000000..efe09167 --- /dev/null +++ b/android/.idea/gradle.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/android/.idea/migrations.xml b/android/.idea/migrations.xml new file mode 100644 index 00000000..f8051a6f --- /dev/null +++ b/android/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml new file mode 100644 index 00000000..48725873 --- /dev/null +++ b/android/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/android/.idea/modules.xml b/android/.idea/modules.xml new file mode 100644 index 00000000..bf609e00 --- /dev/null +++ b/android/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/android/.idea/modules/android.iml b/android/.idea/modules/android.iml new file mode 100644 index 00000000..2af55b99 --- /dev/null +++ b/android/.idea/modules/android.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/runConfigurations.xml b/android/.idea/runConfigurations.xml new file mode 100644 index 00000000..16660f1d --- /dev/null +++ b/android/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/android/.idea/vcs.xml b/android/.idea/vcs.xml new file mode 100644 index 00000000..6c0b8635 --- /dev/null +++ b/android/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/android/.idea/workspace.xml b/android/.idea/workspace.xml new file mode 100644 index 00000000..df82a64e --- /dev/null +++ b/android/.idea/workspace.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 1731295514828 + + + + \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index e5218dce..26791c12 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -7,7 +7,7 @@ plugins { android { namespace = "com.eatvioapp.app" compileSdk = flutter.compileSdkVersion - ndkVersion = "28.0.12433566" + ndkVersion = flutter.ndkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_21 diff --git a/android/settings.gradle b/android/settings.gradle index b5e1b3f5..42a51c65 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -18,8 +18,8 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.3.2" apply false - id "org.jetbrains.kotlin.android" version "2.0.20" apply false + id "com.android.application" version "8.7.2" apply false + id "org.jetbrains.kotlin.android" version "2.0.21" apply false } include ":app" From bc8cff2a55429e12429d6285e307ad36af938c75 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 13:29:05 +0300 Subject: [PATCH 10/18] feat(diary): chart update --- .../diary/models/nutrition_model.dart | 27 ++ .../diary/models/nutrition_model.freezed.dart | 437 ++++++++++++++++++ .../diary/models/nutrition_model.g.dart | 40 ++ .../diary/presentation/bloc/diary_cubit.dart | 6 + .../diary/presentation/bloc/diary_state.dart | 2 + .../bloc/diary_state.freezed.dart | 91 ++-- .../presentation/pages/diary_screen.dart | 178 +++++-- .../widgets/satiety_rating_widget.dart | 12 +- .../diary/repositories/diary_repository.dart | 9 +- .../diary/services/diary_service.dart | 6 + .../diary/services/diary_service.g.dart | 33 ++ pubspec.yaml | 1 + 12 files changed, 760 insertions(+), 82 deletions(-) create mode 100644 lib/features/diary/models/nutrition_model.dart create mode 100644 lib/features/diary/models/nutrition_model.freezed.dart create mode 100644 lib/features/diary/models/nutrition_model.g.dart diff --git a/lib/features/diary/models/nutrition_model.dart b/lib/features/diary/models/nutrition_model.dart new file mode 100644 index 00000000..73103842 --- /dev/null +++ b/lib/features/diary/models/nutrition_model.dart @@ -0,0 +1,27 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'nutrition_model.freezed.dart'; + +part 'nutrition_model.g.dart'; + +@freezed +class NutritionDataModel with _$NutritionDataModel { + const factory NutritionDataModel({ + required NutritionModel dailyNutritionIntake, + required NutritionModel dailyNutritionRecommendation, + }) = _NutritionDataModel; + + factory NutritionDataModel.fromJson(Map json) => _$NutritionDataModelFromJson(json); +} + +@freezed +class NutritionModel with _$NutritionModel { + const factory NutritionModel({ + required double energy, + required double proteins, + required double fats, + required double carbohydrates, + }) = _NutritionModel; + + factory NutritionModel.fromJson(Map json) => _$NutritionModelFromJson(json); +} diff --git a/lib/features/diary/models/nutrition_model.freezed.dart b/lib/features/diary/models/nutrition_model.freezed.dart new file mode 100644 index 00000000..46da50b5 --- /dev/null +++ b/lib/features/diary/models/nutrition_model.freezed.dart @@ -0,0 +1,437 @@ +// 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 'nutrition_model.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +NutritionDataModel _$NutritionDataModelFromJson(Map json) { + return _NutritionDataModel.fromJson(json); +} + +/// @nodoc +mixin _$NutritionDataModel { + NutritionModel get dailyNutritionIntake => throw _privateConstructorUsedError; + NutritionModel get dailyNutritionRecommendation => + throw _privateConstructorUsedError; + + /// Serializes this NutritionDataModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NutritionDataModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NutritionDataModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NutritionDataModelCopyWith<$Res> { + factory $NutritionDataModelCopyWith( + NutritionDataModel value, $Res Function(NutritionDataModel) then) = + _$NutritionDataModelCopyWithImpl<$Res, NutritionDataModel>; + @useResult + $Res call( + {NutritionModel dailyNutritionIntake, + NutritionModel dailyNutritionRecommendation}); + + $NutritionModelCopyWith<$Res> get dailyNutritionIntake; + $NutritionModelCopyWith<$Res> get dailyNutritionRecommendation; +} + +/// @nodoc +class _$NutritionDataModelCopyWithImpl<$Res, $Val extends NutritionDataModel> + implements $NutritionDataModelCopyWith<$Res> { + _$NutritionDataModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NutritionDataModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? dailyNutritionIntake = null, + Object? dailyNutritionRecommendation = null, + }) { + return _then(_value.copyWith( + dailyNutritionIntake: null == dailyNutritionIntake + ? _value.dailyNutritionIntake + : dailyNutritionIntake // ignore: cast_nullable_to_non_nullable + as NutritionModel, + dailyNutritionRecommendation: null == dailyNutritionRecommendation + ? _value.dailyNutritionRecommendation + : dailyNutritionRecommendation // ignore: cast_nullable_to_non_nullable + as NutritionModel, + ) as $Val); + } + + /// Create a copy of NutritionDataModel + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $NutritionModelCopyWith<$Res> get dailyNutritionIntake { + return $NutritionModelCopyWith<$Res>(_value.dailyNutritionIntake, (value) { + return _then(_value.copyWith(dailyNutritionIntake: value) as $Val); + }); + } + + /// Create a copy of NutritionDataModel + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $NutritionModelCopyWith<$Res> get dailyNutritionRecommendation { + return $NutritionModelCopyWith<$Res>(_value.dailyNutritionRecommendation, + (value) { + return _then( + _value.copyWith(dailyNutritionRecommendation: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$NutritionDataModelImplCopyWith<$Res> + implements $NutritionDataModelCopyWith<$Res> { + factory _$$NutritionDataModelImplCopyWith(_$NutritionDataModelImpl value, + $Res Function(_$NutritionDataModelImpl) then) = + __$$NutritionDataModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {NutritionModel dailyNutritionIntake, + NutritionModel dailyNutritionRecommendation}); + + @override + $NutritionModelCopyWith<$Res> get dailyNutritionIntake; + @override + $NutritionModelCopyWith<$Res> get dailyNutritionRecommendation; +} + +/// @nodoc +class __$$NutritionDataModelImplCopyWithImpl<$Res> + extends _$NutritionDataModelCopyWithImpl<$Res, _$NutritionDataModelImpl> + implements _$$NutritionDataModelImplCopyWith<$Res> { + __$$NutritionDataModelImplCopyWithImpl(_$NutritionDataModelImpl _value, + $Res Function(_$NutritionDataModelImpl) _then) + : super(_value, _then); + + /// Create a copy of NutritionDataModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? dailyNutritionIntake = null, + Object? dailyNutritionRecommendation = null, + }) { + return _then(_$NutritionDataModelImpl( + dailyNutritionIntake: null == dailyNutritionIntake + ? _value.dailyNutritionIntake + : dailyNutritionIntake // ignore: cast_nullable_to_non_nullable + as NutritionModel, + dailyNutritionRecommendation: null == dailyNutritionRecommendation + ? _value.dailyNutritionRecommendation + : dailyNutritionRecommendation // ignore: cast_nullable_to_non_nullable + as NutritionModel, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NutritionDataModelImpl implements _NutritionDataModel { + const _$NutritionDataModelImpl( + {required this.dailyNutritionIntake, + required this.dailyNutritionRecommendation}); + + factory _$NutritionDataModelImpl.fromJson(Map json) => + _$$NutritionDataModelImplFromJson(json); + + @override + final NutritionModel dailyNutritionIntake; + @override + final NutritionModel dailyNutritionRecommendation; + + @override + String toString() { + return 'NutritionDataModel(dailyNutritionIntake: $dailyNutritionIntake, dailyNutritionRecommendation: $dailyNutritionRecommendation)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NutritionDataModelImpl && + (identical(other.dailyNutritionIntake, dailyNutritionIntake) || + other.dailyNutritionIntake == dailyNutritionIntake) && + (identical(other.dailyNutritionRecommendation, + dailyNutritionRecommendation) || + other.dailyNutritionRecommendation == + dailyNutritionRecommendation)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, dailyNutritionIntake, dailyNutritionRecommendation); + + /// Create a copy of NutritionDataModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NutritionDataModelImplCopyWith<_$NutritionDataModelImpl> get copyWith => + __$$NutritionDataModelImplCopyWithImpl<_$NutritionDataModelImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$NutritionDataModelImplToJson( + this, + ); + } +} + +abstract class _NutritionDataModel implements NutritionDataModel { + const factory _NutritionDataModel( + {required final NutritionModel dailyNutritionIntake, + required final NutritionModel dailyNutritionRecommendation}) = + _$NutritionDataModelImpl; + + factory _NutritionDataModel.fromJson(Map json) = + _$NutritionDataModelImpl.fromJson; + + @override + NutritionModel get dailyNutritionIntake; + @override + NutritionModel get dailyNutritionRecommendation; + + /// Create a copy of NutritionDataModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NutritionDataModelImplCopyWith<_$NutritionDataModelImpl> get copyWith => + throw _privateConstructorUsedError; +} + +NutritionModel _$NutritionModelFromJson(Map json) { + return _NutritionModel.fromJson(json); +} + +/// @nodoc +mixin _$NutritionModel { + double get energy => throw _privateConstructorUsedError; + double get proteins => throw _privateConstructorUsedError; + double get fats => throw _privateConstructorUsedError; + double get carbohydrates => throw _privateConstructorUsedError; + + /// Serializes this NutritionModel to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of NutritionModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NutritionModelCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $NutritionModelCopyWith<$Res> { + factory $NutritionModelCopyWith( + NutritionModel value, $Res Function(NutritionModel) then) = + _$NutritionModelCopyWithImpl<$Res, NutritionModel>; + @useResult + $Res call( + {double energy, double proteins, double fats, double carbohydrates}); +} + +/// @nodoc +class _$NutritionModelCopyWithImpl<$Res, $Val extends NutritionModel> + implements $NutritionModelCopyWith<$Res> { + _$NutritionModelCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of NutritionModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? energy = null, + Object? proteins = null, + Object? fats = null, + Object? carbohydrates = null, + }) { + return _then(_value.copyWith( + energy: null == energy + ? _value.energy + : energy // ignore: cast_nullable_to_non_nullable + as double, + proteins: null == proteins + ? _value.proteins + : proteins // ignore: cast_nullable_to_non_nullable + as double, + fats: null == fats + ? _value.fats + : fats // ignore: cast_nullable_to_non_nullable + as double, + carbohydrates: null == carbohydrates + ? _value.carbohydrates + : carbohydrates // ignore: cast_nullable_to_non_nullable + as double, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$NutritionModelImplCopyWith<$Res> + implements $NutritionModelCopyWith<$Res> { + factory _$$NutritionModelImplCopyWith(_$NutritionModelImpl value, + $Res Function(_$NutritionModelImpl) then) = + __$$NutritionModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {double energy, double proteins, double fats, double carbohydrates}); +} + +/// @nodoc +class __$$NutritionModelImplCopyWithImpl<$Res> + extends _$NutritionModelCopyWithImpl<$Res, _$NutritionModelImpl> + implements _$$NutritionModelImplCopyWith<$Res> { + __$$NutritionModelImplCopyWithImpl( + _$NutritionModelImpl _value, $Res Function(_$NutritionModelImpl) _then) + : super(_value, _then); + + /// Create a copy of NutritionModel + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? energy = null, + Object? proteins = null, + Object? fats = null, + Object? carbohydrates = null, + }) { + return _then(_$NutritionModelImpl( + energy: null == energy + ? _value.energy + : energy // ignore: cast_nullable_to_non_nullable + as double, + proteins: null == proteins + ? _value.proteins + : proteins // ignore: cast_nullable_to_non_nullable + as double, + fats: null == fats + ? _value.fats + : fats // ignore: cast_nullable_to_non_nullable + as double, + carbohydrates: null == carbohydrates + ? _value.carbohydrates + : carbohydrates // ignore: cast_nullable_to_non_nullable + as double, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$NutritionModelImpl implements _NutritionModel { + const _$NutritionModelImpl( + {required this.energy, + required this.proteins, + required this.fats, + required this.carbohydrates}); + + factory _$NutritionModelImpl.fromJson(Map json) => + _$$NutritionModelImplFromJson(json); + + @override + final double energy; + @override + final double proteins; + @override + final double fats; + @override + final double carbohydrates; + + @override + String toString() { + return 'NutritionModel(energy: $energy, proteins: $proteins, fats: $fats, carbohydrates: $carbohydrates)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NutritionModelImpl && + (identical(other.energy, energy) || other.energy == energy) && + (identical(other.proteins, proteins) || + other.proteins == proteins) && + (identical(other.fats, fats) || other.fats == fats) && + (identical(other.carbohydrates, carbohydrates) || + other.carbohydrates == carbohydrates)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => + Object.hash(runtimeType, energy, proteins, fats, carbohydrates); + + /// Create a copy of NutritionModel + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NutritionModelImplCopyWith<_$NutritionModelImpl> get copyWith => + __$$NutritionModelImplCopyWithImpl<_$NutritionModelImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$NutritionModelImplToJson( + this, + ); + } +} + +abstract class _NutritionModel implements NutritionModel { + const factory _NutritionModel( + {required final double energy, + required final double proteins, + required final double fats, + required final double carbohydrates}) = _$NutritionModelImpl; + + factory _NutritionModel.fromJson(Map json) = + _$NutritionModelImpl.fromJson; + + @override + double get energy; + @override + double get proteins; + @override + double get fats; + @override + double get carbohydrates; + + /// Create a copy of NutritionModel + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NutritionModelImplCopyWith<_$NutritionModelImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/features/diary/models/nutrition_model.g.dart b/lib/features/diary/models/nutrition_model.g.dart new file mode 100644 index 00000000..6ecd533c --- /dev/null +++ b/lib/features/diary/models/nutrition_model.g.dart @@ -0,0 +1,40 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'nutrition_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$NutritionDataModelImpl _$$NutritionDataModelImplFromJson( + Map json) => + _$NutritionDataModelImpl( + dailyNutritionIntake: NutritionModel.fromJson( + json['dailyNutritionIntake'] as Map), + dailyNutritionRecommendation: NutritionModel.fromJson( + json['dailyNutritionRecommendation'] as Map), + ); + +Map _$$NutritionDataModelImplToJson( + _$NutritionDataModelImpl instance) => + { + 'dailyNutritionIntake': instance.dailyNutritionIntake, + 'dailyNutritionRecommendation': instance.dailyNutritionRecommendation, + }; + +_$NutritionModelImpl _$$NutritionModelImplFromJson(Map json) => + _$NutritionModelImpl( + energy: (json['energy'] as num).toDouble(), + proteins: (json['proteins'] as num).toDouble(), + fats: (json['fats'] as num).toDouble(), + carbohydrates: (json['carbohydrates'] as num).toDouble(), + ); + +Map _$$NutritionModelImplToJson( + _$NutritionModelImpl instance) => + { + 'energy': instance.energy, + 'proteins': instance.proteins, + 'fats': instance.fats, + 'carbohydrates': instance.carbohydrates, + }; diff --git a/lib/features/diary/presentation/bloc/diary_cubit.dart b/lib/features/diary/presentation/bloc/diary_cubit.dart index 62d81086..16df5d4f 100644 --- a/lib/features/diary/presentation/bloc/diary_cubit.dart +++ b/lib/features/diary/presentation/bloc/diary_cubit.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:eatvio_app/features/diary/models/diary_day_model.dart'; +import 'package:eatvio_app/features/diary/models/nutrition_model.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; import 'package:eatvio_app/features/diary/repositories/diary_repository.dart'; import 'package:eatvio_app/features/glossary/models/glossary_model.dart'; @@ -23,6 +24,7 @@ class DiaryCubit extends Cubit { emit( DiaryState.loaded( diary: await diaryRepository.getDiaryByDate(date), + nutrition: await getNutrition(await diaryRepository.getDiaryIndexByDate(date)), currentSelectedSatietyRating: currentSelectedSatietyRating, ), ); @@ -32,6 +34,10 @@ class DiaryCubit extends Cubit { } } + Future getNutrition(int index) async { + return (await diaryRepository.getNutritionData(index)); + } + addProductToMeal({ required int diaryId, required int mealId, diff --git a/lib/features/diary/presentation/bloc/diary_state.dart b/lib/features/diary/presentation/bloc/diary_state.dart index 85221b31..001c9d16 100644 --- a/lib/features/diary/presentation/bloc/diary_state.dart +++ b/lib/features/diary/presentation/bloc/diary_state.dart @@ -1,4 +1,5 @@ import 'package:eatvio_app/features/diary/models/diary_day_model.dart'; +import 'package:eatvio_app/features/diary/models/nutrition_model.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'diary_state.freezed.dart'; @@ -15,6 +16,7 @@ class DiaryState with _$DiaryState { const factory DiaryState.loaded({ required DiaryDayModel diary, + required NutritionDataModel nutrition, required double currentSelectedSatietyRating, }) = DiaryStateLoaded; } diff --git a/lib/features/diary/presentation/bloc/diary_state.freezed.dart b/lib/features/diary/presentation/bloc/diary_state.freezed.dart index 6e0778c4..58fa1471 100644 --- a/lib/features/diary/presentation/bloc/diary_state.freezed.dart +++ b/lib/features/diary/presentation/bloc/diary_state.freezed.dart @@ -21,8 +21,8 @@ mixin _$DiaryState { TResult Function() $default, { required TResult Function() loading, required TResult Function(String errorMessage) error, - required TResult Function( - DiaryDayModel diary, double currentSelectedSatietyRating) + required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating) loaded, }) => throw _privateConstructorUsedError; @@ -31,7 +31,8 @@ mixin _$DiaryState { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(String errorMessage)? error, - TResult? Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating)? loaded, }) => throw _privateConstructorUsedError; @@ -40,7 +41,8 @@ mixin _$DiaryState { TResult Function()? $default, { TResult Function()? loading, TResult Function(String errorMessage)? error, - TResult Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + TResult Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating)? loaded, required TResult orElse(), }) => @@ -137,8 +139,8 @@ class _$DiaryStateImpl implements _DiaryState { TResult Function() $default, { required TResult Function() loading, required TResult Function(String errorMessage) error, - required TResult Function( - DiaryDayModel diary, double currentSelectedSatietyRating) + required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating) loaded, }) { return $default(); @@ -150,7 +152,8 @@ class _$DiaryStateImpl implements _DiaryState { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(String errorMessage)? error, - TResult? Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating)? loaded, }) { return $default?.call(); @@ -162,7 +165,8 @@ class _$DiaryStateImpl implements _DiaryState { TResult Function()? $default, { TResult Function()? loading, TResult Function(String errorMessage)? error, - TResult Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + TResult Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating)? loaded, required TResult orElse(), }) { @@ -258,8 +262,8 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { TResult Function() $default, { required TResult Function() loading, required TResult Function(String errorMessage) error, - required TResult Function( - DiaryDayModel diary, double currentSelectedSatietyRating) + required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating) loaded, }) { return loading(); @@ -271,7 +275,8 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(String errorMessage)? error, - TResult? Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating)? loaded, }) { return loading?.call(); @@ -283,7 +288,8 @@ class _$DiaryStateLoadingImpl implements DiaryStateLoading { TResult Function()? $default, { TResult Function()? loading, TResult Function(String errorMessage)? error, - TResult Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + TResult Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating)? loaded, required TResult orElse(), }) { @@ -408,8 +414,8 @@ class _$DiaryStateErrorImpl implements DiaryStateError { TResult Function() $default, { required TResult Function() loading, required TResult Function(String errorMessage) error, - required TResult Function( - DiaryDayModel diary, double currentSelectedSatietyRating) + required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating) loaded, }) { return error(errorMessage); @@ -421,7 +427,8 @@ class _$DiaryStateErrorImpl implements DiaryStateError { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(String errorMessage)? error, - TResult? Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating)? loaded, }) { return error?.call(errorMessage); @@ -433,7 +440,8 @@ class _$DiaryStateErrorImpl implements DiaryStateError { TResult Function()? $default, { TResult Function()? loading, TResult Function(String errorMessage)? error, - TResult Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + TResult Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating)? loaded, required TResult orElse(), }) { @@ -500,9 +508,13 @@ abstract class _$$DiaryStateLoadedImplCopyWith<$Res> { $Res Function(_$DiaryStateLoadedImpl) then) = __$$DiaryStateLoadedImplCopyWithImpl<$Res>; @useResult - $Res call({DiaryDayModel diary, double currentSelectedSatietyRating}); + $Res call( + {DiaryDayModel diary, + NutritionDataModel nutrition, + double currentSelectedSatietyRating}); $DiaryDayModelCopyWith<$Res> get diary; + $NutritionDataModelCopyWith<$Res> get nutrition; } /// @nodoc @@ -519,6 +531,7 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> @override $Res call({ Object? diary = null, + Object? nutrition = null, Object? currentSelectedSatietyRating = null, }) { return _then(_$DiaryStateLoadedImpl( @@ -526,6 +539,10 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> ? _value.diary : diary // ignore: cast_nullable_to_non_nullable as DiaryDayModel, + nutrition: null == nutrition + ? _value.nutrition + : nutrition // ignore: cast_nullable_to_non_nullable + as NutritionDataModel, currentSelectedSatietyRating: null == currentSelectedSatietyRating ? _value.currentSelectedSatietyRating : currentSelectedSatietyRating // ignore: cast_nullable_to_non_nullable @@ -542,22 +559,36 @@ class __$$DiaryStateLoadedImplCopyWithImpl<$Res> return _then(_value.copyWith(diary: value)); }); } + + /// Create a copy of DiaryState + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $NutritionDataModelCopyWith<$Res> get nutrition { + return $NutritionDataModelCopyWith<$Res>(_value.nutrition, (value) { + return _then(_value.copyWith(nutrition: value)); + }); + } } /// @nodoc class _$DiaryStateLoadedImpl implements DiaryStateLoaded { const _$DiaryStateLoadedImpl( - {required this.diary, required this.currentSelectedSatietyRating}); + {required this.diary, + required this.nutrition, + required this.currentSelectedSatietyRating}); @override final DiaryDayModel diary; @override + final NutritionDataModel nutrition; + @override final double currentSelectedSatietyRating; @override String toString() { - return 'DiaryState.loaded(diary: $diary, currentSelectedSatietyRating: $currentSelectedSatietyRating)'; + return 'DiaryState.loaded(diary: $diary, nutrition: $nutrition, currentSelectedSatietyRating: $currentSelectedSatietyRating)'; } @override @@ -566,6 +597,8 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { (other.runtimeType == runtimeType && other is _$DiaryStateLoadedImpl && (identical(other.diary, diary) || other.diary == diary) && + (identical(other.nutrition, nutrition) || + other.nutrition == nutrition) && (identical(other.currentSelectedSatietyRating, currentSelectedSatietyRating) || other.currentSelectedSatietyRating == @@ -574,7 +607,7 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { @override int get hashCode => - Object.hash(runtimeType, diary, currentSelectedSatietyRating); + Object.hash(runtimeType, diary, nutrition, currentSelectedSatietyRating); /// Create a copy of DiaryState /// with the given fields replaced by the non-null parameter values. @@ -591,11 +624,11 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { TResult Function() $default, { required TResult Function() loading, required TResult Function(String errorMessage) error, - required TResult Function( - DiaryDayModel diary, double currentSelectedSatietyRating) + required TResult Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating) loaded, }) { - return loaded(diary, currentSelectedSatietyRating); + return loaded(diary, nutrition, currentSelectedSatietyRating); } @override @@ -604,10 +637,11 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { TResult? Function()? $default, { TResult? Function()? loading, TResult? Function(String errorMessage)? error, - TResult? Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + TResult? Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating)? loaded, }) { - return loaded?.call(diary, currentSelectedSatietyRating); + return loaded?.call(diary, nutrition, currentSelectedSatietyRating); } @override @@ -616,12 +650,13 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { TResult Function()? $default, { TResult Function()? loading, TResult Function(String errorMessage)? error, - TResult Function(DiaryDayModel diary, double currentSelectedSatietyRating)? + TResult Function(DiaryDayModel diary, NutritionDataModel nutrition, + double currentSelectedSatietyRating)? loaded, required TResult orElse(), }) { if (loaded != null) { - return loaded(diary, currentSelectedSatietyRating); + return loaded(diary, nutrition, currentSelectedSatietyRating); } return orElse(); } @@ -667,10 +702,12 @@ class _$DiaryStateLoadedImpl implements DiaryStateLoaded { abstract class DiaryStateLoaded implements DiaryState { const factory DiaryStateLoaded( {required final DiaryDayModel diary, + required final NutritionDataModel nutrition, required final double currentSelectedSatietyRating}) = _$DiaryStateLoadedImpl; DiaryDayModel get diary; + NutritionDataModel get nutrition; double get currentSelectedSatietyRating; /// Create a copy of DiaryState diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 91fdbf29..791df947 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; import 'package:eatvio_app/features/diary/models/diary_day_model.dart'; +import 'package:eatvio_app/features/diary/models/nutrition_model.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_cubit.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; import 'package:eatvio_app/features/diary/presentation/widgets/satiety_rating_widget.dart'; @@ -16,7 +17,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:image_picker/image_picker.dart'; import 'package:rive/rive.dart'; -import 'package:syncfusion_flutter_charts/charts.dart'; +import 'package:syncfusion_flutter_gauges/gauges.dart'; import 'package:table_calendar/table_calendar.dart'; class DiaryScreen extends StatefulWidget { @@ -66,7 +67,7 @@ class _DiaryScreenState extends State { state.diary, state.currentSelectedSatietyRating, ), - if (state is DiaryStateLoaded) _chart(), + if (state is DiaryStateLoaded) _chart(state.nutrition), const SizedBox(height: 32), ], ), @@ -208,30 +209,26 @@ class _DiaryScreenState extends State { ); } - _chart() { + _chart(NutritionDataModel nutrition) { final List chartData = [ ChartData( - 1924, - 200, - '100%', + nutrition.dailyNutritionIntake.carbohydrates, + nutrition.dailyNutritionRecommendation.carbohydrates, Color(0xFFFF9500), ), ChartData( - 1925, - 50, - '100%', + nutrition.dailyNutritionIntake.fats, + nutrition.dailyNutritionRecommendation.fats, Color(0xFFFF3B30), ), ChartData( - 1926, - 70, - '100%', + nutrition.dailyNutritionIntake.proteins, + nutrition.dailyNutritionRecommendation.proteins, Color(0xFF4CD964), ), ChartData( - 1926, - 70, - '100%', + nutrition.dailyNutritionIntake.energy, + nutrition.dailyNutritionRecommendation.energy, Color(0xFF007AFF), ), ]; @@ -257,38 +254,126 @@ class _DiaryScreenState extends State { height: 1, ), ), - Transform.rotate( - angle: -1.5708, - child: ClipRect( - child: Align( - alignment: Alignment.centerRight, - widthFactor: 0.5, - child: SfCircularChart( - series: [ - RadialBarSeries( - dataSource: chartData, - xValueMapper: (ChartData data, _) => data.x, - yValueMapper: (ChartData data, _) => data.y, - pointColorMapper: (ChartData data, _) => data.color, - trackColor: Color.fromRGBO(59, 130, 246, 1), - trackOpacity: 0.1, - gap: "8%", - radius: "110%", - innerRadius: '20%', - cornerStyle: CornerStyle.bothCurve, - ), - ], + SfRadialGauge( + axes: [ + RadialAxis( + startAngle: 180, + endAngle: 0, + minimum: 0, + maximum: 100, + showLabels: false, + showTicks: false, + radiusFactor: 0.8, + axisLineStyle: AxisLineStyle( + thickness: 0.1, + color: Colors.grey[200], + thicknessUnit: GaugeSizeUnit.factor, ), + pointers: [ + // Carbohydrates Arc + RangePointer( + value: (chartData[0].intake / chartData[0].recommendation) * 100, + width: 0.1, + color: chartData[0].color, + sizeUnit: GaugeSizeUnit.factor, + enableAnimation: true, + cornerStyle: CornerStyle.bothCurve, // Rounded ends + ), + // Fats Arc + RangePointer( + value: (chartData[1].intake / chartData[1].recommendation) * 100, + width: 0.1, + color: chartData[1].color, + sizeUnit: GaugeSizeUnit.factor, + enableAnimation: true, + cornerStyle: CornerStyle.bothCurve, + pointerOffset: -0.12, + ), + // Proteins Arc + RangePointer( + value: (chartData[2].intake / chartData[2].recommendation) * 100, + width: 0.1, + color: chartData[2].color, + sizeUnit: GaugeSizeUnit.factor, + enableAnimation: true, + cornerStyle: CornerStyle.bothCurve, + pointerOffset: -0.24, + ), + // Calories Arc + RangePointer( + value: (chartData[3].intake / chartData[3].recommendation) * 100, + width: 0.1, + color: chartData[3].color, + sizeUnit: GaugeSizeUnit.factor, + enableAnimation: true, + cornerStyle: CornerStyle.bothCurve, + pointerOffset: -0.36, + ), + ], + annotations: [ + // Label for Carbohydrates + GaugeAnnotation( + widget: Transform.rotate( + angle: 30, + child: Text( + 'Углеводы', + style: TextStyle(color: Colors.white, fontSize: 12), + ), + ), + angle: 194, + positionFactor: 1, + ), + // Label for Fats + GaugeAnnotation( + widget: Transform.rotate( + angle: 30, + child: Text( + 'Жиры', + style: TextStyle(color: Colors.white, fontSize: 12), + ), + ), + angle: 190, + positionFactor: 1.07, + ), + // Label for Proteins + GaugeAnnotation( + widget: Transform.rotate( + angle: 30, + child: Text( + 'Белки', + style: TextStyle(color: Colors.white, fontSize: 12), + ), + ), + angle: 190, + positionFactor: 1.19, + ), + // Label for Calories + GaugeAnnotation( + widget: Transform.rotate( + angle: 30, + child: Text( + 'Калории', + style: TextStyle(color: Colors.white, fontSize: 12), + ), + ), + angle: 192, + positionFactor: 1.31, + ), + ], ), - ), + ], ), - _chartData('Калории', '0 ккал'), + _chartData('Калории', + '${nutrition.dailyNutritionIntake.energy.toStringAsFixed(0)} из ${nutrition.dailyNutritionRecommendation.energy.toStringAsFixed(0)} ккал'), const SizedBox(height: 8), - _chartData('Белки', '0 грамм'), + _chartData('Белки', + '${nutrition.dailyNutritionIntake.proteins.toStringAsFixed(0)} из ${nutrition.dailyNutritionRecommendation.proteins.toStringAsFixed(0)} грамм'), const SizedBox(height: 8), - _chartData('Жиры', '0 грамм'), + _chartData( + 'Жиры', '${nutrition.dailyNutritionIntake.fats.toStringAsFixed(0)} из ${nutrition.dailyNutritionRecommendation.fats.toStringAsFixed(0)} грамм'), const SizedBox(height: 8), - _chartData('Углеводы', '0 грамм'), + _chartData('Углеводы', + '${nutrition.dailyNutritionIntake.carbohydrates.toStringAsFixed(0)} из ${nutrition.dailyNutritionRecommendation.carbohydrates.toStringAsFixed(0)} грамм'), ], ), ); @@ -795,14 +880,13 @@ class _DiaryScreenState extends State { } class ChartData { - int x, y; - String text; - Color color; + final double intake; + final double recommendation; + final Color color; ChartData( - this.x, - this.y, - this.text, + this.intake, + this.recommendation, this.color, ); } diff --git a/lib/features/diary/presentation/widgets/satiety_rating_widget.dart b/lib/features/diary/presentation/widgets/satiety_rating_widget.dart index d12fa114..4376f274 100644 --- a/lib/features/diary/presentation/widgets/satiety_rating_widget.dart +++ b/lib/features/diary/presentation/widgets/satiety_rating_widget.dart @@ -47,7 +47,7 @@ class _SatietyRatingWidgetState extends State { case 0: return Container( width: MediaQuery.of(context).size.width / 6, - height: 16, + height: 24, margin: widget.currentSelectedSatietyRating == 1 ? EdgeInsets.symmetric(horizontal: 2) : null, decoration: BoxDecoration( color: Color(0xFFC82222), @@ -71,7 +71,7 @@ class _SatietyRatingWidgetState extends State { case 1: return Container( width: MediaQuery.of(context).size.width / 6, - height: 16, + height: 24, margin: widget.currentSelectedSatietyRating == 2 ? EdgeInsets.symmetric(horizontal: 2) : null, decoration: BoxDecoration( color: Color(0xFFFF3E3E), @@ -88,7 +88,7 @@ class _SatietyRatingWidgetState extends State { case 2: return Container( width: MediaQuery.of(context).size.width / 6, - height: 16, + height: 24, margin: widget.currentSelectedSatietyRating == 3 ? EdgeInsets.symmetric(horizontal: 2) : null, decoration: BoxDecoration( color: Color(0xFFF8C926), @@ -105,7 +105,7 @@ class _SatietyRatingWidgetState extends State { case 3: return Container( width: MediaQuery.of(context).size.width / 6, - height: 16, + height: 24, margin: widget.currentSelectedSatietyRating == 4 ? EdgeInsets.symmetric(horizontal: 2) : null, decoration: BoxDecoration( color: Color(0xFFFFF3BF), @@ -122,7 +122,7 @@ class _SatietyRatingWidgetState extends State { case 4: return Container( width: MediaQuery.of(context).size.width / 6, - height: 16, + height: 24, margin: widget.currentSelectedSatietyRating == 5 ? EdgeInsets.symmetric(horizontal: 2) : null, decoration: BoxDecoration( color: Color(0xFF62E833), @@ -139,7 +139,7 @@ class _SatietyRatingWidgetState extends State { default: return Container( width: MediaQuery.of(context).size.width / 6, - height: 16, + height: 24, margin: widget.currentSelectedSatietyRating == 6 ? EdgeInsets.symmetric(horizontal: 2) : null, decoration: BoxDecoration( color: Color(0xFF4DCE20), diff --git a/lib/features/diary/repositories/diary_repository.dart b/lib/features/diary/repositories/diary_repository.dart index b9b8243c..abb05a33 100644 --- a/lib/features/diary/repositories/diary_repository.dart +++ b/lib/features/diary/repositories/diary_repository.dart @@ -1,5 +1,6 @@ import 'dart:io'; import 'package:eatvio_app/features/diary/models/diary_day_model.dart'; +import 'package:eatvio_app/features/diary/models/nutrition_model.dart'; import 'package:eatvio_app/features/diary/services/diary_service.dart'; class DiaryRepository { @@ -11,15 +12,19 @@ class DiaryRepository { Future getDiaryByDate(String date) async { return (await diaryService.getDiaryDay( - index: await _getDiaryIndexByDate(date), + index: await getDiaryIndexByDate(date), )) .diary; } - Future _getDiaryIndexByDate(String date) async { + Future getDiaryIndexByDate(String date) async { return (await diaryService.getDiaryIndexByDate(date: date)).id; } + Future getNutritionData(int index) async { + return await diaryService.getNutrition(index: index); + } + Future addPortionToMeal({ required int diaryId, required int mealId, diff --git a/lib/features/diary/services/diary_service.dart b/lib/features/diary/services/diary_service.dart index 16990b1b..bf7f1763 100644 --- a/lib/features/diary/services/diary_service.dart +++ b/lib/features/diary/services/diary_service.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:eatvio_app/features/diary/models/diary_day_model.dart'; import 'package:eatvio_app/features/diary/models/diary_index_model.dart'; +import 'package:eatvio_app/features/diary/models/nutrition_model.dart'; import 'package:retrofit/retrofit.dart'; part 'diary_service.g.dart'; @@ -20,6 +21,11 @@ abstract class DiaryService { @Path('diary_id') required int index, }); + @GET('/api/diary/{diary_id}/dailyNutritionData') + Future getNutrition({ + @Path('diary_id') required int index, + }); + @POST('/api/diary/{diary_id}/meal/{meal_id}/photo/upload') @MultiPart() Future uploadPhotoOfMeal({ diff --git a/lib/features/diary/services/diary_service.g.dart b/lib/features/diary/services/diary_service.g.dart index 74de16af..1672b50a 100644 --- a/lib/features/diary/services/diary_service.g.dart +++ b/lib/features/diary/services/diary_service.g.dart @@ -87,6 +87,39 @@ class _DiaryService implements DiaryService { return _value; } + @override + Future getNutrition({required int index}) 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/diary/${index}/dailyNutritionData', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); + final _result = await _dio.fetch>(_options); + late NutritionDataModel _value; + try { + _value = NutritionDataModel.fromJson(_result.data!); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + return _value; + } + @override Future uploadPhotoOfMeal({ required int diaryId, diff --git a/pubspec.yaml b/pubspec.yaml index 080157d0..a0ffdb94 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -40,6 +40,7 @@ dependencies: google_fonts: ^6.2.1 location: ^7.0.1 syncfusion_flutter_charts: ^27.1.55 + syncfusion_flutter_gauges: ^27.1.58 table_calendar: ^3.1.2 flutter_keyboard_visibility: ^6.0.0 share_plus: ^10.1.0 From bbfaa7acef434613a5e736514c5b7ed96074b265 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 13:47:08 +0300 Subject: [PATCH 11/18] feat(diary): chart width --- .../presentation/pages/diary_screen.dart | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 791df947..452e9b8e 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -263,7 +263,7 @@ class _DiaryScreenState extends State { maximum: 100, showLabels: false, showTicks: false, - radiusFactor: 0.8, + radiusFactor: 0.7, axisLineStyle: AxisLineStyle( thickness: 0.1, color: Colors.grey[200], @@ -273,7 +273,7 @@ class _DiaryScreenState extends State { // Carbohydrates Arc RangePointer( value: (chartData[0].intake / chartData[0].recommendation) * 100, - width: 0.1, + width: 0.16, color: chartData[0].color, sizeUnit: GaugeSizeUnit.factor, enableAnimation: true, @@ -282,46 +282,46 @@ class _DiaryScreenState extends State { // Fats Arc RangePointer( value: (chartData[1].intake / chartData[1].recommendation) * 100, - width: 0.1, + width: 0.16, color: chartData[1].color, sizeUnit: GaugeSizeUnit.factor, enableAnimation: true, cornerStyle: CornerStyle.bothCurve, - pointerOffset: -0.12, + pointerOffset: -0.18, ), // Proteins Arc RangePointer( value: (chartData[2].intake / chartData[2].recommendation) * 100, - width: 0.1, + width: 0.16, color: chartData[2].color, sizeUnit: GaugeSizeUnit.factor, enableAnimation: true, cornerStyle: CornerStyle.bothCurve, - pointerOffset: -0.24, + pointerOffset: -0.36, ), // Calories Arc RangePointer( value: (chartData[3].intake / chartData[3].recommendation) * 100, - width: 0.1, + width: 0.16, color: chartData[3].color, sizeUnit: GaugeSizeUnit.factor, enableAnimation: true, cornerStyle: CornerStyle.bothCurve, - pointerOffset: -0.36, + pointerOffset: -0.54, ), ], annotations: [ // Label for Carbohydrates GaugeAnnotation( widget: Transform.rotate( - angle: 30, + angle: 30.1, child: Text( 'Углеводы', style: TextStyle(color: Colors.white, fontSize: 12), ), ), - angle: 194, - positionFactor: 1, + angle: 198, + positionFactor: 0.92, ), // Label for Fats GaugeAnnotation( @@ -333,7 +333,7 @@ class _DiaryScreenState extends State { ), ), angle: 190, - positionFactor: 1.07, + positionFactor: 1.1, ), // Label for Proteins GaugeAnnotation( @@ -345,7 +345,7 @@ class _DiaryScreenState extends State { ), ), angle: 190, - positionFactor: 1.19, + positionFactor: 1.27, ), // Label for Calories GaugeAnnotation( @@ -357,7 +357,7 @@ class _DiaryScreenState extends State { ), ), angle: 192, - positionFactor: 1.31, + positionFactor: 1.46, ), ], ), From 56b5a7df4be2729f363aed5e186f6daa8848dbf2 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 13:49:31 +0300 Subject: [PATCH 12/18] feat(diary): chart padding --- .../presentation/pages/diary_screen.dart | 238 +++++++++--------- 1 file changed, 124 insertions(+), 114 deletions(-) diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 452e9b8e..e82d338f 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -254,126 +254,136 @@ class _DiaryScreenState extends State { height: 1, ), ), - SfRadialGauge( - axes: [ - RadialAxis( - startAngle: 180, - endAngle: 0, - minimum: 0, - maximum: 100, - showLabels: false, - showTicks: false, - radiusFactor: 0.7, - axisLineStyle: AxisLineStyle( - thickness: 0.1, - color: Colors.grey[200], - thicknessUnit: GaugeSizeUnit.factor, - ), - pointers: [ - // Carbohydrates Arc - RangePointer( - value: (chartData[0].intake / chartData[0].recommendation) * 100, - width: 0.16, - color: chartData[0].color, - sizeUnit: GaugeSizeUnit.factor, - enableAnimation: true, - cornerStyle: CornerStyle.bothCurve, // Rounded ends - ), - // Fats Arc - RangePointer( - value: (chartData[1].intake / chartData[1].recommendation) * 100, - width: 0.16, - color: chartData[1].color, - sizeUnit: GaugeSizeUnit.factor, - enableAnimation: true, - cornerStyle: CornerStyle.bothCurve, - pointerOffset: -0.18, - ), - // Proteins Arc - RangePointer( - value: (chartData[2].intake / chartData[2].recommendation) * 100, - width: 0.16, - color: chartData[2].color, - sizeUnit: GaugeSizeUnit.factor, - enableAnimation: true, - cornerStyle: CornerStyle.bothCurve, - pointerOffset: -0.36, - ), - // Calories Arc - RangePointer( - value: (chartData[3].intake / chartData[3].recommendation) * 100, - width: 0.16, - color: chartData[3].color, - sizeUnit: GaugeSizeUnit.factor, - enableAnimation: true, - cornerStyle: CornerStyle.bothCurve, - pointerOffset: -0.54, + const SizedBox(height: 48), + Stack( + alignment: Alignment.bottomCenter, + children: [ + SfRadialGauge( + axes: [ + RadialAxis( + startAngle: 180, + endAngle: 0, + minimum: 0, + maximum: 100, + showLabels: false, + showTicks: false, + radiusFactor: 0.7, + axisLineStyle: AxisLineStyle( + thickness: 0.1, + color: Colors.grey[200], + thicknessUnit: GaugeSizeUnit.factor, + ), + pointers: [ + // Carbohydrates Arc + RangePointer( + value: (chartData[0].intake / chartData[0].recommendation) * 100, + width: 0.16, + color: chartData[0].color, + sizeUnit: GaugeSizeUnit.factor, + enableAnimation: true, + cornerStyle: CornerStyle.bothCurve, // Rounded ends + ), + // Fats Arc + RangePointer( + value: (chartData[1].intake / chartData[1].recommendation) * 100, + width: 0.16, + color: chartData[1].color, + sizeUnit: GaugeSizeUnit.factor, + enableAnimation: true, + cornerStyle: CornerStyle.bothCurve, + pointerOffset: -0.18, + ), + // Proteins Arc + RangePointer( + value: (chartData[2].intake / chartData[2].recommendation) * 100, + width: 0.16, + color: chartData[2].color, + sizeUnit: GaugeSizeUnit.factor, + enableAnimation: true, + cornerStyle: CornerStyle.bothCurve, + pointerOffset: -0.36, + ), + // Calories Arc + RangePointer( + value: (chartData[3].intake / chartData[3].recommendation) * 100, + width: 0.16, + color: chartData[3].color, + sizeUnit: GaugeSizeUnit.factor, + enableAnimation: true, + cornerStyle: CornerStyle.bothCurve, + pointerOffset: -0.54, + ), + ], + annotations: [ + // Label for Carbohydrates + GaugeAnnotation( + widget: Transform.rotate( + angle: 30.1, + child: Text( + 'Углеводы', + style: TextStyle(color: Colors.white, fontSize: 12), + ), + ), + angle: 198, + positionFactor: 0.92, + ), + // Label for Fats + GaugeAnnotation( + widget: Transform.rotate( + angle: 30, + child: Text( + 'Жиры', + style: TextStyle(color: Colors.white, fontSize: 12), + ), + ), + angle: 190, + positionFactor: 1.1, + ), + // Label for Proteins + GaugeAnnotation( + widget: Transform.rotate( + angle: 30, + child: Text( + 'Белки', + style: TextStyle(color: Colors.white, fontSize: 12), + ), + ), + angle: 190, + positionFactor: 1.27, + ), + // Label for Calories + GaugeAnnotation( + widget: Transform.rotate( + angle: 30, + child: Text( + 'Калории', + style: TextStyle(color: Colors.white, fontSize: 12), + ), + ), + angle: 192, + positionFactor: 1.46, + ), + ], ), ], - annotations: [ - // Label for Carbohydrates - GaugeAnnotation( - widget: Transform.rotate( - angle: 30.1, - child: Text( - 'Углеводы', - style: TextStyle(color: Colors.white, fontSize: 12), - ), - ), - angle: 198, - positionFactor: 0.92, - ), - // Label for Fats - GaugeAnnotation( - widget: Transform.rotate( - angle: 30, - child: Text( - 'Жиры', - style: TextStyle(color: Colors.white, fontSize: 12), - ), - ), - angle: 190, - positionFactor: 1.1, - ), - // Label for Proteins - GaugeAnnotation( - widget: Transform.rotate( - angle: 30, - child: Text( - 'Белки', - style: TextStyle(color: Colors.white, fontSize: 12), - ), - ), - angle: 190, - positionFactor: 1.27, - ), - // Label for Calories - GaugeAnnotation( - widget: Transform.rotate( - angle: 30, - child: Text( - 'Калории', - style: TextStyle(color: Colors.white, fontSize: 12), - ), - ), - angle: 192, - positionFactor: 1.46, - ), + ), + Column( + children: [ + _chartData('Калории', + '${nutrition.dailyNutritionIntake.energy.toStringAsFixed(0)} из ${nutrition.dailyNutritionRecommendation.energy.toStringAsFixed(0)} ккал'), + const SizedBox(height: 8), + _chartData('Белки', + '${nutrition.dailyNutritionIntake.proteins.toStringAsFixed(0)} из ${nutrition.dailyNutritionRecommendation.proteins.toStringAsFixed(0)} грамм'), + const SizedBox(height: 8), + _chartData('Жиры', + '${nutrition.dailyNutritionIntake.fats.toStringAsFixed(0)} из ${nutrition.dailyNutritionRecommendation.fats.toStringAsFixed(0)} грамм'), + const SizedBox(height: 8), + _chartData('Углеводы', + '${nutrition.dailyNutritionIntake.carbohydrates.toStringAsFixed(0)} из ${nutrition.dailyNutritionRecommendation.carbohydrates.toStringAsFixed(0)} грамм'), ], ), ], ), - _chartData('Калории', - '${nutrition.dailyNutritionIntake.energy.toStringAsFixed(0)} из ${nutrition.dailyNutritionRecommendation.energy.toStringAsFixed(0)} ккал'), - const SizedBox(height: 8), - _chartData('Белки', - '${nutrition.dailyNutritionIntake.proteins.toStringAsFixed(0)} из ${nutrition.dailyNutritionRecommendation.proteins.toStringAsFixed(0)} грамм'), - const SizedBox(height: 8), - _chartData( - 'Жиры', '${nutrition.dailyNutritionIntake.fats.toStringAsFixed(0)} из ${nutrition.dailyNutritionRecommendation.fats.toStringAsFixed(0)} грамм'), - const SizedBox(height: 8), - _chartData('Углеводы', - '${nutrition.dailyNutritionIntake.carbohydrates.toStringAsFixed(0)} из ${nutrition.dailyNutritionRecommendation.carbohydrates.toStringAsFixed(0)} грамм'), ], ), ); From c7906ea9da5733ce97f6159a6e1d7c9dfdd60cea Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 13:52:57 +0300 Subject: [PATCH 13/18] feat(diary): chart colors when overflow --- lib/features/diary/presentation/pages/diary_screen.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index e82d338f..e9474908 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -278,7 +278,7 @@ class _DiaryScreenState extends State { RangePointer( value: (chartData[0].intake / chartData[0].recommendation) * 100, width: 0.16, - color: chartData[0].color, + color: chartData[0].intake < chartData[0].recommendation ? chartData[0].color : Colors.red, sizeUnit: GaugeSizeUnit.factor, enableAnimation: true, cornerStyle: CornerStyle.bothCurve, // Rounded ends @@ -287,7 +287,7 @@ class _DiaryScreenState extends State { RangePointer( value: (chartData[1].intake / chartData[1].recommendation) * 100, width: 0.16, - color: chartData[1].color, + color: chartData[1].intake < chartData[1].recommendation ? chartData[1].color : Colors.red, sizeUnit: GaugeSizeUnit.factor, enableAnimation: true, cornerStyle: CornerStyle.bothCurve, @@ -297,7 +297,7 @@ class _DiaryScreenState extends State { RangePointer( value: (chartData[2].intake / chartData[2].recommendation) * 100, width: 0.16, - color: chartData[2].color, + color: chartData[2].intake < chartData[2].recommendation ? chartData[2].color : Colors.red, sizeUnit: GaugeSizeUnit.factor, enableAnimation: true, cornerStyle: CornerStyle.bothCurve, @@ -307,7 +307,7 @@ class _DiaryScreenState extends State { RangePointer( value: (chartData[3].intake / chartData[3].recommendation) * 100, width: 0.16, - color: chartData[3].color, + color: chartData[3].intake < chartData[3].recommendation ? chartData[3].color : Colors.red, sizeUnit: GaugeSizeUnit.factor, enableAnimation: true, cornerStyle: CornerStyle.bothCurve, From b07161b41dfc174a30957dee55bc6d47b19c20ee Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 15:32:14 +0300 Subject: [PATCH 14/18] feat(diary): chart update pixel perfect --- .../presentation/pages/diary_screen.dart | 93 +++++++++++++------ 1 file changed, 63 insertions(+), 30 deletions(-) diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index e9474908..2abdac39 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -214,22 +214,18 @@ class _DiaryScreenState extends State { ChartData( nutrition.dailyNutritionIntake.carbohydrates, nutrition.dailyNutritionRecommendation.carbohydrates, - Color(0xFFFF9500), ), ChartData( nutrition.dailyNutritionIntake.fats, nutrition.dailyNutritionRecommendation.fats, - Color(0xFFFF3B30), ), ChartData( nutrition.dailyNutritionIntake.proteins, nutrition.dailyNutritionRecommendation.proteins, - Color(0xFF4CD964), ), ChartData( nutrition.dailyNutritionIntake.energy, nutrition.dailyNutritionRecommendation.energy, - Color(0xFF007AFF), ), ]; @@ -268,46 +264,77 @@ class _DiaryScreenState extends State { showLabels: false, showTicks: false, radiusFactor: 0.7, - axisLineStyle: AxisLineStyle( - thickness: 0.1, - color: Colors.grey[200], - thicknessUnit: GaugeSizeUnit.factor, - ), + showAxisLine: false, pointers: [ - // Carbohydrates Arc + RangePointer( + value: 100, + width: 0.16, + animationDuration: 2000, + color: Color(0xFFF6FAFF), + sizeUnit: GaugeSizeUnit.factor, + enableAnimation: true, + cornerStyle: CornerStyle.bothCurve, + ), RangePointer( value: (chartData[0].intake / chartData[0].recommendation) * 100, width: 0.16, - color: chartData[0].intake < chartData[0].recommendation ? chartData[0].color : Colors.red, + color: chartData[0].intake < chartData[0].recommendation ? appTheme.blueA400 : Colors.red, sizeUnit: GaugeSizeUnit.factor, enableAnimation: true, - cornerStyle: CornerStyle.bothCurve, // Rounded ends + cornerStyle: CornerStyle.bothCurve, ), - // Fats Arc RangePointer( - value: (chartData[1].intake / chartData[1].recommendation) * 100, + value: 100, width: 0.16, - color: chartData[1].intake < chartData[1].recommendation ? chartData[1].color : Colors.red, + animationDuration: 2000, + color: Color(0xFFF6FAFF), sizeUnit: GaugeSizeUnit.factor, enableAnimation: true, cornerStyle: CornerStyle.bothCurve, pointerOffset: -0.18, ), - // Proteins Arc RangePointer( - value: (chartData[2].intake / chartData[2].recommendation) * 100, + value: (chartData[1].intake / chartData[1].recommendation) * 100, width: 0.16, - color: chartData[2].intake < chartData[2].recommendation ? chartData[2].color : Colors.red, + color: chartData[1].intake < chartData[1].recommendation ? appTheme.blueA400 : Colors.red, + sizeUnit: GaugeSizeUnit.factor, + enableAnimation: true, + cornerStyle: CornerStyle.bothCurve, + pointerOffset: -0.18, + ), + RangePointer( + value: 100, + width: 0.16, + animationDuration: 2000, + color: Color(0xFFF6FAFF), sizeUnit: GaugeSizeUnit.factor, enableAnimation: true, cornerStyle: CornerStyle.bothCurve, pointerOffset: -0.36, ), - // Calories Arc + RangePointer( + value: (chartData[2].intake / chartData[2].recommendation) * 100, + width: 0.16, + color: chartData[2].intake < chartData[2].recommendation ? appTheme.blueA400 : Colors.red, + sizeUnit: GaugeSizeUnit.factor, + enableAnimation: true, + cornerStyle: CornerStyle.bothCurve, + pointerOffset: -0.36, + ), + RangePointer( + value: 100, + width: 0.16, + animationDuration: 2000, + color: Color(0xFFF6FAFF), + sizeUnit: GaugeSizeUnit.factor, + enableAnimation: true, + cornerStyle: CornerStyle.bothCurve, + pointerOffset: -0.54, + ), RangePointer( value: (chartData[3].intake / chartData[3].recommendation) * 100, width: 0.16, - color: chartData[3].intake < chartData[3].recommendation ? chartData[3].color : Colors.red, + color: chartData[3].intake < chartData[3].recommendation ? appTheme.blueA400 : Colors.red, sizeUnit: GaugeSizeUnit.factor, enableAnimation: true, cornerStyle: CornerStyle.bothCurve, @@ -315,49 +342,57 @@ class _DiaryScreenState extends State { ), ], annotations: [ - // Label for Carbohydrates GaugeAnnotation( widget: Transform.rotate( angle: 30.1, child: Text( 'Углеводы', - style: TextStyle(color: Colors.white, fontSize: 12), + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), ), ), angle: 198, positionFactor: 0.92, ), - // Label for Fats GaugeAnnotation( widget: Transform.rotate( angle: 30, child: Text( 'Жиры', - style: TextStyle(color: Colors.white, fontSize: 12), + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), ), ), angle: 190, positionFactor: 1.1, ), - // Label for Proteins GaugeAnnotation( widget: Transform.rotate( angle: 30, child: Text( 'Белки', - style: TextStyle(color: Colors.white, fontSize: 12), + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), ), ), angle: 190, positionFactor: 1.27, ), - // Label for Calories GaugeAnnotation( widget: Transform.rotate( angle: 30, child: Text( 'Калории', - style: TextStyle(color: Colors.white, fontSize: 12), + style: TextStyle( + color: Colors.white, + fontSize: 12, + ), ), ), angle: 192, @@ -892,11 +927,9 @@ class _DiaryScreenState extends State { class ChartData { final double intake; final double recommendation; - final Color color; ChartData( this.intake, this.recommendation, - this.color, ); } From cbc596cc45a0a168d12f3bb4131ed7de776497a7 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 15:45:53 +0300 Subject: [PATCH 15/18] feat(diary): arrow down is work --- .../presentation/pages/diary_screen.dart | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 2abdac39..6649263e 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -79,12 +79,20 @@ class _DiaryScreenState extends State { } _arrowDown() { - return Container( - padding: const EdgeInsets.only(top: 8, bottom: 16), - width: double.infinity, - child: Icon( - _calendarFormat == CalendarFormat.month ? Icons.keyboard_arrow_up_rounded : Icons.keyboard_arrow_down_rounded, - color: Colors.grey.shade600, + return GestureDetector( + behavior: HitTestBehavior.translucent, + onVerticalDragStart: (_) { + setState(() { + _calendarFormat = CalendarFormat.values[(_calendarFormat.index - 1) % CalendarFormat.values.length]; + }); + }, + child: Container( + width: double.infinity, + padding: const EdgeInsets.only(top: 8, bottom: 16), + child: Icon( + _calendarFormat == CalendarFormat.month ? Icons.keyboard_arrow_up_rounded : Icons.keyboard_arrow_down_rounded, + color: Colors.grey.shade600, + ), ), ); } From 9af7ad09cdbdc20c4df10bdddb32542e6638e461 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 17:14:18 +0300 Subject: [PATCH 16/18] feat(diary): timer picker --- .../presentation/pages/diary_screen.dart | 100 ++++++++++++++++-- pubspec.yaml | 2 + 2 files changed, 94 insertions(+), 8 deletions(-) diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 6649263e..71376057 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -37,6 +37,59 @@ class _DiaryScreenState extends State { final productNameController = TextEditingController(); final quantityController = TextEditingController(); int currentSelectedPhotoIndex = 0; + String time = "${DateTime.now().hour.toString().padLeft(2, '0')} : ${DateTime.now().minute.toString().padLeft(2, '0')}"; + DateTime _time = DateTime.now(); + + _showDatePicker() { + showModalBottomSheet( + context: context, + useRootNavigator: true, + builder: (context) => SizedBox( + height: MediaQuery.of(context).copyWith().size.height / 3, + child: Column( + children: [ + Expanded( + child: CupertinoDatePicker( + mode: CupertinoDatePickerMode.time, + use24hFormat: true, + initialDateTime: DateTime.now(), + onDateTimeChanged: (newTime) { + setState(() { + _time = newTime; + time = "${_time.hour.toString().padLeft(2, '0')} : ${_time.minute.toString().padLeft(2, '0')}"; + }); + }, + ), + ), + InkWell( + onTap: () { + Navigator.of(context).pop(); + }, + borderRadius: BorderRadius.circular(20), + child: Ink( + width: MediaQuery.of(context).size.width - 16, + height: 52, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: appTheme.blueA400, + ), + child: Center( + child: Text( + 'Сохранить', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + color: Colors.white, + ), + ), + ), + ), + ), + ], + ), + ), + ); + } @override Widget build(BuildContext context) { @@ -78,6 +131,31 @@ class _DiaryScreenState extends State { ); } + _timeOfMeal(String time) { + return InkWell( + onTap: () => _showDatePicker(), + borderRadius: BorderRadius.circular(100), + child: Ink( + width: MediaQuery.of(context).size.width / 5, + height: 32, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + color: Color(0xFFF1F2F6), + ), + child: Center( + child: Text( + time, + style: TextStyle( + color: Color(0xFF6D6F71), + fontSize: 17, + fontWeight: FontWeight.w500, + ), + ), + ), + ), + ); + } + _arrowDown() { return GestureDetector( behavior: HitTestBehavior.translucent, @@ -180,13 +258,19 @@ class _DiaryScreenState extends State { const SizedBox(height: 12), _divider(context), const SizedBox(height: 12), - Text( - 'Время приема пищи', - style: TextStyle( - color: Color(0xFF323F4B), - fontSize: 16, - fontWeight: FontWeight.w500, - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Время приема пищи', + style: TextStyle( + color: Color(0xFF323F4B), + fontSize: 16, + fontWeight: FontWeight.w500, + ), + ), + _timeOfMeal(time), + ], ), const SizedBox(height: 12), _divider(context), @@ -634,7 +718,7 @@ class _DiaryScreenState extends State { child: Text( '$mealNumber', style: TextStyle( - color: isActive ? Colors.white : Colors.black, + color: isActive ? Colors.white : Color(0xFF6D6F71), fontSize: 16, fontWeight: FontWeight.w600, ), diff --git a/pubspec.yaml b/pubspec.yaml index a0ffdb94..de9c3ac0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -51,6 +51,8 @@ dependencies: rive: ^0.13.15 mask_text_input_formatter: ^2.9.0 lottie: ^3.1.3 + flutter_portal: ^1.1.4 + fluttertoast: ^8.2.8 flutter_rating_bar: ^4.0.1 dev_dependencies: From 99fa52419bef50d0e44c94b612dea8e219f113b4 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 11 Nov 2024 17:32:39 +0300 Subject: [PATCH 17/18] resolve dart analyze --- .../presentation/widgets/type_badges.dart | 11 +++- .../diets/services/diets_service.dart | 12 ----- .../diets/services/diets_service.g.dart | 53 ------------------- 3 files changed, 10 insertions(+), 66 deletions(-) delete mode 100644 lib/features/diets/services/diets_service.dart delete mode 100644 lib/features/diets/services/diets_service.g.dart diff --git a/lib/features/diets/presentation/widgets/type_badges.dart b/lib/features/diets/presentation/widgets/type_badges.dart index 3e828f3d..9fc7f7f9 100644 --- a/lib/features/diets/presentation/widgets/type_badges.dart +++ b/lib/features/diets/presentation/widgets/type_badges.dart @@ -8,6 +8,7 @@ import 'package:flutter_svg/svg.dart'; class TypeBadges extends StatefulWidget { const TypeBadges({super.key, required this.type}); + final DietType type; @override @@ -16,6 +17,7 @@ class TypeBadges extends StatefulWidget { class _TypeBadgesState extends State { final List overlaysVisibilityState = [false, false, false, false]; + @override Widget build(BuildContext context) { final s = S.of(context); @@ -117,11 +119,18 @@ class _TypeBadgesState extends State { } class _InfoOverlayEntry extends StatelessWidget { - const _InfoOverlayEntry({super.key, required this.title, required this.description, required this.assetPath, required this.onClose}); + const _InfoOverlayEntry({ + required this.title, + required this.description, + required this.assetPath, + required this.onClose, + }); + final String title; final String description; final assetPath; final void Function() onClose; + @override Widget build(BuildContext context) { return MainBackgroundBouble( diff --git a/lib/features/diets/services/diets_service.dart b/lib/features/diets/services/diets_service.dart deleted file mode 100644 index 9130f39c..00000000 --- a/lib/features/diets/services/diets_service.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:dio/dio.dart'; -import 'package:retrofit/retrofit.dart'; - -part 'diets_service.g.dart'; - -@RestApi() -abstract class DietsService { - - factory DietsService(Dio dio, {String baseUrl}) = _DietsService; - - -} \ No newline at end of file diff --git a/lib/features/diets/services/diets_service.g.dart b/lib/features/diets/services/diets_service.g.dart deleted file mode 100644 index aeef4f7e..00000000 --- a/lib/features/diets/services/diets_service.g.dart +++ /dev/null @@ -1,53 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'diets_service.dart'; - -// ************************************************************************** -// RetrofitGenerator -// ************************************************************************** - -// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations - -class _DietsService implements DietsService { - _DietsService( - this._dio, { - this.baseUrl, - this.errorLogger, - }); - - final Dio _dio; - - String? baseUrl; - - final ParseErrorLogger? errorLogger; - - RequestOptions _setStreamType(RequestOptions requestOptions) { - if (T != dynamic && - !(requestOptions.responseType == ResponseType.bytes || - requestOptions.responseType == ResponseType.stream)) { - if (T == String) { - requestOptions.responseType = ResponseType.plain; - } else { - requestOptions.responseType = ResponseType.json; - } - } - return requestOptions; - } - - String _combineBaseUrls( - String dioBaseUrl, - String? baseUrl, - ) { - if (baseUrl == null || baseUrl.trim().isEmpty) { - return dioBaseUrl; - } - - final url = Uri.parse(baseUrl); - - if (url.isAbsolute) { - return url.toString(); - } - - return Uri.parse(dioBaseUrl).resolveUri(url).toString(); - } -} From a66791d7771579518dc3aa1f21ab103e01d0f30f Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Tue, 12 Nov 2024 14:13:17 +0300 Subject: [PATCH 18/18] feat(diary): update --- .../diary/presentation/pages/diary_screen.dart | 16 ++++++++++++---- ...lossary_moderation_request_modal_widget.dart | 17 +++++++++++++++++ .../widgets/satiety_rating_widget.dart | 1 + 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 lib/features/diary/presentation/widgets/glossary_moderation_request_modal_widget.dart diff --git a/lib/features/diary/presentation/pages/diary_screen.dart b/lib/features/diary/presentation/pages/diary_screen.dart index 71376057..79f9ac2f 100644 --- a/lib/features/diary/presentation/pages/diary_screen.dart +++ b/lib/features/diary/presentation/pages/diary_screen.dart @@ -5,6 +5,7 @@ import 'package:eatvio_app/features/diary/models/diary_day_model.dart'; import 'package:eatvio_app/features/diary/models/nutrition_model.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_cubit.dart'; import 'package:eatvio_app/features/diary/presentation/bloc/diary_state.dart'; +import 'package:eatvio_app/features/diary/presentation/widgets/glossary_moderation_request_modal_widget.dart'; import 'package:eatvio_app/features/diary/presentation/widgets/satiety_rating_widget.dart'; import 'package:eatvio_app/features/glossary/models/glossary_model.dart'; import 'package:eatvio_app/locator_service.dart'; @@ -37,7 +38,7 @@ class _DiaryScreenState extends State { final productNameController = TextEditingController(); final quantityController = TextEditingController(); int currentSelectedPhotoIndex = 0; - String time = "${DateTime.now().hour.toString().padLeft(2, '0')} : ${DateTime.now().minute.toString().padLeft(2, '0')}"; + String time = "${DateTime.now().hour.toString().padLeft(2, '0')}:${DateTime.now().minute.toString().padLeft(2, '0')}"; DateTime _time = DateTime.now(); _showDatePicker() { @@ -56,7 +57,7 @@ class _DiaryScreenState extends State { onDateTimeChanged: (newTime) { setState(() { _time = newTime; - time = "${_time.hour.toString().padLeft(2, '0')} : ${_time.minute.toString().padLeft(2, '0')}"; + time = "${_time.hour.toString().padLeft(2, '0')}:${_time.minute.toString().padLeft(2, '0')}"; }); }, ), @@ -64,6 +65,12 @@ class _DiaryScreenState extends State { InkWell( onTap: () { Navigator.of(context).pop(); + showModalBottomSheet( + useRootNavigator: true, + useSafeArea: false, + context: context, + builder: (context) => GlossaryModerationRequestModalWidget(), + ); }, borderRadius: BorderRadius.circular(20), child: Ink( @@ -136,13 +143,14 @@ class _DiaryScreenState extends State { onTap: () => _showDatePicker(), borderRadius: BorderRadius.circular(100), child: Ink( - width: MediaQuery.of(context).size.width / 5, height: 32, decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), color: Color(0xFFF1F2F6), ), - child: Center( + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric(horizontal: 16), child: Text( time, style: TextStyle( diff --git a/lib/features/diary/presentation/widgets/glossary_moderation_request_modal_widget.dart b/lib/features/diary/presentation/widgets/glossary_moderation_request_modal_widget.dart new file mode 100644 index 00000000..c51a4cb7 --- /dev/null +++ b/lib/features/diary/presentation/widgets/glossary_moderation_request_modal_widget.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; + +class GlossaryModerationRequestModalWidget extends StatefulWidget { + const GlossaryModerationRequestModalWidget({super.key}); + + @override + State createState() => _GlossaryModerationRequestModalWidgetState(); +} + +class _GlossaryModerationRequestModalWidgetState extends State { + @override + Widget build(BuildContext context) { + return Dialog( + child: Column(), + ); + } +} diff --git a/lib/features/diary/presentation/widgets/satiety_rating_widget.dart b/lib/features/diary/presentation/widgets/satiety_rating_widget.dart index 4376f274..69af3f22 100644 --- a/lib/features/diary/presentation/widgets/satiety_rating_widget.dart +++ b/lib/features/diary/presentation/widgets/satiety_rating_widget.dart @@ -42,6 +42,7 @@ class _SatietyRatingWidgetState extends State { initialRating: 3, itemCount: 6, itemSize: MediaQuery.of(context).size.width / 6 - (124 / 6), + updateOnDrag: true, itemBuilder: (context, index) { switch (index) { case 0: