diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index b41eb1e..d2a8336 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences_foundation","path":"/home/lobanov/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"shared_preferences_android","path":"/home/lobanov/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.3/","native_build":true,"dependencies":[]}],"macos":[{"name":"shared_preferences_foundation","path":"/home/lobanov/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/home/lobanov/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/home/lobanov/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"path_provider_windows","path":"/home/lobanov/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/home/lobanov/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"shared_preferences_web","path":"/home/lobanov/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/","dependencies":[]}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2024-10-28 14:09:09.780462","version":"3.24.4","swift_package_manager_enabled":false} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences_foundation","path":"/home/lobanov/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"shared_preferences_android","path":"/home/lobanov/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.10/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"shared_preferences_foundation","path":"/home/lobanov/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"path_provider_linux","path":"/home/lobanov/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_linux","path":"/home/lobanov/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"],"dev_dependency":false}],"windows":[{"name":"path_provider_windows","path":"/home/lobanov/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"shared_preferences_windows","path":"/home/lobanov/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"],"dev_dependency":false}],"web":[{"name":"shared_preferences_web","path":"/home/lobanov/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.3/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2025-05-11 17:22:35.152223","version":"3.29.3","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/.gitignore b/.gitignore index d4f8fdd..79c113f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,16 @@ -design/ -*.certificate -*.key -### Flutter Generated - # Miscellaneous *.class -*.lock *.log *.pyc *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ +migrate_working_dir/ # IntelliJ related *.iml @@ -21,874 +18,28 @@ design/ *.iws .idea/ -# Visual Studio Code related -.vscode/ +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ # Flutter/Dart/Pub related **/doc/api/ +**/ios/Flutter/.last_build_id .dart_tool/ .flutter-plugins -.packages +.flutter-plugins-dependencies .pub-cache/ .pub/ -build/ - -# Android related -**/android/**/gradle-wrapper.jar -**/android/.gradle -**/android/captures/ -**/android/gradlew -**/android/gradlew.bat -**/android/local.properties -**/android/key.properties -**/android/**/GeneratedPluginRegistrant.java - -# iOS/XCode related -**/ios/**/*.mode1v3 -**/ios/**/*.mode2v3 -**/ios/**/*.moved-aside -**/ios/**/*.pbxuser -**/ios/**/*.perspectivev3 -**/ios/**/*sync/ -**/ios/**/.sconsign.dblite -**/ios/**/.tags* -**/ios/**/.vagrant/ -**/ios/**/DerivedData/ -**/ios/**/Icon? -**/ios/**/Pods/ -**/ios/**/.symlinks/ -**/ios/**/profile -**/ios/**/xcuserdata -**/ios/.generated/ -**/ios/Flutter/App.framework -**/ios/Flutter/Flutter.framework -**/ios/Flutter/Generated.xcconfig -**/ios/Flutter/app.flx -**/ios/Flutter/app.zip -**/ios/Flutter/flutter_assets/ -**/ios/ServiceDefinitions.json -**/ios/Runner/GeneratedPluginRegistrant.* - - -### https://raw.github.com/github/gitignore//Android.gitignore - -# Built application files -*.apk -*.ap_ - -# Files for the ART/Dalvik VM -*.dex - -# Java class files -*.class - -# Generated files -bin/ -gen/ -out/ - -# Gradle files -.gradle/ -build/ - -# Local configuration file (sdk path, etc) -local.properties - -# Proguard folder generated by Eclipse -proguard/ - -# Log Files -*.log - -# Android Studio Navigation editor temp files -.navigation/ - -# Android Studio captures folder -captures/ - -# IntelliJ -*.iml -.idea/workspace.xml -.idea/tasks.xml -.idea/gradle.xml -.idea/assetWizardSettings.xml -.idea/dictionaries -.idea/libraries -.idea/caches - -# Keystore files -# Uncomment the following line if you do not want to check your keystore files in. -*.jks - -# External native build folder generated in Android Studio 2.2 and later -.externalNativeBuild - -# Google Services (e.g. APIs or Firebase) -google-services.json - -# Freeline -freeline.py -freeline/ -freeline_project_description.json - -# fastlane -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots -fastlane/test_output -fastlane/readme.md - - -### https://raw.github.com/github/gitignore//Dart.gitignore - -# See https://www.dartlang.org/guides/libraries/private-files - -# Files and directories created by pub -.dart_tool/ -.packages -build/ -# If you're building an application, you may want to check-in your pubspec.lock -pubspec.lock - -# Directory created by dartdoc -# If you don't generate documentation locally you can remove this line. -doc/api/ - -# Avoid committing generated Javascript files: -*.dart.js -*.info.json # Produced by the --dump-info flag. -*.js # When generated by dart2js. Don't specify *.js if your - # project includes source files written in JavaScript. -*.js_ -*.js.deps -*.js.map - - -### https://raw.github.com/github/gitignore//Global/JetBrains.gitignore - -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/modules.xml -# .idea/*.iml -# .idea/modules - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - - -### https://raw.github.com/github/gitignore//Global/macOS.gitignore - -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - - -### https://raw.github.com/github/gitignore//Global/Xcode.gitignore - -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## User settings -xcuserdata/ - -## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) -*.xcscmblueprint -*.xccheckout - -## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) -build/ -DerivedData/ -*.moved-aside -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/Archives.gitignore - -# It's better to unpack these files and commit the raw source because -# git has its own built in compression methods. -*.7z -*.jar -*.rar -*.zip -*.gz -*.tgz -*.bzip -*.bz2 -*.xz -*.lzma -*.cab - -# Packing-only formats -*.iso -*.tar - -# Package management formats -*.dmg -*.xpi -*.gem -*.egg -*.deb -*.rpm -*.msi -*.msm -*.msp - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/Backup.gitignore - -*.bak -*.gho -*.ori -*.orig -*.tmp - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Android.gitignore - -# Built application files -*.apk -*.ap_ - -# Files for the ART/Dalvik VM -*.dex - -# Java class files -*.class - -# Generated files -bin/ -gen/ -out/ - -# Gradle files -.gradle/ -build/ - -# Local configuration file (sdk path, etc) -local.properties -key.properties - -# Proguard folder generated by Eclipse -proguard/ - -# Log Files -*.log - -# Android Studio Navigation editor temp files -.navigation/ - -# Android Studio captures folder -captures/ - -# IntelliJ -*.iml -.idea/workspace.xml -.idea/tasks.xml -.idea/gradle.xml -.idea/assetWizardSettings.xml -.idea/dictionaries -.idea/libraries -.idea/caches - -# Keystore files -# Uncomment the following line if you do not want to check your keystore files in. -*.jks - -# External native build folder generated in Android Studio 2.2 and later -.externalNativeBuild - -# Google Services (e.g. APIs or Firebase) -google-services.json - -# Freeline -freeline.py -freeline/ -freeline_project_description.json - -# fastlane -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots -fastlane/test_output -fastlane/readme.md - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Dart.gitignore - -# See https://www.dartlang.org/guides/libraries/private-files - -# Files and directories created by pub -.dart_tool/ -.packages -build/ -# If you're building an application, you may want to check-in your pubspec.lock -pubspec.lock - -# Directory created by dartdoc -# If you don't generate documentation locally you can remove this line. -doc/api/ - -# Avoid committing generated Javascript files: -*.dart.js -*.info.json # Produced by the --dump-info flag. -*.js # When generated by dart2js. Don't specify *.js if your - # project includes source files written in JavaScript. -*.js_ -*.js.deps -*.js.map - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/DartEditor.gitignore - -.project -.buildlog - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/Emacs.gitignore - -# -*- mode: gitignore; -*- -*~ -\#*\# -/.emacs.desktop -/.emacs.desktop.lock -*.elc -auto-save-list -tramp -.\#* - -# Org-mode -.org-id-locations -*_archive - -# flymake-mode -*_flymake.* - -# eshell files -/eshell/history -/eshell/lastdir - -# elpa packages -/elpa/ - -# reftex files -*.rel - -# AUCTeX auto folder -/auto/ - -# cask packages -.cask/ -dist/ - -# Flycheck -flycheck_*.el - -# server auth directory -/server/ - -# projectiles files -.projectile - -# directory configuration -.dir-locals.el - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Gradle.gitignore - -.gradle /build/ -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Cache of project -.gradletasknamecache - -# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 -# gradle/wrapper/gradle-wrapper.properties - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Java.gitignore - -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/JetBrains.gitignore - -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/modules.xml -# .idea/*.iml -# .idea/modules - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/JEnv.gitignore - -# JEnv local Java version configuration file -.java-version - -# Used by previous versions of JEnv -.jenv-version - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Kotlin.gitignore - -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/Linux.gitignore - -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/macOS.gitignore - -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Maven.gitignore - -target/ -pom.xml.tag -pom.xml.releaseBackup -pom.xml.versionsBackup -pom.xml.next -release.properties -dependency-reduced-pom.xml -buildNumber.properties -.mvn/timing.properties -.mvn/wrapper/maven-wrapper.jar - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Objective-C.gitignore - -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData/ - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata/ - -## Other -*.moved-aside -*.xccheckout -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa -*.dSYM.zip -*.dSYM - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ -# -# Add this line if you want to avoid checking in source code from the Xcode workspace -# *.xcworkspace - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots/**/*.png -fastlane/test_output - -# Code Injection -# -# After new code Injection tools there's a generated folder /iOSInjectionProject -# https://github.com/johnno1962/injectionforxcode - -iOSInjectionProject/ - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/SublimeText.gitignore - -# Cache files for Sublime Text -*.tmlanguage.cache -*.tmPreferences.cache -*.stTheme.cache - -# Workspace files are user-specific -*.sublime-workspace - -# Project files should be checked into the repository, unless a significant -# proportion of contributors will probably not be using Sublime Text -# *.sublime-project - -# SFTP configuration file -sftp-config.json - -# Package control specific files -Package Control.last-run -Package Control.ca-list -Package Control.ca-bundle -Package Control.system-ca-bundle -Package Control.cache/ -Package Control.ca-certs/ -Package Control.merged-ca-bundle -Package Control.user-ca-bundle -oscrypto-ca-bundle.crt -bh_unicode_properties.cache - -# Sublime-github package stores a github token in this file -# https://packagecontrol.io/packages/sublime-github -GitHub.sublime-settings - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/Vim.gitignore - -# Swap -[._]*.s[a-v][a-z] -[._]*.sw[a-p] -[._]s[a-rt-v][a-z] -[._]ss[a-gi-z] -[._]sw[a-p] - -# Session -Session.vim - -# Temporary -.netrwhist -*~ -# Auto-generated tag files -tags -# Persistent undo -[._]*.un~ - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/VisualStudioCode.gitignore - -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/Windows.gitignore - -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -### https://raw.github.com/github/gitignore/340e2fe08a2356c2e3760ff58c3a9e1fddf08060/Global/Xcode.gitignore - -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## User settings -xcuserdata/ - -## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) -*.xcscmblueprint -*.xccheckout - -## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) -build/ -DerivedData/ -*.moved-aside -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 - +# Symbolication related +app.*.symbols -### Flutter Generated Exceptions +# Obfuscation related +app.*.map.json -# Exceptions to above rules. -!**/ios/**/default.mode1v3 -!**/ios/**/default.mode2v3 -!**/ios/**/default.pbxuser -!**/ios/**/default.perspectivev3 -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages \ No newline at end of file +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/.metadata b/.metadata index 7d21057..878648b 100644 --- a/.metadata +++ b/.metadata @@ -4,8 +4,8 @@ # This file should be version controlled and should not be manually edited. version: - revision: "b12d86157e38a6c15b5a7ec32605aa42ebcd831d" - channel: "master" + revision: "ea121f8859e4b13e47a8f845e4586164519588bc" + channel: "stable" project_type: app @@ -13,26 +13,11 @@ project_type: app migration: platforms: - platform: root - create_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d - base_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d + create_revision: ea121f8859e4b13e47a8f845e4586164519588bc + base_revision: ea121f8859e4b13e47a8f845e4586164519588bc - platform: android - create_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d - base_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d - - platform: ios - create_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d - base_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d - - platform: linux - create_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d - base_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d - - platform: macos - create_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d - base_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d - - platform: web - create_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d - base_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d - - platform: windows - create_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d - base_revision: b12d86157e38a6c15b5a7ec32605aa42ebcd831d + create_revision: ea121f8859e4b13e47a8f845e4586164519588bc + base_revision: ea121f8859e4b13e47a8f845e4586164519588bc # User provided section diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..c8a2043 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,32 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Flutter", + "type": "dart", + "request": "launch", + "program": "lib/main.dart", + "flutterMode": "release" + }, + { + "name": "flower-app", + "request": "launch", + "type": "dart" + }, + { + "name": "flower-app (profile mode)", + "request": "launch", + "type": "dart", + "flutterMode": "profile" + }, + { + "name": "flower-app (release mode)", + "request": "launch", + "type": "dart", + "flutterMode": "release" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9ddf6b2 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "cmake.ignoreCMakeListsMissing": true +} \ No newline at end of file diff --git a/README.md b/README.md index aa57669..d19bb30 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# flowers_app +# flower_app A new Flutter project. diff --git a/analysis_options.yaml b/analysis_options.yaml index 4081aa8..0d29021 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -7,67 +7,22 @@ # The following line activates a set of recommended lints for Flutter apps, # packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml -# include: package:flutter_lints/flutter.yaml - -# linter: +linter: # The lint rules applied to this project can be customized in the # section below to disable rules from the `package:flutter_lints/flutter.yaml` # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. + # and their documentation is published at https://dart.dev/lints. # # Instead of disabling a lint rule for the entire project in the # section below, it can also be suppressed for a single line of code # or a specific dart file by using the `// ignore: name_of_lint` and # `// ignore_for_file: name_of_lint` syntax on the line or in the file # producing the lint. - # rules: + rules: # avoid_print: false # Uncomment to disable the `avoid_print` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options - - - -include: package:lint/analysis_options.yaml - -analyser: - # strong-mode: - # implicit-casts: false - errors: - missing_required_param: error - # missing_return: error - # must_be_imutable: error - # sort_unnamed_constructors_first: ignore - plugins: - - dart_colde_metrics - -dart_code_metrics: - anti-patterns: - - long-method - - long-parameter-list - metrics: - cyclomatic-complexity: 20 - maximum-nesting-level: 5 - number-of-parameters: 4 - source-lines-of-code: 50 - technical-debt: - threshold: 1 - todo-cost: 4 - ignore-cost: 8 - ignore-for-file-cost: 16 - as-dynamic-cost: 16 - depricated-annotations: 2 - file-nullsafety-migration: 2 - unit-type: "hour" - metrics-exclude: - - test/** - rules: - # - newline-before-return - - no-boolean-literal-compare - - no-empty-block - - prefer-trailing-comma - # - prefer-conditional-expressions - - no-equal-then-else diff --git a/android/.gitignore b/android/.gitignore index 55afd91..be3943c 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -5,6 +5,7 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. # See https://flutter.dev/to/reference-keystore diff --git a/android/app/build.gradle b/android/app/build.gradle.kts similarity index 68% rename from android/app/build.gradle rename to android/app/build.gradle.kts index b65fc22..1800097 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle.kts @@ -1,27 +1,27 @@ plugins { - id "com.android.application" - id "kotlin-android" + id("com.android.application") + id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. - id "dev.flutter.flutter-gradle-plugin" + id("dev.flutter.flutter-gradle-plugin") } android { - namespace = "com.antonlobanovco.flowersapp.flowers_app" + namespace = "com.lobanov.antongmail.com.flower_app" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8 + jvmTarget = JavaVersion.VERSION_11.toString() } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "com.antonlobanovco.flowersapp.flowers_app" + applicationId = "com.lobanov.antongmail.com.flower_app" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = flutter.minSdkVersion @@ -34,7 +34,7 @@ android { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig = signingConfigs.debug + signingConfig = signingConfigs.getByName("debug") } } } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index a9b7df7..8789587 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ ("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/android/gradle.properties b/android/gradle.properties index 2597170..f018a61 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,3 @@ -org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 7bb2df6..afa1e8e 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip diff --git a/android/settings.gradle b/android/settings.gradle deleted file mode 100644 index b9e43bd..0000000 --- a/android/settings.gradle +++ /dev/null @@ -1,25 +0,0 @@ -pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - }() - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.1.0" apply false - id "org.jetbrains.kotlin.android" version "1.8.22" apply false -} - -include ":app" diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 0000000..a439442 --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,25 @@ +pluginManagement { + val flutterSdkPath = run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.7.0" apply false + id("org.jetbrains.kotlin.android") version "1.8.22" apply false +} + +include(":app") diff --git a/assets/settings/app-settings.json b/assets/settings/app-settings.json index 64b1a05..16aa01c 100644 --- a/assets/settings/app-settings.json +++ b/assets/settings/app-settings.json @@ -1,8 +1,8 @@ { "api-host-commented": "127.0.0.1", - "api-host": "172.20.10.4", "api-host-commented1": "192.168.8.192", + "api-host": "172.20.10.6", "api-port": 8080, "api-auth-token": "flowers-app-api-auth-token", - "api-database": "flowers_app_server" + "api-database": "flowers_app" } \ No newline at end of file diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index ec97fc6..592ceee 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index c4855bf..592ceee 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile deleted file mode 100644 index d97f17e..0000000 --- a/ios/Podfile +++ /dev/null @@ -1,44 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '12.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index f5562e3..ad62796 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -10,12 +10,10 @@ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 5863F22CACB26D4E06019B22 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C071CF1C8F8C0EC7D375BFE8 /* Pods_RunnerTests.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 */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - D9D8B4E204BE999187E32D7B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E33F892A3C7381B13D2BCF5 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -47,14 +45,8 @@ 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3EBAE33EBF70B3943EC85830 /* 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 = ""; }; - 5056529F95EEFFA91759F14C /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - 51555C78847C06014CA3731B /* 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 = ""; }; - 5E33F892A3C7381B13D2BCF5 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 6EC1D801412897DB5E208676 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; 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 = ""; }; - 78E8D53EEC69C55B8C1D009B /* 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 = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.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 = ""; }; @@ -63,8 +55,6 @@ 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 = ""; }; - 9E75EE4516CA338ABAF1D5F7 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - C071CF1C8F8C0EC7D375BFE8 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -72,35 +62,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D9D8B4E204BE999187E32D7B /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F18A9CCF0E8D881E439D8C1A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 5863F22CACB26D4E06019B22 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 12EEC2C2715045288A2E2767 /* Pods */ = { - isa = PBXGroup; - children = ( - 78E8D53EEC69C55B8C1D009B /* Pods-Runner.debug.xcconfig */, - 3EBAE33EBF70B3943EC85830 /* Pods-Runner.release.xcconfig */, - 51555C78847C06014CA3731B /* Pods-Runner.profile.xcconfig */, - 6EC1D801412897DB5E208676 /* Pods-RunnerTests.debug.xcconfig */, - 5056529F95EEFFA91759F14C /* Pods-RunnerTests.release.xcconfig */, - 9E75EE4516CA338ABAF1D5F7 /* Pods-RunnerTests.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; 331C8082294A63A400263BE5 /* RunnerTests */ = { isa = PBXGroup; children = ( @@ -127,8 +94,6 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, - 12EEC2C2715045288A2E2767 /* Pods */, - A16654BEC626EE79B44D5FCF /* Frameworks */, ); sourceTree = ""; }; @@ -156,15 +121,6 @@ path = Runner; sourceTree = ""; }; - A16654BEC626EE79B44D5FCF /* Frameworks */ = { - isa = PBXGroup; - children = ( - 5E33F892A3C7381B13D2BCF5 /* Pods_Runner.framework */, - C071CF1C8F8C0EC7D375BFE8 /* Pods_RunnerTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -172,10 +128,8 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - F539508A2CD475204FF14844 /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, - F18A9CCF0E8D881E439D8C1A /* Frameworks */, ); buildRules = ( ); @@ -191,14 +145,12 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - E58460E537B8B6489B93705A /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 04E0B9E1CA484D3AA1795391 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -270,23 +222,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 04E0B9E1CA484D3AA1795391 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -318,50 +253,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - E58460E537B8B6489B93705A /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - F539508A2CD475204FF14844 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -471,14 +362,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = A8X5SQ4497; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.anton-lobanov-co.flowers-app.flowersApp"; + PRODUCT_BUNDLE_IDENTIFIER = com.lobanov.antongmail.com.flowerApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -488,14 +378,13 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6EC1D801412897DB5E208676 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.anton-lobanov-co.flowers-app.flowersApp.RunnerTests"; + PRODUCT_BUNDLE_IDENTIFIER = com.lobanov.antongmail.com.flowerApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -506,14 +395,13 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5056529F95EEFFA91759F14C /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.anton-lobanov-co.flowers-app.flowersApp.RunnerTests"; + PRODUCT_BUNDLE_IDENTIFIER = com.lobanov.antongmail.com.flowerApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -522,14 +410,13 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9E75EE4516CA338ABAF1D5F7 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = "com.anton-lobanov-co.flowers-app.flowersApp.RunnerTests"; + PRODUCT_BUNDLE_IDENTIFIER = com.lobanov.antongmail.com.flowerApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -654,14 +541,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = A8X5SQ4497; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.anton-lobanov-co.flowers-app.flowersApp"; + PRODUCT_BUNDLE_IDENTIFIER = com.lobanov.antongmail.com.flowerApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -677,14 +563,13 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = A8X5SQ4497; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.anton-lobanov-co.flowers-app.flowersApp"; + PRODUCT_BUNDLE_IDENTIFIER = com.lobanov.antongmail.com.flowerApp; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8e3ca5d..15cada4 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -59,6 +59,7 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata index 21a3cc1..1d526a1 100644 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,7 +4,4 @@ - - diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index cbff900..70e8fc4 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - Flowers App + Flower App CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - flowers_app + flower_app CFBundlePackageType APPL CFBundleShortVersionString diff --git a/lib/app/app_state.dart_ b/lib/app/app_state.dart_ index a32c80e..ae2ab1a 100644 --- a/lib/app/app_state.dart_ +++ b/lib/app/app_state.dart_ @@ -1,6 +1,6 @@ -import 'package:flowers_app/app/app_events.dart_'; -import 'package:flowers_app/app/auth/auth_state.dart_'; -import 'package:flowers_app/app/purchase_overview/state.dart'; +import 'package:flower_app/app/app_events.dart_'; +import 'package:flower_app/app/auth/auth_state.dart_'; +import 'package:flower_app/app/purchase_overview/state.dart'; class AppState { final AppEvents appEvents; diff --git a/lib/app/auth/auth_state.dart_ b/lib/app/auth/auth_state.dart_ index 7fafd27..9b7596e 100644 --- a/lib/app/auth/auth_state.dart_ +++ b/lib/app/auth/auth_state.dart_ @@ -1,4 +1,4 @@ -import 'package:flowers_app/app/auth/auth_events.dart_'; +import 'package:flower_app/app/auth/auth_events.dart_'; class AuthState { final AuthEvents authEvents; diff --git a/lib/app/purchase_overview/state.dart_ b/lib/app/purchase_overview/state.dart_ index c0d9595..1c89325 100644 --- a/lib/app/purchase_overview/state.dart_ +++ b/lib/app/purchase_overview/state.dart_ @@ -1,10 +1,10 @@ -import 'package:flowers_app/app/purchase_overview/events.dart_'; -import 'package:flowers_app/domain/purchase/purchase.dart'; -import 'package:flowers_app/domain/purchase/purchase_list.dart'; -import 'package:flowers_app/infrastructure/api/api_request.dart'; -import 'package:flowers_app/infrastructure/api/api_params.dart'; -import 'package:flowers_app/infrastructure/datasource/data_set.dart'; -import 'package:flowers_app/infrastructure/datasource/data_source.dart'; +import 'package:flower_app/app/purchase_overview/events.dart_'; +import 'package:flower_app/domain/purchase/purchase.dart'; +import 'package:flower_app/domain/purchase/purchase_list.dart'; +import 'package:flower_app/infrastructure/api/api_request.dart'; +import 'package:flower_app/infrastructure/api/api_params.dart'; +import 'package:flower_app/infrastructure/datasource/data_set.dart'; +import 'package:flower_app/infrastructure/datasource/data_source.dart'; class PurchaseOverviewState { final PurchaseOverviewEvent purchaseOverviewEvents; diff --git a/lib/assets/texts/app_text.dart b/lib/assets/texts/app_text.dart index 3f86199..5cf666d 100644 --- a/lib/assets/texts/app_text.dart +++ b/lib/assets/texts/app_text.dart @@ -1,7 +1,7 @@ // ignore_for_file: avoid_classes_with_only_static_members -import 'package:flowers_app/dev/log/log.dart'; +import 'package:flower_app/dev/log/log.dart'; enum AppLang {en, ru, de, fr} const appLang = AppLang.ru; @@ -66,12 +66,12 @@ class AppText { 'No notines': ['Сообщений нет',], }; static String tr(String text, {AppLang? lng}) { - final AppLang _lng = lng ?? appLang; - if (_lng == AppLang.en) { + final AppLang lng_ = lng ?? appLang; + if (lng_ == AppLang.en) { return text; } if (_map.containsKey(text)) { - return (_map[text] ?? [])[_lng.index]; + return (_map[text] ?? [])[lng_.index]; } log(_debug, '[$AppText.tr] нет перевода для "$text"'); return text; diff --git a/lib/domain/auth/app_user.dart b/lib/domain/auth/app_user.dart index 19ec2a1..a773816 100644 --- a/lib/domain/auth/app_user.dart +++ b/lib/domain/auth/app_user.dart @@ -1,8 +1,8 @@ import 'package:ext_rw/ext_rw.dart'; -import 'package:flowers_app/settings/setting.dart'; +import 'package:flower_app/settings/setting.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// class AppUserSqlParams { final String? id; diff --git a/lib/domain/auth/auth_result.dart b/lib/domain/auth/auth_result.dart index 817e292..0fd69fa 100644 --- a/lib/domain/auth/auth_result.dart +++ b/lib/domain/auth/auth_result.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; class AuthResult { final bool _authenticated; diff --git a/lib/domain/auth/authenticate.dart b/lib/domain/auth/authenticate.dart index 6c9fd73..6f36085 100644 --- a/lib/domain/auth/authenticate.dart +++ b/lib/domain/auth/authenticate.dart @@ -1,10 +1,10 @@ // import 'package:firebase_auth/firebase_auth.dart'; -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/auth/auth_result.dart'; -import 'package:flowers_app/domain/auth/user_phone.dart'; -import 'package:flowers_app/domain/core/local_store/local_store.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/auth/auth_result.dart'; +import 'package:flower_app/domain/auth/user_phone.dart'; +import 'package:flower_app/domain/core/local_store/local_store.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// Auth user by phone number class Authenticate { diff --git a/lib/domain/auth/register_user.dart b/lib/domain/auth/register_user.dart index d2f962e..2a25870 100644 --- a/lib/domain/auth/register_user.dart +++ b/lib/domain/auth/register_user.dart @@ -1,9 +1,9 @@ import 'package:ext_rw/ext_rw.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/core/errors/failure.dart'; -import 'package:flowers_app/settings/setting.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/core/errors/failure.dart'; +import 'package:flower_app/settings/setting.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// Sql parameters used in the RegisterUserSqlAccess.sqlBuilder class RegisterUserSqlParams { @@ -59,7 +59,7 @@ class RegisterUser { return Sql(sql: """ insert into public.customer as cu ('role', email, phone, 'name', 'location', 'login', pass, account, last_act, blocked) values (${params?.role}, ${params?.email}, ${params?.phone}, ${params?.name}, _${params?.location}, ${params?.login}, ${params?.pass}, ${params?.account}, ${params?.lastAct}, ${params?.blocked}) - on conflict (customer_id, purchase_content_id) do update + on conflict (customer_id, purchase_item_id) do update set role = _role, set email = _email, set phone = _phone, diff --git a/lib/domain/auth/test/test_encode.dart b/lib/domain/auth/test/test_encode.dart index bdac553..30dc225 100644 --- a/lib/domain/auth/test/test_encode.dart +++ b/lib/domain/auth/test/test_encode.dart @@ -1,8 +1,8 @@ -import 'package:flowers_app/dev/log/log.dart'; +import 'package:flower_app/dev/log/log.dart'; void main() { - const _debug = false; + const debug_ = false; const key = '1234'; final lKey = _escape(key).split(','); // use escape() so only have single-byte chars to encode final k = []; @@ -11,12 +11,12 @@ void main() { final keySlice = lKey[i];//str4ToLong(keySlice); k[i] = keySlice; } - log(_debug, 'k: $k'); + log(debug_, 'k: $k'); alg(k); } void alg(List k) { - const _debug = false; + const debug_ = false; var y = 1; var z = 2; const delta = 0x9E3779B9; @@ -37,14 +37,14 @@ void alg(List k) { final ysum = y ^ sum; final y4y5 = y4 ^ y5; // print('encode add1: $add1'); - log(_debug, 'encode z: $z; z4: $z4; z5: $z5; z4z5: $z4z5; zsum: $zsum'); - log(_debug, 'encode y: $y; y4: $y4; y5: $y5; y4y5: $y4y5; ysum: $ysum'); - log(_debug, 'encode add1: $add1; add2: $add2'); + log(debug_, 'encode z: $z; z4: $z4; z5: $z5; z4z5: $z4z5; zsum: $zsum'); + log(debug_, 'encode y: $y; y4: $y4; y5: $y5; y4y5: $y4y5; ysum: $ysum'); + log(debug_, 'encode add1: $add1; add2: $add2'); z += ((y << 4) ^ (y >>> 5)) + ysum + add2; // note: unsigned right-shift '>>>' is used in place of original '>>', due to lack // of 'unsigned' type declaration in JavaScript (thanks to Karsten Kraus for this) } - log(_debug, 'encode y: $y; z: $z'); + log(debug_, 'encode y: $y; z: $z'); } String _escape(String str) { diff --git a/lib/domain/auth/test/test_password.dart_ b/lib/domain/auth/test/test_password.dart_ index 82cfbd6..2ea153e 100644 --- a/lib/domain/auth/test/test_password.dart_ +++ b/lib/domain/auth/test/test_password.dart_ @@ -1,4 +1,4 @@ -import 'package:flowers_app/dev/log/log.dart'; +import 'package:flower_app/dev/log/log.dart'; void main() { // const str = r'12$34\567890-=qwertyuiop[]asdfghjkl;\`zxcvbnm,./ !@#%^&*()_+QWERTYUIOP{}ASDFGHJKL:"|~ZXCVBNM<>?;1234567890-=!"№%:,.;()_+йцукенгшщзхъЙЦУКЕНГШЩЗХЪфывапролджэёФЫВАПРОЛДЖЭЁ]ячсмитьбю/[ЯЧСМИТЬБЮ?]"'; diff --git a/lib/domain/auth/test/test_tea_password.dart_ b/lib/domain/auth/test/test_tea_password.dart_ index df1c516..9fa97ce 100644 --- a/lib/domain/auth/test/test_tea_password.dart_ +++ b/lib/domain/auth/test/test_tea_password.dart_ @@ -1,4 +1,4 @@ -import 'package:flowers_app/dev/log/log.dart'; +import 'package:flower_app/dev/log/log.dart'; /// Tiny Encryption Algorithm void main() { diff --git a/lib/domain/auth/test/test_user.dart b/lib/domain/auth/test/test_user.dart index bd42641..dcac621 100644 --- a/lib/domain/auth/test/test_user.dart +++ b/lib/domain/auth/test/test_user.dart @@ -1,9 +1,9 @@ -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/auth/auth_result.dart'; -import 'package:flowers_app/domain/auth/user_phone.dart'; -import 'package:flowers_app/domain/core/local_store/local_store.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/auth/auth_result.dart'; +import 'package:flower_app/domain/auth/user_phone.dart'; +import 'package:flower_app/domain/core/local_store/local_store.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// Future main(List args) async { diff --git a/lib/domain/auth/user_group.dart b/lib/domain/auth/user_group.dart index 300337f..f2d8110 100644 --- a/lib/domain/auth/user_group.dart +++ b/lib/domain/auth/user_group.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/domain/core/errors/failure.dart'; +import 'package:flower_app/domain/core/errors/failure.dart'; /// Константы групп пользователей в системе class UserGroupList { diff --git a/lib/domain/auth/user_password.dart b/lib/domain/auth/user_password.dart index 7e5c9b7..416ce53 100644 --- a/lib/domain/auth/user_password.dart +++ b/lib/domain/auth/user_password.dart @@ -1,7 +1,7 @@ import 'dart:math'; -import 'package:flowers_app/domain/auth/user_password.key' as user_pass; -import 'package:flowers_app/domain/core/entities/validation_result.dart'; +import 'package:flower_app/domain/auth/user_password.key' as user_pass; +import 'package:flower_app/domain/core/entities/validation_result.dart'; class UserPassword { final _key = user_pass.key; @@ -12,9 +12,9 @@ class UserPassword { required String value, }): _value = value; - factory UserPassword.generate(int _length1, int _length2) { - final part1 = _generateRandomString(_length1); - final part2 = _generateRandomString(_length2); + factory UserPassword.generate(int length1, int length2) { + final part1 = _generateRandomString(length1); + final part2 = _generateRandomString(length2); return UserPassword(value: '$part1-$part2'); } String value() => _value; @@ -26,10 +26,10 @@ class UserPassword { } ValidationResult validate() { final regex = RegExp('^.{$minLength,$maxLength}\$'); - final _valid = regex.hasMatch(_value); + final valid = regex.hasMatch(_value); return ValidationResult( - valid: _valid, - message: _valid ? null : 'Символов не менее: $minLength', + valid: valid, + message: valid ? null : 'Символов не менее: $minLength', ); } String _encrypt(String source, String key) { @@ -106,7 +106,7 @@ class UserPassword { } } String _generateRandomString(int len) { - const _chars = '!%&AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890!%&'; + const chars = '!%&AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890!%&'; final r = Random.secure(); - return List.generate(len, (index) => _chars[r.nextInt(_chars.length)]).join(); + return List.generate(len, (index) => chars[r.nextInt(chars.length)]).join(); } diff --git a/lib/domain/auth/user_phone.dart b/lib/domain/auth/user_phone.dart index 3a6feeb..5b665d4 100644 --- a/lib/domain/auth/user_phone.dart +++ b/lib/domain/auth/user_phone.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/domain/core/entities/validation_result.dart'; +import 'package:flower_app/domain/core/entities/validation_result.dart'; /// /// Класс хранит номер телефона в 10-ти значном формате /// и код страны в строке как пример +7 diff --git a/lib/domain/auth/user_phone_verify.dart_ b/lib/domain/auth/user_phone_verify.dart_ index a9d7489..0d0ba0d 100644 --- a/lib/domain/auth/user_phone_verify.dart_ +++ b/lib/domain/auth/user_phone_verify.dart_ @@ -1,5 +1,5 @@ import 'package:firebase_auth/firebase_auth.dart'; -import 'package:flowers_app/dev/log/log.dart'; +import 'package:flower_app/dev/log/log.dart'; class UserPhoneVerify { final String _countryCode; diff --git a/lib/domain/core/entities/value_multy_line_string.dart b/lib/domain/core/entities/value_multy_line_string.dart index caf10d4..134c5e9 100644 --- a/lib/domain/core/entities/value_multy_line_string.dart +++ b/lib/domain/core/entities/value_multy_line_string.dart @@ -1,14 +1,13 @@ -import 'package:flowers_app/domain/core/entities/value_object.dart'; -import 'package:flowers_app/domain/core/entities/value_object_validation.dart'; +import 'package:flower_app/domain/core/entities/value_object.dart'; +import 'package:flower_app/domain/core/entities/value_object_validation.dart'; class ValueMultyLineString extends ValueObject { final List? _validationList; ValueMultyLineString( - String value, + super.value, {List? validationList,} ): - _validationList = validationList, - super(value); + _validationList = validationList; @override ValueMultyLineString toDomain(String value) { return ValueMultyLineString( @@ -24,12 +23,12 @@ class ValueMultyLineString extends ValueObject { return get(); } String valid() { - final _vList = _validationList; - if (_vList == null) { + final vList = _validationList; + if (vList == null) { return ''; } - return _vList.map( - (_validation) => _validation.validate(get()), + return vList.map( + (validation) => validation.validate(get()), ).join('; ') ; } } diff --git a/lib/domain/core/entities/value_string.dart b/lib/domain/core/entities/value_string.dart index 6d0d061..1495ac5 100644 --- a/lib/domain/core/entities/value_string.dart +++ b/lib/domain/core/entities/value_string.dart @@ -1,25 +1,24 @@ -import 'package:flowers_app/domain/core/entities/value_object.dart'; -import 'package:flowers_app/domain/core/entities/value_object_validation.dart'; +import 'package:flower_app/domain/core/entities/value_object.dart'; +import 'package:flower_app/domain/core/entities/value_object_validation.dart'; class ValueString extends ValueObject { final List? _validationList; ValueString( - String value, + super.value, {List? validationList,} ): - _validationList = validationList, - super(value); + _validationList = validationList; @override String toString() { return get(); } String valid() { - final _vList = _validationList; - if (_vList == null) { + final vList = _validationList; + if (vList == null) { return ''; } - return _vList.map( - (_validation) => _validation.validate(get()), + return vList.map( + (validation) => validation.validate(get()), ).join('; ') ; } @override diff --git a/lib/domain/core/errors/errors.dart b/lib/domain/core/errors/errors.dart index 3098e66..25d002c 100644 --- a/lib/domain/core/errors/errors.dart +++ b/lib/domain/core/errors/errors.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/domain/core/errors/failure.dart'; +import 'package:flower_app/domain/core/errors/failure.dart'; class NotAuthenticatedError extends Error {} diff --git a/lib/domain/core/errors/failure.dart b/lib/domain/core/errors/failure.dart index 96e6b7e..6a051ec 100644 --- a/lib/domain/core/errors/failure.dart +++ b/lib/domain/core/errors/failure.dart @@ -1,6 +1,6 @@ // // Ganeral Value Failures -import 'package:flowers_app/dev/log/log.dart'; +import 'package:flower_app/dev/log/log.dart'; abstract class Failure { static const _debug = true; diff --git a/lib/domain/core/local_store/local_store.dart b/lib/domain/core/local_store/local_store.dart index 3871467..7dc07d7 100644 --- a/lib/domain/core/local_store/local_store.dart +++ b/lib/domain/core/local_store/local_store.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:flowers_app/dev/log/log.dart'; +import 'package:flower_app/dev/log/log.dart'; import 'package:shared_preferences/shared_preferences.dart'; /// Класс реализует чтение и запись данных diff --git a/lib/domain/core/translate/translate.dart b/lib/domain/core/translate/translate.dart new file mode 100644 index 0000000..b91e941 --- /dev/null +++ b/lib/domain/core/translate/translate.dart @@ -0,0 +1,70 @@ +class InEn { + final String _value; + InEn(value) : _value = value; + @override + String toString() { + return tr[_value]?[Lang.en] ?? _value; + } +} + +class InRu { + final String _value; + InRu(value) : _value = value; + @override + String toString() { + return tr[_value]?[Lang.ru] ?? _value; + } +} + +enum Lang { + en, + ru +} + +const tr = { + 'name': {Lang.en: 'name', Lang.ru: 'имя'}, + 'Edit customer': {Lang.en: 'Edit customer', Lang.ru: 'Редактировать пользователя'}, + 'Edit transaction': {Lang.en: 'Edit transaction', Lang.ru: 'Редактировать транзакцию'}, + 'New transaction': {Lang.en: 'New transaction', Lang.ru: 'Новая транзакция'}, + 'from': {Lang.en: 'from', Lang.ru: 'от'}, + 'Author': {Lang.en: 'Author', Lang.ru: 'Автор'}, + 'Customer': {Lang.en: 'Customer', Lang.ru: 'Пользователь'}, + 'Value': {Lang.en: 'Value', Lang.ru: 'Сумма'}, + 'Created': {Lang.en: 'Created', Lang.ru: 'Создано'}, + 'Description': {Lang.en: 'Description', Lang.ru: 'Описание'}, + 'TransactionDetails': {Lang.en: 'Details', Lang.ru: 'Назначение'}, + 'CustomerAccountBefore': {Lang.en: 'Customer account before', Lang.ru: 'Счет клиента до'}, + 'NotSampled': {Lang.en: 'Not sampled', Lang.ru: 'Не выбрано'}, + 'AllowIndebted': {Lang.en: 'Allow indebted', Lang.ru: 'Разрешить в долг'}, + 'Amount': {Lang.en: 'Amount', Lang.ru: 'Сумма'}, + 'amount': {Lang.en: 'amount', Lang.ru: 'сумма'}, + 'of': {Lang.en: 'of', Lang.ru: 'от'}, + 'Show deleted': {Lang.en: 'Show deleted', Lang.ru: 'Показывать удаленные'}, + 'Customers': {Lang.en: 'Customers', Lang.ru: 'Пользователи'}, + 'Transactions': {Lang.en: 'Transactions', Lang.ru: 'Транзакции'}, + 'Payment': {Lang.en: 'Payment', Lang.ru: 'Оплата'}, + 'ProductCategory': {Lang.en: 'Product Category', Lang.ru: 'Категории'}, + 'Product': {Lang.en: 'Product', Lang.ru: 'Товар'}, + 'Products': {Lang.en: 'Products', Lang.ru: 'Товары'}, + 'Purchase': {Lang.en: 'Purchase', Lang.ru: 'Закупка'}, + 'Purchases': {Lang.en: 'Purchases', Lang.ru: 'Закупки'}, + 'PurchaseItems': {Lang.en: 'Purchase Items', Lang.ru: 'Позиции закупок'}, + 'Orders': {Lang.en: 'Orders', Lang.ru: 'Заказы'}, + 'Count': {Lang.en: 'Count', Lang.ru: 'Кол-во'}, + 'Paid': {Lang.en: 'Paid', Lang.ru: 'Оплачено'}, + 'Cost': {Lang.en: 'Cost', Lang.ru: 'Стоимость'}, + 'Distributed': {Lang.en: 'Distributed', Lang.ru: 'Выдано'}, + + 'No products added yet': {Lang.en: 'No products added yet', Lang.ru: 'Пока не добавлено ни одного товара'}, + 'Reload': {Lang.en: 'Reload', Lang.ru: 'Перезагрузить'}, +}; +/// +/// Simple translate +extension StringTranslation on String{ + String get inEn { + return tr[this]?[Lang.en] ?? this; + } + String get inRu { + return tr[this]?[Lang.ru] ?? this; + } +} diff --git a/lib/domain/notice/notice.dart b/lib/domain/notice/notice.dart index d732a6b..8292d52 100644 --- a/lib/domain/notice/notice.dart +++ b/lib/domain/notice/notice.dart @@ -1,22 +1,22 @@ import 'package:ext_rw/ext_rw.dart'; -import 'package:flowers_app/settings/setting.dart'; +import 'package:flower_app/settings/setting.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// class NoticeSqlParams { final String? id; final String? customerId; final String? purchaseId; - final String? purchaseContentId; + final String? purchaseItemId; /// /// NoticeSqlParams({ this.id, this.customerId, this.purchaseId, - this.purchaseContentId, + this.purchaseItemId, }); } /// @@ -26,7 +26,7 @@ typedef NoticeSqlAccess = SqlAccess, NoticeSqlParams>; /// Contains an information about the Notice message /// - [customerId] - Author of the [Notice] /// - [purchaseId] - If notice refers to the whole Purchase, not to exact position -/// - [purchaseContentId] - If notice refers to single position of the Purchase, purchase_id - not required +/// - [purchaseItemId] - If notice refers to single position of the Purchase, purchase_id - not required /// - [title] - Title of the notice /// - [body] - Text of the notice class Notice { @@ -34,7 +34,7 @@ class Notice { late String id = ''; late String customerId = ''; late String purchaseId = ''; - late String purchaseContentId = ''; + late String purchaseItemId = ''; late String title = ''; late String body = ''; late String created = ''; @@ -59,12 +59,12 @@ class Notice { return Sql(sql: "select * from notice where id = ${params?.id};"); } else if (params?.customerId != null && params?.purchaseId != null) { return Sql(sql: "select * from notice where customer_id = ${params?.customerId} and purchase_id = ${params?.purchaseId};"); - } else if (params?.customerId != null && params?.purchaseContentId != null) { - return Sql(sql: "select * from notice where customer_id = ${params?.customerId} and purchase_content_id = ${params?.purchaseContentId};"); + } else if (params?.customerId != null && params?.purchaseItemId != null) { + return Sql(sql: "select * from notice where customer_id = ${params?.customerId} and purchase_item_id = ${params?.purchaseItemId};"); } else if (params?.purchaseId != null) { return Sql(sql: "select * from notice where purchase_id = ${params?.purchaseId};"); - } else if (params?.purchaseContentId != null) { - return Sql(sql: "select * from notice where purchase_content_id = ${params?.purchaseContentId};"); + } else if (params?.purchaseItemId != null) { + return Sql(sql: "select * from notice where purchase_item_id = ${params?.purchaseItemId};"); } return Sql(sql: "select * from notice where id = ${params?.id};"); }, @@ -90,7 +90,7 @@ class Notice { /// Returns true if all field of the Purchase is Ok bool get isValid => _valid; /// - /// Returns Notice parsed from database row Map + /// Returns Notice parsed from database row `Map` Notice.fromRow(Map row): _viewed = Future.value(true), _remote = null @@ -112,7 +112,7 @@ class Notice { id = '${row['id']}'; customerId = '${row['customer_id']}'; purchaseId = '${row['purchase_id']}'; - purchaseContentId = '${row['purchase_content_id']}'; + purchaseItemId = '${row['purchase_item_id']}'; title = '${row['title']}'; body = '${row['body']}'; created = '${row['created']}'; diff --git a/lib/domain/notice/notice_list.dart b/lib/domain/notice/notice_list.dart index 6c34715..90fe071 100644 --- a/lib/domain/notice/notice_list.dart +++ b/lib/domain/notice/notice_list.dart @@ -1,24 +1,24 @@ import 'dart:async'; import 'package:ext_rw/ext_rw.dart'; -import 'package:flowers_app/domain/notice/notice.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/settings/setting.dart'; +import 'package:flower_app/domain/notice/notice.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/settings/setting.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// Container provides SQL query parameters for the [NoticeListSqlParams] class NoticeListSqlParams { final String? customerId; final String? purchaseId; - final String? purchaseContentId; + final String? purchaseItemId; /// /// const NoticeListSqlParams({ this.customerId, this.purchaseId, - this.purchaseContentId, + this.purchaseItemId, }); } /// @@ -50,8 +50,10 @@ class NoticeList { authToken: const Setting('api-auth-token').toString(), database: const Setting('api-database').toString(), sqlBuilder: (sql, params) { - if (params?.purchaseContentId != null) { - return Sql(sql: "select * from notice where purchase_content_id = ${params?.purchaseContentId} order by id;"); + if (params?.purchaseItemId != null) { + return Sql(sql: "select * from notice where purchase_item_id = ${params?.purchaseItemId} order by id;"); + } else if (params?.purchaseId != null) { + return Sql(sql: "select * from notice where purchase_id = ${params?.purchaseId} order by id;"); } else { return Sql(sql: "select * from notice order by id;"); } @@ -69,8 +71,8 @@ class NoticeList { bool isEmpty() => _isEmpty; /// /// Returns Notice's - /// - all notices if params.purchaseContentId = null - /// - notices relevant to the purchase_content if params.purchaseContentId specified + /// - all notices if params.purchaseItemId = null + /// - notices relevant to the purchase_item if params.purchaseItemId specified Future> refresh(NoticeListSqlParams params) => _fetch(params); /// /// @@ -160,7 +162,7 @@ class NoticeList { return _awaitReading(NoticeListSqlParams( customerId: (fieldName == 'customer_id') ? value : null, purchaseId: (fieldName == 'purchase_id') ? value : null, - purchaseContentId: (fieldName == 'purchase_content_id') ? value : null, + purchaseItemId: (fieldName == 'purchase_item_id') ? value : null, ),) .then((_) { return _findNewNotice( @@ -180,8 +182,8 @@ class NoticeList { return notice.id == value; } else if (fieldName == 'purchase_id') { return notice.purchaseId == value; - } else if (fieldName == 'purchase_content_id') { - return notice.purchaseContentId == value; + } else if (fieldName == 'purchase_item_id') { + return notice.purchaseItemId == value; } else { _log.error("$NoticeList._validateByFieldName | Notice list can't be filterd by field: $fieldName, not implemented"); return false; @@ -211,7 +213,7 @@ class NoticeList { return _awaitReading(NoticeListSqlParams( customerId: (fieldName == 'customer_id') ? value : null, purchaseId: (fieldName == 'purchase_id') ? value : null, - purchaseContentId: (fieldName == 'purchase_content_id') ? value : null, + purchaseItemId: (fieldName == 'purchase_item_id') ? value : null, ),) .then((_) { _log.debug('$NoticeList.last | try to find Notice (field: $fieldName\tvalue: $value)'); diff --git a/lib/domain/notice/notice_list_viewed.dart b/lib/domain/notice/notice_list_viewed.dart index 9ba6add..72b37f8 100644 --- a/lib/domain/notice/notice_list_viewed.dart +++ b/lib/domain/notice/notice_list_viewed.dart @@ -1,8 +1,8 @@ import 'dart:async'; import 'dart:convert'; -import 'package:flowers_app/domain/core/errors/failure.dart'; -import 'package:flowers_app/domain/core/local_store/local_store.dart'; +import 'package:flower_app/domain/core/errors/failure.dart'; +import 'package:flower_app/domain/core/local_store/local_store.dart'; import 'package:hmi_core/hmi_core_log.dart'; /// /// Класс реализует список элементов Notice для OrderOverviewBody @@ -41,16 +41,16 @@ class NoticeListViewed { /// /// Метод сохраняет noticeId в список просмотренных в localStorage /// noticeId - идентификатор, хранящийся в localStorage - /// purchaseContentId - идентификатор группы, в которую попадет noticeId + /// purchaseItemId - идентификатор группы, в которую попадет noticeId Future setViewed({ required String noticeId, - required String purchaseContentId, + required String purchaseItemId, }) { _log.debug('.setViewed | trying to find Notice (id: $noticeId)'); return _awaitReading() .then((_) { - if (!_containsInGroup(map: _map, groupId: purchaseContentId, id: noticeId)) { - _map.update(purchaseContentId, + if (!_containsInGroup(map: _map, groupId: purchaseItemId, id: noticeId)) { + _map.update(purchaseItemId, (listOfId) { listOfId.add(noticeId); return listOfId; @@ -151,7 +151,7 @@ class NoticeListViewed { /// /// Вернет true если Notice с указанным /// noticeId - /// purchaseContentId + /// purchaseItemId /// имеется в списке просмотренных Future contains({ required String noticeId, @@ -175,16 +175,16 @@ class NoticeListViewed { /// /// Вернет true если Notice с указанными /// noticeId - /// purchaseContentId + /// purchaseItemId /// имеется в списке просмотренных Future containsInGroup({ required String noticeId, - required String purchaseContentId, + required String purchaseItemId, }) { - _log.debug('.containsInGroup | trying to find Notice (id: $noticeId, purchaseContentId: $purchaseContentId)'); + _log.debug('.containsInGroup | trying to find Notice (id: $noticeId, purchaseItemId: $purchaseItemId)'); return _awaitReading() .then((_) { - return _containsInGroup(map: _map, groupId: purchaseContentId, id: noticeId); + return _containsInGroup(map: _map, groupId: purchaseItemId, id: noticeId); }); } /// @@ -215,7 +215,7 @@ class NoticeListViewed { /// /// вернет путь в localStorage для просмотренного notice /// или пустую строку '' если пуст хотя бы один из - /// параметров 'customer_id' или 'purchase_content_id' + /// параметров 'customer_id' или 'purchase_item_id' String localStorageViewedNoticePath(String customerId) { return 'viewedNotice:user:$customerId'; } diff --git a/lib/domain/order/order.dart b/lib/domain/order/order.dart index d53eab9..3cd98f9 100644 --- a/lib/domain/order/order.dart +++ b/lib/domain/order/order.dart @@ -1,13 +1,13 @@ import 'package:ext_rw/ext_rw.dart'; -import 'package:flowers_app/domain/purchase/purchase_set_order.dart'; -import 'package:flowers_app/domain/purchase/purchase_status.dart'; -import 'package:flowers_app/presentation/core/dialogs/complete_dialog.dart'; -import 'package:flowers_app/presentation/core/dialogs/failure_dialog.dart'; -import 'package:flowers_app/settings/setting.dart'; +import 'package:flower_app/domain/purchase/purchase_set_order.dart'; +import 'package:flower_app/domain/purchase/purchase_status.dart'; +import 'package:flower_app/presentation/core/dialogs/complete_dialog.dart'; +import 'package:flower_app/presentation/core/dialogs/failure_dialog.dart'; +import 'package:flower_app/settings/setting.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// Container provides SQL query parameters for the [OrderSqlAccess] class OrderSqlParams { @@ -15,16 +15,23 @@ class OrderSqlParams { final String? id; /// customer_order.customerId final String? customerId; - /// customer_order.purchase_content_id - final String? purchaseContentId; + /// customer_order.purchase_item_id + final String? purchaseItemId; /// customer_order.count final String? count; + /// + /// const OrderSqlParams({ this.id, this.customerId, - this.purchaseContentId, + this.purchaseItemId, this.count, }); + // + @override + String toString() { + return 'OrderSqlParams { customer_order.id: $id, customer_order.customerId: $customerId, customer_order.purchase_item_id: $purchaseItemId, count: $count }'; + } } /// /// @@ -38,27 +45,27 @@ typedef OrderSqlAccess = SqlAccess, OrderSqlParams>; class Order { static const _log = Log('Order'); late String id = ''; - late String customer_id = ''; - late String product_id = ''; - late String product_group = ''; - late String product_name = ''; - late String product_picture = ''; + late String customerId = ''; + late String productId = ''; + late String productCategory = ''; + late String product = ''; + late String productPicture = ''; /// количество единиц товара в заказе пользователя late int count = 0; late String cost = ''; // сколько оплатил late String paid = ''; // сколько оплатил - late String to_refounded = ''; // сколько денег клиенту нужно вернуть + late String toRefounded = ''; // сколько денег клиенту нужно вернуть late String refounded = ''; // сколько денег клиенту вернули late String distributed = ''; // сколько товара получил late String description = ''; - late String purchase_id = ''; - late String purchase_name = ''; - late String purchase_details = ''; - late String purchase_content_id = ''; - late String purchase_content_sale_price = ''; // цена за единицу - late String purchase_content_sale_currency = ''; // валюта - late String purchase_content_shipping = ''; // доставка за единицу - late PurchaseStatus purchase_content_status = PurchaseStatus.notCampled(); // статус позиции + late String purchaseId = ''; + late String purchase = ''; + late String purchaseDetails = ''; + late String purchaseItemId = ''; + late String purchaseItemSalePrice = ''; // цена за единицу + late String currency = ''; // валюта + late String purchaseItemShipping = ''; // доставка за единицу + late PurchaseStatus purchaseItemStatus = PurchaseStatus.notCampled(); // статус позиции late String created = ''; late String updated = ''; late String deleted = ''; @@ -79,13 +86,17 @@ class Order { authToken: const Setting('api-auth-token').toString(), database: const Setting('api-database').toString(), sqlBuilder: (sql, params) { - if (params?.customerId != null && params?.purchaseContentId != null) { - _log.debug(".sqlBuilder | Selecting by customer_id: ${params?.customerId} and purchase_content_id: ${params?.purchaseContentId}"); + if (params?.customerId != null && params?.purchaseItemId != null) { + _log.debug(".sqlBuilder | Selecting by customer_id: ${params?.customerId} and purchase_item_id: ${params?.purchaseItemId}"); return Sql(sql: """ - SELECT cord.id, + select + cord.id, cord.customer_id, - cord.purchase_content_id, + cu.name as customer, + cord.purchase_item_id, cord.count, + cord.count * (pui.sale_price + pui.shipping) as cost, + pui.shipping as shipping, cord.paid, cord.distributed, cord.to_refound, @@ -94,16 +105,20 @@ class Order { cord.created, cord.updated, cord.deleted, - cu.name AS customer, - p.name AS product, - pu.name AS purchase - FROM customer_order cord - JOIN customer cu ON cord.customer_id = cu.id - JOIN purchase_content puc ON cord.purchase_content_id = puc.id - JOIN purchase pu ON puc.purchase_id = pu.id - JOIN product p ON puc.product_id = p.id + pui.status as status, + pui.product as product, + pui.sale_currency as currency, + p.category as product_category, + pui.picture as product_picture, + pu.id as purchase_id, + pu.name as purchase + from public.customer_order cord + JOIN public.customer cu ON cord.customer_id = cu.id + JOIN public.purchase_item_view pui ON cord.purchase_item_id = pui.id + JOIN public.purchase pu ON pui.purchase_id = pu.id + JOIN public.product_view p ON pui.product_id = p.id where cord.customer_id = ${params?.customerId} - and cord.purchase_content_id = ${params?.purchaseContentId}; + and cord.purchase_item_id = ${params?.purchaseItemId}; """,); } final selfId = (params?.id != null) @@ -111,10 +126,14 @@ class Order { : id; _log.debug(".sqlBuilder | Selecting by order id: $selfId"); return Sql(sql: """ - SELECT cord.id, + select + cord.id, cord.customer_id, - cord.purchase_content_id, + cu.name as customer, + cord.purchase_item_id, cord.count, + cord.count * (pui.sale_price + pui.shipping) as cost, + pui.shipping as shipping, cord.paid, cord.distributed, cord.to_refound, @@ -123,14 +142,18 @@ class Order { cord.created, cord.updated, cord.deleted, - cu.name AS customer, - p.name AS product, - pu.name AS purchase - FROM customer_order cord - JOIN customer cu ON cord.customer_id = cu.id - JOIN purchase_content puc ON cord.purchase_content_id = puc.id - JOIN purchase pu ON puc.purchase_id = pu.id - JOIN product p ON puc.product_id = p.id + pui.status as status, + pui.product as product, + pui.sale_currency as currency, + p.category as product_category, + pui.picture as product_picture, + pu.id as purchase_id, + pu.name as purchase + from public.customer_order cord + JOIN public.customer cu ON cord.customer_id = cu.id + JOIN public.purchase_item_view pui ON cord.purchase_item_id = pui.id + JOIN public.purchase pu ON pui.purchase_id = pu.id + JOIN public.product_view p ON pui.product_id = p.id where cord.id = $selfId; """,); }, @@ -154,25 +177,17 @@ class Order { double getCost() => double.parse(cost); /// /// Returns Shipping as double - double getShipping() => double.parse(purchase_content_shipping) * count; + double getShipping() => double.parse(purchaseItemShipping) * count; /// /// Removing order from the database Future, Failure>> remove(BuildContext context) { _log.debug('Order.remove | loading...'); - // final product = PurchaseItem( - // userId: customer_id, - // purchaseContentId: purchase_content_id, - // remote: dataSource.dataSet('purchase_product'), - // ); - // product.product_id = this.product_id; - // product.purchase_id = this.purchase_id; - // product['product/name'] = this['product/name']; return removeOrder( context, ); } /// - /// Returns Order parsed from database row Map + /// Returns Order parsed from database row `Map` Order.fromRow(Map row) { _fromRow(row); } @@ -192,26 +207,26 @@ class Order { return Err(Failure(message: 'Purchase._fromRow | Error: Purchase invalid "id" in row: $row', stackTrace: StackTrace.current)); } id = '${row['id']}'; - customer_id = '${row['customer_id']}'; - product_id = '${row['product_id']}'; - product_group = '${row['product_group']}'; - product_name = '${row['product_name']}'; - product_picture = '${row['product_picture']}'; + customerId = '${row['customer_id']}'; + productId = '${row['product_id']}'; + productCategory = '${row['product_category']}'; + product = '${row['product']}'; + productPicture = '${row['product_picture']}'; count = _parseInt('${row['count']}'); cost = '${row['cost']}'; // сколько оплатил paid = '${row['paid']}'; // сколько оплатил - to_refounded = '${row['to_refounded']}'; // сколько денег клиенту нужно вернуть + toRefounded = '${row['to_refounded']}'; // сколько денег клиенту нужно вернуть refounded = '${row['refounded']}'; // сколько денег клиенту вернули distributed = '${row['distributed']}'; // сколько товара получил description = '${row['description']}'; - purchase_id = '${row['purchase_id']}'; - purchase_name = '${row['purchase_name']}'; - purchase_details = '${row['purchase_details']}'; - purchase_content_id = '${row['purchase_content_id']}'; - purchase_content_sale_price = '${row['purchase_content_sale_price']}'; // цена за единицу - purchase_content_sale_currency = '${row['purchase_content_sale_currency']}'; // валюта - purchase_content_shipping = '${row['purchase_content_shipping']}'; // доставка за единицу - purchase_content_status = PurchaseStatus(status: '${row['purchase_content_status']}'); // статус позиции + purchaseId = '${row['purchase_id']}'; + purchase = '${row['purchase']}'; + purchaseDetails = '${row['purchase_details']}'; + purchaseItemId = '${row['purchase_item_id']}'; + purchaseItemSalePrice = '${row['price']}'; // цена за единицу + currency = '${row['currency']}'; // валюта + purchaseItemShipping = '${row['shipping']}'; // доставка за единицу + purchaseItemStatus = PurchaseStatus(status: '${row['status']}'); // статус позиции created = '${row['created']}'; updated = '${row['updated']}'; deleted = '${row['deleted']}'; @@ -233,7 +248,7 @@ class Order { return _fromRow(row); } else { _valid = false; - return Err(Failure(message: 'Order.fetch | Error: Order with id=$id is not found', stackTrace: StackTrace.current)); + return Err(Failure(message: 'Order.fetch | Error: Order by params: $params is not found', stackTrace: StackTrace.current)); } case Err(:final error): _log.warning('.fetch | Error: $error'); @@ -316,7 +331,7 @@ class Order { /// Future, Failure>> setOrder({required int count}) { return PurchaseSetOrder( - customerId: customer_id, - ).send('$count', purchase_content_id); + customerId: customerId, + ).send('$count', purchaseItemId); } } diff --git a/lib/domain/order/order_header.dart b/lib/domain/order/order_header.dart index 150223c..869aba6 100644 --- a/lib/domain/order/order_header.dart +++ b/lib/domain/order/order_header.dart @@ -1,23 +1,36 @@ -import 'package:flowers_app/domain/order/order.dart'; +import 'package:flower_app/domain/order/order.dart'; +/// +/// class OrderHeader { late String purchaseId; late String purchaseName; late double _total; late double _totalShipping; + final String currency; + /// + /// OrderHeader({ required Order order, required double total, required double shipping, - }) { - purchaseId = order.purchase_id; - purchaseName = order.purchase_name; - _total = total; - _totalShipping = shipping; - } + }) : + purchaseId = order.purchaseId, + purchaseName = order.purchase, + _total = total, + _totalShipping = shipping, + currency = order.currency; + /// + /// double get total => _total; + /// + /// double get totalPrice => _total - _totalShipping; + /// + /// double get totalShipping => _totalShipping; + /// + /// Adding [cost] and [shipping] to the totals void addCost(double cost, double shipping) { _total += cost; _totalShipping += shipping; diff --git a/lib/domain/order/order_list.dart b/lib/domain/order/order_list.dart index 2face71..f948e54 100644 --- a/lib/domain/order/order_list.dart +++ b/lib/domain/order/order_list.dart @@ -1,31 +1,123 @@ import 'package:ext_rw/ext_rw.dart'; -import 'package:flowers_app/domain/order/order.dart'; -import 'package:flowers_app/settings/setting.dart'; +import 'package:flower_app/domain/order/order.dart'; +import 'package:flower_app/settings/setting.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// -typedef OrderListSqlAccess = SqlAccess, void>; +typedef OrderListSqlAccess = SqlAccess, OrderListSqlParams>; +/// +/// Container provides SQL query parameters for the [OrderListSqlAccess] +class OrderListSqlParams { + /// customer_order.id + final String? id; + /// customer_order.customerId + final String? customerId; + /// customer_order.purchase_item_id + final String? purchaseItemId; + /// customer_order.count + final String? count; + /// + /// Container provides SQL query parameters for the [OrderListSqlAccess] + const OrderListSqlParams({ + this.id, + this.customerId, + this.purchaseItemId, + this.count, + }); + // + @override + String toString() { + return 'OrderSqlParams { customer_order.id: $id, customer_order.customerId: $customerId, customer_order.purchase_item_id: $purchaseItemId, count: $count }'; + } +} + /// /// Класс реализует список элементов Order для OrderOverviewBody /// Список заказов для отображения в личном кабинете class OrderList { static const _log = Log('OrderList'); + final OrderListSqlParams? params; final OrderListSqlAccess _remote; final Map _orders = {}; /// /// Список заказов для отображения в личном кабинете OrderList({ + this.params, OrderListSqlAccess? remote, }): - _remote = remote ?? SqlAccess( address: ApiAddress(host: const Setting('api-host').toString(), port: const Setting('api-port').toInt), authToken: const Setting('api-auth-token').toString(), database: const Setting('api-database').toString(), - sqlBuilder: (sql, _) { - return Sql(sql: "select * from order;"); + sqlBuilder: (sql, params) { + // return Sql(sql: "select * from customer_order_view;"); + if (params?.customerId != null) { + return Sql(sql: """ + select + cord.id, + cord.customer_id, + cu.name as customer, + cord.purchase_item_id, + cord.count, + cord.count * (pui.sale_price + pui.shipping) as cost, + pui.shipping as shipping, + cord.paid, + cord.distributed, + cord.to_refound, + cord.refounded, + cord.description, + cord.created, + cord.updated, + cord.deleted, + pui.status as status, + pui.product as product, + pui.sale_currency as currency, + p.category as product_category, + pui.picture as product_picture, + pu.id as purchase_id, + pu.name as purchase + from public.customer_order cord + JOIN public.customer cu ON cord.customer_id = cu.id + JOIN public.purchase_item_view pui ON cord.purchase_item_id = pui.id + JOIN public.purchase pu ON pui.purchase_id = pu.id + JOIN public.product_view p ON pui.product_id = p.id + where cord.customer_id = ${params?.customerId} + order by pu.id, pui.id; + """); + } + return Sql(sql: """ + select + cord.id, + cord.customer_id, + cu.name as customer, + cord.purchase_item_id, + cord.count, + cord.count * (pui.sale_price + pui.shipping) as cost, + pui.shipping as shipping, + cord.paid, + cord.distributed, + cord.to_refound, + cord.refounded, + cord.description, + cord.created, + cord.updated, + cord.deleted, + pui.status as status, + pui.product as product, + pui.sale_currency as currency, + p.category as product_category, + pui.picture as product_picture, + pu.id as purchase_id, + pu.name as purchase + from public.customer_order cord + JOIN public.customer cu ON cord.customer_id = cu.id + JOIN public.purchase_item_view pui ON cord.purchase_item_id = pui.id + JOIN public.purchase pu ON pui.purchase_id = pu.id + JOIN public.product_view p ON pui.product_id = p.id + order by cu.id, pu.id, pui.id; + """); }, entryBuilder: (row) { return row; @@ -36,9 +128,9 @@ class OrderList { Future, Failure>> refresh() => fetch(); /// /// Returns Order's as map - Future, Failure>> fetch() { + Future, Failure>> fetch({OrderListSqlParams? params}) { _orders.clear(); - return _remote.fetch().then( + return _remote.fetch(params: params ?? this.params).then( (result) { switch (result) { case Ok(value :final result): diff --git a/lib/domain/purchase/purchase.dart b/lib/domain/purchase/purchase.dart index 70ea71f..6a90317 100644 --- a/lib/domain/purchase/purchase.dart +++ b/lib/domain/purchase/purchase.dart @@ -1,8 +1,8 @@ import 'package:ext_rw/ext_rw.dart'; -import 'package:flowers_app/settings/setting.dart'; +import 'package:flower_app/settings/setting.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// typedef PurchaseId = String; @@ -67,9 +67,9 @@ class Purchase { id = '${row['id']}'; status = '${row['status']}'; name = '${row['name']}'; - details = '${row['details']}'; - preview = '${row['preview']}'; - description = '${row['description']}'; + details = '${row['details'] ?? ''}'; + preview = '${row['preview'] ?? ''}'; + description = '${row['description'] ?? ''}'; picture = '${row['picture']}'; dateOfStart = '${row['dateOfStart']}'; dateOfEnd = '${row['dateOfEnd']}'; diff --git a/lib/domain/purchase/purchase_item.dart b/lib/domain/purchase/purchase_item.dart index 56ce8ea..b3d243e 100644 --- a/lib/domain/purchase/purchase_item.dart +++ b/lib/domain/purchase/purchase_item.dart @@ -1,9 +1,9 @@ import 'package:ext_rw/ext_rw.dart'; -import 'package:flowers_app/domain/purchase/purchase_status.dart'; -import 'package:flowers_app/settings/setting.dart'; +import 'package:flower_app/domain/purchase/purchase_status.dart'; +import 'package:flower_app/settings/setting.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// The SQL parameters for the PurchaseItem class PurchaseItemSqlParams { @@ -21,7 +21,7 @@ typedef PurchaseitemSqlAccess = SqlAccess, PurchaseItemSqlP /// Item of the PurchaseContent class PurchaseItem { static const _log = Log('PurchaseItem'); - /// purchase_content -> id + /// purchase_item -> id late String id = ''; late String purchase_id = ''; late String product_id = ''; @@ -60,13 +60,13 @@ class PurchaseItem { if (params?.id != null) { if (params?.purchaseId != null) { _log.debug('.sqlBuilder | Building SQL with id: ${params?.id}, purchase_id: ${params?.purchaseId}'); - return Sql(sql: "select * from purchase_content_view where id = ${params?.id} and pirchase_id = ${params?.purchaseId};"); + return Sql(sql: "select * from purchase_item_view where id = ${params?.id} and pirchase_id = ${params?.purchaseId};"); } _log.debug('.sqlBuilder | Building SQL with id: ${params?.id}'); - return Sql(sql: "select * from purchase_content_view where id = ${params?.id};"); + return Sql(sql: "select * from purchase_item_view where id = ${params?.id};"); } _log.debug('.sqlBuilder | Building SQL with id: $id'); - return Sql(sql: "select * from purchase_content_view where id = $id;"); + return Sql(sql: "select * from purchase_item_view where id = $id;"); }, entryBuilder: (row) { return row; @@ -87,7 +87,7 @@ class PurchaseItem { return 0; } /// - /// Returns Order parsed from database row Map + /// Returns Order parsed from database row `Map` PurchaseItem.fromRow(Map row): _remote = _sqlAccess() { _fromRow(row); } @@ -96,14 +96,14 @@ class PurchaseItem { Result _fromRow(Map row) { _log.debug("._fromRow |"); final rowId = row['id']; - if (rowId == null) { + if (rowId == null || '$rowId'.isEmpty) { _valid = false; return Err(Failure(message: 'PurchaseItem._fromRow | Error: PurchaseItem invalid "id" in row: $row', stackTrace: StackTrace.current)); } else { - if ('$rowId'.isEmpty) { - _valid = false; - return Err(Failure(message: 'PurchaseItem._fromRow | Error: PurchaseItem invalid "id" in row: $row', stackTrace: StackTrace.current)); - } + // if ('$rowId'.isEmpty) { + // _valid = false; + // return Err(Failure(message: 'PurchaseItem._fromRow | Error: PurchaseItem invalid "id" in row: $row', stackTrace: StackTrace.current)); + // } id = '${row['id']}'; purchase_id = '${row['purchase_id']}'; product_id = '${row['product_id']}'; @@ -112,8 +112,8 @@ class PurchaseItem { shipping = '${row['shipping']}'; // доставка за единицу purchase = '${row['purchase']}'; product_name = '${row['product']}'; - product_details = '${row['details']}'; - product_description = '${row['description']}'; + product_details = '${row['details'] ?? ''}'; + product_description = '${row['description'] ?? ''}'; product_picture = '${row['picture']}'; remains = _parseInt('${row['remains']}'); status = PurchaseStatus(status: '${row['status']}'); @@ -140,7 +140,7 @@ class PurchaseItem { return _fromRow(row); } else { _valid = false; - return Err(Failure(message: 'PurchaseItem.fetch | Error: PurchaseItem with purchase_content_id: ${params.id}, purchase_id: ${params.purchaseId} - Not found', stackTrace: StackTrace.current)); + return Err(Failure(message: 'PurchaseItem.fetch | Error: PurchaseItem with purchase_item_id: ${params.id}, purchase_id: ${params.purchaseId} - Not found', stackTrace: StackTrace.current)); } case Err(:final error): _log.warning('.fetch | Error: $error'); diff --git a/lib/domain/purchase/purchase_content.dart b/lib/domain/purchase/purchase_items.dart similarity index 77% rename from lib/domain/purchase/purchase_content.dart rename to lib/domain/purchase/purchase_items.dart index 2f1ec52..84c608e 100644 --- a/lib/domain/purchase/purchase_content.dart +++ b/lib/domain/purchase/purchase_items.dart @@ -1,19 +1,19 @@ import 'package:ext_rw/ext_rw.dart'; -import 'package:flowers_app/domain/purchase/purchase_item.dart'; -import 'package:flowers_app/settings/setting.dart'; +import 'package:flower_app/domain/purchase/purchase_item.dart'; +import 'package:flower_app/settings/setting.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// class PurchaseContentSqlParams { final String? customerId; final String? purchaseId; - final String? purchaseContentId; + final String? purchaseItemId; PurchaseContentSqlParams({ this.customerId, this.purchaseId, - this.purchaseContentId, + this.purchaseItemId, }); } /// @@ -22,14 +22,14 @@ typedef PurchaseContentSqlAccess = SqlAccess, PurchaseConte /// /// Класс реализует список элементов PurchaseItem /// список позиций в составе закупки для каталога -class PurchaseContent { +class PurchaseItems { static const _log = Log('PurchaseContent'); final PurchaseContentSqlAccess _remote; final String _purchaseId; - final Map _products = {}; + final Map _itemss = {}; /// /// - PurchaseContent({ + PurchaseItems({ required String purchaseId, PurchaseContentSqlAccess? remote, }): @@ -39,7 +39,7 @@ class PurchaseContent { authToken: const Setting('api-auth-token').toString(), database: const Setting('api-database').toString(), sqlBuilder: (sql, params) { - return Sql(sql: 'select * from purchase_content_view where purchase_id = ${params?.purchaseId};'); + return Sql(sql: 'select * from purchase_item_view where purchase_id = ${params?.purchaseId};'); }, entryBuilder: (row) { return row; @@ -51,7 +51,7 @@ class PurchaseContent { /// /// Returns PurchaseItem's as map Future, Failure>> fetch() { - _products.clear(); + _itemss.clear(); return _remote.fetch(params: PurchaseContentSqlParams(purchaseId: _purchaseId)).then( (result) { switch (result) { @@ -59,11 +59,11 @@ class PurchaseContent { _log.debug('.fetch | result: $result'); if (result.isNotEmpty) { for (final row in result) { - final product = PurchaseItem.fromRow(row); - _products.putIfAbsent(product.id, () => product); + final purchaseItem = PurchaseItem.fromRow(row); + _itemss.putIfAbsent(purchaseItem.id, () => purchaseItem); } } - return Ok(_products); + return Ok(_itemss); case Err(:final error): _log.warning('.fetch | Error: $error'); return Err(Failure(message: 'OrderList.fetch | Error: $error', stackTrace: StackTrace.current)); diff --git a/lib/domain/purchase/purchase_list.dart b/lib/domain/purchase/purchase_list.dart index 8987eda..0594f6b 100644 --- a/lib/domain/purchase/purchase_list.dart +++ b/lib/domain/purchase/purchase_list.dart @@ -1,9 +1,9 @@ import 'package:ext_rw/ext_rw.dart'; -import 'package:flowers_app/domain/purchase/purchase.dart'; -import 'package:flowers_app/settings/setting.dart'; +import 'package:flower_app/domain/purchase/purchase.dart'; +import 'package:flower_app/settings/setting.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// typedef PurchaseListSqlAccess = SqlAccess, void>; diff --git a/lib/domain/purchase/purchase_list_filtered.dart b/lib/domain/purchase/purchase_list_filtered.dart index 48a384f..9499034 100644 --- a/lib/domain/purchase/purchase_list_filtered.dart +++ b/lib/domain/purchase/purchase_list_filtered.dart @@ -1,10 +1,10 @@ import 'dart:async'; -import 'package:flowers_app/domain/purchase/purchase.dart'; -import 'package:flowers_app/domain/purchase/purchase_list.dart'; +import 'package:flower_app/domain/purchase/purchase.dart'; +import 'package:flower_app/domain/purchase/purchase_list.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// Класс реализует список элементов Purchase для PurchaseOverview /// Список закупок для отображения в катологе diff --git a/lib/domain/purchase/purchase_set_order.dart b/lib/domain/purchase/purchase_set_order.dart index c0b1030..dccff21 100644 --- a/lib/domain/purchase/purchase_set_order.dart +++ b/lib/domain/purchase/purchase_set_order.dart @@ -1,9 +1,9 @@ import 'package:ext_rw/ext_rw.dart'; -import 'package:flowers_app/domain/order/order.dart'; -import 'package:flowers_app/settings/setting.dart'; +import 'package:flower_app/domain/order/order.dart'; +import 'package:flower_app/settings/setting.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// class PurchaseSetOrder { @@ -20,7 +20,7 @@ class PurchaseSetOrder { authToken: const Setting('api-auth-token').toString(), database: const Setting('api-database').toString(), sqlBuilder: (sql, params) { - return Sql(sql: 'select * from set_order($customerId, ${params?.purchaseContentId}, ${params?.count});'); + return Sql(sql: 'select * from set_order($customerId, ${params?.purchaseItemId}, ${params?.count});'); }, entryBuilder: (row) { return row; @@ -30,11 +30,11 @@ class PurchaseSetOrder { /// Inserting the new Order or updating if already exists Future, Failure>> send( String count, - String purchaseContentId, + String purchaseItemId, ) async { return _remote.fetch( params: OrderSqlParams( - purchaseContentId: purchaseContentId, + purchaseItemId: purchaseItemId, count: count, ), ) diff --git a/lib/domain/purchase/purchase_status.dart b/lib/domain/purchase/purchase_status.dart index 6a8874a..292019f 100644 --- a/lib/domain/purchase/purchase_status.dart +++ b/lib/domain/purchase/purchase_status.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/domain/core/errors/failure.dart'; +import 'package:flower_app/domain/core/errors/failure.dart'; /// /// Константы статусов закупок и позиций в закупке class PurchaseStatusList { diff --git a/lib/infrastructure/api/api_handle_error.dart b/lib/infrastructure/api/api_handle_error.dart_ similarity index 75% rename from lib/infrastructure/api/api_handle_error.dart rename to lib/infrastructure/api/api_handle_error.dart_ index 783779c..a030a34 100644 --- a/lib/infrastructure/api/api_handle_error.dart +++ b/lib/infrastructure/api/api_handle_error.dart_ @@ -1,8 +1,8 @@ -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/core/errors/failure.dart'; -import 'package:flowers_app/infrastructure/api/api_params.dart'; -import 'package:flowers_app/infrastructure/api/json_to.dart'; -import 'package:flowers_app/infrastructure/api/response.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/core/errors/failure.dart'; +import 'package:flower_app/infrastructure/api/api_params.dart'; +import 'package:flower_app/infrastructure/api/json_to.dart'; +import 'package:flower_app/infrastructure/api/response.dart'; class ApiHandleError { static const _debug = false; diff --git a/lib/infrastructure/api/api_request.dart b/lib/infrastructure/api/api_request.dart_ similarity index 92% rename from lib/infrastructure/api/api_request.dart rename to lib/infrastructure/api/api_request.dart_ index eaef265..b8b0b9a 100644 --- a/lib/infrastructure/api/api_request.dart +++ b/lib/infrastructure/api/api_request.dart_ @@ -1,8 +1,8 @@ import 'dart:io'; -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/core/errors/failure.dart'; -import 'package:flowers_app/infrastructure/api/api_params.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/core/errors/failure.dart'; +import 'package:flower_app/infrastructure/api/api_params.dart'; import 'package:http/http.dart' as http; import 'package:http/io_client.dart'; diff --git a/lib/infrastructure/api/api_stream.dart_ b/lib/infrastructure/api/api_stream.dart_ index 5d57489..5fb54df 100644 --- a/lib/infrastructure/api/api_stream.dart_ +++ b/lib/infrastructure/api/api_stream.dart_ @@ -1,8 +1,8 @@ import 'dart:async'; import 'dart:convert'; -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/infrastructure/api/api_params.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/infrastructure/api/api_params.dart'; import 'package:http/http.dart' as http; class ApiStream { diff --git a/lib/infrastructure/api/json_to.dart b/lib/infrastructure/api/json_to.dart_ similarity index 75% rename from lib/infrastructure/api/json_to.dart rename to lib/infrastructure/api/json_to.dart_ index 65f4554..2b13c6d 100644 --- a/lib/infrastructure/api/json_to.dart +++ b/lib/infrastructure/api/json_to.dart_ @@ -1,9 +1,9 @@ import 'dart:convert'; -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/core/errors/failure.dart'; -import 'package:flowers_app/infrastructure/api/api_params.dart'; -import 'package:flowers_app/infrastructure/api/api_request.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/core/errors/failure.dart'; +import 'package:flower_app/infrastructure/api/api_params.dart'; +import 'package:flower_app/infrastructure/api/api_request.dart'; class JsonTo { static const _debug = false; diff --git a/lib/infrastructure/api/json_to_list.dart_ b/lib/infrastructure/api/json_to_list.dart_ index c4fc1ba..da17441 100644 --- a/lib/infrastructure/api/json_to_list.dart_ +++ b/lib/infrastructure/api/json_to_list.dart_ @@ -1,9 +1,9 @@ import 'dart:convert'; -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/core/errors/failure.dart'; -import 'package:flowers_app/infrastructure/api/api_params.dart'; -import 'package:flowers_app/infrastructure/api/api_request.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/core/errors/failure.dart'; +import 'package:flower_app/infrastructure/api/api_params.dart'; +import 'package:flower_app/infrastructure/api/api_request.dart'; class JsonToList { final ApiRequest _request; diff --git a/lib/infrastructure/api/json_to_map.dart_ b/lib/infrastructure/api/json_to_map.dart_ index 22082a3..52a384a 100644 --- a/lib/infrastructure/api/json_to_map.dart_ +++ b/lib/infrastructure/api/json_to_map.dart_ @@ -1,9 +1,9 @@ import 'dart:convert'; -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/core/errors/failure.dart'; -import 'package:flowers_app/infrastructure/api/api_params.dart'; -import 'package:flowers_app/infrastructure/api/api_request.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/core/errors/failure.dart'; +import 'package:flower_app/infrastructure/api/api_params.dart'; +import 'package:flower_app/infrastructure/api/api_request.dart'; class JsonToMap { final ApiRequest _request; diff --git a/lib/main.dart b/lib/main.dart index e528b6a..70c7a39 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,16 +1,16 @@ import 'dart:async'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/auth/authenticate.dart'; -import 'package:flowers_app/presentation/auth/sign_in/sign_in_page.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; -import 'package:flowers_app/presentation/purchase/purchase_overview/purchase_overview_page.dart'; -import 'package:flowers_app/settings/app_settings.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/auth/authenticate.dart'; +import 'package:flower_app/presentation/auth/sign_in/sign_in_page.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/purchase/purchase_overview/purchase_overview_page.dart'; +import 'package:flower_app/settings/app_settings.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_failure.dart'; +import 'package:hmi_core/hmi_core_json.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/src/core/json/json_map.dart'; -import 'package:hmi_core/src/core/text_file.dart'; +import 'package:hmi_core/hmi_core_text_file.dart'; /// /// Application entry point void main() { diff --git a/lib/presentation/auth/change_password/change_password_page.dart b/lib/presentation/auth/change_password/change_password_page.dart index 42cf711..83212ba 100644 --- a/lib/presentation/auth/change_password/change_password_page.dart +++ b/lib/presentation/auth/change_password/change_password_page.dart @@ -1,7 +1,7 @@ -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/presentation/auth/change_password/widgets/change_password_form.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/presentation/auth/change_password/widgets/change_password_form.dart'; import 'package:flutter/material.dart'; class ChangePasswordPage extends StatelessWidget { diff --git a/lib/presentation/auth/change_password/widgets/change_password_form.dart b/lib/presentation/auth/change_password/widgets/change_password_form.dart index e50e06b..302cf4a 100644 --- a/lib/presentation/auth/change_password/widgets/change_password_form.dart +++ b/lib/presentation/auth/change_password/widgets/change_password_form.dart @@ -1,17 +1,17 @@ import 'package:another_flushbar/flushbar_helper.dart'; -import 'package:flowers_app/assets/settings/common_settings.dart'; -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/auth/register_user.dart'; -import 'package:flowers_app/domain/auth/user_group.dart'; -import 'package:flowers_app/domain/auth/user_password.dart'; -import 'package:flowers_app/domain/auth/user_phone.dart'; -import 'package:flowers_app/domain/core/errors/failure.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; -import 'package:flowers_app/presentation/core/widgets/in_pogress_overlay.dart'; +import 'package:flower_app/assets/settings/common_settings.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/auth/register_user.dart'; +import 'package:flower_app/domain/auth/user_group.dart'; +import 'package:flower_app/domain/auth/user_password.dart'; +import 'package:flower_app/domain/auth/user_phone.dart'; +import 'package:flower_app/domain/core/errors/failure.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/widgets/in_pogress_overlay.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/src/core/result_new/result.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// class ChangePasswordForm extends StatefulWidget { diff --git a/lib/presentation/auth/register_user/register_user_page.dart b/lib/presentation/auth/register_user/register_user_page.dart index 0f3f592..4121739 100644 --- a/lib/presentation/auth/register_user/register_user_page.dart +++ b/lib/presentation/auth/register_user/register_user_page.dart @@ -1,6 +1,6 @@ -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/domain/auth/user_phone.dart'; -import 'package:flowers_app/presentation/auth/register_user/widgets/register_user_form.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/domain/auth/user_phone.dart'; +import 'package:flower_app/presentation/auth/register_user/widgets/register_user_form.dart'; import 'package:flutter/material.dart'; class RegisterUserPage extends StatelessWidget { diff --git a/lib/presentation/auth/register_user/widgets/register_user_form.dart b/lib/presentation/auth/register_user/widgets/register_user_form.dart index ea95108..314dc40 100644 --- a/lib/presentation/auth/register_user/widgets/register_user_form.dart +++ b/lib/presentation/auth/register_user/widgets/register_user_form.dart @@ -1,17 +1,17 @@ import 'package:another_flushbar/flushbar_helper.dart'; -import 'package:flowers_app/assets/settings/common_settings.dart'; -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/auth/register_user.dart'; -import 'package:flowers_app/domain/auth/user_group.dart'; -import 'package:flowers_app/domain/auth/user_password.dart'; -import 'package:flowers_app/domain/auth/user_phone.dart'; -import 'package:flowers_app/domain/core/errors/failure.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; -import 'package:flowers_app/presentation/core/widgets/in_pogress_overlay.dart'; +import 'package:flower_app/assets/settings/common_settings.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/auth/register_user.dart'; +import 'package:flower_app/domain/auth/user_group.dart'; +import 'package:flower_app/domain/auth/user_password.dart'; +import 'package:flower_app/domain/auth/user_phone.dart'; +import 'package:flower_app/domain/core/errors/failure.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/widgets/in_pogress_overlay.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// class RegisterUserForm extends StatefulWidget { diff --git a/lib/presentation/auth/sign_in/sign_in_page.dart b/lib/presentation/auth/sign_in/sign_in_page.dart index 210bed2..b2c5f89 100644 --- a/lib/presentation/auth/sign_in/sign_in_page.dart +++ b/lib/presentation/auth/sign_in/sign_in_page.dart @@ -1,7 +1,7 @@ -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/auth/authenticate.dart'; -import 'package:flowers_app/presentation/auth/sign_in/widgets/sign_in_form.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/auth/authenticate.dart'; +import 'package:flower_app/presentation/auth/sign_in/widgets/sign_in_form.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_log.dart'; /// diff --git a/lib/presentation/auth/sign_in/user_id_page.dart b/lib/presentation/auth/sign_in/user_id_page.dart index 42a7689..42af311 100644 --- a/lib/presentation/auth/sign_in/user_id_page.dart +++ b/lib/presentation/auth/sign_in/user_id_page.dart @@ -1,11 +1,11 @@ import 'package:another_flushbar/flushbar_helper.dart'; -import 'package:flowers_app/assets/settings/common_settings.dart'; -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/auth/user_phone.dart'; -import 'package:flowers_app/domain/core/timers/count_timer.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; +import 'package:flower_app/assets/settings/common_settings.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/auth/user_phone.dart'; +import 'package:flower_app/domain/core/timers/count_timer.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; import 'package:flutter/material.dart'; /// Класс проверяет пользователя по ID @@ -23,10 +23,11 @@ class UserIdPage extends StatefulWidget { _userPhone = userPhone; AppUser user() => _user; UserPhone userPhone() => _userPhone; + // @override - _UserIdPageState createState() => _UserIdPageState(); + State createState() => _UserIdPageState(); } - +// class _UserIdPageState extends State { static const _debug = false; bool _isLoading = true; diff --git a/lib/presentation/auth/sign_in/user_pass_page.dart b/lib/presentation/auth/sign_in/user_pass_page.dart index e6d6013..902f3ef 100644 --- a/lib/presentation/auth/sign_in/user_pass_page.dart +++ b/lib/presentation/auth/sign_in/user_pass_page.dart @@ -1,12 +1,12 @@ import 'package:another_flushbar/flushbar_helper.dart'; -import 'package:flowers_app/assets/settings/common_settings.dart'; -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/auth/user_password.dart'; -import 'package:flowers_app/domain/auth/user_phone.dart'; -import 'package:flowers_app/domain/core/timers/count_timer.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; +import 'package:flower_app/assets/settings/common_settings.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/auth/user_password.dart'; +import 'package:flower_app/domain/auth/user_phone.dart'; +import 'package:flower_app/domain/core/timers/count_timer.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; import 'package:flutter/material.dart'; /// /// Класс проверяет пользователя по ID @@ -33,7 +33,7 @@ class UserPassPage extends StatefulWidget { // // @override - _UserPassPageState createState() => _UserPassPageState(); + State createState() => _UserPassPageState(); } // // @@ -119,7 +119,9 @@ class _UserPassPageState extends State { const SizedBox(height: paddingValue), TextFormField( style: appThemeData.textTheme.bodyMedium, + autofocus: true, maxLength: _userPass.maxLength, + obscureText: true, decoration: const InputDecoration( prefixIcon: Icon( Icons.lock, @@ -136,6 +138,9 @@ class _UserPassPageState extends State { _userPass = UserPassword(value: value); }); }, + onFieldSubmitted: _allowResend + ? (_) => _verifyUserPass + : null, ), const SizedBox(height: paddingValue), SizedBox( diff --git a/lib/presentation/auth/sign_in/widgets/phone_number_widget.dart b/lib/presentation/auth/sign_in/widgets/phone_number_widget.dart index 6441ea7..0e05c11 100644 --- a/lib/presentation/auth/sign_in/widgets/phone_number_widget.dart +++ b/lib/presentation/auth/sign_in/widgets/phone_number_widget.dart @@ -1,22 +1,22 @@ -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/auth/user_phone.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/auth/user_phone.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; import 'package:flutter/material.dart'; class PhoneNumbetWidget extends StatefulWidget { final UserPhone? userPhone; final void Function(UserPhone)? onCompleted; const PhoneNumbetWidget({ - Key? key, + super.key, this.userPhone, this.onCompleted, - }) : super(key: key); - + }); + // @override - _PhoneNumbetWidgetState createState() => _PhoneNumbetWidgetState(); + State createState() => _PhoneNumbetWidgetState(); } - +// class _PhoneNumbetWidgetState extends State { static const _debug = false; late UserPhone _userPhone; @@ -43,6 +43,7 @@ class _PhoneNumbetWidgetState extends State { child: TextFormField( style: appThemeData.textTheme.bodyMedium, keyboardType: TextInputType.number, + autofocus: true, maxLength: 10, decoration: InputDecoration( prefixIcon: const Icon( @@ -62,6 +63,9 @@ class _PhoneNumbetWidgetState extends State { _userPhone = UserPhone(phone: phone); }); }, + onFieldSubmitted: _userPhone.validate().valid() + ? (_) => _onComplete + : null, ), ), const SizedBox(height: paddingValue), diff --git a/lib/presentation/auth/sign_in/widgets/sign_in_form.dart b/lib/presentation/auth/sign_in/widgets/sign_in_form.dart index 8781b3f..2f39209 100644 --- a/lib/presentation/auth/sign_in/widgets/sign_in_form.dart +++ b/lib/presentation/auth/sign_in/widgets/sign_in_form.dart @@ -1,18 +1,18 @@ import 'package:another_flushbar/flushbar_helper.dart'; -import 'package:flowers_app/assets/settings/common_settings.dart'; -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/auth/auth_result.dart'; -import 'package:flowers_app/domain/auth/authenticate.dart'; -import 'package:flowers_app/domain/auth/user_phone.dart'; -import 'package:flowers_app/presentation/auth/register_user/register_user_page.dart'; -import 'package:flowers_app/presentation/auth/sign_in/user_pass_page.dart'; -import 'package:flowers_app/presentation/auth/sign_in/widgets/phone_number_widget.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; -import 'package:flowers_app/presentation/core/widgets/in_pogress_overlay.dart'; +import 'package:flower_app/assets/settings/common_settings.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/auth/auth_result.dart'; +import 'package:flower_app/domain/auth/authenticate.dart'; +import 'package:flower_app/domain/auth/user_phone.dart'; +import 'package:flower_app/presentation/auth/register_user/register_user_page.dart'; +import 'package:flower_app/presentation/auth/sign_in/user_pass_page.dart'; +import 'package:flower_app/presentation/auth/sign_in/widgets/phone_number_widget.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/widgets/in_pogress_overlay.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// class SignInForm extends StatefulWidget { diff --git a/lib/presentation/core/widgets/button_with_loading_indicator.dart b/lib/presentation/core/widgets/button_with_loading_indicator.dart index e695345..2a2fe9c 100644 --- a/lib/presentation/core/widgets/button_with_loading_indicator.dart +++ b/lib/presentation/core/widgets/button_with_loading_indicator.dart @@ -1,7 +1,7 @@ -import 'package:flowers_app/presentation/core/widgets/sized_progress_indicator.dart'; +import 'package:flower_app/presentation/core/widgets/sized_progress_indicator.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_failure.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// class ButtonWithLoadingIndicator extends StatefulWidget { diff --git a/lib/presentation/core/widgets/count_button.dart b/lib/presentation/core/widgets/count_button.dart index 4bb3a23..494801e 100644 --- a/lib/presentation/core/widgets/count_button.dart +++ b/lib/presentation/core/widgets/count_button.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; import 'package:flutter/material.dart'; class CountButton extends StatefulWidget { diff --git a/lib/presentation/core/widgets/critical_error_widget.dart b/lib/presentation/core/widgets/critical_error_widget.dart index d5312ec..15c3ff6 100644 --- a/lib/presentation/core/widgets/critical_error_widget.dart +++ b/lib/presentation/core/widgets/critical_error_widget.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_log.dart'; /// diff --git a/lib/presentation/core/widgets/image_on_network.dart b/lib/presentation/core/widgets/image_on_network.dart index 04a8591..394fae5 100644 --- a/lib/presentation/core/widgets/image_on_network.dart +++ b/lib/presentation/core/widgets/image_on_network.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/presentation/core/widgets/sized_progress_indicator.dart'; +import 'package:flower_app/presentation/core/widgets/sized_progress_indicator.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_log.dart'; /// diff --git a/lib/presentation/core/widgets/in_pogress_overlay.dart b/lib/presentation/core/widgets/in_pogress_overlay.dart index b19d81c..be8c61e 100644 --- a/lib/presentation/core/widgets/in_pogress_overlay.dart +++ b/lib/presentation/core/widgets/in_pogress_overlay.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; import 'package:flutter/material.dart'; /// /// @@ -20,7 +20,7 @@ class InProgressOverlay extends StatelessWidget { child: AnimatedContainer( duration: const Duration(milliseconds: 150), color: _isSaving - ? appThemeData.colorScheme.secondary.withOpacity(0.8) + ? appThemeData.colorScheme.secondary.withValues(alpha: 0.8) : Colors.transparent, child: Visibility( visible: _isSaving, diff --git a/lib/presentation/core/widgets/remains_widget.dart b/lib/presentation/core/widgets/remains_widget.dart index e2fad82..1e7eabb 100644 --- a/lib/presentation/core/widgets/remains_widget.dart +++ b/lib/presentation/core/widgets/remains_widget.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; import 'package:flutter/material.dart'; class RemainsWidget extends StatelessWidget { diff --git a/lib/presentation/core/widgets/sized_progress_indicator.dart b/lib/presentation/core/widgets/sized_progress_indicator.dart index 5d52021..5d001c5 100644 --- a/lib/presentation/core/widgets/sized_progress_indicator.dart +++ b/lib/presentation/core/widgets/sized_progress_indicator.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; import 'package:flutter/material.dart'; /// /// CircularProgressIndicator wrapped into SizedBox diff --git a/lib/presentation/notice/build_notice_icon.dart b/lib/presentation/notice/build_notice_icon.dart new file mode 100644 index 0000000..96c3d43 --- /dev/null +++ b/lib/presentation/notice/build_notice_icon.dart @@ -0,0 +1,27 @@ +import 'package:flower_app/domain/notice/notice.dart'; +import 'package:flutter/material.dart'; + +/// +/// +Widget buildNoticeIcon({ + required BuildContext context, + required Notice? notice, + required bool hasError, + required bool hasNotRead, + Color? errorColor, + double? size, +}) { + return Icon( + hasError || notice == null + ? Icons.error_outline + : notice.isEmpty + ? Icons.messenger_outline + : Icons.message_outlined, + size: size, + color: hasError + ? errorColor ?? Theme.of(context).colorScheme.error + : hasNotRead + ? Colors.blue + : Colors.grey, + ); +} diff --git a/lib/presentation/notice/notice_overview_page.dart b/lib/presentation/notice/notice_overview_page.dart index 87e2e27..551863e 100644 --- a/lib/presentation/notice/notice_overview_page.dart +++ b/lib/presentation/notice/notice_overview_page.dart @@ -1,8 +1,8 @@ -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/notice/notice_list.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/purchase/purchase_item.dart'; -import 'package:flowers_app/presentation/notice/widgets/notice_overview_body.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/notice/notice_list.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/purchase/purchase_item.dart'; +import 'package:flower_app/presentation/notice/widgets/notice_overview_body.dart'; import 'package:flutter/material.dart'; /// /// @@ -42,7 +42,7 @@ class NoticeOverviewPage extends StatelessWidget { ), body: NoticeOverviewBody( // user: user, - purchaseContentId: product.id, + purchaseItemId: product.id, noticeList: _noticeList, enableUserMessage: false, noticeListViewed: _noticeListViewed, diff --git a/lib/presentation/notice/widgets/notice_card.dart b/lib/presentation/notice/widgets/notice_card.dart index 1e2f9cc..251ec14 100644 --- a/lib/presentation/notice/widgets/notice_card.dart +++ b/lib/presentation/notice/widgets/notice_card.dart @@ -1,6 +1,6 @@ -import 'package:flowers_app/domain/notice/notice.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; +import 'package:flower_app/domain/notice/notice.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; import 'package:flutter/material.dart'; import 'package:visibility_detector/visibility_detector.dart'; /// @@ -48,7 +48,7 @@ class _NoticeCardState extends State { if (info.visibleFraction == 1) { widget.noticeListViewed.setViewed( noticeId: notice.id, - purchaseContentId: notice.purchaseContentId, + purchaseItemId: notice.purchaseItemId, ); } }, diff --git a/lib/presentation/notice/widgets/notice_overview_body.dart b/lib/presentation/notice/widgets/notice_overview_body.dart index 8c947a3..2b45eaa 100644 --- a/lib/presentation/notice/widgets/notice_overview_body.dart +++ b/lib/presentation/notice/widgets/notice_overview_body.dart @@ -1,26 +1,26 @@ -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/notice/notice.dart'; -import 'package:flowers_app/domain/notice/notice_list.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; -import 'package:flowers_app/presentation/core/widgets/critical_error_widget.dart'; -import 'package:flowers_app/presentation/core/widgets/in_pogress_overlay.dart'; -import 'package:flowers_app/presentation/notice/widgets/notice_card.dart'; -import 'package:flowers_app/presentation/purchase/purchase_overview/widgets/error_purchase_card.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/notice/notice.dart'; +import 'package:flower_app/domain/notice/notice_list.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/widgets/critical_error_widget.dart'; +import 'package:flower_app/presentation/core/widgets/in_pogress_overlay.dart'; +import 'package:flower_app/presentation/notice/widgets/notice_card.dart'; +import 'package:flower_app/presentation/purchase/purchase_overview/widgets/error_purchase_card.dart'; import 'package:flutter/material.dart'; class NoticeOverviewBody extends StatelessWidget { static const _debug = false; final bool enableUserMessage; final NoticeList noticeList; - final String purchaseContentId; + final String purchaseItemId; final NoticeListViewed _noticeListViewed; /// /// const NoticeOverviewBody({ super.key, - required this.purchaseContentId, + required this.purchaseItemId, required this.noticeList, required this.enableUserMessage, required NoticeListViewed noticeListViewed, @@ -31,11 +31,11 @@ class NoticeOverviewBody extends StatelessWidget { @override Widget build(BuildContext context) { return FutureBuilder>( - future: noticeList.refresh(NoticeListSqlParams(purchaseContentId: purchaseContentId)), + future: noticeList.refresh(NoticeListSqlParams(purchaseItemId: purchaseItemId)), builder:(context, snapshot) { return RefreshIndicator( displacement: 20.0, - onRefresh: () => noticeList.refresh(NoticeListSqlParams(purchaseContentId: purchaseContentId)), + onRefresh: () => noticeList.refresh(NoticeListSqlParams(purchaseItemId: purchaseItemId)), child: _buildListViewWidget(context, snapshot), ); },); @@ -51,7 +51,7 @@ class NoticeOverviewBody extends StatelessWidget { log(_debug, '[$NoticeOverviewBody._buildListView] snapshot hasError'); return CriticalErrorWidget( message: snapshot.error.toString(), - refresh: () => noticeList.refresh(NoticeListSqlParams(purchaseContentId: purchaseContentId)), + refresh: () => noticeList.refresh(NoticeListSqlParams(purchaseItemId: purchaseItemId)), ); } else if (snapshot.hasData) { log(_debug, '[$NoticeOverviewBody._buildListView] snapshot hasData'); diff --git a/lib/presentation/product/product_page.dart b/lib/presentation/product/product_page.dart index f2f35e3..bc8046f 100644 --- a/lib/presentation/product/product_page.dart +++ b/lib/presentation/product/product_page.dart @@ -1,8 +1,8 @@ -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/notice/notice_list.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/purchase/purchase_item.dart'; -import 'package:flowers_app/presentation/product/widgets/product_body.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/notice/notice_list.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/purchase/purchase_item.dart'; +import 'package:flower_app/presentation/product/widgets/product_body.dart'; import 'package:flutter/material.dart'; /// /// Displays a detailed info about the PurchaseItem diff --git a/lib/presentation/product/widgets/product_body.dart b/lib/presentation/product/widgets/product_body.dart index 838f45c..4c4ae73 100644 --- a/lib/presentation/product/widgets/product_body.dart +++ b/lib/presentation/product/widgets/product_body.dart @@ -1,8 +1,8 @@ -import 'package:flowers_app/domain/notice/notice_list.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/purchase/purchase_item.dart'; -import 'package:flowers_app/presentation/product/widgets/product_card.dart'; -import 'package:flowers_app/presentation/product/widgets/product_card_with_notices.dart'; +import 'package:flower_app/domain/notice/notice_list.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/purchase/purchase_item.dart'; +import 'package:flower_app/presentation/product/widgets/product_card.dart'; +import 'package:flower_app/presentation/product/widgets/product_card_with_notices.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_log.dart'; /// @@ -38,10 +38,6 @@ class ProductBody extends StatelessWidget { purchaseItem: purchaseItem, noticeList: notices, noticeListViewed: _noticeListViewed, - hasNotRead: notices.hasNew( - fieldName: 'purchase_content_id', - value: purchaseItem.id, - ), ); } else { _log.debug('.build | using ProductCard'); diff --git a/lib/presentation/product/widgets/product_card.dart b/lib/presentation/product/widgets/product_card.dart index 90c2cc5..6aa48a3 100644 --- a/lib/presentation/product/widgets/product_card.dart +++ b/lib/presentation/product/widgets/product_card.dart @@ -1,10 +1,10 @@ -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/domain/purchase/purchase_item.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; -import 'package:flowers_app/presentation/core/widgets/in_pogress_overlay.dart'; -import 'package:flowers_app/presentation/core/widgets/remains_widget.dart'; -import 'package:flowers_app/presentation/product/widgets/product_image_widget.dart'; -import 'package:flowers_app/presentation/product/widgets/set_order_widget.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/domain/purchase/purchase_item.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/widgets/in_pogress_overlay.dart'; +import 'package:flower_app/presentation/core/widgets/remains_widget.dart'; +import 'package:flower_app/presentation/product/widgets/product_image_widget.dart'; +import 'package:flower_app/presentation/product/widgets/set_order_widget.dart'; import 'package:flutter/material.dart'; /// /// Displays a detailed info about the PurchaseItem @@ -130,7 +130,7 @@ class _ProductCardState extends State { const SizedBox(width: 8.0,), SetOrderWidget( customerId: widget.customerId, - product: product, + purchaseItem: product, onComplete: () => refreshPurchaseItem(), ), ], diff --git a/lib/presentation/product/widgets/product_card_with_notices.dart b/lib/presentation/product/widgets/product_card_with_notices.dart index ee6e369..3963757 100644 --- a/lib/presentation/product/widgets/product_card_with_notices.dart +++ b/lib/presentation/product/widgets/product_card_with_notices.dart @@ -1,15 +1,16 @@ -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/domain/notice/notice.dart'; -import 'package:flowers_app/domain/notice/notice_list.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/order/order.dart'; -import 'package:flowers_app/domain/purchase/purchase_item.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; -import 'package:flowers_app/presentation/core/widgets/in_pogress_overlay.dart'; -import 'package:flowers_app/presentation/core/widgets/remains_widget.dart'; -import 'package:flowers_app/presentation/notice/widgets/notice_overview_body.dart'; -import 'package:flowers_app/presentation/product/widgets/product_image_widget.dart'; -import 'package:flowers_app/presentation/product/widgets/set_order_widget.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/domain/notice/notice.dart'; +import 'package:flower_app/domain/notice/notice_list.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/order/order.dart'; +import 'package:flower_app/domain/purchase/purchase_item.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/widgets/in_pogress_overlay.dart'; +import 'package:flower_app/presentation/core/widgets/remains_widget.dart'; +import 'package:flower_app/presentation/notice/build_notice_icon.dart'; +import 'package:flower_app/presentation/notice/widgets/notice_overview_body.dart'; +import 'package:flower_app/presentation/product/widgets/product_image_widget.dart'; +import 'package:flower_app/presentation/product/widgets/set_order_widget.dart'; import 'package:flutter/material.dart'; /// /// @@ -18,7 +19,6 @@ class ProductCardWithNotices extends StatefulWidget { final PurchaseItem purchaseItem; final NoticeList _noticeList; final NoticeListViewed noticeListViewed; - final Future hasNotRead; /// /// @@ -27,7 +27,6 @@ class ProductCardWithNotices extends StatefulWidget { required this.customerId, required this.purchaseItem, NoticeList? noticeList, - required this.hasNotRead, required this.noticeListViewed, }) : _noticeList = noticeList ?? NoticeList.empty(); @@ -60,10 +59,9 @@ class _ProductCardWithNoticesState extends State { setState(() { _isLoading = true; }); - widget - ._noticeList + widget._noticeList .last( - fieldName: 'purchase_content_id', + fieldName: 'purchase_item_id', value: widget.purchaseItem.id, ) .then((value) { @@ -76,7 +74,11 @@ class _ProductCardWithNoticesState extends State { _lastNoticeHasError = true; }); }); - widget.hasNotRead + widget._noticeList + .hasNew( + fieldName: 'purchase_item_id', + value: widget.purchaseItem.id, + ) .then((value) { setState(() { _hasNotRead = value; @@ -167,7 +169,7 @@ class _ProductCardWithNoticesState extends State { const SizedBox(width: 8.0,), SetOrderWidget( customerId: widget.customerId, - product: product, + purchaseItem: product, onComplete: () => refreshPurchaseItem(), ), ], @@ -236,7 +238,7 @@ class _ProductCardWithNoticesState extends State { padding: const EdgeInsets.only(left: 16.0, top: 16.0, right: 16.0, bottom: 16,), child: NoticeOverviewBody( // user: user, - purchaseContentId: product.id, + purchaseItemId: product.id, noticeList: widget._noticeList, enableUserMessage: false, noticeListViewed: widget.noticeListViewed, @@ -290,18 +292,13 @@ class _ProductCardWithNoticesState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - _lastNoticeHasError - ? Icons.error_outline - : _lastNotice.isEmpty - ? Icons.messenger_outline - : Icons.message_outlined, + buildNoticeIcon( + context: context, + notice: _lastNotice, + hasError: _lastNoticeHasError, + hasNotRead: _hasNotRead, + errorColor: appThemeData.colorScheme.error, size: baseFontSize * 1.3, - color: _lastNoticeHasError - ? appThemeData.colorScheme.error - : _hasNotRead - ? Colors.blue - : Colors.grey, ), const SizedBox(width: 4.0,), Expanded( diff --git a/lib/presentation/product/widgets/product_image_widget.dart b/lib/presentation/product/widgets/product_image_widget.dart index 7f33100..cc5204a 100644 --- a/lib/presentation/product/widgets/product_image_widget.dart +++ b/lib/presentation/product/widgets/product_image_widget.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/presentation/core/widgets/image_on_network.dart'; +import 'package:flower_app/presentation/core/widgets/image_on_network.dart'; import 'package:flutter/material.dart'; /// /// Shows Picture in the ProductCard / PurchaseContentCard diff --git a/lib/presentation/product/widgets/set_order_widget.dart b/lib/presentation/product/widgets/set_order_widget.dart index c64c63d..ebfbf73 100644 --- a/lib/presentation/product/widgets/set_order_widget.dart +++ b/lib/presentation/product/widgets/set_order_widget.dart @@ -1,20 +1,20 @@ -import 'package:flowers_app/domain/order/order.dart'; -import 'package:flowers_app/domain/purchase/purchase_item.dart'; -import 'package:flowers_app/domain/purchase/purchase_set_order.dart'; -import 'package:flowers_app/presentation/core/widgets/button_with_loading_indicator.dart'; -import 'package:flowers_app/presentation/core/widgets/count_button.dart'; -import 'package:flowers_app/presentation/core/widgets/sized_progress_indicator.dart'; +import 'package:flower_app/domain/order/order.dart'; +import 'package:flower_app/domain/purchase/purchase_item.dart'; +import 'package:flower_app/domain/purchase/purchase_set_order.dart'; +import 'package:flower_app/presentation/core/widgets/button_with_loading_indicator.dart'; +import 'package:flower_app/presentation/core/widgets/count_button.dart'; +import 'package:flower_app/presentation/core/widgets/sized_progress_indicator.dart'; import 'package:flutter/material.dart'; +import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/src/core/error/failure.dart'; -import 'package:hmi_core/src/core/result_new/result.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// class SetOrderWidget extends StatefulWidget { final int min; final int? max; final String customerId; - final PurchaseItem product; + final PurchaseItem purchaseItem; final Function()? onComplete; /// /// @@ -23,7 +23,7 @@ class SetOrderWidget extends StatefulWidget { this.min = 0, this.max, required this.customerId, - required this.product, + required this.purchaseItem, this.onComplete, }); // @@ -35,7 +35,7 @@ class SetOrderWidget extends StatefulWidget { // class _SetOrderWidgetState extends State { static const _log = Log('_SetOrderWidgetState'); - bool _isLoadingOrderCount = false; + bool _isLoadingOrderCount = true; late final int _count; int _orderCount = 0; final Order _order = Order(); @@ -47,7 +47,7 @@ class _SetOrderWidgetState extends State { setState(() { _isLoadingOrderCount = true; }); - _order.fetch(params: OrderSqlParams(customerId: widget.customerId, purchaseContentId: widget.product.id)).then((result) { + _order.fetch(params: OrderSqlParams(customerId: widget.customerId, purchaseItemId: widget.purchaseItem.id)).then((result) { switch (result) { case Ok(value :final order): setState(() { @@ -59,6 +59,7 @@ class _SetOrderWidgetState extends State { _log.debug(".initState.widget.product.fetch.then | Error : $error"); setState(() { _isLoadingOrderCount = false; + _count = 0; }); } }); @@ -69,9 +70,9 @@ class _SetOrderWidgetState extends State { // @override Widget build(BuildContext context) { - _log.debug(".build | PurchaseItem: ${widget.product.id} '${widget.product.product_name}' (${widget.product.product_id})"); + _log.debug(".build | PurchaseItem: ${widget.purchaseItem.id} '${widget.purchaseItem.product_name}' (${widget.purchaseItem.product_id})"); _log.debug(".build | widget.max: ${widget.max}, widget.product.count: ${_order.count}"); - if (widget.product.status.isOrder()) { + if (widget.purchaseItem.status.isOrder()) { return Column( mainAxisSize: MainAxisSize.min, children: [ @@ -86,7 +87,7 @@ class _SetOrderWidgetState extends State { else CountButton( min: widget.min, - max: widget.max ?? _count + widget.product.remains, + max: widget.max ?? _count + widget.purchaseItem.remains, initialCount: _order.count, disabled: _isLoadingOrderCount, onChange: (count) => _orderCount = count, @@ -98,7 +99,7 @@ class _SetOrderWidgetState extends State { child: ButtonWithLoadingIndicator( width: 110.0, height: 32.0, - onSubmit: () => PurchaseSetOrder(customerId: widget.customerId).send('$_orderCount', widget.product.id) + onSubmit: () => PurchaseSetOrder(customerId: widget.customerId).send('$_orderCount', widget.purchaseItem.id) .then((result) { switch (result) { case Ok, Failure>(value: final _): @@ -157,8 +158,8 @@ class _SetOrderWidgetState extends State { 'приостановлены', ), Text( - style: style.copyWith(color: color?.withOpacity(0.5)), - widget.product.status.text(), + style: style.copyWith(color: color?.withValues(alpha: 0.5)), + widget.purchaseItem.status.text(), ), ], ); diff --git a/lib/presentation/purchase/purchase_content/purchase_content_page.dart b/lib/presentation/purchase/purchase_item/purchase_items_page.dart similarity index 63% rename from lib/presentation/purchase/purchase_content/purchase_content_page.dart rename to lib/presentation/purchase/purchase_item/purchase_items_page.dart index d0a6b04..8e688a1 100644 --- a/lib/presentation/purchase/purchase_content/purchase_content_page.dart +++ b/lib/presentation/purchase/purchase_item/purchase_items_page.dart @@ -1,15 +1,16 @@ -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/purchase/purchase.dart'; -import 'package:flowers_app/domain/purchase/purchase_content.dart'; -import 'package:flowers_app/presentation/purchase/purchase_content/widgets/purchase_content_body.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/purchase/purchase.dart'; +import 'package:flower_app/domain/purchase/purchase_items.dart'; +import 'package:flower_app/presentation/purchase/purchase_item/widgets/purchase_items_body.dart'; import 'package:flutter/material.dart'; - -class PurchaseContentPage extends StatelessWidget { +/// +/// +class PurchaseItemsPage extends StatelessWidget { final AppUser user; final Purchase purchase; final NoticeListViewed _noticeListViewed; - const PurchaseContentPage({ + const PurchaseItemsPage({ super.key, required this.user, required this.purchase, @@ -37,9 +38,9 @@ class PurchaseContentPage extends StatelessWidget { automaticallyImplyLeading: false, ), body: Center( - child: PurchaseContentBody( + child: PurchaseItemsBody( user: user, - purchaseContent: PurchaseContent(purchaseId: purchase.id), + purchaseItems: PurchaseItems(purchaseId: purchase.id), noticeListViewed: _noticeListViewed, ), ), diff --git a/lib/presentation/purchase/purchase_content/widgets/purchase_content_card.dart b/lib/presentation/purchase/purchase_item/widgets/purchase_item_card.dart similarity index 72% rename from lib/presentation/purchase/purchase_content/widgets/purchase_content_card.dart rename to lib/presentation/purchase/purchase_item/widgets/purchase_item_card.dart index ed8347c..08c71da 100644 --- a/lib/presentation/purchase/purchase_content/widgets/purchase_content_card.dart +++ b/lib/presentation/purchase/purchase_item/widgets/purchase_item_card.dart @@ -1,24 +1,25 @@ -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/notice/notice_list.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/purchase/purchase_item.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; -import 'package:flowers_app/presentation/core/widgets/remains_widget.dart'; -import 'package:flowers_app/presentation/product/product_page.dart'; -import 'package:flowers_app/presentation/product/widgets/product_image_widget.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/notice/notice_list.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/purchase/purchase_item.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/widgets/remains_widget.dart'; +import 'package:flower_app/presentation/notice/build_notice_icon.dart'; +import 'package:flower_app/presentation/product/product_page.dart'; +import 'package:flower_app/presentation/product/widgets/product_image_widget.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_log.dart'; /// /// -class PurchaseContentCard extends StatelessWidget { - static const _log = Log('PurchaseContentCard'); +class PurchaseItemCard extends StatelessWidget { + static const _log = Log('PurchaseItemCard'); final AppUser _user; final PurchaseItem purchaseItem; final NoticeList _noticeList; final NoticeListViewed _noticeListViewed; /// /// - PurchaseContentCard({ + PurchaseItemCard({ super.key, required AppUser user, required this.purchaseItem, @@ -71,6 +72,35 @@ class PurchaseContentCard extends StatelessWidget { ), ), ), + Positioned( + right: 16.0, + bottom: 64.0, + width: 42.0, + height: 42.0, + child: Center( + child: FutureBuilder( + future: Future.wait([ + _noticeList.last( + fieldName: 'purchase_item_id', + value: purchaseItem.id, + ), + _noticeList.hasNew( + fieldName: 'purchase_item_id', + value: purchaseItem.id, + ), + ]), + builder: (BuildContext context, AsyncSnapshot snapshot) { + return buildNoticeIcon( + context: context, + notice: snapshot.data?[0], + hasError: snapshot.hasError, + hasNotRead: snapshot.data?[1] ?? false, + size: 23.0, + ); + } + ), + ), + ), Positioned( right: 16.0, bottom: 16.0, diff --git a/lib/presentation/purchase/purchase_content/widgets/purchase_content_body.dart b/lib/presentation/purchase/purchase_item/widgets/purchase_items_body.dart similarity index 56% rename from lib/presentation/purchase/purchase_content/widgets/purchase_content_body.dart rename to lib/presentation/purchase/purchase_item/widgets/purchase_items_body.dart index 8f40d69..3c77401 100644 --- a/lib/presentation/purchase/purchase_content/widgets/purchase_content_body.dart +++ b/lib/presentation/purchase/purchase_item/widgets/purchase_items_body.dart @@ -1,26 +1,27 @@ -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/purchase/purchase_content.dart'; -import 'package:flowers_app/domain/purchase/purchase_item.dart'; -import 'package:flowers_app/presentation/core/widgets/critical_error_widget.dart'; -import 'package:flowers_app/presentation/core/widgets/in_pogress_overlay.dart'; -import 'package:flowers_app/presentation/purchase/purchase_content/widgets/purchase_content_card.dart'; -import 'package:flowers_app/presentation/purchase/purchase_overview/widgets/error_purchase_card.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/core/translate/translate.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/purchase/purchase_items.dart'; +import 'package:flower_app/domain/purchase/purchase_item.dart'; +import 'package:flower_app/presentation/core/widgets/critical_error_widget.dart'; +import 'package:flower_app/presentation/core/widgets/in_pogress_overlay.dart'; +import 'package:flower_app/presentation/purchase/purchase_item/widgets/purchase_item_card.dart'; +import 'package:flower_app/presentation/purchase/purchase_overview/widgets/error_purchase_card.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// The list of PurchaseItem's -class PurchaseContentBody extends StatelessWidget { - static const _log = Log('PurchaseContentBody'); +class PurchaseItemsBody extends StatelessWidget { + static const _log = Log('PurchaseItemBody'); final AppUser _user; - final PurchaseContent purchaseContent; + final PurchaseItems purchaseItems; final NoticeListViewed _noticeListViewed; - const PurchaseContentBody({ + const PurchaseItemsBody({ super.key, required AppUser user, - required this.purchaseContent, + required this.purchaseItems, required NoticeListViewed noticeListViewed, }) : _user = user, @@ -30,11 +31,11 @@ class PurchaseContentBody extends StatelessWidget { @override Widget build(BuildContext context) { return FutureBuilder, Failure>>( - future: purchaseContent.fetch(), + future: purchaseItems.fetch(), builder: (context, snapshot) { return RefreshIndicator( displacement: 20.0, - onRefresh: purchaseContent.refresh, + onRefresh: purchaseItems.refresh, child: _buildListViewWidget(context, snapshot), ); }, @@ -58,17 +59,33 @@ class PurchaseContentBody extends StatelessWidget { ); case Ok, Failure>(value: final map): _log.debug('._buildListViewWidget | Data map received'); - final products = map.values.toList(); + final purchaseItems = map.values.toList(); + if (purchaseItems.isEmpty) { + return Column( + mainAxisSize: MainAxisSize.min, // это оцентрирует по верикали + children: [ + Text( + 'No products added yet'.inRu, + textAlign: TextAlign.center, + ), + const SizedBox(height: 4,), + TextButton( + onPressed: () {}, + child: Text('Reload'.inRu) + ), + ], + ); + } return Scrollbar( child: ListView.builder( physics: const AlwaysScrollableScrollPhysics(), - itemCount: products.length, + itemCount: purchaseItems.length, itemBuilder: (context, index) { - final product = products[index]; - if (product.valid) { - return PurchaseContentCard( + final purchaseItem = purchaseItems[index]; + if (purchaseItem.valid) { + return PurchaseItemCard( user: _user, - purchaseItem: product, + purchaseItem: purchaseItem, noticeListViewed: _noticeListViewed, ); } else { @@ -81,14 +98,14 @@ class PurchaseContentBody extends StatelessWidget { _log.warning('._buildListViewWidget | Error received: $error'); return CriticalErrorWidget( message: snapshot.error.toString(), - refresh: purchaseContent.refresh, + refresh: purchaseItems.refresh, ); } } else if (snapshot.hasError) { _log.warning('._buildListViewWidget | snapshot - hasError: ${snapshot.error}'); return CriticalErrorWidget( message: snapshot.error.toString(), - refresh: purchaseContent.refresh, + refresh: purchaseItems.refresh, ); } return const InProgressOverlay( diff --git a/lib/presentation/purchase/purchase_overview/purchase_overview_page.dart b/lib/presentation/purchase/purchase_overview/purchase_overview_page.dart index 0496ec7..a2a5ee0 100644 --- a/lib/presentation/purchase/purchase_overview/purchase_overview_page.dart +++ b/lib/presentation/purchase/purchase_overview/purchase_overview_page.dart @@ -1,14 +1,14 @@ -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/auth/user_group.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/purchase/purchase_list.dart'; -import 'package:flowers_app/domain/purchase/purchase_list_filtered.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; -import 'package:flowers_app/presentation/core/widgets/icons.dart'; -import 'package:flowers_app/presentation/purchase/purchase_overview/widgets/popup_menu_btn.dart'; -import 'package:flowers_app/presentation/purchase/purchase_overview/widgets/purchase_overview_body.dart'; -import 'package:flowers_app/presentation/user_account/user_account_page.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/auth/user_group.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/purchase/purchase_list.dart'; +import 'package:flower_app/domain/purchase/purchase_list_filtered.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/widgets/icons.dart'; +import 'package:flower_app/presentation/purchase/purchase_overview/widgets/popup_menu_btn.dart'; +import 'package:flower_app/presentation/purchase/purchase_overview/widgets/purchase_overview_body.dart'; +import 'package:flower_app/presentation/user_account/user_account_page.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_log.dart'; /// @@ -153,8 +153,6 @@ class _PurchaseOverviewPageState extends State { return ['archived',]; case ViewFilter.canceled: return ['canceled',]; - default: - return ['active',]; } } } diff --git a/lib/presentation/purchase/purchase_overview/widgets/error_purchase_card.dart b/lib/presentation/purchase/purchase_overview/widgets/error_purchase_card.dart index 82f4e45..71c2c5a 100644 --- a/lib/presentation/purchase/purchase_overview/widgets/error_purchase_card.dart +++ b/lib/presentation/purchase/purchase_overview/widgets/error_purchase_card.dart @@ -1,5 +1,5 @@ -import 'package:flowers_app/assets/settings/common_settings.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; +import 'package:flower_app/assets/settings/common_settings.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; import 'package:flutter/material.dart'; /// /// diff --git a/lib/presentation/purchase/purchase_overview/widgets/popup_menu_btn.dart b/lib/presentation/purchase/purchase_overview/widgets/popup_menu_btn.dart index b6833ef..d418ae2 100644 --- a/lib/presentation/purchase/purchase_overview/widgets/popup_menu_btn.dart +++ b/lib/presentation/purchase/purchase_overview/widgets/popup_menu_btn.dart @@ -1,7 +1,7 @@ -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/auth/user_group.dart'; -import 'package:flowers_app/domain/purchase/purchase_status.dart'; -import 'package:flowers_app/presentation/purchase/purchase_overview/purchase_overview_page.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/auth/user_group.dart'; +import 'package:flower_app/domain/purchase/purchase_status.dart'; +import 'package:flower_app/presentation/purchase/purchase_overview/purchase_overview_page.dart'; import 'package:flutter/material.dart'; class ViewFilterPopupMenuBtn extends StatefulWidget { diff --git a/lib/presentation/purchase/purchase_overview/widgets/purchase_card.dart b/lib/presentation/purchase/purchase_overview/widgets/purchase_card.dart index bcbcd7a..629d457 100644 --- a/lib/presentation/purchase/purchase_overview/widgets/purchase_card.dart +++ b/lib/presentation/purchase/purchase_overview/widgets/purchase_card.dart @@ -1,10 +1,12 @@ -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/purchase/purchase.dart'; -import 'package:flowers_app/domain/purchase/purchase_status.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; -import 'package:flowers_app/presentation/purchase/purchase_content/purchase_content_page.dart'; -import 'package:flowers_app/presentation/purchase/purchase_overview/widgets/purchase_image_widget.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/notice/notice_list.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/purchase/purchase.dart'; +import 'package:flower_app/domain/purchase/purchase_status.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/notice/build_notice_icon.dart'; +import 'package:flower_app/presentation/purchase/purchase_item/purchase_items_page.dart'; +import 'package:flower_app/presentation/purchase/purchase_overview/widgets/purchase_image_widget.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_log.dart'; /// @@ -31,12 +33,14 @@ class PurchaseCard extends StatefulWidget { class _PurchaseCardState extends State { static const _log = Log('_PurchaseCardState'); bool _expanded = false; - late NoticeListViewed _noticeListViewed; + late final NoticeList _noticeList; + late final NoticeListViewed _noticeListViewed; // // @override void initState() { _noticeListViewed = widget.noticeListViewed; + _noticeList = NoticeList(noticeListViewed: _noticeListViewed); super.initState(); } // @@ -50,7 +54,7 @@ class _PurchaseCardState extends State { onTap: () { Navigator.of(context).push( MaterialPageRoute( - builder: (context) => PurchaseContentPage( + builder: (context) => PurchaseItemsPage( user: widget.user, purchase: widget.purchase, noticeListViewed: _noticeListViewed, @@ -62,7 +66,40 @@ class _PurchaseCardState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PurchaseImageWidget(url: widget.purchase.picture), + Stack( + children: [ + PurchaseImageWidget(url: widget.purchase.picture), + Positioned( + right: 16.0, + bottom: 64.0, + width: 42.0, + height: 42.0, + child: Center( + child: FutureBuilder( + future: Future.wait([ + _noticeList.last( + fieldName: 'purchase_id', + value: widget.purchase.id, + ), + _noticeList.hasNew( + fieldName: 'purchase_id', + value: widget.purchase.id, + ), + ]), + builder: (BuildContext context, AsyncSnapshot snapshot) { + return buildNoticeIcon( + context: context, + notice: snapshot.data?[0], + hasError: snapshot.hasError, + hasNotRead: snapshot.data?[1] ?? false, + size: 32.0, + ); + } + ), + ), + ), + ] + ), ExpansionPanelList( animationDuration: const Duration(milliseconds: 1000), elevation: 0.0, diff --git a/lib/presentation/purchase/purchase_overview/widgets/purchase_image_widget.dart b/lib/presentation/purchase/purchase_overview/widgets/purchase_image_widget.dart index 0736943..90698e0 100644 --- a/lib/presentation/purchase/purchase_overview/widgets/purchase_image_widget.dart +++ b/lib/presentation/purchase/purchase_overview/widgets/purchase_image_widget.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/presentation/core/widgets/image_on_network.dart'; +import 'package:flower_app/presentation/core/widgets/image_on_network.dart'; import 'package:flutter/material.dart'; class PurchaseImageWidget extends StatelessWidget { diff --git a/lib/presentation/purchase/purchase_overview/widgets/purchase_overview_body.dart b/lib/presentation/purchase/purchase_overview/widgets/purchase_overview_body.dart index 64a642e..a5214ff 100644 --- a/lib/presentation/purchase/purchase_overview/widgets/purchase_overview_body.dart +++ b/lib/presentation/purchase/purchase_overview/widgets/purchase_overview_body.dart @@ -1,16 +1,16 @@ -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/purchase/purchase.dart'; -import 'package:flowers_app/domain/purchase/purchase_list_filtered.dart'; -import 'package:flowers_app/presentation/core/widgets/critical_error_widget.dart'; -import 'package:flowers_app/presentation/core/widgets/in_pogress_overlay.dart'; -import 'package:flowers_app/presentation/purchase/purchase_overview/widgets/error_purchase_card.dart'; -import 'package:flowers_app/presentation/purchase/purchase_overview/widgets/purchase_card.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/purchase/purchase.dart'; +import 'package:flower_app/domain/purchase/purchase_list_filtered.dart'; +import 'package:flower_app/presentation/core/widgets/critical_error_widget.dart'; +import 'package:flower_app/presentation/core/widgets/in_pogress_overlay.dart'; +import 'package:flower_app/presentation/purchase/purchase_overview/widgets/error_purchase_card.dart'; +import 'package:flower_app/presentation/purchase/purchase_overview/widgets/purchase_card.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// class PurchaseOverviewBody extends StatelessWidget { diff --git a/lib/presentation/user_account/user_account_page.dart b/lib/presentation/user_account/user_account_page.dart index 5fb9fc7..320f49a 100644 --- a/lib/presentation/user_account/user_account_page.dart +++ b/lib/presentation/user_account/user_account_page.dart @@ -1,11 +1,11 @@ -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/notice/notice_list.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/order/order_list.dart'; -import 'package:flowers_app/presentation/auth/change_password/change_password_page.dart'; -import 'package:flowers_app/presentation/user_account/widgets/order_overview_body.dart'; -import 'package:flowers_app/presentation/user_account/widgets/user_account_popup_menu_btn.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/notice/notice_list.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/order/order_list.dart'; +import 'package:flower_app/presentation/auth/change_password/change_password_page.dart'; +import 'package:flower_app/presentation/user_account/widgets/order_overview_body.dart'; +import 'package:flower_app/presentation/user_account/widgets/user_account_popup_menu_btn.dart'; import 'package:flutter/material.dart'; /// /// @@ -79,7 +79,7 @@ class UserAccountPage extends StatelessWidget { ), body: OrderOverviewBody( user: _user, - orderList: OrderList(), + orderList: OrderList(params: OrderListSqlParams(customerId: _user.id)), noticeList: NoticeList(noticeListViewed: _noticeListViewed), noticeListViewed: _noticeListViewed, ), diff --git a/lib/presentation/user_account/widgets/last_notice_tile.dart b/lib/presentation/user_account/widgets/last_notice_tile.dart index 05312ed..e5291f3 100644 --- a/lib/presentation/user_account/widgets/last_notice_tile.dart +++ b/lib/presentation/user_account/widgets/last_notice_tile.dart @@ -1,6 +1,6 @@ -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/domain/notice/notice.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/domain/notice/notice.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_log.dart'; import 'package:visibility_detector/visibility_detector.dart'; diff --git a/lib/presentation/user_account/widgets/order_card.dart b/lib/presentation/user_account/widgets/order_card.dart index 44560fc..fa7b968 100644 --- a/lib/presentation/user_account/widgets/order_card.dart +++ b/lib/presentation/user_account/widgets/order_card.dart @@ -1,17 +1,17 @@ -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/notice/notice.dart'; -import 'package:flowers_app/domain/notice/notice_list.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/order/order.dart'; -import 'package:flowers_app/domain/purchase/purchase_item.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; -import 'package:flowers_app/presentation/core/dialogs/delete_dialog.dart'; -import 'package:flowers_app/presentation/core/widgets/sized_progress_indicator.dart'; -import 'package:flowers_app/presentation/product/product_page.dart'; -import 'package:flowers_app/presentation/user_account/widgets/last_notice_tile.dart'; -import 'package:flowers_app/presentation/user_account/widgets/order_tile_image_widget.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/notice/notice.dart'; +import 'package:flower_app/domain/notice/notice_list.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/order/order.dart'; +import 'package:flower_app/domain/purchase/purchase_item.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; +import 'package:flower_app/presentation/core/dialogs/delete_dialog.dart'; +import 'package:flower_app/presentation/core/widgets/sized_progress_indicator.dart'; +import 'package:flower_app/presentation/product/product_page.dart'; +import 'package:flower_app/presentation/user_account/widgets/last_notice_tile.dart'; +import 'package:flower_app/presentation/user_account/widgets/order_tile_image_widget.dart'; import 'package:flutter/material.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// class OrderCard extends StatefulWidget { @@ -77,11 +77,11 @@ class _OrderCardState extends State { return InkWell( onTap: () { final product = PurchaseItem( - id: order.purchase_content_id, + id: order.purchaseItemId, ); - product.product_name = order.product_name; - product.purchase_id = order.purchase_id; - product.status = order.purchase_content_status; + product.product_name = order.product; + product.purchase_id = order.purchaseId; + product.status = order.purchaseItemStatus; Navigator.of(context).push( MaterialPageRoute( builder: (context) => ProductPage( @@ -119,7 +119,7 @@ class _OrderCardState extends State { child: Align( alignment: Alignment.centerLeft, child: OrderTileImageWidget( - url: order.product_picture, + url: order.productPicture, radius: 36.0, ), ), @@ -136,14 +136,14 @@ class _OrderCardState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - order.product_name, + order.product, softWrap: true, overflow: TextOverflow.visible, style: appThemeData.textTheme.titleSmall, ), const SizedBox(height: 8.0,), Text( - order.product_group, + order.productCategory, style: appThemeData.textTheme.bodySmall, ), const SizedBox(height: 12.0,), @@ -163,7 +163,7 @@ class _OrderCardState extends State { onPressed: () { showDeleteDialog( context, - Text(order.product_name), + Text(order.product), const Text('Удалить заказ ?'), ).then((result) { if (result != null && result) { @@ -187,7 +187,7 @@ class _OrderCardState extends State { left: 12.0, ), child: Text( - order.purchase_content_status.text(), + order.purchaseItemStatus.text(), ), ), Expanded( @@ -202,12 +202,12 @@ class _OrderCardState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - order.cost, + '${order.cost} ${order.currency}', style: appThemeData.textTheme.titleSmall, ), const SizedBox(height: 8,), Text( - '${order.count}x(${order.purchase_content_sale_price} + ${order.purchase_content_shipping})', + '${order.count} x (${order.purchaseItemSalePrice} + ${order.purchaseItemShipping})', style: appThemeData.textTheme.bodySmall, ), ], diff --git a/lib/presentation/user_account/widgets/order_header_card.dart b/lib/presentation/user_account/widgets/order_header_card.dart index 4540aa9..a79d5ed 100644 --- a/lib/presentation/user_account/widgets/order_header_card.dart +++ b/lib/presentation/user_account/widgets/order_header_card.dart @@ -1,21 +1,22 @@ -import 'package:flowers_app/domain/order/order_header.dart'; -import 'package:flowers_app/presentation/core/app_theme.dart'; +import 'package:flower_app/domain/order/order_header.dart'; +import 'package:flower_app/presentation/core/app_theme.dart'; import 'package:flutter/material.dart'; - +/// +/// Displays a total by customer's orders +/// in the customer's profile class OrderHeaderCard extends StatelessWidget { - final OrderHeader _orderHeader; + final OrderHeader orderHeader; const OrderHeaderCard({ - Key? key, - required OrderHeader orderHeader, - }) : - _orderHeader = orderHeader, - super(key: key); + super.key, + required this.orderHeader, + }); + // @override Widget build(BuildContext context) { return Card( // color: appThemeData.colorScheme.secondaryContainer, - color: appThemeData.colorScheme.background, - shadowColor: appThemeData.colorScheme.background, + color: appThemeData.colorScheme.surface, + shadowColor: appThemeData.colorScheme.surface, child: Padding( padding: const EdgeInsets.only( left: 32.0, @@ -27,18 +28,34 @@ class OrderHeaderCard extends StatelessWidget { children: [ Expanded( child: Text( - _orderHeader.purchaseName, + orderHeader.purchaseName, style: appThemeData.textTheme.titleSmall!.copyWith( - color: appThemeData.colorScheme.onBackground, + color: appThemeData.colorScheme.onSurface, ), ), ), - Text( - '${_orderHeader.total} (${_orderHeader.totalPrice} + ${_orderHeader.totalShipping})', - style: appThemeData.textTheme.titleSmall!.copyWith( - color: appThemeData.colorScheme.onBackground, - fontWeight: FontWeight.bold, - ), + Tooltip( + message: """Общая сумма за все заказы в данной закупке ${orderHeader.total.toStringAsFixed(2)} ${orderHeader.currency}, + суммарная стоимость товаров ${orderHeader.totalPrice.toStringAsFixed(2)} ${orderHeader.currency}, + суммарная стоимость доставки ${orderHeader.totalShipping.toStringAsFixed(2)} ${orderHeader.currency}""", + child: Column( + children: [ + Text( + '${orderHeader.total.toStringAsFixed(2)} ${orderHeader.currency}', + style: appThemeData.textTheme.titleSmall!.copyWith( + color: appThemeData.colorScheme.onSurface, + fontWeight: FontWeight.bold, + ), + ), + Text( + '(${orderHeader.totalPrice.toStringAsFixed(2)} + ${orderHeader.totalShipping.toStringAsFixed(2)})', + // style: appThemeData.textTheme.titleSmall!.copyWith( + // color: appThemeData.colorScheme.onSurface, + // fontWeight: FontWeight.bold, + // ), + ), + ], + ), ), ], ), diff --git a/lib/presentation/user_account/widgets/order_overview_body.dart b/lib/presentation/user_account/widgets/order_overview_body.dart index 0672ad2..726bbaf 100644 --- a/lib/presentation/user_account/widgets/order_overview_body.dart +++ b/lib/presentation/user_account/widgets/order_overview_body.dart @@ -1,19 +1,19 @@ -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/domain/auth/app_user.dart'; -import 'package:flowers_app/domain/notice/notice_list.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/domain/order/order.dart'; -import 'package:flowers_app/domain/order/order_header.dart'; -import 'package:flowers_app/domain/order/order_list.dart'; -import 'package:flowers_app/presentation/core/widgets/critical_error_widget.dart'; -import 'package:flowers_app/presentation/core/widgets/in_pogress_overlay.dart'; -import 'package:flowers_app/presentation/purchase/purchase_overview/widgets/error_purchase_card.dart'; -import 'package:flowers_app/presentation/user_account/widgets/order_card.dart'; -import 'package:flowers_app/presentation/user_account/widgets/order_header_card.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/domain/auth/app_user.dart'; +import 'package:flower_app/domain/notice/notice_list.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/domain/order/order.dart'; +import 'package:flower_app/domain/order/order_header.dart'; +import 'package:flower_app/domain/order/order_list.dart'; +import 'package:flower_app/presentation/core/widgets/critical_error_widget.dart'; +import 'package:flower_app/presentation/core/widgets/in_pogress_overlay.dart'; +import 'package:flower_app/presentation/purchase/purchase_overview/widgets/error_purchase_card.dart'; +import 'package:flower_app/presentation/user_account/widgets/order_card.dart'; +import 'package:flower_app/presentation/user_account/widgets/order_header_card.dart'; import 'package:flutter/material.dart'; import 'package:hmi_core/hmi_core_failure.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; /// /// class OrderOverviewBody extends StatelessWidget { @@ -54,10 +54,10 @@ class OrderOverviewBody extends StatelessWidget { /// Future _refreshAllLists() { return Future(() { - _log.debug('$OrderOverviewBody._refreshAllLists | orderList.refresh ...'); + _log.debug('._refreshAllLists | orderList.refresh ...'); _orderList.refresh() .then((value) { - _log.debug('$OrderOverviewBody._refreshAllLists | noticeList.refresh ...'); + _log.debug('._refreshAllLists | noticeList.refresh ...'); _noticeList.refresh(const NoticeListSqlParams()); }); }); @@ -70,7 +70,7 @@ class OrderOverviewBody extends StatelessWidget { ) { switch (snapshot.data) { case null: - _log.debug('$OrderOverviewBody._buildListView | is loading'); + _log.debug('._buildListView | is loading'); return const InProgressOverlay( isSaving: true, message: AppText.loading, @@ -80,8 +80,8 @@ class OrderOverviewBody extends StatelessWidget { OrderHeader? orderHeader; String orderPurchaseId = '-1'; for (final order in ordersMap.values) { - if (order.purchase_id != orderPurchaseId) { - orderPurchaseId = order.purchase_id; + if (order.purchaseId != orderPurchaseId) { + orderPurchaseId = order.purchaseId; orderHeader = OrderHeader( order: order, total: 0, @@ -97,7 +97,7 @@ class OrderOverviewBody extends StatelessWidget { } orders.add(order); } - _log.debug('$OrderOverviewBody._buildListView | orders received'); + _log.debug('._buildListView | orders received'); return Scrollbar( child: ListView.builder( physics: const AlwaysScrollableScrollPhysics(), @@ -116,12 +116,12 @@ class OrderOverviewBody extends StatelessWidget { order: order, noticeList: _noticeList, lastNotice: _noticeList.last( - fieldName: 'purchase_content_id', - value: order.purchase_content_id, + fieldName: 'purchase_item_id', + value: order.purchaseItemId, ), hasNotRead: _noticeList.hasNew( - fieldName: 'purchase_content_id', - value: order.purchase_content_id, + fieldName: 'purchase_item_id', + value: order.purchaseItemId, ), noticeListViewed: _noticeListViewed, onRemoved: () => _refreshAllLists(), @@ -134,7 +134,7 @@ class OrderOverviewBody extends StatelessWidget { ), ); case Err, Failure>(:final error): - _log.debug('$OrderOverviewBody._buildListView | Error: $error'); + _log.debug('._buildListView | Error: $error'); return CriticalErrorWidget( message: snapshot.error.toString(), refresh: _refreshAllLists, diff --git a/lib/presentation/user_account/widgets/order_tile_image_widget.dart b/lib/presentation/user_account/widgets/order_tile_image_widget.dart index 5fb6ef9..1b30fdb 100644 --- a/lib/presentation/user_account/widgets/order_tile_image_widget.dart +++ b/lib/presentation/user_account/widgets/order_tile_image_widget.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/presentation/core/widgets/image_on_network.dart'; +import 'package:flower_app/presentation/core/widgets/image_on_network.dart'; import 'package:flutter/material.dart'; class OrderTileImageWidget extends StatelessWidget { diff --git a/lib/presentation/user_account/widgets/user_account_popup_menu_btn.dart b/lib/presentation/user_account/widgets/user_account_popup_menu_btn.dart index bac4465..7ba6dbf 100644 --- a/lib/presentation/user_account/widgets/user_account_popup_menu_btn.dart +++ b/lib/presentation/user_account/widgets/user_account_popup_menu_btn.dart @@ -1,6 +1,6 @@ -import 'package:flowers_app/assets/texts/app_text.dart'; -import 'package:flowers_app/dev/log/log.dart'; -import 'package:flowers_app/presentation/core/widgets/icons.dart'; +import 'package:flower_app/assets/texts/app_text.dart'; +import 'package:flower_app/dev/log/log.dart'; +import 'package:flower_app/presentation/core/widgets/icons.dart'; import 'package:flutter/material.dart'; class UserAccountPopupMenuBtn extends StatelessWidget { diff --git a/lib/settings/app_settings.dart b/lib/settings/app_settings.dart index 9d5d283..9ce9672 100644 --- a/lib/settings/app_settings.dart +++ b/lib/settings/app_settings.dart @@ -1,5 +1,5 @@ import 'package:hmi_core/hmi_core.dart'; -import 'package:hmi_core/hmi_core_result_new.dart'; +import 'package:hmi_core/hmi_core_result.dart'; // ignore: avoid_classes_with_only_static_members /// /// diff --git a/lib/settings/setting.dart b/lib/settings/setting.dart index f21dd1c..52d5c43 100644 --- a/lib/settings/setting.dart +++ b/lib/settings/setting.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/settings/app_settings.dart'; +import 'package:flower_app/settings/app_settings.dart'; /// /// Holds setting value stored in AppSettings by it name /// - value can be returned in int, double or string represantation diff --git a/license.txt b/license.txt deleted file mode 100644 index 17f42d1..0000000 --- a/license.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 Yegor Bugayenko - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 2b8fa86..14e7846 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -1,13 +1,13 @@ # Project-level configuration. -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.13) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "flowers_app") +set(BINARY_NAME "flower_app") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.antonlobanovco.flowersapp.flowers_app") +set(APPLICATION_ID "com.lobanov.antongmail.com.flower_app") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. @@ -54,25 +54,8 @@ add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Define the application target. To change its name, change BINARY_NAME above, -# not the value here, or `flutter run` will no longer work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add dependency libraries. Add any application-specific dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/linux/runner/CMakeLists.txt b/linux/runner/CMakeLists.txt new file mode 100644 index 0000000..e97dabc --- /dev/null +++ b/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the application ID. +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/linux/main.cc b/linux/runner/main.cc similarity index 100% rename from linux/main.cc rename to linux/runner/main.cc diff --git a/linux/my_application.cc b/linux/runner/my_application.cc similarity index 90% rename from linux/my_application.cc rename to linux/runner/my_application.cc index b4d38d7..6b18b78 100644 --- a/linux/my_application.cc +++ b/linux/runner/my_application.cc @@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) { if (use_header_bar) { GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "flowers_app"); + gtk_header_bar_set_title(header_bar, "flower_app"); gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); } else { - gtk_window_set_title(window, "flowers_app"); + gtk_window_set_title(window, "flower_app"); } gtk_window_set_default_size(window, 1280, 720); @@ -117,6 +117,12 @@ static void my_application_class_init(MyApplicationClass* klass) { static void my_application_init(MyApplication* self) {} MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + return MY_APPLICATION(g_object_new(my_application_get_type(), "application-id", APPLICATION_ID, "flags", G_APPLICATION_NON_UNIQUE, diff --git a/linux/my_application.h b/linux/runner/my_application.h similarity index 100% rename from linux/my_application.h rename to linux/runner/my_application.h diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig index 4b81f9b..c2efd0b 100644 --- a/macos/Flutter/Flutter-Debug.xcconfig +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig index 5caa9d1..c2efd0b 100644 --- a/macos/Flutter/Flutter-Release.xcconfig +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Podfile b/macos/Podfile deleted file mode 100644 index c795730..0000000 --- a/macos/Podfile +++ /dev/null @@ -1,43 +0,0 @@ -platform :osx, '10.14' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_macos_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 54fc92d..4b65217 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -64,7 +64,7 @@ 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* flowers_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "flowers_app.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* flower_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "flower_app.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -131,7 +131,7 @@ 33CC10EE2044A3C60003C045 /* Products */ = { isa = PBXGroup; children = ( - 33CC10ED2044A3C60003C045 /* flowers_app.app */, + 33CC10ED2044A3C60003C045 /* flower_app.app */, 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, ); name = Products; @@ -217,7 +217,7 @@ ); name = Runner; productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* flowers_app.app */; + productReference = 33CC10ED2044A3C60003C045 /* flower_app.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -385,10 +385,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.anton-lobanov-co.flowers-app.flowersApp.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.lobanov.antongmail.com.flowerApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flowers_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flowers_app"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flower_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flower_app"; }; name = Debug; }; @@ -399,10 +399,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.anton-lobanov-co.flowers-app.flowersApp.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.lobanov.antongmail.com.flowerApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flowers_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flowers_app"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flower_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flower_app"; }; name = Release; }; @@ -413,10 +413,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.anton-lobanov-co.flowers-app.flowersApp.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.lobanov.antongmail.com.flowerApp.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flowers_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flowers_app"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flower_app.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flower_app"; }; name = Profile; }; diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 35b17e8..60d8b2d 100644 --- a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -15,7 +15,7 @@ @@ -31,7 +31,7 @@ @@ -59,13 +59,14 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> @@ -82,7 +83,7 @@ diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig index 94aa99e..4e75c27 100644 --- a/macos/Runner/Configs/AppInfo.xcconfig +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -5,10 +5,10 @@ // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = flowers_app +PRODUCT_NAME = flower_app // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.anton-lobanov-co.flowers-app.flowersApp +PRODUCT_BUNDLE_IDENTIFIER = com.lobanov.antongmail.com.flowerApp // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2024 com.anton-lobanov-co.flowers-app. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2025 com.lobanov.anton@gmail.com. All rights reserved. diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..9a953ba --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,652 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: e55636ed79578b9abca5fecf9437947798f5ef7456308b5cb85720b793eac92f + url: "https://pub.dev" + source: hosted + version: "82.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "904ae5bb474d32c38fb9482e2d925d5454cda04ddd0e55d2e6826bc72f6ba8c0" + url: "https://pub.dev" + source: hosted + version: "7.4.5" + another_flushbar: + dependency: "direct main" + description: + name: another_flushbar + sha256: "19bf9520230ec40b300aaf9dd2a8fefcb277b25ecd1c4838f530566965befc2a" + url: "https://pub.dev" + source: hosted + version: "1.12.30" + archive: + dependency: transitive + description: + name: archive + sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" + url: "https://pub.dev" + source: hosted + version: "4.0.7" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + url: "https://pub.dev" + source: hosted + version: "2.12.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + build: + dependency: transitive + description: + name: build + sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: ea90e81dc4a25a043d9bee692d20ed6d1c4a1662a28c03a96417446c093ed6b4 + url: "https://pub.dev" + source: hosted + version: "8.9.5" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "27eb0ae77836989a3bc541ce55595e8ceee0992807f14511552a898ddd0d88ac" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + ext_rw: + dependency: "direct main" + description: + path: "." + ref: "1.2.3" + resolved-ref: e75f8a0b002e1ee3e37d04853829d76f24f5a9ba + url: "https://github.com/a-givertzman/dart_ext_rw" + source: git + version: "1.2.3" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + url: "https://pub.dev" + source: hosted + version: "1.3.2" + ffi: + dependency: transitive + description: + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_launcher_icons: + dependency: "direct dev" + description: + name: flutter_launcher_icons + sha256: bfa04787c85d80ecb3f8777bde5fc10c3de809240c48fa061a2c2bf15ea5211c + url: "https://pub.dev" + source: hosted + version: "0.14.3" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + url: "https://pub.dev" + source: hosted + version: "5.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + hmi_core: + dependency: "direct main" + description: + path: "." + ref: "2.1.5" + resolved-ref: "4f2652eabcb0e4a2ac40b55e4e318896ff77641a" + url: "https://github.com/a-givertzman/hmi_core.git" + source: git + version: "2.1.5" + image: + dependency: transitive + description: + name: image + sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928" + url: "https://pub.dev" + source: hosted + version: "4.5.4" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + url: "https://pub.dev" + source: hosted + version: "10.0.8" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + url: "https://pub.dev" + source: hosted + version: "3.0.9" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lint: + dependency: "direct dev" + description: + name: lint + sha256: "3cd03646de313481336500ba02eb34d07c590535525f154aae7fda7362aa07a9" + url: "https://pub.dev" + source: hosted + version: "2.8.0" + lints: + dependency: transitive + description: + name: lints + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + url: "https://pub.dev" + source: hosted + version: "5.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.dev" + source: hosted + version: "1.16.0" + mockito: + dependency: "direct dev" + description: + name: mockito + sha256: "4546eac99e8967ea91bae633d2ca7698181d008e95fa4627330cf903d573277a" + url: "https://pub.dev" + source: hosted + version: "5.4.6" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + posix: + dependency: transitive + description: + name: posix + sha256: f0d7856b6ca1887cfa6d1d394056a296ae33489db914e365e2044fdada449e62 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" + url: "https://pub.dev" + source: hosted + version: "2.5.3" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "20cbd561f743a342c76c151d6ddb93a9ce6005751e7aa458baad3858bfbfb6ac" + url: "https://pub.dev" + source: hosted + version: "2.4.10" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + url: "https://pub.dev" + source: hosted + version: "0.7.4" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uuid: + dependency: "direct main" + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + visibility_detector: + dependency: "direct main" + description: + name: visibility_detector + sha256: dd5cc11e13494f432d15939c3aa8ae76844c42b723398643ce9addb88a5ed420 + url: "https://pub.dev" + source: hosted + version: "0.4.0+2" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + url: "https://pub.dev" + source: hosted + version: "14.3.1" + watcher: + dependency: transitive + description: + name: watcher + sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: "direct main" + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.7.0 <4.0.0" + flutter: ">=3.27.0" diff --git a/pubspec.yaml b/pubspec.yaml index 8dbaabc..d493d70 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,5 @@ -name: flowers_app -description: Dart/Flutter simple application to organising join purchases - +name: flower_app +description: "A new Flutter project." # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev @@ -12,38 +11,45 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # build by specifying --build-name and --build-number, respectively. # In Android, build-name is used as versionName while build-number used as versionCode. # Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. version: 1.0.0+1 environment: - sdk: '>=3.2.3 <4.0.0' + sdk: ^3.7.0 +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter another_flushbar: ^1.12.30 ext_rw: - path: ../ext_rw - # git: - # url: https://github.com/a-givertzman/dart_ext_rw - # ref: 1.0.1 + # path: ../ext_rw + git: + url: https://github.com/a-givertzman/dart_ext_rw + ref: 1.2.3 hmi_core: + # path: ../hmi_core git: url: https://github.com/a-givertzman/hmi_core.git - ref: 2.0.0 + ref: 2.1.5 cupertino_icons: ^1.0.8 - shared_preferences: ^2.3.2 + shared_preferences: ^2.5.2 visibility_detector: ^0.4.0+2 - web_socket_channel: ^3.0.1 + web_socket_channel: ^3.0.2 uuid: ^4.5.1 -dependency_overrides: - uuid: ^3.0.7 - dev_dependencies: - dart_code_metrics: ^5.7.6 + flutter_test: + sdk: flutter flutter_launcher_icons: ^0.14.1 # to update app icons just run this command: # flutter pub run flutter_launcher_icons:main @@ -52,20 +58,17 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. + flutter_lints: ^5.0.0 - flutter_test: - sdk: flutter - lint: ^2.3.0 - mockito: ^5.4.4 + lint: ^2.8.0 + mockito: ^5.4.5 flutter_icons: android: true ios: true image_path: "assets/app_icon.png" -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec -# The following section is specific to Flutter. +# The following section is specific to Flutter packages. flutter: # The following line ensures that the Material Icons font is @@ -78,13 +81,16 @@ flutter: - assets/img/ - assets/icons/ - assets/settings/ - # - assets/img/product-placeholder.png + # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg + # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. + # https://flutter.dev/to/resolution-aware-images + # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages + # https://flutter.dev/to/asset-from-package + # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a @@ -103,4 +109,4 @@ flutter: # weight: 700 # # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages + # see https://flutter.dev/to/font-from-package diff --git a/test/unit/notice_list_test.dart b/test/unit/notice_list_test.dart index 9f32556..b1d152c 100644 --- a/test/unit/notice_list_test.dart +++ b/test/unit/notice_list_test.dart @@ -1,17 +1,17 @@ -import 'package:flowers_app/domain/notice/notice.dart'; -import 'package:flowers_app/domain/notice/notice_list.dart'; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart'; -import 'package:flowers_app/settings/app_settings.dart'; +import 'package:flower_app/domain/notice/notice.dart'; +import 'package:flower_app/domain/notice/notice_list.dart'; +import 'package:flower_app/domain/notice/notice_list_viewed.dart'; +import 'package:flower_app/settings/app_settings.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:hmi_core/hmi_core_json.dart'; import 'package:hmi_core/hmi_core_log.dart'; -import 'package:hmi_core/src/core/json/json_map.dart'; -import 'package:hmi_core/src/core/text_file.dart'; +import 'package:hmi_core/hmi_core_text_file.dart'; import 'package:shared_preferences/shared_preferences.dart'; void main() { SharedPreferences.setMockInitialValues({}); - const findLastNoticeByFieldName = 'purchase_content_id'; + const findLastNoticeByFieldName = 'purchase_item_id'; const findLastNoticeByFieldNameValue = '2'; const lastNoticeId = '4'; const customerId = '916'; @@ -47,7 +47,7 @@ void main() { expect(result, equals(true)); final contains = await noticeListViewed.containsInGroup( noticeId: lastNoticeId.toString(), - purchaseContentId: findLastNoticeByFieldNameValue, + purchaseItemId: findLastNoticeByFieldNameValue, ); expect(contains, equals(false)); }); @@ -55,12 +55,12 @@ void main() { test('NoticeListViewed.setViewed() test', () async { final result = await noticeListViewed.setViewed( noticeId: lastNoticeId.toString(), - purchaseContentId: findLastNoticeByFieldNameValue, + purchaseItemId: findLastNoticeByFieldNameValue, ); expect(result, equals(true)); final contains = await noticeListViewed.containsInGroup( noticeId: lastNoticeId.toString(), - purchaseContentId: findLastNoticeByFieldNameValue, + purchaseItemId: findLastNoticeByFieldNameValue, ); expect(contains, equals(true)); }); @@ -75,7 +75,7 @@ void main() { expect(last.isValid, equals(true), reason: 'last notice is empty'); expect(last.id.isNotEmpty, true, reason: "error reading last['id']"); expect(last.purchaseId.isNotEmpty, true, reason: "error reading last['purchase_id']"); - expect(last.purchaseContentId.isNotEmpty, true, reason: "error reading last['purchase_content_id']"); + expect(last.purchaseItemId.isNotEmpty, true, reason: "error reading last['purchase_item_id']"); expect(!last.isEmpty, true, reason: "error reading last['message']"); expect(last.created.isNotEmpty, true, reason: "error reading last['created']"); expect(last.updated.isNotEmpty, true, reason: "error reading last['updated']"); diff --git a/test/unit/notice_list_test.mocks.dart b/test/unit/notice_list_test.mocks.dart index 0bf3882..2a110be 100644 --- a/test/unit/notice_list_test.mocks.dart +++ b/test/unit/notice_list_test.mocks.dart @@ -4,7 +4,7 @@ import 'dart:async' as _i3; -import 'package:flowers_app/domain/notice/notice_list_viewed.dart' as _i2; +import 'package:flower_app/domain/notice/notice_list_viewed.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: type=lint @@ -30,10 +30,10 @@ class MockNoticeListViewed extends _i1.Mock implements _i2.NoticeListViewed { (super.noSuchMethod(Invocation.method(#isEmpty, []), returnValue: false) as bool); @override - _i3.Future setViewed({String? noticeId, String? purchaseContentId}) => + _i3.Future setViewed({String? noticeId, String? purchaseItemId}) => (super.noSuchMethod( Invocation.method(#setViewed, [], - {#noticeId: noticeId, #purchaseContentId: purchaseContentId}), + {#noticeId: noticeId, #purchaseItemId: purchaseItemId}), returnValue: Future.value(false)) as _i3.Future); @override _i3.Future contains({String? noticeId}) => (super.noSuchMethod( @@ -41,10 +41,10 @@ class MockNoticeListViewed extends _i1.Mock implements _i2.NoticeListViewed { returnValue: Future.value(false)) as _i3.Future); @override _i3.Future containsInGroup( - {String? noticeId, String? purchaseContentId}) => + {String? noticeId, String? purchaseItemId}) => (super.noSuchMethod( Invocation.method(#containsInGroup, [], - {#noticeId: noticeId, #purchaseContentId: purchaseContentId}), + {#noticeId: noticeId, #purchaseItemId: purchaseItemId}), returnValue: Future.value(false)) as _i3.Future); @override String localStorageViewedNoticePath(String? customerId) => (super.noSuchMethod( diff --git a/test/unit/notice_test.dart b/test/unit/notice_test.dart index e22d8dd..a4cc7b7 100644 --- a/test/unit/notice_test.dart +++ b/test/unit/notice_test.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/domain/notice/notice.dart'; +import 'package:flower_app/domain/notice/notice.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { diff --git a/test/unit/user_password_test.dart b/test/unit/user_password_test.dart index d164c64..50a8d3e 100644 --- a/test/unit/user_password_test.dart +++ b/test/unit/user_password_test.dart @@ -1,4 +1,4 @@ -import 'package:flowers_app/domain/auth/user_password.dart'; +import 'package:flower_app/domain/auth/user_password.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; import './user_password_test.key' as user_pass; diff --git a/test/widget_test.dart_ b/test/widget_test.dart_ deleted file mode 100644 index c669ad0..0000000 --- a/test/widget_test.dart_ +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:flowers_app/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/web/index.html b/web/index.html index 976274d..a19f961 100644 --- a/web/index.html +++ b/web/index.html @@ -21,15 +21,15 @@ - + - + - flowers_app + flower_app diff --git a/web/manifest.json b/web/manifest.json index e8189ff..43522b5 100644 --- a/web/manifest.json +++ b/web/manifest.json @@ -1,6 +1,6 @@ { - "name": "flowers_app", - "short_name": "flowers_app", + "name": "flower_app", + "short_name": "flower_app", "start_url": ".", "display": "standalone", "background_color": "#0175C2", diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 51bf251..cf1eadd 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -1,10 +1,10 @@ # Project-level configuration. cmake_minimum_required(VERSION 3.14) -project(flowers_app LANGUAGES CXX) +project(flower_app LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "flowers_app") +set(BINARY_NAME "flower_app") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc index 5c006ee..ae6eee0 100644 --- a/windows/runner/Runner.rc +++ b/windows/runner/Runner.rc @@ -89,13 +89,13 @@ BEGIN BEGIN BLOCK "040904e4" BEGIN - VALUE "CompanyName", "com.anton-lobanov-co.flowers-app" "\0" - VALUE "FileDescription", "flowers_app" "\0" + VALUE "CompanyName", "com.lobanov.anton@gmail.com" "\0" + VALUE "FileDescription", "flower_app" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "flowers_app" "\0" - VALUE "LegalCopyright", "Copyright (C) 2024 com.anton-lobanov-co.flowers-app. All rights reserved." "\0" - VALUE "OriginalFilename", "flowers_app.exe" "\0" - VALUE "ProductName", "flowers_app" "\0" + VALUE "InternalName", "flower_app" "\0" + VALUE "LegalCopyright", "Copyright (C) 2025 com.lobanov.anton@gmail.com. All rights reserved." "\0" + VALUE "OriginalFilename", "flower_app.exe" "\0" + VALUE "ProductName", "flower_app" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp index fc320cd..6fc77ba 100644 --- a/windows/runner/main.cpp +++ b/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.Create(L"flowers_app", origin, size)) { + if (!window.Create(L"flower_app", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true);