From 05ccfd289cc9340fc13037552181f382674e877e Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Mon, 24 Jun 2024 20:03:54 +0300 Subject: [PATCH 1/6] feat(chat): add websocket --- ios/Podfile | 6 +- ios/Runner.xcodeproj/project.pbxproj | 76 +-- lib/core/app_export.dart | 1 - .../initialization_cubit.dart | 46 ++ .../initialization_state.dart | 14 + .../initialization_state.freezed.dart | 589 ++++++++++++++++++ lib/core/network/network_info.dart | 47 -- .../chat/models/websocket_info_model.dart | 6 +- .../models/websocket_info_model.freezed.dart | 104 +++- .../chat/models/websocket_info_model.g.dart | 12 +- .../chat_select_screen/chat_search_view.dart | 53 +- .../chat_select_screen.dart | 2 +- lib/locator_service.dart | 2 + lib/main.dart | 84 ++- .../my_profile_screen/my_profile_screen.dart | 4 +- pubspec.yaml | 57 +- test/auth_test.dart | 3 - 17 files changed, 911 insertions(+), 195 deletions(-) create mode 100644 lib/core/initialization_cubit/initialization_cubit.dart create mode 100644 lib/core/initialization_cubit/initialization_state.dart create mode 100644 lib/core/initialization_cubit/initialization_state.freezed.dart delete mode 100644 lib/core/network/network_info.dart diff --git a/ios/Podfile b/ios/Podfile index 279576f3..27c089c7 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '12.0' +platform :ios, '14.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -37,5 +37,9 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + target.build_configurations.each do |config| + config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0' + end end end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 68ec53f4..7454c98b 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -9,7 +9,7 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 68F4DD6659288F4CFDC41C5C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7024DE075B2C1E5A149230E4 /* Pods_Runner.framework */; }; + 46B43B96F809CEC6058EFDD3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15ADDB2A35F334AF0AE50011 /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; @@ -32,13 +32,12 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 1DC098B20AE17A152A9E7BC6 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 15ADDB2A35F334AF0AE50011 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 4B6A3CFB60775CA626789750 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 7024DE075B2C1E5A149230E4 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 938EE8FB5BAA359AAEDEFFF8 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -46,7 +45,8 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - EC46FEE88A2E87A3510B5EC3 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 9D8D6181877DE17809AFF936 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + DF0C4038A57E19D3ABA03C15 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -54,27 +54,19 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 68F4DD6659288F4CFDC41C5C /* Pods_Runner.framework in Frameworks */, + 46B43B96F809CEC6058EFDD3 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 28430AE518366E9EB19A31C9 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 7024DE075B2C1E5A149230E4 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 6F201E010624CF963CC3A17B /* Pods */ = { isa = PBXGroup; children = ( - 1DC098B20AE17A152A9E7BC6 /* Pods-Runner.debug.xcconfig */, - 4B6A3CFB60775CA626789750 /* Pods-Runner.release.xcconfig */, - EC46FEE88A2E87A3510B5EC3 /* Pods-Runner.profile.xcconfig */, + 938EE8FB5BAA359AAEDEFFF8 /* Pods-Runner.debug.xcconfig */, + 9D8D6181877DE17809AFF936 /* Pods-Runner.release.xcconfig */, + DF0C4038A57E19D3ABA03C15 /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -97,7 +89,7 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 6F201E010624CF963CC3A17B /* Pods */, - 28430AE518366E9EB19A31C9 /* Frameworks */, + AEE6B7943D197783DD1CB2EE /* Frameworks */, ); sourceTree = ""; }; @@ -124,6 +116,14 @@ path = Runner; sourceTree = ""; }; + AEE6B7943D197783DD1CB2EE /* Frameworks */ = { + isa = PBXGroup; + children = ( + 15ADDB2A35F334AF0AE50011 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -131,14 +131,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - C9531164650CD277994F87F5 /* [CP] Check Pods Manifest.lock */, + 9A49250058577CAA8C897A03 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 8944C2327F94FA34E28A19A3 /* [CP] Embed Pods Frameworks */, + 1D324C14EB43C988423BC1AD /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -198,23 +198,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 8944C2327F94FA34E28A19A3 /* [CP] Embed Pods Frameworks */ = { + 1D324C14EB43C988423BC1AD /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -231,6 +215,22 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -246,7 +246,7 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - C9531164650CD277994F87F5 /* [CP] Check Pods Manifest.lock */ = { + 9A49250058577CAA8C897A03 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( diff --git a/lib/core/app_export.dart b/lib/core/app_export.dart index 233b58c8..ae95a220 100644 --- a/lib/core/app_export.dart +++ b/lib/core/app_export.dart @@ -1,7 +1,6 @@ export 'package:flutter_bloc/flutter_bloc.dart'; export 'package:eatvio_app/core/constants/constants.dart'; export 'package:eatvio_app/core/errors/exceptions.dart'; -export 'package:eatvio_app/core/network/network_info.dart'; export 'package:eatvio_app/core/utils/image_constant.dart'; export 'package:eatvio_app/core/utils/logger.dart'; export 'package:eatvio_app/core/utils/pref_utils.dart'; diff --git a/lib/core/initialization_cubit/initialization_cubit.dart b/lib/core/initialization_cubit/initialization_cubit.dart new file mode 100644 index 00000000..e61d691f --- /dev/null +++ b/lib/core/initialization_cubit/initialization_cubit.dart @@ -0,0 +1,46 @@ +import 'package:eatvio_app/core/app_export.dart'; +import 'package:eatvio_app/core/initialization_cubit/initialization_state.dart'; +import 'package:eatvio_app/core/token_storage.dart'; +import 'package:eatvio_app/features/chat/repositories/chat_repository.dart'; +import 'package:pusher_client/pusher_client.dart'; + +class InitializationCubit extends Cubit { + late final webSocketChannel; + + final ChatRepository chatRepository; + + InitializationCubit({required this.chatRepository}) : super(const InitializationState.loading()); + + runInitialization() async { + try { + await TokenStorage.haveTokenInStorage(); + + final wsUrl = await chatRepository.getWebsocket(); + + PusherOptions options = PusherOptions( + host: 'socket.mobile-stage.eatvio.ru', + wsPort: 443, + encrypted: true, + auth: PusherAuth( + 'wss://' + wsUrl.host + '/app/' + wsUrl.key, + headers: { + 'Authorization': 'Bearer ${TokenStorage.getTokenFromStorage()}', + }, + ), + ); + + PusherClient pusher = PusherClient( + wsUrl.key, + options, + autoConnect: true, + enableLogging: true, + ); + + await pusher.connect(); + + emit(const InitializationState.success()); + } catch (e) { + emit(InitializationState.error(errorMessage: e.toString())); + } + } +} diff --git a/lib/core/initialization_cubit/initialization_state.dart b/lib/core/initialization_cubit/initialization_state.dart new file mode 100644 index 00000000..98f881cd --- /dev/null +++ b/lib/core/initialization_cubit/initialization_state.dart @@ -0,0 +1,14 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'initialization_state.freezed.dart'; + +@freezed +abstract class InitializationState with _$InitializationState { + const factory InitializationState() = _InitializationState; + + const factory InitializationState.loading() = InitializationStateLoading; + + const factory InitializationState.success() = InitializationStateSuccess; + + const factory InitializationState.error({required String errorMessage}) = InitializationStateError; +} diff --git a/lib/core/initialization_cubit/initialization_state.freezed.dart b/lib/core/initialization_cubit/initialization_state.freezed.dart new file mode 100644 index 00000000..136672f7 --- /dev/null +++ b/lib/core/initialization_cubit/initialization_state.freezed.dart @@ -0,0 +1,589 @@ +// 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 'initialization_state.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +/// @nodoc +mixin _$InitializationState { + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function() success, + required TResult Function(String errorMessage) error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function()? success, + TResult? Function(String errorMessage)? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function()? success, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map( + TResult Function(_InitializationState value) $default, { + required TResult Function(InitializationStateLoading value) loading, + required TResult Function(InitializationStateSuccess value) success, + required TResult Function(InitializationStateError value) error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_InitializationState value)? $default, { + TResult? Function(InitializationStateLoading value)? loading, + TResult? Function(InitializationStateSuccess value)? success, + TResult? Function(InitializationStateError value)? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap( + TResult Function(_InitializationState value)? $default, { + TResult Function(InitializationStateLoading value)? loading, + TResult Function(InitializationStateSuccess value)? success, + TResult Function(InitializationStateError value)? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $InitializationStateCopyWith<$Res> { + factory $InitializationStateCopyWith( + InitializationState value, $Res Function(InitializationState) then) = + _$InitializationStateCopyWithImpl<$Res, InitializationState>; +} + +/// @nodoc +class _$InitializationStateCopyWithImpl<$Res, $Val extends InitializationState> + implements $InitializationStateCopyWith<$Res> { + _$InitializationStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$InitializationStateImplCopyWith<$Res> { + factory _$$InitializationStateImplCopyWith(_$InitializationStateImpl value, + $Res Function(_$InitializationStateImpl) then) = + __$$InitializationStateImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$InitializationStateImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, _$InitializationStateImpl> + implements _$$InitializationStateImplCopyWith<$Res> { + __$$InitializationStateImplCopyWithImpl(_$InitializationStateImpl _value, + $Res Function(_$InitializationStateImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$InitializationStateImpl implements _InitializationState { + const _$InitializationStateImpl(); + + @override + String toString() { + return 'InitializationState()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InitializationStateImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function() success, + required TResult Function(String errorMessage) error, + }) { + return $default(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function()? success, + TResult? Function(String errorMessage)? error, + }) { + return $default?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function()? success, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if ($default != null) { + return $default(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_InitializationState value) $default, { + required TResult Function(InitializationStateLoading value) loading, + required TResult Function(InitializationStateSuccess value) success, + required TResult Function(InitializationStateError value) error, + }) { + return $default(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_InitializationState value)? $default, { + TResult? Function(InitializationStateLoading value)? loading, + TResult? Function(InitializationStateSuccess value)? success, + TResult? Function(InitializationStateError value)? error, + }) { + return $default?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_InitializationState value)? $default, { + TResult Function(InitializationStateLoading value)? loading, + TResult Function(InitializationStateSuccess value)? success, + TResult Function(InitializationStateError value)? error, + required TResult orElse(), + }) { + if ($default != null) { + return $default(this); + } + return orElse(); + } +} + +abstract class _InitializationState implements InitializationState { + const factory _InitializationState() = _$InitializationStateImpl; +} + +/// @nodoc +abstract class _$$InitializationStateLoadingImplCopyWith<$Res> { + factory _$$InitializationStateLoadingImplCopyWith( + _$InitializationStateLoadingImpl value, + $Res Function(_$InitializationStateLoadingImpl) then) = + __$$InitializationStateLoadingImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$InitializationStateLoadingImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, + _$InitializationStateLoadingImpl> + implements _$$InitializationStateLoadingImplCopyWith<$Res> { + __$$InitializationStateLoadingImplCopyWithImpl( + _$InitializationStateLoadingImpl _value, + $Res Function(_$InitializationStateLoadingImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$InitializationStateLoadingImpl implements InitializationStateLoading { + const _$InitializationStateLoadingImpl(); + + @override + String toString() { + return 'InitializationState.loading()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InitializationStateLoadingImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function() success, + required TResult Function(String errorMessage) error, + }) { + return loading(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function()? success, + TResult? Function(String errorMessage)? error, + }) { + return loading?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function()? success, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (loading != null) { + return loading(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_InitializationState value) $default, { + required TResult Function(InitializationStateLoading value) loading, + required TResult Function(InitializationStateSuccess value) success, + required TResult Function(InitializationStateError value) error, + }) { + return loading(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_InitializationState value)? $default, { + TResult? Function(InitializationStateLoading value)? loading, + TResult? Function(InitializationStateSuccess value)? success, + TResult? Function(InitializationStateError value)? error, + }) { + return loading?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_InitializationState value)? $default, { + TResult Function(InitializationStateLoading value)? loading, + TResult Function(InitializationStateSuccess value)? success, + TResult Function(InitializationStateError value)? error, + required TResult orElse(), + }) { + if (loading != null) { + return loading(this); + } + return orElse(); + } +} + +abstract class InitializationStateLoading implements InitializationState { + const factory InitializationStateLoading() = _$InitializationStateLoadingImpl; +} + +/// @nodoc +abstract class _$$InitializationStateSuccessImplCopyWith<$Res> { + factory _$$InitializationStateSuccessImplCopyWith( + _$InitializationStateSuccessImpl value, + $Res Function(_$InitializationStateSuccessImpl) then) = + __$$InitializationStateSuccessImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$InitializationStateSuccessImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, + _$InitializationStateSuccessImpl> + implements _$$InitializationStateSuccessImplCopyWith<$Res> { + __$$InitializationStateSuccessImplCopyWithImpl( + _$InitializationStateSuccessImpl _value, + $Res Function(_$InitializationStateSuccessImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$InitializationStateSuccessImpl implements InitializationStateSuccess { + const _$InitializationStateSuccessImpl(); + + @override + String toString() { + return 'InitializationState.success()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InitializationStateSuccessImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function() success, + required TResult Function(String errorMessage) error, + }) { + return success(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function()? success, + TResult? Function(String errorMessage)? error, + }) { + return success?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function()? success, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (success != null) { + return success(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_InitializationState value) $default, { + required TResult Function(InitializationStateLoading value) loading, + required TResult Function(InitializationStateSuccess value) success, + required TResult Function(InitializationStateError value) error, + }) { + return success(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_InitializationState value)? $default, { + TResult? Function(InitializationStateLoading value)? loading, + TResult? Function(InitializationStateSuccess value)? success, + TResult? Function(InitializationStateError value)? error, + }) { + return success?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_InitializationState value)? $default, { + TResult Function(InitializationStateLoading value)? loading, + TResult Function(InitializationStateSuccess value)? success, + TResult Function(InitializationStateError value)? error, + required TResult orElse(), + }) { + if (success != null) { + return success(this); + } + return orElse(); + } +} + +abstract class InitializationStateSuccess implements InitializationState { + const factory InitializationStateSuccess() = _$InitializationStateSuccessImpl; +} + +/// @nodoc +abstract class _$$InitializationStateErrorImplCopyWith<$Res> { + factory _$$InitializationStateErrorImplCopyWith( + _$InitializationStateErrorImpl value, + $Res Function(_$InitializationStateErrorImpl) then) = + __$$InitializationStateErrorImplCopyWithImpl<$Res>; + @useResult + $Res call({String errorMessage}); +} + +/// @nodoc +class __$$InitializationStateErrorImplCopyWithImpl<$Res> + extends _$InitializationStateCopyWithImpl<$Res, + _$InitializationStateErrorImpl> + implements _$$InitializationStateErrorImplCopyWith<$Res> { + __$$InitializationStateErrorImplCopyWithImpl( + _$InitializationStateErrorImpl _value, + $Res Function(_$InitializationStateErrorImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? errorMessage = null, + }) { + return _then(_$InitializationStateErrorImpl( + errorMessage: null == errorMessage + ? _value.errorMessage + : errorMessage // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$InitializationStateErrorImpl implements InitializationStateError { + const _$InitializationStateErrorImpl({required this.errorMessage}); + + @override + final String errorMessage; + + @override + String toString() { + return 'InitializationState.error(errorMessage: $errorMessage)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InitializationStateErrorImpl && + (identical(other.errorMessage, errorMessage) || + other.errorMessage == errorMessage)); + } + + @override + int get hashCode => Object.hash(runtimeType, errorMessage); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> + get copyWith => __$$InitializationStateErrorImplCopyWithImpl< + _$InitializationStateErrorImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when( + TResult Function() $default, { + required TResult Function() loading, + required TResult Function() success, + required TResult Function(String errorMessage) error, + }) { + return error(errorMessage); + } + + @override + @optionalTypeArgs + TResult? whenOrNull( + TResult? Function()? $default, { + TResult? Function()? loading, + TResult? Function()? success, + TResult? Function(String errorMessage)? error, + }) { + return error?.call(errorMessage); + } + + @override + @optionalTypeArgs + TResult maybeWhen( + TResult Function()? $default, { + TResult Function()? loading, + TResult Function()? success, + TResult Function(String errorMessage)? error, + required TResult orElse(), + }) { + if (error != null) { + return error(errorMessage); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map( + TResult Function(_InitializationState value) $default, { + required TResult Function(InitializationStateLoading value) loading, + required TResult Function(InitializationStateSuccess value) success, + required TResult Function(InitializationStateError value) error, + }) { + return error(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull( + TResult? Function(_InitializationState value)? $default, { + TResult? Function(InitializationStateLoading value)? loading, + TResult? Function(InitializationStateSuccess value)? success, + TResult? Function(InitializationStateError value)? error, + }) { + return error?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap( + TResult Function(_InitializationState value)? $default, { + TResult Function(InitializationStateLoading value)? loading, + TResult Function(InitializationStateSuccess value)? success, + TResult Function(InitializationStateError value)? error, + required TResult orElse(), + }) { + if (error != null) { + return error(this); + } + return orElse(); + } +} + +abstract class InitializationStateError implements InitializationState { + const factory InitializationStateError({required final String errorMessage}) = + _$InitializationStateErrorImpl; + + String get errorMessage; + @JsonKey(ignore: true) + _$$InitializationStateErrorImplCopyWith<_$InitializationStateErrorImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/core/network/network_info.dart b/lib/core/network/network_info.dart deleted file mode 100644 index c92c5215..00000000 --- a/lib/core/network/network_info.dart +++ /dev/null @@ -1,47 +0,0 @@ -import 'package:connectivity_plus/connectivity_plus.dart'; - -// For checking internet connectivity -abstract class NetworkInfoI { - Future isConnected(); - - Future get connectivityResult; - - Stream get onConnectivityChanged; -} - -class NetworkInfo implements NetworkInfoI { - Connectivity connectivity; - - static final NetworkInfo _networkInfo = NetworkInfo._internal(Connectivity()); - - factory NetworkInfo() { - return _networkInfo; - } - - NetworkInfo._internal(this.connectivity) { - connectivity = this.connectivity; - } - - ///checks internet is connected or not - ///returns [true] if internet is connected - ///else it will return [false] - @override - Future isConnected() async { - final result = await connectivity.checkConnectivity(); - if (result != ConnectivityResult.none) { - return true; - } - return false; - } - - // to check type of internet connectivity - @override - Future get connectivityResult async { - return connectivity.checkConnectivity(); - } - - //check the type on internet connection on changed of internet connection - @override - Stream get onConnectivityChanged => - connectivity.onConnectivityChanged; -} diff --git a/lib/features/chat/models/websocket_info_model.dart b/lib/features/chat/models/websocket_info_model.dart index 9fe8abc4..281c71ed 100644 --- a/lib/features/chat/models/websocket_info_model.dart +++ b/lib/features/chat/models/websocket_info_model.dart @@ -6,7 +6,11 @@ part 'websocket_info_model.g.dart'; @freezed class WebsocketInfoModel with _$WebsocketInfoModel { - const factory WebsocketInfoModel() = _WebsocketInfoModel; + const factory WebsocketInfoModel({ + required String key, + required String host, + required String port, + }) = _WebsocketInfoModel; factory WebsocketInfoModel.fromJson(Map json) => _$WebsocketInfoModelFromJson(json); } diff --git a/lib/features/chat/models/websocket_info_model.freezed.dart b/lib/features/chat/models/websocket_info_model.freezed.dart index fd9ef4b9..9a26feea 100644 --- a/lib/features/chat/models/websocket_info_model.freezed.dart +++ b/lib/features/chat/models/websocket_info_model.freezed.dart @@ -20,7 +20,14 @@ WebsocketInfoModel _$WebsocketInfoModelFromJson(Map json) { /// @nodoc mixin _$WebsocketInfoModel { + String get key => throw _privateConstructorUsedError; + String get host => throw _privateConstructorUsedError; + String get port => throw _privateConstructorUsedError; + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $WebsocketInfoModelCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc @@ -28,6 +35,8 @@ abstract class $WebsocketInfoModelCopyWith<$Res> { factory $WebsocketInfoModelCopyWith( WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) = _$WebsocketInfoModelCopyWithImpl<$Res, WebsocketInfoModel>; + @useResult + $Res call({String key, String host, String port}); } /// @nodoc @@ -39,13 +48,40 @@ class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel> final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? key = null, + Object? host = null, + Object? port = null, + }) { + return _then(_value.copyWith( + key: null == key + ? _value.key + : key // ignore: cast_nullable_to_non_nullable + as String, + host: null == host + ? _value.host + : host // ignore: cast_nullable_to_non_nullable + as String, + port: null == port + ? _value.port + : port // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } } /// @nodoc -abstract class _$$WebsocketInfoModelImplCopyWith<$Res> { +abstract class _$$WebsocketInfoModelImplCopyWith<$Res> + implements $WebsocketInfoModelCopyWith<$Res> { factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value, $Res Function(_$WebsocketInfoModelImpl) then) = __$$WebsocketInfoModelImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({String key, String host, String port}); } /// @nodoc @@ -55,30 +91,72 @@ class __$$WebsocketInfoModelImplCopyWithImpl<$Res> __$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value, $Res Function(_$WebsocketInfoModelImpl) _then) : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? key = null, + Object? host = null, + Object? port = null, + }) { + return _then(_$WebsocketInfoModelImpl( + key: null == key + ? _value.key + : key // ignore: cast_nullable_to_non_nullable + as String, + host: null == host + ? _value.host + : host // ignore: cast_nullable_to_non_nullable + as String, + port: null == port + ? _value.port + : port // ignore: cast_nullable_to_non_nullable + as String, + )); + } } /// @nodoc @JsonSerializable() class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { - const _$WebsocketInfoModelImpl(); + const _$WebsocketInfoModelImpl( + {required this.key, required this.host, required this.port}); factory _$WebsocketInfoModelImpl.fromJson(Map json) => _$$WebsocketInfoModelImplFromJson(json); + @override + final String key; + @override + final String host; + @override + final String port; + @override String toString() { - return 'WebsocketInfoModel()'; + return 'WebsocketInfoModel(key: $key, host: $host, port: $port)'; } @override bool operator ==(Object other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$WebsocketInfoModelImpl); + (other.runtimeType == runtimeType && + other is _$WebsocketInfoModelImpl && + (identical(other.key, key) || other.key == key) && + (identical(other.host, host) || other.host == host) && + (identical(other.port, port) || other.port == port)); } @JsonKey(ignore: true) @override - int get hashCode => runtimeType.hashCode; + int get hashCode => Object.hash(runtimeType, key, host, port); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => + __$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>( + this, _$identity); @override Map toJson() { @@ -89,8 +167,22 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel { } abstract class _WebsocketInfoModel implements WebsocketInfoModel { - const factory _WebsocketInfoModel() = _$WebsocketInfoModelImpl; + const factory _WebsocketInfoModel( + {required final String key, + required final String host, + required final String port}) = _$WebsocketInfoModelImpl; factory _WebsocketInfoModel.fromJson(Map json) = _$WebsocketInfoModelImpl.fromJson; + + @override + String get key; + @override + String get host; + @override + String get port; + @override + @JsonKey(ignore: true) + _$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/features/chat/models/websocket_info_model.g.dart b/lib/features/chat/models/websocket_info_model.g.dart index 6573c3c7..e5b5c322 100644 --- a/lib/features/chat/models/websocket_info_model.g.dart +++ b/lib/features/chat/models/websocket_info_model.g.dart @@ -8,8 +8,16 @@ part of 'websocket_info_model.dart'; _$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson( Map json) => - _$WebsocketInfoModelImpl(); + _$WebsocketInfoModelImpl( + key: json['key'] as String, + host: json['host'] as String, + port: json['port'] as String, + ); Map _$$WebsocketInfoModelImplToJson( _$WebsocketInfoModelImpl instance) => - {}; + { + 'key': instance.key, + 'host': instance.host, + 'port': instance.port, + }; diff --git a/lib/features/chat/presentation/pages/chat_select_screen/chat_search_view.dart b/lib/features/chat/presentation/pages/chat_select_screen/chat_search_view.dart index 939bb42d..22020a9e 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen/chat_search_view.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen/chat_search_view.dart @@ -2,32 +2,30 @@ import 'package:flutter/material.dart'; import 'package:eatvio_app/core/app_export.dart'; class CustomSearchView extends StatelessWidget { - CustomSearchView( - {Key? key, - this.alignment, - this.width, - this.scrollPadding, - this.controller, - this.focusNode, - this.autofocus = false, - this.textStyle, - this.textInputType = TextInputType.text, - this.maxLines, - this.hintText, - this.hintStyle, - this.prefix, - this.prefixConstraints, - this.suffix, - this.suffixConstraints, - this.contentPadding, - this.borderDecoration, - this.fillColor, - this.filled = true, - this.validator, - this.onChanged}) - : super( - key: key, - ); + CustomSearchView({ + Key? key, + this.alignment, + this.width, + this.scrollPadding, + this.controller, + this.focusNode, + this.autofocus = false, + this.textStyle, + this.textInputType = TextInputType.text, + this.maxLines, + this.hintText, + this.hintStyle, + this.prefix, + this.prefixConstraints, + this.suffix, + this.suffixConstraints, + this.contentPadding, + this.borderDecoration, + this.fillColor, + this.filled = true, + this.validator, + this.onChanged, + }) : super(key: key); final Alignment? alignment; @@ -73,13 +71,12 @@ class CustomSearchView extends StatelessWidget { @override Widget build(BuildContext context) { - return alignment != null ? Align(alignment: alignment ?? Alignment.center, child: searchViewWidget(context)) : searchViewWidget(context); + return searchViewWidget(context); } searchViewWidget(BuildContext context) => SizedBox( width: width ?? double.maxFinite, child: TextFormField( - scrollPadding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), controller: controller, focusNode: focusNode, onTapOutside: (event) => onTapOutside(), diff --git a/lib/features/chat/presentation/pages/chat_select_screen/chat_select_screen.dart b/lib/features/chat/presentation/pages/chat_select_screen/chat_select_screen.dart index fe468f3b..74911c3d 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen/chat_select_screen.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen/chat_select_screen.dart @@ -44,7 +44,7 @@ class ChatSelectScreen extends StatelessWidget { headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { return [ SliverAppBar( - backgroundColor: Colors.white, + automaticallyImplyLeading: false, stretchTriggerOffset: 1, forceMaterialTransparency: true, floating: true, diff --git a/lib/locator_service.dart b/lib/locator_service.dart index 68233789..8759775c 100644 --- a/lib/locator_service.dart +++ b/lib/locator_service.dart @@ -1,4 +1,5 @@ import 'package:dio/dio.dart'; +import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart'; import 'package:eatvio_app/features/chat/repositories/chat_repository.dart'; import 'package:eatvio_app/features/chat/services/chat_service.dart'; @@ -10,6 +11,7 @@ final sl = GetIt.instance; Future init() async { // BLoC sl.registerFactory(() => ChatRoomCubit(chatRepository: sl())); + sl.registerFactory(() => InitializationCubit(chatRepository: sl())); // Repository sl.registerLazySingleton(() => ChatRepository(chatService: sl())); diff --git a/lib/main.dart b/lib/main.dart index 8e0c1b94..ebe22899 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,9 @@ import 'package:eatvio_app/app_router.dart'; +import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart'; +import 'package:eatvio_app/core/initialization_cubit/initialization_state.dart'; import 'package:eatvio_app/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart'; import 'package:eatvio_app/features/chat/presentation/pages/chat_select_screen/models/chat_select_model.dart'; +import 'package:eatvio_app/locator_service.dart'; import 'package:eatvio_app/presentation/diary/diary_edit_screen/bloc/diary_edit_bloc.dart'; import 'package:eatvio_app/presentation/diary/diary_edit_screen/models/diary_edit_model.dart'; import 'package:eatvio_app/presentation/feed/feed_screen/bloc/feed_bloc.dart'; @@ -40,64 +43,53 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { return MultiBlocProvider( providers: [ + BlocProvider(create: (context) => sl()..runInitialization()), BlocProvider( - create: (context) => ThemeBloc( - ThemeState(themeType: PrefUtils().getThemeData()), - ), + create: (context) => ThemeBloc(ThemeState(themeType: PrefUtils().getThemeData())), ), BlocProvider( - create: (context) => MyProfileBloc( - MyProfileState( - myProfileModelObj: MyProfileModel(), - ), - )..add(MyProfileInitialEvent()), + create: (context) => MyProfileBloc(MyProfileState(myProfileModelObj: MyProfileModel()))..add(MyProfileInitialEvent()), ), BlocProvider( - create: (context) => FeedBloc(FeedState(myProfileModelObj: FeedModel())) - ..add( - FeedInitialEvent(), - ), + create: (context) => FeedBloc(FeedState(myProfileModelObj: FeedModel()))..add(FeedInitialEvent()), ), BlocProvider( - create: (context) => DiaryEditBloc(DiaryEditState(diaryEditModelObj: DiaryEditModel())) - ..add( - DiaryEditInitialEvent(), - ), + create: (context) => DiaryEditBloc(DiaryEditState(diaryEditModelObj: DiaryEditModel()))..add(DiaryEditInitialEvent()), ), BlocProvider( - create: (context) => ChatSelectBloc(ChatSelectState(chatSelectModelObj: ChatSelectModel())) - ..add( - ChatSelectInitialEvent(), - ), + create: (context) => ChatSelectBloc(ChatSelectState(chatSelectModelObj: ChatSelectModel()))..add(ChatSelectInitialEvent()), ), ], - child: BlocBuilder( - builder: (context, state) { - return KeyboardDismisser( - gestures: [ - GestureType.onTap, - GestureType.onPanUpdateDownDirection, - ], - child: MaterialApp.router( - theme: theme, - title: 'Eatvio', - routerConfig: AppRouter.appRouter, - debugShowCheckedModeBanner: false, - localizationsDelegates: [ - AppLocalizationDelegate(), - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, + child: BlocListener( + listener: (BuildContext context, InitializationState state) { }, + child: BlocBuilder( + builder: (context, state) { + return KeyboardDismisser( + gestures: [ + GestureType.onTap, + GestureType.onPanUpdateDownDirection, ], - supportedLocales: [ - Locale( - 'ru', - '', - ), - ], - ), - ); - }, + child: MaterialApp.router( + theme: theme, + title: 'Eatvio', + routerConfig: AppRouter.appRouter, + debugShowCheckedModeBanner: false, + localizationsDelegates: [ + AppLocalizationDelegate(), + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + supportedLocales: [ + Locale( + 'ru', + '', + ), + ], + ), + ); + }, + ), ), ); } diff --git a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart index e6f97062..48d1ed62 100644 --- a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart +++ b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart @@ -342,7 +342,7 @@ class MyProfileScreen extends StatelessWidget { lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( maxContentWidth: 100, - tooltipBgColor: Colors.black, + // tooltipBgColor: Colors.black, getTooltipItems: mapSpots(), ), handleBuiltInTouches: true, @@ -519,7 +519,7 @@ class MyProfileScreen extends StatelessWidget { lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( maxContentWidth: 100, - tooltipBgColor: Colors.black, + // tooltipBgColor: Colors.black, getTooltipItems: mapTouchedSpots(), ), handleBuiltInTouches: true, diff --git a/pubspec.yaml b/pubspec.yaml index 6000794d..ad2e28fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,36 +12,55 @@ dependencies: flutter_localizations: sdk: flutter - flutter_bloc: ^8.0.0 - connectivity_plus: ^5.0.2 - shared_preferences: ^2.0.15 - cached_network_image: ^3.3.1 - flutter_svg: ^2.0.9 - equatable: ^2.0.0 - validators: ^3.0.0 + # BLoC state manager + flutter_bloc: ^8.1.6 + # local storage + shared_preferences: ^2.2.3 hive: ^2.2.3 hive_flutter: ^1.1.0 - isar_flutter_libs: ^4.0.0-dev.13 - path_provider: ^2.1.0 - fl_chart: ^0.66.0 - flutter_spinkit: ^5.0.0 + # + cached_network_image: ^3.3.1 + # + flutter_svg: ^2.0.9 + # + equatable: ^2.0.5 + # + freezed_annotation: ^2.4.1 + # + json_annotation: ^4.9.0 + # + validators: ^3.0.0 + # + isar_flutter_libs: ^3.1.0+1 + # + path_provider: ^2.1.3 + # + fl_chart: ^0.68.0 + # + flutter_spinkit: ^5.2.1 + # flutter_dotenv: ^5.1.0 + # carousel_slider: ^4.2.1 - flutter_form_builder: ^9.2.1 - image_picker: ^1.0.7 + # + flutter_form_builder: ^9.3.0 + # + image_picker: ^1.1.2 + # flutter_typeahead: ^5.2.0 - bloc_test: ^9.1.6 # navigation go_router: ^14.1.4 + # keyboard_dismisser: ^3.0.0 - - freezed_annotation: ^2.4.1 - json_annotation: ^4.9.0 + # service generator retrofit: ^4.1.0 + # di get_it: ^7.7.0 + # http request dio: ^5.4.3+1 - - # photo viewer + # websocket + pusher_client: ^2.0.0 + # photo gallery viewer photo_view: ^0.15.0 #url launcher url_launcher: ^6.3.0 diff --git a/test/auth_test.dart b/test/auth_test.dart index 22de3a00..e131dc88 100644 --- a/test/auth_test.dart +++ b/test/auth_test.dart @@ -2,13 +2,10 @@ import 'package:eatvio_app/core/app_export.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:bloc_test/bloc_test.dart'; import 'package:eatvio_app/presentation/auth/auth_screen/auth_screen.dart'; import 'package:eatvio_app/presentation/auth/auth_screen/bloc/auth_bloc.dart'; import 'package:eatvio_app/presentation/auth/auth_screen/models/auth_model.dart'; -class MockAuthBloc extends MockBloc implements AuthBloc {} - void main() { group('AuthScreen', () { testWidgets('renders AuthScreen with initial state', From 2337bdd3689cff64e2e6ad9c30afcecba55b9ddc Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Tue, 25 Jun 2024 15:26:03 +0300 Subject: [PATCH 2/6] feat(chat): hero animation + chat select scren --- lib/app_router.dart | 12 +- .../initialization_cubit.dart | 3 + .../chat/presentation/pages/chat_screen.dart | 194 +++++++++--------- .../bloc/chat_select_bloc.dart | 20 +- .../chat_select_screen.dart | 5 +- .../chat_select_screen/models/chat_entry.dart | 29 ++- .../models/chat_select_model.dart | 2 + .../widgets/chat_entry_widget.dart | 7 +- .../presentation/pages/photo_view_screen.dart | 92 ++++----- .../widgets/chat_bubble_widget.dart | 26 ++- .../my_profile_screen/my_profile_screen.dart | 14 +- pubspec.yaml | 7 +- 12 files changed, 211 insertions(+), 200 deletions(-) diff --git a/lib/app_router.dart b/lib/app_router.dart index 3c60e6e6..f0aafe9f 100644 --- a/lib/app_router.dart +++ b/lib/app_router.dart @@ -202,16 +202,14 @@ class AppRouter { path: '/chat-select-screen', name: 'chatSelectScreen', builder: (context, state) => ChatSelectScreen(), - routes: [ - GoRoute( - path: 'chat-screen', - name: 'chatScreen', - builder: (context, state) => ChatScreen(chatId: state.extra as String), - ), - ], ), ], ), + GoRoute( + path: '/chat-screen', + name: 'chatScreen', + builder: (context, state) => ChatScreen(chatId: state.extra as String), + ), GoRoute( path: '/my-settings-screen', name: 'mySettingsScreen', diff --git a/lib/core/initialization_cubit/initialization_cubit.dart b/lib/core/initialization_cubit/initialization_cubit.dart index e61d691f..cd9828ea 100644 --- a/lib/core/initialization_cubit/initialization_cubit.dart +++ b/lib/core/initialization_cubit/initialization_cubit.dart @@ -38,6 +38,9 @@ class InitializationCubit extends Cubit { await pusher.connect(); + // Channel channel = pusher.subscribe('private-direct-chat.'); + // channel.registerListener(classId, method); + emit(const InitializationState.success()); } catch (e) { emit(InitializationState.error(errorMessage: e.toString())); diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index c6ad9beb..4c4bcfe1 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -81,119 +81,121 @@ class ChatScreen extends StatelessWidget { ], ), ), - body: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Expanded( - child: Container( - color: Color(0xFFF0F2F5), - width: double.maxFinite, - child: CustomScrollView( - reverse: true, - slivers: [ - SliverPadding( - padding: EdgeInsets.symmetric(vertical: 16), - sliver: SliverList( - delegate: SliverChildBuilderDelegate( - (context, index) => ChatBubbleWidget( - text: state.chatRoomModel.messages[state.chatRoomModel.messages.length - index - 1].data, - isCurrentUser: state.chatRoomModel.users['to_chat_user']!.id != - state.chatRoomModel.messages[state.chatRoomModel.messages.length - index - 1].authorId, - mediaData: state.chatRoomModel.messages[state.chatRoomModel.messages.length - index - 1].mediaData, + body: SafeArea( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Expanded( + child: Container( + color: Color(0xFFF0F2F5), + width: double.maxFinite, + child: CustomScrollView( + reverse: true, + slivers: [ + SliverPadding( + padding: EdgeInsets.symmetric(vertical: 16), + sliver: SliverList( + delegate: SliverChildBuilderDelegate( + (context, index) => ChatBubbleWidget( + text: state.chatRoomModel.messages[state.chatRoomModel.messages.length - index - 1].data, + isCurrentUser: state.chatRoomModel.users['to_chat_user']!.id != + state.chatRoomModel.messages[state.chatRoomModel.messages.length - index - 1].authorId, + mediaData: state.chatRoomModel.messages[state.chatRoomModel.messages.length - index - 1].mediaData, + ), + childCount: state.chatRoomModel.messages.length, ), - childCount: state.chatRoomModel.messages.length, + ), + ), + ], + ), + ), + ), + Padding( + padding: EdgeInsets.symmetric(vertical: 8), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(width: 8), + InkWell( + onTap: () {}, + borderRadius: BorderRadiusStyle.circleBorder17, + child: Ink( + height: 32, + width: 32, + child: Icon( + Icons.attach_file_rounded, + size: 28, + color: Color(0xFF858E99), ), ), ), - ], - ), - ), - ), - Padding( - padding: EdgeInsets.symmetric(vertical: 8), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(width: 8), - InkWell( - onTap: () {}, - borderRadius: BorderRadiusStyle.circleBorder17, - child: Ink( - height: 32, - width: 32, - child: Icon( - Icons.attach_file_rounded, - size: 28, - color: Color(0xFF858E99), - ), - ), - ), - SizedBox(width: 8), - SizedBox( - width: mediaQueryData.size.width - 96, - child: TextFormField( - maxLines: 5, - minLines: 1, - keyboardType: TextInputType.multiline, - style: TextStyle( - fontSize: 16, - fontFamily: 'Mulish', - fontWeight: FontWeight.w400, - color: Colors.black, - ), - decoration: InputDecoration( - contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 4), - hintText: 'Сообщение', - hintStyle: TextStyle( + SizedBox(width: 8), + SizedBox( + width: mediaQueryData.size.width - 96, + child: TextFormField( + maxLines: 5, + minLines: 1, + keyboardType: TextInputType.multiline, + style: TextStyle( fontSize: 16, fontFamily: 'Mulish', fontWeight: FontWeight.w400, - color: Color(0xFFAEAEB2), + color: Colors.black, ), - filled: true, - border: OutlineInputBorder( - borderRadius: BorderRadiusStyle.circleBorder17, - borderSide: BorderSide( - color: Color(0xFFD1D1D6), - width: 1, + decoration: InputDecoration( + contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 4), + hintText: 'Сообщение', + hintStyle: TextStyle( + fontSize: 16, + fontFamily: 'Mulish', + fontWeight: FontWeight.w400, + color: Color(0xFFAEAEB2), ), - ), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadiusStyle.circleBorder17, - borderSide: BorderSide( - color: Color(0xFFD1D1D6), - width: 1, + filled: true, + border: OutlineInputBorder( + borderRadius: BorderRadiusStyle.circleBorder17, + borderSide: BorderSide( + color: Color(0xFFD1D1D6), + width: 1, + ), ), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadiusStyle.circleBorder17, - borderSide: BorderSide( - color: Color(0xFFD1D1D6), - width: 1, + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadiusStyle.circleBorder17, + borderSide: BorderSide( + color: Color(0xFFD1D1D6), + width: 1, + ), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadiusStyle.circleBorder17, + borderSide: BorderSide( + color: Color(0xFFD1D1D6), + width: 1, + ), ), ), ), ), - ), - SizedBox(width: 8), - InkWell( - borderRadius: BorderRadiusStyle.circleBorder17, - onTap: () {}, - child: Ink( - height: 32, - width: 32, - child: Icon( - Icons.send_outlined, - size: 28, - color: Color(0xFF858E99), + SizedBox(width: 8), + InkWell( + borderRadius: BorderRadiusStyle.circleBorder17, + onTap: () {}, + child: Ink( + height: 32, + width: 32, + child: Icon( + Icons.send_outlined, + size: 28, + color: Color(0xFF858E99), + ), ), ), - ), - SizedBox(width: 8), - ], + SizedBox(width: 8), + ], + ), ), - ), - ], + ], + ), ), ); } diff --git a/lib/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart b/lib/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart index ba44ade1..d041db4f 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart @@ -27,17 +27,22 @@ class ChatSelectBloc extends Bloc { List chats = []; for (int i = 0; i < chatRooms.length; i++) { String text = chatRooms[i]['last_message']['data']; - if (chatRooms[i]['last_message']['is_author_from_user']) { + if (chatRooms[i]['last_message']['is_author_message_auth_user'] != null) { text = "Вы: " + text; } - chats.add(ChatItemModel( + chats.add( + ChatItemModel( id: chatRooms[i]['id'], - userImage: chatRooms[i]['users']['to_chat_user'] - ['profile_photo_path'], + userImage: chatRooms[i]['users']['to_chat_user']['profile_photo_path'], username: chatRooms[i]['users']['to_chat_user']['name'], dateText: DateFormat('dd.MM').format( - DateTime.parse(chatRooms[i]['last_message']['updated_at'])), - greetingText: text)); + DateTime.parse( + chatRooms[i]['last_message']['updated_at'], + ), + ), + greetingText: text, + ), + ); } return chats; } @@ -75,8 +80,7 @@ class ChatSelectBloc extends Bloc { } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку - emit(ChatSelectErrorState( - 'Некоторые необходимые данные отсутствуют.')); + emit(ChatSelectErrorState('Некоторые необходимые данные отсутствуют.')); } } else { // Статус ответа не равен 200, обрабатываем ошибку diff --git a/lib/features/chat/presentation/pages/chat_select_screen/chat_select_screen.dart b/lib/features/chat/presentation/pages/chat_select_screen/chat_select_screen.dart index 74911c3d..60b889a7 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen/chat_select_screen.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen/chat_select_screen.dart @@ -64,7 +64,10 @@ class ChatSelectScreen extends StatelessWidget { ), ); } else if (state is ChatSelectErrorState) { - return Center(child: Text(state.errorMessage)); + return Padding( + padding: const EdgeInsets.all(16), + child: Center(child: Text(state.errorMessage)), + ); } else { return Scaffold( body: Center( diff --git a/lib/features/chat/presentation/pages/chat_select_screen/models/chat_entry.dart b/lib/features/chat/presentation/pages/chat_select_screen/models/chat_entry.dart index 6738afb8..cffee89a 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen/models/chat_entry.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen/models/chat_entry.dart @@ -4,26 +4,23 @@ import 'package:eatvio_app/core/app_export.dart'; // ignore_for_file: must_be_immutable class ChatItemModel { - ChatItemModel( - {this.userImage, - this.username, - this.dateText, - this.greetingText, - required this.id}) { + String? userImage; + String? username; + String? dateText; + String? greetingText; + String id; + + ChatItemModel({ + this.userImage, + this.username, + this.dateText, + this.greetingText, + required this.id, + }) { userImage = userImage ?? ImageConstant.imageNotFound; username = username; dateText = dateText; greetingText = greetingText; id = id; } - - String? userImage; - - String? username; - - String? dateText; - - String? greetingText; - - String id; } diff --git a/lib/features/chat/presentation/pages/chat_select_screen/models/chat_select_model.dart b/lib/features/chat/presentation/pages/chat_select_screen/models/chat_select_model.dart index c95b52ee..8a0ae045 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen/models/chat_select_model.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen/models/chat_select_model.dart @@ -5,9 +5,11 @@ import 'package:equatable/equatable.dart'; /// This class defines the variables used in the [chat_select_screen], /// and is typically used to hold data that is passed between different parts of the application. + class ChatSelectModel extends Equatable { ChatSelectModel({this.chatList = const []}); List chatList; + ChatSelectModel copyWith({List? chatList}) { return ChatSelectModel( chatList: chatList ?? this.chatList, diff --git a/lib/features/chat/presentation/pages/chat_select_screen/widgets/chat_entry_widget.dart b/lib/features/chat/presentation/pages/chat_select_screen/widgets/chat_entry_widget.dart index fbd6b1b0..87a46ab5 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen/widgets/chat_entry_widget.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen/widgets/chat_entry_widget.dart @@ -15,12 +15,13 @@ class ChatEntryWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return GestureDetector( - onTap: () => GoRouter.of(context).goNamed( + return InkWell( + borderRadius: BorderRadiusStyle.circleBorder8, + onTap: () => GoRouter.of(context).pushNamed( 'chatScreen', extra: chatEntryObj.id.toString(), ), - child: Container( + child: Ink( padding: EdgeInsets.all(16), decoration: BoxDecoration( borderRadius: BorderRadiusStyle.circleBorder8, diff --git a/lib/features/chat/presentation/pages/photo_view_screen.dart b/lib/features/chat/presentation/pages/photo_view_screen.dart index 229ced53..f576a586 100644 --- a/lib/features/chat/presentation/pages/photo_view_screen.dart +++ b/lib/features/chat/presentation/pages/photo_view_screen.dart @@ -1,6 +1,7 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:dismissible_page/dismissible_page.dart'; import 'package:eatvio_app/core/app_export.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:go_router/go_router.dart'; import 'package:photo_view/photo_view.dart'; @@ -34,37 +35,32 @@ class _PhotoViewScreenState extends State { @override Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Colors.black, - appBar: AppBar( - centerTitle: true, - systemOverlayStyle: SystemUiOverlayStyle( - statusBarColor: Colors.black, - statusBarBrightness: Brightness.dark, - statusBarIconBrightness: Brightness.light, + return DismissiblePage( + minScale: 1, + onDismissed: () => GoRouter.of(context).pop(), + direction: DismissiblePageDismissDirection.vertical, + isFullScreen: true, + child: PhotoViewGallery.builder( + backgroundDecoration: BoxDecoration( + color: Colors.transparent, ), - backgroundColor: Colors.black, - foregroundColor: Colors.white, - title: Text( - (imageIndex + 1).toString() + ' из ' + widget.imageUrls.length.toString(), - ), - ), - body: Dismissible( - direction: DismissDirection.vertical, - key: const Key('key'), - onDismissed: (_) => GoRouter.of(context).pop(), - resizeDuration: Duration(microseconds: 1), - child: Container( - child: PhotoViewGallery.builder( - scrollPhysics: const BouncingScrollPhysics(), - builder: (BuildContext context, int index) { - return PhotoViewGalleryPageOptions( - imageProvider: NetworkImage(widget.imageUrls[index]), - initialScale: PhotoViewComputedScale.contained, - minScale: PhotoViewComputedScale.contained, - heroAttributes: PhotoViewHeroAttributes(tag: widget.imageUrls[index]), - errorBuilder: (context, object, stackTrace) { - return Column( + scrollPhysics: const BouncingScrollPhysics(), + builder: (BuildContext context, int index) { + return PhotoViewGalleryPageOptions( + imageProvider: CachedNetworkImageProvider( + widget.imageUrls[index], + ), + initialScale: PhotoViewComputedScale.contained, + minScale: PhotoViewComputedScale.contained, + heroAttributes: PhotoViewHeroAttributes( + tag: widget.imageUrls[index], + transitionOnUserGestures: true, + ), + errorBuilder: (context, object, stackTrace) { + return Scaffold( + backgroundColor: Colors.black, + body: SafeArea( + child: Column( children: [ SizedBox(height: 32), Text('Файл'), @@ -96,28 +92,28 @@ class _PhotoViewScreenState extends State { ), ), ], - ); - }, + ), + ), ); }, - itemCount: widget.imageUrls.length, - loadingBuilder: (context, event) => Center( - child: Container( - width: 20.0, - height: 20.0, - child: CircularProgressIndicator( - value: event == null ? 0 : event.cumulativeBytesLoaded / event.expectedTotalBytes!, - ), - ), + ); + }, + itemCount: widget.imageUrls.length, + loadingBuilder: (context, event) => Center( + child: Container( + width: 20.0, + height: 20.0, + child: CircularProgressIndicator( + value: event == null ? 0 : event.cumulativeBytesLoaded / event.expectedTotalBytes!, ), - pageController: pageController, - onPageChanged: (page) { - setState(() { - imageIndex = page; - }); - }, ), ), + pageController: pageController, + onPageChanged: (page) { + setState(() { + imageIndex = page; + }); + }, ), ); } diff --git a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart index 127795cc..39a13253 100644 --- a/lib/features/chat/presentation/widgets/chat_bubble_widget.dart +++ b/lib/features/chat/presentation/widgets/chat_bubble_widget.dart @@ -1,8 +1,9 @@ import 'package:cached_network_image/cached_network_image.dart'; +import 'package:dismissible_page/dismissible_page.dart'; +import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart'; import 'package:eatvio_app/theme/app_decoration.dart'; import 'package:flutter/material.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; -import 'package:go_router/go_router.dart'; import 'package:url_launcher/url_launcher.dart'; class ChatBubbleWidget extends StatelessWidget { @@ -71,18 +72,21 @@ class ChatBubbleWidget extends StatelessWidget { } return GestureDetector( onTap: () { - GoRouter.of(context).pushNamed( - 'photoViewScreen', - extra: mediaData!.map((e) => dotenv.env['STORAGE_URL']! + e.toString()).toList(), - pathParameters: { - 'index': index.toString(), - }, + context.pushTransparentRoute( + PhotoViewScreen( + imageUrls: mediaData!.map((e) => dotenv.env['STORAGE_URL']! + e.toString()).toList(), + index: index, + ), ); }, - child: ClipRRect( - borderRadius: BorderRadiusStyle.roundedBorder8, - child: CachedNetworkImage( - imageUrl: dotenv.env['STORAGE_URL']! + '${mediaData![index]}', + child: Hero( + tag: dotenv.env['STORAGE_URL']! + '${mediaData![index]}', + transitionOnUserGestures: true, + child: ClipRRect( + borderRadius: BorderRadiusStyle.roundedBorder8, + child: CachedNetworkImage( + imageUrl: dotenv.env['STORAGE_URL']! + '${mediaData![index]}', + ), ), ), ); diff --git a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart index 48d1ed62..38b15615 100644 --- a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart +++ b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart @@ -175,13 +175,13 @@ class MyProfileScreen extends StatelessWidget { } addImage(BuildContext context) async { - final picker = ImagePicker(); - List? images = await picker.pickMultiImage(); - if (images.isNotEmpty) { - for (var image in images) { - context.read().add(UploadAvatar(image)); - } + final picker = ImagePicker(); + List? images = await picker.pickMultiImage(); + if (images.isNotEmpty) { + for (var image in images) { + context.read().add(UploadAvatar(image)); } + } } onTapSettings(BuildContext context) { @@ -192,7 +192,7 @@ class MyProfileScreen extends StatelessWidget { _buildCarousel(BuildContext contex, MyProfileLoadedState state) { return CarouselSlider( - options: CarouselOptions(height: 320.0), + options: CarouselOptions(height: 340), items: [1, 2, 3].map((chartType) { return Builder( builder: (BuildContext context) { diff --git a/pubspec.yaml b/pubspec.yaml index ad2e28fd..17ba3aae 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A new Flutter project. version: 0.0.0+1 environment: - sdk: '>=3.3.4 <4.0.0' + sdk: ">=3.3.4 <4.0.0" dependencies: flutter: @@ -60,8 +60,9 @@ dependencies: dio: ^5.4.3+1 # websocket pusher_client: ^2.0.0 - # photo gallery viewer + # photo gallery viewer + dismissible page photo_view: ^0.15.0 + dismissible_page: ^1.0.2 #url launcher url_launcher: ^6.3.0 @@ -94,4 +95,4 @@ flutter: - asset: assets/fonts/MulishRegular.ttf weight: 400 - asset: assets/fonts/MulishSemiBold.ttf - weight: 600 \ No newline at end of file + weight: 600 From 6ea4a23ad64dd550eb052738a514046ac8abbfd3 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Tue, 25 Jun 2024 16:01:52 +0300 Subject: [PATCH 3/6] feat(chat): change package for android build --- lib/main.dart | 75 +++++++++++++++++++++------------------------------ pubspec.yaml | 4 ++- 2 files changed, 34 insertions(+), 45 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index ebe22899..b907ba66 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -44,52 +44,39 @@ class MyApp extends StatelessWidget { return MultiBlocProvider( providers: [ BlocProvider(create: (context) => sl()..runInitialization()), - BlocProvider( - create: (context) => ThemeBloc(ThemeState(themeType: PrefUtils().getThemeData())), - ), - BlocProvider( - create: (context) => MyProfileBloc(MyProfileState(myProfileModelObj: MyProfileModel()))..add(MyProfileInitialEvent()), - ), - BlocProvider( - create: (context) => FeedBloc(FeedState(myProfileModelObj: FeedModel()))..add(FeedInitialEvent()), - ), - BlocProvider( - create: (context) => DiaryEditBloc(DiaryEditState(diaryEditModelObj: DiaryEditModel()))..add(DiaryEditInitialEvent()), - ), - BlocProvider( - create: (context) => ChatSelectBloc(ChatSelectState(chatSelectModelObj: ChatSelectModel()))..add(ChatSelectInitialEvent()), - ), + BlocProvider(create: (context) => ThemeBloc(ThemeState(themeType: PrefUtils().getThemeData()))), + BlocProvider(create: (context) => MyProfileBloc(MyProfileState(myProfileModelObj: MyProfileModel()))..add(MyProfileInitialEvent())), + BlocProvider(create: (context) => FeedBloc(FeedState(myProfileModelObj: FeedModel()))..add(FeedInitialEvent())), + BlocProvider(create: (context) => DiaryEditBloc(DiaryEditState(diaryEditModelObj: DiaryEditModel()))..add(DiaryEditInitialEvent())), + BlocProvider(create: (context) => ChatSelectBloc(ChatSelectState(chatSelectModelObj: ChatSelectModel()))..add(ChatSelectInitialEvent())) ], - child: BlocListener( - listener: (BuildContext context, InitializationState state) { }, - child: BlocBuilder( - builder: (context, state) { - return KeyboardDismisser( - gestures: [ - GestureType.onTap, - GestureType.onPanUpdateDownDirection, + child: BlocBuilder( + builder: (context, state) { + return KeyboardDismisser( + gestures: [ + GestureType.onTap, + GestureType.onPanUpdateDownDirection, + ], + child: MaterialApp.router( + theme: theme, + title: 'Eatvio', + routerConfig: AppRouter.appRouter, + debugShowCheckedModeBanner: false, + localizationsDelegates: [ + AppLocalizationDelegate(), + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, ], - child: MaterialApp.router( - theme: theme, - title: 'Eatvio', - routerConfig: AppRouter.appRouter, - debugShowCheckedModeBanner: false, - localizationsDelegates: [ - AppLocalizationDelegate(), - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - ], - supportedLocales: [ - Locale( - 'ru', - '', - ), - ], - ), - ); - }, - ), + supportedLocales: [ + Locale( + 'ru', + '', + ), + ], + ), + ); + }, ), ); } diff --git a/pubspec.yaml b/pubspec.yaml index 17ba3aae..a3986dba 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -59,7 +59,9 @@ dependencies: # http request dio: ^5.4.3+1 # websocket - pusher_client: ^2.0.0 + pusher_client: + git: + url: https://github.com/bihim/pusher_client # photo gallery viewer + dismissible page photo_view: ^0.15.0 dismissible_page: ^1.0.2 From b1b6ffe0f3359f91d3c0391932918dd3d5996077 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Tue, 25 Jun 2024 16:05:55 +0300 Subject: [PATCH 4/6] feat(chat): add trailing comma rules --- analysis_options.yaml | 4 +- lib/core/utils/progress_dialog_utils.dart | 2 +- lib/core/utils/size_utils.dart | 2 +- .../bloc/chat_select_bloc.dart | 4 +- .../widgets/chat_entry_widget.dart | 4 +- lib/localization/app_localization.dart | 2 +- lib/main.dart | 5 +- .../auth/auth_screen/auth_screen.dart | 12 +- .../bloc/diary_edit_bloc.dart | 124 +++++++++--------- .../bloc/diary_edit_event.dart | 2 +- .../bloc/diary_edit_state.dart | 6 +- .../diary_edit_screen/diary_edit_screen.dart | 42 +++--- .../bloc/diet_create_bloc.dart | 10 +- .../diet_create_screen.dart | 10 +- .../diet_edit_screen/bloc/diet_edit_bloc.dart | 4 +- .../bloc/diet_edit_state.dart | 2 +- .../diet_edit_screen/diet_edit_screen.dart | 6 +- .../bloc/diet_select_bloc.dart | 4 +- .../diet_select_screen.dart | 8 +- .../diet_show_screen/diet_show_screen.dart | 8 +- .../bloc/blog_post_create_bloc.dart | 8 +- .../bloc/blog_post_create_state.dart | 4 +- .../blog_post_create_screen.dart | 4 +- .../bloc/blog_post_edit_bloc.dart | 4 +- .../bloc/blog_post_edit_state.dart | 2 +- .../blog_post_edit_screen.dart | 6 +- .../blog_post_screen/bloc/blog_post_bloc.dart | 18 +-- .../bloc/blog_post_state.dart | 6 +- .../blog_post_screen/blog_post_screen.dart | 16 +-- .../models/comment_model.dart | 2 +- .../widgets/comment_widget.dart | 4 +- .../feed/feed_screen/bloc/feed_bloc.dart | 4 +- .../feed/feed_screen/feed_screen.dart | 16 +-- .../feed_screen/widgets/feed_search_view.dart | 6 +- .../bloc/glossary_screen_bloc.dart | 12 +- .../bloc/glossary_screen_state.dart | 4 +- .../glossary_screen/glossary_screen.dart | 24 ++-- .../widgets/glossary_search_widget.dart | 6 +- .../bloc/plan_create_bloc.dart | 10 +- .../plan_create_screen.dart | 8 +- .../plan_edit_screen/bloc/plan_edit_bloc.dart | 4 +- .../bloc/plan_edit_state.dart | 2 +- .../plan_edit_screen/plan_edit_screen.dart | 6 +- .../bloc/plan_select_bloc.dart | 4 +- .../plan_select_screen.dart | 6 +- .../plan_show_screen/plan_show_screen.dart | 8 +- .../bloc/my_profile_bloc.dart | 48 +++---- .../bloc/my_profile_state.dart | 2 +- .../my_profile_screen/my_profile_screen.dart | 46 +++---- .../my_profile_screen/my_settings_screen.dart | 6 +- .../bloc/recipe_create_bloc.dart | 22 ++-- .../bloc/recipe_create_state.dart | 6 +- .../recipe_create_screen.dart | 18 +-- .../bloc/recipe_edit_bloc.dart | 8 +- .../bloc/recipe_edit_state.dart | 2 +- .../recipe_edit_screen.dart | 14 +- .../bloc/recipe_select_bloc.dart | 4 +- .../recipe_select_screen.dart | 6 +- .../bloc/recipe_show_bloc.dart | 8 +- .../bloc/recipe_show_state.dart | 6 +- .../recipe_show_screen.dart | 26 ++-- .../widgets/comment_widget.dart | 4 +- .../additional_information_screen.dart | 28 ++-- .../allergies_screen/allergies_screen.dart | 22 ++-- .../app_navigation_screen.dart | 2 +- .../bloc/blood_pressure_bloc.dart | 4 +- .../blood_pressure_screen.dart | 34 ++--- .../models/blood_pressure_model.dart | 2 +- .../bloc/body_circumferences_bloc.dart | 2 +- .../body_circumferences_screen.dart | 22 ++-- .../bloc/city_of_living_bloc.dart | 2 +- .../city_of_living_screen.dart | 22 ++-- .../models/city_of_living_model.dart | 2 +- .../bloc/credentials_bloc.dart | 2 +- .../credentials_screen.dart | 18 +-- .../date_of_birth_screen.dart | 20 +-- .../bloc/favorite_foods_bloc.dart | 2 +- .../favorite_foods_screen.dart | 28 ++-- .../favorite_sports_screen.dart | 22 ++-- .../gender_screen/gender_screen.dart | 14 +- .../gender_screen/models/gender_model.dart | 2 +- .../height_screen/bloc/height_bloc.dart | 2 +- .../height_screen/height_screen.dart | 6 +- .../height_screen/models/height_model.dart | 2 +- .../bloc/language_select_bloc.dart | 2 +- .../language_select_screen.dart | 2 +- .../medicine_intake_screen.dart | 24 ++-- .../name_screen/bloc/name_bloc.dart | 2 +- .../registration/name_screen/name_screen.dart | 18 +-- .../splash_screen/splash_screen.dart | 8 +- .../weight_screen/bloc/weight_bloc.dart | 2 +- .../weight_screen/models/weight_model.dart | 2 +- .../weight_screen/weight_screen.dart | 6 +- lib/theme/theme_helper.dart | 8 +- lib/widgets/bottom_navigation_bar_widget.dart | 2 +- lib/widgets/custom_about_list.dart | 4 +- lib/widgets/custom_expandable_list.dart | 28 ++-- lib/widgets/custom_hyper_switch.dart | 2 +- lib/widgets/custom_hypo_switch.dart | 2 +- lib/widgets/custom_icon_button.dart | 2 +- lib/widgets/custom_navigation_menu_item.dart | 2 +- lib/widgets/custom_notification_screen.dart | 2 +- test/add_info_test.dart | 2 +- test/allergies_test.dart | 2 +- test/blood_pressure_test.dart | 2 +- test/body_circumferences_test.dart | 2 +- test/city_of_living_test.dart | 2 +- test/credentials_test.dart | 2 +- test/date_of_birth_test.dart | 2 +- test/diary_test.dart | 2 +- test/favorite_foods_test.dart | 2 +- test/favorite_sports_test.dart | 2 +- test/gender_test.dart | 2 +- test/height_test.dart | 2 +- test/language_select_test.dart | 2 +- test/medicine_intake_test.dart | 2 +- test/name_test.dart | 2 +- test/profile_test.dart | 2 +- test/settings_test.dart | 2 +- test/weight_test.dart | 2 +- 120 files changed, 549 insertions(+), 546 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 22f04010..ee447165 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -27,7 +27,9 @@ dart_code_metrics: # maximum-nesting-level: 5 # metrics-exclude: # - test/** -# rules: +linter: + rules: + require_trailing_commas: true # - newline-before-return # - no-boolean-literal-compare # - no-empty-block diff --git a/lib/core/utils/progress_dialog_utils.dart b/lib/core/utils/progress_dialog_utils.dart index ce4da750..98cdac07 100644 --- a/lib/core/utils/progress_dialog_utils.dart +++ b/lib/core/utils/progress_dialog_utils.dart @@ -19,7 +19,7 @@ class ProgressDialogUtils { ), ), ); - }); + },); isProgressVisible = true; } } diff --git a/lib/core/utils/size_utils.dart b/lib/core/utils/size_utils.dart index a6de3e67..55953775 100644 --- a/lib/core/utils/size_utils.dart +++ b/lib/core/utils/size_utils.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; // This functions are responsible to make UI responsive across all the mobile devices. MediaQueryData mediaQueryData = MediaQueryData.fromView( - WidgetsBinding.instance.platformDispatcher.views.single); + WidgetsBinding.instance.platformDispatcher.views.single,); // These are the Viewport values of your Figma Design. // These are used in the code as a reference to create your UI Responsively. diff --git a/lib/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart b/lib/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart index d041db4f..9bd2845c 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart @@ -71,12 +71,12 @@ class ChatSelectBloc extends Bloc { emit(currentState.copyWith( chatSelectModelObj: currentState.chatSelectModelObj, chatRooms: currentState.chatRooms, - )); + ),); } else { emit(ChatSelectLoadedState( chatRooms: fillChatEntryList(data['chatRooms']), //chatRooms: [], - )); + ),); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку diff --git a/lib/features/chat/presentation/pages/chat_select_screen/widgets/chat_entry_widget.dart b/lib/features/chat/presentation/pages/chat_select_screen/widgets/chat_entry_widget.dart index 87a46ab5..334aa657 100644 --- a/lib/features/chat/presentation/pages/chat_select_screen/widgets/chat_entry_widget.dart +++ b/lib/features/chat/presentation/pages/chat_select_screen/widgets/chat_entry_widget.dart @@ -75,7 +75,7 @@ class ChatEntryWidget extends StatelessWidget { chatEntryObj.dateText!, style: theme.textTheme.bodyMedium, ), - ) + ), ], ), SizedBox(height: 6.v), @@ -85,7 +85,7 @@ class ChatEntryWidget extends StatelessWidget { ), ], ), - ) + ), ], ), ), diff --git a/lib/localization/app_localization.dart b/lib/localization/app_localization.dart index 2fc106da..5d003fca 100644 --- a/lib/localization/app_localization.dart +++ b/lib/localization/app_localization.dart @@ -26,7 +26,7 @@ class AppLocalization { return AppLocalization(Locale( 'ru', '', - )); // Возвращаем дефолтное значение или обработку ошибки + ),); // Возвращаем дефолтное значение или обработку ошибки } } diff --git a/lib/main.dart b/lib/main.dart index b907ba66..e1f081ee 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,5 @@ import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart'; -import 'package:eatvio_app/core/initialization_cubit/initialization_state.dart'; import 'package:eatvio_app/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart'; import 'package:eatvio_app/features/chat/presentation/pages/chat_select_screen/models/chat_select_model.dart'; import 'package:eatvio_app/locator_service.dart'; @@ -48,7 +47,9 @@ class MyApp extends StatelessWidget { BlocProvider(create: (context) => MyProfileBloc(MyProfileState(myProfileModelObj: MyProfileModel()))..add(MyProfileInitialEvent())), BlocProvider(create: (context) => FeedBloc(FeedState(myProfileModelObj: FeedModel()))..add(FeedInitialEvent())), BlocProvider(create: (context) => DiaryEditBloc(DiaryEditState(diaryEditModelObj: DiaryEditModel()))..add(DiaryEditInitialEvent())), - BlocProvider(create: (context) => ChatSelectBloc(ChatSelectState(chatSelectModelObj: ChatSelectModel()))..add(ChatSelectInitialEvent())) + BlocProvider( + create: (context) => ChatSelectBloc(ChatSelectState(chatSelectModelObj: ChatSelectModel()))..add(ChatSelectInitialEvent()), + ), ], child: BlocBuilder( builder: (context, state) { diff --git a/lib/presentation/auth/auth_screen/auth_screen.dart b/lib/presentation/auth/auth_screen/auth_screen.dart index 9694a2c9..4a74ba36 100644 --- a/lib/presentation/auth/auth_screen/auth_screen.dart +++ b/lib/presentation/auth/auth_screen/auth_screen.dart @@ -50,7 +50,7 @@ class AuthScreen extends StatelessWidget { selector: (state) => state.emailController, builder: (context, emailController) { return CustomTextFormField(controller: emailController, textInputAction: TextInputAction.done); - }), + },), SizedBox(height: 22.v), Text("password".tr, style: theme.textTheme.bodyLarge), SizedBox(height: 5.v), @@ -61,7 +61,7 @@ class AuthScreen extends StatelessWidget { obscureText: true, controller: passwordController, ); - }), + },), SizedBox(height: 50.v), NextStepButton( text: "no_account".tr.toUpperCase(), @@ -86,9 +86,9 @@ class AuthScreen extends StatelessWidget { text: "authentificate".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapAuth(state, context)); - }), - ])))); + onPressed: onTapAuth(state, context),); + },), + ],),),),); } onTapAuth(AuthState state, BuildContext context) { @@ -100,7 +100,7 @@ class AuthScreen extends StatelessWidget { 'password': state.passwordController!.text, }; final response = await http.post(Uri.parse(dotenv.env['SERVER_ROOT']! + '/login'), - headers: {'Content-Type': 'application/json'}, body: json.encode(credentials), encoding: utf8); + headers: {'Content-Type': 'application/json'}, body: json.encode(credentials), encoding: utf8,); print(response.statusCode); if (response.statusCode == 200) { var res = await jsonDecode(response.body); diff --git a/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_bloc.dart b/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_bloc.dart index 44741105..591cad6f 100644 --- a/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_bloc.dart +++ b/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_bloc.dart @@ -29,15 +29,15 @@ class DiaryEditBloc extends Bloc { on(_addPortion); //пользователь нажимает "Добавить продукт" on(_removePortion); on( - _removeImage); // пользователь нажимает на крестик около продукта + _removeImage,); // пользователь нажимает на крестик около продукта on(_uploadImages); //пользователь нажимает "Добавить фото" on(_addComment); //пользователь нажимает "Добавить комментарий" on( - _inputProduct); //пользователь нажимает "Добавить комментарий" + _inputProduct,); //пользователь нажимает "Добавить комментарий" on(_finishDay); //пользователь нажимает "Добавить комментарий" on(_sendModeration); on( - reloadScreen); //пользователь нажимает "Добавить комментарий" + reloadScreen,); //пользователь нажимает "Добавить комментарий" on(_clearInput); } @@ -89,7 +89,7 @@ class DiaryEditBloc extends Bloc { recommendedChartValues: currentState.recommendedChartValues, consumedChartValues: currentState.consumedChartValues, autocompleteList: currentState.autocompleteList, - diaryEditModelObj: currentState.diaryEditModelObj)); + diaryEditModelObj: currentState.diaryEditModelObj,),); } else { // Если текущее состояние - начальное, создаем новое загруженное состояние final List meals = @@ -97,7 +97,7 @@ class DiaryEditBloc extends Bloc { emit(DiaryEditLoadedState( currentMeal: meals[0], portionController: SelectionPopupModel( - id: 0, title: "порций", isSelected: true), + id: 0, title: "порций", isSelected: true,), wakeupExpanded: true, moodExpanded: true, moderationExpanded: false, @@ -125,7 +125,7 @@ class DiaryEditBloc extends Bloc { diaryDate: diaryDate, autocompleteList: [], diaryEditModelObj: state.diaryEditModelObj - ?.copyWith(mealList: meals, portionList: fillPortions()))); + ?.copyWith(mealList: meals, portionList: fillPortions()),),); } } } catch (e) { @@ -177,10 +177,10 @@ class DiaryEditBloc extends Bloc { } fetchChartValues( - String token, int diaryID, Emitter emit) async { + String token, int diaryID, Emitter emit,) async { final responseChart = await http.get( Uri.parse( - dotenv.env['SERVER_ROOT']! + '/diary/$diaryID/dailyNutritionData/'), + dotenv.env['SERVER_ROOT']! + '/diary/$diaryID/dailyNutritionData/',), headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer $token', @@ -250,7 +250,7 @@ class DiaryEditBloc extends Bloc { final String diaryDate = diary['date'] ?? DateTime.now().toString(); final responseChart = await http.get( Uri.parse(dotenv.env['SERVER_ROOT']! + - '/diary/$diaryId/dailyNutritionData/'), + '/diary/$diaryId/dailyNutritionData/',), headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer $token', @@ -258,7 +258,7 @@ class DiaryEditBloc extends Bloc { ); if (responseChart.statusCode == 200) { final recommendedChartValues = jsonDecode( - responseChart.body)['dailyNutritionRecommendation']; + responseChart.body,)['dailyNutritionRecommendation']; final consumedChartValues = jsonDecode(responseChart.body)['dailyNutritionIntake']; final List meals = @@ -266,10 +266,10 @@ class DiaryEditBloc extends Bloc { try { await Future(() => emit(DiaryEditLoadedState( diaryEditModelObj: state.diaryEditModelObj?.copyWith( - mealList: meals, portionList: fillPortions()), + mealList: meals, portionList: fillPortions(),), currentMeal: meals[0], portionController: SelectionPopupModel( - id: 0, title: "порций", isSelected: true), + id: 0, title: "порций", isSelected: true,), wakeupExpanded: true, moodExpanded: true, moderationExpanded: false, @@ -301,7 +301,7 @@ class DiaryEditBloc extends Bloc { diaryDate: diaryDate, isLoading: false, autocompleteList: [], - ))); + ),),); print("Updated"); } catch (e) { @@ -312,11 +312,11 @@ class DiaryEditBloc extends Bloc { } } else { emit(DiaryEditErrorState( - 'Ошибка при декодировании данных дневника')); + 'Ошибка при декодировании данных дневника',),); } } else { emit( - DiaryEditErrorState('Некоторые необходимые данные отсутствуют.')); + DiaryEditErrorState('Некоторые необходимые данные отсутствуют.'),); } } else { emit(DiaryEditErrorState('Ошибка сервера: ${response.statusCode}')); @@ -327,7 +327,7 @@ class DiaryEditBloc extends Bloc { } Future _changeSatiety( - ChangeSatiety event, Emitter emit) async { + ChangeSatiety event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; var updatedState = @@ -338,7 +338,7 @@ class DiaryEditBloc extends Bloc { currentState.token, event.selectedElement, currentState.currentMeal?.id, - currentState.diaryId); + currentState.diaryId,); if (response.statusCode == 200) { updatedState.selectedSatiety = event.selectedElement; @@ -364,12 +364,12 @@ class DiaryEditBloc extends Bloc { 'Authorization': 'Bearer $token', }, body: json.encode(credentials), - encoding: utf8); + encoding: utf8,); return response; } Future _changeMood( - ChangeMood event, Emitter emit) async { + ChangeMood event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; var updatedState = @@ -380,11 +380,11 @@ class DiaryEditBloc extends Bloc { currentState.token, event.selectedElement, currentState.currentMeal?.id, - currentState.diaryId); + currentState.diaryId,); if (response.statusCode == 200) { print( - 'Mood change success! meal_id: ${currentState.currentMeal?.id}, mood: ${event.selectedElement}'); + 'Mood change success! meal_id: ${currentState.currentMeal?.id}, mood: ${event.selectedElement}',); updatedState.selectedMood = event.selectedElement; emit(updatedState); // Передаем обновленное состояние в emit } @@ -409,17 +409,17 @@ class DiaryEditBloc extends Bloc { 'Authorization': 'Bearer $token', }, body: json.encode(credentials), - encoding: utf8); + encoding: utf8,); return response; } FutureOr _changeWakeup( - WakeupEvent event, Emitter emit) async { + WakeupEvent event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; var response = await sendWakeupData( - currentState.token, event.selectedTime, currentState.diaryId); + currentState.token, event.selectedTime, currentState.diaryId,); if (response.statusCode == 200) { await reloadScreen(event, emit); var updatedState = @@ -432,11 +432,11 @@ class DiaryEditBloc extends Bloc { } FutureOr _changeRetire( - RetireEvent event, Emitter emit) async { + RetireEvent event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; var response = await sendRetireData( - currentState.token, event.selectedTime, currentState.diaryId); + currentState.token, event.selectedTime, currentState.diaryId,); if (response.statusCode == 200) { await reloadScreen(event, emit); var updatedState = @@ -467,13 +467,13 @@ class DiaryEditBloc extends Bloc { 'Authorization': 'Bearer $token', }, body: json.encode(credentials), - encoding: utf8); + encoding: utf8,); return response; } Future sendRetireData( - String? token, TimeOfDay retire, int diaryID) async { + String? token, TimeOfDay retire, int diaryID,) async { String url = dotenv.env['SERVER_ROOT']! + '/diary/$diaryID/retire/fill'; final formatter = DateFormat('HH:mm'); final retireString = @@ -488,13 +488,13 @@ class DiaryEditBloc extends Bloc { 'Authorization': 'Bearer $token', }, body: json.encode(credentials), - encoding: utf8); + encoding: utf8,); return response; } FutureOr _changeMealTime( - ChangeMealTime event, Emitter emit) async { + ChangeMealTime event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; var updatedState = currentState.copyWith(mealTimeController: event.time); @@ -522,18 +522,18 @@ class DiaryEditBloc extends Bloc { 'Authorization': 'Bearer $token', }, body: json.encode(credentials), - encoding: utf8); + encoding: utf8,); return response; } FutureOr _changeMeal( - ChangeMeal event, Emitter emit) async { + ChangeMeal event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; final meal = currentState.meals?.firstWhere( (meal) => meal['id'] == event.value.id, - orElse: () => null); + orElse: () => null,); int? id = event.value.id; print(meal['photos']); DiaryEditLoadedState updatedState = currentState.copyWith( @@ -542,7 +542,7 @@ class DiaryEditBloc extends Bloc { photos: meal['photos'], mealTimeController: toTime(meal['time'] ?? "1$id:00"), selectedMood: meal['mood'], - selectedSatiety: meal['satiety']); + selectedSatiety: meal['satiety'],); print(updatedState.photos); emit(updatedState); } @@ -550,7 +550,7 @@ class DiaryEditBloc extends Bloc { FutureOr _clearInput( - ClearInput event, Emitter emit) { + ClearInput event, Emitter emit,) { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; DiaryEditLoadedState updatedState = currentState.copyWith( @@ -560,7 +560,7 @@ class DiaryEditBloc extends Bloc { } FutureOr _changePortion( - ChangePortion event, Emitter emit) { + ChangePortion event, Emitter emit,) { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; DiaryEditLoadedState updatedState = currentState.copyWith( @@ -571,7 +571,7 @@ class DiaryEditBloc extends Bloc { } FutureOr _toggleMood( - ToggleMoodExpandedEvent event, Emitter emit) { + ToggleMoodExpandedEvent event, Emitter emit,) { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; @@ -581,7 +581,7 @@ class DiaryEditBloc extends Bloc { } FutureOr _toggleWakeup( - ToggleWakeupExpandedEvent event, Emitter emit) { + ToggleWakeupExpandedEvent event, Emitter emit,) { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; @@ -591,7 +591,7 @@ class DiaryEditBloc extends Bloc { } FutureOr _addPortion( - AddPortionEvent event, Emitter emit) async { + AddPortionEvent event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; @@ -609,13 +609,13 @@ class DiaryEditBloc extends Bloc { await reloadScreen(event, emit); } else { print( - 'Failed to add portion. Status Code: ${response.statusCode} ${response.body}'); + 'Failed to add portion. Status Code: ${response.statusCode} ${response.body}',); } } } FutureOr sendPortionData(String? token, String? name, - String portion, int? quantity, int? mealID, int diaryID) async { + String portion, int? quantity, int? mealID, int diaryID,) async { String url = '${dotenv.env['SERVER_ROOT']!}/diary/$diaryID/meal/$mealID/portions/create'; @@ -639,14 +639,14 @@ class DiaryEditBloc extends Bloc { } Future _inputProduct( - ProductInput event, Emitter emit) async { + ProductInput event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; String? token = currentState.token; final Map credentials = {'name': event.input}; final uri = Uri.parse( - '${dotenv.env['SERVER_ROOT']!}/diary/product_nutritional_values/filter?${Uri(queryParameters: credentials).query}'); + '${dotenv.env['SERVER_ROOT']!}/diary/product_nutritional_values/filter?${Uri(queryParameters: credentials).query}',); final response = await http.get( uri, @@ -679,7 +679,7 @@ class DiaryEditBloc extends Bloc { } Future _removePortion( - RemovePortionEvent event, Emitter emit) async { + RemovePortionEvent event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; @@ -697,13 +697,13 @@ class DiaryEditBloc extends Bloc { await reloadScreen(event, emit); } else { print( - 'Failed to add portion. Status Code: ${response.statusCode} ${response.body}'); + 'Failed to add portion. Status Code: ${response.statusCode} ${response.body}',); } } } Future sendRemovePortion( - String? token, int? portionID, int? mealID, int diaryID) async { + String? token, int? portionID, int? mealID, int diaryID,) async { String url = '${dotenv.env['SERVER_ROOT']!}/diary/$diaryID/meal/$mealID/portions/$portionID/delete'; @@ -720,7 +720,7 @@ class DiaryEditBloc extends Bloc { } FutureOr _removeImage( - RemoveImageEvent event, Emitter emit) async { + RemoveImageEvent event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; @@ -736,13 +736,13 @@ class DiaryEditBloc extends Bloc { await reloadScreen(event, emit); } else { print( - 'Failed to remove photo. Status Code: ${response.statusCode} ${response.body}'); + 'Failed to remove photo. Status Code: ${response.statusCode} ${response.body}',); } } } Future sendRemovePhoto(String? token, String? path, - String? photoID, int? mealID, int diaryID) async { + String? photoID, int? mealID, int diaryID,) async { String url = '${dotenv.env['SERVER_ROOT']!}/diary/$diaryID/meal/$mealID/photo/delete'; final Map credentials = { @@ -781,7 +781,7 @@ class DiaryEditBloc extends Bloc { } Future sendFinishDay(String? token, int diaryID, - TimeOfDay? wakeup, TimeOfDay? retire, String? comment) async { + TimeOfDay? wakeup, TimeOfDay? retire, String? comment,) async { final formatter = DateFormat('HH:mm'); final wakeupString = formatter.format(DateTime(2022, 1, 1, wakeup!.hour, wakeup.minute)); @@ -810,19 +810,19 @@ class DiaryEditBloc extends Bloc { } Future _uploadImages( - UploadImages event, Emitter emit) async { + UploadImages event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; emit(currentState.copyWith(isLoading: true)); await uploadImageToServer(event.image.path, currentState.diaryId, - currentState.currentMeal!.id!, currentState.token); + currentState.currentMeal!.id!, currentState.token,); await reloadScreen(event, emit); } } Future uploadImageToServer( - String imagePath, int diaryID, int mealId, String? token) async { + String imagePath, int diaryID, int mealId, String? token,) async { String url = '${dotenv.env['SERVER_ROOT']!}/diary/$diaryID/meal/$mealId/photo/upload'; @@ -841,12 +841,12 @@ class DiaryEditBloc extends Bloc { return imageUrl; } else { throw Exception( - 'Failed to upload image. Status code: ${streamedResponse.statusCode}}'); + 'Failed to upload image. Status code: ${streamedResponse.statusCode}}',); } } FutureOr _sendModeration( - SendModeration event, Emitter emit) async { + SendModeration event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; final response = await _sendModerationData( @@ -871,9 +871,9 @@ class DiaryEditBloc extends Bloc { String proteins_on_100gr, String fats_on_100gr, String carbohydrates_on_100gr, - String? token) async { + String? token,) async { final Uri url = Uri.parse( - '${dotenv.env['SERVER_ROOT']!}/diary/product_nutritional_values/sendToModeration'); + '${dotenv.env['SERVER_ROOT']!}/diary/product_nutritional_values/sendToModeration',); final Uri serverURL = Uri.parse('${dotenv.env['SERVER_ROOT']!}'); String host = serverURL.host; final Map credentials = { @@ -901,12 +901,12 @@ class DiaryEditBloc extends Bloc { return response; } else { throw Exception( - 'Failed to send a product for moderation ${response.statusCode}'); + 'Failed to send a product for moderation ${response.statusCode}',); } } FutureOr _addComment( - AddComment event, Emitter emit) async { + AddComment event, Emitter emit,) async { if (state is DiaryEditLoadedState) { var currentState = state as DiaryEditLoadedState; var updatedState = currentState.copyWith( @@ -915,7 +915,7 @@ class DiaryEditBloc extends Bloc { // Отправляем данные по HTTP маршруту и ждем ответ var response = await sendCommentData( - currentState.token, event.comment, currentState.diaryId); + currentState.token, event.comment, currentState.diaryId,); if (response.statusCode == 200) { emit(updatedState); // Передаем обновленное состояние в emit @@ -924,7 +924,7 @@ class DiaryEditBloc extends Bloc { } Future sendCommentData( - String? token, String comment, int diaryID) async { + String? token, String comment, int diaryID,) async { String url = dotenv.env['SERVER_ROOT']! + '/diary/$diaryID/retire/fill'; final Map credentials = { 'comment': comment, @@ -936,7 +936,7 @@ class DiaryEditBloc extends Bloc { 'Authorization': 'Bearer $token', }, body: json.encode(credentials), - encoding: utf8); + encoding: utf8,); return response; } diff --git a/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_event.dart b/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_event.dart index 8185fa28..c2c5dad3 100644 --- a/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_event.dart +++ b/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_event.dart @@ -159,7 +159,7 @@ class SendModeration extends DiaryEditEvent { required this.energyOn100gr, required this.proteinsOn100gr, required this.fatsOn100gr, - required this.carbohydratesOn100gr}); + required this.carbohydratesOn100gr,}); String name; String energyOn100gr; String proteinsOn100gr; diff --git a/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_state.dart b/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_state.dart index 61762f0e..fc8e1979 100644 --- a/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_state.dart +++ b/lib/presentation/diary/diary_edit_screen/bloc/diary_edit_state.dart @@ -47,7 +47,7 @@ class DiaryEditLoadedState extends DiaryEditState { required this.selectedSatiety, required this.moderationExpanded, required this.wakeupExpanded, - required this.moodExpanded}) + required this.moodExpanded,}) : super(diaryEditModelObj: null); DiaryEditModel? diaryEditModelObj; @@ -109,7 +109,7 @@ class DiaryEditLoadedState extends DiaryEditState { moderationExpanded, isLoading, isAdded, - currentMeal + currentMeal, ]; DiaryEditLoadedState copyWith({ DiaryEditModel? diaryEditModelObj, @@ -174,7 +174,7 @@ class DiaryEditLoadedState extends DiaryEditState { moderationExpanded: moderationExpanded ?? this.moderationExpanded, moodExpanded: moodExpanded ?? this.moodExpanded, isAdded: isAdded ?? this.isAdded, - isLoading: isLoading ?? this.isLoading); + isLoading: isLoading ?? this.isLoading,); } } diff --git a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart index e2be9487..77aa77f5 100644 --- a/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart +++ b/lib/presentation/diary/diary_edit_screen/diary_edit_screen.dart @@ -21,7 +21,7 @@ class DiaryEditScreen extends StatelessWidget { static Widget builder(BuildContext context) { return BlocProvider( - create: (context) => DiaryEditBloc(DiaryEditState(diaryEditModelObj: DiaryEditModel()))..add(DiaryEditInitialEvent()), child: DiaryEditScreen()); + create: (context) => DiaryEditBloc(DiaryEditState(diaryEditModelObj: DiaryEditModel()))..add(DiaryEditInitialEvent()), child: DiaryEditScreen(),); } Widget build(BuildContext context) { @@ -221,7 +221,7 @@ class DiaryEditScreen extends StatelessWidget { Icon( Icons.photo_library, color: appTheme.blueGray300, - ) + ), ], ), ), @@ -332,7 +332,7 @@ class DiaryEditScreen extends StatelessWidget { defaultValue: diaryEditModelObj?.mealList[0], onChanged: changeMeal(context, state), ); - })), + },),), SizedBox(height: 20.v), Padding( padding: EdgeInsets.symmetric(horizontal: 10.h), @@ -381,7 +381,7 @@ class DiaryEditScreen extends StatelessWidget { ), ), ); - }), + },), ), SizedBox(height: 20.v), if (state.moderationExpanded) @@ -492,9 +492,9 @@ class DiaryEditScreen extends StatelessWidget { return Container(); // Возвращаем пустой контейнер, если состояние не является DiaryEditLoadedState } }, - ) + ), ], - )); + ),); } openCaloriesDialog(BuildContext context, DiaryEditLoadedState state) { @@ -543,7 +543,7 @@ class DiaryEditScreen extends StatelessWidget { ), TextButton( onPressed: triggerModeration(context, state.productNameController!.text, state.caloriesController!.text, state.proteinsController!.text, - state.fatsController!.text, state.carbsController!.text, dialogContext), + state.fatsController!.text, state.carbsController!.text, dialogContext,), child: Text('Отправить'), ), ], @@ -553,11 +553,11 @@ class DiaryEditScreen extends StatelessWidget { } triggerModeration(BuildContext context, String name, String energyOn100gr, String proteinsOn100gr, String fatsOn100gr, String carbohydratesOn100gr, - BuildContext dialogContext) { + BuildContext dialogContext,) { return () { // Call function to send moderation with the entered values context.read().add(SendModeration( - name: name, energyOn100gr: energyOn100gr, proteinsOn100gr: proteinsOn100gr, fatsOn100gr: fatsOn100gr, carbohydratesOn100gr: carbohydratesOn100gr)); + name: name, energyOn100gr: energyOn100gr, proteinsOn100gr: proteinsOn100gr, fatsOn100gr: fatsOn100gr, carbohydratesOn100gr: carbohydratesOn100gr,),); Navigator.of(dialogContext).pop(); // Dismiss the dialog }; } @@ -647,7 +647,7 @@ class DiaryEditScreen extends StatelessWidget { child: Text( portion['product_name'].length > 8 ? portion['product_name'].substring(0, 8) : portion['product_name'], style: CustomTextStyles.titleMedium16, - )), + ),), Padding( padding: EdgeInsets.only( left: 20.h, @@ -667,7 +667,7 @@ class DiaryEditScreen extends StatelessWidget { Icons.close, color: appTheme.blueGray300, ), - )), + ),), ], ), ); @@ -783,26 +783,26 @@ class DiaryEditScreen extends StatelessWidget { BarChartRodData( toY: consumedValues[0] / recommendedValues[0] * 100, color: checkConsumedValues([recommendedValues[0]], [consumedValues[1]]) ? Colors.red : Colors.blue, - ) - ]), + ), + ],), BarChartGroupData(x: 1, barRods: [ BarChartRodData( toY: consumedValues[1] / recommendedValues[1] * 100, color: checkConsumedValues([recommendedValues[1]], [consumedValues[1]]) ? Colors.red : Colors.blue, - ) - ]), + ), + ],), BarChartGroupData(x: 2, barRods: [ BarChartRodData( toY: consumedValues[2] / recommendedValues[2] * 100, color: checkConsumedValues([recommendedValues[2]], [consumedValues[2]]) ? Colors.red : Colors.blue, - ) - ]), + ), + ],), BarChartGroupData(x: 3, barRods: [ BarChartRodData( toY: consumedValues[3] / recommendedValues[3] * 100, color: checkConsumedValues([recommendedValues[3]], [consumedValues[3]]) ? Colors.red : Colors.blue, - ) - ]), + ), + ],), ], ), ), @@ -909,7 +909,7 @@ class DiaryEditScreen extends StatelessWidget { Text( "*Превышенная суточная норма", style: theme.textTheme.labelLarge, - ) + ), ], ), ); @@ -1147,7 +1147,7 @@ class DiaryEditScreen extends StatelessWidget { // Остальные элементы шкалы ], ), - ])); + ],),); } changeMood(BuildContext context, int satiety) { diff --git a/lib/presentation/diets/diet_create_screen/bloc/diet_create_bloc.dart b/lib/presentation/diets/diet_create_screen/bloc/diet_create_bloc.dart index e4e0cbc8..a28b79de 100644 --- a/lib/presentation/diets/diet_create_screen/bloc/diet_create_bloc.dart +++ b/lib/presentation/diets/diet_create_screen/bloc/diet_create_bloc.dart @@ -36,17 +36,17 @@ class DietCreateBloc extends Bloc { dietModelObj: currentState.dietModelObj, name: currentState.name, details: currentState.details, - )); + ),); } else { emit(DietCreateLoadedState( name: TextEditingController(), details: TextEditingController(), - )); + ),); } } FutureOr _createDiet( - CreateDiet event, Emitter emit) async { + CreateDiet event, Emitter emit,) async { if (state is DietCreateLoadedState) { var currentState = state as DietCreateLoadedState; @@ -59,7 +59,7 @@ class DietCreateBloc extends Bloc { AppRouter.navigatorKey.currentContext?.goNamed('dietSelectScreen'); } else { print( - 'Failed to create blog post. Status Code: ${response.statusCode} ${response.body}'); + 'Failed to create blog post. Status Code: ${response.statusCode} ${response.body}',); } } } @@ -77,7 +77,7 @@ class DietCreateBloc extends Bloc { 'state': 'active', 'type': '{"meat": true}', 'daily_schedule': - '{"1": {"lunch": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 494}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 12}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 432}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 195}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 710}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "grams", "quantity": 119}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 287}], "snacks": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 445}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "grams", "quantity": 500}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 764}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 735}], "breakfast": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 127}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 89}]}, "2": {"lunch": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 436}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 700}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 766}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 194}], "dinner": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 426}], "snacks": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 58}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 152}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 925}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 224}], "breakfast": [{"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 918}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 81}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 308}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 579}]}, "3": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 266}], "dinner": [{"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 790}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 26}], "snacks": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 549}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 446}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "grams", "quantity": 406}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 92}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 403}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 894}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 457}]}, "4": {"lunch": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 698}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 43}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 994}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 965}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 42}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 948}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 28}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 54}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 112}], "supper": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 891}], "breakfast": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 538}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 635}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "pcs", "quantity": 586}]}, "5": {"lunch": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 900}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "milliliters", "quantity": 242}], "dinner": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 375}], "snacks": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 604}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 510}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 887}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 554}], "supper": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 731}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 574}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 274}], "breakfast": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 276}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 80}]}, "6": {"lunch": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 359}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 358}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 639}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 861}], "dinner": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 124}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 122}], "snacks": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 980}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 837}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 444}], "supper": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 577}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 706}], "breakfast": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 839}]}, "7": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 118}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 664}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 665}], "dinner": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 986}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 296}], "snacks": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 807}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 493}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "milliliters", "quantity": 227}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 385}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 448}], "breakfast": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 784}]}, "8": {"lunch": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 433}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 871}], "dinner": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 332}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 41}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 388}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 649}], "supper": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 114}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "milliliters", "quantity": 968}], "breakfast": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 180}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 269}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 998}]}, "9": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 68}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 505}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 554}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 579}], "snacks": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 751}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 144}], "supper": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 677}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 263}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "pcs", "quantity": 304}], "breakfast": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 963}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 258}]}, "10": {"lunch": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 167}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 306}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 243}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 79}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 560}], "snacks": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 294}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 145}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 639}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 108}], "supper": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 924}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 894}], "breakfast": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 280}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 336}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 338}]}, "11": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 817}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 968}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 525}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 864}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 457}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 548}], "snacks": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 658}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 239}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 358}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 406}], "supper": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "grams", "quantity": 416}], "breakfast": [{"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 220}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 323}]}, "12": {"lunch": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 377}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 138}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 654}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 237}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 902}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 76}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 723}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 481}], "breakfast": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 571}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 515}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 188}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 411}]}, "13": {"lunch": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 379}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 231}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 376}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 147}], "dinner": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 871}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 679}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 359}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 561}], "snacks": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 414}], "supper": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 827}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 649}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 363}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 161}], "breakfast": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 185}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 464}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 387}]}, "14": {"lunch": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 248}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 5}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 693}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 655}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 709}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 881}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 588}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 36}], "snacks": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 453}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 692}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 186}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 721}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 740}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 731}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 842}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 850}]}, "15": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 124}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 380}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 211}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 689}], "dinner": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 326}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 629}], "snacks": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 201}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 129}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 749}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 315}], "breakfast": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 444}]}, "16": {"lunch": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 953}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 101}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 684}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 506}], "dinner": [{"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 333}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 416}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 796}], "snacks": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 799}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 799}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 756}], "supper": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 858}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 619}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 800}], "breakfast": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 363}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 539}]}, "17": {"lunch": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 134}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 977}], "snacks": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 211}], "supper": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 209}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "grams", "quantity": 227}], "breakfast": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 195}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 917}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 706}]}, "18": {"lunch": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "pcs", "quantity": 296}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 239}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 798}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 155}], "dinner": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 959}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 958}], "snacks": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 984}], "supper": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 134}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 432}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 242}]}, "19": {"lunch": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 906}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 152}], "dinner": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 610}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 605}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 498}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 616}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 512}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 146}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 200}], "supper": [{"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 764}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 353}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 181}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 783}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 506}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 887}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 130}]}, "20": {"lunch": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 48}], "dinner": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 266}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 143}], "snacks": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 55}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 174}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 855}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 6}], "supper": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 296}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 878}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 376}], "breakfast": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 442}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 528}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "milliliters", "quantity": 558}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 885}]}, "21": {"lunch": [{"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 504}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 652}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 996}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 200}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 641}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 87}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 689}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 143}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 528}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 475}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 924}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 98}], "breakfast": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 438}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 383}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 462}]}}' + '{"1": {"lunch": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 494}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 12}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 432}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 195}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 710}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "grams", "quantity": 119}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 287}], "snacks": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 445}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "grams", "quantity": 500}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 764}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 735}], "breakfast": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 127}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 89}]}, "2": {"lunch": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 436}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 700}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 766}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 194}], "dinner": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 426}], "snacks": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 58}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 152}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 925}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 224}], "breakfast": [{"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 918}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 81}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 308}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 579}]}, "3": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 266}], "dinner": [{"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 790}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 26}], "snacks": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 549}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 446}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "grams", "quantity": 406}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 92}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 403}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 894}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 457}]}, "4": {"lunch": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 698}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 43}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 994}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 965}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 42}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 948}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 28}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 54}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 112}], "supper": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 891}], "breakfast": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 538}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 635}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "pcs", "quantity": 586}]}, "5": {"lunch": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 900}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "milliliters", "quantity": 242}], "dinner": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 375}], "snacks": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 604}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 510}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 887}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 554}], "supper": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 731}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 574}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 274}], "breakfast": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 276}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 80}]}, "6": {"lunch": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 359}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 358}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 639}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 861}], "dinner": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 124}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 122}], "snacks": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 980}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 837}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 444}], "supper": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 577}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 706}], "breakfast": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 839}]}, "7": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 118}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 664}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 665}], "dinner": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 986}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 296}], "snacks": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 807}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 493}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "milliliters", "quantity": 227}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 385}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 448}], "breakfast": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 784}]}, "8": {"lunch": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 433}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 871}], "dinner": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 332}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 41}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 388}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 649}], "supper": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 114}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "milliliters", "quantity": 968}], "breakfast": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 180}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 269}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 998}]}, "9": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 68}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 505}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 554}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 579}], "snacks": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 751}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 144}], "supper": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 677}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 263}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "pcs", "quantity": 304}], "breakfast": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 963}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 258}]}, "10": {"lunch": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 167}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 306}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 243}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 79}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 560}], "snacks": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 294}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 145}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 639}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 108}], "supper": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 924}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 894}], "breakfast": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 280}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 336}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 338}]}, "11": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 817}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 968}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 525}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 864}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 457}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 548}], "snacks": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 658}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 239}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 358}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 406}], "supper": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "grams", "quantity": 416}], "breakfast": [{"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 220}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 323}]}, "12": {"lunch": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 377}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 138}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 654}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 237}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 902}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 76}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 723}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 481}], "breakfast": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 571}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 515}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 188}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 411}]}, "13": {"lunch": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 379}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 231}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 376}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 147}], "dinner": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 871}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 679}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 359}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 561}], "snacks": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 414}], "supper": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 827}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 649}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 363}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 161}], "breakfast": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 185}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 464}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 387}]}, "14": {"lunch": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 248}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 5}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 693}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 655}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 709}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 881}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 588}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 36}], "snacks": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 453}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 692}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 186}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 721}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 740}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 731}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 842}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 850}]}, "15": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 124}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 380}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 211}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 689}], "dinner": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 326}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 629}], "snacks": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 201}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 129}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 749}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 315}], "breakfast": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 444}]}, "16": {"lunch": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 953}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 101}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 684}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 506}], "dinner": [{"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 333}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 416}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 796}], "snacks": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 799}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 799}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 756}], "supper": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 858}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 619}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 800}], "breakfast": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 363}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 539}]}, "17": {"lunch": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 134}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 977}], "snacks": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 211}], "supper": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 209}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "grams", "quantity": 227}], "breakfast": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 195}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 917}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 706}]}, "18": {"lunch": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "pcs", "quantity": 296}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 239}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 798}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 155}], "dinner": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 959}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 958}], "snacks": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 984}], "supper": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 134}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 432}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 242}]}, "19": {"lunch": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 906}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 152}], "dinner": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 610}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 605}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 498}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 616}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 512}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 146}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 200}], "supper": [{"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 764}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 353}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 181}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 783}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 506}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 887}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 130}]}, "20": {"lunch": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 48}], "dinner": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 266}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 143}], "snacks": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 55}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 174}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 855}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 6}], "supper": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 296}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 878}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 376}], "breakfast": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 442}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 528}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "milliliters", "quantity": 558}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 885}]}, "21": {"lunch": [{"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 504}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 652}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 996}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 200}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 641}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 87}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 689}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 143}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 528}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 475}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 924}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 98}], "breakfast": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 438}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 383}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 462}]}}', }; var response = await http.post( diff --git a/lib/presentation/diets/diet_create_screen/diet_create_screen.dart b/lib/presentation/diets/diet_create_screen/diet_create_screen.dart index 516a9312..619e8f71 100644 --- a/lib/presentation/diets/diet_create_screen/diet_create_screen.dart +++ b/lib/presentation/diets/diet_create_screen/diet_create_screen.dart @@ -10,7 +10,7 @@ class DietCreateScreen extends StatelessWidget { final dietID = ModalRoute.of(context)!.settings.arguments; return BlocProvider( create: (context) => DietCreateBloc(DietCreateState(dietModelObj: DietCreateModel(dietID: dietID.toString())))..add(DietCreateInitialEvent()), - child: DietCreateScreen()); + child: DietCreateScreen(),); } Widget build(BuildContext context) { @@ -80,10 +80,10 @@ class DietCreateScreen extends StatelessWidget { ElevatedButton( onPressed: () => context.read().add(CreateDiet()), child: Text('Создать'), - ) - ]), - ) - ]), + ), + ],), + ), + ],), ), ), ); diff --git a/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_bloc.dart b/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_bloc.dart index e69101c0..22cc1aa2 100644 --- a/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_bloc.dart +++ b/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_bloc.dart @@ -49,13 +49,13 @@ class DietEditBloc extends Bloc { diet: currentState.diet, name: currentState.name, duration: currentState.duration, - details: currentState.details)); + details: currentState.details,),); } else { emit(DietEditLoadedState( diet: data, name: TextEditingController(text: data['name']), details: TextEditingController(text: data['details']), - duration: TextEditingController(text: data['duration']))); + duration: TextEditingController(text: data['duration']),),); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку diff --git a/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_state.dart b/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_state.dart index 1c10a404..bfc5e245 100644 --- a/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_state.dart +++ b/lib/presentation/diets/diet_edit_screen/bloc/diet_edit_state.dart @@ -23,7 +23,7 @@ class DietEditState extends Equatable { class DietEditLoadedState extends DietEditState { DietEditLoadedState( - {this.dietModelObj, this.diet, this.name, this.details, this.duration}); + {this.dietModelObj, this.diet, this.name, this.details, this.duration,}); DietEditModel? dietModelObj; Map? diet; diff --git a/lib/presentation/diets/diet_edit_screen/diet_edit_screen.dart b/lib/presentation/diets/diet_edit_screen/diet_edit_screen.dart index a0f988d1..aa7cf200 100644 --- a/lib/presentation/diets/diet_edit_screen/diet_edit_screen.dart +++ b/lib/presentation/diets/diet_edit_screen/diet_edit_screen.dart @@ -12,7 +12,7 @@ class DietEditScreen extends StatelessWidget { final dietID = ModalRoute.of(context)!.settings.arguments; return BlocProvider( create: (context) => DietEditBloc(DietEditState(dietModelObj: DietEditModel(dietID: dietID.toString())))..add(DietEditInitialEvent()), - child: DietEditScreen()); + child: DietEditScreen(),); } Widget build(BuildContext context) { @@ -98,10 +98,10 @@ class DietEditScreen extends StatelessWidget { ElevatedButton( onPressed: () => context.read().add(EditDiet()), child: Text('Сохранить'), - ) + ), ], ), - ) + ), ], ), ), diff --git a/lib/presentation/diets/diet_select_screen/bloc/diet_select_bloc.dart b/lib/presentation/diets/diet_select_screen/bloc/diet_select_bloc.dart index dbc622fa..e12eab5e 100644 --- a/lib/presentation/diets/diet_select_screen/bloc/diet_select_bloc.dart +++ b/lib/presentation/diets/diet_select_screen/bloc/diet_select_bloc.dart @@ -50,12 +50,12 @@ class DietSelectBloc extends Bloc { emit((currentState).copyWith( posts: data, myProfileModelObj: currentState.myProfileModelObj, - )); + ),); } else { print('Got unloaded'); emit(DietSelectLoadedState( posts: data, - )); + ),); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку diff --git a/lib/presentation/diets/diet_select_screen/diet_select_screen.dart b/lib/presentation/diets/diet_select_screen/diet_select_screen.dart index 68834d09..4b026cb2 100644 --- a/lib/presentation/diets/diet_select_screen/diet_select_screen.dart +++ b/lib/presentation/diets/diet_select_screen/diet_select_screen.dart @@ -13,7 +13,7 @@ import 'package:flutter/material.dart'; class DietSelectScreen extends StatelessWidget { static Widget builder(BuildContext context) { return BlocProvider( - create: (context) => DietSelectBloc(DietSelectState(myProfileModelObj: DietSelectModel()))..add(DietSelectInitialEvent()), child: DietSelectScreen()); + create: (context) => DietSelectBloc(DietSelectState(myProfileModelObj: DietSelectModel()))..add(DietSelectInitialEvent()), child: DietSelectScreen(),); } Widget build(BuildContext context) { @@ -95,14 +95,14 @@ class DietSelectScreen extends StatelessWidget { onTap: () => GoRouter.of(context).goNamed('dietCreateScreen'), child: Icon(Icons.create_outlined), ), - ) + ), ], ), ), ), ), SizedBox(height: 20), - _buildDietList(context, state) + _buildDietList(context, state), ], ), ), @@ -161,7 +161,7 @@ class DietSelectScreen extends StatelessWidget { ), child: Icon(Icons.edit), ), - )); + ),); }, ); } diff --git a/lib/presentation/diets/diet_show_screen/diet_show_screen.dart b/lib/presentation/diets/diet_show_screen/diet_show_screen.dart index 0c06f5d9..950e47a6 100644 --- a/lib/presentation/diets/diet_show_screen/diet_show_screen.dart +++ b/lib/presentation/diets/diet_show_screen/diet_show_screen.dart @@ -13,7 +13,7 @@ class DietScreen extends StatelessWidget { static Widget builder(BuildContext context) { final dietID = ModalRoute.of(context)!.settings.arguments; return BlocProvider( - create: (context) => DietBloc(DietState(dietModelObj: DietModel(dietID: dietID.toString())))..add(DietInitialEvent()), child: DietScreen()); + create: (context) => DietBloc(DietState(dietModelObj: DietModel(dietID: dietID.toString())))..add(DietInitialEvent()), child: DietScreen(),); } Widget build(BuildContext context) { @@ -104,9 +104,9 @@ class DietScreen extends StatelessWidget { child: Text('Удалить'), ), ], - ) - ]), - ) + ), + ],), + ), ], ), ), diff --git a/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart b/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart index 77f0f1a1..3e6c5407 100644 --- a/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart +++ b/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_bloc.dart @@ -37,18 +37,18 @@ class BlogPostCreateBloc title: currentState.title, description: currentState.description, youtube_url: currentState.youtube_url, - token: currentState.token)); + token: currentState.token,),); } else { emit(BlogPostCreateLoadedState( token: token, title: TextEditingController(), description: TextEditingController(), - youtube_url: TextEditingController())); + youtube_url: TextEditingController(),),); } } FutureOr _createBlogPost( - CreateBlogPost event, Emitter emit) async { + CreateBlogPost event, Emitter emit,) async { if (state is BlogPostCreateLoadedState) { var currentState = state as BlogPostCreateLoadedState; @@ -62,7 +62,7 @@ class BlogPostCreateBloc AppRouter.navigatorKey.currentContext?.goNamed('feedScreen'); } else { print( - 'Failed to create blog post. Status Code: ${response.statusCode} ${response.body}'); + 'Failed to create blog post. Status Code: ${response.statusCode} ${response.body}',); } } } diff --git a/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_state.dart b/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_state.dart index de3bab48..6012dd45 100644 --- a/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_state.dart +++ b/lib/presentation/feed/blog_post_create_screen/bloc/blog_post_create_state.dart @@ -27,7 +27,7 @@ class BlogPostCreateLoadedState extends BlogPostCreateState { this.blog_postModelObj, this.title, this.description, - this.youtube_url}); + this.youtube_url,}); BlogPostCreateModel? blog_postModelObj; TextEditingController? title; @@ -42,7 +42,7 @@ class BlogPostCreateLoadedState extends BlogPostCreateState { TextEditingController? title, TextEditingController? description, TextEditingController? youtube_url, - String? token}) { + String? token,}) { return BlogPostCreateLoadedState( blog_postModelObj: blog_postModelObj ?? this.blog_postModelObj, title: title ?? this.title, diff --git a/lib/presentation/feed/blog_post_create_screen/blog_post_create_screen.dart b/lib/presentation/feed/blog_post_create_screen/blog_post_create_screen.dart index be78f7e3..444800a8 100644 --- a/lib/presentation/feed/blog_post_create_screen/blog_post_create_screen.dart +++ b/lib/presentation/feed/blog_post_create_screen/blog_post_create_screen.dart @@ -13,7 +13,7 @@ class BlogPostCreateScreen extends StatelessWidget { return BlocProvider( create: (context) => BlogPostCreateBloc(BlogPostCreateState(blog_postModelObj: BlogPostCreateModel(blog_postID: blog_postID.toString()))) ..add(BlogPostCreateInitialEvent()), - child: BlogPostCreateScreen()); + child: BlogPostCreateScreen(),); } Widget build(BuildContext context) { @@ -100,7 +100,7 @@ class BlogPostCreateScreen extends StatelessWidget { ), ], ), - ) + ), ], ), ), diff --git a/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart b/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart index b3a30278..6b45f843 100644 --- a/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart +++ b/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_bloc.dart @@ -49,13 +49,13 @@ class BlogPostEditBloc extends Bloc { blog_post: currentState.blog_post, title: currentState.title, description: currentState.description, - youtube_url: currentState.youtube_url)); + youtube_url: currentState.youtube_url,),); } else { emit(BlogPostEditLoadedState( blog_post: data, title: TextEditingController(text: data['title']), description: TextEditingController(text: data['description']), - youtube_url: TextEditingController(text: data['youtube_url']))); + youtube_url: TextEditingController(text: data['youtube_url']),),); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку diff --git a/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart b/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart index 321448ee..4381948b 100644 --- a/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart +++ b/lib/presentation/feed/blog_post_edit_screen/bloc/blog_post_edit_state.dart @@ -27,7 +27,7 @@ class BlogPostEditLoadedState extends BlogPostEditState { this.blog_post, this.title, this.description, - this.youtube_url}); + this.youtube_url,}); BlogPostEditModel? blog_postModelObj; Map? blog_post; diff --git a/lib/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart b/lib/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart index 5c38ffb7..6af1c513 100644 --- a/lib/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart +++ b/lib/presentation/feed/blog_post_edit_screen/blog_post_edit_screen.dart @@ -12,7 +12,7 @@ class BlogPostEditScreen extends StatelessWidget { return BlocProvider( create: (context) => BlogPostEditBloc(BlogPostEditState(blog_postModelObj: BlogPostEditModel(blog_postID: blog_postID.toString())))..add(BlogPostEditInitialEvent()), - child: BlogPostEditScreen()); + child: BlogPostEditScreen(),); } Widget build(BuildContext context) { @@ -106,10 +106,10 @@ class BlogPostEditScreen extends StatelessWidget { ElevatedButton( onPressed: () => context.read().add(EditBlogPost()), child: Text('Сохранить'), - ) + ), ], ), - ) + ), ], ), ), diff --git a/lib/presentation/feed/blog_post_screen/bloc/blog_post_bloc.dart b/lib/presentation/feed/blog_post_screen/bloc/blog_post_bloc.dart index 9f5f11f2..b93c18ce 100644 --- a/lib/presentation/feed/blog_post_screen/bloc/blog_post_bloc.dart +++ b/lib/presentation/feed/blog_post_screen/bloc/blog_post_bloc.dart @@ -50,14 +50,14 @@ class BlogPostBloc extends Bloc { blog_post: currentState.blog_post, author: currentState.author, comments: currentState.comments, - token: currentState.token)); + token: currentState.token,),); } else { emit(BlogPostLoadedState( blog_post: data, token: token, commentController: TextEditingController(), author: await _fetchAuthor(data['id']), - comments: fillCommentList(await _fetchComments(data['id'])))); + comments: fillCommentList(await _fetchComments(data['id'])),),); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку @@ -74,15 +74,15 @@ class BlogPostBloc extends Bloc { } FutureOr _createComment( - CreateComment event, Emitter emit) async { + CreateComment event, Emitter emit,) async { if (state is BlogPostLoadedState) { var currentState = state as BlogPostLoadedState; // Отправляем данные по HTTP маршруту и ждем ответ var response = await _sendCommentData( - currentState.token, event.body, currentState.blog_post?['id']); + currentState.token, event.body, currentState.blog_post?['id'],); if (response.statusCode == 200) { var updatedComments = fillCommentList( - await _fetchComments(currentState.blog_post?['id'])); + await _fetchComments(currentState.blog_post?['id']),); var updatedState = currentState.copyWith( comments: updatedComments, commentController: @@ -94,7 +94,7 @@ class BlogPostBloc extends Bloc { } FutureOr _deleteEntry( - DeleteEntry event, Emitter emit) async { + DeleteEntry event, Emitter emit,) async { final box = await Hive.openBox('token'); final token = box.get('token'); if (token == null) { @@ -158,13 +158,13 @@ class BlogPostBloc extends Bloc { username: comments[i]['name'], dateText: DateFormat('dd.MM') .format(DateTime.parse(comments[i]['updated_at'])), - greetingText: comments[i]['body'])); + greetingText: comments[i]['body'],),); } return list; } Future _sendCommentData( - String? token, String body, int id) async { + String? token, String body, int id,) async { String url = dotenv.env['SERVER_ROOT']! + '/feed/createComment/$id'; final Map credentials = { 'id': id, @@ -177,7 +177,7 @@ class BlogPostBloc extends Bloc { 'Authorization': 'Bearer $token', }, body: json.encode(credentials), - encoding: utf8); + encoding: utf8,); return response; } diff --git a/lib/presentation/feed/blog_post_screen/bloc/blog_post_state.dart b/lib/presentation/feed/blog_post_screen/bloc/blog_post_state.dart index 76226025..982eac90 100644 --- a/lib/presentation/feed/blog_post_screen/bloc/blog_post_state.dart +++ b/lib/presentation/feed/blog_post_screen/bloc/blog_post_state.dart @@ -28,7 +28,7 @@ class BlogPostLoadedState extends BlogPostState { this.author, this.comments, this.token, - this.commentController}); + this.commentController,}); BlogPostModel? blog_postModelObj; Map? blog_post; @@ -44,14 +44,14 @@ class BlogPostLoadedState extends BlogPostState { Map? author, TextEditingController? commentController, String? token, - List? comments}) { + List? comments,}) { return BlogPostLoadedState( blog_postModelObj: blog_postModelObj ?? this.blog_postModelObj, blog_post: blog_post ?? this.blog_post, author: author ?? this.author, comments: comments ?? this.comments, token: token ?? this.token, - commentController: commentController ?? this.commentController); + commentController: commentController ?? this.commentController,); } } diff --git a/lib/presentation/feed/blog_post_screen/blog_post_screen.dart b/lib/presentation/feed/blog_post_screen/blog_post_screen.dart index 37a2ce24..dd2252b4 100644 --- a/lib/presentation/feed/blog_post_screen/blog_post_screen.dart +++ b/lib/presentation/feed/blog_post_screen/blog_post_screen.dart @@ -197,7 +197,7 @@ class BlogPostScreen extends StatelessWidget { child: Text( DateFormat('dd.MM.yyyy').format(DateTime.parse(state.blog_post?['updated_at'])), style: theme.textTheme.bodyMedium, - )), + ),), SizedBox(height: 16.0), Row(children: [ Padding( @@ -210,8 +210,8 @@ class BlogPostScreen extends StatelessWidget { Text( "Нравится", style: CustomTextStyles.titleMediumSemiBold, - ) - ]), + ), + ],), ), Spacer(), Padding( @@ -224,10 +224,10 @@ class BlogPostScreen extends StatelessWidget { Text( "Поделиться", style: CustomTextStyles.titleMediumSemiBold, - ) - ])) - ]), - ]), + ), + ],),), + ],), + ],), ); } @@ -356,7 +356,7 @@ class BlogPostScreen extends StatelessWidget { ), onPressed: () => context.read().add(CreateComment(state.commentController!.text)), // Установите прозрачный фон - ) + ), ], ), ], diff --git a/lib/presentation/feed/blog_post_screen/models/comment_model.dart b/lib/presentation/feed/blog_post_screen/models/comment_model.dart index 3c8c5934..feecc7c9 100644 --- a/lib/presentation/feed/blog_post_screen/models/comment_model.dart +++ b/lib/presentation/feed/blog_post_screen/models/comment_model.dart @@ -9,7 +9,7 @@ class CommentModel { this.username, this.dateText, this.greetingText, - required this.id}) { + required this.id,}) { userImage = userImage ?? ImageConstant.imageNotFound; username = username; dateText = dateText; diff --git a/lib/presentation/feed/blog_post_screen/widgets/comment_widget.dart b/lib/presentation/feed/blog_post_screen/widgets/comment_widget.dart index c224966c..ab177fa1 100644 --- a/lib/presentation/feed/blog_post_screen/widgets/comment_widget.dart +++ b/lib/presentation/feed/blog_post_screen/widgets/comment_widget.dart @@ -82,7 +82,7 @@ class CommentWidget extends StatelessWidget { commentModelObj.dateText!, style: theme.textTheme.bodyMedium, ), - ) + ), ], ), ), @@ -99,7 +99,7 @@ class CommentWidget extends StatelessWidget { imagePath: ImageConstant.imgSend, height: 30.v, width: 30.h, - margin: EdgeInsets.only(left: 5)), + margin: EdgeInsets.only(left: 5),), ], ), ); diff --git a/lib/presentation/feed/feed_screen/bloc/feed_bloc.dart b/lib/presentation/feed/feed_screen/bloc/feed_bloc.dart index 1eda1feb..0055e61e 100644 --- a/lib/presentation/feed/feed_screen/bloc/feed_bloc.dart +++ b/lib/presentation/feed/feed_screen/bloc/feed_bloc.dart @@ -50,12 +50,12 @@ class FeedBloc extends Bloc { emit((currentState).copyWith( posts: data, myProfileModelObj: currentState.myProfileModelObj, - )); + ),); } else { print('Got unloaded'); emit(FeedLoadedState( posts: data, - )); + ),); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку diff --git a/lib/presentation/feed/feed_screen/feed_screen.dart b/lib/presentation/feed/feed_screen/feed_screen.dart index 1af8a84e..52105c63 100644 --- a/lib/presentation/feed/feed_screen/feed_screen.dart +++ b/lib/presentation/feed/feed_screen/feed_screen.dart @@ -56,7 +56,7 @@ class FeedScreen extends StatelessWidget { SizedBox(height: 20), _buildMenu(context, state), SizedBox(height: 20), - _buildBlogPostList(context, state) + _buildBlogPostList(context, state), ], ), ), @@ -108,7 +108,7 @@ class FeedScreen extends StatelessWidget { ), ), ], - ) + ), ], ), ), @@ -235,8 +235,8 @@ class FeedScreen extends StatelessWidget { ), Text( "Комментировать", - ) - ]), + ), + ],), ), Spacer(), Row(children: [ @@ -246,18 +246,18 @@ class FeedScreen extends StatelessWidget { ), Text( "Нравится", - ) - ]), + ), + ],), Spacer(), Padding( padding: EdgeInsets.only(right: 4), child: Icon(Icons.share_outlined), ), - ]), + ],), ], ), ), - ])); + ],),); } Function onTapBack(BuildContext context) { diff --git a/lib/presentation/feed/feed_screen/widgets/feed_search_view.dart b/lib/presentation/feed/feed_screen/widgets/feed_search_view.dart index 20cce2ed..cef2304e 100644 --- a/lib/presentation/feed/feed_screen/widgets/feed_search_view.dart +++ b/lib/presentation/feed/feed_screen/widgets/feed_search_view.dart @@ -24,7 +24,7 @@ class CustomSearchView extends StatelessWidget { this.fillColor, this.filled = true, this.validator, - this.onChanged}) + this.onChanged,}) : super( key: key, ); @@ -76,7 +76,7 @@ class CustomSearchView extends StatelessWidget { return alignment != null ? Align( alignment: alignment ?? Alignment.center, - child: searchViewWidget(context)) + child: searchViewWidget(context),) : searchViewWidget(context); } @@ -113,7 +113,7 @@ class CustomSearchView extends StatelessWidget { SizedBox( child: Padding( padding: EdgeInsets.only(left: 10), - child: Icon(Icons.search)), + child: Icon(Icons.search),), ), prefixIconConstraints: prefixConstraints ?? BoxConstraints( diff --git a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_bloc.dart b/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_bloc.dart index 5f63f293..f78c3ffb 100644 --- a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_bloc.dart +++ b/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_bloc.dart @@ -45,14 +45,14 @@ class GlossaryBloc extends Bloc { glossaryModelObj: currentState.glossaryModelObj, token: currentState.token, productGroups: currentState.productGroups, - productList: currentState.productList)); + productList: currentState.productList,),); } else { List productGroupsModel = _fillProductGroups(dataProductGroups); emit(GlossaryLoadedState( token: token, productGroups: productGroupsModel, - productList: [])); + productList: [],),); await _getProductListById(token, emit, productGroupsModel[0].id); } } else { @@ -62,7 +62,7 @@ class GlossaryBloc extends Bloc { } else { // Статус ответа не равен 200, обрабатываем ошибку emit(GlossaryErrorState( - 'Ошибка сервера: ${responseProductGroups.statusCode}')); + 'Ошибка сервера: ${responseProductGroups.statusCode}',),); } } catch (e) { // Ошибка при декодировании JSON или другая ошибка выполнения @@ -71,7 +71,7 @@ class GlossaryBloc extends Bloc { } void _changeProductGroup( - ChangeProductGroup event, Emitter emit) async { + ChangeProductGroup event, Emitter emit,) async { if (state is GlossaryLoadedState) { var currentState = state as GlossaryLoadedState; await _getProductListById(currentState.token, emit, event.id); @@ -79,7 +79,7 @@ class GlossaryBloc extends Bloc { } Future _getProductListById( - token, Emitter emit, int? productGroupID) async { + token, Emitter emit, int? productGroupID,) async { final responseProductList = await http.get( Uri.parse(dotenv.env['SERVER_ROOT']! + '/glossary/index/$productGroupID'), headers: { @@ -93,7 +93,7 @@ class GlossaryBloc extends Bloc { emit(currentState.copyWith( glossaryModelObj: currentState.glossaryModelObj, productGroups: currentState.productGroups, - productList: dataProductList)); + productList: dataProductList,),); } else { emit(GlossaryErrorState('Список продуктов некорректного формата')); } diff --git a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_state.dart b/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_state.dart index 75363864..a6f8cf52 100644 --- a/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_state.dart +++ b/lib/presentation/glossary/glossary_screen/bloc/glossary_screen_state.dart @@ -26,7 +26,7 @@ class GlossaryLoadedState extends GlossaryState { {this.glossaryModelObj, this.productGroups, this.productList, - this.token}); + this.token,}); GlossaryModel? glossaryModelObj; String? token; @@ -39,7 +39,7 @@ class GlossaryLoadedState extends GlossaryState { {GlossaryModel? glossaryModelObj, String? token, List? productGroups, - List? productList}) { + List? productList,}) { return GlossaryLoadedState( glossaryModelObj: glossaryModelObj ?? this.glossaryModelObj, productGroups: productGroups ?? this.productGroups, diff --git a/lib/presentation/glossary/glossary_screen/glossary_screen.dart b/lib/presentation/glossary/glossary_screen/glossary_screen.dart index ada1e86c..b421b87a 100644 --- a/lib/presentation/glossary/glossary_screen/glossary_screen.dart +++ b/lib/presentation/glossary/glossary_screen/glossary_screen.dart @@ -14,7 +14,7 @@ class GlossaryScreen extends StatelessWidget { static Widget builder(BuildContext context) { return BlocProvider( - create: (context) => GlossaryBloc(GlossaryState(glossaryModelObj: GlossaryModel()))..add(GlossaryInitialEvent()), child: GlossaryScreen()); + create: (context) => GlossaryBloc(GlossaryState(glossaryModelObj: GlossaryModel()))..add(GlossaryInitialEvent()), child: GlossaryScreen(),); } Widget build(BuildContext context) { @@ -67,7 +67,7 @@ class GlossaryScreen extends StatelessWidget { SizedBox(height: 20), _buildMenu(context), SizedBox(height: 20), - _buildProducts(context, state) + _buildProducts(context, state), ], ), ), @@ -142,7 +142,7 @@ class GlossaryScreen extends StatelessWidget { children: List.generate(33, _fillAlphabet), ), ), - ]), + ],), ); } @@ -196,8 +196,8 @@ class GlossaryScreen extends StatelessWidget { SizedBox( height: 8, ), - _buildProductList(context, state) - ]), + _buildProductList(context, state), + ],), ); } @@ -259,22 +259,22 @@ class GlossaryScreen extends StatelessWidget { Column(children: [ Text("Ккал - ${product['energy_on_100gr'].toString()}"), SizedBox(height: 8), - Text("Белки - ${product['proteins_on_100gr'].toString()}") - ]), + Text("Белки - ${product['proteins_on_100gr'].toString()}"), + ],), Spacer(), Padding( padding: const EdgeInsets.only(right: 24.0), child: Column(children: [ Text("Жиры - ${product['fats_on_100gr'].toString()}"), SizedBox(height: 8), - Text("Углеводы - ${product['carbohydrates_on_100gr'].toString()}") - ]), - ) - ]) + Text("Углеводы - ${product['carbohydrates_on_100gr'].toString()}"), + ],), + ), + ],), ], ), ), - ])); + ],),); } Widget _fillAlphabet(int index) { diff --git a/lib/presentation/glossary/glossary_screen/widgets/glossary_search_widget.dart b/lib/presentation/glossary/glossary_screen/widgets/glossary_search_widget.dart index 20cce2ed..cef2304e 100644 --- a/lib/presentation/glossary/glossary_screen/widgets/glossary_search_widget.dart +++ b/lib/presentation/glossary/glossary_screen/widgets/glossary_search_widget.dart @@ -24,7 +24,7 @@ class CustomSearchView extends StatelessWidget { this.fillColor, this.filled = true, this.validator, - this.onChanged}) + this.onChanged,}) : super( key: key, ); @@ -76,7 +76,7 @@ class CustomSearchView extends StatelessWidget { return alignment != null ? Align( alignment: alignment ?? Alignment.center, - child: searchViewWidget(context)) + child: searchViewWidget(context),) : searchViewWidget(context); } @@ -113,7 +113,7 @@ class CustomSearchView extends StatelessWidget { SizedBox( child: Padding( padding: EdgeInsets.only(left: 10), - child: Icon(Icons.search)), + child: Icon(Icons.search),), ), prefixIconConstraints: prefixConstraints ?? BoxConstraints( diff --git a/lib/presentation/plans/plan_create_screen/bloc/plan_create_bloc.dart b/lib/presentation/plans/plan_create_screen/bloc/plan_create_bloc.dart index 51e08b9c..fd30edd0 100644 --- a/lib/presentation/plans/plan_create_screen/bloc/plan_create_bloc.dart +++ b/lib/presentation/plans/plan_create_screen/bloc/plan_create_bloc.dart @@ -35,17 +35,17 @@ class PlanCreateBloc extends Bloc { planModelObj: currentState.planModelObj, name: currentState.name, details: currentState.details, - )); + ),); } else { emit(PlanCreateLoadedState( name: TextEditingController(), details: TextEditingController(), - )); + ),); } } FutureOr _createPlan( - CreatePlan event, Emitter emit) async { + CreatePlan event, Emitter emit,) async { if (state is PlanCreateLoadedState) { var currentState = state as PlanCreateLoadedState; @@ -58,7 +58,7 @@ class PlanCreateBloc extends Bloc { AppRouter.navigatorKey.currentContext?.goNamed('planSelectScreen'); } else { print( - 'Failed to create blog post. Status Code: ${response.statusCode} ${response.body}'); + 'Failed to create blog post. Status Code: ${response.statusCode} ${response.body}',); } } } @@ -76,7 +76,7 @@ class PlanCreateBloc extends Bloc { 'state': 'active', 'type': '{"meat": true}', 'daily_schedule': - '{"1": {"lunch": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 494}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 12}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 432}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 195}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 710}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "grams", "quantity": 119}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 287}], "snacks": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 445}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "grams", "quantity": 500}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 764}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 735}], "breakfast": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 127}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 89}]}, "2": {"lunch": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 436}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 700}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 766}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 194}], "dinner": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 426}], "snacks": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 58}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 152}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 925}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 224}], "breakfast": [{"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 918}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 81}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 308}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 579}]}, "3": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 266}], "dinner": [{"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 790}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 26}], "snacks": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 549}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 446}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "grams", "quantity": 406}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 92}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 403}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 894}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 457}]}, "4": {"lunch": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 698}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 43}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 994}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 965}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 42}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 948}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 28}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 54}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 112}], "supper": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 891}], "breakfast": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 538}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 635}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "pcs", "quantity": 586}]}, "5": {"lunch": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 900}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "milliliters", "quantity": 242}], "dinner": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 375}], "snacks": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 604}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 510}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 887}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 554}], "supper": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 731}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 574}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 274}], "breakfast": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 276}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 80}]}, "6": {"lunch": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 359}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 358}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 639}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 861}], "dinner": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 124}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 122}], "snacks": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 980}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 837}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 444}], "supper": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 577}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 706}], "breakfast": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 839}]}, "7": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 118}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 664}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 665}], "dinner": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 986}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 296}], "snacks": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 807}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 493}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "milliliters", "quantity": 227}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 385}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 448}], "breakfast": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 784}]}, "8": {"lunch": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 433}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 871}], "dinner": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 332}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 41}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 388}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 649}], "supper": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 114}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "milliliters", "quantity": 968}], "breakfast": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 180}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 269}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 998}]}, "9": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 68}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 505}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 554}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 579}], "snacks": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 751}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 144}], "supper": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 677}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 263}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "pcs", "quantity": 304}], "breakfast": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 963}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 258}]}, "10": {"lunch": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 167}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 306}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 243}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 79}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 560}], "snacks": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 294}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 145}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 639}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 108}], "supper": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 924}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 894}], "breakfast": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 280}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 336}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 338}]}, "11": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 817}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 968}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 525}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 864}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 457}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 548}], "snacks": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 658}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 239}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 358}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 406}], "supper": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "grams", "quantity": 416}], "breakfast": [{"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 220}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 323}]}, "12": {"lunch": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 377}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 138}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 654}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 237}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 902}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 76}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 723}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 481}], "breakfast": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 571}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 515}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 188}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 411}]}, "13": {"lunch": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 379}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 231}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 376}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 147}], "dinner": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 871}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 679}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 359}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 561}], "snacks": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 414}], "supper": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 827}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 649}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 363}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 161}], "breakfast": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 185}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 464}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 387}]}, "14": {"lunch": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 248}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 5}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 693}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 655}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 709}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 881}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 588}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 36}], "snacks": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 453}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 692}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 186}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 721}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 740}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 731}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 842}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 850}]}, "15": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 124}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 380}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 211}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 689}], "dinner": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 326}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 629}], "snacks": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 201}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 129}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 749}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 315}], "breakfast": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 444}]}, "16": {"lunch": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 953}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 101}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 684}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 506}], "dinner": [{"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 333}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 416}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 796}], "snacks": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 799}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 799}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 756}], "supper": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 858}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 619}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 800}], "breakfast": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 363}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 539}]}, "17": {"lunch": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 134}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 977}], "snacks": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 211}], "supper": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 209}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "grams", "quantity": 227}], "breakfast": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 195}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 917}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 706}]}, "18": {"lunch": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "pcs", "quantity": 296}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 239}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 798}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 155}], "dinner": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 959}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 958}], "snacks": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 984}], "supper": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 134}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 432}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 242}]}, "19": {"lunch": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 906}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 152}], "dinner": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 610}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 605}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 498}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 616}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 512}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 146}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 200}], "supper": [{"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 764}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 353}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 181}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 783}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 506}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 887}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 130}]}, "20": {"lunch": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 48}], "dinner": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 266}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 143}], "snacks": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 55}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 174}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 855}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 6}], "supper": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 296}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 878}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 376}], "breakfast": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 442}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 528}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "milliliters", "quantity": 558}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 885}]}, "21": {"lunch": [{"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 504}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 652}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 996}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 200}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 641}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 87}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 689}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 143}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 528}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 475}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 924}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 98}], "breakfast": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 438}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 383}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 462}]}}' + '{"1": {"lunch": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 494}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 12}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 432}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 195}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 710}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "grams", "quantity": 119}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 287}], "snacks": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 445}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "grams", "quantity": 500}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 764}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 735}], "breakfast": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 127}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 89}]}, "2": {"lunch": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 436}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 700}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 766}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 194}], "dinner": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 426}], "snacks": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 58}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 152}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 925}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 224}], "breakfast": [{"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 918}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 81}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 308}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 579}]}, "3": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 266}], "dinner": [{"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 790}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 26}], "snacks": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 549}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 446}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "grams", "quantity": 406}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 92}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 403}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 894}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 457}]}, "4": {"lunch": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 698}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 43}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 994}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 965}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 42}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 948}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 28}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 54}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 112}], "supper": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 891}], "breakfast": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 538}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 635}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "pcs", "quantity": 586}]}, "5": {"lunch": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 900}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "milliliters", "quantity": 242}], "dinner": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 375}], "snacks": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 604}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 510}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 887}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 554}], "supper": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 731}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 574}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 274}], "breakfast": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 276}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 80}]}, "6": {"lunch": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 359}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 358}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 639}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 861}], "dinner": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 124}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 122}], "snacks": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 980}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 837}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 444}], "supper": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 577}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 706}], "breakfast": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 839}]}, "7": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 118}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 664}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 665}], "dinner": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 986}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 296}], "snacks": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 807}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 493}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "milliliters", "quantity": 227}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 385}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 448}], "breakfast": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 784}]}, "8": {"lunch": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 433}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 871}], "dinner": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 332}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 41}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 388}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 649}], "supper": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 114}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "milliliters", "quantity": 968}], "breakfast": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 180}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 269}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 998}]}, "9": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 68}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 505}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 554}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 579}], "snacks": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 751}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 144}], "supper": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 677}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 263}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "pcs", "quantity": 304}], "breakfast": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 963}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 258}]}, "10": {"lunch": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 167}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 306}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 243}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 79}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 560}], "snacks": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 294}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 145}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 639}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 108}], "supper": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 924}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 894}], "breakfast": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 280}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 336}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 338}]}, "11": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 817}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 968}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 525}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 864}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "pcs", "quantity": 457}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 548}], "snacks": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 658}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 239}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 358}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 406}], "supper": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "grams", "quantity": 416}], "breakfast": [{"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 220}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 323}]}, "12": {"lunch": [{"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 377}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 138}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 654}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 237}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 902}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 76}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 723}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 481}], "breakfast": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 571}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 515}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 188}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 411}]}, "13": {"lunch": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 379}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "grams", "quantity": 231}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 376}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 147}], "dinner": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 871}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 679}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 359}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 561}], "snacks": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 414}], "supper": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 827}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 649}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 363}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 161}], "breakfast": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 185}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 464}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 387}]}, "14": {"lunch": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 248}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 5}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 693}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 655}], "dinner": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 709}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 881}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 588}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 36}], "snacks": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "pcs", "quantity": 453}], "supper": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 692}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 186}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 721}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 740}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 731}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 842}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 850}]}, "15": {"lunch": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "grams", "quantity": 124}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 380}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 211}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 689}], "dinner": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 326}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 629}], "snacks": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 201}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 129}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 749}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "milliliters", "quantity": 315}], "breakfast": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 444}]}, "16": {"lunch": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 953}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 101}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 684}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "pcs", "quantity": 506}], "dinner": [{"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 333}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 416}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "milliliters", "quantity": 796}], "snacks": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 799}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 799}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "pcs", "quantity": 756}], "supper": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 858}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 619}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 800}], "breakfast": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "pcs", "quantity": 363}, {"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "grams", "quantity": 539}]}, "17": {"lunch": [{"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 134}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 977}], "snacks": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "pcs", "quantity": 211}], "supper": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 209}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "grams", "quantity": 227}], "breakfast": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 195}, {"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "pcs", "quantity": 917}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 706}]}, "18": {"lunch": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "pcs", "quantity": 296}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 239}, {"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 798}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 155}], "dinner": [{"name": "Little Hamburger", "uniq": "Little Hamburger-1709115623", "portion": "grams", "quantity": 959}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 958}], "snacks": [{"name": "Pasta", "uniq": "Pasta-1709115623", "portion": "milliliters", "quantity": 984}], "supper": [{"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 134}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 432}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "milliliters", "quantity": 242}]}, "19": {"lunch": [{"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 906}, {"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 152}], "dinner": [{"name": "Cheeseburger", "uniq": "Cheeseburger-1709115623", "portion": "milliliters", "quantity": 610}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 605}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "grams", "quantity": 498}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 616}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 512}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 146}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 200}], "supper": [{"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 764}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 353}, {"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 181}], "breakfast": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 783}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 506}, {"name": "Bacon Cheeseburger", "uniq": "Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 887}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 130}]}, "20": {"lunch": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 48}], "dinner": [{"name": "Bacon Dog", "uniq": "Bacon Dog-1709115623", "portion": "milliliters", "quantity": 266}, {"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 143}], "snacks": [{"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "grams", "quantity": 55}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "grams", "quantity": 174}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 855}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "milliliters", "quantity": 6}], "supper": [{"name": "Grilled Cheese", "uniq": "Grilled Cheese-1709115623", "portion": "pcs", "quantity": 296}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 878}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "pcs", "quantity": 376}], "breakfast": [{"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "milliliters", "quantity": 442}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "pcs", "quantity": 528}, {"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "milliliters", "quantity": 558}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 885}]}, "21": {"lunch": [{"name": "Little Bacon Burger", "uniq": "Little Bacon Burger-1709115623", "portion": "grams", "quantity": 504}, {"name": "Little Bacon Cheeseburger", "uniq": "Little Bacon Cheeseburger-1709115623", "portion": "milliliters", "quantity": 652}, {"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 996}], "dinner": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "milliliters", "quantity": 200}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "pcs", "quantity": 641}, {"name": "Cheese Veggie Sandwich", "uniq": "Cheese Veggie Sandwich-1709115623", "portion": "milliliters", "quantity": 87}, {"name": "Cheese Dog", "uniq": "Cheese Dog-1709115623", "portion": "pcs", "quantity": 689}], "snacks": [{"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 143}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "pcs", "quantity": 528}, {"name": "Veggie Sandwich", "uniq": "Veggie Sandwich-1709115623", "portion": "grams", "quantity": 475}], "supper": [{"name": "Little Cheeseburger", "uniq": "Little Cheeseburger-1709115623", "portion": "grams", "quantity": 924}, {"name": "Hamburger", "uniq": "Hamburger-1709115623", "portion": "grams", "quantity": 98}], "breakfast": [{"name": "Bacon Cheese Dog", "uniq": "Bacon Cheese Dog-1709115623", "portion": "grams", "quantity": 438}, {"name": "Cheese Pizza", "uniq": "Cheese Pizza-1709115623", "portion": "milliliters", "quantity": 383}, {"name": "Bacon Burger", "uniq": "Bacon Burger-1709115623", "portion": "grams", "quantity": 462}]}}', }; var response = await http.post( diff --git a/lib/presentation/plans/plan_create_screen/plan_create_screen.dart b/lib/presentation/plans/plan_create_screen/plan_create_screen.dart index bd354af0..81262591 100644 --- a/lib/presentation/plans/plan_create_screen/plan_create_screen.dart +++ b/lib/presentation/plans/plan_create_screen/plan_create_screen.dart @@ -10,7 +10,7 @@ class PlanCreateScreen extends StatelessWidget { final planID = ModalRoute.of(context)!.settings.arguments; return BlocProvider( create: (context) => PlanCreateBloc(PlanCreateState(planModelObj: PlanCreateModel(planID: planID.toString())))..add(PlanCreateInitialEvent()), - child: PlanCreateScreen()); + child: PlanCreateScreen(),); } Widget build(BuildContext context) { @@ -81,9 +81,9 @@ class PlanCreateScreen extends StatelessWidget { ElevatedButton( onPressed: () => context.read().add(CreatePlan()), child: Text('Создать'), - ) - ]), - ) + ), + ],), + ), ], ), ), diff --git a/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart b/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart index 1e7e4f27..e150c8bc 100644 --- a/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart +++ b/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_bloc.dart @@ -49,13 +49,13 @@ class PlanEditBloc extends Bloc { plan: currentState.plan, name: currentState.name, duration: currentState.duration, - details: currentState.details)); + details: currentState.details,),); } else { emit(PlanEditLoadedState( plan: data, name: TextEditingController(text: data['name']), details: TextEditingController(text: data['details']), - duration: TextEditingController(text: data['duration'].toString()))); + duration: TextEditingController(text: data['duration'].toString()),),); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку diff --git a/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_state.dart b/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_state.dart index 427bf0df..66769622 100644 --- a/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_state.dart +++ b/lib/presentation/plans/plan_edit_screen/bloc/plan_edit_state.dart @@ -23,7 +23,7 @@ class PlanEditState extends Equatable { class PlanEditLoadedState extends PlanEditState { PlanEditLoadedState( - {this.planModelObj, this.plan, this.name, this.details, this.duration}); + {this.planModelObj, this.plan, this.name, this.details, this.duration,}); PlanEditModel? planModelObj; Map? plan; diff --git a/lib/presentation/plans/plan_edit_screen/plan_edit_screen.dart b/lib/presentation/plans/plan_edit_screen/plan_edit_screen.dart index 7baa33d2..abea8b9a 100644 --- a/lib/presentation/plans/plan_edit_screen/plan_edit_screen.dart +++ b/lib/presentation/plans/plan_edit_screen/plan_edit_screen.dart @@ -12,7 +12,7 @@ class PlanEditScreen extends StatelessWidget { final planID = ModalRoute.of(context)!.settings.arguments; return BlocProvider( create: (context) => PlanEditBloc(PlanEditState(planModelObj: PlanEditModel(planID: planID.toString())))..add(PlanEditInitialEvent()), - child: PlanEditScreen()); + child: PlanEditScreen(),); } Widget build(BuildContext context) { @@ -98,10 +98,10 @@ class PlanEditScreen extends StatelessWidget { ElevatedButton( onPressed: () => context.read().add(EditPlan()), child: Text('Сохранить'), - ) + ), ], ), - ) + ), ], ), ), diff --git a/lib/presentation/plans/plan_select_screen/bloc/plan_select_bloc.dart b/lib/presentation/plans/plan_select_screen/bloc/plan_select_bloc.dart index b74c0ede..e65409f1 100644 --- a/lib/presentation/plans/plan_select_screen/bloc/plan_select_bloc.dart +++ b/lib/presentation/plans/plan_select_screen/bloc/plan_select_bloc.dart @@ -47,12 +47,12 @@ class PlanSelectBloc extends Bloc { emit((currentState).copyWith( posts: data, myProfileModelObj: currentState.myProfileModelObj, - )); + ),); } else { print('Got unloaded'); emit(PlanSelectLoadedState( posts: data, - )); + ),); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку diff --git a/lib/presentation/plans/plan_select_screen/plan_select_screen.dart b/lib/presentation/plans/plan_select_screen/plan_select_screen.dart index 810bd3ae..022e4e2e 100644 --- a/lib/presentation/plans/plan_select_screen/plan_select_screen.dart +++ b/lib/presentation/plans/plan_select_screen/plan_select_screen.dart @@ -13,7 +13,7 @@ import 'package:flutter/material.dart'; class PlanSelectScreen extends StatelessWidget { static Widget builder(BuildContext context) { return BlocProvider( - create: (context) => PlanSelectBloc(PlanSelectState(myProfileModelObj: PlanSelectModel()))..add(PlanSelectInitialEvent()), child: PlanSelectScreen()); + create: (context) => PlanSelectBloc(PlanSelectState(myProfileModelObj: PlanSelectModel()))..add(PlanSelectInitialEvent()), child: PlanSelectScreen(),); } Widget build(BuildContext context) { @@ -95,14 +95,14 @@ class PlanSelectScreen extends StatelessWidget { onTap: () => GoRouter.of(context).goNamed('planCreateScreen'), child: Icon(Icons.create_outlined), ), - ) + ), ], ), ), ), ), SizedBox(height: 20), - _buildPlanList(context, state) + _buildPlanList(context, state), ], ), ), diff --git a/lib/presentation/plans/plan_show_screen/plan_show_screen.dart b/lib/presentation/plans/plan_show_screen/plan_show_screen.dart index a19f6dac..98cefd46 100644 --- a/lib/presentation/plans/plan_show_screen/plan_show_screen.dart +++ b/lib/presentation/plans/plan_show_screen/plan_show_screen.dart @@ -14,7 +14,7 @@ class PlanScreen extends StatelessWidget { static Widget builder(BuildContext context) { final planID = ModalRoute.of(context)!.settings.arguments; return BlocProvider( - create: (context) => PlanBloc(PlanState(planModelObj: PlanModel(planID: planID.toString())))..add(PlanInitialEvent()), child: PlanScreen()); + create: (context) => PlanBloc(PlanState(planModelObj: PlanModel(planID: planID.toString())))..add(PlanInitialEvent()), child: PlanScreen(),); } Widget build(BuildContext context) { @@ -104,9 +104,9 @@ class PlanScreen extends StatelessWidget { child: Text('Удалить'), ), ], - ) - ]), - ) + ), + ],), + ), ], ), ), diff --git a/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart b/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart index db799d25..cfecf5a3 100644 --- a/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart +++ b/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart @@ -100,7 +100,7 @@ class MyProfileBloc extends Bloc { selectedCountry: currentState.selectedCountry, selectedActivity: currentState.selectedActivity, myProfileModelObj: currentState.myProfileModelObj, - )); + ),); } else { var plans = [] ..addAll(data["finishedPlans"]) @@ -135,7 +135,7 @@ class MyProfileBloc extends Bloc { "0000-00-00 00:00:00", "0000-00-00 00:00:00", "0000-00-00 00:00:00", - "0000-00-00 00:00:00" + "0000-00-00 00:00:00", ]; for (int i = 0; i < data["circumferences"].length; i++) { dates[i] = data["circumferences"]['$i']["created_at"]; @@ -147,7 +147,7 @@ class MyProfileBloc extends Bloc { "user_id": 0, "weight": 0, "created_at": "0000-00-00 00:00:00", - "updated_at": "0000-00-00 00:00:00" + "updated_at": "0000-00-00 00:00:00", }; } } @@ -161,7 +161,7 @@ class MyProfileBloc extends Bloc { "waist_circumference": 0, "hip_circumference": 0, "created_at": "0000-00-00 00:00:00", - "updated_at": "0000-00-00 00:00:00" + "updated_at": "0000-00-00 00:00:00", }; } } @@ -180,17 +180,17 @@ class MyProfileBloc extends Bloc { hypoFormController: data['userDetails']['has_hypo'].toString(), hyperFormController: data['userDetails']['has_hyper'].toString(), chestCircumferenceFormController: TextEditingController( - text: data['userDetails']['chest_circumference']?.toString()), + text: data['userDetails']['chest_circumference']?.toString(),), waistCircumferenceFormController: TextEditingController( - text: data['userDetails']['waist_circumference']?.toString()), + text: data['userDetails']['waist_circumference']?.toString(),), hipCircumferenceFormController: TextEditingController( - text: data['userDetails']['hip_circumference']?.toString()), + text: data['userDetails']['hip_circumference']?.toString(),), weightController: TextEditingController( - text: data['userDetails']['weight']?.toString()), + text: data['userDetails']['weight']?.toString(),), weightFormController: TextEditingController( - text: data['userDetails']['weight']?.toString()), + text: data['userDetails']['weight']?.toString(),), firstNameFormController: TextEditingController( - text: data['userDetails']['first_name']), + text: data['userDetails']['first_name'],), lastNameFormController: TextEditingController(text: data['userDetails']['last_name']), countryFormController: @@ -198,35 +198,35 @@ class MyProfileBloc extends Bloc { cityFormController: TextEditingController(text: data['userDetails']['city']), heightFormController: TextEditingController( - text: data['userDetails']['height']?.toString()), + text: data['userDetails']['height']?.toString(),), upPressureFormController: TextEditingController( - text: data['userDetails']['blood_pressure_up']?.toString()), + text: data['userDetails']['blood_pressure_up']?.toString(),), downPressureFormController: TextEditingController( - text: data['userDetails']['blood_pressure_down']?.toString()), + text: data['userDetails']['blood_pressure_down']?.toString(),), allergiesFormController: TextEditingController( - text: data['userDetails']['about_alergy']), + text: data['userDetails']['about_alergy'],), pillsFormController: TextEditingController( - text: data['userDetails']['about_taking_pils']), + text: data['userDetails']['about_taking_pils'],), sportsFormController: TextEditingController( - text: data['userDetails']['about_sport_hobbies']), + text: data['userDetails']['about_sport_hobbies'],), favoriteFormController: TextEditingController( - text: data['userDetails']['favorite_foods']), + text: data['userDetails']['favorite_foods'],), unfavoriteFormController: TextEditingController( - text: data['userDetails']['unfavorite_foods']), + text: data['userDetails']['unfavorite_foods'],), additionalFormController: TextEditingController( - text: data['userDetails']['additional_info']), + text: data['userDetails']['additional_info'],), dateFormController: TextEditingController(text: data['userDetails']['birthdate']), selectedCity: data['userDetails']['city'], selectedCountry: data['userDetails']['country'], selectedActivity: determineActivityLevel( - data['userDetails']['activity_coefficient']), - )); + data['userDetails']['activity_coefficient'],), + ),); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку emit( - MyProfileErrorState('Некоторые необходимые данные отсутствуют.')); + MyProfileErrorState('Некоторые необходимые данные отсутствуют.'),); } } else { // Статус ответа не равен 200, обрабатываем ошибку @@ -253,7 +253,7 @@ class MyProfileBloc extends Bloc { } // колхоз, но свитчкейсы в дарте странно ведут себя при сравнении double Future _uploadAvatar( - UploadAvatar event, Emitter emit) async { + UploadAvatar event, Emitter emit,) async { if (state is MyProfileLoadedState) { var currentState = state as MyProfileLoadedState; @@ -279,7 +279,7 @@ class MyProfileBloc extends Bloc { return imageUrl; } else { throw Exception( - 'Failed to upload image. Status code: ${streamedResponse.statusCode} ${streamedResponse}}'); + 'Failed to upload image. Status code: ${streamedResponse.statusCode} ${streamedResponse}}',); } } } diff --git a/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart b/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart index acf48231..7c66b4c3 100644 --- a/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart +++ b/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart @@ -53,7 +53,7 @@ class MyProfileLoadedState extends MyProfileState { this.additionalFormController, this.hypoFormController, this.hyperFormController, - this.circumferences}) + this.circumferences,}) : super(myProfileModelObj: null); MyProfileModel? myProfileModelObj; diff --git a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart index 38b15615..8df32943 100644 --- a/lib/presentation/profile/my_profile_screen/my_profile_screen.dart +++ b/lib/presentation/profile/my_profile_screen/my_profile_screen.dart @@ -112,7 +112,7 @@ class MyProfileScreen extends StatelessWidget { ), ], ), - child: _buildCarousel(context, state)), + child: _buildCarousel(context, state),), SizedBox(height: 15.v), if (!state.plans!.isEmpty) Container( @@ -137,7 +137,7 @@ class MyProfileScreen extends StatelessWidget { state.plans?.map((plan) => plan['name']).toList(), state.plans?.map((plan) => plan['image']).toList(), state.plans?.map((plan) => plan['state']).toList(), - )), + ),), SizedBox(height: 5.v), ], ), @@ -212,8 +212,8 @@ class MyProfileScreen extends StatelessWidget { context, state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], state.chartDates, - ) - ])); + ), + ],),); case 2: // График ИМТ return Column(children: [ Text( @@ -226,9 +226,9 @@ class MyProfileScreen extends StatelessWidget { _buildChart( context, _bodyMassIndex(state.chartPoints?.values.map((e) => e['weight']).toList().map((i) => i.toDouble()).toList() ?? [0.0, 0.0, 0.0, 0.0], - state.userDetails?['height'].toInt() ?? 160), - state.chartDates), - ]); + state.userDetails?['height'].toInt() ?? 160,), + state.chartDates,), + ],); case 3: //График обхватов return GestureDetector( onTap: () => _editCircumference(context, state), @@ -241,8 +241,8 @@ class MyProfileScreen extends StatelessWidget { ), SizedBox(height: 30.v), _buildCircumferenceChart(context, state.circumferences, state.chartDates), - _buildChartLegend() - ])); + _buildChartLegend(), + ],),); default: return Text('text', style: TextStyle(fontSize: 16.0)); } @@ -640,7 +640,7 @@ class MyProfileScreen extends StatelessWidget { child: Column(children: [ Padding( padding: EdgeInsets.only(left: 15.h), - child: Text("plans_complete".tr, style: CustomTextStyles.titleMediumBlack.copyWith(color: appTheme.black900))), + child: Text("plans_complete".tr, style: CustomTextStyles.titleMediumBlack.copyWith(color: appTheme.black900)),), SizedBox(height: 5.v), Container( decoration: AppDecoration.outlineBlueGray.copyWith(borderRadius: BorderRadiusStyle.roundedBorder5), @@ -683,12 +683,12 @@ class MyProfileScreen extends StatelessWidget { child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Padding( padding: EdgeInsets.only(bottom: 1.v), - child: Text(plans![i], style: CustomTextStyles.titleSmallBluegray800Bold)), + child: Text(plans![i], style: CustomTextStyles.titleSmallBluegray800Bold),), Container( height: 19.v, width: 100.h, - decoration: BoxDecoration(color: boxColor, borderRadius: BorderRadius.circular(5.h))) - ]))), + decoration: BoxDecoration(color: boxColor, borderRadius: BorderRadius.circular(5.h)),), + ],),),), Align( alignment: Alignment.center, child: Container( @@ -697,18 +697,18 @@ class MyProfileScreen extends StatelessWidget { dotenv.env['STORAGE_URL']! + imagePaths?[i], height: 25.adaptSize, width: 25.adaptSize, - ))), + ),),), Align( alignment: Alignment.bottomRight, child: Container( width: 70.h, margin: EdgeInsets.only(bottom: 14.h, right: 22.h), - child: Text("$state".tr, maxLines: 3, overflow: TextOverflow.ellipsis, style: theme.textTheme.titleSmall))) - ])); - })), - ])) - ])) - ])); + child: Text("$state".tr, maxLines: 3, overflow: TextOverflow.ellipsis, style: theme.textTheme.titleSmall),),), + ],),); + },),), + ],),), + ],),), + ],),); } List _bodyMassIndex(List weightPoints, int height) { @@ -770,7 +770,7 @@ class MyProfileScreen extends StatelessWidget { ], ), ], - )), + ),), actions: [ TextButton( onPressed: onTapOk(context), @@ -781,7 +781,7 @@ class MyProfileScreen extends StatelessWidget { child: Text("Изменить", style: CustomTextStyles.titleMediumBlack.copyWith( color: Colors.blue, - )), + ),), ), ], backgroundColor: Colors.white, @@ -862,7 +862,7 @@ class MyProfileScreen extends StatelessWidget { child: Text("Изменить", style: CustomTextStyles.titleMediumBlack.copyWith( color: Colors.blue, - )), + ),), ), ], backgroundColor: Colors.white, diff --git a/lib/presentation/profile/my_profile_screen/my_settings_screen.dart b/lib/presentation/profile/my_profile_screen/my_settings_screen.dart index a5be7c00..cb3aeb60 100644 --- a/lib/presentation/profile/my_profile_screen/my_settings_screen.dart +++ b/lib/presentation/profile/my_profile_screen/my_settings_screen.dart @@ -16,7 +16,7 @@ import 'package:flutter/material.dart'; class MySettingsScreen extends StatelessWidget { static Widget builder(BuildContext context) { return BlocProvider( - create: (context) => MyProfileBloc(MyProfileState(myProfileModelObj: MyProfileModel()))..add(MyProfileInitialEvent()), child: MySettingsScreen()); + create: (context) => MyProfileBloc(MyProfileState(myProfileModelObj: MyProfileModel()))..add(MyProfileInitialEvent()), child: MySettingsScreen(),); } Widget build(BuildContext context) { @@ -86,8 +86,8 @@ class MySettingsScreen extends StatelessWidget { ), title: Padding( padding: EdgeInsets.only(left: 20.h), - child: Row(children: [AppbarSubtitle(text: state.user?['name'], margin: EdgeInsets.only(left: 80.h, top: 12.v, bottom: 9.v))])), - )), + child: Row(children: [AppbarSubtitle(text: state.user?['name'], margin: EdgeInsets.only(left: 80.h, top: 12.v, bottom: 9.v))]),), + ),), SizedBox(height: 20), Container( padding: EdgeInsets.symmetric( diff --git a/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_bloc.dart b/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_bloc.dart index 881e14a8..ebb0ec06 100644 --- a/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_bloc.dart +++ b/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_bloc.dart @@ -42,7 +42,7 @@ class RecipeCreateBloc extends Bloc { video_url: currentState.video_url, steps: currentState.steps, stepDescriptions: currentState.stepDescriptions, - tags: currentState.tags)); + tags: currentState.tags,),); } else { final Map step = { 'description': '', @@ -55,12 +55,12 @@ class RecipeCreateBloc extends Bloc { video_url: TextEditingController(), tags: TextEditingController(), stepDescriptions: [TextEditingController()], - steps: [step])); + steps: [step],),); } } FutureOr _addStep( - AddStep event, Emitter emit) async { + AddStep event, Emitter emit,) async { if (state is RecipeCreateLoadedState) { var currentState = state as RecipeCreateLoadedState; @@ -74,13 +74,13 @@ class RecipeCreateBloc extends Bloc { }); updatedStepDescriptions!.add(TextEditingController()); emit(currentState.copyWith( - steps: updatedSteps, stepDescriptions: updatedStepDescriptions)); + steps: updatedSteps, stepDescriptions: updatedStepDescriptions,),); await _reloadScreen(event, emit); } } FutureOr _removeStep( - RemoveStep event, Emitter emit) async { + RemoveStep event, Emitter emit,) async { if (state is RecipeCreateLoadedState) { var currentState = state as RecipeCreateLoadedState; @@ -91,13 +91,13 @@ class RecipeCreateBloc extends Bloc { updatedSteps!.removeAt(event.id); updatedStepDescriptions!.removeAt(event.id); emit(currentState.copyWith( - steps: updatedSteps, stepDescriptions: updatedStepDescriptions)); + steps: updatedSteps, stepDescriptions: updatedStepDescriptions,),); await _reloadScreen(event, emit); } } FutureOr _createRecipe( - CreateRecipe event, Emitter emit) async { + CreateRecipe event, Emitter emit,) async { if (state is RecipeCreateLoadedState) { var currentState = state as RecipeCreateLoadedState; @@ -112,13 +112,13 @@ class RecipeCreateBloc extends Bloc { AppRouter.navigatorKey.currentContext?.goNamed('recipeSelectScreen'); } else { print( - 'Failed to create blog post. Status Code: ${response.statusCode} ${response.body}'); + 'Failed to create blog post. Status Code: ${response.statusCode} ${response.body}',); } } } FutureOr sendRecipe(String? title, String? video_url, - String? description, List? steps) async { + String? description, List? steps,) async { String url = '${dotenv.env['SERVER_ROOT']!}/recipe/create'; final Map credentials = { 'title': title, @@ -141,7 +141,7 @@ class RecipeCreateBloc extends Bloc { } FutureOr _reloadScreen( - RecipeCreateEvent? event, Emitter emit) async { + RecipeCreateEvent? event, Emitter emit,) async { print('Reloading..'); final box = await Hive.openBox('token'); final token = box.get('token'); @@ -158,7 +158,7 @@ class RecipeCreateBloc extends Bloc { video_url: currentState.video_url, steps: currentState.steps, stepDescriptions: currentState.stepDescriptions, - tags: currentState.tags)); + tags: currentState.tags,),); } } } diff --git a/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_state.dart b/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_state.dart index 8545b837..4865bf38 100644 --- a/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_state.dart +++ b/lib/presentation/recipe/recipe_create_screen/bloc/recipe_create_state.dart @@ -30,7 +30,7 @@ class RecipeCreateLoadedState extends RecipeCreateState { this.video_url, this.tags, this.stepDescriptions, - this.steps}); + this.steps,}); RecipeCreateModel? recipeModelObj; String? token; @@ -49,7 +49,7 @@ class RecipeCreateLoadedState extends RecipeCreateState { video_url, steps, tags, - stepDescriptions + stepDescriptions, ]; RecipeCreateLoadedState copyWith({ RecipeCreateModel? recipeModelObj, @@ -69,7 +69,7 @@ class RecipeCreateLoadedState extends RecipeCreateState { token: token ?? this.token, steps: steps ?? this.steps, tags: tags ?? this.tags, - stepDescriptions: stepDescriptions ?? this.stepDescriptions); + stepDescriptions: stepDescriptions ?? this.stepDescriptions,); } } diff --git a/lib/presentation/recipe/recipe_create_screen/recipe_create_screen.dart b/lib/presentation/recipe/recipe_create_screen/recipe_create_screen.dart index 3a81754a..5afb1645 100644 --- a/lib/presentation/recipe/recipe_create_screen/recipe_create_screen.dart +++ b/lib/presentation/recipe/recipe_create_screen/recipe_create_screen.dart @@ -18,7 +18,7 @@ class RecipeCreateScreen extends StatelessWidget { return BlocProvider( create: (context) => RecipeCreateBloc(RecipeCreateState(recipeModelObj: RecipeCreateModel(recipeID: recipeID.toString())))..add(RecipeCreateInitialEvent()), - child: RecipeCreateScreen()); + child: RecipeCreateScreen(),); } Widget build(BuildContext context) { @@ -73,9 +73,9 @@ class RecipeCreateScreen extends StatelessWidget { children: steps, ), SizedBox(height: 20.v), - _buildAdditional(context, state) - ]), - ))); + _buildAdditional(context, state), + ],), + ),),); } _buldAppBar(BuildContext context) { @@ -105,7 +105,7 @@ class RecipeCreateScreen extends StatelessWidget { alignment: Alignment.center, child: AppbarSubtitle( text: "Добавление рецепта", - )), + ),), ), ); } @@ -164,7 +164,7 @@ class RecipeCreateScreen extends StatelessWidget { ), ), SizedBox(height: 16.0), - ]), + ],), ); } @@ -206,7 +206,7 @@ class RecipeCreateScreen extends StatelessWidget { Icon( Icons.photo_library, color: appTheme.blueGray300, - ) + ), ], ), ), @@ -318,7 +318,7 @@ class RecipeCreateScreen extends StatelessWidget { text: "x", buttonStyle: CustomButtonStyles.outlinePrimaryTL15, ), - ]), + ],), ); } @@ -375,7 +375,7 @@ class RecipeCreateScreen extends StatelessWidget { text: "Добавить рецепт", buttonStyle: CustomButtonStyles.outlinePrimaryTL15, ), - ]), + ],), ); } diff --git a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart b/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart index 9c982dd4..00dbfcd3 100644 --- a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart +++ b/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_bloc.dart @@ -56,7 +56,7 @@ class RecipeEditBloc extends Bloc { video_url: currentState.video_url, steps: currentState.steps, stepDescriptions: currentState.stepDescriptions, - tags: currentState.tags)); + tags: currentState.tags,),); } else { final Map defaultStep = { 'description': '', @@ -85,7 +85,7 @@ class RecipeEditBloc extends Bloc { tags: await _fetchTags(data['id']), stepDescriptions: stepDescriptions, steps: steps, - )); + ),); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку @@ -171,7 +171,7 @@ class RecipeEditBloc extends Bloc { 'steps': '[{"image": "steps/bT91V52zY2hIkjZezUxO4jW4njfhDfCe2PcMxciZ.jpg", "description": "Excepturi fuga sed quaerat impedit facere recusandae. Nihil exercitationem architecto accusantium ut. Qui consequuntur rerum quam asperiores repellendus molestias."}, {"image": "steps/7vaLlotrw65NXbqaD0dK4OTLVyxMgmB9wL3xBzg3.jpg", "description": "Sit hic sint ullam qui. Odit nihil possimus quo id itaque nisi non."}, {"image": "steps/et7cKUsnQkegcRAE72TS0mfAf2jLJXW93QDAGfjz.jpg", "description": "Ab dolores qui voluptatem sed quasi vero. Culpa minus optio in voluptatibus aut corrupti. Dolor expedita minus aut nesciunt quos quibusdam rerum."}, {"image": "steps/260401J6r71r9kuUt694VcsuMMQKTlQMrlIwfaKo.jpg", "description": "Eos dolores corrupti cupiditate aut. Nam nesciunt eveniet eos nam vitae ut. Quibusdam ab commodi ut natus. Nisi earum porro quidem et eligendi iste doloribus."}, {"image": "steps/Ol10BkOFeZ9EG4BAShgB1wnVwtCimoUMcSNDh2EB.jpg", "description": "Consectetur optio porro nobis voluptas quibusdam. Consequatur dolor dolorem laboriosam magnam iste atque."}, {"image": "steps/8PanRq2aWWdXG1xCYkRyJ0M3Z39y6jMPfnHCqlVi.jpg", "description": "A optio porro eligendi ullam. Sed numquam ullam quasi aperiam inventore corrupti enim. Alias id et consequatur perferendis. Ullam consequatur incidunt nesciunt ut et aut."}, {"image": "steps/19U2sYSGDkprS3L8SIFT3xz59OwQJ5xs0A8etZjr.jpg", "description": "In doloribus vel voluptas dolorum. Temporibus iusto est repellat quo sed. Perspiciatis enim sit beatae in dolor ut. Quis ad qui eligendi nisi. Est suscipit dolore ratione dolores suscipit molestiae."}, {"image": "steps/CRxJtjgQw84kG3teJVtl9GqwWUQ1WKpvOeBbwf9a.jpg", "description": "Aut quia maiores et aut. Quidem ab voluptates blanditiis. Est quam quia repellat exercitationem rerum et iste mollitia. Et sed dolores tempore nam et similique qui."}, {"image": "steps/NoG9rHtvHNLrYI2LujURT3DMQCmEe68UbpiXco2y.jpg", "description": "Nam et dolorum delectus. Labore fuga asperiores nam cumque sit. Eum hic officiis ea asperiores qui. Soluta totam enim quasi explicabo sed aut."}]', 'ingredients': - '[{"name": "Cheeseburger", "unit": "pcs", "portion": 336}, {"name": "Little Cheeseburger", "unit": "gr", "portion": 623}, {"name": "Bacon Burger", "unit": "ml", "portion": 713}, {"name": "Little Bacon Burger", "unit": "pcs", "portion": 160}, {"name": "Hamburger", "unit": "tablespoon", "portion": 390}, {"name": "Bacon Cheese Dog", "unit": "teespons", "portion": 295}, {"name": "Hamburger", "unit": "pcs", "portion": 813}, {"name": "Cheeseburger", "unit": "gr", "portion": 951}]' + '[{"name": "Cheeseburger", "unit": "pcs", "portion": 336}, {"name": "Little Cheeseburger", "unit": "gr", "portion": 623}, {"name": "Bacon Burger", "unit": "ml", "portion": 713}, {"name": "Little Bacon Burger", "unit": "pcs", "portion": 160}, {"name": "Hamburger", "unit": "tablespoon", "portion": 390}, {"name": "Bacon Cheese Dog", "unit": "teespons", "portion": 295}, {"name": "Hamburger", "unit": "pcs", "portion": 813}, {"name": "Cheeseburger", "unit": "gr", "portion": 951}]', }; var response = await http.post( @@ -222,7 +222,7 @@ class RecipeEditBloc extends Bloc { video_url: currentState.video_url, steps: currentState.steps, stepDescriptions: currentState.stepDescriptions, - tags: currentState.tags)); + tags: currentState.tags,),); } } } diff --git a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart b/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart index af03fcfe..e9086e60 100644 --- a/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart +++ b/lib/presentation/recipe/recipe_edit_screen/bloc/recipe_edit_state.dart @@ -32,7 +32,7 @@ class RecipeEditLoadedState extends RecipeEditState { this.tagsController, this.stepDescriptions, this.tags, - this.steps}); + this.steps,}); RecipeEditModel? recipeModelObj; Map? recipe; diff --git a/lib/presentation/recipe/recipe_edit_screen/recipe_edit_screen.dart b/lib/presentation/recipe/recipe_edit_screen/recipe_edit_screen.dart index c9ce2669..6621fc8d 100644 --- a/lib/presentation/recipe/recipe_edit_screen/recipe_edit_screen.dart +++ b/lib/presentation/recipe/recipe_edit_screen/recipe_edit_screen.dart @@ -19,7 +19,7 @@ class RecipeEditScreen extends StatelessWidget { final recipeID = ModalRoute.of(context)!.settings.arguments; return BlocProvider( create: (context) => RecipeEditBloc(RecipeEditState(recipeModelObj: RecipeEditModel(recipeID: recipeID.toString())))..add(RecipeEditInitialEvent()), - child: RecipeEditScreen()); + child: RecipeEditScreen(),); } Widget build(BuildContext context) { @@ -76,7 +76,7 @@ class RecipeEditScreen extends StatelessWidget { children: steps, ), SizedBox(height: 20.v), - _buildAdditional(context, state) + _buildAdditional(context, state), ], ), ), @@ -112,7 +112,7 @@ class RecipeEditScreen extends StatelessWidget { alignment: Alignment.center, child: AppbarSubtitle( text: "Редактирование рецепта", - )), + ),), ), ); } @@ -182,7 +182,7 @@ class RecipeEditScreen extends StatelessWidget { ), ), SizedBox(height: 16.0), - ]), + ],), ); } @@ -224,7 +224,7 @@ class RecipeEditScreen extends StatelessWidget { Icon( Icons.photo_library, color: appTheme.blueGray300, - ) + ), ], ), ), @@ -348,7 +348,7 @@ class RecipeEditScreen extends StatelessWidget { text: "x", buttonStyle: CustomButtonStyles.outlinePrimaryTL15, ), - ]), + ],), ); } @@ -394,7 +394,7 @@ class RecipeEditScreen extends StatelessWidget { text: "Добавить рецепт", buttonStyle: CustomButtonStyles.outlinePrimaryTL15, ), - ]), + ],), ); } diff --git a/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart b/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart index a7b0d375..6f5bdfda 100644 --- a/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart +++ b/lib/presentation/recipe/recipe_select_screen/bloc/recipe_select_bloc.dart @@ -46,12 +46,12 @@ class RecipeSelectBloc extends Bloc { emit((currentState).copyWith( posts: data, myProfileModelObj: currentState.myProfileModelObj, - )); + ),); } else { print('Got unloaded'); emit(RecipeSelectLoadedState( posts: data, - )); + ),); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку diff --git a/lib/presentation/recipe/recipe_select_screen/recipe_select_screen.dart b/lib/presentation/recipe/recipe_select_screen/recipe_select_screen.dart index 2a3a108e..fa0a9506 100644 --- a/lib/presentation/recipe/recipe_select_screen/recipe_select_screen.dart +++ b/lib/presentation/recipe/recipe_select_screen/recipe_select_screen.dart @@ -14,7 +14,7 @@ class RecipeSelectScreen extends StatelessWidget { static Widget builder(BuildContext context) { return BlocProvider( create: (context) => RecipeSelectBloc(RecipeSelectState(myProfileModelObj: RecipeSelectModel()))..add(RecipeSelectInitialEvent()), - child: RecipeSelectScreen()); + child: RecipeSelectScreen(),); } Widget build(BuildContext context) { @@ -94,7 +94,7 @@ class RecipeSelectScreen extends StatelessWidget { onTap: () => GoRouter.of(context).goNamed('recipeCreateScreen'), child: Icon(Icons.create_outlined), ), - ) + ), ], ), ), @@ -160,7 +160,7 @@ class RecipeSelectScreen extends StatelessWidget { ), child: Icon(Icons.edit), ), - )); + ),); }, ); } diff --git a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart b/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart index a8b5e192..ed9b6efe 100644 --- a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart +++ b/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_bloc.dart @@ -54,7 +54,7 @@ class RecipeBloc extends Bloc { commentController: currentState.commentController, comments: currentState.comments, steps: currentState.steps, - author: currentState.author)); + author: currentState.author,),); } else { emit(RecipeLoadedState( token: token, @@ -63,7 +63,7 @@ class RecipeBloc extends Bloc { author: await _fetchAuthor(data['id']), comments: fillCommentList(await _fetchComments(data['id'])), tags: await _fetchTags(data['id']), - commentController: TextEditingController())); + commentController: TextEditingController(),),); } } else { // Один или несколько ключевых полей отсутствуют, обрабатываем ошибку @@ -176,7 +176,7 @@ class RecipeBloc extends Bloc { userImage: comments[i]['profile_photo_path'], username: comments[i]['name'], dateText: DateFormat('dd.MM').format(DateTime.parse(comments[i]['updated_at'])), - greetingText: comments[i]['body'])); + greetingText: comments[i]['body'],),); } return list; } @@ -194,7 +194,7 @@ class RecipeBloc extends Bloc { 'Authorization': 'Bearer $token', }, body: json.encode(credentials), - encoding: utf8); + encoding: utf8,); return response; } diff --git a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_state.dart b/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_state.dart index fc3a9f49..efc80d69 100644 --- a/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_state.dart +++ b/lib/presentation/recipe/recipe_show_screen/bloc/recipe_show_state.dart @@ -30,7 +30,7 @@ class RecipeLoadedState extends RecipeState { this.token, this.commentController, this.tags, - this.steps}); + this.steps,}); RecipeModel? recipeModelObj; Map? recipe; @@ -48,7 +48,7 @@ class RecipeLoadedState extends RecipeState { comments, token, commentController, - steps + steps, ]; RecipeLoadedState copyWith( {RecipeModel? recipeModelObj, @@ -58,7 +58,7 @@ class RecipeLoadedState extends RecipeState { String? token, List? tags, List? steps, - List? comments}) { + List? comments,}) { return RecipeLoadedState( recipeModelObj: recipeModelObj ?? this.recipeModelObj, recipe: recipe ?? this.recipe, diff --git a/lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart b/lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart index f1835f8e..30fd4e9d 100644 --- a/lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart +++ b/lib/presentation/recipe/recipe_show_screen/recipe_show_screen.dart @@ -18,7 +18,7 @@ class RecipeScreen extends StatelessWidget { final recipeID = ModalRoute.of(context)!.settings.arguments; return BlocProvider( create: (context) => RecipeBloc(RecipeState(recipeModelObj: RecipeModel(recipeID: recipeID.toString())))..add(RecipeInitialEvent()), - child: RecipeScreen()); + child: RecipeScreen(),); } Widget build(BuildContext context) { @@ -77,7 +77,7 @@ class RecipeScreen extends StatelessWidget { _buildCommentSection(context, state), ], ), - )); + ),); } _buildHeaderRow(BuildContext context, RecipeLoadedState state) { @@ -195,7 +195,7 @@ class RecipeScreen extends StatelessWidget { child: Text( DateFormat('dd.MM.yyyy').format(DateTime.parse(state.recipe?['updated_at'])), style: theme.textTheme.bodyMedium, - )), + ),), SizedBox(height: 16.0), _buildTags(state.tags), SizedBox(height: 16.0), @@ -210,8 +210,8 @@ class RecipeScreen extends StatelessWidget { Text( "Нравится", style: CustomTextStyles.titleMediumSemiBold, - ) - ]), + ), + ],), ), Spacer(), Padding( @@ -224,10 +224,10 @@ class RecipeScreen extends StatelessWidget { Text( "Поделиться", style: CustomTextStyles.titleMediumSemiBold, - ) - ])) - ]), - ]), + ), + ],),), + ],), + ],), ); } @@ -368,7 +368,7 @@ class RecipeScreen extends StatelessWidget { ), onPressed: () => context.read().add(CreateComment(state.commentController!.text)), // Установите прозрачный фон - ) + ), ], ), ], @@ -400,7 +400,7 @@ class RecipeScreen extends StatelessWidget { ), SizedBox( height: 20, - ) + ), ], ); } @@ -451,8 +451,8 @@ class RecipeScreen extends StatelessWidget { errorWidget: (context, url, error) => Icon(Icons.error), ), SizedBox(height: 16.0), - Text(state.steps?[i]['description']) - ]), + Text(state.steps?[i]['description']), + ],), ); } } diff --git a/lib/presentation/recipe/recipe_show_screen/widgets/comment_widget.dart b/lib/presentation/recipe/recipe_show_screen/widgets/comment_widget.dart index c224966c..ab177fa1 100644 --- a/lib/presentation/recipe/recipe_show_screen/widgets/comment_widget.dart +++ b/lib/presentation/recipe/recipe_show_screen/widgets/comment_widget.dart @@ -82,7 +82,7 @@ class CommentWidget extends StatelessWidget { commentModelObj.dateText!, style: theme.textTheme.bodyMedium, ), - ) + ), ], ), ), @@ -99,7 +99,7 @@ class CommentWidget extends StatelessWidget { imagePath: ImageConstant.imgSend, height: 30.v, width: 30.h, - margin: EdgeInsets.only(left: 5)), + margin: EdgeInsets.only(left: 5),), ], ), ); diff --git a/lib/presentation/registration/additional_information_screen/additional_information_screen.dart b/lib/presentation/registration/additional_information_screen/additional_information_screen.dart index c855fb4b..1ade5821 100644 --- a/lib/presentation/registration/additional_information_screen/additional_information_screen.dart +++ b/lib/presentation/registration/additional_information_screen/additional_information_screen.dart @@ -23,7 +23,7 @@ class AdditionalInformationScreen extends StatelessWidget { create: (context) => AdditionalInformationBloc(AdditionalInformationState(additionalInformationModelObj: AdditionalInformationModel(userRegistrationSheet: sheet))) ..add(AdditionalInformationInitialEvent()), - child: AdditionalInformationScreen()); + child: AdditionalInformationScreen(),); } @override @@ -42,11 +42,11 @@ class AdditionalInformationScreen extends StatelessWidget { decoration: BoxDecoration( color: theme.colorScheme.onPrimary, borderRadius: BorderRadius.circular(8.h), - border: Border.all(color: theme.colorScheme.primary, width: 1.h)), + border: Border.all(color: theme.colorScheme.primary, width: 1.h),), child: ClipRRect( borderRadius: BorderRadius.circular(8.h), child: LinearProgressIndicator( - value: 1, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400)))), + value: 1, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400),),),), SizedBox(height: 20.v), SizedBox(height: 73.v), _buildTextFormField(context), @@ -56,9 +56,9 @@ class AdditionalInformationScreen extends StatelessWidget { text: "finish".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapFinish(state, context)); - }), - ]))); + onPressed: onTapFinish(state, context),); + },), + ],),),); } onTapFinish(AdditionalInformationState state, BuildContext context) { @@ -67,7 +67,7 @@ class AdditionalInformationScreen extends StatelessWidget { sheet.additionalInfo = state.editTextController!.text; final response = await http.post(Uri.parse(dotenv.env['SERVER_ROOT']! + '/register'), - headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}, body: jsonEncode(sheet.toJson()), encoding: utf8); + headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}, body: jsonEncode(sheet.toJson()), encoding: utf8,); var res = await jsonDecode(response.body); if (response.statusCode == 200) { @@ -88,7 +88,7 @@ class AdditionalInformationScreen extends StatelessWidget { leading: AppbarLeadingImage(imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 18.h, top: 15.v, bottom: 15.v), onTap: onTapBack(context)), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); + title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio),); } onTapBack(BuildContext context) { @@ -110,7 +110,7 @@ class AdditionalInformationScreen extends StatelessWidget { width: 294.h, margin: EdgeInsets.only(left: 24.h, right: 23.h), child: Text("enter_additional_information".tr, - maxLines: 2, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, style: CustomTextStyles.titleMediumSegoeUI)), + maxLines: 2, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, style: CustomTextStyles.titleMediumSegoeUI,),), SizedBox(height: 10.v), BlocSelector( selector: (state) => state.editTextController, @@ -119,10 +119,10 @@ class AdditionalInformationScreen extends StatelessWidget { controller: editTextController, hintText: "У меня крепкое здоровье, но последнее время часто утомляюсь, однако, это мне не мешает радоваться жизни", textInputAction: TextInputAction.done, - maxLines: 8); - }) - ])) - ])); + maxLines: 8,); + },), + ],),), + ],),); } /// Navigates to the previous screen. @@ -139,7 +139,7 @@ class AdditionalInformationScreen extends StatelessWidget { title: const Text('Ошибка'), content: Text(text), actions: [TextButton(onPressed: onTapOk(context), child: const Text('Ok'))], - )); + ),); } onTapOk(BuildContext context) { diff --git a/lib/presentation/registration/allergies_screen/allergies_screen.dart b/lib/presentation/registration/allergies_screen/allergies_screen.dart index 50d056b3..30e218c2 100644 --- a/lib/presentation/registration/allergies_screen/allergies_screen.dart +++ b/lib/presentation/registration/allergies_screen/allergies_screen.dart @@ -17,7 +17,7 @@ class AllergiesScreen extends StatefulWidget { static Widget builder(BuildContext context, sheet) { return BlocProvider( create: (context) => AllergiesBloc(AllergiesState(allergiesModelObj: AllergiesModel(userRegistrationSheet: sheet)))..add(AllergiesInitialEvent()), - child: AllergiesScreen()); + child: AllergiesScreen(),); } @override @@ -41,11 +41,11 @@ class _AllergiesScreenState extends State { decoration: BoxDecoration( color: theme.colorScheme.onPrimary, borderRadius: BorderRadius.circular(8.h), - border: Border.all(color: theme.colorScheme.primary, width: 1.h)), + border: Border.all(color: theme.colorScheme.primary, width: 1.h),), child: ClipRRect( borderRadius: BorderRadius.circular(8.h), child: LinearProgressIndicator( - value: 0.76, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400)))), + value: 0.76, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400),),),), SizedBox(height: 22.v), Text("allergies_presence".tr, style: theme.textTheme.headlineSmall), Spacer(flex: 36), @@ -56,15 +56,15 @@ class _AllergiesScreenState extends State { text: "continue".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapContinue(state, context)); - }), + onPressed: onTapContinue(state, context),); + },), BlocBuilder(builder: (context, state) { return GestureDetector( onTap: onTapSkip(state, context), child: Text("skip".tr, style: theme.textTheme.bodyLarge), ); - }), - ]))); + },), + ],),),); } onTapSkip(AllergiesState state, BuildContext context) { @@ -89,7 +89,7 @@ class _AllergiesScreenState extends State { leading: AppbarLeadingImage(imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 18.h, top: 15.v, bottom: 15.v), onTap: onTapBack(context)), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); + title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio),); } onTapBack(BuildContext context) { @@ -107,9 +107,9 @@ class _AllergiesScreenState extends State { selector: (state) => state.enterInformationController, builder: (context, enterInformationController) { return CustomTextFormField( - controller: enterInformationController, hintText: "enter_information".tr, textInputAction: TextInputAction.done, maxLines: 8); - }) - ]); + controller: enterInformationController, hintText: "enter_information".tr, textInputAction: TextInputAction.done, maxLines: 8,); + },), + ],); } /// Navigates to the previous screen. diff --git a/lib/presentation/registration/app_navigation_screen/app_navigation_screen.dart b/lib/presentation/registration/app_navigation_screen/app_navigation_screen.dart index 781552ef..29c5748b 100644 --- a/lib/presentation/registration/app_navigation_screen/app_navigation_screen.dart +++ b/lib/presentation/registration/app_navigation_screen/app_navigation_screen.dart @@ -15,7 +15,7 @@ class AppNavigationScreen extends StatefulWidget { return BlocProvider( create: (context) => AppNavigationBloc(AppNavigationState( appNavigationModelObj: AppNavigationModel(), - )) + ),) ..add(AppNavigationInitialEvent()), child: AppNavigationScreen(), ); diff --git a/lib/presentation/registration/blood_pressure_screen/bloc/blood_pressure_bloc.dart b/lib/presentation/registration/blood_pressure_screen/bloc/blood_pressure_bloc.dart index e5a0c6a0..47416549 100644 --- a/lib/presentation/registration/blood_pressure_screen/bloc/blood_pressure_bloc.dart +++ b/lib/presentation/registration/blood_pressure_screen/bloc/blood_pressure_bloc.dart @@ -53,9 +53,9 @@ class BloodPressureBloc extends Bloc { ) async { emit(state.copyWith( upPressureController: TextEditingController(), - downPressureController: TextEditingController())); + downPressureController: TextEditingController(),),); emit(state.copyWith( bloodPressureModelObj: state.bloodPressureModelObj - ?.copyWith(dropdownItemList: fillDropdownItemList()))); + ?.copyWith(dropdownItemList: fillDropdownItemList()),),); } } diff --git a/lib/presentation/registration/blood_pressure_screen/blood_pressure_screen.dart b/lib/presentation/registration/blood_pressure_screen/blood_pressure_screen.dart index 5d4d8cc4..1aabdbd4 100644 --- a/lib/presentation/registration/blood_pressure_screen/blood_pressure_screen.dart +++ b/lib/presentation/registration/blood_pressure_screen/blood_pressure_screen.dart @@ -21,7 +21,7 @@ class BloodPressureScreen extends StatefulWidget { return BlocProvider( create: (context) => BloodPressureBloc(BloodPressureState(bloodPressureModelObj: BloodPressureModel(userRegistrationSheet: sheet)))..add(BloodPressureInitialEvent()), - child: BloodPressureScreen()); + child: BloodPressureScreen(),); } @override @@ -66,7 +66,7 @@ class _BloodPressureScreenState extends State { SizedBox( width: 224.h, child: Text("your_blood_pressure".tr, - maxLines: 2, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, style: theme.textTheme.headlineSmall)), + maxLines: 2, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, style: theme.textTheme.headlineSmall,),), SizedBox(height: 21.v), Container( margin: EdgeInsets.only(right: 1.h), @@ -78,8 +78,8 @@ class _BloodPressureScreenState extends State { selector: (state) => state.upPressureController, builder: (context, upPressureController) { return CustomTextFormField(inputFormatters: [digitsOnly], controller: upPressureController, hintText: "90".tr); - }) - ])), + },), + ],),), SizedBox(height: 21.v), Container( margin: EdgeInsets.only(right: 1.h), @@ -91,8 +91,8 @@ class _BloodPressureScreenState extends State { selector: (state) => state.downPressureController, builder: (context, downPressureController) { return CustomTextFormField(inputFormatters: [digitsOnly], controller: downPressureController, hintText: "90".tr); - }) - ])), + },), + ],),), SizedBox(height: 22.v), Text("do_you_have_hypotension_tendency".tr, style: theme.textTheme.bodyLarge), SizedBox(height: 2.v), @@ -105,11 +105,11 @@ class _BloodPressureScreenState extends State { icon: Container( margin: EdgeInsets.fromLTRB(30.h, 11.v, 13.h, 11.v), decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)), - child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize)), + child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize),), hintText: "Не выбрано".tr, items: bloodPressureModelObj?.dropdownItemList ?? [], - onChanged: onChangeHyper(context)); - })), + onChanged: onChangeHyper(context),); + },),), SizedBox(height: 22.v), Text("do_you_have_hypertension_tendency".tr, style: theme.textTheme.bodyLarge), SizedBox(height: 2.v), @@ -122,26 +122,26 @@ class _BloodPressureScreenState extends State { icon: Container( margin: EdgeInsets.fromLTRB(30.h, 11.v, 13.h, 11.v), decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)), - child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize)), + child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize),), hintText: "Не выбрано".tr, items: bloodPressureModelObj?.dropdownItemList ?? [], - onChanged: onChangeHypo(context)); - })), + onChanged: onChangeHypo(context),); + },),), Spacer(), BlocBuilder(builder: (context, state) { return NextStepButton( text: "continue".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapContinue(state, context)); - }), + onPressed: onTapContinue(state, context),); + },), BlocBuilder(builder: (context, state) { return GestureDetector( onTap: onTapSkip(state, context), child: Text("skip".tr, style: theme.textTheme.bodyLarge), ); - }), - ]))); + },), + ],),),); } onTapSkip(BloodPressureState state, BuildContext context) { @@ -208,7 +208,7 @@ class _BloodPressureScreenState extends State { leading: AppbarLeadingImage(imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), onTap: onTapBack(context)), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); + title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio),); } Function onTapBack(BuildContext context) { diff --git a/lib/presentation/registration/blood_pressure_screen/models/blood_pressure_model.dart b/lib/presentation/registration/blood_pressure_screen/models/blood_pressure_model.dart index 328d1c5d..2d8463ef 100644 --- a/lib/presentation/registration/blood_pressure_screen/models/blood_pressure_model.dart +++ b/lib/presentation/registration/blood_pressure_screen/models/blood_pressure_model.dart @@ -9,7 +9,7 @@ import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_m class BloodPressureModel extends Equatable { UserRegistrationSheet userRegistrationSheet; BloodPressureModel( - {required this.userRegistrationSheet, this.dropdownItemList = const []}); + {required this.userRegistrationSheet, this.dropdownItemList = const [],}); List dropdownItemList; diff --git a/lib/presentation/registration/body_circumferences_screen/bloc/body_circumferences_bloc.dart b/lib/presentation/registration/body_circumferences_screen/bloc/body_circumferences_bloc.dart index 13f1a279..871ff8dc 100644 --- a/lib/presentation/registration/body_circumferences_screen/bloc/body_circumferences_bloc.dart +++ b/lib/presentation/registration/body_circumferences_screen/bloc/body_circumferences_bloc.dart @@ -20,6 +20,6 @@ class BodyCircumferencesBloc emit(state.copyWith( chestCircumferenceController: TextEditingController(), waistCircumferenceController: TextEditingController(), - hipCircumferenceController: TextEditingController())); + hipCircumferenceController: TextEditingController(),),); } } diff --git a/lib/presentation/registration/body_circumferences_screen/body_circumferences_screen.dart b/lib/presentation/registration/body_circumferences_screen/body_circumferences_screen.dart index 3610697e..3326d45a 100644 --- a/lib/presentation/registration/body_circumferences_screen/body_circumferences_screen.dart +++ b/lib/presentation/registration/body_circumferences_screen/body_circumferences_screen.dart @@ -41,11 +41,11 @@ class BodyCircumferencesScreen extends StatelessWidget { decoration: BoxDecoration( color: theme.colorScheme.onPrimary, borderRadius: BorderRadius.circular(8.h), - border: Border.all(color: theme.colorScheme.primary, width: 1.h)), + border: Border.all(color: theme.colorScheme.primary, width: 1.h),), child: ClipRRect( borderRadius: BorderRadius.circular(8.h), child: LinearProgressIndicator( - value: 0.40, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400)))), + value: 0.40, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400),),),), SizedBox(height: 39.v), Text("initial_measurements".tr, style: theme.textTheme.headlineSmall), SizedBox(height: 93.v), @@ -56,8 +56,8 @@ class BodyCircumferencesScreen extends StatelessWidget { selector: (state) => state.chestCircumferenceController, builder: (context, chestCircumferenceController) { return CustomTextFormField(inputFormatters: [digitsOnly], controller: chestCircumferenceController, hintText: "90".tr); - }) - ]), + },), + ],), SizedBox(height: 19.v), Text("waist_circumference".tr, style: theme.textTheme.bodyLarge), SizedBox(height: 5.v), @@ -65,7 +65,7 @@ class BodyCircumferencesScreen extends StatelessWidget { selector: (state) => state.waistCircumferenceController, builder: (context, waistCircumferenceController) { return CustomTextFormField(inputFormatters: [digitsOnly], controller: waistCircumferenceController, hintText: "60".tr); - }), + },), SizedBox(height: 21.v), Text("hip_circumference".tr, style: theme.textTheme.bodyLarge), SizedBox(height: 3.v), @@ -73,17 +73,17 @@ class BodyCircumferencesScreen extends StatelessWidget { selector: (state) => state.hipCircumferenceController, builder: (context, hipCircumferenceController) { return CustomTextFormField( - inputFormatters: [digitsOnly], controller: hipCircumferenceController, hintText: "90".tr, textInputAction: TextInputAction.done); - }), + inputFormatters: [digitsOnly], controller: hipCircumferenceController, hintText: "90".tr, textInputAction: TextInputAction.done,); + },), Spacer(), BlocBuilder(builder: (context, state) { return NextStepButton( text: "continue".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapContinue(state, context)); - }), - ]))); + onPressed: onTapContinue(state, context),); + },), + ],),),); } onTapContinue(BodyCircumferencesState state, BuildContext context) { @@ -133,7 +133,7 @@ class BodyCircumferencesScreen extends StatelessWidget { leading: AppbarLeadingImage(imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), onTap: onTapBack(context)), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); + title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio),); } Function onTapBack(BuildContext context) { diff --git a/lib/presentation/registration/city_of_living_screen/bloc/city_of_living_bloc.dart b/lib/presentation/registration/city_of_living_screen/bloc/city_of_living_bloc.dart index ce4073f3..71864dbf 100644 --- a/lib/presentation/registration/city_of_living_screen/bloc/city_of_living_bloc.dart +++ b/lib/presentation/registration/city_of_living_screen/bloc/city_of_living_bloc.dart @@ -19,7 +19,7 @@ class CityOfLivingBloc extends Bloc { emit(state.copyWith( cityOfLivingModelObj: state.cityOfLivingModelObj?.copyWith( dropdownItemList: fillDropdownItemList(), - ))); + ),),); } _changeDropDown( diff --git a/lib/presentation/registration/city_of_living_screen/city_of_living_screen.dart b/lib/presentation/registration/city_of_living_screen/city_of_living_screen.dart index 5ce91501..82da493d 100644 --- a/lib/presentation/registration/city_of_living_screen/city_of_living_screen.dart +++ b/lib/presentation/registration/city_of_living_screen/city_of_living_screen.dart @@ -1142,7 +1142,7 @@ class CityOfLivingScreen extends StatelessWidget { "Ярцево", "Ясногорск", "Ясный", - "Яхрома" + "Яхрома", ]; return Scaffold( appBar: _buildAppBar(context), @@ -1157,11 +1157,11 @@ class CityOfLivingScreen extends StatelessWidget { decoration: BoxDecoration( color: theme.colorScheme.onPrimary, borderRadius: BorderRadius.circular(8.h), - border: Border.all(color: theme.colorScheme.primary, width: 1.h)), + border: Border.all(color: theme.colorScheme.primary, width: 1.h),), child: ClipRRect( borderRadius: BorderRadius.circular(8.h), child: LinearProgressIndicator( - value: 0.32, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400)))), + value: 0.32, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400),),),), SizedBox(height: 39.v), Text("place_of_living".tr, style: theme.textTheme.headlineSmall), Spacer(flex: 34), @@ -1174,11 +1174,11 @@ class CityOfLivingScreen extends StatelessWidget { icon: Container( margin: EdgeInsets.fromLTRB(30.h, 11.v, 17.h, 11.v), decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.h)), - child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize)), + child: CustomImageView(imagePath: ImageConstant.imgFavorite, height: 12.adaptSize, width: 12.adaptSize),), hintText: "Не выбрано".tr, items: cityOfLivingModelObj?.dropdownItemList ?? [], - onChanged: onDropDownChange(context)); - }), + onChanged: onDropDownChange(context),); + },), SizedBox(height: 22.v), Text("Населенный пункт", style: theme.textTheme.bodyLarge), SizedBox(height: 2.v), @@ -1228,16 +1228,16 @@ class CityOfLivingScreen extends StatelessWidget { ); }, ); - }), + },), Spacer(flex: 65), BlocBuilder(builder: (context, state) { return NextStepButton( text: "continue".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapContinue(state, context)); - }), - ]))); + onPressed: onTapContinue(state, context),); + },), + ],),),); } onTapContinue(CityOfLivingState state, BuildContext context) { @@ -1260,7 +1260,7 @@ class CityOfLivingScreen extends StatelessWidget { leading: AppbarLeadingImage(imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), onTap: onTapBack(context)), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); + title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio),); } Function onTapBack(BuildContext context) { diff --git a/lib/presentation/registration/city_of_living_screen/models/city_of_living_model.dart b/lib/presentation/registration/city_of_living_screen/models/city_of_living_model.dart index 10366f3d..24eb6d9c 100644 --- a/lib/presentation/registration/city_of_living_screen/models/city_of_living_model.dart +++ b/lib/presentation/registration/city_of_living_screen/models/city_of_living_model.dart @@ -1128,7 +1128,7 @@ class CityOfLivingModel extends Equatable { "Ярцево", "Ясногорск", "Ясный", - "Яхрома" + "Яхрома", ], }); diff --git a/lib/presentation/registration/credentials_screen/bloc/credentials_bloc.dart b/lib/presentation/registration/credentials_screen/bloc/credentials_bloc.dart index 91090d2a..f0d45cc0 100644 --- a/lib/presentation/registration/credentials_screen/bloc/credentials_bloc.dart +++ b/lib/presentation/registration/credentials_screen/bloc/credentials_bloc.dart @@ -19,6 +19,6 @@ class CredentialsBloc extends Bloc { emailController: TextEditingController(), nameController: TextEditingController(), passwordController: TextEditingController(), - passwordConfirmationController: TextEditingController())); + passwordConfirmationController: TextEditingController(),),); } } diff --git a/lib/presentation/registration/credentials_screen/credentials_screen.dart b/lib/presentation/registration/credentials_screen/credentials_screen.dart index 90723f60..cbf31712 100644 --- a/lib/presentation/registration/credentials_screen/credentials_screen.dart +++ b/lib/presentation/registration/credentials_screen/credentials_screen.dart @@ -40,11 +40,11 @@ class CredentialsScreen extends StatelessWidget { decoration: BoxDecoration( color: theme.colorScheme.onPrimary, borderRadius: BorderRadius.circular(8.h), - border: Border.all(color: theme.colorScheme.primary, width: 1.h)), + border: Border.all(color: theme.colorScheme.primary, width: 1.h),), child: ClipRRect( borderRadius: BorderRadius.circular(8.h), child: LinearProgressIndicator( - value: 0.05, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400)))), + value: 0.05, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400),),),), SizedBox(height: 39.v), Text("user_registration".tr, style: theme.textTheme.headlineSmall), SizedBox(height: 16.v), @@ -54,7 +54,7 @@ class CredentialsScreen extends StatelessWidget { selector: (state) => state.emailController, builder: (context, emailController) { return CustomTextFormField(controller: emailController, textInputAction: TextInputAction.done); - }), + },), SizedBox(height: 22.v), Text("username".tr, style: theme.textTheme.bodyLarge), SizedBox(height: 3.v), @@ -62,7 +62,7 @@ class CredentialsScreen extends StatelessWidget { selector: (state) => state.nameController, builder: (context, nameController) { return CustomTextFormField(controller: nameController, textInputAction: TextInputAction.done); - }), + },), SizedBox(height: 19.v), Text("password".tr, style: theme.textTheme.bodyLarge), SizedBox(height: 5.v), @@ -73,7 +73,7 @@ class CredentialsScreen extends StatelessWidget { obscureText: true, controller: passwordController, ); - }), + },), SizedBox(height: 21.v), Text("password_confirmation".tr, style: theme.textTheme.bodyLarge), SizedBox(height: 3.v), @@ -81,16 +81,16 @@ class CredentialsScreen extends StatelessWidget { selector: (state) => state.passwordConfirmationController, builder: (context, passwordConfirmationController) { return CustomTextFormField(obscureText: true, controller: passwordConfirmationController, textInputAction: TextInputAction.done); - }), + },), Spacer(), BlocBuilder(builder: (context, state) { return NextStepButton( text: "continue".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapContinue(state, context)); - }), - ]))); + onPressed: onTapContinue(state, context),); + },), + ],),),); } onTapContinue(CredentialsState state, BuildContext context) { diff --git a/lib/presentation/registration/date_of_birth_screen/date_of_birth_screen.dart b/lib/presentation/registration/date_of_birth_screen/date_of_birth_screen.dart index 5f68a3d2..a6b2da07 100644 --- a/lib/presentation/registration/date_of_birth_screen/date_of_birth_screen.dart +++ b/lib/presentation/registration/date_of_birth_screen/date_of_birth_screen.dart @@ -49,11 +49,11 @@ class _DateOfBirthScreenState extends State { decoration: BoxDecoration( color: theme.colorScheme.onPrimary, borderRadius: BorderRadius.circular(8.h), - border: Border.all(color: theme.colorScheme.primary, width: 1.h)), + border: Border.all(color: theme.colorScheme.primary, width: 1.h),), child: ClipRRect( borderRadius: BorderRadius.circular(8.h), child: LinearProgressIndicator( - value: 0.24, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400)))), + value: 0.24, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400),),),), SizedBox(height: 38.v), Text("date_of_birth".tr, style: theme.textTheme.headlineSmall), Spacer(flex: 39), @@ -64,10 +64,10 @@ class _DateOfBirthScreenState extends State { text: "continue".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapContinue(state, context)); - }), - ]))); - }); + onPressed: onTapContinue(state, context),); + },), + ],),),); + },); } onTapContinue(DateOfBirthState state, BuildContext context) { @@ -85,7 +85,7 @@ class _DateOfBirthScreenState extends State { leading: AppbarLeadingImage(imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), onTap: onTapBack(context)), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); + title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio),); } Function onTapBack(BuildContext context) { @@ -107,9 +107,9 @@ class _DateOfBirthScreenState extends State { alignment: Alignment.center, child: GestureDetector( onTap: onTapCalendar(context), - child: Text('${selectedDate.day}.${selectedDate.month}.${selectedDate.year}', style: theme.textTheme.titleMedium))), - SizedBox(height: 6.v) - ])); + child: Text('${selectedDate.day}.${selectedDate.month}.${selectedDate.year}', style: theme.textTheme.titleMedium),),), + SizedBox(height: 6.v), + ],),); } onTapCalendar(BuildContext context) { diff --git a/lib/presentation/registration/favorite_foods_screen/bloc/favorite_foods_bloc.dart b/lib/presentation/registration/favorite_foods_screen/bloc/favorite_foods_bloc.dart index 05f9d908..b9494911 100644 --- a/lib/presentation/registration/favorite_foods_screen/bloc/favorite_foods_bloc.dart +++ b/lib/presentation/registration/favorite_foods_screen/bloc/favorite_foods_bloc.dart @@ -17,6 +17,6 @@ class FavoriteFoodsBloc extends Bloc { ) async { emit(state.copyWith( favoriteFoodsController: TextEditingController(), - unfavoriteFoodsController: TextEditingController())); + unfavoriteFoodsController: TextEditingController(),),); } } diff --git a/lib/presentation/registration/favorite_foods_screen/favorite_foods_screen.dart b/lib/presentation/registration/favorite_foods_screen/favorite_foods_screen.dart index 94771a17..ea90d988 100644 --- a/lib/presentation/registration/favorite_foods_screen/favorite_foods_screen.dart +++ b/lib/presentation/registration/favorite_foods_screen/favorite_foods_screen.dart @@ -18,7 +18,7 @@ class FavoriteFoodsScreen extends StatefulWidget { return BlocProvider( create: (context) => FavoriteFoodsBloc(FavoriteFoodsState(favoriteFoodsModelObj: FavoriteFoodsModel(userRegistrationSheet: sheet)))..add(FavoriteFoodsInitialEvent()), - child: FavoriteFoodsScreen()); + child: FavoriteFoodsScreen(),); } @override @@ -42,17 +42,17 @@ class _FavoriteFoodsScreenState extends State { decoration: BoxDecoration( color: theme.colorScheme.onPrimary, borderRadius: BorderRadius.circular(8.h), - border: Border.all(color: theme.colorScheme.primary, width: 1.h)), + border: Border.all(color: theme.colorScheme.primary, width: 1.h),), child: ClipRRect( borderRadius: BorderRadius.circular(8.h), child: LinearProgressIndicator( - value: 0.90, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400)))), + value: 0.90, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400),),),), SizedBox(height: 19.v), Container( width: 327.h, margin: EdgeInsets.only(left: 8.h, right: 7.h), child: Text("favorite_unfavorite_foods".tr, - maxLines: 2, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, style: theme.textTheme.headlineSmall)), + maxLines: 2, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, style: theme.textTheme.headlineSmall,),), SizedBox(height: 13.v), _buildTextFormFieldFav(context), SizedBox(height: 12.v), @@ -63,15 +63,15 @@ class _FavoriteFoodsScreenState extends State { text: "continue".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 40.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapContinue(state, context)); - }), + onPressed: onTapContinue(state, context),); + },), BlocBuilder(builder: (context, state) { return GestureDetector( onTap: onTapSkip(state, context), child: Text("skip".tr, style: theme.textTheme.bodyLarge), ); - }), - ]))); + },), + ],),),); } onTapSkip(FavoriteFoodsState state, BuildContext context) { @@ -97,7 +97,7 @@ class _FavoriteFoodsScreenState extends State { leading: AppbarLeadingImage(imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 18.h, top: 15.v, bottom: 15.v), onTap: onTapBack(context)), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); + title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio),); } Function onTapBack(BuildContext context) { @@ -115,8 +115,8 @@ class _FavoriteFoodsScreenState extends State { selector: (state) => state.favoriteFoodsController, builder: (context, favoriteFoodsController) { return CustomTextFormField(controller: favoriteFoodsController, hintText: "enter_information".tr, maxLines: 7); - }) - ]); + },), + ],); } /// Section Widget @@ -128,9 +128,9 @@ class _FavoriteFoodsScreenState extends State { selector: (state) => state.unfavoriteFoodsController, builder: (context, unfavoriteFoodsController) { return CustomTextFormField( - controller: unfavoriteFoodsController, hintText: "enter_information".tr, textInputAction: TextInputAction.done, maxLines: 7); - }) - ]); + controller: unfavoriteFoodsController, hintText: "enter_information".tr, textInputAction: TextInputAction.done, maxLines: 7,); + },), + ],); } /// Navigates to the previous screen. diff --git a/lib/presentation/registration/favorite_sports_screen/favorite_sports_screen.dart b/lib/presentation/registration/favorite_sports_screen/favorite_sports_screen.dart index 66f98d28..498b24c4 100644 --- a/lib/presentation/registration/favorite_sports_screen/favorite_sports_screen.dart +++ b/lib/presentation/registration/favorite_sports_screen/favorite_sports_screen.dart @@ -18,7 +18,7 @@ class FavoriteSportsScreen extends StatefulWidget { return BlocProvider( create: (context) => FavoriteSportsBloc(FavoriteSportsState(favoriteSportsModelObj: FavoriteSportsModel(userRegistrationSheet: sheet))) ..add(FavoriteSportsInitialEvent()), - child: FavoriteSportsScreen()); + child: FavoriteSportsScreen(),); } @override @@ -42,11 +42,11 @@ class _FavoriteSportsScreenState extends State { decoration: BoxDecoration( color: theme.colorScheme.onPrimary, borderRadius: BorderRadius.circular(8.h), - border: Border.all(color: theme.colorScheme.primary, width: 1.h)), + border: Border.all(color: theme.colorScheme.primary, width: 1.h),), child: ClipRRect( borderRadius: BorderRadius.circular(8.h), child: LinearProgressIndicator( - value: 0.83, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400)))), + value: 0.83, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400),),),), SizedBox(height: 38.v), Text("your_favorite_sports".tr, style: theme.textTheme.headlineSmall), Spacer(flex: 32), @@ -57,15 +57,15 @@ class _FavoriteSportsScreenState extends State { text: "continue".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapContinue(state, context)); - }), + onPressed: onTapContinue(state, context),); + },), BlocBuilder(builder: (context, state) { return GestureDetector( onTap: onTapSkip(state, context), child: Text("skip".tr, style: theme.textTheme.bodyLarge), ); - }), - ]))); + },), + ],),),); } onTapSkip(FavoriteSportsState state, BuildContext context) { @@ -89,7 +89,7 @@ class _FavoriteSportsScreenState extends State { leading: AppbarLeadingImage(imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), onTap: onTapBack(context)), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); + title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio),); } Function onTapBack(BuildContext context) { @@ -111,9 +111,9 @@ class _FavoriteSportsScreenState extends State { hintText: "Я занимаюсь плаванием , почти каждый вечер прогулки на свежем воздухе, пару раз в месяц играю в волейбол. Стараюсь не сидеть на месте!", textInputAction: TextInputAction.done, - maxLines: 8); - }) - ]); + maxLines: 8,); + },), + ],); } onTapArrowLeft(BuildContext context) { diff --git a/lib/presentation/registration/gender_screen/gender_screen.dart b/lib/presentation/registration/gender_screen/gender_screen.dart index 68909d7f..d6a9b63d 100644 --- a/lib/presentation/registration/gender_screen/gender_screen.dart +++ b/lib/presentation/registration/gender_screen/gender_screen.dart @@ -20,7 +20,7 @@ class GenderScreen extends StatefulWidget { genderModelObj: GenderModel(userRegistrationSheet: sheet), ), )..add(GenderInitialEvent()), - child: GenderScreen()); + child: GenderScreen(),); } @override @@ -45,11 +45,11 @@ class _GenderScreenState extends State { decoration: BoxDecoration( color: theme.colorScheme.onPrimary, borderRadius: BorderRadius.circular(8.h), - border: Border.all(color: theme.colorScheme.primary, width: 1.h)), + border: Border.all(color: theme.colorScheme.primary, width: 1.h),), child: ClipRRect( borderRadius: BorderRadius.circular(8.h), child: LinearProgressIndicator( - value: 0.16, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400)))), + value: 0.16, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400),),),), SizedBox(height: 36.v), Text("your_gender".tr, style: theme.textTheme.headlineSmall), RadioListTile( @@ -80,10 +80,10 @@ class _GenderScreenState extends State { text: "continue".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapNext(state, context)); - }), - ]))); - }); + onPressed: onTapNext(state, context),); + },), + ],),),); + },); } onTapNext(GenderState state, BuildContext context) { diff --git a/lib/presentation/registration/gender_screen/models/gender_model.dart b/lib/presentation/registration/gender_screen/models/gender_model.dart index b314fba5..69779b41 100644 --- a/lib/presentation/registration/gender_screen/models/gender_model.dart +++ b/lib/presentation/registration/gender_screen/models/gender_model.dart @@ -12,7 +12,7 @@ class GenderModel extends Equatable { GenderModel copyWith({UserRegistrationSheet? userRegistrationSheet, gender}) { return GenderModel( userRegistrationSheet: - userRegistrationSheet ?? this.userRegistrationSheet); + userRegistrationSheet ?? this.userRegistrationSheet,); } @override diff --git a/lib/presentation/registration/height_screen/bloc/height_bloc.dart b/lib/presentation/registration/height_screen/bloc/height_bloc.dart index 70b8ba60..223f7194 100644 --- a/lib/presentation/registration/height_screen/bloc/height_bloc.dart +++ b/lib/presentation/registration/height_screen/bloc/height_bloc.dart @@ -17,6 +17,6 @@ class HeightBloc extends Bloc { ) async { emit(state.copyWith( heightModelObj: state.heightModelObj?.copyWith(), - heightController: state.heightController)); + heightController: state.heightController,),); } } diff --git a/lib/presentation/registration/height_screen/height_screen.dart b/lib/presentation/registration/height_screen/height_screen.dart index 071285f9..22ada6c4 100644 --- a/lib/presentation/registration/height_screen/height_screen.dart +++ b/lib/presentation/registration/height_screen/height_screen.dart @@ -18,7 +18,7 @@ class HeightScreen extends StatelessWidget { static Widget builder(BuildContext context, sheet) { return BlocProvider( create: (context) => HeightBloc(HeightState(heightModelObj: HeightModel(userRegistrationSheet: sheet)))..add(HeightInitialEvent()), - child: HeightScreen()); + child: HeightScreen(),); } @override @@ -79,7 +79,7 @@ class HeightScreen extends StatelessWidget { FilteringTextInputFormatter.digitsOnly, ], ); - }) + },), ], ), ], @@ -119,7 +119,7 @@ class HeightScreen extends StatelessWidget { leading: AppbarLeadingImage(imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), onTap: onTapBack(context)), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); + title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio),); } Function onTapBack(BuildContext context) { diff --git a/lib/presentation/registration/height_screen/models/height_model.dart b/lib/presentation/registration/height_screen/models/height_model.dart index caa3b752..3a56580a 100644 --- a/lib/presentation/registration/height_screen/models/height_model.dart +++ b/lib/presentation/registration/height_screen/models/height_model.dart @@ -9,7 +9,7 @@ import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_m class HeightModel extends Equatable { UserRegistrationSheet userRegistrationSheet; HeightModel( - {this.dropdownItemList = const [], required this.userRegistrationSheet}); + {this.dropdownItemList = const [], required this.userRegistrationSheet,}); List dropdownItemList; diff --git a/lib/presentation/registration/language_select_screen/bloc/language_select_bloc.dart b/lib/presentation/registration/language_select_screen/bloc/language_select_bloc.dart index e9b6959f..b0592bb0 100644 --- a/lib/presentation/registration/language_select_screen/bloc/language_select_bloc.dart +++ b/lib/presentation/registration/language_select_screen/bloc/language_select_bloc.dart @@ -19,7 +19,7 @@ class LanguageSelectBloc ) async { emit(state.copyWith( languageSelectModelObj: state.languageSelectModelObj - ?.copyWith(dropdownItemList: fillDropdownItemList()))); + ?.copyWith(dropdownItemList: fillDropdownItemList()),),); } _changeDropDown( diff --git a/lib/presentation/registration/language_select_screen/language_select_screen.dart b/lib/presentation/registration/language_select_screen/language_select_screen.dart index 75a7c1a3..a682d9db 100644 --- a/lib/presentation/registration/language_select_screen/language_select_screen.dart +++ b/lib/presentation/registration/language_select_screen/language_select_screen.dart @@ -87,7 +87,7 @@ class LanguageSelectScreen extends StatelessWidget { items: languageSelectModelObj?.dropdownItemList ?? [], onChanged: (value) => _onDropDownChanged(context, value), ); - }), + },), Spacer(flex: 63), ], ), diff --git a/lib/presentation/registration/medicine_intake_screen/medicine_intake_screen.dart b/lib/presentation/registration/medicine_intake_screen/medicine_intake_screen.dart index 9f01f6f8..bce90496 100644 --- a/lib/presentation/registration/medicine_intake_screen/medicine_intake_screen.dart +++ b/lib/presentation/registration/medicine_intake_screen/medicine_intake_screen.dart @@ -18,7 +18,7 @@ class MedicineIntakeScreen extends StatefulWidget { return BlocProvider( create: (context) => MedicineIntakeBloc(MedicineIntakeState(medicineIntakeModelObj: MedicineIntakeModel(userRegistrationSheet: sheet))) ..add(MedicineIntakeInitialEvent()), - child: MedicineIntakeScreen()); + child: MedicineIntakeScreen(),); } @override @@ -43,17 +43,17 @@ class _MedicineIntakeScreenState extends State { decoration: BoxDecoration( color: theme.colorScheme.onPrimary, borderRadius: BorderRadius.circular(8.h), - border: Border.all(color: theme.colorScheme.primary, width: 1.h)), + border: Border.all(color: theme.colorScheme.primary, width: 1.h),), child: ClipRRect( borderRadius: BorderRadius.circular(8.h), child: LinearProgressIndicator( - value: 0.69, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400)))), + value: 0.69, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400),),),), SizedBox(height: 20.v), Container( width: 271.h, margin: EdgeInsets.only(left: 35.h, right: 36.h), child: Text("do_you_take_pills".tr, - maxLines: 2, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, style: theme.textTheme.headlineSmall)), + maxLines: 2, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, style: theme.textTheme.headlineSmall,),), SizedBox(height: 86.v), _buildTextFormField(context), Spacer(), @@ -62,15 +62,15 @@ class _MedicineIntakeScreenState extends State { text: "continue".tr.toUpperCase(), margin: EdgeInsets.only(left: 16.h, right: 16.h, bottom: 50.v), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, - onPressed: onTapNext(state, context)); - }), + onPressed: onTapNext(state, context),); + },), BlocBuilder(builder: (context, state) { return GestureDetector( onTap: onTapSkip(state, context), child: Text("skip".tr, style: theme.textTheme.bodyLarge), ); - }), - ]))); + },), + ],),),); } onTapSkip(MedicineIntakeState state, BuildContext context) { @@ -101,7 +101,7 @@ class _MedicineIntakeScreenState extends State { leading: AppbarLeadingImage(imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 18.h, top: 15.v, bottom: 15.v), onTap: onTapBack(context)), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); + title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio),); } Function onTapBack(BuildContext context) { @@ -119,9 +119,9 @@ class _MedicineIntakeScreenState extends State { selector: (state) => state.enterInformationController, builder: (context, enterInformationController) { return CustomTextFormField( - controller: enterInformationController, hintText: "enter_information".tr, textInputAction: TextInputAction.done, maxLines: 8); - }) - ]); + controller: enterInformationController, hintText: "enter_information".tr, textInputAction: TextInputAction.done, maxLines: 8,); + },), + ],); } /// Navigates to the previous screen. diff --git a/lib/presentation/registration/name_screen/bloc/name_bloc.dart b/lib/presentation/registration/name_screen/bloc/name_bloc.dart index f9c47e33..e4a51431 100644 --- a/lib/presentation/registration/name_screen/bloc/name_bloc.dart +++ b/lib/presentation/registration/name_screen/bloc/name_bloc.dart @@ -17,6 +17,6 @@ class NameBloc extends Bloc { ) async { emit(state.copyWith( firstNameController: TextEditingController(), - lastNameController: TextEditingController())); + lastNameController: TextEditingController(),),); } } diff --git a/lib/presentation/registration/name_screen/name_screen.dart b/lib/presentation/registration/name_screen/name_screen.dart index e1f03271..880c3ae2 100644 --- a/lib/presentation/registration/name_screen/name_screen.dart +++ b/lib/presentation/registration/name_screen/name_screen.dart @@ -22,7 +22,7 @@ class NameScreen extends StatelessWidget { nameModelObj: NameModel(userRegistrationSheet: sheet), ), )..add(NameInitialEvent()), - child: NameScreen()); + child: NameScreen(),); } @override @@ -42,11 +42,11 @@ class NameScreen extends StatelessWidget { decoration: BoxDecoration( color: theme.colorScheme.onPrimary, borderRadius: BorderRadius.circular(8.h), - border: Border.all(color: theme.colorScheme.primary, width: 1.h)), + border: Border.all(color: theme.colorScheme.primary, width: 1.h),), child: ClipRRect( borderRadius: BorderRadius.circular(8.h), child: LinearProgressIndicator( - value: 0.1, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400)))), + value: 0.1, backgroundColor: theme.colorScheme.onPrimary, valueColor: AlwaysStoppedAnimation(appTheme.blueA400),),),), SizedBox(height: 39.v), Text("what_is_your_name".tr, style: theme.textTheme.headlineSmall), SizedBox(height: 93.v), @@ -56,7 +56,7 @@ class NameScreen extends StatelessWidget { selector: (state) => state.firstNameController, builder: (context, firstNameController) { return CustomTextFormField(controller: firstNameController, textInputAction: TextInputAction.done); - }), + },), SizedBox(height: 19.v), Text("last_name".tr, style: theme.textTheme.bodyLarge), SizedBox(height: 5.v), @@ -66,7 +66,7 @@ class NameScreen extends StatelessWidget { return CustomTextFormField( controller: lastNameController, ); - }), + },), Spacer(), BlocBuilder(builder: (context, state) { return NextStepButton( @@ -75,8 +75,8 @@ class NameScreen extends StatelessWidget { buttonStyle: CustomButtonStyles.outlinePrimaryTL15, onPressed: () => _onTapNext(context, state), // Assign callback function here ); - }), - ]))); + },), + ],),),); } /// Section Widget @@ -84,9 +84,9 @@ class NameScreen extends StatelessWidget { return CustomAppBar( leadingWidth: 29.h, leading: AppbarLeadingImage( - imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), onTap: () => onTapArrowLeft(context)), + imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), onTap: () => onTapArrowLeft(context),), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); + title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio),); } /// Navigates to the previous screen. diff --git a/lib/presentation/registration/splash_screen/splash_screen.dart b/lib/presentation/registration/splash_screen/splash_screen.dart index 501586fd..f8355f03 100644 --- a/lib/presentation/registration/splash_screen/splash_screen.dart +++ b/lib/presentation/registration/splash_screen/splash_screen.dart @@ -11,7 +11,7 @@ class SplashScreen extends StatelessWidget { create: (context) => SplashBloc(SplashState(splashModelObj: SplashModel())) ..add(SplashInitialEvent()), - child: SplashScreen()); + child: SplashScreen(),); } @override @@ -29,8 +29,8 @@ class SplashScreen extends StatelessWidget { CustomImageView( imagePath: ImageConstant.img2456927096976, height: 137.adaptSize, - width: 137.adaptSize) - ])))); - }); + width: 137.adaptSize,), + ],),),),); + },); } } diff --git a/lib/presentation/registration/weight_screen/bloc/weight_bloc.dart b/lib/presentation/registration/weight_screen/bloc/weight_bloc.dart index 69161cce..f03c8c3b 100644 --- a/lib/presentation/registration/weight_screen/bloc/weight_bloc.dart +++ b/lib/presentation/registration/weight_screen/bloc/weight_bloc.dart @@ -17,6 +17,6 @@ class WeightBloc extends Bloc { ) async { emit(state.copyWith( weightModelObj: state.weightModelObj?.copyWith(), - weightController: state.weightController)); + weightController: state.weightController,),); } } diff --git a/lib/presentation/registration/weight_screen/models/weight_model.dart b/lib/presentation/registration/weight_screen/models/weight_model.dart index e26b49a0..d5edd078 100644 --- a/lib/presentation/registration/weight_screen/models/weight_model.dart +++ b/lib/presentation/registration/weight_screen/models/weight_model.dart @@ -9,7 +9,7 @@ import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_m class WeightModel extends Equatable { UserRegistrationSheet userRegistrationSheet; WeightModel( - {this.dropdownItemList = const [], required this.userRegistrationSheet}); + {this.dropdownItemList = const [], required this.userRegistrationSheet,}); List dropdownItemList; diff --git a/lib/presentation/registration/weight_screen/weight_screen.dart b/lib/presentation/registration/weight_screen/weight_screen.dart index 7bf28f1f..5d47e8d1 100644 --- a/lib/presentation/registration/weight_screen/weight_screen.dart +++ b/lib/presentation/registration/weight_screen/weight_screen.dart @@ -18,7 +18,7 @@ class WeightScreen extends StatelessWidget { static Widget builder(BuildContext context, sheet) { return BlocProvider( create: (context) => WeightBloc(WeightState(weightModelObj: WeightModel(userRegistrationSheet: sheet)))..add(WeightInitialEvent()), - child: WeightScreen()); + child: WeightScreen(),); } @override @@ -78,7 +78,7 @@ class WeightScreen extends StatelessWidget { FilteringTextInputFormatter.digitsOnly, ], ); - }) + },), ], ), ], @@ -118,7 +118,7 @@ class WeightScreen extends StatelessWidget { leading: AppbarLeadingImage(imagePath: ImageConstant.imgArrowLeft, margin: EdgeInsets.only(left: 16.h, top: 15.v, bottom: 15.v), onTap: onTapBack(context)), centerTitle: true, - title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio)); + title: AppbarTitleImage(imagePath: ImageConstant.imgLogoEatvio),); } Function onTapBack(BuildContext context) { diff --git a/lib/theme/theme_helper.dart b/lib/theme/theme_helper.dart index 7226e373..8a5d5ed4 100644 --- a/lib/theme/theme_helper.dart +++ b/lib/theme/theme_helper.dart @@ -9,12 +9,12 @@ class ThemeHelper { // A map of custom color themes supported by the app Map _supportedCustomColor = { - 'primary': PrimaryColors() + 'primary': PrimaryColors(), }; // A map of color schemes supported by the app Map _supportedColorScheme = { - 'primary': ColorSchemes.primaryColorScheme + 'primary': ColorSchemes.primaryColorScheme, }; /// Returns the primary colors for the current theme. @@ -22,7 +22,7 @@ class ThemeHelper { //throw exception to notify given theme is not found or not generated by the generator if (!_supportedCustomColor.containsKey(_appTheme)) { throw Exception( - "$_appTheme is not found.Make sure you have added this theme class in JSON Try running flutter pub run build_runner"); + "$_appTheme is not found.Make sure you have added this theme class in JSON Try running flutter pub run build_runner",); } //return theme from map @@ -34,7 +34,7 @@ class ThemeHelper { //throw exception to notify given theme is not found or not generated by the generator if (!_supportedColorScheme.containsKey(_appTheme)) { throw Exception( - "$_appTheme is not found.Make sure you have added this theme class in JSON Try running flutter pub run build_runner"); + "$_appTheme is not found.Make sure you have added this theme class in JSON Try running flutter pub run build_runner",); } //return theme from map diff --git a/lib/widgets/bottom_navigation_bar_widget.dart b/lib/widgets/bottom_navigation_bar_widget.dart index 68197c17..51fd3e9d 100644 --- a/lib/widgets/bottom_navigation_bar_widget.dart +++ b/lib/widgets/bottom_navigation_bar_widget.dart @@ -51,7 +51,7 @@ class _BottomNavigationBarWidgetState extends State { items: [ PopupMenuItem( child: CustomNavigationMenu(), - ) + ), ], position: RelativeRect.fromLTRB(size.width, size.height, 0, 0), ); diff --git a/lib/widgets/custom_about_list.dart b/lib/widgets/custom_about_list.dart index f4b91b2c..4b4e709f 100644 --- a/lib/widgets/custom_about_list.dart +++ b/lib/widgets/custom_about_list.dart @@ -28,7 +28,7 @@ class _AboutListState extends State { style: TextStyle( color: Colors.black, fontSize: 14, - fontWeight: FontWeight.bold), + fontWeight: FontWeight.bold,), ), Icon(isExpanded ? Icons.arrow_drop_up : Icons.arrow_drop_down), ], @@ -39,7 +39,7 @@ class _AboutListState extends State { padding: const EdgeInsets.only(left: 16.0), child: Column( //children: widget.items.map((item) => Text(item)).toList(), - children: [Text(widget.items.join('\n'))]), + children: [Text(widget.items.join('\n'))],), ), Divider(), ], diff --git a/lib/widgets/custom_expandable_list.dart b/lib/widgets/custom_expandable_list.dart index c3d552b7..79d62d1b 100644 --- a/lib/widgets/custom_expandable_list.dart +++ b/lib/widgets/custom_expandable_list.dart @@ -39,7 +39,7 @@ class _ExpandableListState extends State { style: TextStyle( color: Colors.black, fontSize: 14, - fontWeight: FontWeight.bold), + fontWeight: FontWeight.bold,), ), Icon(isExpanded ? Icons.arrow_drop_up : Icons.arrow_drop_down), ], @@ -66,7 +66,7 @@ class _ExpandableListState extends State { // Другие состояния, если они есть. return Container(); // Пустой контейнер для необработанных состояний. } - }), + },), ), Divider(), ], @@ -122,7 +122,7 @@ class _ExpandableListState extends State { 'низкий (1-3 тренировки в неделю по 20 мин)', 'умеренный (3-4 тренировки в неделю по 30-60 мин)', 'высокий (5-7 тренировок по 30-60 мин)', - 'экстремальный (несколько интенсивных тренировок в день)' + 'экстремальный (несколько интенсивных тренировок в день)', ]; final digitsOnly = FilteringTextInputFormatter.digitsOnly; return Column(children: [ @@ -137,7 +137,7 @@ class _ExpandableListState extends State { TextField( decoration: InputDecoration(labelText: 'date_of_birth'.tr), controller: state.dateFormController, - onTap: inputTime(context, state)), + onTap: inputTime(context, state),), DropdownButtonFormField( value: state.selectedCountry, hint: Text(state.selectedCountry ?? "Не выбрано"), @@ -166,37 +166,37 @@ class _ExpandableListState extends State { controller: state.weightFormController, decoration: InputDecoration(labelText: 'weight_measurements'.tr), keyboardType: TextInputType.number, - inputFormatters: [digitsOnly]), + inputFormatters: [digitsOnly],), TextField( controller: state.heightFormController, decoration: InputDecoration(labelText: 'height_measurements'.tr), keyboardType: TextInputType.number, - inputFormatters: [digitsOnly]), + inputFormatters: [digitsOnly],), TextField( controller: state.chestCircumferenceFormController, decoration: InputDecoration(labelText: 'chest_circumference'.tr), keyboardType: TextInputType.number, - inputFormatters: [digitsOnly]), + inputFormatters: [digitsOnly],), TextField( controller: state.waistCircumferenceFormController, decoration: InputDecoration(labelText: 'waist_circumference'.tr), keyboardType: TextInputType.number, - inputFormatters: [digitsOnly]), + inputFormatters: [digitsOnly],), TextField( controller: state.hipCircumferenceFormController, decoration: InputDecoration(labelText: 'hip_circumference'.tr), keyboardType: TextInputType.number, - inputFormatters: [digitsOnly]), + inputFormatters: [digitsOnly],), TextField( controller: state.upPressureFormController, decoration: InputDecoration(labelText: 'up_pressure'.tr), keyboardType: TextInputType.number, - inputFormatters: [digitsOnly]), + inputFormatters: [digitsOnly],), TextField( controller: state.downPressureFormController, decoration: InputDecoration(labelText: 'down_pressure'.tr), keyboardType: TextInputType.number, - inputFormatters: [digitsOnly]), + inputFormatters: [digitsOnly],), TextField( controller: state.allergiesFormController, decoration: InputDecoration(labelText: 'allergies_presence'.tr), @@ -259,8 +259,8 @@ class _ExpandableListState extends State { onPressed: () => sendProfileData(state), buttonStyle: CustomButtonStyles.outlinePrimaryTL15, text: "save".tr.toUpperCase(), - margin: EdgeInsets.only(top: 20.h, bottom: 20.h)), - ]); + margin: EdgeInsets.only(top: 20.h, bottom: 20.h),), + ],); } sendData(MyProfileLoadedState state) { @@ -382,7 +382,7 @@ class _ExpandableListState extends State { } Future _sendHttpRequest( - Map profileData, String apiUrl, String? token) { + Map profileData, String apiUrl, String? token,) { return http.post( Uri.parse(apiUrl), body: json.encode(profileData), diff --git a/lib/widgets/custom_hyper_switch.dart b/lib/widgets/custom_hyper_switch.dart index 92ebf000..e25c462b 100644 --- a/lib/widgets/custom_hyper_switch.dart +++ b/lib/widgets/custom_hyper_switch.dart @@ -30,7 +30,7 @@ class _HyperState extends State { Text( widget.title, style: TextStyle( - color: Colors.black, fontSize: 14, fontWeight: FontWeight.bold), + color: Colors.black, fontSize: 14, fontWeight: FontWeight.bold,), ), Switch( value: switchValue, diff --git a/lib/widgets/custom_hypo_switch.dart b/lib/widgets/custom_hypo_switch.dart index 1c625feb..173de64a 100644 --- a/lib/widgets/custom_hypo_switch.dart +++ b/lib/widgets/custom_hypo_switch.dart @@ -30,7 +30,7 @@ class _HypoState extends State { Text( widget.title, style: TextStyle( - color: Colors.black, fontSize: 14, fontWeight: FontWeight.bold), + color: Colors.black, fontSize: 14, fontWeight: FontWeight.bold,), ), Switch( value: switchValue, diff --git a/lib/widgets/custom_icon_button.dart b/lib/widgets/custom_icon_button.dart index 55766f18..2937b5a1 100644 --- a/lib/widgets/custom_icon_button.dart +++ b/lib/widgets/custom_icon_button.dart @@ -45,7 +45,7 @@ class CustomIconButton extends StatelessWidget { color: Colors.black, borderRadius: const BorderRadius.all(Radius.circular(9)), border: const Border.fromBorderSide( - BorderSide(color: Colors.blueGrey, width: 1)), + BorderSide(color: Colors.blueGrey, width: 1),), ), child: child, ), diff --git a/lib/widgets/custom_navigation_menu_item.dart b/lib/widgets/custom_navigation_menu_item.dart index f33d5342..2ee47a8c 100644 --- a/lib/widgets/custom_navigation_menu_item.dart +++ b/lib/widgets/custom_navigation_menu_item.dart @@ -26,7 +26,7 @@ class MenuItem extends StatelessWidget { CustomImageView(imagePath: icon), SizedBox( width: - 8.0), // Добавляем небольшой отступ между иконкой и текстом + 8.0,), // Добавляем небольшой отступ между иконкой и текстом Text(text), ], ), diff --git a/lib/widgets/custom_notification_screen.dart b/lib/widgets/custom_notification_screen.dart index bb778441..960293c3 100644 --- a/lib/widgets/custom_notification_screen.dart +++ b/lib/widgets/custom_notification_screen.dart @@ -21,7 +21,7 @@ class _NotificationSwitchState extends State { Text( widget.title, style: TextStyle( - color: Colors.black, fontSize: 14, fontWeight: FontWeight.bold), + color: Colors.black, fontSize: 14, fontWeight: FontWeight.bold,), ), Switch( value: switchValue, diff --git a/test/add_info_test.dart b/test/add_info_test.dart index a4d576d7..86379dda 100644 --- a/test/add_info_test.dart +++ b/test/add_info_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteFoods", unfavoriteFoods: "unfavoriteFoods", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/allergies_test.dart b/test/allergies_test.dart index d020b5ff..d0a78328 100644 --- a/test/allergies_test.dart +++ b/test/allergies_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteFoods", unfavoriteFoods: "unfavoriteFoods", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/blood_pressure_test.dart b/test/blood_pressure_test.dart index 14693437..a8c70dbe 100644 --- a/test/blood_pressure_test.dart +++ b/test/blood_pressure_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteFoods", unfavoriteFoods: "unfavoriteFoods", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/body_circumferences_test.dart b/test/body_circumferences_test.dart index e727e214..339c3b8b 100644 --- a/test/body_circumferences_test.dart +++ b/test/body_circumferences_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteFoods", unfavoriteFoods: "unfavoriteFoods", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/city_of_living_test.dart b/test/city_of_living_test.dart index d198eb2b..1a6c18ba 100644 --- a/test/city_of_living_test.dart +++ b/test/city_of_living_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteFoods", unfavoriteFoods: "unfavoriteFoods", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/credentials_test.dart b/test/credentials_test.dart index 851a7df6..a82cd418 100644 --- a/test/credentials_test.dart +++ b/test/credentials_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteFoods", unfavoriteFoods: "unfavoriteFoods", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/date_of_birth_test.dart b/test/date_of_birth_test.dart index 4d79b572..8ce0a1f7 100644 --- a/test/date_of_birth_test.dart +++ b/test/date_of_birth_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteFoods", unfavoriteFoods: "unfavoriteFoods", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/diary_test.dart b/test/diary_test.dart index c7570d39..56d1c582 100644 --- a/test/diary_test.dart +++ b/test/diary_test.dart @@ -28,7 +28,7 @@ void main() { moderationExpanded: false, recommendedChartValues: [10, 10, 10, 10], consumedChartValues: [1, 2, 3, 4], - moodExpanded: false); + moodExpanded: false,); await tester.pumpWidget( MaterialApp( diff --git a/test/favorite_foods_test.dart b/test/favorite_foods_test.dart index 2fbd838d..6364726f 100644 --- a/test/favorite_foods_test.dart +++ b/test/favorite_foods_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteFoods", unfavoriteFoods: "unfavoriteFoods", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/favorite_sports_test.dart b/test/favorite_sports_test.dart index ed7ff4cd..1c7311e6 100644 --- a/test/favorite_sports_test.dart +++ b/test/favorite_sports_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteSports", unfavoriteFoods: "unfavoriteSports", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/gender_test.dart b/test/gender_test.dart index e05ba6fb..94ab621c 100644 --- a/test/gender_test.dart +++ b/test/gender_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteSports", unfavoriteFoods: "unfavoriteSports", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/height_test.dart b/test/height_test.dart index 9338fa71..cd512ed4 100644 --- a/test/height_test.dart +++ b/test/height_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteSports", unfavoriteFoods: "unfavoriteSports", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/language_select_test.dart b/test/language_select_test.dart index 447592f8..15582cf6 100644 --- a/test/language_select_test.dart +++ b/test/language_select_test.dart @@ -10,7 +10,7 @@ void main() { testWidgets('renders screen in initial state', (WidgetTester tester) async { final myProfileBloc = LanguageSelectBloc(LanguageSelectState( languageSelectModelObj: - LanguageSelectModel())); // Ensure that MyProfileModel is non-nullable + LanguageSelectModel(),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/medicine_intake_test.dart b/test/medicine_intake_test.dart index fd92e719..eae83c13 100644 --- a/test/medicine_intake_test.dart +++ b/test/medicine_intake_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteFoods", unfavoriteFoods: "unfavoriteFoods", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/name_test.dart b/test/name_test.dart index 408a01cb..1e271cb2 100644 --- a/test/name_test.dart +++ b/test/name_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteFoods", unfavoriteFoods: "unfavoriteFoods", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/profile_test.dart b/test/profile_test.dart index 20f3f34f..cf0ebc41 100644 --- a/test/profile_test.dart +++ b/test/profile_test.dart @@ -11,7 +11,7 @@ void main() { (WidgetTester tester) async { final myProfileBloc = MyProfileBloc(MyProfileState( myProfileModelObj: - MyProfileModel())); // Ensure that MyProfileModel is non-nullable + MyProfileModel(),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/settings_test.dart b/test/settings_test.dart index b866ba40..c6058784 100644 --- a/test/settings_test.dart +++ b/test/settings_test.dart @@ -11,7 +11,7 @@ void main() { (WidgetTester tester) async { final myProfileBloc = MyProfileBloc(MyProfileState( myProfileModelObj: - MyProfileModel())); // Ensure that MyProfileModel is non-nullable + MyProfileModel(),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( diff --git a/test/weight_test.dart b/test/weight_test.dart index adf8f8f1..e5f9fe0c 100644 --- a/test/weight_test.dart +++ b/test/weight_test.dart @@ -39,7 +39,7 @@ void main() { favoriteFoods: "favoriteFoods", unfavoriteFoods: "unfavoriteFoods", additionalInfo: - "additionalInfo")))); // Ensure that MyProfileModel is non-nullable + "additionalInfo",),),),); // Ensure that MyProfileModel is non-nullable await tester.pumpWidget( MaterialApp( From f8bfe36f4724899773b5bfac4a2662f033643120 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Thu, 27 Jun 2024 10:44:33 +0300 Subject: [PATCH 5/6] feat(chat): fix native analyze --- analysis_options.yaml | 3 +- ios/Runner/Info.plist | 5 ++ .../initialization_cubit.dart | 19 +++--- .../chat/presentation/pages/chat_screen.dart | 10 +++- lib/main.dart | 59 ++++++++++--------- pubspec.yaml | 1 + 6 files changed, 60 insertions(+), 37 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index ee447165..31a0a37e 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -33,6 +33,7 @@ linter: # - newline-before-return # - no-boolean-literal-compare # - no-empty-block -# - prefer-trailing-comma # - prefer-conditional-expressions # - no-equal-then-else +rules: + - prefer-trailing-comma \ No newline at end of file diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index fb188418..0d81ba44 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -52,5 +52,10 @@ UIApplicationSupportsIndirectInputEvents + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + diff --git a/lib/core/initialization_cubit/initialization_cubit.dart b/lib/core/initialization_cubit/initialization_cubit.dart index cd9828ea..57544ae5 100644 --- a/lib/core/initialization_cubit/initialization_cubit.dart +++ b/lib/core/initialization_cubit/initialization_cubit.dart @@ -5,8 +5,6 @@ import 'package:eatvio_app/features/chat/repositories/chat_repository.dart'; import 'package:pusher_client/pusher_client.dart'; class InitializationCubit extends Cubit { - late final webSocketChannel; - final ChatRepository chatRepository; InitializationCubit({required this.chatRepository}) : super(const InitializationState.loading()); @@ -29,20 +27,27 @@ class InitializationCubit extends Cubit { ), ); - PusherClient pusher = PusherClient( + PusherClient pusherClient = PusherClient( wsUrl.key, options, autoConnect: true, enableLogging: true, ); - await pusher.connect(); - - // Channel channel = pusher.subscribe('private-direct-chat.'); - // channel.registerListener(classId, method); + await pusherClient.connect(); emit(const InitializationState.success()); + + Channel channel = pusherClient.subscribe('private-direct-chat.' + '7909ea56-7822-4d5f-8892-134bc937127f'); + + channel.bind("pusher_internal:subscription_succeeded", (PusherEvent? event) { + channel.trigger("pusher_internal:subscription_succeeded", {}); + }); + + channel.registerListener('pusher:subscribe', (data) => print(data.toString())); + } catch (e) { + print(e); emit(InitializationState.error(errorMessage: e.toString())); } } diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index 4c4bcfe1..4f7867e2 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -1,3 +1,4 @@ +import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.dart'; import 'package:eatvio_app/features/chat/presentation/widgets/chat_bubble_widget.dart'; @@ -6,7 +7,7 @@ import 'package:flutter/cupertino.dart'; import 'package:eatvio_app/core/app_export.dart'; import 'package:flutter/material.dart'; -class ChatScreen extends StatelessWidget { +class ChatScreen extends StatefulWidget { final String chatId; const ChatScreen({ @@ -14,9 +15,14 @@ class ChatScreen extends StatelessWidget { super.key, }); + @override + State createState() => _ChatScreenState(); +} + +class _ChatScreenState extends State { Widget build(BuildContext context) { return BlocProvider( - create: (BuildContext context) => sl()..initChat(chatId), + create: (BuildContext context) => sl()..initChat(widget.chatId), child: BlocBuilder( builder: (context, state) { if (state is ChatRoomStateLoading) { diff --git a/lib/main.dart b/lib/main.dart index e1f081ee..29191300 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'package:eatvio_app/app_router.dart'; import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart'; +import 'package:eatvio_app/core/initialization_cubit/initialization_state.dart'; import 'package:eatvio_app/features/chat/presentation/pages/chat_select_screen/bloc/chat_select_bloc.dart'; import 'package:eatvio_app/features/chat/presentation/pages/chat_select_screen/models/chat_select_model.dart'; import 'package:eatvio_app/locator_service.dart'; @@ -42,7 +43,7 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { return MultiBlocProvider( providers: [ - BlocProvider(create: (context) => sl()..runInitialization()), + BlocProvider(create: (context) => InitializationCubit(chatRepository: sl())..runInitialization()), BlocProvider(create: (context) => ThemeBloc(ThemeState(themeType: PrefUtils().getThemeData()))), BlocProvider(create: (context) => MyProfileBloc(MyProfileState(myProfileModelObj: MyProfileModel()))..add(MyProfileInitialEvent())), BlocProvider(create: (context) => FeedBloc(FeedState(myProfileModelObj: FeedModel()))..add(FeedInitialEvent())), @@ -51,33 +52,37 @@ class MyApp extends StatelessWidget { create: (context) => ChatSelectBloc(ChatSelectState(chatSelectModelObj: ChatSelectModel()))..add(ChatSelectInitialEvent()), ), ], - child: BlocBuilder( - builder: (context, state) { - return KeyboardDismisser( - gestures: [ - GestureType.onTap, - GestureType.onPanUpdateDownDirection, - ], - child: MaterialApp.router( - theme: theme, - title: 'Eatvio', - routerConfig: AppRouter.appRouter, - debugShowCheckedModeBanner: false, - localizationsDelegates: [ - AppLocalizationDelegate(), - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - ], - supportedLocales: [ - Locale( - 'ru', - '', - ), - ], - ), - ); + child: BlocListener( + listener: (BuildContext context, InitializationState state) { }, + child: BlocBuilder( + builder: (context, state) { + return KeyboardDismisser( + gestures: [ + GestureType.onTap, + GestureType.onPanUpdateDownDirection, + ], + child: MaterialApp.router( + theme: theme, + title: 'Eatvio', + routerConfig: AppRouter.appRouter, + debugShowCheckedModeBanner: false, + localizationsDelegates: [ + AppLocalizationDelegate(), + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + supportedLocales: [ + Locale( + 'ru', + '', + ), + ], + ), + ); + }, + ), ), ); } diff --git a/pubspec.yaml b/pubspec.yaml index a3986dba..353e7efd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,7 @@ name: eatvio_app description: A new Flutter project. version: 0.0.0+1 +publish_to: 'none' environment: sdk: ">=3.3.4 <4.0.0" From 6b56d4583264578af344973e0f5ed96819145a2c Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Thu, 27 Jun 2024 10:49:00 +0300 Subject: [PATCH 6/6] feat(chat): remove rules --- analysis_options.yaml | 7 +------ lib/features/chat/presentation/pages/chat_screen.dart | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 31a0a37e..3d36fcec 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -27,13 +27,8 @@ dart_code_metrics: # maximum-nesting-level: 5 # metrics-exclude: # - test/** -linter: - rules: - require_trailing_commas: true # - newline-before-return # - no-boolean-literal-compare # - no-empty-block # - prefer-conditional-expressions -# - no-equal-then-else -rules: - - prefer-trailing-comma \ No newline at end of file +# - no-equal-then-else \ No newline at end of file diff --git a/lib/features/chat/presentation/pages/chat_screen.dart b/lib/features/chat/presentation/pages/chat_screen.dart index 4f7867e2..31f431ac 100644 --- a/lib/features/chat/presentation/pages/chat_screen.dart +++ b/lib/features/chat/presentation/pages/chat_screen.dart @@ -1,4 +1,3 @@ -import 'package:eatvio_app/core/initialization_cubit/initialization_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.dart'; import 'package:eatvio_app/features/chat/presentation/widgets/chat_bubble_widget.dart';