Merge pull request 'feat(test-flight): try test flight load' (#327) from main into test-flight

Reviewed-on: eatvio/eatvio_app#327
This commit is contained in:
mso7nueh
2025-04-18 12:57:28 +00:00
423 changed files with 18402 additions and 18954 deletions

1
.gitignore vendored
View File

@@ -9,3 +9,4 @@
/node_modules/
/android/app/release/app-release.aab
/android/app/upload-keystore.jks
/android/app/.cxx

View File

@@ -31,6 +31,7 @@ EXPORT_OPTIONS_FILE="Support/ExportOptions.plist"
# Clean and prepare the build
flutter clean
flutter pub get
flutter upgrade
cd ios
rm -rf Pods Podfile.lock
@@ -68,4 +69,4 @@ if [[ -d "${ARCHIVE_PATH}" ]]; then
ditto -c -k --sequesterRsrc --keepParent "${ARCHIVE_PATH}" "${ARTIFACT_PATH}/${SCHEME}.xcarchive.zip"
else
echo "Archive directory not found, skipping zip."
fi
fi

View File

@@ -5,7 +5,7 @@
<key>provisioningProfiles</key>
<dict>
<key>com.eatvioapp.app</key>
<string>CI CD Example Disctribution</string>
<string>Eatvio distribution profile</string>
</dict>
<key>signingCertificate</key>
<string>Apple Distribution: Team ITVIO, OOO</string>

View File

@@ -1,6 +1,10 @@
include: package:flutter_lints/flutter.yaml
linter:
rules:
- require_trailing_commas
prefer_const_constructors: true
prefer_const_declarations: true
prefer_const_literals_to_create_immutables: true
analyzer:
exclude:

View File

@@ -2,27 +2,27 @@ C/C++ Structured Loga
_
]/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/additional_project_files.txtC
A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ¤¤þñÚ2  <20>ë„ÖØ2^
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ‹Ãú½Ü2  <20>ë„ÖØ2^
\
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/android_gradle_build.json  ¤¤þñÚ2§ ‡ë„ÖØ2c
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/android_gradle_build.json  ‹Ãú½Ü2§ ‡ë„ÖØ2c
a
_/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/android_gradle_build_mini.json  ¤¤þñÚ2² ‰ë„ÖØ2P
_/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/android_gradle_build_mini.json  ‹Ãú½Ü2² ‰ë„ÖØ2P
N
L/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/build.ninja  ¤¤þñÚ2œÃ çê„ÖØ2T
L/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/build.ninja  ŒÃú½Ü2œÃ çê„ÖØ2T
R
P/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/build.ninja.txt  ¤¤þñÚ2Y
P/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/build.ninja.txt  ŒÃú½Ü2Y
W
U/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/build_file_index.txt  ¤¤þñÚ2
U/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/build_file_index.txt  ŒÃú½Ü2
P ‰ë„ÖØ2Z
X
X
V/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/compile_commands.json  ŒÃú½Ü2^
\
\
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/compile_commands.json.bin  ŒÃú½Ü2 d
b
b
`/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/metadata_generation_command.txt  ŒÃú½Ü2
‚ ‰ë„ÖØ2W
U
U
S/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/prefab_config.json  ŒÃú½Ü2
 ( ‰ë„ÖØ2\
 ( ‰ë„ÖØ2\
Z
X/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/symbol_folder_index.txt  ¤¤þñÚ2
X/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/arm64-v8a/symbol_folder_index.txt  ŒÃú½Ü2

View File

@@ -2,27 +2,27 @@ C/C++ Structured Logc
a
_/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/additional_project_files.txtC
A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ѤþñÚ2  ’ò„ÖØ2`
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  åÃú½Ü2  ’ò„ÖØ2`
^
\/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/android_gradle_build.json  ѤþñÚ2« ”ò„ÖØ2e
\/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/android_gradle_build.json  åÃú½Ü2« ”ò„ÖØ2e
c
a/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/android_gradle_build_mini.json  ѤþñÚ2 –ò„ÖØ2R
a/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/android_gradle_build_mini.json  åÃú½Ü2 –ò„ÖØ2R
P
N/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/build.ninja  ѤþñÚ2¨Ã þñ„ÖØ2V
N/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/build.ninja  åÃú½Ü2¨Ã þñ„ÖØ2V
T
R/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/build.ninja.txt  ѤþñÚ2[
R/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/build.ninja.txt  åÃú½Ü2[
Y
W/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/build_file_index.txt  ѤþñÚ2
W/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/build_file_index.txt  åÃú½Ü2
P –ò„ÖØ2\
Z
Z
X/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/compile_commands.json  åÃú½Ü2`
^
^
\/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/compile_commands.json.bin  åÃú½Ü2 f
d
d
b/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/metadata_generation_command.txt  åÃú½Ü2
Œ –ò„ÖØ2Y
W
W
U/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/prefab_config.json  åÃú½Ü2
 ( –ò„ÖØ2^
 ( –ò„ÖØ2^
\
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/symbol_folder_index.txt  ѤþñÚ2
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/armeabi-v7a/symbol_folder_index.txt  åÃú½Ü2

View File

@@ -2,27 +2,27 @@ C/C++ Structured Log[
Y
W/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/additional_project_files.txtC
A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ߤþñÚ2  Üû„ÖØ2X
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  öÃú½Ü2  Üû„ÖØ2X
V
T/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/android_gradle_build.json  ߤþñÚ2› Ýû„ÖØ2]
T/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/android_gradle_build.json  öÃú½Ü2› Ýû„ÖØ2]
[
Y/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/android_gradle_build_mini.json  ߤþñÚ2¦ Þû„ÖØ2J
Y/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/android_gradle_build_mini.json  öÃú½Ü2¦ Þû„ÖØ2J
H
F/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/build.ninja  ߤþñÚ2øÂ Ïû„ÖØ2N
F/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/build.ninja  öÃú½Ü2øÂ Ïû„ÖØ2N
L
J/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/build.ninja.txt  ߤþñÚ2S
J/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/build.ninja.txt  öÃú½Ü2S
Q
O/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/build_file_index.txt  ߤþñÚ2
O/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/build_file_index.txt  öÃú½Ü2
P ßû„ÖØ2T
R
R
P/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/compile_commands.json  öÃú½Ü2X
V
V
T/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/compile_commands.json.bin  öÃú½Ü2 ^
\
\
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/metadata_generation_command.txt  öÃú½Ü2
ä Þû„ÖØ2Q
O
O
M/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/prefab_config.json  öÃú½Ü2
 ( Þû„ÖØ2V
 ( Þû„ÖØ2V
T
R/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/symbol_folder_index.txt  ߤþñÚ2
R/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86/symbol_folder_index.txt  öÃú½Ü2

View File

@@ -2,27 +2,27 @@ C/C++ Structured Log^
\
Z/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/additional_project_files.txtC
A
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  é¤þñÚ2  Î<>…ÖØ2[
?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  ‰Äú½Ü2  Î<>…ÖØ2[
Y
W/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/android_gradle_build.json  é¤þñÚ2¡ Ð<>…ÖØ2`
W/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/android_gradle_build.json  ‰Äú½Ü2¡ Ð<>…ÖØ2`
^
\/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/android_gradle_build_mini.json  é¤þñÚ2¬ Ò<>…ÖØ2M
\/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/android_gradle_build_mini.json  ‰Äú½Ü2¬ Ò<>…ÖØ2M
K
I/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/build.ninja  é¤þñÚ2ŠÃ »<>…ÖØ2Q
I/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/build.ninja  ‰Äú½Ü2ŠÃ »<>…ÖØ2Q
O
M/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/build.ninja.txt  é¤þñÚ2V
M/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/build.ninja.txt  ‰Äú½Ü2V
T
R/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/build_file_index.txt  é¤þñÚ2
R/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/build_file_index.txt  ‰Äú½Ü2
P Ô<>…ÖØ2W
U
U
S/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/compile_commands.json  ‰Äú½Ü2[
Y
Y
W/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/compile_commands.json.bin  ‰Äú½Ü2 a
_
_
]/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/metadata_generation_command.txt  ‰Äú½Ü2
ó Ó<>…ÖØ2T
R
R
P/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/prefab_config.json  ‰Äú½Ü2
 ( Ó<>…ÖØ2Y
 ( Ó<>…ÖØ2Y
W
U/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/symbol_folder_index.txt  ê¤þñÚ2
U/Users/alex/eatvio_app/android/app/.cxx/Debug/4y1z256o/x86_64/symbol_folder_index.txt  ‰Äú½Ü2

View File

@@ -1,5 +1,8 @@
plugins {
id "com.android.application"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
// END: FlutterFire Configuration
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
@@ -13,7 +16,7 @@ if (keystorePropertiesFile.exists()) {
android {
namespace = "com.eatvioapp.app"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
ndkVersion = "27.0.12077973"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21

View File

@@ -0,0 +1,30 @@
{
"project_info": {
"project_number": "613980912922",
"firebase_url": "https://eatvio-3467b-default-rtdb.europe-west1.firebasedatabase.app",
"project_id": "eatvio-3467b",
"storage_bucket": "eatvio-3467b.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:613980912922:android:4de95e5f2d50ba69ecc0a3",
"android_client_info": {
"package_name": "com.eatvioapp.app"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBUe1UqAAMfgMcd4hWdRoLF1Os-yn-HE9k"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

View File

@@ -19,6 +19,9 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.7.3" apply false
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
// END: FlutterFire Configuration
id "org.jetbrains.kotlin.android" version "2.0.21" apply false
}

8
assets/icons/mood_1.svg Normal file
View File

@@ -0,0 +1,8 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M30 15C30 23.2842 23.2842 30 15 30C6.71583 30 0 23.2842 0 15C0 6.71583 6.71583 0 15 0C23.2842 0 30 6.71583 30 15Z" fill="#FFCC4D"/>
<path d="M18.3353 22.5C18.3353 24.8025 16.8428 25 15.002 25C13.1603 25 11.6686 24.8025 11.6686 22.5C11.6686 20.1992 13.1603 17.5 15.002 17.5C16.8428 17.5 18.3353 20.1992 18.3353 22.5ZM25.002 12.5C24.8986 12.5 24.7936 12.4809 24.6928 12.44C20.3353 10.6975 18.5495 8.07253 18.4753 7.96169C18.2195 7.57836 18.3228 7.06086 18.7061 6.80586C19.0886 6.55086 19.6036 6.65253 19.8603 7.03419C19.8761 7.05669 21.4686 9.35503 25.3111 10.8917C25.7386 11.0634 25.947 11.5475 25.7761 11.975C25.6453 12.3017 25.332 12.5 25.002 12.5ZM5.00195 12.5C4.67112 12.5 4.35862 12.3017 4.22779 11.9759C4.05695 11.5484 4.26445 11.0634 4.69195 10.8925C8.53529 9.35586 10.1278 7.05753 10.1436 7.03503C10.4003 6.65503 10.9178 6.55419 11.2995 6.81003C11.6803 7.06669 11.7836 7.58086 11.5286 7.96253C11.4545 8.07336 9.66862 10.6984 5.31195 12.4409C5.21029 12.4809 5.10529 12.5 5.00195 12.5Z" fill="#664500"/>
<path d="M20.0013 13.3334H23.3346V29.1667L20.0013 29.1284V13.3334ZM6.66797 29.1667L10.0013 29.1284V13.3334H6.66797V29.1667Z" fill="#5DADEC"/>
<path d="M12.499 14.9998C12.374 14.9998 12.2465 14.9714 12.1274 14.9123C9.2007 13.4489 6.2357 14.8973 6.20654 14.9123C5.79404 15.1198 5.29404 14.9506 5.0882 14.5398C4.88237 14.1281 5.04904 13.6273 5.4607 13.4214C5.61237 13.3464 9.20904 11.5906 12.8732 13.4214C13.2849 13.6273 13.4515 14.1281 13.2457 14.5398C13.099 14.8314 12.8049 14.9998 12.499 14.9998ZM24.1657 14.9998C24.0407 14.9998 23.9132 14.9714 23.794 14.9123C20.8665 13.4489 17.9024 14.8973 17.8732 14.9123C17.4615 15.1189 16.9615 14.9514 16.7549 14.5398C16.549 14.1281 16.7157 13.6273 17.1274 13.4214C17.279 13.3464 20.8782 11.5914 24.5399 13.4214C24.9515 13.6273 25.1182 14.1281 24.9124 14.5398C24.7657 14.8314 24.4715 14.9998 24.1657 14.9998Z" fill="#664500"/>
<path d="M15 30C23.2843 30 30 29.2538 30 28.3333C30 27.4128 23.2843 26.6666 15 26.6666C6.71573 26.6666 0 27.4128 0 28.3333C0 29.2538 6.71573 30 15 30Z" fill="#5DADEC"/>
<path d="M15 24.1667C16.3807 24.1667 17.5 23.4205 17.5 22.5C17.5 21.5796 16.3807 20.8334 15 20.8334C13.6193 20.8334 12.5 21.5796 12.5 22.5C12.5 23.4205 13.6193 24.1667 15 24.1667Z" fill="#E75A70"/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

6
assets/icons/mood_2.svg Normal file
View File

@@ -0,0 +1,6 @@
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M30 15C30 23.2842 23.2842 30 15 30C6.71583 30 0 23.2842 0 15C0 6.71583 6.71583 0 15 0C23.2842 0 30 6.71583 30 15Z" fill="#FFCC4D"/>
<path d="M14.9987 17.5C11.9795 17.5 9.9762 17.1484 7.4987 16.6667C6.93286 16.5575 5.83203 16.6667 5.83203 18.3334C5.83203 21.6667 9.6612 25.8334 14.9987 25.8334C20.3354 25.8334 24.1654 21.6667 24.1654 18.3334C24.1654 16.6667 23.0645 16.5567 22.4987 16.6667C20.0212 17.1484 18.0179 17.5 14.9987 17.5Z" fill="#664500"/>
<path d="M7.5 18.3334C7.5 18.3334 10 19.1667 15 19.1667C20 19.1667 22.5 18.3334 22.5 18.3334C22.5 18.3334 20.8333 21.6667 15 21.6667C9.16667 21.6667 7.5 18.3334 7.5 18.3334Z" fill="white"/>
<path d="M13.0686 3.67752L9.28363 4.34502L7.33363 0.800858C7.11863 0.410024 6.67697 0.200858 6.2403 0.277525C5.80113 0.355025 5.45947 0.703358 5.39113 1.14336L4.7703 5.14086L0.9853 5.80836C0.539467 5.88669 0.1953 6.24586 0.134467 6.69502C0.0736333 7.14419 0.3103 7.58086 0.7203 7.77586L4.11197 9.38586L3.48863 13.3959C3.41947 13.8425 3.64613 14.2825 4.04947 14.4867C4.19863 14.5617 4.35863 14.5975 4.5178 14.5975C4.7903 14.5975 5.05947 14.4909 5.2603 14.2875L8.18697 11.32L11.952 13.1075C12.3603 13.3009 12.847 13.21 13.157 12.8809C13.467 12.5517 13.5286 12.0609 13.3111 11.665L11.3545 8.10836L13.992 5.43502C14.3103 5.11252 14.3828 4.62086 14.1728 4.21919C13.9611 3.81752 13.512 3.60002 13.0686 3.67752ZM16.932 3.67752L20.717 4.34502L22.667 0.800858C22.882 0.410024 23.3236 0.200858 23.7603 0.277525C24.1986 0.355025 24.5403 0.703358 24.6086 1.14336L25.2295 5.14086L29.0145 5.80836C29.4611 5.88669 29.8053 6.24502 29.8653 6.69419C29.9253 7.14336 29.6895 7.58002 29.2795 7.77502L25.8878 9.38502L26.5111 13.395C26.5803 13.8417 26.3536 14.2817 25.9503 14.4859C25.8011 14.5609 25.6411 14.5967 25.482 14.5967C25.2095 14.5967 24.9403 14.49 24.7395 14.2867L21.8128 11.3192L18.0478 13.1067C17.6395 13.3 17.1528 13.2092 16.8428 12.88C16.5328 12.5509 16.4711 12.06 16.6886 11.6642L18.6453 8.10836L16.0078 5.43502C15.6895 5.11252 15.617 4.62086 15.827 4.21919C16.0395 3.81752 16.4886 3.60002 16.932 3.67752Z" fill="#E95F28"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

10
assets/icons/retire.svg Normal file
View File

@@ -0,0 +1,10 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_4416_49941)">
<path d="M8.75535 15.5792C7.63577 15.5792 6.58588 15.3668 5.60567 14.942C4.62532 14.5171 3.77023 13.9398 3.04041 13.21C2.31058 12.4801 1.73325 11.625 1.30841 10.6447C0.883564 9.66448 0.671143 8.61459 0.671143 7.49501C0.671143 5.87662 1.10897 4.39838 1.98462 3.06027C2.86013 1.72202 4.04441 0.744692 5.53746 0.128271C5.80314 0.0159904 6.05444 0.0357096 6.29135 0.187429C6.52827 0.339008 6.64784 0.554657 6.65009 0.834376C6.66735 2.00574 6.89598 3.12231 7.33598 4.18406C7.77584 5.24595 8.40876 6.18982 9.23472 7.01564C10.0605 7.8416 11.0017 8.47318 12.0581 8.91038C13.1145 9.34771 14.2284 9.57501 15.3998 9.59227C15.7108 9.59438 15.9391 9.71311 16.0848 9.94848C16.2307 10.1839 16.2474 10.4387 16.1351 10.7129C15.5013 12.1974 14.5175 13.3796 13.1836 14.2594C11.8498 15.1393 10.3737 15.5792 8.75535 15.5792ZM8.75535 14.3161C9.99044 14.3161 11.1343 14.0073 12.1869 13.3897C13.2396 12.7722 14.0676 11.9231 14.6711 10.8424C13.4641 10.7301 12.3203 10.4235 11.2396 9.92259C10.1589 9.42167 9.19044 8.74315 8.3343 7.88701C7.47816 7.03087 6.79746 6.06378 6.2922 4.98574C5.78693 3.90771 5.48518 2.76518 5.38693 1.55817C4.30623 2.16167 3.46062 2.99325 2.85009 4.0529C2.23956 5.11255 1.9343 6.25992 1.9343 7.49501C1.9343 9.38974 2.59746 11.0003 3.92377 12.3266C5.25009 13.6529 6.86062 14.3161 8.75535 14.3161Z" fill="#6D6F71"/>
</g>
<defs>
<clipPath id="clip0_4416_49941">
<rect width="16" height="16" fill="white" transform="translate(0.25)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

10
assets/icons/wakeup.svg Normal file
View File

@@ -0,0 +1,10 @@
<svg width="19" height="18" viewBox="0 0 19 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_4416_49934)">
<path d="M9.24976 3.44577C9.07576 3.44577 8.93006 3.38699 8.81265 3.26945C8.6951 3.15177 8.63633 3.00599 8.63633 2.83213V1.03847C8.63633 0.864608 8.69517 0.718903 8.81285 0.601358C8.93053 0.483676 9.07631 0.424835 9.25017 0.424835C9.42417 0.424835 9.56987 0.483676 9.68728 0.601358C9.80483 0.718903 9.8636 0.864608 9.8636 1.03847V2.83213C9.8636 3.00599 9.80476 3.15177 9.68708 3.26945C9.5694 3.38699 9.42362 3.44577 9.24976 3.44577ZM13.1742 5.07579C13.0609 4.96261 13.0055 4.82236 13.0081 4.65504C13.0107 4.48772 13.0686 4.34058 13.1819 4.21363L14.4297 2.93768C14.5528 2.81072 14.699 2.74724 14.8682 2.74724C15.0374 2.74724 15.1861 2.81127 15.3141 2.93931C15.4315 3.05672 15.4902 3.19984 15.4902 3.36865C15.4902 3.53761 15.4309 3.68134 15.3123 3.79984L14.0363 5.07579C13.9178 5.19443 13.7741 5.25374 13.6051 5.25374C13.4363 5.25374 13.2927 5.19443 13.1742 5.07579ZM15.4178 9.61363C15.244 9.61363 15.0982 9.55479 14.9805 9.43711C14.863 9.31943 14.8042 9.17365 14.8042 8.99979C14.8042 8.82579 14.863 8.68009 14.9805 8.56268C15.0982 8.44513 15.244 8.38636 15.4178 8.38636H17.2115C17.3853 8.38636 17.5311 8.4452 17.6486 8.56288C17.7663 8.68056 17.8251 8.82633 17.8251 9.0002C17.8251 9.1742 17.7663 9.3199 17.6486 9.43731C17.5311 9.55486 17.3853 9.61363 17.2115 9.61363H15.4178ZM9.24976 17.5752C9.07576 17.5752 8.93006 17.5163 8.81265 17.3986C8.6951 17.2811 8.63633 17.1354 8.63633 16.9615V15.1756C8.63633 15.0018 8.69517 14.8561 8.81285 14.7385C8.93053 14.6208 9.07631 14.562 9.25017 14.562C9.42417 14.562 9.56987 14.6208 9.68728 14.7385C9.80483 14.8561 9.8636 15.0018 9.8636 15.1756V16.9615C9.8636 17.1354 9.80476 17.2811 9.68708 17.3986C9.5694 17.5163 9.42362 17.5752 9.24976 17.5752ZM4.47158 5.07579L3.18765 3.82029C3.06069 3.6977 2.99721 3.54954 2.99721 3.37581C2.99721 3.20222 3.06069 3.05618 3.18765 2.93768C3.30615 2.82436 3.45158 2.7677 3.62394 2.7677C3.7963 2.7677 3.93826 2.82436 4.0498 2.93768L5.33374 4.22161C5.44705 4.33315 5.50371 4.47511 5.50371 4.64747C5.50371 4.81984 5.4476 4.96261 5.33537 5.07579C5.21292 5.18911 5.07008 5.24577 4.90685 5.24577C4.74349 5.24577 4.5984 5.18911 4.47158 5.07579ZM14.4376 15.0623L13.1819 13.7864C13.0686 13.6594 13.0107 13.5123 13.0081 13.3449C13.0055 13.1776 13.0603 13.0374 13.1725 12.9242C13.2848 12.8109 13.4251 12.7542 13.5935 12.7542C13.7618 12.7542 13.9094 12.8135 14.0363 12.932L15.3123 14.1877C15.4341 14.3009 15.4928 14.4432 15.4886 14.6148C15.4844 14.7863 15.4249 14.9355 15.31 15.0623C15.1847 15.1893 15.0359 15.2527 14.8635 15.2527C14.691 15.2527 14.5491 15.1893 14.4376 15.0623ZM1.28844 9.61363C1.11458 9.61363 0.968873 9.55479 0.851327 9.43711C0.733646 9.31943 0.674805 9.17365 0.674805 8.99979C0.674805 8.82579 0.733646 8.68009 0.851327 8.56268C0.968873 8.44513 1.11458 8.38636 1.28844 8.38636H3.0821C3.25596 8.38636 3.40174 8.4452 3.51942 8.56288C3.63696 8.68056 3.69574 8.82633 3.69574 9.0002C3.69574 9.1742 3.63696 9.3199 3.51942 9.43731C3.40174 9.55486 3.25596 9.61363 3.0821 9.61363H1.28844ZM3.19542 15.0623C3.0821 14.9438 3.02415 14.7988 3.02155 14.6272C3.01896 14.4558 3.07433 14.3135 3.18765 14.2002L4.45583 12.932C4.57433 12.8135 4.71594 12.7542 4.88067 12.7542C5.04526 12.7542 5.19103 12.8129 5.31799 12.9303C5.44494 13.0584 5.50842 13.2061 5.50842 13.3734C5.50842 13.5407 5.44494 13.6878 5.31799 13.8146L4.07026 15.0623C3.9433 15.1893 3.79365 15.2527 3.62128 15.2527C3.44892 15.2527 3.30696 15.1893 3.19542 15.0623ZM9.25181 13.5C8.00231 13.5 6.93962 13.0627 6.06376 12.188C5.1879 11.3134 4.74996 10.2513 4.74996 9.00183C4.74996 7.75234 5.18728 6.68965 6.06192 5.81379C6.93656 4.93793 7.99862 4.49999 9.24812 4.49999C10.4976 4.49999 11.5603 4.93731 12.4362 5.81195C13.312 6.68659 13.75 7.74865 13.75 8.99815C13.75 10.2477 13.3126 11.3103 12.438 12.1862C11.5634 13.0621 10.5013 13.5 9.25181 13.5ZM9.24996 12.2727C10.15 12.2727 10.9204 11.9523 11.5613 11.3114C12.2022 10.6704 12.5227 9.89999 12.5227 8.99999C12.5227 8.09999 12.2022 7.32954 11.5613 6.68863C10.9204 6.04772 10.15 5.72727 9.24996 5.72727C8.34996 5.72727 7.57951 6.04772 6.9386 6.68863C6.29769 7.32954 5.97724 8.09999 5.97724 8.99999C5.97724 9.89999 6.29769 10.6704 6.9386 11.3114C7.57951 11.9523 8.34996 12.2727 9.24996 12.2727Z" fill="#6D6F71"/>
</g>
<defs>
<clipPath id="clip0_4416_49934">
<rect width="18" height="18" fill="white" transform="translate(0.25)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

30
firebase.json Normal file
View File

@@ -0,0 +1,30 @@
{
"flutter": {
"platforms": {
"android": {
"default": {
"projectId": "eatvio-3467b",
"appId": "1:613980912922:android:4de95e5f2d50ba69ecc0a3",
"fileOutput": "android/app/google-services.json"
}
},
"ios": {
"default": {
"projectId": "eatvio-3467b",
"appId": "1:613980912922:ios:c557d140a1212e63ecc0a3",
"uploadDebugSymbols": false,
"fileOutput": "ios/Runner/GoogleService-Info.plist"
}
},
"dart": {
"lib/firebase_options.dart": {
"projectId": "eatvio-3467b",
"configurations": {
"android": "1:613980912922:android:4de95e5f2d50ba69ecc0a3",
"ios": "1:613980912922:ios:c557d140a1212e63ecc0a3"
}
}
}
}
}
}

View File

@@ -14,6 +14,7 @@
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 */; };
ACF3142BB74D6F5F3C98AD82 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = EB9FE5381C3F532BD9A9456D /* GoogleService-Info.plist */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -47,6 +48,7 @@
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9D8D6181877DE17809AFF936 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
DF0C4038A57E19D3ABA03C15 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
EB9FE5381C3F532BD9A9456D /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
FEE92A0E2D772EA300E6E989 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -91,6 +93,7 @@
97C146EF1CF9000F007C117D /* Products */,
6F201E010624CF963CC3A17B /* Pods */,
AEE6B7943D197783DD1CB2EE /* Frameworks */,
EB9FE5381C3F532BD9A9456D /* GoogleService-Info.plist */,
);
sourceTree = "<group>";
};
@@ -141,6 +144,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
1D324C14EB43C988423BC1AD /* [CP] Embed Pods Frameworks */,
DEAA66E178B81C074317BF9A /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -194,6 +198,7 @@
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
ACF3142BB74D6F5F3C98AD82 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -270,6 +275,23 @@
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;
};
DEAA66E178B81C074317BF9A /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@@ -363,9 +385,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 48;
CURRENT_PROJECT_VERSION = 51;
DEVELOPMENT_TEAM = VL68C36HYS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -383,7 +406,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.0.48;
MARKETING_VERSION = 1.0.49;
PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -512,9 +535,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 48;
CURRENT_PROJECT_VERSION = 51;
DEVELOPMENT_TEAM = VL68C36HYS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -532,7 +556,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.0.48;
MARKETING_VERSION = 1.0.49;
PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -549,9 +573,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 48;
CURRENT_PROJECT_VERSION = 51;
DEVELOPMENT_TEAM = VL68C36HYS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@@ -569,7 +594,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 1.0.48;
MARKETING_VERSION = 1.0.49;
PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>API_KEY</key>
<string>AIzaSyBnE8tQjL9_1HuXrTnqNy6qbXpoenO36yQ</string>
<key>GCM_SENDER_ID</key>
<string>613980912922</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.eatvioapp.app</string>
<key>PROJECT_ID</key>
<string>eatvio-3467b</string>
<key>STORAGE_BUCKET</key>
<string>eatvio-3467b.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:613980912922:ios:c557d140a1212e63ecc0a3</string>
<key>DATABASE_URL</key>
<string>https://eatvio-3467b-default-rtdb.europe-west1.firebasedatabase.app</string>
</dict>
</plist>

View File

@@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
@@ -24,6 +22,8 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
@@ -42,6 +42,7 @@
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>

View File

@@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>disabled</string>
<string>development</string>
</dict>
</plist>

View File

@@ -9,11 +9,12 @@ import 'package:eatvio_app/features/bottom_navigation_bar/presentation/widgets/b
import 'package:eatvio_app/features/calendar/presentation/pages/calendar_screen.dart';
import 'package:eatvio_app/features/chat/presentation/pages/chat_screen.dart';
import 'package:eatvio_app/features/chat/presentation/pages/chats_screen.dart';
import 'package:eatvio_app/features/chat/presentation/pages/payment_screen.dart';
import 'package:eatvio_app/features/chat/presentation/pages/photo_view_screen.dart';
import 'package:eatvio_app/features/consultant/become_consultant/presentation/pages/become_consultant_screen.dart';
import 'package:eatvio_app/features/consultant/become_consultant/presentation/pages/stepper_become_consultant_screen.dart';
import 'package:eatvio_app/features/consultations/presentation/pages/consultations_screen.dart';
import 'package:eatvio_app/features/consultations/presentation/pages/info_by_order_screen.dart';
import 'package:eatvio_app/features/order_info/presentation/info_by_order_screen.dart';
import 'package:eatvio_app/features/create_diet/presentation/create_diet_screen.dart';
import 'package:eatvio_app/features/create_diet/presentation/diet_preview_screen.dart';
import 'package:eatvio_app/features/create_plan/presentation/create_plan_screen.dart';
@@ -77,9 +78,9 @@ class AppRouter {
return BlocBuilder<ProfileAvatarCubit, ProfileAvatarState>(
builder: (BuildContext context, ProfileAvatarState state) {
if (state is ProfileAvatarStateLoaded) {
return BottomNavigationBarWidget(child: child, profileModel: state.profile);
return BottomNavigationBarWidget(profileModel: state.profile, child: child);
}
return SizedBox.shrink();
return const SizedBox.shrink();
},
);
},
@@ -92,45 +93,50 @@ class AppRouter {
return null;
},
pageBuilder: (context, state) {
return NoTransitionPage(child: ProfileScreen());
return const NoTransitionPage(child: ProfileScreen());
},
),
GoRoute(path: '/feed-screen', name: 'feedScreen', pageBuilder: (context, state) => NoTransitionPage(child: FeedScreen())),
GoRoute(path: '/diary-screen', name: 'diaryScreen', pageBuilder: (context, state) => NoTransitionPage(child: DiaryScreen())),
GoRoute(path: '/consultations-screen', name: 'consultationsScreen', pageBuilder: (context, state) => NoTransitionPage(child: ConsultationsScreen())),
GoRoute(path: '/chat-select-screen', name: 'chatSelectScreen', pageBuilder: (context, state) => NoTransitionPage(child: ChatsScreen())),
GoRoute(path: '/notifications-screen', name: 'notificationsScreen', pageBuilder: (context, state) => NoTransitionPage(child: NotificationsScreen())),
GoRoute(path: '/feed-screen', name: 'feedScreen', pageBuilder: (context, state) => const NoTransitionPage(child: FeedScreen())),
GoRoute(path: '/diary-screen', name: 'diaryScreen', pageBuilder: (context, state) => const NoTransitionPage(child: DiaryScreen())),
GoRoute(
path: '/consultations-screen',
name: 'consultationsScreen',
pageBuilder: (context, state) => const NoTransitionPage(child: ConsultationsScreen())),
GoRoute(path: '/chat-select-screen', name: 'chatSelectScreen', pageBuilder: (context, state) => const NoTransitionPage(child: ChatsScreen())),
GoRoute(
path: '/notifications-screen',
name: 'notificationsScreen',
pageBuilder: (context, state) => const NoTransitionPage(child: NotificationsScreen())),
GoRoute(
path: '/menu-screen',
name: 'menuScreen',
pageBuilder:
(context, state) => NoTransitionPage(
child: BlocBuilder<ProfileAvatarCubit, ProfileAvatarState>(
builder: (BuildContext context, ProfileAvatarState state) {
if (state is ProfileAvatarStateLoaded) {
return MenuScreen(profileModel: state.profile);
}
return SizedBox.shrink();
},
),
),
pageBuilder: (context, state) => NoTransitionPage(
child: BlocBuilder<ProfileAvatarCubit, ProfileAvatarState>(
builder: (BuildContext context, ProfileAvatarState state) {
if (state is ProfileAvatarStateLoaded) {
return MenuScreen(profileModel: state.profile);
}
return const SizedBox.shrink();
},
),
),
),
],
),
GoRoute(
path: '/consultant-finance-screen',
name: 'consultantFinanceScreen',
builder: (context, state) => ConsultantFinanceScreen(),
builder: (context, state) => const ConsultantFinanceScreen(),
),
GoRoute(
path: '/user-finance-screen',
name: 'userFinanceScreen',
builder: (context, state) => UserFinanceScreen(),
builder: (context, state) => const UserFinanceScreen(),
),
GoRoute(
path: CardSettingsScreen.path,
name: CardSettingsScreen.name,
builder: (context, state) => CardSettingsScreen(),
builder: (context, state) => const CardSettingsScreen(),
),
GoRoute(
path: '/about-plan-screen',
@@ -140,7 +146,7 @@ class AppRouter {
return AboutPlanScreen(plan: data['plan'] as PlanModel, index: data['index'] as int?, navigateToComments: data['navigateToComments'] as bool);
},
),
GoRoute(path: '/glossary-screen', name: 'glossaryScreen', builder: (context, state) => GlossaryScreen()),
GoRoute(path: '/glossary-screen', name: 'glossaryScreen', builder: (context, state) => const GlossaryScreen()),
GoRoute(
path: '/about-recipes-screen',
name: 'aboutRecipesScreen',
@@ -149,7 +155,7 @@ class AppRouter {
return AboutRecipeScreen(recipe: data['recipe'] as Recipe, index: data['index'] as int?, navigateToComments: data['navigateToComments'] as bool);
},
),
GoRoute(path: RecipeCreateScreen.path, name: RecipeCreateScreen.name, builder: (context, state) => RecipeCreateScreen()),
GoRoute(path: RecipeCreateScreen.path, name: RecipeCreateScreen.name, builder: (context, state) => const RecipeCreateScreen()),
GoRoute(path: '/profile-screen', name: 'profileScreen', builder: (context, state) => ProfileScreen(author: state.extra as Author)),
GoRoute(
path: '/subs-screen/:slug',
@@ -182,7 +188,7 @@ class AppRouter {
GoRoute(
path: '/settings-screen',
name: 'settingsScreen',
builder: (context, state) => SettingsScreen(),
builder: (context, state) => const SettingsScreen(),
routes: [
GoRoute(
path: 'general-info-screen',
@@ -217,10 +223,11 @@ class AppRouter {
),
],
),
GoRoute(path: '/become-consultant-screen', name: 'becomeConsultantScreen', builder: (context, state) => BecomeConsultantScreen()),
GoRoute(path: '/stepper-become-consultant-screen', name: 'stepperBecomeConsultantScreen', builder: (context, state) => StepperBecomeConsultantScreen()),
GoRoute(path: '/calendar-screen', name: 'calendarScreen', builder: (context, state) => CalendarScreen()),
GoRoute(path: '/support-screen', name: 'supportScreen', builder: (context, state) => SupportScreen()),
GoRoute(path: '/become-consultant-screen', name: 'becomeConsultantScreen', builder: (context, state) => const BecomeConsultantScreen()),
GoRoute(
path: '/stepper-become-consultant-screen', name: 'stepperBecomeConsultantScreen', builder: (context, state) => const StepperBecomeConsultantScreen()),
GoRoute(path: '/calendar-screen', name: 'calendarScreen', builder: (context, state) => const CalendarScreen()),
GoRoute(path: '/support-screen', name: 'supportScreen', builder: (context, state) => const SupportScreen()),
GoRoute(
path: '/photo-view-screen/:index',
name: 'photoViewScreen',
@@ -242,13 +249,36 @@ class AppRouter {
return DietPreviewScreen(diet: data);
},
),
GoRoute(path: CreatePlanScreen.path, name: CreatePlanScreen.name, builder: (context, state) => CreatePlanScreen()),
GoRoute(path: MyDietsScreen.path, name: MyDietsScreen.name, builder: (context, state) => MyDietsScreen()),
GoRoute(path: MyPlansScreen.path, name: MyPlansScreen.name, builder: (context, state) => MyPlansScreen()),
GoRoute(path: CreatePlanScreen.path, name: CreatePlanScreen.name, builder: (context, state) => const CreatePlanScreen()),
GoRoute(path: MyDietsScreen.path, name: MyDietsScreen.name, builder: (context, state) => const MyDietsScreen()),
GoRoute(path: MyPlansScreen.path, name: MyPlansScreen.name, builder: (context, state) => const MyPlansScreen()),
GoRoute(path: UserDetailsScreen.path, name: UserDetailsScreen.name, builder: (context, state) => UserDetailsScreen(slug: state.extra as String)),
GoRoute(path: DevToolsScreen.path, name: DevToolsScreen.name, builder: (context, state) => DevToolsScreen()),
GoRoute(path: ConsultantRatingScreen.path, name: ConsultantRatingScreen.name, builder: (context, state) => ConsultantRatingScreen()),
GoRoute(path: InfoByOrderScreen.path, name: InfoByOrderScreen.name, builder: (context, state) => InfoByOrderScreen()),
GoRoute(path: DevToolsScreen.path, name: DevToolsScreen.name, builder: (context, state) => const DevToolsScreen()),
GoRoute(path: ConsultantRatingScreen.path, name: ConsultantRatingScreen.name, builder: (context, state) => const ConsultantRatingScreen()),
GoRoute(
path: InfoByOrderScreen.path,
name: InfoByOrderScreen.name,
builder: (context, state) {
final data = state.extra as Map<String, dynamic>;
final planId = data['planId'] as int;
final successfulPayment = data['successfulPayment'] as bool?;
return InfoByOrderScreen(
planId: planId,
successfulPayment: successfulPayment,
);
}),
GoRoute(
path: PaymentScreen.path,
name: PaymentScreen.name,
builder: (context, state) {
final data = state.extra as Map<String, dynamic>;
final planId = data['planId'] as int;
final url = data['url'] as String;
return PaymentScreen(
url: url,
planId: planId,
);
}),
],
);
}

View File

@@ -3,7 +3,7 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
abstract class CredentialsStorage {
static Future<bool> haveCredentialsInStorage() async {
try {
if (await FlutterSecureStorage().read(key: 'email') == null || await FlutterSecureStorage().read(key: 'password') == null) {
if (await const FlutterSecureStorage().read(key: 'email') == null || await const FlutterSecureStorage().read(key: 'password') == null) {
return false;
} else {
return true;
@@ -15,18 +15,18 @@ abstract class CredentialsStorage {
static Future<Map<String, String>> getCredentialsFromStorage() async {
return {
'email': (await FlutterSecureStorage().read(key: 'email'))!,
'password': (await FlutterSecureStorage().read(key: 'password'))!,
'email': (await const FlutterSecureStorage().read(key: 'email'))!,
'password': (await const FlutterSecureStorage().read(key: 'password'))!,
};
}
static saveCredentials(String email, String password) async {
await FlutterSecureStorage().write(key: 'email', value: email);
await FlutterSecureStorage().write(key: 'password', value: password);
await const FlutterSecureStorage().write(key: 'email', value: email);
await const FlutterSecureStorage().write(key: 'password', value: password);
}
static removeCredentials() async {
await FlutterSecureStorage().delete(key: 'email');
await FlutterSecureStorage().delete(key: 'password');
await const FlutterSecureStorage().delete(key: 'email');
await const FlutterSecureStorage().delete(key: 'password');
}
}

View File

@@ -12,8 +12,7 @@ part of 'selection_popup_model.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$SelectionPopupModel {
@@ -32,9 +31,8 @@ mixin _$SelectionPopupModel {
/// @nodoc
abstract class $SelectionPopupModelCopyWith<$Res> {
factory $SelectionPopupModelCopyWith(
SelectionPopupModel value,
$Res Function(SelectionPopupModel) then,
) = _$SelectionPopupModelCopyWithImpl<$Res, SelectionPopupModel>;
SelectionPopupModel value, $Res Function(SelectionPopupModel) then) =
_$SelectionPopupModelCopyWithImpl<$Res, SelectionPopupModel>;
@useResult
$Res call({int? id, String title, dynamic value, bool isSelected});
}
@@ -59,41 +57,33 @@ class _$SelectionPopupModelCopyWithImpl<$Res, $Val extends SelectionPopupModel>
Object? value = freezed,
Object? isSelected = null,
}) {
return _then(
_value.copyWith(
id:
freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int?,
title:
null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
value:
freezed == value
? _value.value
: value // ignore: cast_nullable_to_non_nullable
as dynamic,
isSelected:
null == isSelected
? _value.isSelected
: isSelected // ignore: cast_nullable_to_non_nullable
as bool,
)
as $Val,
);
return _then(_value.copyWith(
id: freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int?,
title: null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
value: freezed == value
? _value.value
: value // ignore: cast_nullable_to_non_nullable
as dynamic,
isSelected: null == isSelected
? _value.isSelected
: isSelected // ignore: cast_nullable_to_non_nullable
as bool,
) as $Val);
}
}
/// @nodoc
abstract class _$$SelectionPopupModelImplCopyWith<$Res>
implements $SelectionPopupModelCopyWith<$Res> {
factory _$$SelectionPopupModelImplCopyWith(
_$SelectionPopupModelImpl value,
$Res Function(_$SelectionPopupModelImpl) then,
) = __$$SelectionPopupModelImplCopyWithImpl<$Res>;
factory _$$SelectionPopupModelImplCopyWith(_$SelectionPopupModelImpl value,
$Res Function(_$SelectionPopupModelImpl) then) =
__$$SelectionPopupModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int? id, String title, dynamic value, bool isSelected});
@@ -103,10 +93,9 @@ abstract class _$$SelectionPopupModelImplCopyWith<$Res>
class __$$SelectionPopupModelImplCopyWithImpl<$Res>
extends _$SelectionPopupModelCopyWithImpl<$Res, _$SelectionPopupModelImpl>
implements _$$SelectionPopupModelImplCopyWith<$Res> {
__$$SelectionPopupModelImplCopyWithImpl(
_$SelectionPopupModelImpl _value,
$Res Function(_$SelectionPopupModelImpl) _then,
) : super(_value, _then);
__$$SelectionPopupModelImplCopyWithImpl(_$SelectionPopupModelImpl _value,
$Res Function(_$SelectionPopupModelImpl) _then)
: super(_value, _then);
/// Create a copy of SelectionPopupModel
/// with the given fields replaced by the non-null parameter values.
@@ -118,42 +107,32 @@ class __$$SelectionPopupModelImplCopyWithImpl<$Res>
Object? value = freezed,
Object? isSelected = null,
}) {
return _then(
_$SelectionPopupModelImpl(
id:
freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int?,
title:
null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
value:
freezed == value
? _value.value
: value // ignore: cast_nullable_to_non_nullable
as dynamic,
isSelected:
null == isSelected
? _value.isSelected
: isSelected // ignore: cast_nullable_to_non_nullable
as bool,
),
);
return _then(_$SelectionPopupModelImpl(
id: freezed == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int?,
title: null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
value: freezed == value
? _value.value
: value // ignore: cast_nullable_to_non_nullable
as dynamic,
isSelected: null == isSelected
? _value.isSelected
: isSelected // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// @nodoc
class _$SelectionPopupModelImpl implements _SelectionPopupModel {
const _$SelectionPopupModelImpl({
this.id,
required this.title,
this.value,
this.isSelected = false,
});
const _$SelectionPopupModelImpl(
{this.id, required this.title, this.value, this.isSelected = false});
@override
final int? id;
@@ -183,13 +162,8 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel {
}
@override
int get hashCode => Object.hash(
runtimeType,
id,
title,
const DeepCollectionEquality().hash(value),
isSelected,
);
int get hashCode => Object.hash(runtimeType, id, title,
const DeepCollectionEquality().hash(value), isSelected);
/// Create a copy of SelectionPopupModel
/// with the given fields replaced by the non-null parameter values.
@@ -198,18 +172,15 @@ class _$SelectionPopupModelImpl implements _SelectionPopupModel {
@pragma('vm:prefer-inline')
_$$SelectionPopupModelImplCopyWith<_$SelectionPopupModelImpl> get copyWith =>
__$$SelectionPopupModelImplCopyWithImpl<_$SelectionPopupModelImpl>(
this,
_$identity,
);
this, _$identity);
}
abstract class _SelectionPopupModel implements SelectionPopupModel {
const factory _SelectionPopupModel({
final int? id,
required final String title,
final dynamic value,
final bool isSelected,
}) = _$SelectionPopupModelImpl;
const factory _SelectionPopupModel(
{final int? id,
required final String title,
final dynamic value,
final bool isSelected}) = _$SelectionPopupModelImpl;
@override
int? get id;

View File

@@ -0,0 +1,11 @@
import 'package:firebase_messaging/firebase_messaging.dart';
class FirebaseApi {
final _firebaseMessaging = FirebaseMessaging.instance;
Future<String?> getToken() async{
await _firebaseMessaging.requestPermission();
return await _firebaseMessaging.getToken();
}
}

View File

@@ -55,6 +55,7 @@ import 'package:eatvio_app/features/my_finance/services/cards_service.dart';
import 'package:eatvio_app/features/my_plans/presentation/cubit/my_plans_cubit.dart';
import 'package:eatvio_app/features/my_plans/repositories/my_diets_repository.dart';
import 'package:eatvio_app/features/my_plans/services/my_plans_service.dart';
import 'package:eatvio_app/features/order_info/cubit/order_info_cubit.dart';
import 'package:eatvio_app/features/plans/repositories/plans_repository.dart';
import 'package:eatvio_app/features/plans/services/plans_service.dart';
import 'package:eatvio_app/features/plans/presentation/cubit/about_plan_cubit.dart';
@@ -79,7 +80,7 @@ import 'package:eatvio_app/features/settings/services/settings_service.dart';
import 'package:eatvio_app/features/user_details/presentation/cubit/user_details_cubit.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:get_it/get_it.dart';
import 'package:eatvio_app/features/profile/presentation/bloc/plans_cubit/plans_cubit.dart' as profilePlans;
import 'package:eatvio_app/features/profile/presentation/bloc/plans_cubit/plans_cubit.dart' as profile_plans;
final sl = GetIt.instance;
@@ -94,13 +95,13 @@ Future<void> init() async {
// Cubit factories
sl.registerFactory<RegistrationCubit>(() => RegistrationCubit(registrationRepository: sl()));
sl.registerFactory<ChatRoomCubit>(() => ChatRoomCubit(chatRepository: sl(), wsManager: sl()));
sl.registerFactory<ChatRoomCubit>(() => ChatRoomCubit(cardsRepository: sl(), chatRepository: sl(), wsManager: sl()));
sl.registerFactory<RecipesCubit>(() => RecipesCubit(feedRepository: sl(), recipeRepository: sl(), aboutRecipeRepository: sl()));
sl.registerFactory<CalendarCubit>(() => CalendarCubit(calendarRepository: sl()));
sl.registerFactory<ProfileCubit>(() => ProfileCubit(profileRepository: sl(), chatRepository: sl()));
sl.registerFactory<profilePlans.PlansCubit>(() => profilePlans.PlansCubit(plansRepository: sl()));
sl.registerFactory<profile_plans.PlansCubit>(() => profile_plans.PlansCubit(plansRepository: sl()));
sl.registerFactory<DietsCubit>(() => DietsCubit(feedRepository: sl(), dietsRepository: sl()));
sl.registerFactory<CommentsCubit>(() => CommentsCubit(feedRepository: sl()));
sl.registerFactory<CommentsCubit>(() => CommentsCubit(feedRepository: sl()));
sl.registerFactory<PlansCubit>(() => PlansCubit(feedRepository: sl(), planRepository: sl()));
sl.registerFactory<SettingsCubit>(() => SettingsCubit(profileRepository: sl(), settingsRepository: sl()));
sl.registerFactory<RegisterConsultantCubit>(() => RegisterConsultantCubit(consultantRepository: sl()));
@@ -121,6 +122,7 @@ Future<void> init() async {
sl.registerFactory<AuthCubit>(() => AuthCubit(authRepository: sl()));
sl.registerFactory<ComplainingCubit>(() => ComplainingCubit(repository: sl()));
sl.registerFactory<UserCardsCubit>(() => UserCardsCubit(cardsRepository: sl()));
sl.registerFactory<OrderInfoCubit>(() => OrderInfoCubit(chatRepository: sl()));
// Repository
sl.registerLazySingleton<ChatRepository>(() => ChatRepository(chatService: sl()));
@@ -171,15 +173,7 @@ Future<void> init() async {
// External
sl.registerLazySingleton(
() => Dio(
BaseOptions(
baseUrl: baseUrl,
headers: {
'accept': 'application/json',
'content-type': 'application/json',
},
),
)..interceptors.add(TokenInterceptor()),
() => Dio(BaseOptions(baseUrl: baseUrl, headers: {'accept': 'application/json', 'content-type': 'application/json'}))..interceptors.add(TokenInterceptor()),
);
sl.registerLazySingleton(() async => await FlutterSecureStorage());
sl.registerLazySingleton(() async => const FlutterSecureStorage());
}

View File

@@ -12,8 +12,7 @@ part of 'pagination_model.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
Links _$LinksFromJson(Map<String, dynamic> json) {
return _Links.fromJson(json);
@@ -44,12 +43,11 @@ abstract class $LinksCopyWith<$Res> {
factory $LinksCopyWith(Links value, $Res Function(Links) then) =
_$LinksCopyWithImpl<$Res, Links>;
@useResult
$Res call({
@JsonKey(name: "first") String first,
@JsonKey(name: "last") String last,
@JsonKey(name: "prev") dynamic prev,
@JsonKey(name: "next") dynamic next,
});
$Res call(
{@JsonKey(name: "first") String first,
@JsonKey(name: "last") String last,
@JsonKey(name: "prev") dynamic prev,
@JsonKey(name: "next") dynamic next});
}
/// @nodoc
@@ -72,48 +70,39 @@ class _$LinksCopyWithImpl<$Res, $Val extends Links>
Object? prev = freezed,
Object? next = freezed,
}) {
return _then(
_value.copyWith(
first:
null == first
? _value.first
: first // ignore: cast_nullable_to_non_nullable
as String,
last:
null == last
? _value.last
: last // ignore: cast_nullable_to_non_nullable
as String,
prev:
freezed == prev
? _value.prev
: prev // ignore: cast_nullable_to_non_nullable
as dynamic,
next:
freezed == next
? _value.next
: next // ignore: cast_nullable_to_non_nullable
as dynamic,
)
as $Val,
);
return _then(_value.copyWith(
first: null == first
? _value.first
: first // ignore: cast_nullable_to_non_nullable
as String,
last: null == last
? _value.last
: last // ignore: cast_nullable_to_non_nullable
as String,
prev: freezed == prev
? _value.prev
: prev // ignore: cast_nullable_to_non_nullable
as dynamic,
next: freezed == next
? _value.next
: next // ignore: cast_nullable_to_non_nullable
as dynamic,
) as $Val);
}
}
/// @nodoc
abstract class _$$LinksImplCopyWith<$Res> implements $LinksCopyWith<$Res> {
factory _$$LinksImplCopyWith(
_$LinksImpl value,
$Res Function(_$LinksImpl) then,
) = __$$LinksImplCopyWithImpl<$Res>;
_$LinksImpl value, $Res Function(_$LinksImpl) then) =
__$$LinksImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: "first") String first,
@JsonKey(name: "last") String last,
@JsonKey(name: "prev") dynamic prev,
@JsonKey(name: "next") dynamic next,
});
$Res call(
{@JsonKey(name: "first") String first,
@JsonKey(name: "last") String last,
@JsonKey(name: "prev") dynamic prev,
@JsonKey(name: "next") dynamic next});
}
/// @nodoc
@@ -121,9 +110,8 @@ class __$$LinksImplCopyWithImpl<$Res>
extends _$LinksCopyWithImpl<$Res, _$LinksImpl>
implements _$$LinksImplCopyWith<$Res> {
__$$LinksImplCopyWithImpl(
_$LinksImpl _value,
$Res Function(_$LinksImpl) _then,
) : super(_value, _then);
_$LinksImpl _value, $Res Function(_$LinksImpl) _then)
: super(_value, _then);
/// Create a copy of Links
/// with the given fields replaced by the non-null parameter values.
@@ -135,42 +123,35 @@ class __$$LinksImplCopyWithImpl<$Res>
Object? prev = freezed,
Object? next = freezed,
}) {
return _then(
_$LinksImpl(
first:
null == first
? _value.first
: first // ignore: cast_nullable_to_non_nullable
as String,
last:
null == last
? _value.last
: last // ignore: cast_nullable_to_non_nullable
as String,
prev:
freezed == prev
? _value.prev
: prev // ignore: cast_nullable_to_non_nullable
as dynamic,
next:
freezed == next
? _value.next
: next // ignore: cast_nullable_to_non_nullable
as dynamic,
),
);
return _then(_$LinksImpl(
first: null == first
? _value.first
: first // ignore: cast_nullable_to_non_nullable
as String,
last: null == last
? _value.last
: last // ignore: cast_nullable_to_non_nullable
as String,
prev: freezed == prev
? _value.prev
: prev // ignore: cast_nullable_to_non_nullable
as dynamic,
next: freezed == next
? _value.next
: next // ignore: cast_nullable_to_non_nullable
as dynamic,
));
}
}
/// @nodoc
@JsonSerializable()
class _$LinksImpl implements _Links {
const _$LinksImpl({
@JsonKey(name: "first") required this.first,
@JsonKey(name: "last") required this.last,
@JsonKey(name: "prev") required this.prev,
@JsonKey(name: "next") required this.next,
});
const _$LinksImpl(
{@JsonKey(name: "first") required this.first,
@JsonKey(name: "last") required this.last,
@JsonKey(name: "prev") required this.prev,
@JsonKey(name: "next") required this.next});
factory _$LinksImpl.fromJson(Map<String, dynamic> json) =>
_$$LinksImplFromJson(json);
@@ -207,12 +188,11 @@ class _$LinksImpl implements _Links {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
first,
last,
const DeepCollectionEquality().hash(prev),
const DeepCollectionEquality().hash(next),
);
runtimeType,
first,
last,
const DeepCollectionEquality().hash(prev),
const DeepCollectionEquality().hash(next));
/// Create a copy of Links
/// with the given fields replaced by the non-null parameter values.
@@ -224,17 +204,18 @@ class _$LinksImpl implements _Links {
@override
Map<String, dynamic> toJson() {
return _$$LinksImplToJson(this);
return _$$LinksImplToJson(
this,
);
}
}
abstract class _Links implements Links {
const factory _Links({
@JsonKey(name: "first") required final String first,
@JsonKey(name: "last") required final String last,
@JsonKey(name: "prev") required final dynamic prev,
@JsonKey(name: "next") required final dynamic next,
}) = _$LinksImpl;
const factory _Links(
{@JsonKey(name: "first") required final String first,
@JsonKey(name: "last") required final String last,
@JsonKey(name: "prev") required final dynamic prev,
@JsonKey(name: "next") required final dynamic next}) = _$LinksImpl;
factory _Links.fromJson(Map<String, dynamic> json) = _$LinksImpl.fromJson;
@@ -300,18 +281,17 @@ abstract class $MetaCopyWith<$Res> {
factory $MetaCopyWith(Meta value, $Res Function(Meta) then) =
_$MetaCopyWithImpl<$Res, Meta>;
@useResult
$Res call({
@JsonKey(name: "current_page") int currentPage,
@JsonKey(name: "from") dynamic from,
@JsonKey(name: "last_page") int lastPage,
@JsonKey(name: "links") List<Link> links,
@JsonKey(name: "path") String? path,
@JsonKey(name: "per_page") int perPage,
@JsonKey(name: "to") dynamic to,
@JsonKey(name: "total") int total,
@JsonKey(name: "total_min_price") int? totalMinPrice,
@JsonKey(name: "total_max_price") int? totalMaxPrice,
});
$Res call(
{@JsonKey(name: "current_page") int currentPage,
@JsonKey(name: "from") dynamic from,
@JsonKey(name: "last_page") int lastPage,
@JsonKey(name: "links") List<Link> links,
@JsonKey(name: "path") String? path,
@JsonKey(name: "per_page") int perPage,
@JsonKey(name: "to") dynamic to,
@JsonKey(name: "total") int total,
@JsonKey(name: "total_min_price") int? totalMinPrice,
@JsonKey(name: "total_max_price") int? totalMaxPrice});
}
/// @nodoc
@@ -340,84 +320,69 @@ class _$MetaCopyWithImpl<$Res, $Val extends Meta>
Object? totalMinPrice = freezed,
Object? totalMaxPrice = freezed,
}) {
return _then(
_value.copyWith(
currentPage:
null == currentPage
? _value.currentPage
: currentPage // ignore: cast_nullable_to_non_nullable
as int,
from:
freezed == from
? _value.from
: from // ignore: cast_nullable_to_non_nullable
as dynamic,
lastPage:
null == lastPage
? _value.lastPage
: lastPage // ignore: cast_nullable_to_non_nullable
as int,
links:
null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
as List<Link>,
path:
freezed == path
? _value.path
: path // ignore: cast_nullable_to_non_nullable
as String?,
perPage:
null == perPage
? _value.perPage
: perPage // ignore: cast_nullable_to_non_nullable
as int,
to:
freezed == to
? _value.to
: to // ignore: cast_nullable_to_non_nullable
as dynamic,
total:
null == total
? _value.total
: total // ignore: cast_nullable_to_non_nullable
as int,
totalMinPrice:
freezed == totalMinPrice
? _value.totalMinPrice
: totalMinPrice // ignore: cast_nullable_to_non_nullable
as int?,
totalMaxPrice:
freezed == totalMaxPrice
? _value.totalMaxPrice
: totalMaxPrice // ignore: cast_nullable_to_non_nullable
as int?,
)
as $Val,
);
return _then(_value.copyWith(
currentPage: null == currentPage
? _value.currentPage
: currentPage // ignore: cast_nullable_to_non_nullable
as int,
from: freezed == from
? _value.from
: from // ignore: cast_nullable_to_non_nullable
as dynamic,
lastPage: null == lastPage
? _value.lastPage
: lastPage // ignore: cast_nullable_to_non_nullable
as int,
links: null == links
? _value.links
: links // ignore: cast_nullable_to_non_nullable
as List<Link>,
path: freezed == path
? _value.path
: path // ignore: cast_nullable_to_non_nullable
as String?,
perPage: null == perPage
? _value.perPage
: perPage // ignore: cast_nullable_to_non_nullable
as int,
to: freezed == to
? _value.to
: to // ignore: cast_nullable_to_non_nullable
as dynamic,
total: null == total
? _value.total
: total // ignore: cast_nullable_to_non_nullable
as int,
totalMinPrice: freezed == totalMinPrice
? _value.totalMinPrice
: totalMinPrice // ignore: cast_nullable_to_non_nullable
as int?,
totalMaxPrice: freezed == totalMaxPrice
? _value.totalMaxPrice
: totalMaxPrice // ignore: cast_nullable_to_non_nullable
as int?,
) as $Val);
}
}
/// @nodoc
abstract class _$$MetaImplCopyWith<$Res> implements $MetaCopyWith<$Res> {
factory _$$MetaImplCopyWith(
_$MetaImpl value,
$Res Function(_$MetaImpl) then,
) = __$$MetaImplCopyWithImpl<$Res>;
_$MetaImpl value, $Res Function(_$MetaImpl) then) =
__$$MetaImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: "current_page") int currentPage,
@JsonKey(name: "from") dynamic from,
@JsonKey(name: "last_page") int lastPage,
@JsonKey(name: "links") List<Link> links,
@JsonKey(name: "path") String? path,
@JsonKey(name: "per_page") int perPage,
@JsonKey(name: "to") dynamic to,
@JsonKey(name: "total") int total,
@JsonKey(name: "total_min_price") int? totalMinPrice,
@JsonKey(name: "total_max_price") int? totalMaxPrice,
});
$Res call(
{@JsonKey(name: "current_page") int currentPage,
@JsonKey(name: "from") dynamic from,
@JsonKey(name: "last_page") int lastPage,
@JsonKey(name: "links") List<Link> links,
@JsonKey(name: "path") String? path,
@JsonKey(name: "per_page") int perPage,
@JsonKey(name: "to") dynamic to,
@JsonKey(name: "total") int total,
@JsonKey(name: "total_min_price") int? totalMinPrice,
@JsonKey(name: "total_max_price") int? totalMaxPrice});
}
/// @nodoc
@@ -425,7 +390,7 @@ class __$$MetaImplCopyWithImpl<$Res>
extends _$MetaCopyWithImpl<$Res, _$MetaImpl>
implements _$$MetaImplCopyWith<$Res> {
__$$MetaImplCopyWithImpl(_$MetaImpl _value, $Res Function(_$MetaImpl) _then)
: super(_value, _then);
: super(_value, _then);
/// Create a copy of Meta
/// with the given fields replaced by the non-null parameter values.
@@ -443,78 +408,66 @@ class __$$MetaImplCopyWithImpl<$Res>
Object? totalMinPrice = freezed,
Object? totalMaxPrice = freezed,
}) {
return _then(
_$MetaImpl(
currentPage:
null == currentPage
? _value.currentPage
: currentPage // ignore: cast_nullable_to_non_nullable
as int,
from:
freezed == from
? _value.from
: from // ignore: cast_nullable_to_non_nullable
as dynamic,
lastPage:
null == lastPage
? _value.lastPage
: lastPage // ignore: cast_nullable_to_non_nullable
as int,
links:
null == links
? _value._links
: links // ignore: cast_nullable_to_non_nullable
as List<Link>,
path:
freezed == path
? _value.path
: path // ignore: cast_nullable_to_non_nullable
as String?,
perPage:
null == perPage
? _value.perPage
: perPage // ignore: cast_nullable_to_non_nullable
as int,
to:
freezed == to
? _value.to
: to // ignore: cast_nullable_to_non_nullable
as dynamic,
total:
null == total
? _value.total
: total // ignore: cast_nullable_to_non_nullable
as int,
totalMinPrice:
freezed == totalMinPrice
? _value.totalMinPrice
: totalMinPrice // ignore: cast_nullable_to_non_nullable
as int?,
totalMaxPrice:
freezed == totalMaxPrice
? _value.totalMaxPrice
: totalMaxPrice // ignore: cast_nullable_to_non_nullable
as int?,
),
);
return _then(_$MetaImpl(
currentPage: null == currentPage
? _value.currentPage
: currentPage // ignore: cast_nullable_to_non_nullable
as int,
from: freezed == from
? _value.from
: from // ignore: cast_nullable_to_non_nullable
as dynamic,
lastPage: null == lastPage
? _value.lastPage
: lastPage // ignore: cast_nullable_to_non_nullable
as int,
links: null == links
? _value._links
: links // ignore: cast_nullable_to_non_nullable
as List<Link>,
path: freezed == path
? _value.path
: path // ignore: cast_nullable_to_non_nullable
as String?,
perPage: null == perPage
? _value.perPage
: perPage // ignore: cast_nullable_to_non_nullable
as int,
to: freezed == to
? _value.to
: to // ignore: cast_nullable_to_non_nullable
as dynamic,
total: null == total
? _value.total
: total // ignore: cast_nullable_to_non_nullable
as int,
totalMinPrice: freezed == totalMinPrice
? _value.totalMinPrice
: totalMinPrice // ignore: cast_nullable_to_non_nullable
as int?,
totalMaxPrice: freezed == totalMaxPrice
? _value.totalMaxPrice
: totalMaxPrice // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$MetaImpl implements _Meta {
const _$MetaImpl({
@JsonKey(name: "current_page") required this.currentPage,
@JsonKey(name: "from") required this.from,
@JsonKey(name: "last_page") required this.lastPage,
@JsonKey(name: "links") required final List<Link> links,
@JsonKey(name: "path") this.path,
@JsonKey(name: "per_page") required this.perPage,
@JsonKey(name: "to") required this.to,
@JsonKey(name: "total") required this.total,
@JsonKey(name: "total_min_price") this.totalMinPrice,
@JsonKey(name: "total_max_price") this.totalMaxPrice,
}) : _links = links;
const _$MetaImpl(
{@JsonKey(name: "current_page") required this.currentPage,
@JsonKey(name: "from") required this.from,
@JsonKey(name: "last_page") required this.lastPage,
@JsonKey(name: "links") required final List<Link> links,
@JsonKey(name: "path") this.path,
@JsonKey(name: "per_page") required this.perPage,
@JsonKey(name: "to") required this.to,
@JsonKey(name: "total") required this.total,
@JsonKey(name: "total_min_price") this.totalMinPrice,
@JsonKey(name: "total_max_price") this.totalMaxPrice})
: _links = links;
factory _$MetaImpl.fromJson(Map<String, dynamic> json) =>
_$$MetaImplFromJson(json);
@@ -585,18 +538,17 @@ class _$MetaImpl implements _Meta {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
currentPage,
const DeepCollectionEquality().hash(from),
lastPage,
const DeepCollectionEquality().hash(_links),
path,
perPage,
const DeepCollectionEquality().hash(to),
total,
totalMinPrice,
totalMaxPrice,
);
runtimeType,
currentPage,
const DeepCollectionEquality().hash(from),
lastPage,
const DeepCollectionEquality().hash(_links),
path,
perPage,
const DeepCollectionEquality().hash(to),
total,
totalMinPrice,
totalMaxPrice);
/// Create a copy of Meta
/// with the given fields replaced by the non-null parameter values.
@@ -608,23 +560,24 @@ class _$MetaImpl implements _Meta {
@override
Map<String, dynamic> toJson() {
return _$$MetaImplToJson(this);
return _$$MetaImplToJson(
this,
);
}
}
abstract class _Meta implements Meta {
const factory _Meta({
@JsonKey(name: "current_page") required final int currentPage,
@JsonKey(name: "from") required final dynamic from,
@JsonKey(name: "last_page") required final int lastPage,
@JsonKey(name: "links") required final List<Link> links,
@JsonKey(name: "path") final String? path,
@JsonKey(name: "per_page") required final int perPage,
@JsonKey(name: "to") required final dynamic to,
@JsonKey(name: "total") required final int total,
@JsonKey(name: "total_min_price") final int? totalMinPrice,
@JsonKey(name: "total_max_price") final int? totalMaxPrice,
}) = _$MetaImpl;
const factory _Meta(
{@JsonKey(name: "current_page") required final int currentPage,
@JsonKey(name: "from") required final dynamic from,
@JsonKey(name: "last_page") required final int lastPage,
@JsonKey(name: "links") required final List<Link> links,
@JsonKey(name: "path") final String? path,
@JsonKey(name: "per_page") required final int perPage,
@JsonKey(name: "to") required final dynamic to,
@JsonKey(name: "total") required final int total,
@JsonKey(name: "total_min_price") final int? totalMinPrice,
@JsonKey(name: "total_max_price") final int? totalMaxPrice}) = _$MetaImpl;
factory _Meta.fromJson(Map<String, dynamic> json) = _$MetaImpl.fromJson;
@@ -694,11 +647,10 @@ abstract class $LinkCopyWith<$Res> {
factory $LinkCopyWith(Link value, $Res Function(Link) then) =
_$LinkCopyWithImpl<$Res, Link>;
@useResult
$Res call({
@JsonKey(name: "url") String? url,
@JsonKey(name: "label") String? label,
@JsonKey(name: "active") bool? active,
});
$Res call(
{@JsonKey(name: "url") String? url,
@JsonKey(name: "label") String? label,
@JsonKey(name: "active") bool? active});
}
/// @nodoc
@@ -720,42 +672,34 @@ class _$LinkCopyWithImpl<$Res, $Val extends Link>
Object? label = freezed,
Object? active = freezed,
}) {
return _then(
_value.copyWith(
url:
freezed == url
? _value.url
: url // ignore: cast_nullable_to_non_nullable
as String?,
label:
freezed == label
? _value.label
: label // ignore: cast_nullable_to_non_nullable
as String?,
active:
freezed == active
? _value.active
: active // ignore: cast_nullable_to_non_nullable
as bool?,
)
as $Val,
);
return _then(_value.copyWith(
url: freezed == url
? _value.url
: url // ignore: cast_nullable_to_non_nullable
as String?,
label: freezed == label
? _value.label
: label // ignore: cast_nullable_to_non_nullable
as String?,
active: freezed == active
? _value.active
: active // ignore: cast_nullable_to_non_nullable
as bool?,
) as $Val);
}
}
/// @nodoc
abstract class _$$LinkImplCopyWith<$Res> implements $LinkCopyWith<$Res> {
factory _$$LinkImplCopyWith(
_$LinkImpl value,
$Res Function(_$LinkImpl) then,
) = __$$LinkImplCopyWithImpl<$Res>;
_$LinkImpl value, $Res Function(_$LinkImpl) then) =
__$$LinkImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: "url") String? url,
@JsonKey(name: "label") String? label,
@JsonKey(name: "active") bool? active,
});
$Res call(
{@JsonKey(name: "url") String? url,
@JsonKey(name: "label") String? label,
@JsonKey(name: "active") bool? active});
}
/// @nodoc
@@ -763,7 +707,7 @@ class __$$LinkImplCopyWithImpl<$Res>
extends _$LinkCopyWithImpl<$Res, _$LinkImpl>
implements _$$LinkImplCopyWith<$Res> {
__$$LinkImplCopyWithImpl(_$LinkImpl _value, $Res Function(_$LinkImpl) _then)
: super(_value, _then);
: super(_value, _then);
/// Create a copy of Link
/// with the given fields replaced by the non-null parameter values.
@@ -774,36 +718,30 @@ class __$$LinkImplCopyWithImpl<$Res>
Object? label = freezed,
Object? active = freezed,
}) {
return _then(
_$LinkImpl(
url:
freezed == url
? _value.url
: url // ignore: cast_nullable_to_non_nullable
as String?,
label:
freezed == label
? _value.label
: label // ignore: cast_nullable_to_non_nullable
as String?,
active:
freezed == active
? _value.active
: active // ignore: cast_nullable_to_non_nullable
as bool?,
),
);
return _then(_$LinkImpl(
url: freezed == url
? _value.url
: url // ignore: cast_nullable_to_non_nullable
as String?,
label: freezed == label
? _value.label
: label // ignore: cast_nullable_to_non_nullable
as String?,
active: freezed == active
? _value.active
: active // ignore: cast_nullable_to_non_nullable
as bool?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$LinkImpl implements _Link {
const _$LinkImpl({
@JsonKey(name: "url") this.url,
@JsonKey(name: "label") this.label,
@JsonKey(name: "active") this.active,
});
const _$LinkImpl(
{@JsonKey(name: "url") this.url,
@JsonKey(name: "label") this.label,
@JsonKey(name: "active") this.active});
factory _$LinkImpl.fromJson(Map<String, dynamic> json) =>
_$$LinkImplFromJson(json);
@@ -847,16 +785,17 @@ class _$LinkImpl implements _Link {
@override
Map<String, dynamic> toJson() {
return _$$LinkImplToJson(this);
return _$$LinkImplToJson(
this,
);
}
}
abstract class _Link implements Link {
const factory _Link({
@JsonKey(name: "url") final String? url,
@JsonKey(name: "label") final String? label,
@JsonKey(name: "active") final bool? active,
}) = _$LinkImpl;
const factory _Link(
{@JsonKey(name: "url") final String? url,
@JsonKey(name: "label") final String? label,
@JsonKey(name: "active") final bool? active}) = _$LinkImpl;
factory _Link.fromJson(Map<String, dynamic> json) = _$LinkImpl.fromJson;

View File

@@ -7,11 +7,11 @@ part of 'pagination_model.dart';
// **************************************************************************
_$LinksImpl _$$LinksImplFromJson(Map<String, dynamic> json) => _$LinksImpl(
first: json['first'] as String,
last: json['last'] as String,
prev: json['prev'],
next: json['next'],
);
first: json['first'] as String,
last: json['last'] as String,
prev: json['prev'],
next: json['next'],
);
Map<String, dynamic> _$$LinksImplToJson(_$LinksImpl instance) =>
<String, dynamic>{
@@ -22,20 +22,19 @@ Map<String, dynamic> _$$LinksImplToJson(_$LinksImpl instance) =>
};
_$MetaImpl _$$MetaImplFromJson(Map<String, dynamic> json) => _$MetaImpl(
currentPage: (json['current_page'] as num).toInt(),
from: json['from'],
lastPage: (json['last_page'] as num).toInt(),
links:
(json['links'] as List<dynamic>)
currentPage: (json['current_page'] as num).toInt(),
from: json['from'],
lastPage: (json['last_page'] as num).toInt(),
links: (json['links'] as List<dynamic>)
.map((e) => Link.fromJson(e as Map<String, dynamic>))
.toList(),
path: json['path'] as String?,
perPage: (json['per_page'] as num).toInt(),
to: json['to'],
total: (json['total'] as num).toInt(),
totalMinPrice: (json['total_min_price'] as num?)?.toInt(),
totalMaxPrice: (json['total_max_price'] as num?)?.toInt(),
);
path: json['path'] as String?,
perPage: (json['per_page'] as num).toInt(),
to: json['to'],
total: (json['total'] as num).toInt(),
totalMinPrice: (json['total_min_price'] as num?)?.toInt(),
totalMaxPrice: (json['total_max_price'] as num?)?.toInt(),
);
Map<String, dynamic> _$$MetaImplToJson(_$MetaImpl instance) =>
<String, dynamic>{
@@ -52,10 +51,10 @@ Map<String, dynamic> _$$MetaImplToJson(_$MetaImpl instance) =>
};
_$LinkImpl _$$LinkImplFromJson(Map<String, dynamic> json) => _$LinkImpl(
url: json['url'] as String?,
label: json['label'] as String?,
active: json['active'] as bool?,
);
url: json['url'] as String?,
label: json['label'] as String?,
active: json['active'] as bool?,
);
Map<String, dynamic> _$$LinkImplToJson(_$LinkImpl instance) =>
<String, dynamic>{

View File

@@ -80,7 +80,7 @@ class BorderRadiusStyle {
color: appTheme.black900.withValues(alpha: 0.15),
spreadRadius: 2,
blurRadius: 2,
offset: Offset(
offset: const Offset(
0,
2,
),
@@ -110,15 +110,15 @@ class BorderRadiusStyle {
);
// Custom borders
static BorderRadius get customBorderBL8 => BorderRadius.only(
static BorderRadius get customBorderBL8 => const BorderRadius.only(
bottomLeft: Radius.circular(8),
);
static BorderRadius get customBorderTL5 => BorderRadius.vertical(
static BorderRadius get customBorderTL5 => const BorderRadius.vertical(
top: Radius.circular(5),
);
static BorderRadius get customBorderTL51 => BorderRadius.only(
static BorderRadius get customBorderTL51 => const BorderRadius.only(
topLeft: Radius.circular(5),
bottomRight: Radius.circular(5),
);

View File

@@ -5,15 +5,15 @@ import 'package:google_fonts/google_fonts.dart';
/// Helper class for managing themes and colors.
class ThemeHelper {
// The current app theme
var _appTheme = 'primary';
final _appTheme = 'primary';
// A map of custom color themes supported by the app
Map<String, PrimaryColors> _supportedCustomColor = {
final Map<String, PrimaryColors> _supportedCustomColor = {
'primary': PrimaryColors(),
};
// A map of color schemes supported by the app
Map<String, ColorScheme> _supportedColorScheme = {
final Map<String, ColorScheme> _supportedColorScheme = {
'primary': ColorSchemes.primaryColorScheme,
};
@@ -46,7 +46,7 @@ class ThemeHelper {
visualDensity: VisualDensity.standard,
colorScheme: colorScheme,
scaffoldBackgroundColor: colorScheme.onPrimary,
appBarTheme: AppBarTheme(
appBarTheme: const AppBarTheme(
scrolledUnderElevation: 0,
elevation: 0,
systemOverlayStyle: SystemUiOverlayStyle(
@@ -86,7 +86,7 @@ class ThemeHelper {
/// Class containing the supported color schemes.
class ColorSchemes {
static final primaryColorScheme = ColorScheme.light(
static const primaryColorScheme = ColorScheme.light(
// Primary colors
primary: Color(0XFF323F4B),
@@ -99,102 +99,103 @@ class ColorSchemes {
/// Class containing custom colors for a primary theme.
class PrimaryColors {
// Blue
Color get blue400 => Color(0XFF43A6F2);
Color get blue400 => const Color(0XFF43A6F2);
Color get blueA400 => Color(0XFF2F80ED);
Color get blueA400 => const Color(0XFF2F80ED);
// BlueGray
Color get blueGray400 => Color(0XFF7B8794);
Color get blueGray400 => const Color(0XFF7B8794);
Color get black900 => Color(0XFF000000);
Color get black900 => const Color(0XFF000000);
// Blue
Color get blue800 => Color(0XFF1F78B4);
Color get blue800 => const Color(0XFF1F78B4);
// BlueGray
Color get blueGray300 => Color(0XFF9AA5B1);
Color get blueGray300 => const Color(0XFF9AA5B1);
Color get black => Color(0XFF323F4B);
Color get black => const Color(0XFF323F4B);
Color get blueGray900 => Color(0XFF2A2F4C);
Color get blueGray900 => const Color(0XFF2A2F4C);
// DeepOrange
Color get deepOrange900 => Color(0XFF9A4A00);
Color get deepOrange900 => const Color(0XFF9A4A00);
// Gray
Color get gray100 => Color(0XFFF0F2F5);
Color get gray100 => const Color(0XFFF0F2F5);
Color get gray200 => Color(0XFFF0F0F0);
Color get gray200 => const Color(0XFFF0F0F0);
Color get gray400 => Color(0XFFC1C1C1);
Color get gray400 => const Color(0XFFC1C1C1);
Color get gray40001 => Color(0XFFC8C8C8);
Color get gray40001 => const Color(0XFFC8C8C8);
Color get gray50 => Color(0XFFF6FAFF);
Color get gray50 => const Color(0XFFF6FAFF);
Color get gray500 => Color(0XFFA3A3A3);
Color get gray500 => const Color(0XFFA3A3A3);
Color get gray600 => Color(0XFF6D6D6D);
Color get gray600 => const Color(0XFF6D6D6D);
Color get gray60001 => Color(0XFF848484);
Color get gray60001 => const Color(0XFF848484);
Color get gray60002 => Color(0XFF757575);
Color get gray60002 => const Color(0XFF757575);
Color get gray60003 => Color(0XFF707070);
Color get gray60003 => const Color(0XFF707070);
// Green
Color get greenA700 => Color(0XFF019A3E);
Color get greenA700 => const Color(0XFF019A3E);
Color get greenA70001 => Color(0XFF00BE13);
Color get greenA70001 => const Color(0XFF00BE13);
// LightGreen
Color get lightGreen300 => Color(0XFFB2DF8A);
Color get lightGreen300 => const Color(0XFFB2DF8A);
Color get lightGreenA700 => Color(0XFF18FF14);
Color get lightGreenA700 => const Color(0XFF18FF14);
// Red
Color get red200 => Color(0XFFE3A6A6);
Color get red200 => const Color(0XFFE3A6A6);
// Teal
Color get teal100 => Color(0XFFA6CEE3);
Color get teal100 => const Color(0XFFA6CEE3);
Color get teal900 => Color(0XFF0B3F56);
Color get teal900 => const Color(0XFF0B3F56);
// White
Color get whiteA700 => Color(0XFFFFFFFF);
Color get whiteA700 => const Color(0XFFFFFFFF);
Color get backgroundAvatar => Color(0xFFEBF4FF);
Color get backgroundAvatar => const Color(0xFFEBF4FF);
Color get cardBackground => Color(0xFFF7FAFF);
Color get cardBackground => const Color(0xFFF7FAFF);
Color get dividerColor => Color(0xFFF1F2F6);
Color get dividerColor => const Color(0xFFF1F2F6);
Color get gray => Color(0xFF6D6F71);
Color get gray => const Color(0xFF6D6F71);
Color get lightGray600 => Color(0xFFB0B0B0);
Color get lightGray600 => const Color(0xFFB0B0B0);
Color get lightGray => Color(0xFFCECECE);
Color get lightGray => const Color(0xFFCECECE);
Color get transparentBlue => Color(0xFF2F80ED).withValues(alpha: 0.1);
Color get transparentBlue => const Color(0xFF2F80ED).withValues(alpha: 0.1);
Color get lightGray0 => Color(0xFFF6F6F6);
Color get lightGray0 => const Color(0xFFF6F6F6);
Color get lightGray00 => Color(0xFFE9E9EA);
Color get lightGray00 => const Color(0xFFE9E9EA);
Color get dottedBorder => Color(0xFFE6E6E6);
Color get dottedBorder => const Color(0xFFE6E6E6);
Color get red => Color(0xFFCD4141);
Color get strongRed => Color(0xFFD01717);
Color get red => const Color(0xFFCD4141);
Color get strongRed => const Color(0xFFD01717);
Color get transparentRed => Color(0xFFCD4141).withValues(alpha: 0.75);
Color get transparentRed => const Color(0xFFCD4141).withValues(alpha: 0.75);
Color get transparentBlack => Color(0xFF1313264).withValues(alpha: 0.3);
// ignore: use_full_hex_values_for_flutter_colors
Color get transparentBlack => const Color(0xff1313264).withValues(alpha: 0.3);
Color get gray60004 => Color(0xFFD4DAE2).withValues(alpha: 0.2);
Color get gray60004 => const Color(0xFFD4DAE2).withValues(alpha: 0.2);
Color get blueGray => Color(0xFF809CB9);
Color get blueGray => const Color(0xFF809CB9);
Color get dialogShadow => Color.fromARGB(125, 0, 0, 0);
Color get dialogShadow => const Color.fromARGB(125, 0, 0, 0);
}
PrimaryColors get appTheme => ThemeHelper().themeColor();

View File

@@ -3,7 +3,7 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
abstract class TokenStorage {
static Future<bool> haveTokenInStorage() async {
try {
if (await FlutterSecureStorage().read(key: 'token') == null) {
if (await const FlutterSecureStorage().read(key: 'token') == null) {
return false;
} else {
return true;
@@ -13,11 +13,11 @@ abstract class TokenStorage {
}
}
static Future<String?> getTokenFromStorage() async => await FlutterSecureStorage().read(key: 'token');
static Future<String?> getTokenFromStorage() async => await const FlutterSecureStorage().read(key: 'token');
static saveTokenInStorage(String token) async {
await FlutterSecureStorage().write(key: 'token', value: token);
await const FlutterSecureStorage().write(key: 'token', value: token);
}
static Future<void> removeTokenInStorage() async => (await FlutterSecureStorage().delete(key: 'token'));
static Future<void> removeTokenInStorage() async => (await const FlutterSecureStorage().delete(key: 'token'));
}

View File

@@ -3,11 +3,11 @@ import 'package:eatvio_app/generated/l10n.dart';
String getLocalizedMeasurementUnits(S s, Portion portion) {
switch (portion) {
case Portion.GRAMS:
case Portion.grams:
return s.gr;
case Portion.MILLILITERS:
case Portion.milliliters:
return s.milliliter;
case Portion.PCS:
case Portion.pcs:
return s.pcs;
}
}

View File

@@ -27,7 +27,7 @@ class WsManager {
Stream<ChannelReadEvent>? get clientTypingStream => _privateDirectChatChannel?.bind('client-typing');
Future<void> initialize() async {
if (this.client == null) {
if (client == null) {
try {
await TokenStorage.haveTokenInStorage();
final wsUrl = await wsService.getWebsocket();
@@ -37,7 +37,7 @@ class WsManager {
key: wsUrl.key,
host: wsUrl.host,
shouldSupplyMetadataQueries: true,
metadata: PusherChannelsOptionsMetadata.byDefault(),
metadata: const PusherChannelsOptionsMetadata.byDefault(),
port: 443,
);
client = PusherChannelsClient.websocket(
@@ -58,7 +58,7 @@ class WsManager {
await client?.connect();
this.client = client;
client = client;
userId = wsUrl.userId;
await _initPrivateNotificationsChannel();
@@ -82,10 +82,10 @@ class WsManager {
Future<void> _initPrivateNotificationsChannel() async {
final token = await TokenStorage.getTokenFromStorage();
_privateNotificationChannel = await client?.privateChannel(
_privateNotificationChannel = client?.privateChannel(
'$newNotificationsChannelName.$userId',
authorizationDelegate: EndpointAuthorizableChannelTokenAuthorizationDelegate.forPrivateChannel(
authorizationEndpoint: Uri.parse(baseUrl + '/broadcasting/auth'),
authorizationEndpoint: Uri.parse('$baseUrl/broadcasting/auth'),
headers: {
'Authorization': 'Bearer $token',
},
@@ -95,10 +95,10 @@ class WsManager {
Future<void> _initPrivateMessagesChannel() async {
final token = await TokenStorage.getTokenFromStorage();
_privateMessagesChannel = await client?.privateChannel(
_privateMessagesChannel = client?.privateChannel(
'$newMessagesChannelName.$userId',
authorizationDelegate: EndpointAuthorizableChannelTokenAuthorizationDelegate.forPrivateChannel(
authorizationEndpoint: Uri.parse(baseUrl + '/broadcasting/auth'),
authorizationEndpoint: Uri.parse('$baseUrl/broadcasting/auth'),
headers: {
'Authorization': 'Bearer $token',
},
@@ -108,10 +108,10 @@ class WsManager {
Future<void> initPrivateDirectChatChannel(String chatId) async {
final token = await TokenStorage.getTokenFromStorage();
_privateDirectChatChannel = await client?.privateChannel(
_privateDirectChatChannel = client?.privateChannel(
'$directChatChannelName.$chatId',
authorizationDelegate: EndpointAuthorizableChannelTokenAuthorizationDelegate.forPrivateChannel(
authorizationEndpoint: Uri.parse(baseUrl + '/broadcasting/auth'),
authorizationEndpoint: Uri.parse('$baseUrl/broadcasting/auth'),
headers: {
'Authorization': 'Bearer $token',
},

View File

@@ -18,12 +18,12 @@ class AddItemButton extends StatelessWidget {
color: appTheme.blueA400,
shape: BoxShape.circle,
),
width: 40,
height: 40,
child: Icon(
Icons.add_rounded,
color: appTheme.gray100,
),
width: 40,
height: 40,
),
);
}

View File

@@ -3,7 +3,7 @@ import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:flutter/material.dart';
class AnimatedOptionButton extends StatelessWidget {
const AnimatedOptionButton({required this.text, required this.isSelected, required this.onTap, this.textStyle});
const AnimatedOptionButton({super.key, required this.text, required this.isSelected, required this.onTap, this.textStyle});
final String text;
final bool isSelected;
final void Function() onTap;

View File

@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
class BaseButton extends StatelessWidget {
BaseButton({
Key? key,
const BaseButton({
super.key,
required this.text,
this.onPressed,
this.buttonStyle,
@@ -12,9 +12,7 @@ class BaseButton extends StatelessWidget {
this.width,
this.margin,
this.alignment,
}) : super(
key: key,
);
});
final String text;

View File

@@ -32,7 +32,7 @@ Future<void> showBottomSheetWithBlur({
child: Container(
height: height,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
),

View File

@@ -15,31 +15,31 @@ class CpfcContainer extends StatelessWidget {
final s = S.of(context);
return Container(
color: appTheme.cardBackground,
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
Text('${calories.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
Text(calories.toStringAsFixed(roundDigit), style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
Text(s.calories, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
],
),
Column(
children: [
Text('${proteins.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
Text(proteins.toStringAsFixed(roundDigit), style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
Text(s.proteins, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
],
),
Column(
children: [
Text('${fats.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
Text(fats.toStringAsFixed(roundDigit), style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
Text(s.fats, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
],
),
Column(
children: [
Text('${carbohydrates.toStringAsFixed(roundDigit)}', style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
Text(carbohydrates.toStringAsFixed(roundDigit), style: TextStyles.textMSemibold.copyWith(color: appTheme.black)),
Text(s.carbohydrates, style: TextStyles.textXSSemibold.copyWith(color: appTheme.black)),
],
),

View File

@@ -2,7 +2,7 @@ import 'package:eatvio_app/core/data/selectionPopupModel/selection_popup_model.d
import 'package:flutter/material.dart';
class CustomDropDown extends StatelessWidget {
const CustomDropDown({
const CustomDropDown({super.key,
this.alignment,
this.width,
this.focusNode,
@@ -59,7 +59,7 @@ class CustomDropDown extends StatelessWidget {
_buildDropDownWidget(BuildContext context) {
return DropdownButtonFormField<SelectionPopupModel>(
focusNode: focusNode ?? FocusNode(),
icon: Icon(Icons.keyboard_arrow_down_rounded),
icon: const Icon(Icons.keyboard_arrow_down_rounded),
autofocus: autofocus!,
value: value,
isDense: true,
@@ -70,7 +70,7 @@ class CustomDropDown extends StatelessWidget {
child: Text(
item.title,
style: hintStyle ??
TextStyle(
const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w400,
color: Colors.black,
@@ -90,7 +90,7 @@ class CustomDropDown extends StatelessWidget {
InputDecoration _buildInputDecoration(BuildContext context) {
return InputDecoration(
labelStyle: TextStyle(
labelStyle: const TextStyle(
fontSize: 16,
color: Colors.black,
fontWeight: FontWeight.w400,
@@ -108,19 +108,19 @@ class CustomDropDown extends StatelessWidget {
suffixIcon: suffix,
isDense: true,
suffixIconConstraints: suffixConstraints,
contentPadding: EdgeInsets.symmetric(vertical: 16, horizontal: 12),
fillColor: Color(0xFFF6F6F6),
contentPadding: const EdgeInsets.symmetric(vertical: 16, horizontal: 12),
fillColor: const Color(0xFFF6F6F6),
filled: filled,
border: OutlineInputBorder(
borderRadius: const BorderRadius.all(Radius.circular(20)),
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide.none,
),
enabledBorder: OutlineInputBorder(
borderRadius: const BorderRadius.all(Radius.circular(20)),
enabledBorder: const OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide.none,
),
focusedBorder: OutlineInputBorder(
borderRadius: const BorderRadius.all(Radius.circular(20)),
focusedBorder: const OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide.none,
),
);

View File

@@ -3,32 +3,21 @@ import 'package:eatvio_app/core/widgets/base_button.dart';
import 'package:flutter/material.dart';
class CustomOutlinedButton extends BaseButton {
CustomOutlinedButton({
Key? key,
const CustomOutlinedButton({super.key,
this.decoration,
this.leftIcon,
this.rightIcon,
this.label,
VoidCallback? onPressed,
ButtonStyle? buttonStyle,
TextStyle? buttonTextStyle,
bool? isDisabled,
Alignment? alignment,
double? height,
double? width,
EdgeInsets? margin,
required String text,
}) : super(
text: text,
onPressed: onPressed,
buttonStyle: buttonStyle,
isDisabled: isDisabled,
buttonTextStyle: buttonTextStyle,
height: height,
alignment: alignment,
width: width,
margin: margin,
);
super.onPressed,
super.buttonStyle,
super.buttonTextStyle,
super.isDisabled,
super.alignment,
super.height,
super.width,
super.margin,
required super.text,
});
final BoxDecoration? decoration;
final Widget? leftIcon;
@@ -41,8 +30,8 @@ class CustomOutlinedButton extends BaseButton {
return Align(
alignment: alignment ?? Alignment.center,
child: Container(
height: this.height ?? 30,
width: this.width ?? double.maxFinite,
height: height ?? 30,
width: width ?? double.maxFinite,
margin: margin,
decoration: decoration,
child: OutlinedButton(
@@ -52,12 +41,12 @@ class CustomOutlinedButton extends BaseButton {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
leftIcon ?? SizedBox.shrink(),
leftIcon ?? const SizedBox.shrink(),
Text(
text,
style: buttonTextStyle ?? CustomTextStyles.titleSmallBold,
),
rightIcon ?? SizedBox.shrink(),
rightIcon ?? const SizedBox.shrink(),
],
),
),
@@ -65,8 +54,8 @@ class CustomOutlinedButton extends BaseButton {
);
} else {
return Container(
height: this.height ?? 30,
width: this.width ?? double.maxFinite,
height: height ?? 30,
width: width ?? double.maxFinite,
margin: margin,
decoration: decoration,
child: OutlinedButton(
@@ -76,12 +65,12 @@ class CustomOutlinedButton extends BaseButton {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
leftIcon ?? SizedBox.shrink(),
leftIcon ?? const SizedBox.shrink(),
Text(
text,
style: buttonTextStyle ?? CustomTextStyles.titleSmallBold,
),
rightIcon ?? SizedBox.shrink(),
rightIcon ?? const SizedBox.shrink(),
],
),
),

View File

@@ -16,9 +16,10 @@ class CustomSearchBar extends StatelessWidget {
height: 40,
width: width ?? MediaQuery.of(context).size.width - 84,
child: TextFormField(
textCapitalization: TextCapitalization.sentences,
controller: searchController,
autofocus: false,
style: TextStyle(
style: const TextStyle(
fontSize: 12,
),
onChanged: onChanged,
@@ -37,7 +38,7 @@ class CustomSearchBar extends StatelessWidget {
)
: null,
isDense: false,
contentPadding: enableIcon ? EdgeInsets.all(8) : EdgeInsets.only(top: 8, left: 16, right: 8, bottom: 8),
contentPadding: enableIcon ? const EdgeInsets.all(8) : const EdgeInsets.only(top: 8, left: 16, right: 8, bottom: 8),
fillColor: backgroundColor ?? appTheme.gray100,
filled: true,
border: OutlineInputBorder(

View File

@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class CustomTextFormField extends StatelessWidget {
CustomTextFormField({
const CustomTextFormField({
this.alignment,
this.width,
this.controller,
@@ -80,8 +80,10 @@ class CustomTextFormField extends StatelessWidget {
final TextAlignVertical? textAlignVertical;
final bool hasError;
final bool enabled;
// final TextAlign
final bool readOnly;
@override
Widget build(BuildContext context) {
return Align(
@@ -95,56 +97,39 @@ class CustomTextFormField extends StatelessWidget {
maxLength: maxLength,
onChanged: onChanged,
controller: controller,
focusNode: focusNode ?? null,
focusNode: focusNode,
autofocus: autofocus,
style: TextStyle(
fontSize: 16,
color: Colors.black,
fontWeight: FontWeight.w500,
),
style: const TextStyle(fontSize: 16, color: Colors.black, fontWeight: FontWeight.w500),
obscureText: obscureText!,
textInputAction: textInputAction,
maxLines: maxLines,
initialValue: initialValue,
cursorColor: appTheme.blueA400,
textCapitalization: TextCapitalization.sentences,
decoration: InputDecoration(
counter: counter,
suffixText: suffixText,
hintText: hintText ?? "",
hintStyle: TextStyle(
fontSize: 16,
color: Colors.grey.shade400,
fontWeight: FontWeight.w500,
),
hintStyle: hintStyle ?? TextStyle(fontSize: 16, color: const Color(0xFF323F4B).withAlpha((255 / 2).toInt()), fontWeight: FontWeight.w500),
prefixIcon: prefix,
prefixIconConstraints: prefixConstraints,
suffixIcon: suffix,
floatingLabelBehavior: FloatingLabelBehavior.always,
suffixStyle: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Color(0xFF323F4B),
),
suffixStyle: textStyle ?? const TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: Color(0xFF323F4B)),
suffixIconConstraints: suffixConstraints,
isDense: false,
contentPadding: EdgeInsets.symmetric(vertical: 16, horizontal: 12),
fillColor: Color(0xFFF6F6F6),
contentPadding: const EdgeInsets.symmetric(vertical: 16, horizontal: 12),
fillColor: const Color(0xFFF6F6F6),
filled: true,
border: borderDecoration ??
OutlineInputBorder(
borderRadius: BorderRadius.circular(20),
borderSide: hasError ? BorderSide(color: appTheme.red, width: 1) : BorderSide.none,
),
enabledBorder: borderDecoration ??
OutlineInputBorder(
borderRadius: BorderRadius.circular(20),
borderSide: hasError ? BorderSide(color: appTheme.red, width: 1) : BorderSide.none,
),
focusedBorder: borderDecoration ??
OutlineInputBorder(
borderRadius: BorderRadius.circular(20),
borderSide: hasError ? BorderSide(color: appTheme.red, width: 1) : BorderSide.none,
),
border:
borderDecoration ??
OutlineInputBorder(borderRadius: BorderRadius.circular(20), borderSide: hasError ? BorderSide(color: appTheme.red, width: 1) : BorderSide.none),
enabledBorder:
borderDecoration ??
OutlineInputBorder(borderRadius: BorderRadius.circular(20), borderSide: hasError ? BorderSide(color: appTheme.red, width: 1) : BorderSide.none),
focusedBorder:
borderDecoration ??
OutlineInputBorder(borderRadius: BorderRadius.circular(20), borderSide: hasError ? BorderSide(color: appTheme.red, width: 1) : BorderSide.none),
),
keyboardType: keyboardType,
validator: validator,

View File

@@ -24,41 +24,33 @@ class _DataErrorWidgetState extends State<DataErrorWidget> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset('assets/icons/cloud.svg'),
SizedBox(height: 30),
Text(
s.something_went_wrong,
style: TextStyles.textLSemibold.copyWith(color: appTheme.black),
),
SizedBox(height: 12),
const SizedBox(height: 30),
Text(s.something_went_wrong, style: TextStyles.textLSemibold.copyWith(color: appTheme.black)),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
child: Text(
s.can_not_load_data_please_try_again,
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
textAlign: TextAlign.center,
),
child: Text(s.can_not_load_data_please_try_again, style: TextStyles.textSMedium.copyWith(color: appTheme.black), textAlign: TextAlign.center),
),
SizedBox(height: 20),
const SizedBox(height: 20),
isLoading
? Loader()
? const Loader()
: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: CustomOutlinedButton(
text: s.try_again,
height: 52,
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.whiteA700),
buttonStyle: ButtonStyle(
side: WidgetStatePropertyAll(BorderSide.none),
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
),
buttonStyle: ButtonStyle(side: const WidgetStatePropertyAll(BorderSide.none), backgroundColor: WidgetStatePropertyAll(appTheme.blueA400)),
onPressed: () async {
setState(() {
isLoading = true;
});
await widget.onReload();
setState(() {
isLoading = false;
});
if (context.mounted) {
setState(() {
isLoading = false;
});
}
},
),
),

View File

@@ -18,7 +18,7 @@ class FeedIconButton extends StatelessWidget {
onTap: onTap ?? () {},
borderRadius: BorderRadius.circular(16),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(
color: backgroundColor ?? appTheme.gray100,
borderRadius: BorderRadius.circular(16),
@@ -35,7 +35,7 @@ class FeedIconButton extends StatelessWidget {
color: iconColor ?? appTheme.gray600,
),
if (text != null) ...[
SizedBox(width: 8),
const SizedBox(width: 8),
Text(
text!,
style: TextStyles.textSMedium.copyWith(

View File

@@ -55,18 +55,18 @@ class InfoRow extends StatelessWidget {
width: 13.3,
height: 13.3,
),
SizedBox(width: 4),
const SizedBox(width: 4),
Text(
switch (type) {
ProductType.diet => '${diet?.duration} ${getDayForm(diet?.duration ?? 7, s)}',
ProductType.plan => '${plan?.duration} ${getDayForm(plan?.duration ?? 7, s)}',
ProductType.recipe => '${timeTitle ?? ''}',
ProductType.recipe => timeTitle ?? '',
},
style: TextStyles.textXSSemibold.copyWith(color: appTheme.black),
),
],
),
SizedBox(width: 12),
const SizedBox(width: 12),
InfoBouble(
backgroundColor: itemsBackgroundColor,
children: [
@@ -79,18 +79,18 @@ class InfoRow extends StatelessWidget {
width: 13.3,
height: 13.3,
),
SizedBox(width: 4),
const SizedBox(width: 4),
Text(
switch (type) {
ProductType.diet => '80 человек прошли',
ProductType.plan => '80 человек прошли',
ProductType.recipe => (recipe?.calories.toStringAsFixed(0) ?? '0') + ' ккал',
ProductType.recipe => '${recipe?.calories.toStringAsFixed(0) ?? '0'} ккал',
},
style: TextStyles.textXSSemibold.copyWith(color: appTheme.black),
),
],
),
SizedBox(width: 12),
const SizedBox(width: 12),
if (type == ProductType.recipe)
InfoBouble(
backgroundColor: itemsBackgroundColor,
@@ -100,7 +100,7 @@ class InfoRow extends StatelessWidget {
width: 13.3,
height: 13.3,
),
SizedBox(width: 4),
const SizedBox(width: 4),
Text(
'${recipe?.steps?.length ?? 0} ${getStepForm(recipe?.steps?.length ?? 0)}',
style: TextStyles.textXSSemibold.copyWith(color: appTheme.black),

View File

@@ -18,7 +18,7 @@ class ItemWidget extends StatelessWidget {
width: iconSize,
height: iconSize,
),
SizedBox(width: 8),
const SizedBox(width: 8),
Expanded(
child: Text(
text,

View File

@@ -6,7 +6,7 @@ class Loader extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Center(
return const Center(
child: SizedBox(
height: 32,
width: 32,

View File

@@ -23,10 +23,10 @@ class MainBackgroundBouble extends StatelessWidget {
boxShadow: enableShadow
? [
BoxShadow(
color: Color(0x00000000).withValues(alpha: 0.2),
color: const Color(0x00000000).withValues(alpha: 0.2),
spreadRadius: 0,
blurRadius: 32,
offset: Offset(0, 0),
offset: const Offset(0, 0),
),
]
: null,

View File

@@ -0,0 +1,94 @@
import 'package:eatvio_app/core/theme/custom_text_style.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/core/utils/localization_utils.dart';
import 'package:eatvio_app/core/widgets/custom_divider.dart';
import 'package:eatvio_app/core/widgets/main_background_bouble.dart';
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
import 'package:eatvio_app/core/widgets/item_widget.dart';
import 'package:eatvio_app/generated/l10n.dart';
import 'package:flutter/material.dart';
class OptionWidget extends StatelessWidget {
const OptionWidget({super.key, required this.option, this.disableDuration = false});
final PacketOptions? option;
final bool disableDuration;
@override
Widget build(BuildContext context) {
if (option == null) {
return const SizedBox.shrink();
}
return MainBackgroundBouble(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 16),
Text(
option?.short ?? '',
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
const SizedBox(height: 12),
Text(
option?.description ?? '',
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
const SizedBox(height: 12),
if (!disableDuration) ...[
const _OptionDurationWidget(duration: 7),
const SizedBox(height: 16),
],
const CustomDivider(),
const SizedBox(height: 16),
ListView.separated(
physics: const NeverScrollableScrollPhysics(),
separatorBuilder: (context, index) => const SizedBox(height: 12),
itemBuilder: (context, index) => ItemWidget(text: option?.items[index] ?? ''),
itemCount: option?.items.length ?? 0,
shrinkWrap: true,
),
],
),
);
}
}
class _OptionDurationWidget extends StatelessWidget {
const _OptionDurationWidget({required this.duration});
final int duration;
@override
Widget build(BuildContext context) {
final s = S.of(context);
return Container(
decoration: BoxDecoration(borderRadius: BorderRadius.circular(4), color: appTheme.cardBackground),
child: Row(
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: Container(
width: 4,
height: 20,
decoration: BoxDecoration(
color: appTheme.blueA400,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(100),
bottomRight: Radius.circular(100),
),
),
),
),
const SizedBox(
width: 12,
),
Text(
'${s.option_duration} $duration ${getDayForm(duration, s)}',
style: TextStyles.textSMedium.copyWith(color: appTheme.black),
),
const SizedBox(
width: 12,
),
],
),
);
}
}

View File

@@ -17,7 +17,7 @@ void showErrorDialog(BuildContext context, {String? title, String? description})
child: Container(
decoration: BoxDecoration(
color: appTheme.whiteA700,
borderRadius: BorderRadius.all(Radius.circular(20)),
borderRadius: const BorderRadius.all(Radius.circular(20)),
boxShadow: [BoxShadow(color: appTheme.dialogShadow, blurRadius: 32)],
),
width: MediaQuery.sizeOf(context).width,
@@ -27,12 +27,12 @@ void showErrorDialog(BuildContext context, {String? title, String? description})
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 20),
const SizedBox(height: 20),
Text(
title ?? s.some_error_occurred,
style: TextStyles.textLSemibold.copyWith(color: appTheme.black, decoration: TextDecoration.none),
),
SizedBox(height: 12),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.only(right: 72),
child: Text(
@@ -47,7 +47,7 @@ void showErrorDialog(BuildContext context, {String? title, String? description})
child: Text(s.ok, style: TextStyles.textLSemibold.copyWith(color: appTheme.blueA400)),
),
),
SizedBox(height: 12),
const SizedBox(height: 12),
],
),
),

View File

@@ -15,11 +15,11 @@ class SuccessPublishedDietBottomSheet extends StatelessWidget {
final s = S.of(context);
return Column(
children: [
SizedBox(
const SizedBox(
height: 20,
),
BottomSheetHandlerBar(),
SizedBox(
const BottomSheetHandlerBar(),
const SizedBox(
height: 20,
),
Text(
@@ -30,7 +30,7 @@ class SuccessPublishedDietBottomSheet extends StatelessWidget {
'опубликованна',
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
SizedBox(
const SizedBox(
height: 20,
),
Padding(
@@ -43,12 +43,12 @@ class SuccessPublishedDietBottomSheet extends StatelessWidget {
height: 52,
buttonTextStyle: TextStyles.textSSemibold.copyWith(color: appTheme.whiteA700),
buttonStyle: ButtonStyle(
side: WidgetStatePropertyAll(BorderSide.none),
side: const WidgetStatePropertyAll(BorderSide.none),
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
),
),
),
SizedBox(
const SizedBox(
height: 20,
),
],

View File

@@ -15,11 +15,11 @@ class SuccessPublishedRecipeBottomSheet extends StatelessWidget {
final s = S.of(context);
return Column(
children: [
SizedBox(
const SizedBox(
height: 20,
),
BottomSheetHandlerBar(),
SizedBox(
const BottomSheetHandlerBar(),
const SizedBox(
height: 20,
),
Text(
@@ -30,7 +30,7 @@ class SuccessPublishedRecipeBottomSheet extends StatelessWidget {
'"$title" ${s.successfully_published}',
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
),
SizedBox(
const SizedBox(
height: 20,
),
Padding(
@@ -43,12 +43,12 @@ class SuccessPublishedRecipeBottomSheet extends StatelessWidget {
height: 52,
buttonTextStyle: TextStyles.textSSemibold.copyWith(color: appTheme.whiteA700),
buttonStyle: ButtonStyle(
side: WidgetStatePropertyAll(BorderSide.none),
side: const WidgetStatePropertyAll(BorderSide.none),
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
),
),
),
SizedBox(
const SizedBox(
height: 20,
),
],

View File

@@ -12,8 +12,7 @@ part of 'credentials_model.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
CredentialsModel _$CredentialsModelFromJson(Map<String, dynamic> json) {
return _CredentialsModel.fromJson(json);
@@ -37,9 +36,8 @@ mixin _$CredentialsModel {
/// @nodoc
abstract class $CredentialsModelCopyWith<$Res> {
factory $CredentialsModelCopyWith(
CredentialsModel value,
$Res Function(CredentialsModel) then,
) = _$CredentialsModelCopyWithImpl<$Res, CredentialsModel>;
CredentialsModel value, $Res Function(CredentialsModel) then) =
_$CredentialsModelCopyWithImpl<$Res, CredentialsModel>;
@useResult
$Res call({String email, String password});
}
@@ -58,32 +56,29 @@ class _$CredentialsModelCopyWithImpl<$Res, $Val extends CredentialsModel>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? email = null, Object? password = null}) {
return _then(
_value.copyWith(
email:
null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
password:
null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
$Res call({
Object? email = null,
Object? password = null,
}) {
return _then(_value.copyWith(
email: null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
password: null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$CredentialsModelImplCopyWith<$Res>
implements $CredentialsModelCopyWith<$Res> {
factory _$$CredentialsModelImplCopyWith(
_$CredentialsModelImpl value,
$Res Function(_$CredentialsModelImpl) then,
) = __$$CredentialsModelImplCopyWithImpl<$Res>;
factory _$$CredentialsModelImplCopyWith(_$CredentialsModelImpl value,
$Res Function(_$CredentialsModelImpl) then) =
__$$CredentialsModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String email, String password});
@@ -93,30 +88,28 @@ abstract class _$$CredentialsModelImplCopyWith<$Res>
class __$$CredentialsModelImplCopyWithImpl<$Res>
extends _$CredentialsModelCopyWithImpl<$Res, _$CredentialsModelImpl>
implements _$$CredentialsModelImplCopyWith<$Res> {
__$$CredentialsModelImplCopyWithImpl(
_$CredentialsModelImpl _value,
$Res Function(_$CredentialsModelImpl) _then,
) : super(_value, _then);
__$$CredentialsModelImplCopyWithImpl(_$CredentialsModelImpl _value,
$Res Function(_$CredentialsModelImpl) _then)
: super(_value, _then);
/// Create a copy of CredentialsModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? email = null, Object? password = null}) {
return _then(
_$CredentialsModelImpl(
email:
null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
password:
null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? email = null,
Object? password = null,
}) {
return _then(_$CredentialsModelImpl(
email: null == email
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
password: null == password
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -159,21 +152,20 @@ class _$CredentialsModelImpl implements _CredentialsModel {
@pragma('vm:prefer-inline')
_$$CredentialsModelImplCopyWith<_$CredentialsModelImpl> get copyWith =>
__$$CredentialsModelImplCopyWithImpl<_$CredentialsModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$CredentialsModelImplToJson(this);
return _$$CredentialsModelImplToJson(
this,
);
}
}
abstract class _CredentialsModel implements CredentialsModel {
const factory _CredentialsModel({
required final String email,
required final String password,
}) = _$CredentialsModelImpl;
const factory _CredentialsModel(
{required final String email,
required final String password}) = _$CredentialsModelImpl;
factory _CredentialsModel.fromJson(Map<String, dynamic> json) =
_$CredentialsModelImpl.fromJson;

View File

@@ -7,12 +7,15 @@ part of 'credentials_model.dart';
// **************************************************************************
_$CredentialsModelImpl _$$CredentialsModelImplFromJson(
Map<String, dynamic> json,
) => _$CredentialsModelImpl(
email: json['email'] as String,
password: json['password'] as String,
);
Map<String, dynamic> json) =>
_$CredentialsModelImpl(
email: json['email'] as String,
password: json['password'] as String,
);
Map<String, dynamic> _$$CredentialsModelImplToJson(
_$CredentialsModelImpl instance,
) => <String, dynamic>{'email': instance.email, 'password': instance.password};
_$CredentialsModelImpl instance) =>
<String, dynamic>{
'email': instance.email,
'password': instance.password,
};

View File

@@ -12,8 +12,7 @@ part of 'token_model.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
TokenModel _$TokenModelFromJson(Map<String, dynamic> json) {
return _TokenModel.fromJson(json);
@@ -36,9 +35,8 @@ mixin _$TokenModel {
/// @nodoc
abstract class $TokenModelCopyWith<$Res> {
factory $TokenModelCopyWith(
TokenModel value,
$Res Function(TokenModel) then,
) = _$TokenModelCopyWithImpl<$Res, TokenModel>;
TokenModel value, $Res Function(TokenModel) then) =
_$TokenModelCopyWithImpl<$Res, TokenModel>;
@useResult
$Res call({String token});
}
@@ -57,17 +55,15 @@ class _$TokenModelCopyWithImpl<$Res, $Val extends TokenModel>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? token = null}) {
return _then(
_value.copyWith(
token:
null == token
? _value.token
: token // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
$Res call({
Object? token = null,
}) {
return _then(_value.copyWith(
token: null == token
? _value.token
: token // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
@@ -75,9 +71,8 @@ class _$TokenModelCopyWithImpl<$Res, $Val extends TokenModel>
abstract class _$$TokenModelImplCopyWith<$Res>
implements $TokenModelCopyWith<$Res> {
factory _$$TokenModelImplCopyWith(
_$TokenModelImpl value,
$Res Function(_$TokenModelImpl) then,
) = __$$TokenModelImplCopyWithImpl<$Res>;
_$TokenModelImpl value, $Res Function(_$TokenModelImpl) then) =
__$$TokenModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String token});
@@ -88,24 +83,22 @@ class __$$TokenModelImplCopyWithImpl<$Res>
extends _$TokenModelCopyWithImpl<$Res, _$TokenModelImpl>
implements _$$TokenModelImplCopyWith<$Res> {
__$$TokenModelImplCopyWithImpl(
_$TokenModelImpl _value,
$Res Function(_$TokenModelImpl) _then,
) : super(_value, _then);
_$TokenModelImpl _value, $Res Function(_$TokenModelImpl) _then)
: super(_value, _then);
/// Create a copy of TokenModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? token = null}) {
return _then(
_$TokenModelImpl(
token:
null == token
? _value.token
: token // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? token = null,
}) {
return _then(_$TokenModelImpl(
token: null == token
? _value.token
: token // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -147,7 +140,9 @@ class _$TokenModelImpl implements _TokenModel {
@override
Map<String, dynamic> toJson() {
return _$$TokenModelImplToJson(this);
return _$$TokenModelImplToJson(
this,
);
}
}

View File

@@ -7,7 +7,11 @@ part of 'token_model.dart';
// **************************************************************************
_$TokenModelImpl _$$TokenModelImplFromJson(Map<String, dynamic> json) =>
_$TokenModelImpl(token: json['token'] as String);
_$TokenModelImpl(
token: json['token'] as String,
);
Map<String, dynamic> _$$TokenModelImplToJson(_$TokenModelImpl instance) =>
<String, dynamic>{'token': instance.token};
<String, dynamic>{
'token': instance.token,
};

View File

@@ -1,3 +1,5 @@
import 'dart:developer';
import 'package:eatvio_app/core/app_router.dart';
import 'package:eatvio_app/core/token_storage.dart';
import 'package:eatvio_app/core/utils/toasts.dart';
@@ -11,10 +13,10 @@ class AuthCubit extends Cubit<AuthState> {
AuthCubit({
required this.authRepository,
}) : super(AuthState());
}) : super(const AuthState());
Future<bool> getTokenByCredentials(String email, String password) async {
emit(AuthState.loading());
emit(const AuthState.loading());
try {
final token = (await authRepository.getTokenByCredentials(
email,
@@ -31,7 +33,7 @@ class AuthCubit extends Cubit<AuthState> {
AppRouter.navigatorKey.currentContext?.go('/my-profile-screen');
return true;
} catch (e) {
print(e);
log(e.toString());
showErrorToast('Неверный адрес электронной почты или пароль');
emit(AuthState.error(errorMessage: '$e'));
return false;

View File

@@ -12,8 +12,7 @@ part of 'auth_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$AuthState {
@@ -23,14 +22,16 @@ mixin _$AuthState {
required TResult Function() loading,
required TResult Function(String token) loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(String token)? loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
@@ -38,21 +39,24 @@ mixin _$AuthState {
TResult Function(String token)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_AuthState value) $default, {
required TResult Function(AuthStateLoading value) loading,
required TResult Function(AuthStateLoaded value) loaded,
required TResult Function(AuthStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_AuthState value)? $default, {
TResult? Function(AuthStateLoading value)? loading,
TResult? Function(AuthStateLoaded value)? loaded,
TResult? Function(AuthStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_AuthState value)? $default, {
@@ -60,7 +64,8 @@ mixin _$AuthState {
TResult Function(AuthStateLoaded value)? loaded,
TResult Function(AuthStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
@@ -86,9 +91,8 @@ class _$AuthStateCopyWithImpl<$Res, $Val extends AuthState>
/// @nodoc
abstract class _$$AuthStateImplCopyWith<$Res> {
factory _$$AuthStateImplCopyWith(
_$AuthStateImpl value,
$Res Function(_$AuthStateImpl) then,
) = __$$AuthStateImplCopyWithImpl<$Res>;
_$AuthStateImpl value, $Res Function(_$AuthStateImpl) then) =
__$$AuthStateImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -96,9 +100,8 @@ class __$$AuthStateImplCopyWithImpl<$Res>
extends _$AuthStateCopyWithImpl<$Res, _$AuthStateImpl>
implements _$$AuthStateImplCopyWith<$Res> {
__$$AuthStateImplCopyWithImpl(
_$AuthStateImpl _value,
$Res Function(_$AuthStateImpl) _then,
) : super(_value, _then);
_$AuthStateImpl _value, $Res Function(_$AuthStateImpl) _then)
: super(_value, _then);
/// Create a copy of AuthState
/// with the given fields replaced by the non-null parameter values.
@@ -204,20 +207,18 @@ abstract class _AuthState implements AuthState {
/// @nodoc
abstract class _$$AuthStateLoadingImplCopyWith<$Res> {
factory _$$AuthStateLoadingImplCopyWith(
_$AuthStateLoadingImpl value,
$Res Function(_$AuthStateLoadingImpl) then,
) = __$$AuthStateLoadingImplCopyWithImpl<$Res>;
factory _$$AuthStateLoadingImplCopyWith(_$AuthStateLoadingImpl value,
$Res Function(_$AuthStateLoadingImpl) then) =
__$$AuthStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$AuthStateLoadingImplCopyWithImpl<$Res>
extends _$AuthStateCopyWithImpl<$Res, _$AuthStateLoadingImpl>
implements _$$AuthStateLoadingImplCopyWith<$Res> {
__$$AuthStateLoadingImplCopyWithImpl(
_$AuthStateLoadingImpl _value,
$Res Function(_$AuthStateLoadingImpl) _then,
) : super(_value, _then);
__$$AuthStateLoadingImplCopyWithImpl(_$AuthStateLoadingImpl _value,
$Res Function(_$AuthStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of AuthState
/// with the given fields replaced by the non-null parameter values.
@@ -323,10 +324,9 @@ abstract class AuthStateLoading implements AuthState {
/// @nodoc
abstract class _$$AuthStateLoadedImplCopyWith<$Res> {
factory _$$AuthStateLoadedImplCopyWith(
_$AuthStateLoadedImpl value,
$Res Function(_$AuthStateLoadedImpl) then,
) = __$$AuthStateLoadedImplCopyWithImpl<$Res>;
factory _$$AuthStateLoadedImplCopyWith(_$AuthStateLoadedImpl value,
$Res Function(_$AuthStateLoadedImpl) then) =
__$$AuthStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({String token});
}
@@ -336,24 +336,22 @@ class __$$AuthStateLoadedImplCopyWithImpl<$Res>
extends _$AuthStateCopyWithImpl<$Res, _$AuthStateLoadedImpl>
implements _$$AuthStateLoadedImplCopyWith<$Res> {
__$$AuthStateLoadedImplCopyWithImpl(
_$AuthStateLoadedImpl _value,
$Res Function(_$AuthStateLoadedImpl) _then,
) : super(_value, _then);
_$AuthStateLoadedImpl _value, $Res Function(_$AuthStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of AuthState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? token = null}) {
return _then(
_$AuthStateLoadedImpl(
token:
null == token
? _value.token
: token // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? token = null,
}) {
return _then(_$AuthStateLoadedImpl(
token: null == token
? _value.token
: token // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -388,9 +386,7 @@ class _$AuthStateLoadedImpl implements AuthStateLoaded {
@pragma('vm:prefer-inline')
_$$AuthStateLoadedImplCopyWith<_$AuthStateLoadedImpl> get copyWith =>
__$$AuthStateLoadedImplCopyWithImpl<_$AuthStateLoadedImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -482,10 +478,9 @@ abstract class AuthStateLoaded implements AuthState {
/// @nodoc
abstract class _$$AuthStateErrorImplCopyWith<$Res> {
factory _$$AuthStateErrorImplCopyWith(
_$AuthStateErrorImpl value,
$Res Function(_$AuthStateErrorImpl) then,
) = __$$AuthStateErrorImplCopyWithImpl<$Res>;
factory _$$AuthStateErrorImplCopyWith(_$AuthStateErrorImpl value,
$Res Function(_$AuthStateErrorImpl) then) =
__$$AuthStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -495,24 +490,22 @@ class __$$AuthStateErrorImplCopyWithImpl<$Res>
extends _$AuthStateCopyWithImpl<$Res, _$AuthStateErrorImpl>
implements _$$AuthStateErrorImplCopyWith<$Res> {
__$$AuthStateErrorImplCopyWithImpl(
_$AuthStateErrorImpl _value,
$Res Function(_$AuthStateErrorImpl) _then,
) : super(_value, _then);
_$AuthStateErrorImpl _value, $Res Function(_$AuthStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of AuthState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$AuthStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$AuthStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -548,9 +541,7 @@ class _$AuthStateErrorImpl implements AuthStateError {
@pragma('vm:prefer-inline')
_$$AuthStateErrorImplCopyWith<_$AuthStateErrorImpl> get copyWith =>
__$$AuthStateErrorImplCopyWithImpl<_$AuthStateErrorImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs

View File

@@ -1,5 +1,6 @@
import 'dart:async';
import 'package:easy_debounce/easy_debounce.dart';
import 'package:eatvio_app/core/const.dart';
import 'package:eatvio_app/core/locator_service.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
@@ -22,7 +23,7 @@ import 'package:url_launcher/url_launcher.dart';
import '../bloc/auth_state.dart';
class AuthScreen extends StatefulWidget {
const AuthScreen();
const AuthScreen({super.key});
@override
State<AuthScreen> createState() => _AuthScreenState();
@@ -36,7 +37,7 @@ class _AuthScreenState extends State<AuthScreen> {
final authCubit = sl<AuthCubit>();
late StreamSubscription<bool> keyboardSubscription;
bool isFocused = false;
int tapsCount = 0;
@override
void initState() {
super.initState();
@@ -60,15 +61,27 @@ class _AuthScreenState extends State<AuthScreen> {
appBar: AppBar(
centerTitle: true,
toolbarHeight: isFocused ? 64 : MediaQuery.of(context).size.width - 64,
title: SvgPicture.asset(
ImageConstant.imgLogoEatvio,
height: isFocused ? 64 : MediaQuery.of(context).size.width - 64,
fit: BoxFit.contain,
title: GestureDetector(
onTap: () {
tapsCount++;
if (tapsCount == 6) {
tapsCount = 0;
// showModalBottomSheet(context: context, builder: (context) => );
}
EasyDebounce.debounce('change env', Durations.medium4, () {
tapsCount = 0;
});
},
child: SvgPicture.asset(
ImageConstant.imgLogoEatvio,
height: isFocused ? 64 : MediaQuery.of(context).size.width - 64,
fit: BoxFit.contain,
),
),
),
body: SafeArea(
child: Padding(
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -104,7 +117,7 @@ class _AuthScreenState extends State<AuthScreen> {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Нет аккаунта? '),
const Text('Нет аккаунта? '),
GestureDetector(
onTap: () => GoRouter.of(context).goNamed('webViewRegistrationScreen'),
child: Text(
@@ -118,18 +131,18 @@ class _AuthScreenState extends State<AuthScreen> {
),
],
),
Spacer(),
const Spacer(),
Center(
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
text: 'Нажимая "Войти", Вы соглашаетесь \n',
style: TextStyle(
style: const TextStyle(
fontSize: 12,
color: Colors.black,
),
children: [
TextSpan(text: 'c '),
const TextSpan(text: 'c '),
TextSpan(
text: ' Публичной офертой',
style: TextStyle(
@@ -138,14 +151,14 @@ class _AuthScreenState extends State<AuthScreen> {
decorationColor: appTheme.blueA400,
decoration: TextDecoration.underline,
),
recognizer: TapGestureRecognizer()..onTap = () async => await launchUrl(Uri.parse(baseUrl + '/oferta_bs.pdf')),
recognizer: TapGestureRecognizer()..onTap = () async => await launchUrl(Uri.parse('$baseUrl/oferta_bs.pdf')),
),
],
),
),
),
const SizedBox(height: 16),
Container(
SizedBox(
height: 48,
width: MediaQuery.of(context).size.width - 32,
child: FloatingActionButton.extended(
@@ -165,12 +178,14 @@ class _AuthScreenState extends State<AuthScreen> {
passwordController.text,
);
if (isAuthenticated) {
context.read<ProfileAvatarCubit>().getMyProfile();
context.read<ChatsCubit>().getChatRoomsWithLoading();
if (context.mounted) {
context.read<ProfileAvatarCubit>().getMyProfile();
context.read<ChatsCubit>().getChatRoomsWithLoading();
}
}
},
label: state is AuthStateLoading
? CupertinoActivityIndicator()
? const CupertinoActivityIndicator()
: Text(
'Войти',
style: theme.textTheme.titleSmall!.copyWith(color: Colors.white),

View File

@@ -24,7 +24,7 @@ import 'package:share_plus/share_plus.dart';
class BlogPostScreen extends StatefulWidget {
final FeedBlogPostModel blogPost;
BlogPostScreen({super.key, required this.blogPost});
const BlogPostScreen({super.key, required this.blogPost});
@override
State<BlogPostScreen> createState() => _BlogPostScreenState();
@@ -60,7 +60,7 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
return Scaffold(
resizeToAvoidBottomInset: true,
bottomSheet: Container(
padding: EdgeInsets.symmetric(vertical: 12) + (Platform.isIOS ? const EdgeInsets.only(bottom: 16) : EdgeInsets.zero),
padding: const EdgeInsets.symmetric(vertical: 12) + (Platform.isIOS ? const EdgeInsets.only(bottom: 16) : EdgeInsets.zero),
decoration: BoxDecoration(color: Colors.white, border: Border(top: BorderSide(color: Colors.black.withValues(alpha: 0.1)))),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
@@ -79,34 +79,57 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
decoration: BoxDecoration(color: appTheme.blueA400, shape: BoxShape.circle),
height: 32,
width: 32,
child: Icon(Icons.close_rounded, size: 18, color: Colors.white),
child: const Icon(Icons.close_rounded, size: 18, color: Colors.white),
),
),
if (replyId != null) SizedBox(width: 8),
if (replyId != null) const SizedBox(width: 8),
SizedBox(
width: MediaQuery.of(context).size.width - (replyId == null ? 64 : 104),
child: TextFormField(
onChanged: (_) {
setState(() {});
},
controller: textEditingController,
maxLines: 5,
minLines: 1,
keyboardType: TextInputType.multiline,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w400, color: Colors.black, height: 1),
decoration: InputDecoration(
isDense: true,
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
hintText: 'Комментарий',
hintStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w400, height: 1, color: Color(0xFFAEAEB2)),
filled: true,
border: OutlineInputBorder(borderRadius: BorderRadius.circular(16), borderSide: BorderSide(color: Color(0xFFD1D1D6), width: 1)),
enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(16), borderSide: BorderSide(color: Color(0xFFD1D1D6), width: 1)),
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(16), borderSide: BorderSide(color: Color(0xFFD1D1D6), width: 1)),
child: ConstrainedBox(
constraints: const BoxConstraints(minHeight: 52),
child: TextFormField(
textCapitalization: TextCapitalization.sentences,
onChanged: (_) {
setState(() {});
},
controller: textEditingController,
maxLines: 5,
minLines: 1,
keyboardType: TextInputType.multiline,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w400,
color: Colors.black,
height: 1.2,
),
decoration: InputDecoration(
isDense: false, // убираем true, чтобы padding учитывался корректно
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), // вертикальный паддинг увеличен
hintText: 'Комментарий',
hintStyle: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w400,
height: 1.2,
color: Color(0xFFAEAEB2),
),
filled: true,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(16),
borderSide: const BorderSide(color: Color(0xFFD1D1D6), width: 1),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(16),
borderSide: const BorderSide(color: Color(0xFFD1D1D6), width: 1),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(16),
borderSide: const BorderSide(color: Color(0xFFD1D1D6), width: 1),
),
),
),
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
GestureDetector(
onTap: () {
if (textEditingController.text.length > 2) {
@@ -128,7 +151,7 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
decoration: BoxDecoration(color: textEditingController.text.length > 2 ? appTheme.blueA400 : Colors.grey, shape: BoxShape.circle),
height: 32,
width: 32,
child: Icon(Icons.send_rounded, size: 18, color: Colors.white),
child: const Icon(Icons.send_rounded, size: 18, color: Colors.white),
),
),
],
@@ -141,6 +164,7 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
onSelected: (value) async {
if (value == 'delete') {
final result = await sl<BlogPostCreateCubit>().deleteBlogPost(widget.blogPost.id);
if (!context.mounted) return;
if (!result) {
showErrorDialog(context, title: S.current.could_not_delete_blog_post);
return;
@@ -152,29 +176,28 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
GoRouter.of(context).replaceNamed('blogPostCreateScreen', extra: widget.blogPost);
}
},
itemBuilder:
(context) => [
if (widget.blogPost.author.authorIsMe) PopupMenuItem(value: 'edit', child: Text('Редактировать')),
if (widget.blogPost.author.authorIsMe) PopupMenuItem(value: 'delete', child: Text('Удалить')),
if (!widget.blogPost.author.authorIsMe)
PopupMenuItem(
value: 'report',
child: Text('Пожаловаться'),
onTap: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (context) => ComplainingBottomSheet(complainedContentType: ComplainedContent.posts, id: widget.blogPost.id),
);
},
),
],
itemBuilder: (context) => [
if (widget.blogPost.author.authorIsMe) const PopupMenuItem(value: 'edit', child: Text('Редактировать')),
if (widget.blogPost.author.authorIsMe) const PopupMenuItem(value: 'delete', child: Text('Удалить')),
if (!widget.blogPost.author.authorIsMe)
PopupMenuItem(
value: 'report',
child: const Text('Пожаловаться'),
onTap: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (context) => ComplainingBottomSheet(complainedContentType: ComplainedContent.posts, id: widget.blogPost.id),
);
},
),
],
),
],
),
body: SingleChildScrollView(
padding: EdgeInsets.only(bottom: 80),
physics: BouncingScrollPhysics(),
padding: const EdgeInsets.only(bottom: 80),
physics: const BouncingScrollPhysics(),
child: Column(
children: [
GestureDetector(
@@ -186,15 +209,15 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
CircleAvatar(radius: 16, backgroundImage: NetworkImage(widget.blogPost.author.authorProfileIcon)),
SizedBox(width: 8),
const SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.blogPost.author.authorName,
style: TextStyle(color: Colors.black, fontSize: 14, fontWeight: FontWeight.w400, height: 1),
style: const TextStyle(color: Colors.black, fontSize: 14, fontWeight: FontWeight.w400, height: 1),
),
SizedBox(height: 2),
const SizedBox(height: 2),
Text(
widget.blogPost.createdAt.format('dd MMMM', 'ru'),
style: TextStyle(color: Colors.grey.shade600, fontSize: 12, fontWeight: FontWeight.w400, height: 1),
@@ -210,8 +233,8 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Html(data: widget.blogPost.description, style: {"*": Style(color: Colors.black87)}),
),
SizedBox(height: 8),
CachedNetworkImage(imageUrl: baseUrl + '/storage/' + (widget.blogPost.image)),
const SizedBox(height: 8),
CachedNetworkImage(imageUrl: '$baseUrl/storage/${widget.blogPost.image}'),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row(
@@ -233,20 +256,20 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
sl<FeedCubit>().updateFeedBlogPostList(widget.blogPost, isLiked);
},
),
SizedBox(width: 8),
const SizedBox(width: 8),
_iconButton(
icon: Icons.reply_rounded,
onTap: () {
final box = context.findRenderObject() as RenderBox?;
Share.shareUri(
Uri.parse(baseUrl + '/ru/blog_post/' + widget.blogPost.id.toString()),
Uri.parse('$baseUrl/ru/blog_post/${widget.blogPost.id}'),
sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
);
},
),
Spacer(),
const Spacer(),
Icon(Icons.visibility_rounded, size: 16, color: appTheme.gray500),
SizedBox(width: 4),
const SizedBox(width: 4),
Text(widget.blogPost.totalViews.toString(), style: TextStyle(fontSize: 12, color: appTheme.gray500, fontWeight: FontWeight.w400)),
],
),
@@ -256,16 +279,16 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
height: 0.4,
decoration: BoxDecoration(color: Colors.black.withValues(alpha: 0.2), borderRadius: BorderRadius.circular(16)),
),
SizedBox(height: 8),
const SizedBox(height: 8),
Container(
padding: EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.symmetric(horizontal: 16),
alignment: Alignment.centerLeft,
child: Text(
widget.blogPost.totalComments.toString() + ' КОММЕНТАРИЕВ',
'${widget.blogPost.totalComments} КОММЕНТАРИЕВ',
style: TextStyle(fontSize: 12, color: appTheme.gray500, fontWeight: FontWeight.w400),
),
),
SizedBox(height: 16),
const SizedBox(height: 16),
if (state is CommentsStateLoading) const Loader(),
if (state is CommentsStateLoaded)
CommentsWidget(id: widget.blogPost.id.toString(), commentSourceType: CommentSourceType.blogPost, comment: state.comment, replyId: replyId),
@@ -283,14 +306,14 @@ class _BlogPostScreenState extends State<BlogPostScreen> {
onTap: onTap ?? () {},
borderRadius: BorderRadius.circular(16),
child: Ink(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 4),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
decoration: BoxDecoration(color: backgroundColor ?? appTheme.gray100, borderRadius: BorderRadius.circular(16)),
height: 32,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(icon, size: 20, color: iconColor ?? appTheme.gray600),
if (text != null) SizedBox(width: 8),
if (text != null) const SizedBox(width: 8),
if (text != null) Text(text, style: TextStyle(color: textColor ?? appTheme.gray600, fontWeight: FontWeight.w500)),
],
),

View File

@@ -10,7 +10,7 @@ class BlogPostCreateCubit extends Cubit<BlogPostCreateState> {
BlogPostCreateCubit({
required this.blogPostRepository,
}) : super(BlogPostCreateState());
}) : super(const BlogPostCreateState());
Future<bool> createBlogPost({
String? title,
@@ -19,7 +19,7 @@ class BlogPostCreateCubit extends Cubit<BlogPostCreateState> {
XFile? image,
}) async {
try {
emit(BlogPostCreateState.loading());
emit(const BlogPostCreateState.loading());
await blogPostRepository.createBlogPost(
title,
videoUrl,
@@ -29,7 +29,7 @@ class BlogPostCreateCubit extends Cubit<BlogPostCreateState> {
return true;
} catch (e, st) {
log(e.toString(), stackTrace: st);
emit(BlogPostCreateState.loaded());
emit(const BlogPostCreateState.loaded());
return false;
}
}
@@ -43,7 +43,7 @@ class BlogPostCreateCubit extends Cubit<BlogPostCreateState> {
String? oldImageUrl,
}) async {
try {
emit(BlogPostCreateState.loading());
emit(const BlogPostCreateState.loading());
await blogPostRepository.updateBlogPost(
id,
title,
@@ -52,11 +52,11 @@ class BlogPostCreateCubit extends Cubit<BlogPostCreateState> {
image,
oldImageUrl,
);
emit(BlogPostCreateState.loaded());
emit(const BlogPostCreateState.loaded());
return true;
} catch (e, st) {
log(e.toString(), stackTrace: st);
emit(BlogPostCreateState.loaded());
emit(const BlogPostCreateState.loaded());
return false;
}
}

View File

@@ -12,8 +12,7 @@ part of 'blog_post_create_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$BlogPostCreateState {
@@ -23,14 +22,16 @@ mixin _$BlogPostCreateState {
required TResult Function() loading,
required TResult Function() loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function()? loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
@@ -38,21 +39,24 @@ mixin _$BlogPostCreateState {
TResult Function()? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_BlogPostCreateState value) $default, {
required TResult Function(BlogPostCreateStateLoading value) loading,
required TResult Function(BlogPostCreateStateLoaded value) loaded,
required TResult Function(BlogPostCreateStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_BlogPostCreateState value)? $default, {
TResult? Function(BlogPostCreateStateLoading value)? loading,
TResult? Function(BlogPostCreateStateLoaded value)? loaded,
TResult? Function(BlogPostCreateStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_BlogPostCreateState value)? $default, {
@@ -60,15 +64,15 @@ mixin _$BlogPostCreateState {
TResult Function(BlogPostCreateStateLoaded value)? loaded,
TResult Function(BlogPostCreateStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $BlogPostCreateStateCopyWith<$Res> {
factory $BlogPostCreateStateCopyWith(
BlogPostCreateState value,
$Res Function(BlogPostCreateState) then,
) = _$BlogPostCreateStateCopyWithImpl<$Res, BlogPostCreateState>;
BlogPostCreateState value, $Res Function(BlogPostCreateState) then) =
_$BlogPostCreateStateCopyWithImpl<$Res, BlogPostCreateState>;
}
/// @nodoc
@@ -87,20 +91,18 @@ class _$BlogPostCreateStateCopyWithImpl<$Res, $Val extends BlogPostCreateState>
/// @nodoc
abstract class _$$BlogPostCreateStateImplCopyWith<$Res> {
factory _$$BlogPostCreateStateImplCopyWith(
_$BlogPostCreateStateImpl value,
$Res Function(_$BlogPostCreateStateImpl) then,
) = __$$BlogPostCreateStateImplCopyWithImpl<$Res>;
factory _$$BlogPostCreateStateImplCopyWith(_$BlogPostCreateStateImpl value,
$Res Function(_$BlogPostCreateStateImpl) then) =
__$$BlogPostCreateStateImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$BlogPostCreateStateImplCopyWithImpl<$Res>
extends _$BlogPostCreateStateCopyWithImpl<$Res, _$BlogPostCreateStateImpl>
implements _$$BlogPostCreateStateImplCopyWith<$Res> {
__$$BlogPostCreateStateImplCopyWithImpl(
_$BlogPostCreateStateImpl _value,
$Res Function(_$BlogPostCreateStateImpl) _then,
) : super(_value, _then);
__$$BlogPostCreateStateImplCopyWithImpl(_$BlogPostCreateStateImpl _value,
$Res Function(_$BlogPostCreateStateImpl) _then)
: super(_value, _then);
/// Create a copy of BlogPostCreateState
/// with the given fields replaced by the non-null parameter values.
@@ -208,23 +210,20 @@ abstract class _BlogPostCreateState implements BlogPostCreateState {
/// @nodoc
abstract class _$$BlogPostCreateStateLoadingImplCopyWith<$Res> {
factory _$$BlogPostCreateStateLoadingImplCopyWith(
_$BlogPostCreateStateLoadingImpl value,
$Res Function(_$BlogPostCreateStateLoadingImpl) then,
) = __$$BlogPostCreateStateLoadingImplCopyWithImpl<$Res>;
_$BlogPostCreateStateLoadingImpl value,
$Res Function(_$BlogPostCreateStateLoadingImpl) then) =
__$$BlogPostCreateStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$BlogPostCreateStateLoadingImplCopyWithImpl<$Res>
extends
_$BlogPostCreateStateCopyWithImpl<
$Res,
_$BlogPostCreateStateLoadingImpl
>
extends _$BlogPostCreateStateCopyWithImpl<$Res,
_$BlogPostCreateStateLoadingImpl>
implements _$$BlogPostCreateStateLoadingImplCopyWith<$Res> {
__$$BlogPostCreateStateLoadingImplCopyWithImpl(
_$BlogPostCreateStateLoadingImpl _value,
$Res Function(_$BlogPostCreateStateLoadingImpl) _then,
) : super(_value, _then);
_$BlogPostCreateStateLoadingImpl _value,
$Res Function(_$BlogPostCreateStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of BlogPostCreateState
/// with the given fields replaced by the non-null parameter values.
@@ -332,20 +331,20 @@ abstract class BlogPostCreateStateLoading implements BlogPostCreateState {
/// @nodoc
abstract class _$$BlogPostCreateStateLoadedImplCopyWith<$Res> {
factory _$$BlogPostCreateStateLoadedImplCopyWith(
_$BlogPostCreateStateLoadedImpl value,
$Res Function(_$BlogPostCreateStateLoadedImpl) then,
) = __$$BlogPostCreateStateLoadedImplCopyWithImpl<$Res>;
_$BlogPostCreateStateLoadedImpl value,
$Res Function(_$BlogPostCreateStateLoadedImpl) then) =
__$$BlogPostCreateStateLoadedImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$BlogPostCreateStateLoadedImplCopyWithImpl<$Res>
extends
_$BlogPostCreateStateCopyWithImpl<$Res, _$BlogPostCreateStateLoadedImpl>
extends _$BlogPostCreateStateCopyWithImpl<$Res,
_$BlogPostCreateStateLoadedImpl>
implements _$$BlogPostCreateStateLoadedImplCopyWith<$Res> {
__$$BlogPostCreateStateLoadedImplCopyWithImpl(
_$BlogPostCreateStateLoadedImpl _value,
$Res Function(_$BlogPostCreateStateLoadedImpl) _then,
) : super(_value, _then);
_$BlogPostCreateStateLoadedImpl _value,
$Res Function(_$BlogPostCreateStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of BlogPostCreateState
/// with the given fields replaced by the non-null parameter values.
@@ -453,37 +452,36 @@ abstract class BlogPostCreateStateLoaded implements BlogPostCreateState {
/// @nodoc
abstract class _$$BlogPostCreateStateErrorImplCopyWith<$Res> {
factory _$$BlogPostCreateStateErrorImplCopyWith(
_$BlogPostCreateStateErrorImpl value,
$Res Function(_$BlogPostCreateStateErrorImpl) then,
) = __$$BlogPostCreateStateErrorImplCopyWithImpl<$Res>;
_$BlogPostCreateStateErrorImpl value,
$Res Function(_$BlogPostCreateStateErrorImpl) then) =
__$$BlogPostCreateStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
/// @nodoc
class __$$BlogPostCreateStateErrorImplCopyWithImpl<$Res>
extends
_$BlogPostCreateStateCopyWithImpl<$Res, _$BlogPostCreateStateErrorImpl>
extends _$BlogPostCreateStateCopyWithImpl<$Res,
_$BlogPostCreateStateErrorImpl>
implements _$$BlogPostCreateStateErrorImplCopyWith<$Res> {
__$$BlogPostCreateStateErrorImplCopyWithImpl(
_$BlogPostCreateStateErrorImpl _value,
$Res Function(_$BlogPostCreateStateErrorImpl) _then,
) : super(_value, _then);
_$BlogPostCreateStateErrorImpl _value,
$Res Function(_$BlogPostCreateStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of BlogPostCreateState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$BlogPostCreateStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$BlogPostCreateStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -518,9 +516,8 @@ class _$BlogPostCreateStateErrorImpl implements BlogPostCreateStateError {
@override
@pragma('vm:prefer-inline')
_$$BlogPostCreateStateErrorImplCopyWith<_$BlogPostCreateStateErrorImpl>
get copyWith => __$$BlogPostCreateStateErrorImplCopyWithImpl<
_$BlogPostCreateStateErrorImpl
>(this, _$identity);
get copyWith => __$$BlogPostCreateStateErrorImplCopyWithImpl<
_$BlogPostCreateStateErrorImpl>(this, _$identity);
@override
@optionalTypeArgs
@@ -607,5 +604,5 @@ abstract class BlogPostCreateStateError implements BlogPostCreateState {
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$BlogPostCreateStateErrorImplCopyWith<_$BlogPostCreateStateErrorImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -22,8 +22,9 @@ class BlogPostCreateScreen extends StatefulWidget {
final FeedBlogPostModel? feedBlogPostModel;
const BlogPostCreateScreen({
super.key,
this.feedBlogPostModel,
}) : super();
});
@override
State<BlogPostCreateScreen> createState() => _BlogPostCreateScreenState();
@@ -61,6 +62,7 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
super.dispose();
}
@override
Widget build(BuildContext context) {
return BlocProvider<BlogPostCreateCubit>(
create: (BuildContext context) => blogPostCubit,
@@ -70,7 +72,7 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
context.read<FeedCubit>().loadFeedBlogPostList();
}
},
child: _buildBlogPostCreate(),
child: _buildBlogPostCreate(context),
),
);
}
@@ -85,10 +87,11 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
final picker = ImagePicker();
image = await picker.pickImage(source: ImageSource.camera);
setState(() {});
if (!context.mounted) return;
Navigator.of(context).pop();
},
child: const Row(
children: const [
children: [
Icon(Icons.photo_camera),
SizedBox(width: 8),
Text('Фото'),
@@ -100,10 +103,11 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
final picker = ImagePicker();
image = await picker.pickImage(source: ImageSource.gallery);
setState(() {});
if (!context.mounted) return;
Navigator.of(context).pop();
},
child: const Row(
children: const [
children: [
Icon(Icons.photo),
SizedBox(width: 8),
Text('Галерея'),
@@ -120,7 +124,7 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
);
}
_buildBlogPostCreate() {
_buildBlogPostCreate(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: AppBar(),
@@ -137,8 +141,8 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
),
backgroundColor: appTheme.blueA400,
label: isLoading
? CircularProgressIndicator()
: Text(
? const CircularProgressIndicator()
: const Text(
'Создать',
style: TextStyle(
color: Colors.white,
@@ -164,8 +168,10 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
isLoading = false;
});
if (!result) {
if (!context.mounted) return;
showErrorDialog(context, title: S.current.could_not_update_blog_post);
} else {
if (!context.mounted) return;
context.pop();
}
} else {
@@ -179,8 +185,10 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
isLoading = false;
});
if (!result) {
if (!context.mounted) return;
showErrorDialog(context, title: S.current.could_not_publish_blog_post);
} else {
if (!context.mounted) return;
context.pop();
}
}
@@ -188,36 +196,36 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
),
),
body: SingleChildScrollView(
padding: EdgeInsets.all(16),
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 16),
Text('Заголовок'),
SizedBox(height: 8),
const SizedBox(height: 16),
const Text('Заголовок'),
const SizedBox(height: 8),
CustomTextFormField(
controller: titleController,
),
SizedBox(height: 16),
Text('Описание'),
SizedBox(height: 8),
const SizedBox(height: 16),
const Text('Описание'),
const SizedBox(height: 8),
CustomTextFormField(
controller: descriptionController,
maxLines: 6,
minLines: 4,
),
SizedBox(height: 16),
if (videoUrlController.text.isEmpty) Text('Изображение поста'),
if (videoUrlController.text.isEmpty) SizedBox(height: 8),
const SizedBox(height: 16),
if (videoUrlController.text.isEmpty) const Text('Изображение поста'),
if (videoUrlController.text.isEmpty) const SizedBox(height: 8),
if (videoUrlController.text.isEmpty) _buildAddPhoto(),
SizedBox(height: 16),
if (image == null && widget.feedBlogPostModel?.image == null) Text('Ссылка на видео'),
if (image == null && widget.feedBlogPostModel?.image == null) SizedBox(height: 8),
const SizedBox(height: 16),
if (image == null && widget.feedBlogPostModel?.image == null) const Text('Ссылка на видео'),
if (image == null && widget.feedBlogPostModel?.image == null) const SizedBox(height: 8),
if (image == null && widget.feedBlogPostModel?.image == null)
CustomTextFormField(
controller: videoUrlController,
),
SizedBox(height: 80),
const SizedBox(height: 80),
],
),
),
@@ -235,7 +243,7 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
AnimatedContainer(
height: shrinkImage ? 52 : 128,
curve: Curves.easeIn,
duration: Duration(milliseconds: 150),
duration: const Duration(milliseconds: 150),
decoration: AppDecoration.fillGray.copyWith(
borderRadius: BorderRadius.circular(16),
),
@@ -247,7 +255,7 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
Icons.photo_library,
color: appTheme.blueGray300,
),
SizedBox(width: 8),
const SizedBox(width: 8),
Text(
"Добавить фото",
selectionColor: appTheme.blueA400,
@@ -256,7 +264,7 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
),
),
if (image != null)
Container(
SizedBox(
width: shrinkImage ? 52 : MediaQuery.of(context).size.width - 32,
child: ClipRRect(
borderRadius: BorderRadius.circular(16),
@@ -270,12 +278,12 @@ class _BlogPostCreateScreenState extends State<BlogPostCreateScreen> {
),
),
if (widget.feedBlogPostModel?.image != null && image == null)
Container(
SizedBox(
width: shrinkImage ? 52 : MediaQuery.of(context).size.width - 32,
child: ClipRRect(
borderRadius: BorderRadius.circular(16),
child: Image(
image: NetworkImage(baseUrl + '/storage/' + widget.feedBlogPostModel!.image),
image: NetworkImage('$baseUrl/storage/${widget.feedBlogPostModel!.image}'),
),
),
),

View File

@@ -1,3 +1,4 @@
import 'dart:developer';
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:eatvio_app/core/const.dart';
@@ -35,7 +36,7 @@ class BlogPostRepository {
Future<XFile?> downloadImage(String imageUrl) async {
try {
// Загрузка изображения
final response = await http.get(Uri.parse(baseUrl + '/storage/' + imageUrl));
final response = await http.get(Uri.parse('$baseUrl/storage/$imageUrl'));
if (response.statusCode == 200) {
// Получение временной директории
@@ -49,11 +50,11 @@ class BlogPostRepository {
// Возвращаем объект XFile
return XFile(file.path);
} else {
print('Ошибка загрузки изображения: ${response.statusCode}');
log('Ошибка загрузки изображения: ${response.statusCode}');
return null;
}
} catch (e) {
print('Произошла ошибка: $e');
log('Произошла ошибка: $e');
return null;
}
}
@@ -68,8 +69,7 @@ class BlogPostRepository {
) async {
FormData formData = FormData.fromMap({
'title': title,
'description': description,
'state': 'active',
'description_md': description,
'video_url': videoUrl,
'image': image != null
? await MultipartFile.fromFile((await ImageCompressUtility.compressFile(File(image.path))).path, filename: image.name)

View File

@@ -13,7 +13,7 @@ abstract class BlogPostService {
@Body() required FormData formData,
});
@POST('/api/blogPosts/update/{id}')
@POST('/api/blogPosts/update/published/{id}')
@MultiPart()
Future<void> updateBlogPost({
@Path('id') required int id,

View File

@@ -25,11 +25,11 @@ class _BlogPostService implements BlogPostService {
final _data = formData;
final _options = _setStreamType<void>(
Options(
method: 'POST',
headers: _headers,
extra: _extra,
contentType: 'multipart/form-data',
)
method: 'POST',
headers: _headers,
extra: _extra,
contentType: 'multipart/form-data',
)
.compose(
_dio.options,
'/api/blogPosts/create/published',
@@ -52,14 +52,14 @@ class _BlogPostService implements BlogPostService {
final _data = formData;
final _options = _setStreamType<void>(
Options(
method: 'POST',
headers: _headers,
extra: _extra,
contentType: 'multipart/form-data',
)
method: 'POST',
headers: _headers,
extra: _extra,
contentType: 'multipart/form-data',
)
.compose(
_dio.options,
'/api/blogPosts/update/${id}',
'/api/blogPosts/update/published/${id}',
queryParameters: queryParameters,
data: _data,
)

View File

@@ -1,16 +0,0 @@
/*
import 'package:eatvio_app/features/blog_post_create/models/blog_post_create_credentials_model.dart';
import 'package:dio/dio.dart';
import 'package:retrofit/retrofit.dart';
part 'blog_service.g.dart';
@RestApi()
abstract class BlogService {
factory BlogService(Dio dio, {String baseUrl}) = _BlogService;
@POST('/blog_post/create')
Future<BlogPostCreateCredentialsModel> createBlogPost(
BlogPostCreateCredentialsModel model);
}
*/

View File

@@ -12,8 +12,7 @@ part of 'new_messages_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$NewMessagesState {
@@ -23,14 +22,16 @@ mixin _$NewMessagesState {
required TResult Function() empty,
required TResult Function(int messagesCount) loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? empty,
TResult? Function(int messagesCount)? loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
@@ -38,21 +39,24 @@ mixin _$NewMessagesState {
TResult Function(int messagesCount)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_NewMessagesState value) $default, {
required TResult Function(NewMessagesStateEmpty value) empty,
required TResult Function(NewMessagesStateLoaded value) loaded,
required TResult Function(NewMessagesStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_NewMessagesState value)? $default, {
TResult? Function(NewMessagesStateEmpty value)? empty,
TResult? Function(NewMessagesStateLoaded value)? loaded,
TResult? Function(NewMessagesStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_NewMessagesState value)? $default, {
@@ -60,15 +64,15 @@ mixin _$NewMessagesState {
TResult Function(NewMessagesStateLoaded value)? loaded,
TResult Function(NewMessagesStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $NewMessagesStateCopyWith<$Res> {
factory $NewMessagesStateCopyWith(
NewMessagesState value,
$Res Function(NewMessagesState) then,
) = _$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>;
NewMessagesState value, $Res Function(NewMessagesState) then) =
_$NewMessagesStateCopyWithImpl<$Res, NewMessagesState>;
}
/// @nodoc
@@ -87,20 +91,18 @@ class _$NewMessagesStateCopyWithImpl<$Res, $Val extends NewMessagesState>
/// @nodoc
abstract class _$$NewMessagesStateImplCopyWith<$Res> {
factory _$$NewMessagesStateImplCopyWith(
_$NewMessagesStateImpl value,
$Res Function(_$NewMessagesStateImpl) then,
) = __$$NewMessagesStateImplCopyWithImpl<$Res>;
factory _$$NewMessagesStateImplCopyWith(_$NewMessagesStateImpl value,
$Res Function(_$NewMessagesStateImpl) then) =
__$$NewMessagesStateImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$NewMessagesStateImplCopyWithImpl<$Res>
extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateImpl>
implements _$$NewMessagesStateImplCopyWith<$Res> {
__$$NewMessagesStateImplCopyWithImpl(
_$NewMessagesStateImpl _value,
$Res Function(_$NewMessagesStateImpl) _then,
) : super(_value, _then);
__$$NewMessagesStateImplCopyWithImpl(_$NewMessagesStateImpl _value,
$Res Function(_$NewMessagesStateImpl) _then)
: super(_value, _then);
/// Create a copy of NewMessagesState
/// with the given fields replaced by the non-null parameter values.
@@ -207,19 +209,18 @@ abstract class _NewMessagesState implements NewMessagesState {
/// @nodoc
abstract class _$$NewMessagesStateEmptyImplCopyWith<$Res> {
factory _$$NewMessagesStateEmptyImplCopyWith(
_$NewMessagesStateEmptyImpl value,
$Res Function(_$NewMessagesStateEmptyImpl) then,
) = __$$NewMessagesStateEmptyImplCopyWithImpl<$Res>;
_$NewMessagesStateEmptyImpl value,
$Res Function(_$NewMessagesStateEmptyImpl) then) =
__$$NewMessagesStateEmptyImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$NewMessagesStateEmptyImplCopyWithImpl<$Res>
extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateEmptyImpl>
implements _$$NewMessagesStateEmptyImplCopyWith<$Res> {
__$$NewMessagesStateEmptyImplCopyWithImpl(
_$NewMessagesStateEmptyImpl _value,
$Res Function(_$NewMessagesStateEmptyImpl) _then,
) : super(_value, _then);
__$$NewMessagesStateEmptyImplCopyWithImpl(_$NewMessagesStateEmptyImpl _value,
$Res Function(_$NewMessagesStateEmptyImpl) _then)
: super(_value, _then);
/// Create a copy of NewMessagesState
/// with the given fields replaced by the non-null parameter values.
@@ -327,9 +328,9 @@ abstract class NewMessagesStateEmpty implements NewMessagesState {
/// @nodoc
abstract class _$$NewMessagesStateLoadedImplCopyWith<$Res> {
factory _$$NewMessagesStateLoadedImplCopyWith(
_$NewMessagesStateLoadedImpl value,
$Res Function(_$NewMessagesStateLoadedImpl) then,
) = __$$NewMessagesStateLoadedImplCopyWithImpl<$Res>;
_$NewMessagesStateLoadedImpl value,
$Res Function(_$NewMessagesStateLoadedImpl) then) =
__$$NewMessagesStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({int messagesCount});
}
@@ -339,24 +340,23 @@ class __$$NewMessagesStateLoadedImplCopyWithImpl<$Res>
extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateLoadedImpl>
implements _$$NewMessagesStateLoadedImplCopyWith<$Res> {
__$$NewMessagesStateLoadedImplCopyWithImpl(
_$NewMessagesStateLoadedImpl _value,
$Res Function(_$NewMessagesStateLoadedImpl) _then,
) : super(_value, _then);
_$NewMessagesStateLoadedImpl _value,
$Res Function(_$NewMessagesStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of NewMessagesState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? messagesCount = null}) {
return _then(
_$NewMessagesStateLoadedImpl(
messagesCount:
null == messagesCount
? _value.messagesCount
: messagesCount // ignore: cast_nullable_to_non_nullable
as int,
),
);
$Res call({
Object? messagesCount = null,
}) {
return _then(_$NewMessagesStateLoadedImpl(
messagesCount: null == messagesCount
? _value.messagesCount
: messagesCount // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
@@ -391,11 +391,8 @@ class _$NewMessagesStateLoadedImpl implements NewMessagesStateLoaded {
@override
@pragma('vm:prefer-inline')
_$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl>
get copyWith =>
__$$NewMessagesStateLoadedImplCopyWithImpl<_$NewMessagesStateLoadedImpl>(
this,
_$identity,
);
get copyWith => __$$NewMessagesStateLoadedImplCopyWithImpl<
_$NewMessagesStateLoadedImpl>(this, _$identity);
@override
@optionalTypeArgs
@@ -482,15 +479,15 @@ abstract class NewMessagesStateLoaded implements NewMessagesState {
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$NewMessagesStateLoadedImplCopyWith<_$NewMessagesStateLoadedImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class _$$NewMessagesStateErrorImplCopyWith<$Res> {
factory _$$NewMessagesStateErrorImplCopyWith(
_$NewMessagesStateErrorImpl value,
$Res Function(_$NewMessagesStateErrorImpl) then,
) = __$$NewMessagesStateErrorImplCopyWithImpl<$Res>;
_$NewMessagesStateErrorImpl value,
$Res Function(_$NewMessagesStateErrorImpl) then) =
__$$NewMessagesStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -499,25 +496,23 @@ abstract class _$$NewMessagesStateErrorImplCopyWith<$Res> {
class __$$NewMessagesStateErrorImplCopyWithImpl<$Res>
extends _$NewMessagesStateCopyWithImpl<$Res, _$NewMessagesStateErrorImpl>
implements _$$NewMessagesStateErrorImplCopyWith<$Res> {
__$$NewMessagesStateErrorImplCopyWithImpl(
_$NewMessagesStateErrorImpl _value,
$Res Function(_$NewMessagesStateErrorImpl) _then,
) : super(_value, _then);
__$$NewMessagesStateErrorImplCopyWithImpl(_$NewMessagesStateErrorImpl _value,
$Res Function(_$NewMessagesStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of NewMessagesState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$NewMessagesStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$NewMessagesStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -552,11 +547,8 @@ class _$NewMessagesStateErrorImpl implements NewMessagesStateError {
@override
@pragma('vm:prefer-inline')
_$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl>
get copyWith =>
__$$NewMessagesStateErrorImplCopyWithImpl<_$NewMessagesStateErrorImpl>(
this,
_$identity,
);
get copyWith => __$$NewMessagesStateErrorImplCopyWithImpl<
_$NewMessagesStateErrorImpl>(this, _$identity);
@override
@optionalTypeArgs
@@ -643,5 +635,5 @@ abstract class NewMessagesStateError implements NewMessagesState {
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$NewMessagesStateErrorImplCopyWith<_$NewMessagesStateErrorImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -12,8 +12,7 @@ part of 'notifications_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$NotificationsState {
@@ -22,43 +21,46 @@ mixin _$NotificationsState {
TResult Function() $default, {
required TResult Function() empty,
required TResult Function(
List<String> notifications,
int notificationsCount,
)
loaded,
List<String> notifications, int notificationsCount)
loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? empty,
TResult? Function(List<String> notifications, int notificationsCount)?
loaded,
loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? empty,
TResult Function(List<String> notifications, int notificationsCount)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_NotificationsState value) $default, {
required TResult Function(NotificationsStateEmpty value) empty,
required TResult Function(NotificationsStateLoaded value) loaded,
required TResult Function(NotificationsStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_NotificationsState value)? $default, {
TResult? Function(NotificationsStateEmpty value)? empty,
TResult? Function(NotificationsStateLoaded value)? loaded,
TResult? Function(NotificationsStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_NotificationsState value)? $default, {
@@ -66,15 +68,15 @@ mixin _$NotificationsState {
TResult Function(NotificationsStateLoaded value)? loaded,
TResult Function(NotificationsStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $NotificationsStateCopyWith<$Res> {
factory $NotificationsStateCopyWith(
NotificationsState value,
$Res Function(NotificationsState) then,
) = _$NotificationsStateCopyWithImpl<$Res, NotificationsState>;
NotificationsState value, $Res Function(NotificationsState) then) =
_$NotificationsStateCopyWithImpl<$Res, NotificationsState>;
}
/// @nodoc
@@ -93,20 +95,18 @@ class _$NotificationsStateCopyWithImpl<$Res, $Val extends NotificationsState>
/// @nodoc
abstract class _$$NotificationsStateImplCopyWith<$Res> {
factory _$$NotificationsStateImplCopyWith(
_$NotificationsStateImpl value,
$Res Function(_$NotificationsStateImpl) then,
) = __$$NotificationsStateImplCopyWithImpl<$Res>;
factory _$$NotificationsStateImplCopyWith(_$NotificationsStateImpl value,
$Res Function(_$NotificationsStateImpl) then) =
__$$NotificationsStateImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$NotificationsStateImplCopyWithImpl<$Res>
extends _$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateImpl>
implements _$$NotificationsStateImplCopyWith<$Res> {
__$$NotificationsStateImplCopyWithImpl(
_$NotificationsStateImpl _value,
$Res Function(_$NotificationsStateImpl) _then,
) : super(_value, _then);
__$$NotificationsStateImplCopyWithImpl(_$NotificationsStateImpl _value,
$Res Function(_$NotificationsStateImpl) _then)
: super(_value, _then);
/// Create a copy of NotificationsState
/// with the given fields replaced by the non-null parameter values.
@@ -137,10 +137,8 @@ class _$NotificationsStateImpl implements _NotificationsState {
TResult Function() $default, {
required TResult Function() empty,
required TResult Function(
List<String> notifications,
int notificationsCount,
)
loaded,
List<String> notifications, int notificationsCount)
loaded,
required TResult Function(String errorMessage) error,
}) {
return $default();
@@ -152,7 +150,7 @@ class _$NotificationsStateImpl implements _NotificationsState {
TResult? Function()? $default, {
TResult? Function()? empty,
TResult? Function(List<String> notifications, int notificationsCount)?
loaded,
loaded,
TResult? Function(String errorMessage)? error,
}) {
return $default?.call();
@@ -164,7 +162,7 @@ class _$NotificationsStateImpl implements _NotificationsState {
TResult Function()? $default, {
TResult Function()? empty,
TResult Function(List<String> notifications, int notificationsCount)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -219,20 +217,20 @@ abstract class _NotificationsState implements NotificationsState {
/// @nodoc
abstract class _$$NotificationsStateEmptyImplCopyWith<$Res> {
factory _$$NotificationsStateEmptyImplCopyWith(
_$NotificationsStateEmptyImpl value,
$Res Function(_$NotificationsStateEmptyImpl) then,
) = __$$NotificationsStateEmptyImplCopyWithImpl<$Res>;
_$NotificationsStateEmptyImpl value,
$Res Function(_$NotificationsStateEmptyImpl) then) =
__$$NotificationsStateEmptyImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$NotificationsStateEmptyImplCopyWithImpl<$Res>
extends
_$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateEmptyImpl>
extends _$NotificationsStateCopyWithImpl<$Res,
_$NotificationsStateEmptyImpl>
implements _$$NotificationsStateEmptyImplCopyWith<$Res> {
__$$NotificationsStateEmptyImplCopyWithImpl(
_$NotificationsStateEmptyImpl _value,
$Res Function(_$NotificationsStateEmptyImpl) _then,
) : super(_value, _then);
_$NotificationsStateEmptyImpl _value,
$Res Function(_$NotificationsStateEmptyImpl) _then)
: super(_value, _then);
/// Create a copy of NotificationsState
/// with the given fields replaced by the non-null parameter values.
@@ -264,10 +262,8 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty {
TResult Function() $default, {
required TResult Function() empty,
required TResult Function(
List<String> notifications,
int notificationsCount,
)
loaded,
List<String> notifications, int notificationsCount)
loaded,
required TResult Function(String errorMessage) error,
}) {
return empty();
@@ -279,7 +275,7 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty {
TResult? Function()? $default, {
TResult? Function()? empty,
TResult? Function(List<String> notifications, int notificationsCount)?
loaded,
loaded,
TResult? Function(String errorMessage)? error,
}) {
return empty?.call();
@@ -291,7 +287,7 @@ class _$NotificationsStateEmptyImpl implements NotificationsStateEmpty {
TResult Function()? $default, {
TResult Function()? empty,
TResult Function(List<String> notifications, int notificationsCount)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -346,52 +342,51 @@ abstract class NotificationsStateEmpty implements NotificationsState {
/// @nodoc
abstract class _$$NotificationsStateLoadedImplCopyWith<$Res> {
factory _$$NotificationsStateLoadedImplCopyWith(
_$NotificationsStateLoadedImpl value,
$Res Function(_$NotificationsStateLoadedImpl) then,
) = __$$NotificationsStateLoadedImplCopyWithImpl<$Res>;
_$NotificationsStateLoadedImpl value,
$Res Function(_$NotificationsStateLoadedImpl) then) =
__$$NotificationsStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({List<String> notifications, int notificationsCount});
}
/// @nodoc
class __$$NotificationsStateLoadedImplCopyWithImpl<$Res>
extends
_$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateLoadedImpl>
extends _$NotificationsStateCopyWithImpl<$Res,
_$NotificationsStateLoadedImpl>
implements _$$NotificationsStateLoadedImplCopyWith<$Res> {
__$$NotificationsStateLoadedImplCopyWithImpl(
_$NotificationsStateLoadedImpl _value,
$Res Function(_$NotificationsStateLoadedImpl) _then,
) : super(_value, _then);
_$NotificationsStateLoadedImpl _value,
$Res Function(_$NotificationsStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of NotificationsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? notifications = null, Object? notificationsCount = null}) {
return _then(
_$NotificationsStateLoadedImpl(
notifications:
null == notifications
? _value._notifications
: notifications // ignore: cast_nullable_to_non_nullable
as List<String>,
notificationsCount:
null == notificationsCount
? _value.notificationsCount
: notificationsCount // ignore: cast_nullable_to_non_nullable
as int,
),
);
$Res call({
Object? notifications = null,
Object? notificationsCount = null,
}) {
return _then(_$NotificationsStateLoadedImpl(
notifications: null == notifications
? _value._notifications
: notifications // ignore: cast_nullable_to_non_nullable
as List<String>,
notificationsCount: null == notificationsCount
? _value.notificationsCount
: notificationsCount // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// @nodoc
class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded {
const _$NotificationsStateLoadedImpl({
required final List<String> notifications,
required this.notificationsCount,
}) : _notifications = notifications;
const _$NotificationsStateLoadedImpl(
{required final List<String> notifications,
required this.notificationsCount})
: _notifications = notifications;
final List<String> _notifications;
@override
@@ -414,20 +409,15 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$NotificationsStateLoadedImpl &&
const DeepCollectionEquality().equals(
other._notifications,
_notifications,
) &&
const DeepCollectionEquality()
.equals(other._notifications, _notifications) &&
(identical(other.notificationsCount, notificationsCount) ||
other.notificationsCount == notificationsCount));
}
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_notifications),
notificationsCount,
);
int get hashCode => Object.hash(runtimeType,
const DeepCollectionEquality().hash(_notifications), notificationsCount);
/// Create a copy of NotificationsState
/// with the given fields replaced by the non-null parameter values.
@@ -435,9 +425,8 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded {
@override
@pragma('vm:prefer-inline')
_$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl>
get copyWith => __$$NotificationsStateLoadedImplCopyWithImpl<
_$NotificationsStateLoadedImpl
>(this, _$identity);
get copyWith => __$$NotificationsStateLoadedImplCopyWithImpl<
_$NotificationsStateLoadedImpl>(this, _$identity);
@override
@optionalTypeArgs
@@ -445,10 +434,8 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded {
TResult Function() $default, {
required TResult Function() empty,
required TResult Function(
List<String> notifications,
int notificationsCount,
)
loaded,
List<String> notifications, int notificationsCount)
loaded,
required TResult Function(String errorMessage) error,
}) {
return loaded(notifications, notificationsCount);
@@ -460,7 +447,7 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded {
TResult? Function()? $default, {
TResult? Function()? empty,
TResult? Function(List<String> notifications, int notificationsCount)?
loaded,
loaded,
TResult? Function(String errorMessage)? error,
}) {
return loaded?.call(notifications, notificationsCount);
@@ -472,7 +459,7 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded {
TResult Function()? $default, {
TResult Function()? empty,
TResult Function(List<String> notifications, int notificationsCount)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -521,10 +508,9 @@ class _$NotificationsStateLoadedImpl implements NotificationsStateLoaded {
}
abstract class NotificationsStateLoaded implements NotificationsState {
const factory NotificationsStateLoaded({
required final List<String> notifications,
required final int notificationsCount,
}) = _$NotificationsStateLoadedImpl;
const factory NotificationsStateLoaded(
{required final List<String> notifications,
required final int notificationsCount}) = _$NotificationsStateLoadedImpl;
List<String> get notifications;
int get notificationsCount;
@@ -533,43 +519,42 @@ abstract class NotificationsStateLoaded implements NotificationsState {
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$NotificationsStateLoadedImplCopyWith<_$NotificationsStateLoadedImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class _$$NotificationsStateErrorImplCopyWith<$Res> {
factory _$$NotificationsStateErrorImplCopyWith(
_$NotificationsStateErrorImpl value,
$Res Function(_$NotificationsStateErrorImpl) then,
) = __$$NotificationsStateErrorImplCopyWithImpl<$Res>;
_$NotificationsStateErrorImpl value,
$Res Function(_$NotificationsStateErrorImpl) then) =
__$$NotificationsStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
/// @nodoc
class __$$NotificationsStateErrorImplCopyWithImpl<$Res>
extends
_$NotificationsStateCopyWithImpl<$Res, _$NotificationsStateErrorImpl>
extends _$NotificationsStateCopyWithImpl<$Res,
_$NotificationsStateErrorImpl>
implements _$$NotificationsStateErrorImplCopyWith<$Res> {
__$$NotificationsStateErrorImplCopyWithImpl(
_$NotificationsStateErrorImpl _value,
$Res Function(_$NotificationsStateErrorImpl) _then,
) : super(_value, _then);
_$NotificationsStateErrorImpl _value,
$Res Function(_$NotificationsStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of NotificationsState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$NotificationsStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$NotificationsStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -604,9 +589,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError {
@override
@pragma('vm:prefer-inline')
_$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl>
get copyWith => __$$NotificationsStateErrorImplCopyWithImpl<
_$NotificationsStateErrorImpl
>(this, _$identity);
get copyWith => __$$NotificationsStateErrorImplCopyWithImpl<
_$NotificationsStateErrorImpl>(this, _$identity);
@override
@optionalTypeArgs
@@ -614,10 +598,8 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError {
TResult Function() $default, {
required TResult Function() empty,
required TResult Function(
List<String> notifications,
int notificationsCount,
)
loaded,
List<String> notifications, int notificationsCount)
loaded,
required TResult Function(String errorMessage) error,
}) {
return error(errorMessage);
@@ -629,7 +611,7 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError {
TResult? Function()? $default, {
TResult? Function()? empty,
TResult? Function(List<String> notifications, int notificationsCount)?
loaded,
loaded,
TResult? Function(String errorMessage)? error,
}) {
return error?.call(errorMessage);
@@ -641,7 +623,7 @@ class _$NotificationsStateErrorImpl implements NotificationsStateError {
TResult Function()? $default, {
TResult Function()? empty,
TResult Function(List<String> notifications, int notificationsCount)?
loaded,
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -699,5 +681,5 @@ abstract class NotificationsStateError implements NotificationsState {
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$NotificationsStateErrorImplCopyWith<_$NotificationsStateErrorImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -12,8 +12,7 @@ part of 'profile_avatar_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$ProfileAvatarState {
@@ -23,14 +22,16 @@ mixin _$ProfileAvatarState {
required TResult Function() loading,
required TResult Function(ProfileModel profile) loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(ProfileModel profile)? loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
@@ -38,21 +39,24 @@ mixin _$ProfileAvatarState {
TResult Function(ProfileModel profile)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_ProfileAvatarState value) $default, {
required TResult Function(ProfileAvatarStateLoading value) loading,
required TResult Function(ProfileAvatarStateLoaded value) loaded,
required TResult Function(ProfileAvatarStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_ProfileAvatarState value)? $default, {
TResult? Function(ProfileAvatarStateLoading value)? loading,
TResult? Function(ProfileAvatarStateLoaded value)? loaded,
TResult? Function(ProfileAvatarStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_ProfileAvatarState value)? $default, {
@@ -60,15 +64,15 @@ mixin _$ProfileAvatarState {
TResult Function(ProfileAvatarStateLoaded value)? loaded,
TResult Function(ProfileAvatarStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ProfileAvatarStateCopyWith<$Res> {
factory $ProfileAvatarStateCopyWith(
ProfileAvatarState value,
$Res Function(ProfileAvatarState) then,
) = _$ProfileAvatarStateCopyWithImpl<$Res, ProfileAvatarState>;
ProfileAvatarState value, $Res Function(ProfileAvatarState) then) =
_$ProfileAvatarStateCopyWithImpl<$Res, ProfileAvatarState>;
}
/// @nodoc
@@ -87,20 +91,18 @@ class _$ProfileAvatarStateCopyWithImpl<$Res, $Val extends ProfileAvatarState>
/// @nodoc
abstract class _$$ProfileAvatarStateImplCopyWith<$Res> {
factory _$$ProfileAvatarStateImplCopyWith(
_$ProfileAvatarStateImpl value,
$Res Function(_$ProfileAvatarStateImpl) then,
) = __$$ProfileAvatarStateImplCopyWithImpl<$Res>;
factory _$$ProfileAvatarStateImplCopyWith(_$ProfileAvatarStateImpl value,
$Res Function(_$ProfileAvatarStateImpl) then) =
__$$ProfileAvatarStateImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$ProfileAvatarStateImplCopyWithImpl<$Res>
extends _$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateImpl>
implements _$$ProfileAvatarStateImplCopyWith<$Res> {
__$$ProfileAvatarStateImplCopyWithImpl(
_$ProfileAvatarStateImpl _value,
$Res Function(_$ProfileAvatarStateImpl) _then,
) : super(_value, _then);
__$$ProfileAvatarStateImplCopyWithImpl(_$ProfileAvatarStateImpl _value,
$Res Function(_$ProfileAvatarStateImpl) _then)
: super(_value, _then);
/// Create a copy of ProfileAvatarState
/// with the given fields replaced by the non-null parameter values.
@@ -207,20 +209,20 @@ abstract class _ProfileAvatarState implements ProfileAvatarState {
/// @nodoc
abstract class _$$ProfileAvatarStateLoadingImplCopyWith<$Res> {
factory _$$ProfileAvatarStateLoadingImplCopyWith(
_$ProfileAvatarStateLoadingImpl value,
$Res Function(_$ProfileAvatarStateLoadingImpl) then,
) = __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res>;
_$ProfileAvatarStateLoadingImpl value,
$Res Function(_$ProfileAvatarStateLoadingImpl) then) =
__$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$ProfileAvatarStateLoadingImplCopyWithImpl<$Res>
extends
_$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateLoadingImpl>
extends _$ProfileAvatarStateCopyWithImpl<$Res,
_$ProfileAvatarStateLoadingImpl>
implements _$$ProfileAvatarStateLoadingImplCopyWith<$Res> {
__$$ProfileAvatarStateLoadingImplCopyWithImpl(
_$ProfileAvatarStateLoadingImpl _value,
$Res Function(_$ProfileAvatarStateLoadingImpl) _then,
) : super(_value, _then);
_$ProfileAvatarStateLoadingImpl _value,
$Res Function(_$ProfileAvatarStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of ProfileAvatarState
/// with the given fields replaced by the non-null parameter values.
@@ -328,9 +330,9 @@ abstract class ProfileAvatarStateLoading implements ProfileAvatarState {
/// @nodoc
abstract class _$$ProfileAvatarStateLoadedImplCopyWith<$Res> {
factory _$$ProfileAvatarStateLoadedImplCopyWith(
_$ProfileAvatarStateLoadedImpl value,
$Res Function(_$ProfileAvatarStateLoadedImpl) then,
) = __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res>;
_$ProfileAvatarStateLoadedImpl value,
$Res Function(_$ProfileAvatarStateLoadedImpl) then) =
__$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({ProfileModel profile});
@@ -339,28 +341,27 @@ abstract class _$$ProfileAvatarStateLoadedImplCopyWith<$Res> {
/// @nodoc
class __$$ProfileAvatarStateLoadedImplCopyWithImpl<$Res>
extends
_$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateLoadedImpl>
extends _$ProfileAvatarStateCopyWithImpl<$Res,
_$ProfileAvatarStateLoadedImpl>
implements _$$ProfileAvatarStateLoadedImplCopyWith<$Res> {
__$$ProfileAvatarStateLoadedImplCopyWithImpl(
_$ProfileAvatarStateLoadedImpl _value,
$Res Function(_$ProfileAvatarStateLoadedImpl) _then,
) : super(_value, _then);
_$ProfileAvatarStateLoadedImpl _value,
$Res Function(_$ProfileAvatarStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of ProfileAvatarState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? profile = null}) {
return _then(
_$ProfileAvatarStateLoadedImpl(
profile:
null == profile
? _value.profile
: profile // ignore: cast_nullable_to_non_nullable
as ProfileModel,
),
);
$Res call({
Object? profile = null,
}) {
return _then(_$ProfileAvatarStateLoadedImpl(
profile: null == profile
? _value.profile
: profile // ignore: cast_nullable_to_non_nullable
as ProfileModel,
));
}
/// Create a copy of ProfileAvatarState
@@ -404,9 +405,8 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded {
@override
@pragma('vm:prefer-inline')
_$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl>
get copyWith => __$$ProfileAvatarStateLoadedImplCopyWithImpl<
_$ProfileAvatarStateLoadedImpl
>(this, _$identity);
get copyWith => __$$ProfileAvatarStateLoadedImplCopyWithImpl<
_$ProfileAvatarStateLoadedImpl>(this, _$identity);
@override
@optionalTypeArgs
@@ -484,9 +484,8 @@ class _$ProfileAvatarStateLoadedImpl implements ProfileAvatarStateLoaded {
}
abstract class ProfileAvatarStateLoaded implements ProfileAvatarState {
const factory ProfileAvatarStateLoaded({
required final ProfileModel profile,
}) = _$ProfileAvatarStateLoadedImpl;
const factory ProfileAvatarStateLoaded(
{required final ProfileModel profile}) = _$ProfileAvatarStateLoadedImpl;
ProfileModel get profile;
@@ -494,43 +493,42 @@ abstract class ProfileAvatarStateLoaded implements ProfileAvatarState {
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ProfileAvatarStateLoadedImplCopyWith<_$ProfileAvatarStateLoadedImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class _$$ProfileAvatarStateErrorImplCopyWith<$Res> {
factory _$$ProfileAvatarStateErrorImplCopyWith(
_$ProfileAvatarStateErrorImpl value,
$Res Function(_$ProfileAvatarStateErrorImpl) then,
) = __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res>;
_$ProfileAvatarStateErrorImpl value,
$Res Function(_$ProfileAvatarStateErrorImpl) then) =
__$$ProfileAvatarStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
/// @nodoc
class __$$ProfileAvatarStateErrorImplCopyWithImpl<$Res>
extends
_$ProfileAvatarStateCopyWithImpl<$Res, _$ProfileAvatarStateErrorImpl>
extends _$ProfileAvatarStateCopyWithImpl<$Res,
_$ProfileAvatarStateErrorImpl>
implements _$$ProfileAvatarStateErrorImplCopyWith<$Res> {
__$$ProfileAvatarStateErrorImplCopyWithImpl(
_$ProfileAvatarStateErrorImpl _value,
$Res Function(_$ProfileAvatarStateErrorImpl) _then,
) : super(_value, _then);
_$ProfileAvatarStateErrorImpl _value,
$Res Function(_$ProfileAvatarStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of ProfileAvatarState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$ProfileAvatarStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$ProfileAvatarStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -565,9 +563,8 @@ class _$ProfileAvatarStateErrorImpl implements ProfileAvatarStateError {
@override
@pragma('vm:prefer-inline')
_$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl>
get copyWith => __$$ProfileAvatarStateErrorImplCopyWithImpl<
_$ProfileAvatarStateErrorImpl
>(this, _$identity);
get copyWith => __$$ProfileAvatarStateErrorImplCopyWithImpl<
_$ProfileAvatarStateErrorImpl>(this, _$identity);
@override
@optionalTypeArgs
@@ -654,5 +651,5 @@ abstract class ProfileAvatarStateError implements ProfileAvatarState {
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ProfileAvatarStateErrorImplCopyWith<_$ProfileAvatarStateErrorImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -90,7 +90,7 @@ class _BottomNavigationBarWidgetState extends State<BottomNavigationBarWidget> {
icon: Padding(
padding: const EdgeInsets.only(bottom: 2),
child: SvgPicture.asset(
colorFilter: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
colorFilter: const ColorFilter.mode(Colors.grey, BlendMode.srcIn),
width: 20,
height: 20,
ImageConstant.icnFeed,
@@ -114,7 +114,7 @@ class _BottomNavigationBarWidgetState extends State<BottomNavigationBarWidget> {
icon: Padding(
padding: const EdgeInsets.only(bottom: 2),
child: SvgPicture.asset(
colorFilter: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
colorFilter: const ColorFilter.mode(Colors.grey, BlendMode.srcIn),
ImageConstant.icnDiary,
width: 20,
height: 20,
@@ -139,7 +139,7 @@ class _BottomNavigationBarWidgetState extends State<BottomNavigationBarWidget> {
icon: Padding(
padding: const EdgeInsets.only(bottom: 2),
child: SvgPicture.asset(
colorFilter: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
colorFilter: const ColorFilter.mode(Colors.grey, BlendMode.srcIn),
'assets/icons/consultations.svg',
width: 20,
height: 20,
@@ -165,7 +165,7 @@ class _BottomNavigationBarWidgetState extends State<BottomNavigationBarWidget> {
final hasUnreadMessages = state.chatsWithUnreadMessagesCount > 0;
return badges.Badge(
position: badges.BadgePosition.topEnd(),
badgeAnimation: badges.BadgeAnimation.fade(),
badgeAnimation: const badges.BadgeAnimation.fade(),
badgeStyle: badges.BadgeStyle(
badgeColor: hasUnreadMessages ? Colors.red : Colors.transparent,
),
@@ -187,7 +187,7 @@ class _BottomNavigationBarWidgetState extends State<BottomNavigationBarWidget> {
appTheme.blueA400,
BlendMode.srcIn,
)
: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
: const ColorFilter.mode(Colors.grey, BlendMode.srcIn),
),
),
);
@@ -200,10 +200,10 @@ class _BottomNavigationBarWidgetState extends State<BottomNavigationBarWidget> {
builder: (BuildContext context, NotificationsState state) {
return badges.Badge(
position: badges.BadgePosition.topEnd(),
badgeAnimation: badges.BadgeAnimation.fade(),
badgeAnimation: const badges.BadgeAnimation.fade(),
badgeContent: Text(
(state is NotificationsStateLoaded) ? state.notificationsCount.toString() : '0',
style: TextStyle(
style: const TextStyle(
color: Colors.white,
fontSize: 8,
),
@@ -217,7 +217,7 @@ class _BottomNavigationBarWidgetState extends State<BottomNavigationBarWidget> {
appTheme.blueA400,
BlendMode.srcIn,
)
: ColorFilter.mode(Colors.grey, BlendMode.srcIn),
: const ColorFilter.mode(Colors.grey, BlendMode.srcIn),
width: 20,
height: 20,
),

View File

@@ -1,21 +0,0 @@
/// This class is used in the [userprofile_item_widget] screen.
// ignore_for_file: must_be_immutable
class CalendarEntryModel {
String? date;
String? status;
String id;
bool is_current_day_included_in_the_chosen_diet_progression;
CalendarEntryModel({
this.date,
this.status,
required this.id,
required this.is_current_day_included_in_the_chosen_diet_progression,
}) {
date = date;
status = status;
id = id;
is_current_day_included_in_the_chosen_diet_progression = is_current_day_included_in_the_chosen_diet_progression;
}
}

View File

@@ -8,7 +8,7 @@ part 'calendar_model.g.dart';
class CalendarModel with _$CalendarModel {
const factory CalendarModel({
required String date,
required bool is_current_day_included_in_the_chosen_diet_progression,
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression') required bool isCurrentDayIncludedInTheChosenDietProgression,
Object? diary,
}) = _CalendarModel;

View File

@@ -12,8 +12,7 @@ part of 'calendar_model.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
CalendarModel _$CalendarModelFromJson(Map<String, dynamic> json) {
return _CalendarModel.fromJson(json);
@@ -22,7 +21,8 @@ CalendarModel _$CalendarModelFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$CalendarModel {
String get date => throw _privateConstructorUsedError;
bool get is_current_day_included_in_the_chosen_diet_progression =>
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
bool get isCurrentDayIncludedInTheChosenDietProgression =>
throw _privateConstructorUsedError;
Object? get diary => throw _privateConstructorUsedError;
@@ -39,15 +39,14 @@ mixin _$CalendarModel {
/// @nodoc
abstract class $CalendarModelCopyWith<$Res> {
factory $CalendarModelCopyWith(
CalendarModel value,
$Res Function(CalendarModel) then,
) = _$CalendarModelCopyWithImpl<$Res, CalendarModel>;
CalendarModel value, $Res Function(CalendarModel) then) =
_$CalendarModelCopyWithImpl<$Res, CalendarModel>;
@useResult
$Res call({
String date,
bool is_current_day_included_in_the_chosen_diet_progression,
Object? diary,
});
$Res call(
{String date,
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
bool isCurrentDayIncludedInTheChosenDietProgression,
Object? diary});
}
/// @nodoc
@@ -66,26 +65,21 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel>
@override
$Res call({
Object? date = null,
Object? is_current_day_included_in_the_chosen_diet_progression = null,
Object? isCurrentDayIncludedInTheChosenDietProgression = null,
Object? diary = freezed,
}) {
return _then(
_value.copyWith(
date:
null == date
? _value.date
: date // ignore: cast_nullable_to_non_nullable
as String,
is_current_day_included_in_the_chosen_diet_progression:
null == is_current_day_included_in_the_chosen_diet_progression
? _value
.is_current_day_included_in_the_chosen_diet_progression
: is_current_day_included_in_the_chosen_diet_progression // ignore: cast_nullable_to_non_nullable
as bool,
diary: freezed == diary ? _value.diary : diary,
)
as $Val,
);
return _then(_value.copyWith(
date: null == date
? _value.date
: date // ignore: cast_nullable_to_non_nullable
as String,
isCurrentDayIncludedInTheChosenDietProgression: null ==
isCurrentDayIncludedInTheChosenDietProgression
? _value.isCurrentDayIncludedInTheChosenDietProgression
: isCurrentDayIncludedInTheChosenDietProgression // ignore: cast_nullable_to_non_nullable
as bool,
diary: freezed == diary ? _value.diary : diary,
) as $Val);
}
}
@@ -93,16 +87,15 @@ class _$CalendarModelCopyWithImpl<$Res, $Val extends CalendarModel>
abstract class _$$CalendarModelImplCopyWith<$Res>
implements $CalendarModelCopyWith<$Res> {
factory _$$CalendarModelImplCopyWith(
_$CalendarModelImpl value,
$Res Function(_$CalendarModelImpl) then,
) = __$$CalendarModelImplCopyWithImpl<$Res>;
_$CalendarModelImpl value, $Res Function(_$CalendarModelImpl) then) =
__$$CalendarModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
String date,
bool is_current_day_included_in_the_chosen_diet_progression,
Object? diary,
});
$Res call(
{String date,
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
bool isCurrentDayIncludedInTheChosenDietProgression,
Object? diary});
}
/// @nodoc
@@ -110,9 +103,8 @@ class __$$CalendarModelImplCopyWithImpl<$Res>
extends _$CalendarModelCopyWithImpl<$Res, _$CalendarModelImpl>
implements _$$CalendarModelImplCopyWith<$Res> {
__$$CalendarModelImplCopyWithImpl(
_$CalendarModelImpl _value,
$Res Function(_$CalendarModelImpl) _then,
) : super(_value, _then);
_$CalendarModelImpl _value, $Res Function(_$CalendarModelImpl) _then)
: super(_value, _then);
/// Create a copy of CalendarModel
/// with the given fields replaced by the non-null parameter values.
@@ -120,35 +112,32 @@ class __$$CalendarModelImplCopyWithImpl<$Res>
@override
$Res call({
Object? date = null,
Object? is_current_day_included_in_the_chosen_diet_progression = null,
Object? isCurrentDayIncludedInTheChosenDietProgression = null,
Object? diary = freezed,
}) {
return _then(
_$CalendarModelImpl(
date:
null == date
? _value.date
: date // ignore: cast_nullable_to_non_nullable
as String,
is_current_day_included_in_the_chosen_diet_progression:
null == is_current_day_included_in_the_chosen_diet_progression
? _value.is_current_day_included_in_the_chosen_diet_progression
: is_current_day_included_in_the_chosen_diet_progression // ignore: cast_nullable_to_non_nullable
as bool,
diary: freezed == diary ? _value.diary : diary,
),
);
return _then(_$CalendarModelImpl(
date: null == date
? _value.date
: date // ignore: cast_nullable_to_non_nullable
as String,
isCurrentDayIncludedInTheChosenDietProgression: null ==
isCurrentDayIncludedInTheChosenDietProgression
? _value.isCurrentDayIncludedInTheChosenDietProgression
: isCurrentDayIncludedInTheChosenDietProgression // ignore: cast_nullable_to_non_nullable
as bool,
diary: freezed == diary ? _value.diary : diary,
));
}
}
/// @nodoc
@JsonSerializable()
class _$CalendarModelImpl implements _CalendarModel {
const _$CalendarModelImpl({
required this.date,
required this.is_current_day_included_in_the_chosen_diet_progression,
this.diary,
});
const _$CalendarModelImpl(
{required this.date,
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
required this.isCurrentDayIncludedInTheChosenDietProgression,
this.diary});
factory _$CalendarModelImpl.fromJson(Map<String, dynamic> json) =>
_$$CalendarModelImplFromJson(json);
@@ -156,13 +145,14 @@ class _$CalendarModelImpl implements _CalendarModel {
@override
final String date;
@override
final bool is_current_day_included_in_the_chosen_diet_progression;
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
final bool isCurrentDayIncludedInTheChosenDietProgression;
@override
final Object? diary;
@override
String toString() {
return 'CalendarModel(date: $date, is_current_day_included_in_the_chosen_diet_progression: $is_current_day_included_in_the_chosen_diet_progression, diary: $diary)';
return 'CalendarModel(date: $date, isCurrentDayIncludedInTheChosenDietProgression: $isCurrentDayIncludedInTheChosenDietProgression, diary: $diary)';
}
@override
@@ -171,23 +161,20 @@ class _$CalendarModelImpl implements _CalendarModel {
(other.runtimeType == runtimeType &&
other is _$CalendarModelImpl &&
(identical(other.date, date) || other.date == date) &&
(identical(
other.is_current_day_included_in_the_chosen_diet_progression,
is_current_day_included_in_the_chosen_diet_progression,
) ||
other.is_current_day_included_in_the_chosen_diet_progression ==
is_current_day_included_in_the_chosen_diet_progression) &&
(identical(other.isCurrentDayIncludedInTheChosenDietProgression,
isCurrentDayIncludedInTheChosenDietProgression) ||
other.isCurrentDayIncludedInTheChosenDietProgression ==
isCurrentDayIncludedInTheChosenDietProgression) &&
const DeepCollectionEquality().equals(other.diary, diary));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
date,
is_current_day_included_in_the_chosen_diet_progression,
const DeepCollectionEquality().hash(diary),
);
runtimeType,
date,
isCurrentDayIncludedInTheChosenDietProgression,
const DeepCollectionEquality().hash(diary));
/// Create a copy of CalendarModel
/// with the given fields replaced by the non-null parameter values.
@@ -199,16 +186,18 @@ class _$CalendarModelImpl implements _CalendarModel {
@override
Map<String, dynamic> toJson() {
return _$$CalendarModelImplToJson(this);
return _$$CalendarModelImplToJson(
this,
);
}
}
abstract class _CalendarModel implements CalendarModel {
const factory _CalendarModel({
required final String date,
required final bool is_current_day_included_in_the_chosen_diet_progression,
final Object? diary,
}) = _$CalendarModelImpl;
const factory _CalendarModel(
{required final String date,
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
required final bool isCurrentDayIncludedInTheChosenDietProgression,
final Object? diary}) = _$CalendarModelImpl;
factory _CalendarModel.fromJson(Map<String, dynamic> json) =
_$CalendarModelImpl.fromJson;
@@ -216,7 +205,8 @@ abstract class _CalendarModel implements CalendarModel {
@override
String get date;
@override
bool get is_current_day_included_in_the_chosen_diet_progression;
@JsonKey(name: 'is_current_day_included_in_the_chosen_diet_progression')
bool get isCurrentDayIncludedInTheChosenDietProgression;
@override
Object? get diary;

View File

@@ -9,7 +9,7 @@ part of 'calendar_model.dart';
_$CalendarModelImpl _$$CalendarModelImplFromJson(Map<String, dynamic> json) =>
_$CalendarModelImpl(
date: json['date'] as String,
is_current_day_included_in_the_chosen_diet_progression:
isCurrentDayIncludedInTheChosenDietProgression:
json['is_current_day_included_in_the_chosen_diet_progression']
as bool,
diary: json['diary'],
@@ -19,6 +19,6 @@ Map<String, dynamic> _$$CalendarModelImplToJson(_$CalendarModelImpl instance) =>
<String, dynamic>{
'date': instance.date,
'is_current_day_included_in_the_chosen_diet_progression':
instance.is_current_day_included_in_the_chosen_diet_progression,
instance.isCurrentDayIncludedInTheChosenDietProgression,
'diary': instance.diary,
};

View File

@@ -12,8 +12,7 @@ part of 'calendar_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$CalendarState {
@@ -23,14 +22,16 @@ mixin _$CalendarState {
required TResult Function() loading,
required TResult Function(List<CalendarModel> calendarList) loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(List<CalendarModel> calendarList)? loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
@@ -38,21 +39,24 @@ mixin _$CalendarState {
TResult Function(List<CalendarModel> calendarList)? loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_CalendarState value) $default, {
required TResult Function(CalendarStateLoading value) loading,
required TResult Function(CalendarStateLoaded value) loaded,
required TResult Function(CalendarStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_CalendarState value)? $default, {
TResult? Function(CalendarStateLoading value)? loading,
TResult? Function(CalendarStateLoaded value)? loaded,
TResult? Function(CalendarStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_CalendarState value)? $default, {
@@ -60,15 +64,15 @@ mixin _$CalendarState {
TResult Function(CalendarStateLoaded value)? loaded,
TResult Function(CalendarStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $CalendarStateCopyWith<$Res> {
factory $CalendarStateCopyWith(
CalendarState value,
$Res Function(CalendarState) then,
) = _$CalendarStateCopyWithImpl<$Res, CalendarState>;
CalendarState value, $Res Function(CalendarState) then) =
_$CalendarStateCopyWithImpl<$Res, CalendarState>;
}
/// @nodoc
@@ -88,9 +92,8 @@ class _$CalendarStateCopyWithImpl<$Res, $Val extends CalendarState>
/// @nodoc
abstract class _$$CalendarStateImplCopyWith<$Res> {
factory _$$CalendarStateImplCopyWith(
_$CalendarStateImpl value,
$Res Function(_$CalendarStateImpl) then,
) = __$$CalendarStateImplCopyWithImpl<$Res>;
_$CalendarStateImpl value, $Res Function(_$CalendarStateImpl) then) =
__$$CalendarStateImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -98,9 +101,8 @@ class __$$CalendarStateImplCopyWithImpl<$Res>
extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateImpl>
implements _$$CalendarStateImplCopyWith<$Res> {
__$$CalendarStateImplCopyWithImpl(
_$CalendarStateImpl _value,
$Res Function(_$CalendarStateImpl) _then,
) : super(_value, _then);
_$CalendarStateImpl _value, $Res Function(_$CalendarStateImpl) _then)
: super(_value, _then);
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@@ -206,20 +208,18 @@ abstract class _CalendarState implements CalendarState {
/// @nodoc
abstract class _$$CalendarStateLoadingImplCopyWith<$Res> {
factory _$$CalendarStateLoadingImplCopyWith(
_$CalendarStateLoadingImpl value,
$Res Function(_$CalendarStateLoadingImpl) then,
) = __$$CalendarStateLoadingImplCopyWithImpl<$Res>;
factory _$$CalendarStateLoadingImplCopyWith(_$CalendarStateLoadingImpl value,
$Res Function(_$CalendarStateLoadingImpl) then) =
__$$CalendarStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$CalendarStateLoadingImplCopyWithImpl<$Res>
extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadingImpl>
implements _$$CalendarStateLoadingImplCopyWith<$Res> {
__$$CalendarStateLoadingImplCopyWithImpl(
_$CalendarStateLoadingImpl _value,
$Res Function(_$CalendarStateLoadingImpl) _then,
) : super(_value, _then);
__$$CalendarStateLoadingImplCopyWithImpl(_$CalendarStateLoadingImpl _value,
$Res Function(_$CalendarStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@@ -326,10 +326,9 @@ abstract class CalendarStateLoading implements CalendarState {
/// @nodoc
abstract class _$$CalendarStateLoadedImplCopyWith<$Res> {
factory _$$CalendarStateLoadedImplCopyWith(
_$CalendarStateLoadedImpl value,
$Res Function(_$CalendarStateLoadedImpl) then,
) = __$$CalendarStateLoadedImplCopyWithImpl<$Res>;
factory _$$CalendarStateLoadedImplCopyWith(_$CalendarStateLoadedImpl value,
$Res Function(_$CalendarStateLoadedImpl) then) =
__$$CalendarStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({List<CalendarModel> calendarList});
}
@@ -338,34 +337,32 @@ abstract class _$$CalendarStateLoadedImplCopyWith<$Res> {
class __$$CalendarStateLoadedImplCopyWithImpl<$Res>
extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateLoadedImpl>
implements _$$CalendarStateLoadedImplCopyWith<$Res> {
__$$CalendarStateLoadedImplCopyWithImpl(
_$CalendarStateLoadedImpl _value,
$Res Function(_$CalendarStateLoadedImpl) _then,
) : super(_value, _then);
__$$CalendarStateLoadedImplCopyWithImpl(_$CalendarStateLoadedImpl _value,
$Res Function(_$CalendarStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? calendarList = null}) {
return _then(
_$CalendarStateLoadedImpl(
calendarList:
null == calendarList
? _value._calendarList
: calendarList // ignore: cast_nullable_to_non_nullable
as List<CalendarModel>,
),
);
$Res call({
Object? calendarList = null,
}) {
return _then(_$CalendarStateLoadedImpl(
calendarList: null == calendarList
? _value._calendarList
: calendarList // ignore: cast_nullable_to_non_nullable
as List<CalendarModel>,
));
}
}
/// @nodoc
class _$CalendarStateLoadedImpl implements CalendarStateLoaded {
const _$CalendarStateLoadedImpl({
required final List<CalendarModel> calendarList,
}) : _calendarList = calendarList;
const _$CalendarStateLoadedImpl(
{required final List<CalendarModel> calendarList})
: _calendarList = calendarList;
final List<CalendarModel> _calendarList;
@override
@@ -385,17 +382,13 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$CalendarStateLoadedImpl &&
const DeepCollectionEquality().equals(
other._calendarList,
_calendarList,
));
const DeepCollectionEquality()
.equals(other._calendarList, _calendarList));
}
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_calendarList),
);
runtimeType, const DeepCollectionEquality().hash(_calendarList));
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@@ -404,9 +397,7 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded {
@pragma('vm:prefer-inline')
_$$CalendarStateLoadedImplCopyWith<_$CalendarStateLoadedImpl> get copyWith =>
__$$CalendarStateLoadedImplCopyWithImpl<_$CalendarStateLoadedImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -484,9 +475,9 @@ class _$CalendarStateLoadedImpl implements CalendarStateLoaded {
}
abstract class CalendarStateLoaded implements CalendarState {
const factory CalendarStateLoaded({
required final List<CalendarModel> calendarList,
}) = _$CalendarStateLoadedImpl;
const factory CalendarStateLoaded(
{required final List<CalendarModel> calendarList}) =
_$CalendarStateLoadedImpl;
List<CalendarModel> get calendarList;
@@ -499,10 +490,9 @@ abstract class CalendarStateLoaded implements CalendarState {
/// @nodoc
abstract class _$$CalendarStateErrorImplCopyWith<$Res> {
factory _$$CalendarStateErrorImplCopyWith(
_$CalendarStateErrorImpl value,
$Res Function(_$CalendarStateErrorImpl) then,
) = __$$CalendarStateErrorImplCopyWithImpl<$Res>;
factory _$$CalendarStateErrorImplCopyWith(_$CalendarStateErrorImpl value,
$Res Function(_$CalendarStateErrorImpl) then) =
__$$CalendarStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -511,25 +501,23 @@ abstract class _$$CalendarStateErrorImplCopyWith<$Res> {
class __$$CalendarStateErrorImplCopyWithImpl<$Res>
extends _$CalendarStateCopyWithImpl<$Res, _$CalendarStateErrorImpl>
implements _$$CalendarStateErrorImplCopyWith<$Res> {
__$$CalendarStateErrorImplCopyWithImpl(
_$CalendarStateErrorImpl _value,
$Res Function(_$CalendarStateErrorImpl) _then,
) : super(_value, _then);
__$$CalendarStateErrorImplCopyWithImpl(_$CalendarStateErrorImpl _value,
$Res Function(_$CalendarStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of CalendarState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$CalendarStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$CalendarStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -565,9 +553,7 @@ class _$CalendarStateErrorImpl implements CalendarStateError {
@pragma('vm:prefer-inline')
_$$CalendarStateErrorImplCopyWith<_$CalendarStateErrorImpl> get copyWith =>
__$$CalendarStateErrorImplCopyWithImpl<_$CalendarStateErrorImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs

View File

@@ -12,8 +12,9 @@ import 'package:go_router/go_router.dart';
import 'package:intl/intl.dart';
class CalendarScreen extends StatelessWidget {
CalendarScreen({Key? key}) : super(key: key);
const CalendarScreen({super.key});
@override
Widget build(BuildContext context) {
return BlocProvider<CalendarCubit>(
create: (context) => sl<CalendarCubit>()..loadCalendarList(),
@@ -22,8 +23,8 @@ class CalendarScreen extends StatelessWidget {
if (state is CalendarStateLoaded) {
return _buildCalendar(context, state);
} else if (state is CalendarStateLoading) {
return Scaffold(
body: const Loader(),
return const Scaffold(
body: Loader(),
);
} else if (state is CalendarStateError) {
return Scaffold(
@@ -34,15 +35,15 @@ class CalendarScreen extends StatelessWidget {
),
),
);
} else
return Scaffold(
body: Padding(
padding: const EdgeInsets.all(16),
child: Center(
child: Text("Неопределенная ошибка"),
),
}
return const Scaffold(
body: Padding(
padding: EdgeInsets.all(16),
child: Center(
child: Text("Неопределенная ошибка"),
),
);
),
);
},
),
);
@@ -55,7 +56,7 @@ class CalendarScreen extends StatelessWidget {
FormBuilder(
child: Scaffold(
appBar: AppBar(
title: Text(
title: const Text(
'Календарь',
),
),
@@ -68,12 +69,12 @@ class CalendarScreen extends StatelessWidget {
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.only(bottom: 8),
padding: const EdgeInsets.only(bottom: 8),
child: Column(
children: [
SizedBox(height: 24),
const SizedBox(height: 24),
_buildCalendarBody(context, state),
SizedBox(height: 24),
const SizedBox(height: 24),
],
),
),
@@ -90,11 +91,11 @@ class CalendarScreen extends StatelessWidget {
_buildCalendarBody(BuildContext context, CalendarStateLoaded state) {
return ListView.separated(
padding: EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(),
separatorBuilder: (context, index) {
return SizedBox(
return const SizedBox(
height: 4,
);
},
@@ -106,12 +107,12 @@ class CalendarScreen extends StatelessWidget {
return InkWell(
borderRadius: BorderRadiusStyle.circleBorder8,
child: Ink(
padding: EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadiusStyle.circleBorder8,
color: state.calendarList[index].is_current_day_included_in_the_chosen_diet_progression
? Color.fromRGBO(59, 130, 246, .2)
: Color.fromRGBO(126, 136, 151, .1),
color: state.calendarList[index].isCurrentDayIncludedInTheChosenDietProgression
? const Color.fromRGBO(59, 130, 246, .2)
: const Color.fromRGBO(126, 136, 151, .1),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
@@ -125,12 +126,12 @@ class CalendarScreen extends StatelessWidget {
formatDate(state.calendarList[index].date),
style: theme.textTheme.titleMedium,
),
SizedBox(height: 4),
if (state.calendarList[index].is_current_day_included_in_the_chosen_diet_progression)
const SizedBox(height: 4),
if (state.calendarList[index].isCurrentDayIncludedInTheChosenDietProgression)
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
padding: const EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
color: const Color.fromRGBO(13, 110, 253, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
@@ -138,11 +139,11 @@ class CalendarScreen extends StatelessWidget {
style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
if (!state.calendarList[index].is_current_day_included_in_the_chosen_diet_progression)
if (!state.calendarList[index].isCurrentDayIncludedInTheChosenDietProgression)
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
padding: const EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(108, 117, 125, 1),
color: const Color.fromRGBO(108, 117, 125, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
@@ -166,7 +167,7 @@ class CalendarScreen extends StatelessWidget {
extra: diary['id'].toString(),
),
child: Ink(
padding: EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadiusStyle.circleBorder8,
color: getBackgroundColor(diary['state']),
@@ -183,13 +184,13 @@ class CalendarScreen extends StatelessWidget {
formatDate(state.calendarList[index].date),
style: theme.textTheme.titleMedium,
),
SizedBox(height: 4),
const SizedBox(height: 4),
Row(
children: [
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
padding: const EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: diary['state'] == 'finished' ? Color.fromRGBO(1, 154, 62, 1) : Color.fromRGBO(154, 74, 1, 1),
color: diary['state'] == 'finished' ? const Color.fromRGBO(1, 154, 62, 1) : const Color.fromRGBO(154, 74, 1, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
@@ -197,12 +198,12 @@ class CalendarScreen extends StatelessWidget {
style: CustomTextStyles.titleSmallBold, // Предполагается, что текст белый
),
),
SizedBox(width: 4),
const SizedBox(width: 4),
if (diary['state'] == 'started')
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
padding: const EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
color: const Color.fromRGBO(13, 110, 253, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
@@ -212,9 +213,9 @@ class CalendarScreen extends StatelessWidget {
),
if (diary['state'] == 'finished')
Container(
padding: EdgeInsets.all(4.0), // Отступы внутри контейнера
padding: const EdgeInsets.all(4.0), // Отступы внутри контейнера
decoration: BoxDecoration(
color: Color.fromRGBO(13, 110, 253, 1),
color: const Color.fromRGBO(13, 110, 253, 1),
borderRadius: BorderRadius.circular(24.0), // Закругленные углы
),
child: Text(
@@ -256,16 +257,16 @@ String formatDate(String dateString) {
String formattedDate = DateFormat('d MMMM', 'ru_RU').format(dateTime);
// Возвращаем результат в нужном формате
return '$formattedDate';
return formattedDate;
}
Color getBackgroundColor(String? status) {
switch (status) {
case 'finished':
return Color.fromRGBO(1, 154, 62, .1);
return const Color.fromRGBO(1, 154, 62, .1);
case 'started':
return Color.fromRGBO(154, 74, 1, .1);
return const Color.fromRGBO(154, 74, 1, .1);
default:
return Color.fromRGBO(126, 136, 151, .1);
return const Color.fromRGBO(126, 136, 151, .1);
}
}

View File

@@ -36,13 +36,11 @@ class _CalendarService implements CalendarService {
final _result = await _dio.fetch<List<dynamic>>(_options);
late List<CalendarModel> _value;
try {
_value =
_result.data!
.map(
(dynamic i) =>
CalendarModel.fromJson(i as Map<String, dynamic>),
)
.toList();
_value = _result.data!
.map(
(dynamic i) => CalendarModel.fromJson(i as Map<String, dynamic>),
)
.toList();
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;

View File

@@ -12,8 +12,7 @@ part of 'chat_message_model.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
ChatMessageModel _$ChatMessageModelFromJson(Map<String, dynamic> json) {
return _ChatMessageModel.fromJson(json);
@@ -49,20 +48,18 @@ mixin _$ChatMessageModel {
/// @nodoc
abstract class $ChatMessageModelCopyWith<$Res> {
factory $ChatMessageModelCopyWith(
ChatMessageModel value,
$Res Function(ChatMessageModel) then,
) = _$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>;
ChatMessageModel value, $Res Function(ChatMessageModel) then) =
_$ChatMessageModelCopyWithImpl<$Res, ChatMessageModel>;
@useResult
$Res call({
int id,
String data,
@JsonKey(name: 'media_data') List<dynamic>? mediaData,
@JsonKey(name: 'author_id') int authorId,
@JsonKey(name: 'updated_at', fromJson: parseDate) DateTime updatedAt,
@JsonKey(name: 'read_by_to_user', defaultValue: false) bool isRead,
@JsonKey(name: 'is_author_message_auth_user') bool? isCurrentUserAuthor,
@JsonKey(name: 'room_id') String? roomId,
});
$Res call(
{int id,
String data,
@JsonKey(name: 'media_data') List<dynamic>? mediaData,
@JsonKey(name: 'author_id') int authorId,
@JsonKey(name: 'updated_at', fromJson: parseDate) DateTime updatedAt,
@JsonKey(name: 'read_by_to_user', defaultValue: false) bool isRead,
@JsonKey(name: 'is_author_message_auth_user') bool? isCurrentUserAuthor,
@JsonKey(name: 'room_id') String? roomId});
}
/// @nodoc
@@ -89,83 +86,69 @@ class _$ChatMessageModelCopyWithImpl<$Res, $Val extends ChatMessageModel>
Object? isCurrentUserAuthor = freezed,
Object? roomId = freezed,
}) {
return _then(
_value.copyWith(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
data:
null == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as String,
mediaData:
freezed == mediaData
? _value.mediaData
: mediaData // ignore: cast_nullable_to_non_nullable
as List<dynamic>?,
authorId:
null == authorId
? _value.authorId
: authorId // ignore: cast_nullable_to_non_nullable
as int,
updatedAt:
null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
isRead:
null == isRead
? _value.isRead
: isRead // ignore: cast_nullable_to_non_nullable
as bool,
isCurrentUserAuthor:
freezed == isCurrentUserAuthor
? _value.isCurrentUserAuthor
: isCurrentUserAuthor // ignore: cast_nullable_to_non_nullable
as bool?,
roomId:
freezed == roomId
? _value.roomId
: roomId // ignore: cast_nullable_to_non_nullable
as String?,
)
as $Val,
);
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
data: null == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as String,
mediaData: freezed == mediaData
? _value.mediaData
: mediaData // ignore: cast_nullable_to_non_nullable
as List<dynamic>?,
authorId: null == authorId
? _value.authorId
: authorId // ignore: cast_nullable_to_non_nullable
as int,
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
isRead: null == isRead
? _value.isRead
: isRead // ignore: cast_nullable_to_non_nullable
as bool,
isCurrentUserAuthor: freezed == isCurrentUserAuthor
? _value.isCurrentUserAuthor
: isCurrentUserAuthor // ignore: cast_nullable_to_non_nullable
as bool?,
roomId: freezed == roomId
? _value.roomId
: roomId // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
}
/// @nodoc
abstract class _$$ChatMessageModelImplCopyWith<$Res>
implements $ChatMessageModelCopyWith<$Res> {
factory _$$ChatMessageModelImplCopyWith(
_$ChatMessageModelImpl value,
$Res Function(_$ChatMessageModelImpl) then,
) = __$$ChatMessageModelImplCopyWithImpl<$Res>;
factory _$$ChatMessageModelImplCopyWith(_$ChatMessageModelImpl value,
$Res Function(_$ChatMessageModelImpl) then) =
__$$ChatMessageModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
int id,
String data,
@JsonKey(name: 'media_data') List<dynamic>? mediaData,
@JsonKey(name: 'author_id') int authorId,
@JsonKey(name: 'updated_at', fromJson: parseDate) DateTime updatedAt,
@JsonKey(name: 'read_by_to_user', defaultValue: false) bool isRead,
@JsonKey(name: 'is_author_message_auth_user') bool? isCurrentUserAuthor,
@JsonKey(name: 'room_id') String? roomId,
});
$Res call(
{int id,
String data,
@JsonKey(name: 'media_data') List<dynamic>? mediaData,
@JsonKey(name: 'author_id') int authorId,
@JsonKey(name: 'updated_at', fromJson: parseDate) DateTime updatedAt,
@JsonKey(name: 'read_by_to_user', defaultValue: false) bool isRead,
@JsonKey(name: 'is_author_message_auth_user') bool? isCurrentUserAuthor,
@JsonKey(name: 'room_id') String? roomId});
}
/// @nodoc
class __$$ChatMessageModelImplCopyWithImpl<$Res>
extends _$ChatMessageModelCopyWithImpl<$Res, _$ChatMessageModelImpl>
implements _$$ChatMessageModelImplCopyWith<$Res> {
__$$ChatMessageModelImplCopyWithImpl(
_$ChatMessageModelImpl _value,
$Res Function(_$ChatMessageModelImpl) _then,
) : super(_value, _then);
__$$ChatMessageModelImplCopyWithImpl(_$ChatMessageModelImpl _value,
$Res Function(_$ChatMessageModelImpl) _then)
: super(_value, _then);
/// Create a copy of ChatMessageModel
/// with the given fields replaced by the non-null parameter values.
@@ -181,67 +164,58 @@ class __$$ChatMessageModelImplCopyWithImpl<$Res>
Object? isCurrentUserAuthor = freezed,
Object? roomId = freezed,
}) {
return _then(
_$ChatMessageModelImpl(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
data:
null == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as String,
mediaData:
freezed == mediaData
? _value._mediaData
: mediaData // ignore: cast_nullable_to_non_nullable
as List<dynamic>?,
authorId:
null == authorId
? _value.authorId
: authorId // ignore: cast_nullable_to_non_nullable
as int,
updatedAt:
null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
isRead:
null == isRead
? _value.isRead
: isRead // ignore: cast_nullable_to_non_nullable
as bool,
isCurrentUserAuthor:
freezed == isCurrentUserAuthor
? _value.isCurrentUserAuthor
: isCurrentUserAuthor // ignore: cast_nullable_to_non_nullable
as bool?,
roomId:
freezed == roomId
? _value.roomId
: roomId // ignore: cast_nullable_to_non_nullable
as String?,
),
);
return _then(_$ChatMessageModelImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
data: null == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as String,
mediaData: freezed == mediaData
? _value._mediaData
: mediaData // ignore: cast_nullable_to_non_nullable
as List<dynamic>?,
authorId: null == authorId
? _value.authorId
: authorId // ignore: cast_nullable_to_non_nullable
as int,
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
isRead: null == isRead
? _value.isRead
: isRead // ignore: cast_nullable_to_non_nullable
as bool,
isCurrentUserAuthor: freezed == isCurrentUserAuthor
? _value.isCurrentUserAuthor
: isCurrentUserAuthor // ignore: cast_nullable_to_non_nullable
as bool?,
roomId: freezed == roomId
? _value.roomId
: roomId // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ChatMessageModelImpl implements _ChatMessageModel {
const _$ChatMessageModelImpl({
required this.id,
required this.data,
@JsonKey(name: 'media_data') required final List<dynamic>? mediaData,
@JsonKey(name: 'author_id') required this.authorId,
@JsonKey(name: 'updated_at', fromJson: parseDate) required this.updatedAt,
@JsonKey(name: 'read_by_to_user', defaultValue: false) required this.isRead,
@JsonKey(name: 'is_author_message_auth_user')
required this.isCurrentUserAuthor,
@JsonKey(name: 'room_id') required this.roomId,
}) : _mediaData = mediaData;
const _$ChatMessageModelImpl(
{required this.id,
required this.data,
@JsonKey(name: 'media_data') required final List<dynamic>? mediaData,
@JsonKey(name: 'author_id') required this.authorId,
@JsonKey(name: 'updated_at', fromJson: parseDate) required this.updatedAt,
@JsonKey(name: 'read_by_to_user', defaultValue: false)
required this.isRead,
@JsonKey(name: 'is_author_message_auth_user')
required this.isCurrentUserAuthor,
@JsonKey(name: 'room_id') required this.roomId})
: _mediaData = mediaData;
factory _$ChatMessageModelImpl.fromJson(Map<String, dynamic> json) =>
_$$ChatMessageModelImplFromJson(json);
@@ -289,10 +263,8 @@ class _$ChatMessageModelImpl implements _ChatMessageModel {
other is _$ChatMessageModelImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.data, data) || other.data == data) &&
const DeepCollectionEquality().equals(
other._mediaData,
_mediaData,
) &&
const DeepCollectionEquality()
.equals(other._mediaData, _mediaData) &&
(identical(other.authorId, authorId) ||
other.authorId == authorId) &&
(identical(other.updatedAt, updatedAt) ||
@@ -306,16 +278,15 @@ class _$ChatMessageModelImpl implements _ChatMessageModel {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
id,
data,
const DeepCollectionEquality().hash(_mediaData),
authorId,
updatedAt,
isRead,
isCurrentUserAuthor,
roomId,
);
runtimeType,
id,
data,
const DeepCollectionEquality().hash(_mediaData),
authorId,
updatedAt,
isRead,
isCurrentUserAuthor,
roomId);
/// Create a copy of ChatMessageModel
/// with the given fields replaced by the non-null parameter values.
@@ -324,30 +295,30 @@ class _$ChatMessageModelImpl implements _ChatMessageModel {
@pragma('vm:prefer-inline')
_$$ChatMessageModelImplCopyWith<_$ChatMessageModelImpl> get copyWith =>
__$$ChatMessageModelImplCopyWithImpl<_$ChatMessageModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ChatMessageModelImplToJson(this);
return _$$ChatMessageModelImplToJson(
this,
);
}
}
abstract class _ChatMessageModel implements ChatMessageModel {
const factory _ChatMessageModel({
required final int id,
required final String data,
@JsonKey(name: 'media_data') required final List<dynamic>? mediaData,
@JsonKey(name: 'author_id') required final int authorId,
@JsonKey(name: 'updated_at', fromJson: parseDate)
required final DateTime updatedAt,
@JsonKey(name: 'read_by_to_user', defaultValue: false)
required final bool isRead,
@JsonKey(name: 'is_author_message_auth_user')
required final bool? isCurrentUserAuthor,
@JsonKey(name: 'room_id') required final String? roomId,
}) = _$ChatMessageModelImpl;
const factory _ChatMessageModel(
{required final int id,
required final String data,
@JsonKey(name: 'media_data') required final List<dynamic>? mediaData,
@JsonKey(name: 'author_id') required final int authorId,
@JsonKey(name: 'updated_at', fromJson: parseDate)
required final DateTime updatedAt,
@JsonKey(name: 'read_by_to_user', defaultValue: false)
required final bool isRead,
@JsonKey(name: 'is_author_message_auth_user')
required final bool? isCurrentUserAuthor,
@JsonKey(name: 'room_id') required final String? roomId}) =
_$ChatMessageModelImpl;
factory _ChatMessageModel.fromJson(Map<String, dynamic> json) =
_$ChatMessageModelImpl.fromJson;

View File

@@ -7,27 +7,27 @@ part of 'chat_message_model.dart';
// **************************************************************************
_$ChatMessageModelImpl _$$ChatMessageModelImplFromJson(
Map<String, dynamic> json,
) => _$ChatMessageModelImpl(
id: (json['id'] as num).toInt(),
data: json['data'] as String,
mediaData: json['media_data'] as List<dynamic>?,
authorId: (json['author_id'] as num).toInt(),
updatedAt: parseDate(json['updated_at'] as String),
isRead: json['read_by_to_user'] as bool? ?? false,
isCurrentUserAuthor: json['is_author_message_auth_user'] as bool?,
roomId: json['room_id'] as String?,
);
Map<String, dynamic> json) =>
_$ChatMessageModelImpl(
id: (json['id'] as num).toInt(),
data: json['data'] as String,
mediaData: json['media_data'] as List<dynamic>?,
authorId: (json['author_id'] as num).toInt(),
updatedAt: parseDate(json['updated_at'] as String),
isRead: json['read_by_to_user'] as bool? ?? false,
isCurrentUserAuthor: json['is_author_message_auth_user'] as bool?,
roomId: json['room_id'] as String?,
);
Map<String, dynamic> _$$ChatMessageModelImplToJson(
_$ChatMessageModelImpl instance,
) => <String, dynamic>{
'id': instance.id,
'data': instance.data,
'media_data': instance.mediaData,
'author_id': instance.authorId,
'updated_at': instance.updatedAt.toIso8601String(),
'read_by_to_user': instance.isRead,
'is_author_message_auth_user': instance.isCurrentUserAuthor,
'room_id': instance.roomId,
};
_$ChatMessageModelImpl instance) =>
<String, dynamic>{
'id': instance.id,
'data': instance.data,
'media_data': instance.mediaData,
'author_id': instance.authorId,
'updated_at': instance.updatedAt.toIso8601String(),
'read_by_to_user': instance.isRead,
'is_author_message_auth_user': instance.isCurrentUserAuthor,
'room_id': instance.roomId,
};

View File

@@ -12,8 +12,7 @@ part of 'chat_messages_model.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
ChatMessagesModel _$ChatMessagesModelFromJson(Map<String, dynamic> json) {
return _ChatMessagesModel.fromJson(json);
@@ -38,14 +37,12 @@ mixin _$ChatMessagesModel {
/// @nodoc
abstract class $ChatMessagesModelCopyWith<$Res> {
factory $ChatMessagesModelCopyWith(
ChatMessagesModel value,
$Res Function(ChatMessagesModel) then,
) = _$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>;
ChatMessagesModel value, $Res Function(ChatMessagesModel) then) =
_$ChatMessagesModelCopyWithImpl<$Res, ChatMessagesModel>;
@useResult
$Res call({
@JsonKey(name: 'data') List<ChatMessageModel> messagesList,
ChatMetaModel meta,
});
$Res call(
{@JsonKey(name: 'data') List<ChatMessageModel> messagesList,
ChatMetaModel meta});
$ChatMetaModelCopyWith<$Res> get meta;
}
@@ -64,22 +61,20 @@ class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? messagesList = null, Object? meta = null}) {
return _then(
_value.copyWith(
messagesList:
null == messagesList
? _value.messagesList
: messagesList // ignore: cast_nullable_to_non_nullable
as List<ChatMessageModel>,
meta:
null == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as ChatMetaModel,
)
as $Val,
);
$Res call({
Object? messagesList = null,
Object? meta = null,
}) {
return _then(_value.copyWith(
messagesList: null == messagesList
? _value.messagesList
: messagesList // ignore: cast_nullable_to_non_nullable
as List<ChatMessageModel>,
meta: null == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as ChatMetaModel,
) as $Val);
}
/// Create a copy of ChatMessagesModel
@@ -96,16 +91,14 @@ class _$ChatMessagesModelCopyWithImpl<$Res, $Val extends ChatMessagesModel>
/// @nodoc
abstract class _$$ChatMessagesModelImplCopyWith<$Res>
implements $ChatMessagesModelCopyWith<$Res> {
factory _$$ChatMessagesModelImplCopyWith(
_$ChatMessagesModelImpl value,
$Res Function(_$ChatMessagesModelImpl) then,
) = __$$ChatMessagesModelImplCopyWithImpl<$Res>;
factory _$$ChatMessagesModelImplCopyWith(_$ChatMessagesModelImpl value,
$Res Function(_$ChatMessagesModelImpl) then) =
__$$ChatMessagesModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: 'data') List<ChatMessageModel> messagesList,
ChatMetaModel meta,
});
$Res call(
{@JsonKey(name: 'data') List<ChatMessageModel> messagesList,
ChatMetaModel meta});
@override
$ChatMetaModelCopyWith<$Res> get meta;
@@ -115,40 +108,39 @@ abstract class _$$ChatMessagesModelImplCopyWith<$Res>
class __$$ChatMessagesModelImplCopyWithImpl<$Res>
extends _$ChatMessagesModelCopyWithImpl<$Res, _$ChatMessagesModelImpl>
implements _$$ChatMessagesModelImplCopyWith<$Res> {
__$$ChatMessagesModelImplCopyWithImpl(
_$ChatMessagesModelImpl _value,
$Res Function(_$ChatMessagesModelImpl) _then,
) : super(_value, _then);
__$$ChatMessagesModelImplCopyWithImpl(_$ChatMessagesModelImpl _value,
$Res Function(_$ChatMessagesModelImpl) _then)
: super(_value, _then);
/// Create a copy of ChatMessagesModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? messagesList = null, Object? meta = null}) {
return _then(
_$ChatMessagesModelImpl(
messagesList:
null == messagesList
? _value._messagesList
: messagesList // ignore: cast_nullable_to_non_nullable
as List<ChatMessageModel>,
meta:
null == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as ChatMetaModel,
),
);
$Res call({
Object? messagesList = null,
Object? meta = null,
}) {
return _then(_$ChatMessagesModelImpl(
messagesList: null == messagesList
? _value._messagesList
: messagesList // ignore: cast_nullable_to_non_nullable
as List<ChatMessageModel>,
meta: null == meta
? _value.meta
: meta // ignore: cast_nullable_to_non_nullable
as ChatMetaModel,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ChatMessagesModelImpl implements _ChatMessagesModel {
const _$ChatMessagesModelImpl({
@JsonKey(name: 'data') required final List<ChatMessageModel> messagesList,
required this.meta,
}) : _messagesList = messagesList;
const _$ChatMessagesModelImpl(
{@JsonKey(name: 'data')
required final List<ChatMessageModel> messagesList,
required this.meta})
: _messagesList = messagesList;
factory _$ChatMessagesModelImpl.fromJson(Map<String, dynamic> json) =>
_$$ChatMessagesModelImplFromJson(json);
@@ -175,20 +167,15 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ChatMessagesModelImpl &&
const DeepCollectionEquality().equals(
other._messagesList,
_messagesList,
) &&
const DeepCollectionEquality()
.equals(other._messagesList, _messagesList) &&
(identical(other.meta, meta) || other.meta == meta));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(_messagesList),
meta,
);
runtimeType, const DeepCollectionEquality().hash(_messagesList), meta);
/// Create a copy of ChatMessagesModel
/// with the given fields replaced by the non-null parameter values.
@@ -197,21 +184,21 @@ class _$ChatMessagesModelImpl implements _ChatMessagesModel {
@pragma('vm:prefer-inline')
_$$ChatMessagesModelImplCopyWith<_$ChatMessagesModelImpl> get copyWith =>
__$$ChatMessagesModelImplCopyWithImpl<_$ChatMessagesModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ChatMessagesModelImplToJson(this);
return _$$ChatMessagesModelImplToJson(
this,
);
}
}
abstract class _ChatMessagesModel implements ChatMessagesModel {
const factory _ChatMessagesModel({
@JsonKey(name: 'data') required final List<ChatMessageModel> messagesList,
required final ChatMetaModel meta,
}) = _$ChatMessagesModelImpl;
const factory _ChatMessagesModel(
{@JsonKey(name: 'data')
required final List<ChatMessageModel> messagesList,
required final ChatMetaModel meta}) = _$ChatMessagesModelImpl;
factory _ChatMessagesModel.fromJson(Map<String, dynamic> json) =
_$ChatMessagesModelImpl.fromJson;

View File

@@ -7,15 +7,17 @@ part of 'chat_messages_model.dart';
// **************************************************************************
_$ChatMessagesModelImpl _$$ChatMessagesModelImplFromJson(
Map<String, dynamic> json,
) => _$ChatMessagesModelImpl(
messagesList:
(json['data'] as List<dynamic>)
Map<String, dynamic> json) =>
_$ChatMessagesModelImpl(
messagesList: (json['data'] as List<dynamic>)
.map((e) => ChatMessageModel.fromJson(e as Map<String, dynamic>))
.toList(),
meta: ChatMetaModel.fromJson(json['meta'] as Map<String, dynamic>),
);
meta: ChatMetaModel.fromJson(json['meta'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$ChatMessagesModelImplToJson(
_$ChatMessagesModelImpl instance,
) => <String, dynamic>{'data': instance.messagesList, 'meta': instance.meta};
_$ChatMessagesModelImpl instance) =>
<String, dynamic>{
'data': instance.messagesList,
'meta': instance.meta,
};

View File

@@ -12,8 +12,7 @@ part of 'chat_meta_model.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
ChatMetaModel _$ChatMetaModelFromJson(Map<String, dynamic> json) {
return _ChatMetaModel.fromJson(json);
@@ -37,9 +36,8 @@ mixin _$ChatMetaModel {
/// @nodoc
abstract class $ChatMetaModelCopyWith<$Res> {
factory $ChatMetaModelCopyWith(
ChatMetaModel value,
$Res Function(ChatMetaModel) then,
) = _$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>;
ChatMetaModel value, $Res Function(ChatMetaModel) then) =
_$ChatMetaModelCopyWithImpl<$Res, ChatMetaModel>;
@useResult
$Res call({@JsonKey(name: "last_page") int lastPage});
}
@@ -58,17 +56,15 @@ class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? lastPage = null}) {
return _then(
_value.copyWith(
lastPage:
null == lastPage
? _value.lastPage
: lastPage // ignore: cast_nullable_to_non_nullable
as int,
)
as $Val,
);
$Res call({
Object? lastPage = null,
}) {
return _then(_value.copyWith(
lastPage: null == lastPage
? _value.lastPage
: lastPage // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
}
@@ -76,9 +72,8 @@ class _$ChatMetaModelCopyWithImpl<$Res, $Val extends ChatMetaModel>
abstract class _$$ChatMetaModelImplCopyWith<$Res>
implements $ChatMetaModelCopyWith<$Res> {
factory _$$ChatMetaModelImplCopyWith(
_$ChatMetaModelImpl value,
$Res Function(_$ChatMetaModelImpl) then,
) = __$$ChatMetaModelImplCopyWithImpl<$Res>;
_$ChatMetaModelImpl value, $Res Function(_$ChatMetaModelImpl) then) =
__$$ChatMetaModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({@JsonKey(name: "last_page") int lastPage});
@@ -89,33 +84,30 @@ class __$$ChatMetaModelImplCopyWithImpl<$Res>
extends _$ChatMetaModelCopyWithImpl<$Res, _$ChatMetaModelImpl>
implements _$$ChatMetaModelImplCopyWith<$Res> {
__$$ChatMetaModelImplCopyWithImpl(
_$ChatMetaModelImpl _value,
$Res Function(_$ChatMetaModelImpl) _then,
) : super(_value, _then);
_$ChatMetaModelImpl _value, $Res Function(_$ChatMetaModelImpl) _then)
: super(_value, _then);
/// Create a copy of ChatMetaModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? lastPage = null}) {
return _then(
_$ChatMetaModelImpl(
lastPage:
null == lastPage
? _value.lastPage
: lastPage // ignore: cast_nullable_to_non_nullable
as int,
),
);
$Res call({
Object? lastPage = null,
}) {
return _then(_$ChatMetaModelImpl(
lastPage: null == lastPage
? _value.lastPage
: lastPage // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ChatMetaModelImpl implements _ChatMetaModel {
const _$ChatMetaModelImpl({
@JsonKey(name: "last_page") required this.lastPage,
});
const _$ChatMetaModelImpl(
{@JsonKey(name: "last_page") required this.lastPage});
factory _$ChatMetaModelImpl.fromJson(Map<String, dynamic> json) =>
_$$ChatMetaModelImplFromJson(json);
@@ -152,14 +144,16 @@ class _$ChatMetaModelImpl implements _ChatMetaModel {
@override
Map<String, dynamic> toJson() {
return _$$ChatMetaModelImplToJson(this);
return _$$ChatMetaModelImplToJson(
this,
);
}
}
abstract class _ChatMetaModel implements ChatMetaModel {
const factory _ChatMetaModel({
@JsonKey(name: "last_page") required final int lastPage,
}) = _$ChatMetaModelImpl;
const factory _ChatMetaModel(
{@JsonKey(name: "last_page") required final int lastPage}) =
_$ChatMetaModelImpl;
factory _ChatMetaModel.fromJson(Map<String, dynamic> json) =
_$ChatMetaModelImpl.fromJson;

View File

@@ -7,7 +7,11 @@ part of 'chat_meta_model.dart';
// **************************************************************************
_$ChatMetaModelImpl _$$ChatMetaModelImplFromJson(Map<String, dynamic> json) =>
_$ChatMetaModelImpl(lastPage: (json['last_page'] as num).toInt());
_$ChatMetaModelImpl(
lastPage: (json['last_page'] as num).toInt(),
);
Map<String, dynamic> _$$ChatMetaModelImplToJson(_$ChatMetaModelImpl instance) =>
<String, dynamic>{'last_page': instance.lastPage};
<String, dynamic>{
'last_page': instance.lastPage,
};

View File

@@ -12,8 +12,7 @@ part of 'chat_room_model.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
ChatRoomModel _$ChatRoomModelFromJson(Map<String, dynamic> json) {
return _ChatRoomModel.fromJson(json);
@@ -42,17 +41,16 @@ mixin _$ChatRoomModel {
/// @nodoc
abstract class $ChatRoomModelCopyWith<$Res> {
factory $ChatRoomModelCopyWith(
ChatRoomModel value,
$Res Function(ChatRoomModel) then,
) = _$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>;
ChatRoomModel value, $Res Function(ChatRoomModel) then) =
_$ChatRoomModelCopyWithImpl<$Res, ChatRoomModel>;
@useResult
$Res call({
String id,
@JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel chatRoomSettings,
Users users,
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
ChosenPlanModel? chosenPlan,
});
$Res call(
{String id,
@JsonKey(name: 'chat_room_setting')
ChatRoomSettingsModel chatRoomSettings,
Users users,
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
ChosenPlanModel? chosenPlan});
$ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings;
$UsersCopyWith<$Res> get users;
@@ -79,31 +77,24 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel>
Object? users = null,
Object? chosenPlan = freezed,
}) {
return _then(
_value.copyWith(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
chatRoomSettings:
null == chatRoomSettings
? _value.chatRoomSettings
: chatRoomSettings // ignore: cast_nullable_to_non_nullable
as ChatRoomSettingsModel,
users:
null == users
? _value.users
: users // ignore: cast_nullable_to_non_nullable
as Users,
chosenPlan:
freezed == chosenPlan
? _value.chosenPlan
: chosenPlan // ignore: cast_nullable_to_non_nullable
as ChosenPlanModel?,
)
as $Val,
);
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
chatRoomSettings: null == chatRoomSettings
? _value.chatRoomSettings
: chatRoomSettings // ignore: cast_nullable_to_non_nullable
as ChatRoomSettingsModel,
users: null == users
? _value.users
: users // ignore: cast_nullable_to_non_nullable
as Users,
chosenPlan: freezed == chosenPlan
? _value.chosenPlan
: chosenPlan // ignore: cast_nullable_to_non_nullable
as ChosenPlanModel?,
) as $Val);
}
/// Create a copy of ChatRoomModel
@@ -111,9 +102,8 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel>
@override
@pragma('vm:prefer-inline')
$ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings {
return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings, (
value,
) {
return $ChatRoomSettingsModelCopyWith<$Res>(_value.chatRoomSettings,
(value) {
return _then(_value.copyWith(chatRoomSettings: value) as $Val);
});
}
@@ -147,18 +137,17 @@ class _$ChatRoomModelCopyWithImpl<$Res, $Val extends ChatRoomModel>
abstract class _$$ChatRoomModelImplCopyWith<$Res>
implements $ChatRoomModelCopyWith<$Res> {
factory _$$ChatRoomModelImplCopyWith(
_$ChatRoomModelImpl value,
$Res Function(_$ChatRoomModelImpl) then,
) = __$$ChatRoomModelImplCopyWithImpl<$Res>;
_$ChatRoomModelImpl value, $Res Function(_$ChatRoomModelImpl) then) =
__$$ChatRoomModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
String id,
@JsonKey(name: 'chat_room_setting') ChatRoomSettingsModel chatRoomSettings,
Users users,
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
ChosenPlanModel? chosenPlan,
});
$Res call(
{String id,
@JsonKey(name: 'chat_room_setting')
ChatRoomSettingsModel chatRoomSettings,
Users users,
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
ChosenPlanModel? chosenPlan});
@override
$ChatRoomSettingsModelCopyWith<$Res> get chatRoomSettings;
@@ -173,9 +162,8 @@ class __$$ChatRoomModelImplCopyWithImpl<$Res>
extends _$ChatRoomModelCopyWithImpl<$Res, _$ChatRoomModelImpl>
implements _$$ChatRoomModelImplCopyWith<$Res> {
__$$ChatRoomModelImplCopyWithImpl(
_$ChatRoomModelImpl _value,
$Res Function(_$ChatRoomModelImpl) _then,
) : super(_value, _then);
_$ChatRoomModelImpl _value, $Res Function(_$ChatRoomModelImpl) _then)
: super(_value, _then);
/// Create a copy of ChatRoomModel
/// with the given fields replaced by the non-null parameter values.
@@ -187,43 +175,36 @@ class __$$ChatRoomModelImplCopyWithImpl<$Res>
Object? users = null,
Object? chosenPlan = freezed,
}) {
return _then(
_$ChatRoomModelImpl(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
chatRoomSettings:
null == chatRoomSettings
? _value.chatRoomSettings
: chatRoomSettings // ignore: cast_nullable_to_non_nullable
as ChatRoomSettingsModel,
users:
null == users
? _value.users
: users // ignore: cast_nullable_to_non_nullable
as Users,
chosenPlan:
freezed == chosenPlan
? _value.chosenPlan
: chosenPlan // ignore: cast_nullable_to_non_nullable
as ChosenPlanModel?,
),
);
return _then(_$ChatRoomModelImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
chatRoomSettings: null == chatRoomSettings
? _value.chatRoomSettings
: chatRoomSettings // ignore: cast_nullable_to_non_nullable
as ChatRoomSettingsModel,
users: null == users
? _value.users
: users // ignore: cast_nullable_to_non_nullable
as Users,
chosenPlan: freezed == chosenPlan
? _value.chosenPlan
: chosenPlan // ignore: cast_nullable_to_non_nullable
as ChosenPlanModel?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ChatRoomModelImpl implements _ChatRoomModel {
const _$ChatRoomModelImpl({
required this.id,
@JsonKey(name: 'chat_room_setting') required this.chatRoomSettings,
required this.users,
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
required this.chosenPlan,
});
const _$ChatRoomModelImpl(
{required this.id,
@JsonKey(name: 'chat_room_setting') required this.chatRoomSettings,
required this.users,
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
required this.chosenPlan});
factory _$ChatRoomModelImpl.fromJson(Map<String, dynamic> json) =>
_$$ChatRoomModelImplFromJson(json);
@@ -272,19 +253,20 @@ class _$ChatRoomModelImpl implements _ChatRoomModel {
@override
Map<String, dynamic> toJson() {
return _$$ChatRoomModelImplToJson(this);
return _$$ChatRoomModelImplToJson(
this,
);
}
}
abstract class _ChatRoomModel implements ChatRoomModel {
const factory _ChatRoomModel({
required final String id,
@JsonKey(name: 'chat_room_setting')
required final ChatRoomSettingsModel chatRoomSettings,
required final Users users,
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
required final ChosenPlanModel? chosenPlan,
}) = _$ChatRoomModelImpl;
const factory _ChatRoomModel(
{required final String id,
@JsonKey(name: 'chat_room_setting')
required final ChatRoomSettingsModel chatRoomSettings,
required final Users users,
@JsonKey(name: 'chosen_plan', fromJson: parseChosenPlan)
required final ChosenPlanModel? chosenPlan}) = _$ChatRoomModelImpl;
factory _ChatRoomModel.fromJson(Map<String, dynamic> json) =
_$ChatRoomModelImpl.fromJson;
@@ -333,10 +315,9 @@ abstract class $UsersCopyWith<$Res> {
factory $UsersCopyWith(Users value, $Res Function(Users) then) =
_$UsersCopyWithImpl<$Res, Users>;
@useResult
$Res call({
@JsonKey(name: 'from_chat_user') ChatUserModel sender,
@JsonKey(name: 'to_chat_user') ChatUserModel receiver,
});
$Res call(
{@JsonKey(name: 'from_chat_user') ChatUserModel sender,
@JsonKey(name: 'to_chat_user') ChatUserModel receiver});
$ChatUserModelCopyWith<$Res> get sender;
$ChatUserModelCopyWith<$Res> get receiver;
@@ -356,22 +337,20 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users>
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? sender = null, Object? receiver = null}) {
return _then(
_value.copyWith(
sender:
null == sender
? _value.sender
: sender // ignore: cast_nullable_to_non_nullable
as ChatUserModel,
receiver:
null == receiver
? _value.receiver
: receiver // ignore: cast_nullable_to_non_nullable
as ChatUserModel,
)
as $Val,
);
$Res call({
Object? sender = null,
Object? receiver = null,
}) {
return _then(_value.copyWith(
sender: null == sender
? _value.sender
: sender // ignore: cast_nullable_to_non_nullable
as ChatUserModel,
receiver: null == receiver
? _value.receiver
: receiver // ignore: cast_nullable_to_non_nullable
as ChatUserModel,
) as $Val);
}
/// Create a copy of Users
@@ -398,15 +377,13 @@ class _$UsersCopyWithImpl<$Res, $Val extends Users>
/// @nodoc
abstract class _$$UsersImplCopyWith<$Res> implements $UsersCopyWith<$Res> {
factory _$$UsersImplCopyWith(
_$UsersImpl value,
$Res Function(_$UsersImpl) then,
) = __$$UsersImplCopyWithImpl<$Res>;
_$UsersImpl value, $Res Function(_$UsersImpl) then) =
__$$UsersImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
@JsonKey(name: 'from_chat_user') ChatUserModel sender,
@JsonKey(name: 'to_chat_user') ChatUserModel receiver,
});
$Res call(
{@JsonKey(name: 'from_chat_user') ChatUserModel sender,
@JsonKey(name: 'to_chat_user') ChatUserModel receiver});
@override
$ChatUserModelCopyWith<$Res> get sender;
@@ -419,39 +396,36 @@ class __$$UsersImplCopyWithImpl<$Res>
extends _$UsersCopyWithImpl<$Res, _$UsersImpl>
implements _$$UsersImplCopyWith<$Res> {
__$$UsersImplCopyWithImpl(
_$UsersImpl _value,
$Res Function(_$UsersImpl) _then,
) : super(_value, _then);
_$UsersImpl _value, $Res Function(_$UsersImpl) _then)
: super(_value, _then);
/// Create a copy of Users
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? sender = null, Object? receiver = null}) {
return _then(
_$UsersImpl(
sender:
null == sender
? _value.sender
: sender // ignore: cast_nullable_to_non_nullable
as ChatUserModel,
receiver:
null == receiver
? _value.receiver
: receiver // ignore: cast_nullable_to_non_nullable
as ChatUserModel,
),
);
$Res call({
Object? sender = null,
Object? receiver = null,
}) {
return _then(_$UsersImpl(
sender: null == sender
? _value.sender
: sender // ignore: cast_nullable_to_non_nullable
as ChatUserModel,
receiver: null == receiver
? _value.receiver
: receiver // ignore: cast_nullable_to_non_nullable
as ChatUserModel,
));
}
}
/// @nodoc
@JsonSerializable()
class _$UsersImpl implements _Users {
const _$UsersImpl({
@JsonKey(name: 'from_chat_user') required this.sender,
@JsonKey(name: 'to_chat_user') required this.receiver,
});
const _$UsersImpl(
{@JsonKey(name: 'from_chat_user') required this.sender,
@JsonKey(name: 'to_chat_user') required this.receiver});
factory _$UsersImpl.fromJson(Map<String, dynamic> json) =>
_$$UsersImplFromJson(json);
@@ -492,15 +466,17 @@ class _$UsersImpl implements _Users {
@override
Map<String, dynamic> toJson() {
return _$$UsersImplToJson(this);
return _$$UsersImplToJson(
this,
);
}
}
abstract class _Users implements Users {
const factory _Users({
@JsonKey(name: 'from_chat_user') required final ChatUserModel sender,
@JsonKey(name: 'to_chat_user') required final ChatUserModel receiver,
}) = _$UsersImpl;
const factory _Users(
{@JsonKey(name: 'from_chat_user') required final ChatUserModel sender,
@JsonKey(name: 'to_chat_user')
required final ChatUserModel receiver}) = _$UsersImpl;
factory _Users.fromJson(Map<String, dynamic> json) = _$UsersImpl.fromJson;

View File

@@ -10,8 +10,7 @@ _$ChatRoomModelImpl _$$ChatRoomModelImplFromJson(Map<String, dynamic> json) =>
_$ChatRoomModelImpl(
id: json['id'] as String,
chatRoomSettings: ChatRoomSettingsModel.fromJson(
json['chat_room_setting'] as Map<String, dynamic>,
),
json['chat_room_setting'] as Map<String, dynamic>),
users: Users.fromJson(json['users'] as Map<String, dynamic>),
chosenPlan: parseChosenPlan(json['chosen_plan']),
);
@@ -25,13 +24,11 @@ Map<String, dynamic> _$$ChatRoomModelImplToJson(_$ChatRoomModelImpl instance) =>
};
_$UsersImpl _$$UsersImplFromJson(Map<String, dynamic> json) => _$UsersImpl(
sender: ChatUserModel.fromJson(
json['from_chat_user'] as Map<String, dynamic>,
),
receiver: ChatUserModel.fromJson(
json['to_chat_user'] as Map<String, dynamic>,
),
);
sender: ChatUserModel.fromJson(
json['from_chat_user'] as Map<String, dynamic>),
receiver:
ChatUserModel.fromJson(json['to_chat_user'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$UsersImplToJson(_$UsersImpl instance) =>
<String, dynamic>{

View File

@@ -7,25 +7,24 @@ part of 'chat_room_pagination_model.dart';
// **************************************************************************
_$ChatRoomPreviewModelImpl _$$ChatRoomPreviewModelImplFromJson(
Map<String, dynamic> json,
) => _$ChatRoomPreviewModelImpl(
chatRooms: ChatRooms.fromJson(json['chatRooms'] as Map<String, dynamic>),
unreadChatsCount: (json['number_of_unread_chat_rooms'] as num).toInt(),
);
Map<String, dynamic> json) =>
_$ChatRoomPreviewModelImpl(
chatRooms: ChatRooms.fromJson(json['chatRooms'] as Map<String, dynamic>),
unreadChatsCount: (json['number_of_unread_chat_rooms'] as num).toInt(),
);
Map<String, dynamic> _$$ChatRoomPreviewModelImplToJson(
_$ChatRoomPreviewModelImpl instance,
) => <String, dynamic>{
'chatRooms': instance.chatRooms,
'number_of_unread_chat_rooms': instance.unreadChatsCount,
};
_$ChatRoomPreviewModelImpl instance) =>
<String, dynamic>{
'chatRooms': instance.chatRooms,
'number_of_unread_chat_rooms': instance.unreadChatsCount,
};
_$ChatRoomsImpl _$$ChatRoomsImplFromJson(Map<String, dynamic> json) =>
_$ChatRoomsImpl(
data:
(json['data'] as List<dynamic>)
.map((e) => ChatRoom.fromJson(e as Map<String, dynamic>))
.toList(),
data: (json['data'] as List<dynamic>)
.map((e) => ChatRoom.fromJson(e as Map<String, dynamic>))
.toList(),
lastPage: (json['last_page'] as num).toInt(),
currentPage: (json['current_page'] as num).toInt(),
);
@@ -58,11 +57,11 @@ Map<String, dynamic> _$$ChatRoomImplToJson(_$ChatRoomImpl instance) =>
};
_$UsersImpl _$$UsersImplFromJson(Map<String, dynamic> json) => _$UsersImpl(
fromChatUser: ChatUser.fromJson(
json['from_chat_user'] as Map<String, dynamic>,
),
toChatUser: ChatUser.fromJson(json['to_chat_user'] as Map<String, dynamic>),
);
fromChatUser:
ChatUser.fromJson(json['from_chat_user'] as Map<String, dynamic>),
toChatUser:
ChatUser.fromJson(json['to_chat_user'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$UsersImplToJson(_$UsersImpl instance) =>
<String, dynamic>{

View File

@@ -12,12 +12,10 @@ part of 'chat_room_settings_model.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
ChatRoomSettingsModel _$ChatRoomSettingsModelFromJson(
Map<String, dynamic> json,
) {
Map<String, dynamic> json) {
return _ChatRoomSettingsModel.fromJson(json);
}
@@ -44,25 +42,21 @@ mixin _$ChatRoomSettingsModel {
/// @nodoc
abstract class $ChatRoomSettingsModelCopyWith<$Res> {
factory $ChatRoomSettingsModelCopyWith(
ChatRoomSettingsModel value,
$Res Function(ChatRoomSettingsModel) then,
) = _$ChatRoomSettingsModelCopyWithImpl<$Res, ChatRoomSettingsModel>;
factory $ChatRoomSettingsModelCopyWith(ChatRoomSettingsModel value,
$Res Function(ChatRoomSettingsModel) then) =
_$ChatRoomSettingsModelCopyWithImpl<$Res, ChatRoomSettingsModel>;
@useResult
$Res call({
int id,
@JsonKey(name: 'room_name') String roomName,
String state,
@JsonKey(name: 'access_level') String accessLevel,
@JsonKey(name: 'updated_at') String updatedAt,
});
$Res call(
{int id,
@JsonKey(name: 'room_name') String roomName,
String state,
@JsonKey(name: 'access_level') String accessLevel,
@JsonKey(name: 'updated_at') String updatedAt});
}
/// @nodoc
class _$ChatRoomSettingsModelCopyWithImpl<
$Res,
$Val extends ChatRoomSettingsModel
>
class _$ChatRoomSettingsModelCopyWithImpl<$Res,
$Val extends ChatRoomSettingsModel>
implements $ChatRoomSettingsModelCopyWith<$Res> {
_$ChatRoomSettingsModelCopyWithImpl(this._value, this._then);
@@ -82,36 +76,28 @@ class _$ChatRoomSettingsModelCopyWithImpl<
Object? accessLevel = null,
Object? updatedAt = null,
}) {
return _then(
_value.copyWith(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
roomName:
null == roomName
? _value.roomName
: roomName // ignore: cast_nullable_to_non_nullable
as String,
state:
null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
accessLevel:
null == accessLevel
? _value.accessLevel
: accessLevel // ignore: cast_nullable_to_non_nullable
as String,
updatedAt:
null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as String,
)
as $Val,
);
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
roomName: null == roomName
? _value.roomName
: roomName // ignore: cast_nullable_to_non_nullable
as String,
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
accessLevel: null == accessLevel
? _value.accessLevel
: accessLevel // ignore: cast_nullable_to_non_nullable
as String,
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
@@ -119,29 +105,27 @@ class _$ChatRoomSettingsModelCopyWithImpl<
abstract class _$$ChatRoomSettingsModelImplCopyWith<$Res>
implements $ChatRoomSettingsModelCopyWith<$Res> {
factory _$$ChatRoomSettingsModelImplCopyWith(
_$ChatRoomSettingsModelImpl value,
$Res Function(_$ChatRoomSettingsModelImpl) then,
) = __$$ChatRoomSettingsModelImplCopyWithImpl<$Res>;
_$ChatRoomSettingsModelImpl value,
$Res Function(_$ChatRoomSettingsModelImpl) then) =
__$$ChatRoomSettingsModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
int id,
@JsonKey(name: 'room_name') String roomName,
String state,
@JsonKey(name: 'access_level') String accessLevel,
@JsonKey(name: 'updated_at') String updatedAt,
});
$Res call(
{int id,
@JsonKey(name: 'room_name') String roomName,
String state,
@JsonKey(name: 'access_level') String accessLevel,
@JsonKey(name: 'updated_at') String updatedAt});
}
/// @nodoc
class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res>
extends
_$ChatRoomSettingsModelCopyWithImpl<$Res, _$ChatRoomSettingsModelImpl>
extends _$ChatRoomSettingsModelCopyWithImpl<$Res,
_$ChatRoomSettingsModelImpl>
implements _$$ChatRoomSettingsModelImplCopyWith<$Res> {
__$$ChatRoomSettingsModelImplCopyWithImpl(
_$ChatRoomSettingsModelImpl _value,
$Res Function(_$ChatRoomSettingsModelImpl) _then,
) : super(_value, _then);
__$$ChatRoomSettingsModelImplCopyWithImpl(_$ChatRoomSettingsModelImpl _value,
$Res Function(_$ChatRoomSettingsModelImpl) _then)
: super(_value, _then);
/// Create a copy of ChatRoomSettingsModel
/// with the given fields replaced by the non-null parameter values.
@@ -154,48 +138,40 @@ class __$$ChatRoomSettingsModelImplCopyWithImpl<$Res>
Object? accessLevel = null,
Object? updatedAt = null,
}) {
return _then(
_$ChatRoomSettingsModelImpl(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
roomName:
null == roomName
? _value.roomName
: roomName // ignore: cast_nullable_to_non_nullable
as String,
state:
null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
accessLevel:
null == accessLevel
? _value.accessLevel
: accessLevel // ignore: cast_nullable_to_non_nullable
as String,
updatedAt:
null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as String,
),
);
return _then(_$ChatRoomSettingsModelImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
roomName: null == roomName
? _value.roomName
: roomName // ignore: cast_nullable_to_non_nullable
as String,
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as String,
accessLevel: null == accessLevel
? _value.accessLevel
: accessLevel // ignore: cast_nullable_to_non_nullable
as String,
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel {
const _$ChatRoomSettingsModelImpl({
required this.id,
@JsonKey(name: 'room_name') required this.roomName,
required this.state,
@JsonKey(name: 'access_level') required this.accessLevel,
@JsonKey(name: 'updated_at') required this.updatedAt,
});
const _$ChatRoomSettingsModelImpl(
{required this.id,
@JsonKey(name: 'room_name') required this.roomName,
required this.state,
@JsonKey(name: 'access_level') required this.accessLevel,
@JsonKey(name: 'updated_at') required this.updatedAt});
factory _$ChatRoomSettingsModelImpl.fromJson(Map<String, dynamic> json) =>
_$$ChatRoomSettingsModelImplFromJson(json);
@@ -245,26 +221,25 @@ class _$ChatRoomSettingsModelImpl implements _ChatRoomSettingsModel {
@override
@pragma('vm:prefer-inline')
_$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl>
get copyWith =>
__$$ChatRoomSettingsModelImplCopyWithImpl<_$ChatRoomSettingsModelImpl>(
this,
_$identity,
);
get copyWith => __$$ChatRoomSettingsModelImplCopyWithImpl<
_$ChatRoomSettingsModelImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ChatRoomSettingsModelImplToJson(this);
return _$$ChatRoomSettingsModelImplToJson(
this,
);
}
}
abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel {
const factory _ChatRoomSettingsModel({
required final int id,
@JsonKey(name: 'room_name') required final String roomName,
required final String state,
@JsonKey(name: 'access_level') required final String accessLevel,
@JsonKey(name: 'updated_at') required final String updatedAt,
}) = _$ChatRoomSettingsModelImpl;
const factory _ChatRoomSettingsModel(
{required final int id,
@JsonKey(name: 'room_name') required final String roomName,
required final String state,
@JsonKey(name: 'access_level') required final String accessLevel,
@JsonKey(name: 'updated_at') required final String updatedAt}) =
_$ChatRoomSettingsModelImpl;
factory _ChatRoomSettingsModel.fromJson(Map<String, dynamic> json) =
_$ChatRoomSettingsModelImpl.fromJson;
@@ -288,5 +263,5 @@ abstract class _ChatRoomSettingsModel implements ChatRoomSettingsModel {
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ChatRoomSettingsModelImplCopyWith<_$ChatRoomSettingsModelImpl>
get copyWith => throw _privateConstructorUsedError;
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -7,21 +7,21 @@ part of 'chat_room_settings_model.dart';
// **************************************************************************
_$ChatRoomSettingsModelImpl _$$ChatRoomSettingsModelImplFromJson(
Map<String, dynamic> json,
) => _$ChatRoomSettingsModelImpl(
id: (json['id'] as num).toInt(),
roomName: json['room_name'] as String,
state: json['state'] as String,
accessLevel: json['access_level'] as String,
updatedAt: json['updated_at'] as String,
);
Map<String, dynamic> json) =>
_$ChatRoomSettingsModelImpl(
id: (json['id'] as num).toInt(),
roomName: json['room_name'] as String,
state: json['state'] as String,
accessLevel: json['access_level'] as String,
updatedAt: json['updated_at'] as String,
);
Map<String, dynamic> _$$ChatRoomSettingsModelImplToJson(
_$ChatRoomSettingsModelImpl instance,
) => <String, dynamic>{
'id': instance.id,
'room_name': instance.roomName,
'state': instance.state,
'access_level': instance.accessLevel,
'updated_at': instance.updatedAt,
};
_$ChatRoomSettingsModelImpl instance) =>
<String, dynamic>{
'id': instance.id,
'room_name': instance.roomName,
'state': instance.state,
'access_level': instance.accessLevel,
'updated_at': instance.updatedAt,
};

View File

@@ -12,8 +12,7 @@ part of 'chat_user_model.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
ChatUserModel _$ChatUserModelFromJson(Map<String, dynamic> json) {
return _ChatUserModel.fromJson(json);
@@ -42,17 +41,15 @@ mixin _$ChatUserModel {
/// @nodoc
abstract class $ChatUserModelCopyWith<$Res> {
factory $ChatUserModelCopyWith(
ChatUserModel value,
$Res Function(ChatUserModel) then,
) = _$ChatUserModelCopyWithImpl<$Res, ChatUserModel>;
ChatUserModel value, $Res Function(ChatUserModel) then) =
_$ChatUserModelCopyWithImpl<$Res, ChatUserModel>;
@useResult
$Res call({
int id,
String name,
String slug,
@JsonKey(name: 'profile_photo_path') String? profilePhotoPath,
@JsonKey(name: 'profile_photo_url') String? profilePhotoUrl,
});
$Res call(
{int id,
String name,
String slug,
@JsonKey(name: 'profile_photo_path') String? profilePhotoPath,
@JsonKey(name: 'profile_photo_url') String? profilePhotoUrl});
}
/// @nodoc
@@ -76,36 +73,28 @@ class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel>
Object? profilePhotoPath = freezed,
Object? profilePhotoUrl = freezed,
}) {
return _then(
_value.copyWith(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
slug:
null == slug
? _value.slug
: slug // ignore: cast_nullable_to_non_nullable
as String,
profilePhotoPath:
freezed == profilePhotoPath
? _value.profilePhotoPath
: profilePhotoPath // ignore: cast_nullable_to_non_nullable
as String?,
profilePhotoUrl:
freezed == profilePhotoUrl
? _value.profilePhotoUrl
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
as String?,
)
as $Val,
);
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
slug: null == slug
? _value.slug
: slug // ignore: cast_nullable_to_non_nullable
as String,
profilePhotoPath: freezed == profilePhotoPath
? _value.profilePhotoPath
: profilePhotoPath // ignore: cast_nullable_to_non_nullable
as String?,
profilePhotoUrl: freezed == profilePhotoUrl
? _value.profilePhotoUrl
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
}
@@ -113,18 +102,16 @@ class _$ChatUserModelCopyWithImpl<$Res, $Val extends ChatUserModel>
abstract class _$$ChatUserModelImplCopyWith<$Res>
implements $ChatUserModelCopyWith<$Res> {
factory _$$ChatUserModelImplCopyWith(
_$ChatUserModelImpl value,
$Res Function(_$ChatUserModelImpl) then,
) = __$$ChatUserModelImplCopyWithImpl<$Res>;
_$ChatUserModelImpl value, $Res Function(_$ChatUserModelImpl) then) =
__$$ChatUserModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
int id,
String name,
String slug,
@JsonKey(name: 'profile_photo_path') String? profilePhotoPath,
@JsonKey(name: 'profile_photo_url') String? profilePhotoUrl,
});
$Res call(
{int id,
String name,
String slug,
@JsonKey(name: 'profile_photo_path') String? profilePhotoPath,
@JsonKey(name: 'profile_photo_url') String? profilePhotoUrl});
}
/// @nodoc
@@ -132,9 +119,8 @@ class __$$ChatUserModelImplCopyWithImpl<$Res>
extends _$ChatUserModelCopyWithImpl<$Res, _$ChatUserModelImpl>
implements _$$ChatUserModelImplCopyWith<$Res> {
__$$ChatUserModelImplCopyWithImpl(
_$ChatUserModelImpl _value,
$Res Function(_$ChatUserModelImpl) _then,
) : super(_value, _then);
_$ChatUserModelImpl _value, $Res Function(_$ChatUserModelImpl) _then)
: super(_value, _then);
/// Create a copy of ChatUserModel
/// with the given fields replaced by the non-null parameter values.
@@ -147,48 +133,40 @@ class __$$ChatUserModelImplCopyWithImpl<$Res>
Object? profilePhotoPath = freezed,
Object? profilePhotoUrl = freezed,
}) {
return _then(
_$ChatUserModelImpl(
id:
null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
name:
null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
slug:
null == slug
? _value.slug
: slug // ignore: cast_nullable_to_non_nullable
as String,
profilePhotoPath:
freezed == profilePhotoPath
? _value.profilePhotoPath
: profilePhotoPath // ignore: cast_nullable_to_non_nullable
as String?,
profilePhotoUrl:
freezed == profilePhotoUrl
? _value.profilePhotoUrl
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
as String?,
),
);
return _then(_$ChatUserModelImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
slug: null == slug
? _value.slug
: slug // ignore: cast_nullable_to_non_nullable
as String,
profilePhotoPath: freezed == profilePhotoPath
? _value.profilePhotoPath
: profilePhotoPath // ignore: cast_nullable_to_non_nullable
as String?,
profilePhotoUrl: freezed == profilePhotoUrl
? _value.profilePhotoUrl
: profilePhotoUrl // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ChatUserModelImpl implements _ChatUserModel {
const _$ChatUserModelImpl({
required this.id,
required this.name,
required this.slug,
@JsonKey(name: 'profile_photo_path') this.profilePhotoPath,
@JsonKey(name: 'profile_photo_url') this.profilePhotoUrl,
});
const _$ChatUserModelImpl(
{required this.id,
required this.name,
required this.slug,
@JsonKey(name: 'profile_photo_path') this.profilePhotoPath,
@JsonKey(name: 'profile_photo_url') this.profilePhotoUrl});
factory _$ChatUserModelImpl.fromJson(Map<String, dynamic> json) =>
_$$ChatUserModelImplFromJson(json);
@@ -228,13 +206,7 @@ class _$ChatUserModelImpl implements _ChatUserModel {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
id,
name,
slug,
profilePhotoPath,
profilePhotoUrl,
);
runtimeType, id, name, slug, profilePhotoPath, profilePhotoUrl);
/// Create a copy of ChatUserModel
/// with the given fields replaced by the non-null parameter values.
@@ -246,18 +218,20 @@ class _$ChatUserModelImpl implements _ChatUserModel {
@override
Map<String, dynamic> toJson() {
return _$$ChatUserModelImplToJson(this);
return _$$ChatUserModelImplToJson(
this,
);
}
}
abstract class _ChatUserModel implements ChatUserModel {
const factory _ChatUserModel({
required final int id,
required final String name,
required final String slug,
@JsonKey(name: 'profile_photo_path') final String? profilePhotoPath,
@JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl,
}) = _$ChatUserModelImpl;
const factory _ChatUserModel(
{required final int id,
required final String name,
required final String slug,
@JsonKey(name: 'profile_photo_path') final String? profilePhotoPath,
@JsonKey(name: 'profile_photo_url') final String? profilePhotoUrl}) =
_$ChatUserModelImpl;
factory _ChatUserModel.fromJson(Map<String, dynamic> json) =
_$ChatUserModelImpl.fromJson;

View File

@@ -0,0 +1,14 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'payment_model.freezed.dart';
part 'payment_model.g.dart';
@freezed
class PaymentModel with _$PaymentModel {
factory PaymentModel({
@JsonKey(name: 'checkout_url') required String paymentUrl,
}) = _PaymentModel;
factory PaymentModel.fromJson(Map<String, dynamic> json) => _$PaymentModelFromJson(json);
}

View File

@@ -0,0 +1,170 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'payment_model.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
PaymentModel _$PaymentModelFromJson(Map<String, dynamic> json) {
return _PaymentModel.fromJson(json);
}
/// @nodoc
mixin _$PaymentModel {
@JsonKey(name: 'checkout_url')
String get paymentUrl => throw _privateConstructorUsedError;
/// Serializes this PaymentModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of PaymentModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$PaymentModelCopyWith<PaymentModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $PaymentModelCopyWith<$Res> {
factory $PaymentModelCopyWith(
PaymentModel value, $Res Function(PaymentModel) then) =
_$PaymentModelCopyWithImpl<$Res, PaymentModel>;
@useResult
$Res call({@JsonKey(name: 'checkout_url') String paymentUrl});
}
/// @nodoc
class _$PaymentModelCopyWithImpl<$Res, $Val extends PaymentModel>
implements $PaymentModelCopyWith<$Res> {
_$PaymentModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of PaymentModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? paymentUrl = null,
}) {
return _then(_value.copyWith(
paymentUrl: null == paymentUrl
? _value.paymentUrl
: paymentUrl // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$PaymentModelImplCopyWith<$Res>
implements $PaymentModelCopyWith<$Res> {
factory _$$PaymentModelImplCopyWith(
_$PaymentModelImpl value, $Res Function(_$PaymentModelImpl) then) =
__$$PaymentModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({@JsonKey(name: 'checkout_url') String paymentUrl});
}
/// @nodoc
class __$$PaymentModelImplCopyWithImpl<$Res>
extends _$PaymentModelCopyWithImpl<$Res, _$PaymentModelImpl>
implements _$$PaymentModelImplCopyWith<$Res> {
__$$PaymentModelImplCopyWithImpl(
_$PaymentModelImpl _value, $Res Function(_$PaymentModelImpl) _then)
: super(_value, _then);
/// Create a copy of PaymentModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? paymentUrl = null,
}) {
return _then(_$PaymentModelImpl(
paymentUrl: null == paymentUrl
? _value.paymentUrl
: paymentUrl // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
@JsonSerializable()
class _$PaymentModelImpl implements _PaymentModel {
_$PaymentModelImpl({@JsonKey(name: 'checkout_url') required this.paymentUrl});
factory _$PaymentModelImpl.fromJson(Map<String, dynamic> json) =>
_$$PaymentModelImplFromJson(json);
@override
@JsonKey(name: 'checkout_url')
final String paymentUrl;
@override
String toString() {
return 'PaymentModel(paymentUrl: $paymentUrl)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$PaymentModelImpl &&
(identical(other.paymentUrl, paymentUrl) ||
other.paymentUrl == paymentUrl));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, paymentUrl);
/// Create a copy of PaymentModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$PaymentModelImplCopyWith<_$PaymentModelImpl> get copyWith =>
__$$PaymentModelImplCopyWithImpl<_$PaymentModelImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$PaymentModelImplToJson(
this,
);
}
}
abstract class _PaymentModel implements PaymentModel {
factory _PaymentModel(
{@JsonKey(name: 'checkout_url') required final String paymentUrl}) =
_$PaymentModelImpl;
factory _PaymentModel.fromJson(Map<String, dynamic> json) =
_$PaymentModelImpl.fromJson;
@override
@JsonKey(name: 'checkout_url')
String get paymentUrl;
/// Create a copy of PaymentModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$PaymentModelImplCopyWith<_$PaymentModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -0,0 +1,17 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'payment_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$PaymentModelImpl _$$PaymentModelImplFromJson(Map<String, dynamic> json) =>
_$PaymentModelImpl(
paymentUrl: json['checkout_url'] as String,
);
Map<String, dynamic> _$$PaymentModelImplToJson(_$PaymentModelImpl instance) =>
<String, dynamic>{
'checkout_url': instance.paymentUrl,
};

View File

@@ -12,8 +12,7 @@ part of 'websocket_info_model.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
WebsocketInfoModel _$WebsocketInfoModelFromJson(Map<String, dynamic> json) {
return _WebsocketInfoModel.fromJson(json);
@@ -41,17 +40,15 @@ mixin _$WebsocketInfoModel {
/// @nodoc
abstract class $WebsocketInfoModelCopyWith<$Res> {
factory $WebsocketInfoModelCopyWith(
WebsocketInfoModel value,
$Res Function(WebsocketInfoModel) then,
) = _$WebsocketInfoModelCopyWithImpl<$Res, WebsocketInfoModel>;
WebsocketInfoModel value, $Res Function(WebsocketInfoModel) then) =
_$WebsocketInfoModelCopyWithImpl<$Res, WebsocketInfoModel>;
@useResult
$Res call({
String key,
String host,
String port,
String cluster,
@JsonKey(name: 'user_id') int userId,
});
$Res call(
{String key,
String host,
String port,
String cluster,
@JsonKey(name: 'user_id') int userId});
}
/// @nodoc
@@ -75,65 +72,54 @@ class _$WebsocketInfoModelCopyWithImpl<$Res, $Val extends WebsocketInfoModel>
Object? cluster = null,
Object? userId = null,
}) {
return _then(
_value.copyWith(
key:
null == key
? _value.key
: key // ignore: cast_nullable_to_non_nullable
as String,
host:
null == host
? _value.host
: host // ignore: cast_nullable_to_non_nullable
as String,
port:
null == port
? _value.port
: port // ignore: cast_nullable_to_non_nullable
as String,
cluster:
null == cluster
? _value.cluster
: cluster // ignore: cast_nullable_to_non_nullable
as String,
userId:
null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
)
as $Val,
);
return _then(_value.copyWith(
key: null == key
? _value.key
: key // ignore: cast_nullable_to_non_nullable
as String,
host: null == host
? _value.host
: host // ignore: cast_nullable_to_non_nullable
as String,
port: null == port
? _value.port
: port // ignore: cast_nullable_to_non_nullable
as String,
cluster: null == cluster
? _value.cluster
: cluster // ignore: cast_nullable_to_non_nullable
as String,
userId: null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
}
/// @nodoc
abstract class _$$WebsocketInfoModelImplCopyWith<$Res>
implements $WebsocketInfoModelCopyWith<$Res> {
factory _$$WebsocketInfoModelImplCopyWith(
_$WebsocketInfoModelImpl value,
$Res Function(_$WebsocketInfoModelImpl) then,
) = __$$WebsocketInfoModelImplCopyWithImpl<$Res>;
factory _$$WebsocketInfoModelImplCopyWith(_$WebsocketInfoModelImpl value,
$Res Function(_$WebsocketInfoModelImpl) then) =
__$$WebsocketInfoModelImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
String key,
String host,
String port,
String cluster,
@JsonKey(name: 'user_id') int userId,
});
$Res call(
{String key,
String host,
String port,
String cluster,
@JsonKey(name: 'user_id') int userId});
}
/// @nodoc
class __$$WebsocketInfoModelImplCopyWithImpl<$Res>
extends _$WebsocketInfoModelCopyWithImpl<$Res, _$WebsocketInfoModelImpl>
implements _$$WebsocketInfoModelImplCopyWith<$Res> {
__$$WebsocketInfoModelImplCopyWithImpl(
_$WebsocketInfoModelImpl _value,
$Res Function(_$WebsocketInfoModelImpl) _then,
) : super(_value, _then);
__$$WebsocketInfoModelImplCopyWithImpl(_$WebsocketInfoModelImpl _value,
$Res Function(_$WebsocketInfoModelImpl) _then)
: super(_value, _then);
/// Create a copy of WebsocketInfoModel
/// with the given fields replaced by the non-null parameter values.
@@ -146,48 +132,40 @@ class __$$WebsocketInfoModelImplCopyWithImpl<$Res>
Object? cluster = null,
Object? userId = null,
}) {
return _then(
_$WebsocketInfoModelImpl(
key:
null == key
? _value.key
: key // ignore: cast_nullable_to_non_nullable
as String,
host:
null == host
? _value.host
: host // ignore: cast_nullable_to_non_nullable
as String,
port:
null == port
? _value.port
: port // ignore: cast_nullable_to_non_nullable
as String,
cluster:
null == cluster
? _value.cluster
: cluster // ignore: cast_nullable_to_non_nullable
as String,
userId:
null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
),
);
return _then(_$WebsocketInfoModelImpl(
key: null == key
? _value.key
: key // ignore: cast_nullable_to_non_nullable
as String,
host: null == host
? _value.host
: host // ignore: cast_nullable_to_non_nullable
as String,
port: null == port
? _value.port
: port // ignore: cast_nullable_to_non_nullable
as String,
cluster: null == cluster
? _value.cluster
: cluster // ignore: cast_nullable_to_non_nullable
as String,
userId: null == userId
? _value.userId
: userId // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
/// @nodoc
@JsonSerializable()
class _$WebsocketInfoModelImpl implements _WebsocketInfoModel {
const _$WebsocketInfoModelImpl({
required this.key,
required this.host,
required this.port,
required this.cluster,
@JsonKey(name: 'user_id') required this.userId,
});
const _$WebsocketInfoModelImpl(
{required this.key,
required this.host,
required this.port,
required this.cluster,
@JsonKey(name: 'user_id') required this.userId});
factory _$WebsocketInfoModelImpl.fromJson(Map<String, dynamic> json) =>
_$$WebsocketInfoModelImplFromJson(json);
@@ -233,24 +211,24 @@ class _$WebsocketInfoModelImpl implements _WebsocketInfoModel {
@pragma('vm:prefer-inline')
_$$WebsocketInfoModelImplCopyWith<_$WebsocketInfoModelImpl> get copyWith =>
__$$WebsocketInfoModelImplCopyWithImpl<_$WebsocketInfoModelImpl>(
this,
_$identity,
);
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$WebsocketInfoModelImplToJson(this);
return _$$WebsocketInfoModelImplToJson(
this,
);
}
}
abstract class _WebsocketInfoModel implements WebsocketInfoModel {
const factory _WebsocketInfoModel({
required final String key,
required final String host,
required final String port,
required final String cluster,
@JsonKey(name: 'user_id') required final int userId,
}) = _$WebsocketInfoModelImpl;
const factory _WebsocketInfoModel(
{required final String key,
required final String host,
required final String port,
required final String cluster,
@JsonKey(name: 'user_id') required final int userId}) =
_$WebsocketInfoModelImpl;
factory _WebsocketInfoModel.fromJson(Map<String, dynamic> json) =
_$WebsocketInfoModelImpl.fromJson;

View File

@@ -7,21 +7,21 @@ part of 'websocket_info_model.dart';
// **************************************************************************
_$WebsocketInfoModelImpl _$$WebsocketInfoModelImplFromJson(
Map<String, dynamic> json,
) => _$WebsocketInfoModelImpl(
key: json['key'] as String,
host: json['host'] as String,
port: json['port'] as String,
cluster: json['cluster'] as String,
userId: (json['user_id'] as num).toInt(),
);
Map<String, dynamic> json) =>
_$WebsocketInfoModelImpl(
key: json['key'] as String,
host: json['host'] as String,
port: json['port'] as String,
cluster: json['cluster'] as String,
userId: (json['user_id'] as num).toInt(),
);
Map<String, dynamic> _$$WebsocketInfoModelImplToJson(
_$WebsocketInfoModelImpl instance,
) => <String, dynamic>{
'key': instance.key,
'host': instance.host,
'port': instance.port,
'cluster': instance.cluster,
'user_id': instance.userId,
};
_$WebsocketInfoModelImpl instance) =>
<String, dynamic>{
'key': instance.key,
'host': instance.host,
'port': instance.port,
'cluster': instance.cluster,
'user_id': instance.userId,
};

View File

@@ -7,56 +7,67 @@ import 'package:audioplayers/audioplayers.dart';
import 'package:dart_pusher_channels/dart_pusher_channels.dart';
import 'package:easy_debounce/easy_debounce.dart';
import 'package:eatvio_app/core/image_compressing/image_compress_utility.dart';
import 'package:eatvio_app/core/utils/date_time_utils.dart';
import 'package:eatvio_app/core/websockets/ws_manager.dart';
import 'package:eatvio_app/features/chat/models/chat_message_model.dart';
import 'package:eatvio_app/features/chat/presentation/bloc/chat_room_cubit/chat_room_state.dart';
import 'package:eatvio_app/features/chat/repositories/chat_repository.dart';
import 'package:eatvio_app/features/my_finance/models/card_model.dart';
import 'package:eatvio_app/features/my_finance/repositories/cards_repository.dart';
import 'package:eatvio_app/features/plans/enums/chosen_plan_state_enum.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class ChatRoomCubit extends Cubit<ChatRoomState> {
final ChatRepository chatRepository;
final CardsRepository cardsRepository;
final WsManager wsManager;
StreamSubscription<ChannelReadEvent>? typingSubscription;
StreamSubscription<ChannelReadEvent>? messagesSubscription;
int currentPage = 1;
late final int lastPage;
late int lastPage;
bool isLoading = false;
ChatRoomCubit({
required this.chatRepository,
required this.wsManager,
}) : super(ChatRoomState.loading());
ChatRoomCubit({required this.chatRepository, required this.wsManager, required this.cardsRepository}) : super(const ChatRoomState.loading());
loadNextPage(String chatId) async {
if (currentPage < lastPage && !isLoading) {
isLoading = true;
emit(
ChatRoomState.loaded(
chatRoom: (state as ChatRoomStateLoaded).chatRoom,
chatMessages: (state as ChatRoomStateLoaded).chatMessages,
isTyping: (state as ChatRoomStateLoaded).isTyping,
isLoading: isLoading,
),
);
emit((state as ChatRoomStateLoaded).copyWith(isLoading: isLoading));
try {
final chatMessages = await chatRepository.getChatMessages(chatId, currentPage + 1);
isLoading = false;
emit(
ChatRoomState.loaded(
chatRoom: (state as ChatRoomStateLoaded).chatRoom,
chatMessages: [...(state as ChatRoomStateLoaded).chatMessages, ...chatMessages.messagesList],
isTyping: (state as ChatRoomStateLoaded).isTyping,
(state as ChatRoomStateLoaded).copyWith(
isLoading: isLoading,
chatMessages: [...(state as ChatRoomStateLoaded).chatMessages, ...chatMessages.messagesList],
),
);
currentPage++;
} catch (e) {
emit(ChatRoomState.error(errorMessage: 'Ошибка получеия данных'));
emit(const ChatRoomState.error(errorMessage: 'Ошибка получеия данных'));
}
}
}
Future<void> checkCards() async {
try {
final cards = await cardsRepository.getCards();
setCard(cards: cards);
} catch (e) {
emit(const ChatRoomState.error(errorMessage: 'Ошибка получеия данных'));
}
}
void setCard({required List<CardModel> cards}) {
final currentState = state;
if (currentState is ChatRoomStateLoaded) {
if (cards.where((card) => card.isDefault).isNotEmpty) {
emit(currentState.copyWith(hasCard: true));
}
}
}
@@ -70,19 +81,30 @@ class ChatRoomCubit extends Cubit<ChatRoomState> {
await _subscribeToChatChannel(chatId: chatId);
emit(
ChatRoomState.loaded(
chatRoom: chatRoom,
chatMessages: chatMessages.messagesList,
isTyping: false,
isLoading: isLoading,
),
);
emit(ChatRoomState.loaded(chatRoom: chatRoom, chatMessages: chatMessages.messagesList, isTyping: false, isLoading: isLoading, hasCard: false));
// final cards = await cardsRepository.getCards();
// setCard(cards: cards);
} catch (e) {
log(e.toString());
typingSubscription?.cancel();
messagesSubscription?.cancel();
wsManager.unsubscribeDirectChatChannel();
emit(ChatRoomState.error(errorMessage: 'Ошибка получеия данных'));
emit(const ChatRoomState.error(errorMessage: 'Ошибка получеия данных'));
}
}
Future<bool> choseStartPlanDate(DateTime date) async {
try {
if (state is! ChatRoomStateLoaded) return false;
final planId = (state as ChatRoomStateLoaded).chatRoom.chosenPlan?.id;
if (planId == null) return false;
final stringDate = date.format('yyyy-MM-dd');
await chatRepository.choseStartPlanDate(id: planId, date: {'start_date': stringDate});
emit((state as ChatRoomStateLoaded).copyWith.chatRoom.chosenPlan?.call(chosenPlanState: ChosenPlanStateEnum.stateStartDateHasBeenSet) ?? state);
return true;
} catch (e, st) {
log(e.toString(), stackTrace: st);
return false;
}
}
@@ -90,17 +112,13 @@ class ChatRoomCubit extends Cubit<ChatRoomState> {
try {
await chatRepository.cancelChosenPlan(id: planId);
final chatRoom = await chatRepository.getChatRoom(chatId);
emit(
(state as ChatRoomStateLoaded).copyWith(chatRoom: chatRoom),
);
emit((state as ChatRoomStateLoaded).copyWith(chatRoom: chatRoom));
} catch (e) {
emit(ChatRoomState.error(errorMessage: 'Ошибка получеия данных'));
emit(const ChatRoomState.error(errorMessage: 'Ошибка получеия данных'));
}
}
Future<void> _subscribeToChatChannel({
required String chatId,
}) async {
Future<void> _subscribeToChatChannel({required String chatId}) async {
final client = wsManager.client;
if (client == null) return;
await wsManager.initPrivateDirectChatChannel(chatId);
@@ -108,56 +126,20 @@ class ChatRoomCubit extends Cubit<ChatRoomState> {
messagesSubscription = wsManager.directChatStream?.listen((event) {
AudioPlayer().play((AssetSource('audio/recive_message.wav')));
final message = ChatMessageModel.fromJson(jsonDecode(event.data)['message']);
List<ChatMessageModel> messagesList = [
message,
...(state as ChatRoomStateLoaded).chatMessages,
];
List<ChatMessageModel> messagesList = [message, ...(state as ChatRoomStateLoaded).chatMessages];
chatRepository.emitNewMessageToChats(message);
emit(
ChatRoomState.loaded(
chatRoom: (state as ChatRoomStateLoaded).chatRoom,
chatMessages: messagesList,
isTyping: (state as ChatRoomStateLoaded).isTyping,
isLoading: isLoading,
),
);
emit((state as ChatRoomStateLoaded).copyWith(chatMessages: messagesList, isLoading: isLoading));
});
typingSubscription = wsManager.clientTypingStream?.listen((event) {
emit(
ChatRoomState.loaded(
chatRoom: (state as ChatRoomStateLoaded).chatRoom,
chatMessages: (state as ChatRoomStateLoaded).chatMessages,
isTyping: true,
isLoading: isLoading,
),
);
EasyDebounce.debounce(
'client-typing',
Duration(seconds: 3),
() => emit(
ChatRoomState.loaded(
chatRoom: (state as ChatRoomStateLoaded).chatRoom,
chatMessages: (state as ChatRoomStateLoaded).chatMessages,
isTyping: false,
isLoading: isLoading,
),
),
);
emit((state as ChatRoomStateLoaded).copyWith(isTyping: true, isLoading: isLoading));
EasyDebounce.debounce('client-typing', const Duration(seconds: 3), () => emit((state as ChatRoomStateLoaded).copyWith(isTyping: false, isLoading: isLoading)));
});
}
Future<bool> sendMessage({
required String chatId,
String? data,
List<File>? files,
}) async {
Future<bool> sendMessage({required String chatId, String? data, List<File>? files}) async {
try {
await chatRepository.sendMessage(
chatId: chatId,
data: data,
files: files != null ? await ImageCompressUtility.compressFilesList(files) : null,
);
await chatRepository.sendMessage(chatId: chatId, data: data, files: files != null ? await ImageCompressUtility.compressFilesList(files) : null);
AudioPlayer().play((AssetSource('audio/send_message.wav')));
return true;
} catch (e, st) {
@@ -172,13 +154,11 @@ class ChatRoomCubit extends Cubit<ChatRoomState> {
final ids = messagesIds.map((e) => e.id).toList();
await chatRepository.markMessagesAsRead(chatId, ids);
final currentMessages = [...(state as ChatRoomStateLoaded).chatMessages];
messagesIds.forEach((elem) {
for (var elem in messagesIds) {
currentMessages[elem.index] = currentMessages[elem.index].copyWith(isRead: true);
});
}
if (!isClosed) {
emit(
(state as ChatRoomStateLoaded).copyWith(chatMessages: currentMessages),
);
emit((state as ChatRoomStateLoaded).copyWith(chatMessages: currentMessages));
}
return true;
}
@@ -189,6 +169,18 @@ class ChatRoomCubit extends Cubit<ChatRoomState> {
}
}
Future<String?> getPaymentLink() async {
try {
final planId = (state as ChatRoomStateLoaded).chatRoom.chosenPlan?.id;
if (planId == null) return null;
final paymentModel = await chatRepository.getPaymentLink(id: planId);
return paymentModel.paymentUrl;
} catch (e, st) {
log(e.toString(), stackTrace: st);
return null;
}
}
@override
Future<void> close() async {
wsManager.unsubscribeDirectChatChannel();

View File

@@ -13,6 +13,7 @@ abstract class ChatRoomState with _$ChatRoomState {
const factory ChatRoomState.loaded({
required ChatRoomModel chatRoom,
required List<ChatMessageModel> chatMessages,
required bool hasCard,
required bool isTyping,
required bool isLoading,
}) = ChatRoomStateLoaded;

View File

@@ -12,8 +12,7 @@ part of 'chat_room_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$ChatRoomState {
@@ -22,55 +21,60 @@ mixin _$ChatRoomState {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>(
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)?
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)?
loaded,
TResult? Function(String errorMessage)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>(
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)?
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>(
TResult Function(_ChatRoomState value) $default, {
required TResult Function(ChatRoomStateLoading value) loading,
required TResult Function(ChatRoomStateLoaded value) loaded,
required TResult Function(ChatRoomStateError value) error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>(
TResult? Function(_ChatRoomState value)? $default, {
TResult? Function(ChatRoomStateLoading value)? loading,
TResult? Function(ChatRoomStateLoaded value)? loaded,
TResult? Function(ChatRoomStateError value)? error,
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>(
TResult Function(_ChatRoomState value)? $default, {
@@ -78,15 +82,15 @@ mixin _$ChatRoomState {
TResult Function(ChatRoomStateLoaded value)? loaded,
TResult Function(ChatRoomStateError value)? error,
required TResult orElse(),
}) => throw _privateConstructorUsedError;
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ChatRoomStateCopyWith<$Res> {
factory $ChatRoomStateCopyWith(
ChatRoomState value,
$Res Function(ChatRoomState) then,
) = _$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>;
ChatRoomState value, $Res Function(ChatRoomState) then) =
_$ChatRoomStateCopyWithImpl<$Res, ChatRoomState>;
}
/// @nodoc
@@ -106,9 +110,8 @@ class _$ChatRoomStateCopyWithImpl<$Res, $Val extends ChatRoomState>
/// @nodoc
abstract class _$$ChatRoomStateImplCopyWith<$Res> {
factory _$$ChatRoomStateImplCopyWith(
_$ChatRoomStateImpl value,
$Res Function(_$ChatRoomStateImpl) then,
) = __$$ChatRoomStateImplCopyWithImpl<$Res>;
_$ChatRoomStateImpl value, $Res Function(_$ChatRoomStateImpl) then) =
__$$ChatRoomStateImplCopyWithImpl<$Res>;
}
/// @nodoc
@@ -116,9 +119,8 @@ class __$$ChatRoomStateImplCopyWithImpl<$Res>
extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateImpl>
implements _$$ChatRoomStateImplCopyWith<$Res> {
__$$ChatRoomStateImplCopyWithImpl(
_$ChatRoomStateImpl _value,
$Res Function(_$ChatRoomStateImpl) _then,
) : super(_value, _then);
_$ChatRoomStateImpl _value, $Res Function(_$ChatRoomStateImpl) _then)
: super(_value, _then);
/// Create a copy of ChatRoomState
/// with the given fields replaced by the non-null parameter values.
@@ -149,12 +151,12 @@ class _$ChatRoomStateImpl implements _ChatRoomState {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) {
return $default();
@@ -166,12 +168,12 @@ class _$ChatRoomStateImpl implements _ChatRoomState {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)?
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return $default?.call();
@@ -183,12 +185,12 @@ class _$ChatRoomStateImpl implements _ChatRoomState {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)?
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -242,20 +244,18 @@ abstract class _ChatRoomState implements ChatRoomState {
/// @nodoc
abstract class _$$ChatRoomStateLoadingImplCopyWith<$Res> {
factory _$$ChatRoomStateLoadingImplCopyWith(
_$ChatRoomStateLoadingImpl value,
$Res Function(_$ChatRoomStateLoadingImpl) then,
) = __$$ChatRoomStateLoadingImplCopyWithImpl<$Res>;
factory _$$ChatRoomStateLoadingImplCopyWith(_$ChatRoomStateLoadingImpl value,
$Res Function(_$ChatRoomStateLoadingImpl) then) =
__$$ChatRoomStateLoadingImplCopyWithImpl<$Res>;
}
/// @nodoc
class __$$ChatRoomStateLoadingImplCopyWithImpl<$Res>
extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadingImpl>
implements _$$ChatRoomStateLoadingImplCopyWith<$Res> {
__$$ChatRoomStateLoadingImplCopyWithImpl(
_$ChatRoomStateLoadingImpl _value,
$Res Function(_$ChatRoomStateLoadingImpl) _then,
) : super(_value, _then);
__$$ChatRoomStateLoadingImplCopyWithImpl(_$ChatRoomStateLoadingImpl _value,
$Res Function(_$ChatRoomStateLoadingImpl) _then)
: super(_value, _then);
/// Create a copy of ChatRoomState
/// with the given fields replaced by the non-null parameter values.
@@ -287,12 +287,12 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) {
return loading();
@@ -304,12 +304,12 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)?
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return loading?.call();
@@ -321,12 +321,12 @@ class _$ChatRoomStateLoadingImpl implements ChatRoomStateLoading {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)?
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
@@ -380,17 +380,16 @@ abstract class ChatRoomStateLoading implements ChatRoomState {
/// @nodoc
abstract class _$$ChatRoomStateLoadedImplCopyWith<$Res> {
factory _$$ChatRoomStateLoadedImplCopyWith(
_$ChatRoomStateLoadedImpl value,
$Res Function(_$ChatRoomStateLoadedImpl) then,
) = __$$ChatRoomStateLoadedImplCopyWithImpl<$Res>;
factory _$$ChatRoomStateLoadedImplCopyWith(_$ChatRoomStateLoadedImpl value,
$Res Function(_$ChatRoomStateLoadedImpl) then) =
__$$ChatRoomStateLoadedImplCopyWithImpl<$Res>;
@useResult
$Res call({
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
});
$Res call(
{ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading});
$ChatRoomModelCopyWith<$Res> get chatRoom;
}
@@ -399,10 +398,9 @@ abstract class _$$ChatRoomStateLoadedImplCopyWith<$Res> {
class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res>
extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateLoadedImpl>
implements _$$ChatRoomStateLoadedImplCopyWith<$Res> {
__$$ChatRoomStateLoadedImplCopyWithImpl(
_$ChatRoomStateLoadedImpl _value,
$Res Function(_$ChatRoomStateLoadedImpl) _then,
) : super(_value, _then);
__$$ChatRoomStateLoadedImplCopyWithImpl(_$ChatRoomStateLoadedImpl _value,
$Res Function(_$ChatRoomStateLoadedImpl) _then)
: super(_value, _then);
/// Create a copy of ChatRoomState
/// with the given fields replaced by the non-null parameter values.
@@ -411,33 +409,32 @@ class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res>
$Res call({
Object? chatRoom = null,
Object? chatMessages = null,
Object? hasCard = null,
Object? isTyping = null,
Object? isLoading = null,
}) {
return _then(
_$ChatRoomStateLoadedImpl(
chatRoom:
null == chatRoom
? _value.chatRoom
: chatRoom // ignore: cast_nullable_to_non_nullable
as ChatRoomModel,
chatMessages:
null == chatMessages
? _value._chatMessages
: chatMessages // ignore: cast_nullable_to_non_nullable
as List<ChatMessageModel>,
isTyping:
null == isTyping
? _value.isTyping
: isTyping // ignore: cast_nullable_to_non_nullable
as bool,
isLoading:
null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
),
);
return _then(_$ChatRoomStateLoadedImpl(
chatRoom: null == chatRoom
? _value.chatRoom
: chatRoom // ignore: cast_nullable_to_non_nullable
as ChatRoomModel,
chatMessages: null == chatMessages
? _value._chatMessages
: chatMessages // ignore: cast_nullable_to_non_nullable
as List<ChatMessageModel>,
hasCard: null == hasCard
? _value.hasCard
: hasCard // ignore: cast_nullable_to_non_nullable
as bool,
isTyping: null == isTyping
? _value.isTyping
: isTyping // ignore: cast_nullable_to_non_nullable
as bool,
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
));
}
/// Create a copy of ChatRoomState
@@ -454,12 +451,13 @@ class __$$ChatRoomStateLoadedImplCopyWithImpl<$Res>
/// @nodoc
class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded {
const _$ChatRoomStateLoadedImpl({
required this.chatRoom,
required final List<ChatMessageModel> chatMessages,
required this.isTyping,
required this.isLoading,
}) : _chatMessages = chatMessages;
const _$ChatRoomStateLoadedImpl(
{required this.chatRoom,
required final List<ChatMessageModel> chatMessages,
required this.hasCard,
required this.isTyping,
required this.isLoading})
: _chatMessages = chatMessages;
@override
final ChatRoomModel chatRoom;
@@ -471,6 +469,8 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded {
return EqualUnmodifiableListView(_chatMessages);
}
@override
final bool hasCard;
@override
final bool isTyping;
@override
@@ -478,7 +478,7 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded {
@override
String toString() {
return 'ChatRoomState.loaded(chatRoom: $chatRoom, chatMessages: $chatMessages, isTyping: $isTyping, isLoading: $isLoading)';
return 'ChatRoomState.loaded(chatRoom: $chatRoom, chatMessages: $chatMessages, hasCard: $hasCard, isTyping: $isTyping, isLoading: $isLoading)';
}
@override
@@ -488,10 +488,9 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded {
other is _$ChatRoomStateLoadedImpl &&
(identical(other.chatRoom, chatRoom) ||
other.chatRoom == chatRoom) &&
const DeepCollectionEquality().equals(
other._chatMessages,
_chatMessages,
) &&
const DeepCollectionEquality()
.equals(other._chatMessages, _chatMessages) &&
(identical(other.hasCard, hasCard) || other.hasCard == hasCard) &&
(identical(other.isTyping, isTyping) ||
other.isTyping == isTyping) &&
(identical(other.isLoading, isLoading) ||
@@ -500,12 +499,12 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded {
@override
int get hashCode => Object.hash(
runtimeType,
chatRoom,
const DeepCollectionEquality().hash(_chatMessages),
isTyping,
isLoading,
);
runtimeType,
chatRoom,
const DeepCollectionEquality().hash(_chatMessages),
hasCard,
isTyping,
isLoading);
/// Create a copy of ChatRoomState
/// with the given fields replaced by the non-null parameter values.
@@ -514,9 +513,7 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded {
@pragma('vm:prefer-inline')
_$$ChatRoomStateLoadedImplCopyWith<_$ChatRoomStateLoadedImpl> get copyWith =>
__$$ChatRoomStateLoadedImplCopyWithImpl<_$ChatRoomStateLoadedImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -524,15 +521,15 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) {
return loaded(chatRoom, chatMessages, isTyping, isLoading);
return loaded(chatRoom, chatMessages, hasCard, isTyping, isLoading);
}
@override
@@ -541,15 +538,15 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)?
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return loaded?.call(chatRoom, chatMessages, isTyping, isLoading);
return loaded?.call(chatRoom, chatMessages, hasCard, isTyping, isLoading);
}
@override
@@ -558,17 +555,17 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)?
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {
if (loaded != null) {
return loaded(chatRoom, chatMessages, isTyping, isLoading);
return loaded(chatRoom, chatMessages, hasCard, isTyping, isLoading);
}
return orElse();
}
@@ -612,15 +609,16 @@ class _$ChatRoomStateLoadedImpl implements ChatRoomStateLoaded {
}
abstract class ChatRoomStateLoaded implements ChatRoomState {
const factory ChatRoomStateLoaded({
required final ChatRoomModel chatRoom,
required final List<ChatMessageModel> chatMessages,
required final bool isTyping,
required final bool isLoading,
}) = _$ChatRoomStateLoadedImpl;
const factory ChatRoomStateLoaded(
{required final ChatRoomModel chatRoom,
required final List<ChatMessageModel> chatMessages,
required final bool hasCard,
required final bool isTyping,
required final bool isLoading}) = _$ChatRoomStateLoadedImpl;
ChatRoomModel get chatRoom;
List<ChatMessageModel> get chatMessages;
bool get hasCard;
bool get isTyping;
bool get isLoading;
@@ -633,10 +631,9 @@ abstract class ChatRoomStateLoaded implements ChatRoomState {
/// @nodoc
abstract class _$$ChatRoomStateErrorImplCopyWith<$Res> {
factory _$$ChatRoomStateErrorImplCopyWith(
_$ChatRoomStateErrorImpl value,
$Res Function(_$ChatRoomStateErrorImpl) then,
) = __$$ChatRoomStateErrorImplCopyWithImpl<$Res>;
factory _$$ChatRoomStateErrorImplCopyWith(_$ChatRoomStateErrorImpl value,
$Res Function(_$ChatRoomStateErrorImpl) then) =
__$$ChatRoomStateErrorImplCopyWithImpl<$Res>;
@useResult
$Res call({String errorMessage});
}
@@ -645,25 +642,23 @@ abstract class _$$ChatRoomStateErrorImplCopyWith<$Res> {
class __$$ChatRoomStateErrorImplCopyWithImpl<$Res>
extends _$ChatRoomStateCopyWithImpl<$Res, _$ChatRoomStateErrorImpl>
implements _$$ChatRoomStateErrorImplCopyWith<$Res> {
__$$ChatRoomStateErrorImplCopyWithImpl(
_$ChatRoomStateErrorImpl _value,
$Res Function(_$ChatRoomStateErrorImpl) _then,
) : super(_value, _then);
__$$ChatRoomStateErrorImplCopyWithImpl(_$ChatRoomStateErrorImpl _value,
$Res Function(_$ChatRoomStateErrorImpl) _then)
: super(_value, _then);
/// Create a copy of ChatRoomState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({Object? errorMessage = null}) {
return _then(
_$ChatRoomStateErrorImpl(
errorMessage:
null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
),
);
$Res call({
Object? errorMessage = null,
}) {
return _then(_$ChatRoomStateErrorImpl(
errorMessage: null == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -699,9 +694,7 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError {
@pragma('vm:prefer-inline')
_$$ChatRoomStateErrorImplCopyWith<_$ChatRoomStateErrorImpl> get copyWith =>
__$$ChatRoomStateErrorImplCopyWithImpl<_$ChatRoomStateErrorImpl>(
this,
_$identity,
);
this, _$identity);
@override
@optionalTypeArgs
@@ -709,12 +702,12 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError {
TResult Function() $default, {
required TResult Function() loading,
required TResult Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)
loaded,
required TResult Function(String errorMessage) error,
}) {
return error(errorMessage);
@@ -726,12 +719,12 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError {
TResult? Function()? $default, {
TResult? Function()? loading,
TResult? Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)?
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)?
loaded,
TResult? Function(String errorMessage)? error,
}) {
return error?.call(errorMessage);
@@ -743,12 +736,12 @@ class _$ChatRoomStateErrorImpl implements ChatRoomStateError {
TResult Function()? $default, {
TResult Function()? loading,
TResult Function(
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool isTyping,
bool isLoading,
)?
loaded,
ChatRoomModel chatRoom,
List<ChatMessageModel> chatMessages,
bool hasCard,
bool isTyping,
bool isLoading)?
loaded,
TResult Function(String errorMessage)? error,
required TResult orElse(),
}) {

View File

@@ -12,8 +12,7 @@ part of 'chats_state.dart';
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$ChatsState {
@@ -33,17 +32,15 @@ mixin _$ChatsState {
/// @nodoc
abstract class $ChatsStateCopyWith<$Res> {
factory $ChatsStateCopyWith(
ChatsState value,
$Res Function(ChatsState) then,
) = _$ChatsStateCopyWithImpl<$Res, ChatsState>;
ChatsState value, $Res Function(ChatsState) then) =
_$ChatsStateCopyWithImpl<$Res, ChatsState>;
@useResult
$Res call({
BaseState state,
int chatsWithUnreadMessagesCount,
List<ChatRoom> chatRooms,
bool isLoadingMoreChats,
String? errorMessage,
});
$Res call(
{BaseState state,
int chatsWithUnreadMessagesCount,
List<ChatRoom> chatRooms,
bool isLoadingMoreChats,
String? errorMessage});
}
/// @nodoc
@@ -67,36 +64,28 @@ class _$ChatsStateCopyWithImpl<$Res, $Val extends ChatsState>
Object? isLoadingMoreChats = null,
Object? errorMessage = freezed,
}) {
return _then(
_value.copyWith(
state:
null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as BaseState,
chatsWithUnreadMessagesCount:
null == chatsWithUnreadMessagesCount
? _value.chatsWithUnreadMessagesCount
: chatsWithUnreadMessagesCount // ignore: cast_nullable_to_non_nullable
as int,
chatRooms:
null == chatRooms
? _value.chatRooms
: chatRooms // ignore: cast_nullable_to_non_nullable
as List<ChatRoom>,
isLoadingMoreChats:
null == isLoadingMoreChats
? _value.isLoadingMoreChats
: isLoadingMoreChats // ignore: cast_nullable_to_non_nullable
as bool,
errorMessage:
freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
)
as $Val,
);
return _then(_value.copyWith(
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as BaseState,
chatsWithUnreadMessagesCount: null == chatsWithUnreadMessagesCount
? _value.chatsWithUnreadMessagesCount
: chatsWithUnreadMessagesCount // ignore: cast_nullable_to_non_nullable
as int,
chatRooms: null == chatRooms
? _value.chatRooms
: chatRooms // ignore: cast_nullable_to_non_nullable
as List<ChatRoom>,
isLoadingMoreChats: null == isLoadingMoreChats
? _value.isLoadingMoreChats
: isLoadingMoreChats // ignore: cast_nullable_to_non_nullable
as bool,
errorMessage: freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
}
@@ -104,18 +93,16 @@ class _$ChatsStateCopyWithImpl<$Res, $Val extends ChatsState>
abstract class _$$ChatsStateImplCopyWith<$Res>
implements $ChatsStateCopyWith<$Res> {
factory _$$ChatsStateImplCopyWith(
_$ChatsStateImpl value,
$Res Function(_$ChatsStateImpl) then,
) = __$$ChatsStateImplCopyWithImpl<$Res>;
_$ChatsStateImpl value, $Res Function(_$ChatsStateImpl) then) =
__$$ChatsStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({
BaseState state,
int chatsWithUnreadMessagesCount,
List<ChatRoom> chatRooms,
bool isLoadingMoreChats,
String? errorMessage,
});
$Res call(
{BaseState state,
int chatsWithUnreadMessagesCount,
List<ChatRoom> chatRooms,
bool isLoadingMoreChats,
String? errorMessage});
}
/// @nodoc
@@ -123,9 +110,8 @@ class __$$ChatsStateImplCopyWithImpl<$Res>
extends _$ChatsStateCopyWithImpl<$Res, _$ChatsStateImpl>
implements _$$ChatsStateImplCopyWith<$Res> {
__$$ChatsStateImplCopyWithImpl(
_$ChatsStateImpl _value,
$Res Function(_$ChatsStateImpl) _then,
) : super(_value, _then);
_$ChatsStateImpl _value, $Res Function(_$ChatsStateImpl) _then)
: super(_value, _then);
/// Create a copy of ChatsState
/// with the given fields replaced by the non-null parameter values.
@@ -138,48 +124,41 @@ class __$$ChatsStateImplCopyWithImpl<$Res>
Object? isLoadingMoreChats = null,
Object? errorMessage = freezed,
}) {
return _then(
_$ChatsStateImpl(
state:
null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as BaseState,
chatsWithUnreadMessagesCount:
null == chatsWithUnreadMessagesCount
? _value.chatsWithUnreadMessagesCount
: chatsWithUnreadMessagesCount // ignore: cast_nullable_to_non_nullable
as int,
chatRooms:
null == chatRooms
? _value._chatRooms
: chatRooms // ignore: cast_nullable_to_non_nullable
as List<ChatRoom>,
isLoadingMoreChats:
null == isLoadingMoreChats
? _value.isLoadingMoreChats
: isLoadingMoreChats // ignore: cast_nullable_to_non_nullable
as bool,
errorMessage:
freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
),
);
return _then(_$ChatsStateImpl(
state: null == state
? _value.state
: state // ignore: cast_nullable_to_non_nullable
as BaseState,
chatsWithUnreadMessagesCount: null == chatsWithUnreadMessagesCount
? _value.chatsWithUnreadMessagesCount
: chatsWithUnreadMessagesCount // ignore: cast_nullable_to_non_nullable
as int,
chatRooms: null == chatRooms
? _value._chatRooms
: chatRooms // ignore: cast_nullable_to_non_nullable
as List<ChatRoom>,
isLoadingMoreChats: null == isLoadingMoreChats
? _value.isLoadingMoreChats
: isLoadingMoreChats // ignore: cast_nullable_to_non_nullable
as bool,
errorMessage: freezed == errorMessage
? _value.errorMessage
: errorMessage // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
class _$ChatsStateImpl implements _ChatsState {
_$ChatsStateImpl({
this.state = BaseState.initial,
this.chatsWithUnreadMessagesCount = 0,
final List<ChatRoom> chatRooms = const [],
this.isLoadingMoreChats = false,
this.errorMessage = null,
}) : _chatRooms = chatRooms;
_$ChatsStateImpl(
{this.state = BaseState.initial,
this.chatsWithUnreadMessagesCount = 0,
final List<ChatRoom> chatRooms = const [],
this.isLoadingMoreChats = false,
this.errorMessage = null})
: _chatRooms = chatRooms;
@override
@JsonKey()
@@ -214,16 +193,12 @@ class _$ChatsStateImpl implements _ChatsState {
(other.runtimeType == runtimeType &&
other is _$ChatsStateImpl &&
(identical(other.state, state) || other.state == state) &&
(identical(
other.chatsWithUnreadMessagesCount,
chatsWithUnreadMessagesCount,
) ||
(identical(other.chatsWithUnreadMessagesCount,
chatsWithUnreadMessagesCount) ||
other.chatsWithUnreadMessagesCount ==
chatsWithUnreadMessagesCount) &&
const DeepCollectionEquality().equals(
other._chatRooms,
_chatRooms,
) &&
const DeepCollectionEquality()
.equals(other._chatRooms, _chatRooms) &&
(identical(other.isLoadingMoreChats, isLoadingMoreChats) ||
other.isLoadingMoreChats == isLoadingMoreChats) &&
(identical(other.errorMessage, errorMessage) ||
@@ -232,13 +207,12 @@ class _$ChatsStateImpl implements _ChatsState {
@override
int get hashCode => Object.hash(
runtimeType,
state,
chatsWithUnreadMessagesCount,
const DeepCollectionEquality().hash(_chatRooms),
isLoadingMoreChats,
errorMessage,
);
runtimeType,
state,
chatsWithUnreadMessagesCount,
const DeepCollectionEquality().hash(_chatRooms),
isLoadingMoreChats,
errorMessage);
/// Create a copy of ChatsState
/// with the given fields replaced by the non-null parameter values.
@@ -250,13 +224,12 @@ class _$ChatsStateImpl implements _ChatsState {
}
abstract class _ChatsState implements ChatsState {
factory _ChatsState({
final BaseState state,
final int chatsWithUnreadMessagesCount,
final List<ChatRoom> chatRooms,
final bool isLoadingMoreChats,
final String? errorMessage,
}) = _$ChatsStateImpl;
factory _ChatsState(
{final BaseState state,
final int chatsWithUnreadMessagesCount,
final List<ChatRoom> chatRooms,
final bool isLoadingMoreChats,
final String? errorMessage}) = _$ChatsStateImpl;
@override
BaseState get state;

View File

@@ -13,7 +13,10 @@ import 'package:eatvio_app/features/chat/presentation/widgets/chat_bubble_widget
import 'package:eatvio_app/core/locator_service.dart';
import 'package:eatvio_app/core/theme/custom_text_style.dart';
import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/features/chat/presentation/widgets/notification_banner.dart';
import 'package:eatvio_app/features/chat/presentation/widgets/order_card.dart';
import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart';
import 'package:eatvio_app/features/order_info/presentation/info_by_order_screen.dart';
import 'package:eatvio_app/features/plans/enums/chosen_plan_state_enum.dart';
import 'package:eatvio_app/features/user_details/presentation/user_details_screen.dart';
import 'package:eatvio_app/generated/l10n.dart';
@@ -26,10 +29,7 @@ import 'package:visibility_detector/visibility_detector.dart';
class ChatScreen extends StatefulWidget {
final String chatId;
const ChatScreen({
required this.chatId,
super.key,
});
const ChatScreen({required this.chatId, super.key});
@override
State<ChatScreen> createState() => _ChatScreenState();
@@ -63,6 +63,7 @@ class _ChatScreenState extends State<ChatScreen> {
super.dispose();
}
@override
Widget build(BuildContext context) {
return BlocProvider<ChatRoomCubit>(
create: (BuildContext context) => chatRoomCubit,
@@ -72,14 +73,9 @@ class _ChatScreenState extends State<ChatScreen> {
if (state is ChatRoomStateLoaded) {
return _buildChat(context, state);
} else if (state is ChatRoomStateError) {
return Scaffold(
appBar: AppBar(),
body: DataErrorWidget(onReload: () => chatRoomCubit.initChat(widget.chatId)),
);
return Scaffold(appBar: AppBar(), body: DataErrorWidget(onReload: () => chatRoomCubit.initChat(widget.chatId)));
} else {
return Scaffold(
body: const Loader(),
);
return const Scaffold(body: Loader());
}
},
),
@@ -90,61 +86,84 @@ class _ChatScreenState extends State<ChatScreen> {
final chosenPlan = state.chatRoom.chosenPlan;
final amIConsultant = chosenPlan?.consultantId == state.chatRoom.users.sender.id;
final showAboutOrderButton = showableChatBadgeStates.contains(chosenPlan?.chosenPlanState);
BannerType? bannerType;
if (amIConsultant && state.hasCard) {
bannerType = BannerType.card;
} else if (amIConsultant && chosenPlan?.chosenPlanState == ChosenPlanStateEnum.stateInCoordination) {
bannerType = BannerType.date;
} else if (!amIConsultant &&
(chosenPlan?.chosenPlanState == ChosenPlanStateEnum.stateStartDateHasBeenSet ||
chosenPlan?.chosenPlanState == ChosenPlanStateEnum.statePendingPayment)) {
bannerType = BannerType.payment;
}
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: AppBar(
titleSpacing: 0,
backgroundColor: appTheme.gray100,
centerTitle: false,
title: Row(
children: [
if (state.chatRoom.users.receiver.profilePhotoUrl != null)
CircleAvatar(
radius: 20,
foregroundImage: NetworkImage(state.chatRoom.users.receiver.profilePhotoUrl!),
title: GestureDetector(
onTap: () {
GoRouter.of(context).pushNamed(
'profileScreen',
extra: Author(
authorSlug: state.chatRoom.users.receiver.slug,
authorName: state.chatRoom.users.receiver.name,
authorProfileIcon: state.chatRoom.users.receiver.profilePhotoUrl ?? '',
authorIsMe: false,
),
if (state.chatRoom.users.receiver.profilePhotoUrl == null)
Container(
width: 40,
height: 40,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFEBF4FF),
shape: BoxShape.circle,
);
},
child: Row(
children: [
if (state.chatRoom.users.receiver.profilePhotoUrl != null)
CircleAvatar(
radius: 20,
foregroundImage: NetworkImage(state.chatRoom.users.receiver.profilePhotoUrl!),
),
child: Text(
state.chatRoom.users.receiver.name.split(' ').first[0] + state.chatRoom.users.receiver.name.split(' ')[1][0],
style: TextStyle(
color: Color(0xFF7F9CF5),
fontWeight: FontWeight.w400,
fontSize: 20,
if (state.chatRoom.users.receiver.profilePhotoUrl == null)
Container(
width: 40,
height: 40,
alignment: Alignment.center,
decoration: const BoxDecoration(
color: Color(0xFFEBF4FF),
shape: BoxShape.circle,
),
child: Text(
state.chatRoom.users.receiver.name.split(' ').first[0] + state.chatRoom.users.receiver.name.split(' ')[1][0],
style: const TextStyle(
color: Color(0xFF7F9CF5),
fontWeight: FontWeight.w400,
fontSize: 20,
),
),
),
const SizedBox(width: 16),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
state.chatRoom.users.receiver.name,
style: CustomTextStyles.titleSmallBold.copyWith(
color: PrimaryColors().black,
),
),
AnimatedCrossFade(
firstChild: Text(
'Печатает...',
style: CustomTextStyles.bodySmallMulishPrimary,
),
firstCurve: Curves.easeIn,
secondCurve: Curves.easeOut,
secondChild: const SizedBox.shrink(),
crossFadeState: state.isTyping ? CrossFadeState.showFirst : CrossFadeState.showSecond,
duration: const Duration(milliseconds: 150),
),
],
),
SizedBox(width: 16),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
state.chatRoom.users.receiver.name,
style: CustomTextStyles.titleSmallBold.copyWith(
color: PrimaryColors().black,
),
),
AnimatedCrossFade(
firstChild: Text(
'Печатает...',
style: CustomTextStyles.bodySmallMulishPrimary,
),
firstCurve: Curves.easeIn,
secondCurve: Curves.easeOut,
secondChild: const SizedBox.shrink(),
crossFadeState: state.isTyping ? CrossFadeState.showFirst : CrossFadeState.showSecond,
duration: Duration(milliseconds: 150),
),
],
),
],
],
),
),
),
body: SafeArea(
@@ -158,22 +177,19 @@ class _ChatScreenState extends State<ChatScreen> {
color: appTheme.whiteA700,
width: double.maxFinite,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
physics: const BouncingScrollPhysics(),
controller: scrollController,
reverse: true,
child: Column(
children: [
SizedBox(height: 16),
const SizedBox(height: 16),
ListView.builder(
physics: NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(),
reverse: true,
shrinkWrap: true,
itemBuilder: (context, index) {
if (index == state.chatMessages.length) {
return Padding(
padding: const EdgeInsets.all(8),
child: const Loader(),
);
return const Padding(padding: EdgeInsets.all(8), child: Loader());
}
if ((index + 1 != state.chatMessages.length &&
@@ -188,18 +204,16 @@ class _ChatScreenState extends State<ChatScreen> {
onVisibilityChanged: (VisibilityInfo info) {
if (!state.chatMessages[index].isRead && !isCurrentUserAuthor && info.visibleFraction > 0) {
unreadMessagesIdsCopy.add((id: state.chatMessages[index].id, index: index));
EasyDebounce.debounce(
'mark_as_read',
Duration(milliseconds: 500),
() async {
final result = await context.read<ChatRoomCubit>().markMessagesAsRead(state.chatRoom.id, unreadMessagesIdsCopy);
if (!result) return;
context
.read<ChatsCubit>()
.reduceUnreadMessagesCount(chatId: state.chatRoom.id, count: unreadMessagesIdsCopy.length);
unreadMessagesIdsCopy.clear();
},
);
EasyDebounce.debounce('mark_as_read', const Duration(milliseconds: 500), () async {
final result = await context.read<ChatRoomCubit>().markMessagesAsRead(state.chatRoom.id, unreadMessagesIdsCopy);
if (!result) return;
if (!context.mounted) return;
context.read<ChatsCubit>().reduceUnreadMessagesCount(
chatId: state.chatRoom.id,
count: unreadMessagesIdsCopy.length,
);
unreadMessagesIdsCopy.clear();
});
}
},
child: ChatBubbleWidget(
@@ -219,16 +233,13 @@ class _ChatScreenState extends State<ChatScreen> {
onVisibilityChanged: (VisibilityInfo info) {
if (!state.chatMessages[index].isRead && !isCurrentUserAuthor && info.visibleFraction > 0) {
unreadMessagesIds.add((id: state.chatMessages[index].id, index: index));
EasyDebounce.debounce(
'mark_as_read',
Duration(milliseconds: 500),
() async {
final result = await context.read<ChatRoomCubit>().markMessagesAsRead(state.chatRoom.id, unreadMessagesIds);
if (!result) return;
context.read<ChatsCubit>().reduceUnreadMessagesCount(chatId: state.chatRoom.id, count: unreadMessagesIds.length);
unreadMessagesIds.clear();
},
);
EasyDebounce.debounce('mark_as_read', const Duration(milliseconds: 500), () async {
final result = await context.read<ChatRoomCubit>().markMessagesAsRead(state.chatRoom.id, unreadMessagesIds);
if (!result) return;
if (!context.mounted) return;
context.read<ChatsCubit>().reduceUnreadMessagesCount(chatId: state.chatRoom.id, count: unreadMessagesIds.length);
unreadMessagesIds.clear();
});
}
},
child: ChatBubbleWidget(
@@ -242,7 +253,7 @@ class _ChatScreenState extends State<ChatScreen> {
},
itemCount: state.chatMessages.length + (state.isLoading ? 1 : 0),
),
SizedBox(height: 16),
const SizedBox(height: 16),
if (chosenPlan != null) ...[
OrderCard(
plan: chosenPlan.plan,
@@ -252,15 +263,15 @@ class _ChatScreenState extends State<ChatScreen> {
await context.read<ChatRoomCubit>().cancelChosenPlan(chatId: state.chatRoom.id, planId: chosenPlan.id);
},
),
if (amIConsultant) ...[
if (amIConsultant)
Padding(
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 16),
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
child: CustomOutlinedButton(
text: S.current.user_info,
height: 52,
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.whiteA700),
buttonStyle: ButtonStyle(
side: WidgetStatePropertyAll(BorderSide.none),
side: const WidgetStatePropertyAll(BorderSide.none),
backgroundColor: WidgetStatePropertyAll(appTheme.blueA400),
),
onPressed: () async {
@@ -268,7 +279,8 @@ class _ChatScreenState extends State<ChatScreen> {
},
),
),
],
if (bannerType != null)
Padding(padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), child: NotificationBanner(bannerType: bannerType)),
],
],
),
@@ -276,11 +288,11 @@ class _ChatScreenState extends State<ChatScreen> {
),
),
Container(
padding: EdgeInsets.symmetric(vertical: 8),
padding: const EdgeInsets.symmetric(vertical: 8),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
SizedBox(width: 8),
const SizedBox(width: 8),
InkWell(
onTap: () async {
FilePickerResult? result = await FilePicker.platform.pickFiles(
@@ -310,102 +322,67 @@ class _ChatScreenState extends State<ChatScreen> {
if (result != null) {
List<File> files = result.paths.map((path) => File(path!)).toList();
await chatRoomCubit.sendMessage(
chatId: widget.chatId,
files: files,
);
await chatRoomCubit.sendMessage(chatId: widget.chatId, files: files);
}
},
customBorder: CircleBorder(),
customBorder: const CircleBorder(),
child: Ink(
height: 40,
width: 40,
child: Transform.rotate(
angle: pi / 4,
child: Icon(
Icons.attach_file_rounded,
size: 30,
color: Color(0xFF858E99),
),
),
child: Transform.rotate(angle: pi / 4, child: const Icon(Icons.attach_file_rounded, size: 30, color: Color(0xFF858E99))),
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
Expanded(
child: SizedBox(
height: 40,
child: TextFormField(
expands: true,
textCapitalization: TextCapitalization.sentences,
controller: textEditingController,
maxLines: null,
minLines: null,
keyboardType: TextInputType.multiline,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w400, color: Colors.black, height: 1),
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w400, color: Colors.black, height: 1),
decoration: InputDecoration(
isDense: true,
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 10),
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
hintText: 'Сообщение',
hintStyle: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
height: 1,
color: Color(0xFFAEAEB2),
),
hintStyle: const TextStyle(fontSize: 14, fontWeight: FontWeight.w400, height: 1, color: Color(0xFFAEAEB2)),
filled: true,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(100),
borderSide: BorderSide(
color: Color(0xFFD1D1D6),
width: 1,
),
),
borderRadius: BorderRadius.circular(100), borderSide: const BorderSide(color: Color(0xFFD1D1D6), width: 1)),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(100),
borderSide: BorderSide(
color: Color(0xFFD1D1D6),
width: 1,
),
borderSide: const BorderSide(color: Color(0xFFD1D1D6), width: 1),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(100),
borderSide: BorderSide(
color: Color(0xFFD1D1D6),
width: 1,
),
borderSide: const BorderSide(color: Color(0xFFD1D1D6), width: 1),
),
),
),
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
InkWell(
customBorder: CircleBorder(),
customBorder: const CircleBorder(),
onTap: () {
if (textEditingController.text.isNotEmpty) {
chatRoomCubit.sendMessage(
chatId: widget.chatId,
data: textEditingController.text.trim(),
);
chatRoomCubit.sendMessage(chatId: widget.chatId, data: textEditingController.text.trim());
setState(() {
textEditingController.clear();
});
}
},
child: Ink(
decoration: BoxDecoration(
color: appTheme.blueA400,
shape: BoxShape.circle,
),
decoration: BoxDecoration(color: appTheme.blueA400, shape: BoxShape.circle),
height: 40,
width: 40,
child: Icon(
Icons.arrow_upward_rounded,
size: 24,
color: Colors.white,
),
child: const Icon(Icons.arrow_upward_rounded, size: 24, color: Colors.white),
),
),
SizedBox(width: 8),
const SizedBox(width: 8),
],
),
),
@@ -413,11 +390,14 @@ class _ChatScreenState extends State<ChatScreen> {
),
if (showAboutOrderButton)
Positioned(
top: 8,
right: 15,
left: 16,
child: AboutOrderButton(),
),
top: 8,
right: 15,
left: 16,
child: AboutOrderButton(
onTap: () {
GoRouter.of(context).push(InfoByOrderScreen.path, extra: {'planId': state.chatRoom.chosenPlan?.id});
},
)),
],
),
),
@@ -428,16 +408,7 @@ class _ChatScreenState extends State<ChatScreen> {
return Center(
child: Padding(
padding: const EdgeInsets.only(top: 32),
child: Text(
DateFormat.yMMMMd('RU').format(
date,
),
style: const TextStyle(
height: 1,
color: Color(0xFF8393A1),
fontWeight: FontWeight.w500,
),
),
child: Text(DateFormat.yMMMMd('RU').format(date), style: const TextStyle(height: 1, color: Color(0xFF8393A1), fontWeight: FontWeight.w500)),
),
);
}

Some files were not shown because too many files have changed in this diff Show More