2 Commits

Author SHA1 Message Date
5bdfb9f766 wip: bloc for files 2024-08-23 20:49:19 +02:00
54b777237f wip: bloc for files 2024-08-17 11:41:38 +02:00
131 changed files with 3964 additions and 4401 deletions

View File

@@ -25,16 +25,15 @@ if (flutterVersionName == null) {
android { android {
namespace "eu.mhsl.marianum.mobile.client" namespace "eu.mhsl.marianum.mobile.client"
compileSdk flutter.compileSdkVersion compileSdk flutter.compileSdkVersion
ndkVersion "27.0.12077973" ndkVersion flutter.ndkVersion
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_17 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_1_8
coreLibraryDesugaringEnabled true
} }
kotlinOptions { kotlinOptions {
jvmTarget = '17' jvmTarget = '1.8'
} }
sourceSets { sourceSets {
@@ -42,8 +41,11 @@ android {
} }
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "eu.mhsl.marianum.mobile.client" applicationId "eu.mhsl.marianum.mobile.client"
minSdkVersion 26 // You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
@@ -64,6 +66,5 @@ flutter {
} }
dependencies { dependencies {
implementation 'com.android.support:multidex:2.0.1' implementation 'com.android.support:multidex:1.0.3'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
} }

View File

@@ -1,6 +1,3 @@
org.gradle.jvmargs=-Xmx4G org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false

View File

@@ -1,7 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@@ -19,9 +19,8 @@ pluginManagement {
plugins { plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.9.1" apply false id "com.android.application" version "7.3.0" apply false
id "com.android.library" version "8.9.1" apply false id "org.jetbrains.kotlin.android" version "1.8.10" apply false
id "org.jetbrains.kotlin.android" version "2.1.10" apply false
} }
include ":app" include ":app"

View File

@@ -1,29 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIFBTCCAu2gAwIBAgIQWgDyEtjUtIDzkkFX6imDBTANBgkqhkiG9w0BAQsFADBP
MQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFy
Y2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMTAeFw0yNDAzMTMwMDAwMDBa
Fw0yNzAzMTIyMzU5NTlaMDMxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBF
bmNyeXB0MQwwCgYDVQQDEwNSMTMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQClZ3CN0FaBZBUXYc25BtStGZCMJlA3mBZjklTb2cyEBZPs0+wIG6BgUUNI
fSvHSJaetC3ancgnO1ehn6vw1g7UDjDKb5ux0daknTI+WE41b0VYaHEX/D7YXYKg
L7JRbLAaXbhZzjVlyIuhrxA3/+OcXcJJFzT/jCuLjfC8cSyTDB0FxLrHzarJXnzR
yQH3nAP2/Apd9Np75tt2QnDr9E0i2gB3b9bJXxf92nUupVcM9upctuBzpWjPoXTi
dYJ+EJ/B9aLrAek4sQpEzNPCifVJNYIKNLMc6YjCR06CDgo28EdPivEpBHXazeGa
XP9enZiVuppD0EqiFwUBBDDTMrOPAgMBAAGjgfgwgfUwDgYDVR0PAQH/BAQDAgGG
MB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATASBgNVHRMBAf8ECDAGAQH/
AgEAMB0GA1UdDgQWBBTnq58PLDOgU9NeT3jIsoQOO9aSMzAfBgNVHSMEGDAWgBR5
tFnme7bl5AFzgAiIyBpY9umbbjAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAKG
Fmh0dHA6Ly94MS5pLmxlbmNyLm9yZy8wEwYDVR0gBAwwCjAIBgZngQwBAgEwJwYD
VR0fBCAwHjAcoBqgGIYWaHR0cDovL3gxLmMubGVuY3Iub3JnLzANBgkqhkiG9w0B
AQsFAAOCAgEAUTdYUqEimzW7TbrOypLqCfL7VOwYf/Q79OH5cHLCZeggfQhDconl
k7Kgh8b0vi+/XuWu7CN8n/UPeg1vo3G+taXirrytthQinAHGwc/UdbOygJa9zuBc
VyqoH3CXTXDInT+8a+c3aEVMJ2St+pSn4ed+WkDp8ijsijvEyFwE47hulW0Ltzjg
9fOV5Pmrg/zxWbRuL+k0DBDHEJennCsAen7c35Pmx7jpmJ/HtgRhcnz0yjSBvyIw
6L1QIupkCv2SBODT/xDD3gfQQyKv6roV4G2EhfEyAsWpmojxjCUCGiyg97FvDtm/
NK2LSc9lybKxB73I2+P2G3CaWpvvpAiHCVu30jW8GCxKdfhsXtnIy2imskQqVZ2m
0Pmxobb28Tucr7xBK7CtwvPrb79os7u2XP3O5f9b/H66GNyRrglRXlrYjI1oGYL/
f4I1n/Sgusda6WvA6C190kxjU15Y12mHU4+BxyR9cx2hhGS9fAjMZKJss28qxvz6
Axu4CaDmRNZpK/pQrXF17yXCXkmEWgvSOEZy6Z9pcbLIVEGckV/iVeq0AOo2pkg9
p4QRIy0tK2diRENLSF2KysFwbY6B26BFeFs3v1sYVRhFW9nLkOrQVporCS0KyZmf
wVD89qSTlnctLcZnIavjKsKUu1nA1iU0yYMdYepKR7lWbnwhdx3ewok=
-----END CERTIFICATE-----

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View File

@@ -1,9 +0,0 @@
flutter_launcher_icons:
android: true
ios: true
remove_alpha_ios: true
image_path_android: "assets/logo/icon/ic_launcher.png"
image_path_ios: "assets/logo/icon/1024.png"
adaptive_icon_background: "assets/logo/icon/ic_launcher_adaptive_back.png" # only available for Android 8.0 devices and above
adaptive_icon_foreground: "assets/logo/icon/ic_launcher_adaptive_fore.png" # only available for Android 8.0 devices and above
min_sdk_android: 16 # android min sdk min:16, default 21

BIN
ios/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -21,6 +21,6 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
<string>13.0</string> <string>11.0</string>
</dict> </dict>
</plist> </plist>

View File

@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
platform :ios, '15.0' platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -31,8 +31,6 @@ target 'Runner' do
use_frameworks! use_frameworks!
use_modular_headers! use_modular_headers!
pod 'PhoneNumberKit', '~> 3.7.6'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
# target 'RunnerTests' do # target 'RunnerTests' do
# inherit! :search_paths # inherit! :search_paths

View File

@@ -1,190 +1,185 @@
PODS: PODS:
- connectivity_plus (0.0.1): - better_open_file (0.0.1):
- Flutter - Flutter
- device_info_plus (0.0.1): - device_info_plus (0.0.1):
- Flutter - Flutter
- DKImagePickerController/Core (4.3.9): - DKImagePickerController/Core (4.3.4):
- DKImagePickerController/ImageDataManager - DKImagePickerController/ImageDataManager
- DKImagePickerController/Resource - DKImagePickerController/Resource
- DKImagePickerController/ImageDataManager (4.3.9) - DKImagePickerController/ImageDataManager (4.3.4)
- DKImagePickerController/PhotoGallery (4.3.9): - DKImagePickerController/PhotoGallery (4.3.4):
- DKImagePickerController/Core - DKImagePickerController/Core
- DKPhotoGallery - DKPhotoGallery
- DKImagePickerController/Resource (4.3.9) - DKImagePickerController/Resource (4.3.4)
- DKPhotoGallery (0.0.19): - DKPhotoGallery (0.0.17):
- DKPhotoGallery/Core (= 0.0.19) - DKPhotoGallery/Core (= 0.0.17)
- DKPhotoGallery/Model (= 0.0.19) - DKPhotoGallery/Model (= 0.0.17)
- DKPhotoGallery/Preview (= 0.0.19) - DKPhotoGallery/Preview (= 0.0.17)
- DKPhotoGallery/Resource (= 0.0.19) - DKPhotoGallery/Resource (= 0.0.17)
- SDWebImage - SDWebImage
- SwiftyGif - SwiftyGif
- DKPhotoGallery/Core (0.0.19): - DKPhotoGallery/Core (0.0.17):
- DKPhotoGallery/Model - DKPhotoGallery/Model
- DKPhotoGallery/Preview - DKPhotoGallery/Preview
- SDWebImage - SDWebImage
- SwiftyGif - SwiftyGif
- DKPhotoGallery/Model (0.0.19): - DKPhotoGallery/Model (0.0.17):
- SDWebImage - SDWebImage
- SwiftyGif - SwiftyGif
- DKPhotoGallery/Preview (0.0.19): - DKPhotoGallery/Preview (0.0.17):
- DKPhotoGallery/Model - DKPhotoGallery/Model
- DKPhotoGallery/Resource - DKPhotoGallery/Resource
- SDWebImage - SDWebImage
- SwiftyGif - SwiftyGif
- DKPhotoGallery/Resource (0.0.19): - DKPhotoGallery/Resource (0.0.17):
- SDWebImage - SDWebImage
- SwiftyGif - SwiftyGif
- emoji_picker_flutter (0.0.1): - fast_rsa (0.6.0):
- Flutter
- fast_rsa (0.7.0):
- Flutter - Flutter
- file_picker (0.0.1): - file_picker (0.0.1):
- DKImagePickerController/PhotoGallery - DKImagePickerController/PhotoGallery
- Flutter - Flutter
- Firebase/CoreOnly (12.4.0): - Firebase/CoreOnly (10.12.0):
- FirebaseCore (~> 12.4.0) - FirebaseCore (= 10.12.0)
- Firebase/InAppMessaging (12.4.0): - Firebase/InAppMessaging (10.12.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseInAppMessaging (~> 12.4.0-beta) - FirebaseInAppMessaging (~> 10.12.0-beta)
- Firebase/Messaging (12.4.0): - Firebase/Messaging (10.12.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseMessaging (~> 12.4.0) - FirebaseMessaging (~> 10.12.0)
- firebase_core (4.2.1): - firebase_core (2.15.1):
- Firebase/CoreOnly (= 12.4.0) - Firebase/CoreOnly (= 10.12.0)
- Flutter - Flutter
- firebase_in_app_messaging (0.9.0-4): - firebase_in_app_messaging (0.7.3-5):
- Firebase/InAppMessaging (= 12.4.0) - Firebase/InAppMessaging (= 10.12.0)
- firebase_core - firebase_core
- Flutter - Flutter
- firebase_messaging (16.0.4): - firebase_messaging (14.6.6):
- Firebase/Messaging (= 12.4.0) - Firebase/Messaging (= 10.12.0)
- firebase_core - firebase_core
- Flutter - Flutter
- FirebaseABTesting (12.4.0): - FirebaseABTesting (10.13.0):
- FirebaseCore (~> 12.4.0) - FirebaseCore (~> 10.0)
- FirebaseCore (12.4.0): - FirebaseCore (10.12.0):
- FirebaseCoreInternal (~> 12.4.0) - FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/Logger (~> 8.1) - GoogleUtilities/Logger (~> 7.8)
- FirebaseCoreInternal (12.4.0): - FirebaseCoreInternal (10.13.0):
- "GoogleUtilities/NSData+zlib (~> 8.1)" - "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseInAppMessaging (12.4.0-beta): - FirebaseInAppMessaging (10.12.0-beta):
- FirebaseABTesting (~> 12.4.0) - FirebaseABTesting (~> 10.0)
- FirebaseCore (~> 12.4.0) - FirebaseCore (~> 10.0)
- FirebaseInstallations (~> 12.4.0) - FirebaseInstallations (~> 10.0)
- GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 8.1) - nanopb (< 2.30910.0, >= 2.30908.0)
- nanopb (~> 3.30910.0) - FirebaseInstallations (10.13.0):
- FirebaseInstallations (12.4.0): - FirebaseCore (~> 10.0)
- FirebaseCore (~> 12.4.0) - GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/UserDefaults (~> 7.8)
- GoogleUtilities/UserDefaults (~> 8.1) - PromisesObjC (~> 2.1)
- PromisesObjC (~> 2.4) - FirebaseMessaging (10.12.0):
- FirebaseMessaging (12.4.0): - FirebaseCore (~> 10.0)
- FirebaseCore (~> 12.4.0) - FirebaseInstallations (~> 10.0)
- FirebaseInstallations (~> 12.4.0) - GoogleDataTransport (~> 9.2)
- GoogleDataTransport (~> 10.1) - GoogleUtilities/AppDelegateSwizzler (~> 7.8)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1) - GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/Reachability (~> 7.8)
- GoogleUtilities/Reachability (~> 8.1) - GoogleUtilities/UserDefaults (~> 7.8)
- GoogleUtilities/UserDefaults (~> 8.1) - nanopb (< 2.30910.0, >= 2.30908.0)
- nanopb (~> 3.30910.0)
- Flutter (1.0.0) - Flutter (1.0.0)
- flutter_app_badge (2.0.0): - flutter_app_badger (1.3.0):
- Flutter - Flutter
- flutter_local_notifications (0.0.1): - flutter_local_notifications (0.0.1):
- Flutter - Flutter
- flutter_native_splash (2.4.3): - flutter_native_splash (0.0.1):
- Flutter - Flutter
- GoogleDataTransport (10.1.0): - fluttertoast (0.0.2):
- nanopb (~> 3.30910.0) - Flutter
- PromisesObjC (~> 2.4) - Toast
- GoogleUtilities/AppDelegateSwizzler (8.1.0): - FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- GoogleDataTransport (9.2.5):
- GoogleUtilities/Environment (~> 7.7)
- nanopb (< 2.30910.0, >= 2.30908.0)
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/AppDelegateSwizzler (7.11.5):
- GoogleUtilities/Environment - GoogleUtilities/Environment
- GoogleUtilities/Logger - GoogleUtilities/Logger
- GoogleUtilities/Network - GoogleUtilities/Network
- GoogleUtilities/Privacy - GoogleUtilities/Environment (7.11.5):
- GoogleUtilities/Environment (8.1.0): - PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Privacy - GoogleUtilities/Logger (7.11.5):
- GoogleUtilities/Logger (8.1.0):
- GoogleUtilities/Environment - GoogleUtilities/Environment
- GoogleUtilities/Privacy - GoogleUtilities/Network (7.11.5):
- GoogleUtilities/Network (8.1.0):
- GoogleUtilities/Logger - GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib" - "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Privacy
- GoogleUtilities/Reachability - GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (8.1.0)": - "GoogleUtilities/NSData+zlib (7.11.5)"
- GoogleUtilities/Privacy - GoogleUtilities/Reachability (7.11.5):
- GoogleUtilities/Privacy (8.1.0)
- GoogleUtilities/Reachability (8.1.0):
- GoogleUtilities/Logger - GoogleUtilities/Logger
- GoogleUtilities/Privacy - GoogleUtilities/UserDefaults (7.11.5):
- GoogleUtilities/UserDefaults (8.1.0):
- GoogleUtilities/Logger - GoogleUtilities/Logger
- GoogleUtilities/Privacy
- image_picker_ios (0.0.1): - image_picker_ios (0.0.1):
- Flutter - Flutter
- in_app_review (2.0.0): - libphonenumber_plugin (0.0.1):
- Flutter - Flutter
- nanopb (3.30910.0): - PhoneNumberKit
- nanopb/decode (= 3.30910.0) - nanopb (2.30909.0):
- nanopb/encode (= 3.30910.0) - nanopb/decode (= 2.30909.0)
- nanopb/decode (3.30910.0) - nanopb/encode (= 2.30909.0)
- nanopb/encode (3.30910.0) - nanopb/decode (2.30909.0)
- open_filex (0.0.2): - nanopb/encode (2.30909.0)
- Flutter - package_info (0.0.1):
- package_info_plus (0.4.5):
- Flutter - Flutter
- path_provider_foundation (0.0.1): - path_provider_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- PhoneNumberKit (3.7.11): - PhoneNumberKit (3.6.7):
- PhoneNumberKit/PhoneNumberKitCore (= 3.7.11) - PhoneNumberKit/PhoneNumberKitCore (= 3.6.7)
- PhoneNumberKit/UIKit (= 3.7.11) - PhoneNumberKit/UIKit (= 3.6.7)
- PhoneNumberKit/PhoneNumberKitCore (3.7.11) - PhoneNumberKit/PhoneNumberKitCore (3.6.7)
- PhoneNumberKit/UIKit (3.7.11): - PhoneNumberKit/UIKit (3.6.7):
- PhoneNumberKit/PhoneNumberKitCore - PhoneNumberKit/PhoneNumberKitCore
- PromisesObjC (2.4.0) - PromisesObjC (2.3.1)
- SDWebImage (5.21.2): - SDWebImage (5.17.0):
- SDWebImage/Core (= 5.21.2) - SDWebImage/Core (= 5.17.0)
- SDWebImage/Core (5.21.2) - SDWebImage/Core (5.17.0)
- share_plus (0.0.1): - share_plus (0.0.1):
- Flutter - Flutter
- shared_preferences_foundation (0.0.1): - shared_preferences_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- sqflite_darwin (0.0.4): - sqflite (0.0.3):
- Flutter - Flutter
- FlutterMacOS - FMDB (>= 2.7.5)
- SwiftyGif (5.4.5) - SwiftyGif (5.4.4)
- syncfusion_flutter_pdfviewer (0.0.1): - syncfusion_flutter_pdfviewer (0.0.1):
- Flutter - Flutter
- Toast (4.0.0)
- url_launcher_ios (0.0.1): - url_launcher_ios (0.0.1):
- Flutter - Flutter
DEPENDENCIES: DEPENDENCIES:
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - better_open_file (from `.symlinks/plugins/better_open_file/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- emoji_picker_flutter (from `.symlinks/plugins/emoji_picker_flutter/ios`)
- fast_rsa (from `.symlinks/plugins/fast_rsa/ios`) - fast_rsa (from `.symlinks/plugins/fast_rsa/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_in_app_messaging (from `.symlinks/plugins/firebase_in_app_messaging/ios`) - firebase_in_app_messaging (from `.symlinks/plugins/firebase_in_app_messaging/ios`)
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- flutter_app_badge (from `.symlinks/plugins/flutter_app_badge/ios`) - flutter_app_badger (from `.symlinks/plugins/flutter_app_badger/ios`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- in_app_review (from `.symlinks/plugins/in_app_review/ios`) - libphonenumber_plugin (from `.symlinks/plugins/libphonenumber_plugin/ios`)
- open_filex (from `.symlinks/plugins/open_filex/ios`) - package_info (from `.symlinks/plugins/package_info/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- PhoneNumberKit (~> 3.7.6)
- share_plus (from `.symlinks/plugins/share_plus/ios`) - share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`) - sqflite (from `.symlinks/plugins/sqflite/ios`)
- syncfusion_flutter_pdfviewer (from `.symlinks/plugins/syncfusion_flutter_pdfviewer/ios`) - syncfusion_flutter_pdfviewer (from `.symlinks/plugins/syncfusion_flutter_pdfviewer/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
@@ -199,6 +194,7 @@ SPEC REPOS:
- FirebaseInAppMessaging - FirebaseInAppMessaging
- FirebaseInstallations - FirebaseInstallations
- FirebaseMessaging - FirebaseMessaging
- FMDB
- GoogleDataTransport - GoogleDataTransport
- GoogleUtilities - GoogleUtilities
- nanopb - nanopb
@@ -206,14 +202,13 @@ SPEC REPOS:
- PromisesObjC - PromisesObjC
- SDWebImage - SDWebImage
- SwiftyGif - SwiftyGif
- Toast
EXTERNAL SOURCES: EXTERNAL SOURCES:
connectivity_plus: better_open_file:
:path: ".symlinks/plugins/connectivity_plus/ios" :path: ".symlinks/plugins/better_open_file/ios"
device_info_plus: device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios" :path: ".symlinks/plugins/device_info_plus/ios"
emoji_picker_flutter:
:path: ".symlinks/plugins/emoji_picker_flutter/ios"
fast_rsa: fast_rsa:
:path: ".symlinks/plugins/fast_rsa/ios" :path: ".symlinks/plugins/fast_rsa/ios"
file_picker: file_picker:
@@ -226,73 +221,74 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/firebase_messaging/ios" :path: ".symlinks/plugins/firebase_messaging/ios"
Flutter: Flutter:
:path: Flutter :path: Flutter
flutter_app_badge: flutter_app_badger:
:path: ".symlinks/plugins/flutter_app_badge/ios" :path: ".symlinks/plugins/flutter_app_badger/ios"
flutter_local_notifications: flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios" :path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_native_splash: flutter_native_splash:
:path: ".symlinks/plugins/flutter_native_splash/ios" :path: ".symlinks/plugins/flutter_native_splash/ios"
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
image_picker_ios: image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios" :path: ".symlinks/plugins/image_picker_ios/ios"
in_app_review: libphonenumber_plugin:
:path: ".symlinks/plugins/in_app_review/ios" :path: ".symlinks/plugins/libphonenumber_plugin/ios"
open_filex: package_info:
:path: ".symlinks/plugins/open_filex/ios" :path: ".symlinks/plugins/package_info/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation: path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin" :path: ".symlinks/plugins/path_provider_foundation/darwin"
share_plus: share_plus:
:path: ".symlinks/plugins/share_plus/ios" :path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation: shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin" :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite_darwin: sqflite:
:path: ".symlinks/plugins/sqflite_darwin/darwin" :path: ".symlinks/plugins/sqflite/ios"
syncfusion_flutter_pdfviewer: syncfusion_flutter_pdfviewer:
:path: ".symlinks/plugins/syncfusion_flutter_pdfviewer/ios" :path: ".symlinks/plugins/syncfusion_flutter_pdfviewer/ios"
url_launcher_ios: url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios" :path: ".symlinks/plugins/url_launcher_ios/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd better_open_file: 03cf320415d4d3f46b6e00adc4a567d76c1a399d
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60 DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
emoji_picker_flutter: ece213fc274bdddefb77d502d33080dc54e616cc fast_rsa: f696740d492d562e76f17b0a81dfc8ec3e635374
fast_rsa: fb70897d51040b094c780d5f1d7358614738b879 file_picker: ce3938a0df3cc1ef404671531facef740d03f920
file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be Firebase: 07150e75d142fb9399f6777fa56a187b17f833a0
Firebase: f07b15ae5a6ec0f93713e30b923d9970d144af3e firebase_core: 4a3246a02f828a01c74a2c26427037786d90f17f
firebase_core: f1aafb21c14f497e5498f7ffc4dc63cbb52b2594 firebase_in_app_messaging: aebdbc10109a0ce44a3294f4ea57ed89ebe1d8bd
firebase_in_app_messaging: 04dfc07ab81578ef83bf0c0229be258ddf287c4f firebase_messaging: 13b378c8449cae7ec96c79570170943dd73d4738
firebase_messaging: c17a29984eafce4b2997fe078bb0a9e0b06f5dde FirebaseABTesting: 86ac5a4fc749088bb4d55a1cbfb2c4cb42c6d5de
FirebaseABTesting: c05b5ec9f1d9f21a65909525de301d375032d9a4 FirebaseCore: f86a1394906b97ac445ae49c92552a9425831bed
FirebaseCore: bb595f3114953664e3c1dc032f008a244147cfd3 FirebaseCoreInternal: b342e37cd4f5b4454ec34308f073420e7920858e
FirebaseCoreInternal: d7f5a043c2cd01a08103ab586587c1468047bca6 FirebaseInAppMessaging: dc24f50aebaf81a377f0b8abf360778f94208931
FirebaseInAppMessaging: 606dd4d4d5590a3d8229f363fdebb485235985b2 FirebaseInstallations: b28af1b9f997f1a799efe818c94695a3728c352f
FirebaseInstallations: ae9f4902cb5bf1d0c5eaa31ec1f4e5495a0714e2 FirebaseMessaging: bb2c4f6422a753038fe137d90ae7c1af57251316
FirebaseMessaging: d33971b7bb252745ea6cd31ab190d1a1df4b8ed5 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 flutter_app_badger: b87fc231847b03b92ce1412aa351842e7e97932f
flutter_app_badge: ca742dd659a157c1090ef7cd881cb78f48f3bcdf flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
flutter_local_notifications: a5a732f069baa862e728d839dd2ebb904737effb flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326 GoogleUtilities: 13e2c67ede716b8741c7989e26893d151b2b2084
in_app_review: 7dd1ea365263f834b8464673f9df72c80c17c937 image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 libphonenumber_plugin: e8a7d64a6624a7c25f2c4ab0b7ead2a8e341e35e
open_filex: 432f3cd11432da3e39f47fcc0df2b1603854eff1 nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499 package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880 path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
PhoneNumberKit: ced55861269312a5e3bc2ef82a58d6255b1c976a PhoneNumberKit: 43b5169526cc417398c8f13f77c97552c1c6ed76
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
SDWebImage: 9f177d83116802728e122410fb25ad88f5c7608a SDWebImage: 750adf017a315a280c60fde706ab1e552a3ae4e9
share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0 sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
syncfusion_flutter_pdfviewer: 90dc48305d2e33d4aa20681d1e98ddeda891bc14 syncfusion_flutter_pdfviewer: bb9998884b864cfedf72628df3503bdf57e397c0
url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
PODFILE CHECKSUM: e21c9d4c7b9623c73c6784ddc132fd50a603ad93 PODFILE CHECKSUM: 3d89a90682e2cd438911ad748b8ba5992f8b6a0e
COCOAPODS: 1.16.2 COCOAPODS: 1.12.1

View File

@@ -8,8 +8,8 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
33FDB0982EE9ABDC000B2391 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 33FDB0972EE9ABDC000B2391 /* GoogleService-Info.plist */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
6483E4432A911EA00063B51E /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6483E4422A911EA00063B51E /* GoogleService-Info.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@@ -33,10 +33,10 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
33FDB0972EE9ABDC000B2391 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
4509EC31CB08BA9BF367AF6C /* 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>"; }; 4509EC31CB08BA9BF367AF6C /* 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>"; };
64801C012A9112D500E8B558 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; }; 64801C012A9112D500E8B558 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
6483E4422A911EA00063B51E /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../Downloads/GoogleService-Info.plist"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
@@ -115,12 +115,12 @@
97C146F01CF9000F007C117D /* Runner */ = { 97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
33FDB0972EE9ABDC000B2391 /* GoogleService-Info.plist */,
64801C012A9112D500E8B558 /* Runner.entitlements */, 64801C012A9112D500E8B558 /* Runner.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */, 97C147021CF9000F007C117D /* Info.plist */,
6483E4422A911EA00063B51E /* GoogleService-Info.plist */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
@@ -144,7 +144,6 @@
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
174B54D80220E5F588BD9737 /* [CP] Embed Pods Frameworks */, 174B54D80220E5F588BD9737 /* [CP] Embed Pods Frameworks */,
859FAB4E05FAC31B7B1A62D7 /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@@ -162,7 +161,7 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
BuildIndependentTargetsInParallel = YES; BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1510; LastUpgradeCheck = 1430;
ORGANIZATIONNAME = ""; ORGANIZATIONNAME = "";
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {
@@ -196,7 +195,7 @@
files = ( files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
33FDB0982EE9ABDC000B2391 /* GoogleService-Info.plist in Resources */, 6483E4432A911EA00063B51E /* GoogleService-Info.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
); );
@@ -213,14 +212,10 @@
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = (
);
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
); );
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
@@ -242,27 +237,6 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
}; };
859FAB4E05FAC31B7B1A62D7 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1; alwaysOutOfDate = 1;
@@ -375,7 +349,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@@ -460,7 +434,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
@@ -509,7 +483,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1510" LastUpgradeVersion = "1430"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
shouldUseLaunchSchemeArgsEnv = "YES"> shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion> <MacroExpansion>
<BuildableReference <BuildableReference
@@ -44,13 +43,11 @@
buildConfiguration = "Debug" buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
launchStyle = "0" launchStyle = "0"
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES" debugDocumentVersioning = "YES"
debugServiceExtension = "internal" debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES"> allowLocationSimulation = "YES">
<BuildableProductRunnable <BuildableProductRunnable
runnableDebuggingMode = "0"> runnableDebuggingMode = "0">

View File

@@ -1,7 +1,7 @@
import UIKit import UIKit
import Flutter import Flutter
@main @UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate { @objc class AppDelegate: FlutterAppDelegate {
override func application( override func application(
_ application: UIApplication, _ application: UIApplication,

View File

@@ -5,5 +5,5 @@ abstract class ApiResponse {
late http.Response rawResponse; late http.Response rawResponse;
@JsonKey(includeIfNull: false) @JsonKey(includeIfNull: false)
Map<String, String>? headers; late Map<String, String>? headers;
} }

View File

@@ -8,42 +8,46 @@ part of 'getHolidaysResponse.dart';
GetHolidaysResponse _$GetHolidaysResponseFromJson(Map<String, dynamic> json) => GetHolidaysResponse _$GetHolidaysResponseFromJson(Map<String, dynamic> json) =>
GetHolidaysResponse( GetHolidaysResponse(
(json['data'] as List<dynamic>) (json['data'] as List<dynamic>)
.map( .map((e) =>
(e) => GetHolidaysResponseObject.fromJson(e as Map<String, dynamic>))
GetHolidaysResponseObject.fromJson(e as Map<String, dynamic>), .toList(),
) )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
.toList(),
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$GetHolidaysResponseToJson( Map<String, dynamic> _$GetHolidaysResponseToJson(GetHolidaysResponse instance) {
GetHolidaysResponse instance, final val = <String, dynamic>{};
) => <String, dynamic>{
'headers': ?instance.headers, void writeNotNull(String key, dynamic value) {
'data': instance.data.map((e) => e.toJson()).toList(), if (value != null) {
}; val[key] = value;
}
}
writeNotNull('headers', instance.headers);
val['data'] = instance.data.map((e) => e.toJson()).toList();
return val;
}
GetHolidaysResponseObject _$GetHolidaysResponseObjectFromJson( GetHolidaysResponseObject _$GetHolidaysResponseObjectFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetHolidaysResponseObject( GetHolidaysResponseObject(
start: json['start'] as String, start: json['start'] as String,
end: json['end'] as String, end: json['end'] as String,
year: (json['year'] as num).toInt(), year: (json['year'] as num).toInt(),
stateCode: json['stateCode'] as String, stateCode: json['stateCode'] as String,
name: json['name'] as String, name: json['name'] as String,
slug: json['slug'] as String, slug: json['slug'] as String,
); );
Map<String, dynamic> _$GetHolidaysResponseObjectToJson( Map<String, dynamic> _$GetHolidaysResponseObjectToJson(
GetHolidaysResponseObject instance, GetHolidaysResponseObject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'start': instance.start, 'start': instance.start,
'end': instance.end, 'end': instance.end,
'year': instance.year, 'year': instance.year,
'stateCode': instance.stateCode, 'stateCode': instance.stateCode,
'name': instance.name, 'name': instance.name,
'slug': instance.slug, 'slug': instance.slug,
}; };

View File

@@ -18,7 +18,7 @@ class AutocompleteResponseObject {
String label; String label;
String? icon; String? icon;
String? source; String? source;
String? status; List<String>? status;
String? subline; String? subline;
String? shareWithDisplayNameUniqe; String? shareWithDisplayNameUniqe;

View File

@@ -7,39 +7,40 @@ part of 'autocompleteResponse.dart';
// ************************************************************************** // **************************************************************************
AutocompleteResponse _$AutocompleteResponseFromJson( AutocompleteResponse _$AutocompleteResponseFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => AutocompleteResponse( AutocompleteResponse(
(json['data'] as List<dynamic>) (json['data'] as List<dynamic>)
.map( .map((e) =>
(e) => AutocompleteResponseObject.fromJson(e as Map<String, dynamic>), AutocompleteResponseObject.fromJson(e as Map<String, dynamic>))
) .toList(),
.toList(), );
);
Map<String, dynamic> _$AutocompleteResponseToJson( Map<String, dynamic> _$AutocompleteResponseToJson(
AutocompleteResponse instance, AutocompleteResponse instance) =>
) => <String, dynamic>{'data': instance.data.map((e) => e.toJson()).toList()}; <String, dynamic>{
'data': instance.data.map((e) => e.toJson()).toList(),
};
AutocompleteResponseObject _$AutocompleteResponseObjectFromJson( AutocompleteResponseObject _$AutocompleteResponseObjectFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => AutocompleteResponseObject( AutocompleteResponseObject(
json['id'] as String, json['id'] as String,
json['label'] as String, json['label'] as String,
json['icon'] as String?, json['icon'] as String?,
json['source'] as String?, json['source'] as String?,
json['status'] as String?, (json['status'] as List<dynamic>?)?.map((e) => e as String).toList(),
json['subline'] as String?, json['subline'] as String?,
json['shareWithDisplayNameUniqe'] as String?, json['shareWithDisplayNameUniqe'] as String?,
); );
Map<String, dynamic> _$AutocompleteResponseObjectToJson( Map<String, dynamic> _$AutocompleteResponseObjectToJson(
AutocompleteResponseObject instance, AutocompleteResponseObject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'label': instance.label, 'label': instance.label,
'icon': instance.icon, 'icon': instance.icon,
'source': instance.source, 'source': instance.source,
'status': instance.status, 'status': instance.status,
'subline': instance.subline, 'subline': instance.subline,
'shareWithDisplayNameUniqe': instance.shareWithDisplayNameUniqe, 'shareWithDisplayNameUniqe': instance.shareWithDisplayNameUniqe,
}; };

View File

@@ -7,21 +7,21 @@ part of 'fileSharingApiParams.dart';
// ************************************************************************** // **************************************************************************
FileSharingApiParams _$FileSharingApiParamsFromJson( FileSharingApiParams _$FileSharingApiParamsFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => FileSharingApiParams( FileSharingApiParams(
shareType: (json['shareType'] as num).toInt(), shareType: (json['shareType'] as num).toInt(),
shareWith: json['shareWith'] as String, shareWith: json['shareWith'] as String,
path: json['path'] as String, path: json['path'] as String,
referenceId: json['referenceId'] as String?, referenceId: json['referenceId'] as String?,
talkMetaData: json['talkMetaData'] as String?, talkMetaData: json['talkMetaData'] as String?,
); );
Map<String, dynamic> _$FileSharingApiParamsToJson( Map<String, dynamic> _$FileSharingApiParamsToJson(
FileSharingApiParams instance, FileSharingApiParams instance) =>
) => <String, dynamic>{ <String, dynamic>{
'shareType': instance.shareType, 'shareType': instance.shareType,
'shareWith': instance.shareWith, 'shareWith': instance.shareWith,
'path': instance.path, 'path': instance.path,
'referenceId': instance.referenceId, 'referenceId': instance.referenceId,
'talkMetaData': instance.talkMetaData, 'talkMetaData': instance.talkMetaData,
}; };

View File

@@ -8,35 +8,39 @@ part of 'getChatParams.dart';
GetChatParams _$GetChatParamsFromJson(Map<String, dynamic> json) => GetChatParams _$GetChatParamsFromJson(Map<String, dynamic> json) =>
GetChatParams( GetChatParams(
lookIntoFuture: $enumDecode( lookIntoFuture:
_$GetChatParamsSwitchEnumMap, $enumDecode(_$GetChatParamsSwitchEnumMap, json['lookIntoFuture']),
json['lookIntoFuture'],
),
limit: (json['limit'] as num?)?.toInt(), limit: (json['limit'] as num?)?.toInt(),
lastKnownMessageId: (json['lastKnownMessageId'] as num?)?.toInt(), lastKnownMessageId: (json['lastKnownMessageId'] as num?)?.toInt(),
lastCommonReadId: (json['lastCommonReadId'] as num?)?.toInt(), lastCommonReadId: (json['lastCommonReadId'] as num?)?.toInt(),
timeout: (json['timeout'] as num?)?.toInt(), timeout: (json['timeout'] as num?)?.toInt(),
setReadMarker: $enumDecodeNullable( setReadMarker: $enumDecodeNullable(
_$GetChatParamsSwitchEnumMap, _$GetChatParamsSwitchEnumMap, json['setReadMarker']),
json['setReadMarker'],
),
includeLastKnown: $enumDecodeNullable( includeLastKnown: $enumDecodeNullable(
_$GetChatParamsSwitchEnumMap, _$GetChatParamsSwitchEnumMap, json['includeLastKnown']),
json['includeLastKnown'],
),
); );
Map<String, dynamic> _$GetChatParamsToJson( Map<String, dynamic> _$GetChatParamsToJson(GetChatParams instance) {
GetChatParams instance, final val = <String, dynamic>{
) => <String, dynamic>{ 'lookIntoFuture': _$GetChatParamsSwitchEnumMap[instance.lookIntoFuture]!,
'lookIntoFuture': _$GetChatParamsSwitchEnumMap[instance.lookIntoFuture]!, };
'limit': ?instance.limit,
'lastKnownMessageId': ?instance.lastKnownMessageId, void writeNotNull(String key, dynamic value) {
'lastCommonReadId': ?instance.lastCommonReadId, if (value != null) {
'timeout': ?instance.timeout, val[key] = value;
'setReadMarker': ?_$GetChatParamsSwitchEnumMap[instance.setReadMarker], }
'includeLastKnown': ?_$GetChatParamsSwitchEnumMap[instance.includeLastKnown], }
};
writeNotNull('limit', instance.limit);
writeNotNull('lastKnownMessageId', instance.lastKnownMessageId);
writeNotNull('lastCommonReadId', instance.lastCommonReadId);
writeNotNull('timeout', instance.timeout);
writeNotNull(
'setReadMarker', _$GetChatParamsSwitchEnumMap[instance.setReadMarker]);
writeNotNull('includeLastKnown',
_$GetChatParamsSwitchEnumMap[instance.includeLastKnown]);
return val;
}
const _$GetChatParamsSwitchEnumMap = { const _$GetChatParamsSwitchEnumMap = {
GetChatParamsSwitch.on: 1, GetChatParamsSwitch.on: 1,

View File

@@ -120,5 +120,4 @@ enum RichObjectStringObjectType {
@JsonValue('guest') guest, @JsonValue('guest') guest,
@JsonValue('highlight') highlight, @JsonValue('highlight') highlight,
@JsonValue('talk-poll') talkPoll, @JsonValue('talk-poll') talkPoll,
@JsonValue('geo-location') geoLocation,
} }

View File

@@ -8,72 +8,78 @@ part of 'getChatResponse.dart';
GetChatResponse _$GetChatResponseFromJson(Map<String, dynamic> json) => GetChatResponse _$GetChatResponseFromJson(Map<String, dynamic> json) =>
GetChatResponse( GetChatResponse(
(json['data'] as List<dynamic>) (json['data'] as List<dynamic>)
.map( .map((e) => GetChatResponseObject.fromJson(e as Map<String, dynamic>))
(e) => GetChatResponseObject.fromJson(e as Map<String, dynamic>), .toSet(),
) )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
.toSet(),
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$GetChatResponseToJson(GetChatResponse instance) => Map<String, dynamic> _$GetChatResponseToJson(GetChatResponse instance) {
<String, dynamic>{ final val = <String, dynamic>{};
'headers': ?instance.headers,
'data': instance.data.map((e) => e.toJson()).toList(), void writeNotNull(String key, dynamic value) {
}; if (value != null) {
val[key] = value;
}
}
writeNotNull('headers', instance.headers);
val['data'] = instance.data.map((e) => e.toJson()).toList();
return val;
}
GetChatResponseObject _$GetChatResponseObjectFromJson( GetChatResponseObject _$GetChatResponseObjectFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetChatResponseObject( GetChatResponseObject(
(json['id'] as num).toInt(), (json['id'] as num).toInt(),
json['token'] as String, json['token'] as String,
$enumDecode( $enumDecode(
_$GetRoomResponseObjectMessageActorTypeEnumMap, _$GetRoomResponseObjectMessageActorTypeEnumMap, json['actorType']),
json['actorType'], json['actorId'] as String,
), json['actorDisplayName'] as String,
json['actorId'] as String, (json['timestamp'] as num).toInt(),
json['actorDisplayName'] as String, json['systemMessage'] as String,
(json['timestamp'] as num).toInt(), $enumDecode(
json['systemMessage'] as String, _$GetRoomResponseObjectMessageTypeEnumMap, json['messageType']),
$enumDecode(_$GetRoomResponseObjectMessageTypeEnumMap, json['messageType']), json['isReplyable'] as bool,
json['isReplyable'] as bool, json['referenceId'] as String,
json['referenceId'] as String, json['message'] as String,
json['message'] as String, _fromJson(json['messageParameters']),
_fromJson(json['messageParameters']), (json['reactions'] as Map<String, dynamic>?)?.map(
(json['reactions'] as Map<String, dynamic>?)?.map( (k, e) => MapEntry(k, (e as num).toInt()),
(k, e) => MapEntry(k, (e as num).toInt()), ),
), (json['reactionsSelf'] as List<dynamic>?)
(json['reactionsSelf'] as List<dynamic>?)?.map((e) => e as String).toList(), ?.map((e) => e as String)
json['parent'] == null .toList(),
? null json['parent'] == null
: GetChatResponseObject.fromJson(json['parent'] as Map<String, dynamic>), ? null
); : GetChatResponseObject.fromJson(
json['parent'] as Map<String, dynamic>),
);
Map<String, dynamic> _$GetChatResponseObjectToJson( Map<String, dynamic> _$GetChatResponseObjectToJson(
GetChatResponseObject instance, GetChatResponseObject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'token': instance.token, 'token': instance.token,
'actorType': 'actorType':
_$GetRoomResponseObjectMessageActorTypeEnumMap[instance.actorType]!, _$GetRoomResponseObjectMessageActorTypeEnumMap[instance.actorType]!,
'actorId': instance.actorId, 'actorId': instance.actorId,
'actorDisplayName': instance.actorDisplayName, 'actorDisplayName': instance.actorDisplayName,
'timestamp': instance.timestamp, 'timestamp': instance.timestamp,
'systemMessage': instance.systemMessage, 'systemMessage': instance.systemMessage,
'messageType': 'messageType':
_$GetRoomResponseObjectMessageTypeEnumMap[instance.messageType]!, _$GetRoomResponseObjectMessageTypeEnumMap[instance.messageType]!,
'isReplyable': instance.isReplyable, 'isReplyable': instance.isReplyable,
'referenceId': instance.referenceId, 'referenceId': instance.referenceId,
'message': instance.message, 'message': instance.message,
'reactions': instance.reactions, 'reactions': instance.reactions,
'reactionsSelf': instance.reactionsSelf, 'reactionsSelf': instance.reactionsSelf,
'messageParameters': instance.messageParameters?.map( 'messageParameters':
(k, e) => MapEntry(k, e.toJson()), instance.messageParameters?.map((k, e) => MapEntry(k, e.toJson())),
), 'parent': instance.parent?.toJson(),
'parent': instance.parent?.toJson(), };
};
const _$GetRoomResponseObjectMessageActorTypeEnumMap = { const _$GetRoomResponseObjectMessageActorTypeEnumMap = {
GetRoomResponseObjectMessageActorType.deletedUsers: 'deleted_users', GetRoomResponseObjectMessageActorType.deletedUsers: 'deleted_users',
@@ -85,7 +91,6 @@ const _$GetRoomResponseObjectMessageActorTypeEnumMap = {
const _$GetRoomResponseObjectMessageTypeEnumMap = { const _$GetRoomResponseObjectMessageTypeEnumMap = {
GetRoomResponseObjectMessageType.comment: 'comment', GetRoomResponseObjectMessageType.comment: 'comment',
GetRoomResponseObjectMessageType.voiceMessage: 'voice-message',
GetRoomResponseObjectMessageType.deletedComment: 'comment_deleted', GetRoomResponseObjectMessageType.deletedComment: 'comment_deleted',
GetRoomResponseObjectMessageType.system: 'system', GetRoomResponseObjectMessageType.system: 'system',
GetRoomResponseObjectMessageType.command: 'command', GetRoomResponseObjectMessageType.command: 'command',
@@ -116,5 +121,4 @@ const _$RichObjectStringObjectTypeEnumMap = {
RichObjectStringObjectType.guest: 'guest', RichObjectStringObjectType.guest: 'guest',
RichObjectStringObjectType.highlight: 'highlight', RichObjectStringObjectType.highlight: 'highlight',
RichObjectStringObjectType.talkPoll: 'talk-poll', RichObjectStringObjectType.talkPoll: 'talk-poll',
RichObjectStringObjectType.geoLocation: 'geo-location',
}; };

View File

@@ -7,9 +7,13 @@ part of 'deleteReactMessageParams.dart';
// ************************************************************************** // **************************************************************************
DeleteReactMessageParams _$DeleteReactMessageParamsFromJson( DeleteReactMessageParams _$DeleteReactMessageParamsFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => DeleteReactMessageParams(json['reaction'] as String); DeleteReactMessageParams(
json['reaction'] as String,
);
Map<String, dynamic> _$DeleteReactMessageParamsToJson( Map<String, dynamic> _$DeleteReactMessageParamsToJson(
DeleteReactMessageParams instance, DeleteReactMessageParams instance) =>
) => <String, dynamic>{'reaction': instance.reaction}; <String, dynamic>{
'reaction': instance.reaction,
};

View File

@@ -55,15 +55,12 @@ class GetParticipantsResponseObject {
} }
enum GetParticipantsResponseObjectParticipantType { enum GetParticipantsResponseObjectParticipantType {
@JsonValue(1) owner('Besitzer'), @JsonValue(1) owner,
@JsonValue(2) moderator('Moderator'), @JsonValue(2) moderator,
@JsonValue(3) user('Teilnehmer'), @JsonValue(3) user,
@JsonValue(4) guest('Gast'), @JsonValue(4) guest,
@JsonValue(5) userFollowingPublicLink('Teilnehmer über Link'), @JsonValue(5) userFollowingPublicLink,
@JsonValue(6) guestWithModeratorPermissions('Gast Moderator'); @JsonValue(6) guestWithModeratorPermissions
const GetParticipantsResponseObjectParticipantType(this.prettyName);
final String prettyName;
} }
enum GetParticipantsResponseObjectParticipantsInCallFlags { enum GetParticipantsResponseObjectParticipantsInCallFlags {

View File

@@ -7,77 +7,74 @@ part of 'getParticipantsResponse.dart';
// ************************************************************************** // **************************************************************************
GetParticipantsResponse _$GetParticipantsResponseFromJson( GetParticipantsResponse _$GetParticipantsResponseFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) =>
GetParticipantsResponse( GetParticipantsResponse(
(json['data'] as List<dynamic>) (json['data'] as List<dynamic>)
.map( .map((e) =>
(e) => GetParticipantsResponseObject.fromJson( GetParticipantsResponseObject.fromJson(e as Map<String, dynamic>))
e as Map<String, dynamic>, .toSet(),
), )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
)
.toSet(),
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$GetParticipantsResponseToJson( Map<String, dynamic> _$GetParticipantsResponseToJson(
GetParticipantsResponse instance, GetParticipantsResponse instance) {
) => <String, dynamic>{ final val = <String, dynamic>{};
'headers': ?instance.headers,
'data': instance.data.map((e) => e.toJson()).toList(), void writeNotNull(String key, dynamic value) {
}; if (value != null) {
val[key] = value;
}
}
writeNotNull('headers', instance.headers);
val['data'] = instance.data.map((e) => e.toJson()).toList();
return val;
}
GetParticipantsResponseObject _$GetParticipantsResponseObjectFromJson( GetParticipantsResponseObject _$GetParticipantsResponseObjectFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetParticipantsResponseObject( GetParticipantsResponseObject(
(json['attendeeId'] as num).toInt(), (json['attendeeId'] as num).toInt(),
json['actorType'] as String, json['actorType'] as String,
json['actorId'] as String, json['actorId'] as String,
json['displayName'] as String, json['displayName'] as String,
$enumDecode( $enumDecode(_$GetParticipantsResponseObjectParticipantTypeEnumMap,
_$GetParticipantsResponseObjectParticipantTypeEnumMap, json['participantType']),
json['participantType'], (json['lastPing'] as num).toInt(),
), $enumDecode(_$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap,
(json['lastPing'] as num).toInt(), json['inCall']),
$enumDecode( (json['permissions'] as num).toInt(),
_$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap, (json['attendeePermissions'] as num).toInt(),
json['inCall'], json['sessionId'] as String?,
), (json['sessionIds'] as List<dynamic>).map((e) => e as String).toList(),
(json['permissions'] as num).toInt(), json['status'] as String?,
(json['attendeePermissions'] as num).toInt(), json['statusIcon'] as String?,
json['sessionId'] as String?, json['statusMessage'] as String?,
(json['sessionIds'] as List<dynamic>).map((e) => e as String).toList(), json['roomToken'] as String?,
json['status'] as String?, );
json['statusIcon'] as String?,
json['statusMessage'] as String?,
json['roomToken'] as String?,
);
Map<String, dynamic> _$GetParticipantsResponseObjectToJson( Map<String, dynamic> _$GetParticipantsResponseObjectToJson(
GetParticipantsResponseObject instance, GetParticipantsResponseObject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'attendeeId': instance.attendeeId, 'attendeeId': instance.attendeeId,
'actorType': instance.actorType, 'actorType': instance.actorType,
'actorId': instance.actorId, 'actorId': instance.actorId,
'displayName': instance.displayName, 'displayName': instance.displayName,
'participantType': 'participantType': _$GetParticipantsResponseObjectParticipantTypeEnumMap[
_$GetParticipantsResponseObjectParticipantTypeEnumMap[instance instance.participantType]!,
.participantType]!, 'lastPing': instance.lastPing,
'lastPing': instance.lastPing, 'inCall': _$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap[
'inCall': instance.inCall]!,
_$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap[instance 'permissions': instance.permissions,
.inCall]!, 'attendeePermissions': instance.attendeePermissions,
'permissions': instance.permissions, 'sessionId': instance.sessionId,
'attendeePermissions': instance.attendeePermissions, 'sessionIds': instance.sessionIds,
'sessionId': instance.sessionId, 'status': instance.status,
'sessionIds': instance.sessionIds, 'statusIcon': instance.statusIcon,
'status': instance.status, 'statusMessage': instance.statusMessage,
'statusIcon': instance.statusIcon, 'roomToken': instance.roomToken,
'statusMessage': instance.statusMessage, };
'roomToken': instance.roomToken,
};
const _$GetParticipantsResponseObjectParticipantTypeEnumMap = { const _$GetParticipantsResponseObjectParticipantTypeEnumMap = {
GetParticipantsResponseObjectParticipantType.owner: 1, GetParticipantsResponseObjectParticipantType.owner: 1,

View File

@@ -7,53 +7,55 @@ part of 'getReactionsResponse.dart';
// ************************************************************************** // **************************************************************************
GetReactionsResponse _$GetReactionsResponseFromJson( GetReactionsResponse _$GetReactionsResponseFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) =>
GetReactionsResponse( GetReactionsResponse(
(json['data'] as Map<String, dynamic>).map( (json['data'] as Map<String, dynamic>).map(
(k, e) => MapEntry( (k, e) => MapEntry(
k, k,
(e as List<dynamic>) (e as List<dynamic>)
.map( .map((e) => GetReactionsResponseObject.fromJson(
(e) => GetReactionsResponseObject.fromJson( e as Map<String, dynamic>))
e as Map<String, dynamic>, .toList()),
), ),
) )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
.toList(),
),
),
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$GetReactionsResponseToJson( Map<String, dynamic> _$GetReactionsResponseToJson(
GetReactionsResponse instance, GetReactionsResponse instance) {
) => <String, dynamic>{ final val = <String, dynamic>{};
'headers': ?instance.headers,
'data': instance.data.map( void writeNotNull(String key, dynamic value) {
(k, e) => MapEntry(k, e.map((e) => e.toJson()).toList()), if (value != null) {
), val[key] = value;
}; }
}
writeNotNull('headers', instance.headers);
val['data'] = instance.data
.map((k, e) => MapEntry(k, e.map((e) => e.toJson()).toList()));
return val;
}
GetReactionsResponseObject _$GetReactionsResponseObjectFromJson( GetReactionsResponseObject _$GetReactionsResponseObjectFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetReactionsResponseObject( GetReactionsResponseObject(
$enumDecode(_$GetReactionsResponseObjectActorTypeEnumMap, json['actorType']), $enumDecode(
json['actorId'] as String, _$GetReactionsResponseObjectActorTypeEnumMap, json['actorType']),
json['actorDisplayName'] as String, json['actorId'] as String,
(json['timestamp'] as num).toInt(), json['actorDisplayName'] as String,
); (json['timestamp'] as num).toInt(),
);
Map<String, dynamic> _$GetReactionsResponseObjectToJson( Map<String, dynamic> _$GetReactionsResponseObjectToJson(
GetReactionsResponseObject instance, GetReactionsResponseObject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'actorType': 'actorType':
_$GetReactionsResponseObjectActorTypeEnumMap[instance.actorType]!, _$GetReactionsResponseObjectActorTypeEnumMap[instance.actorType]!,
'actorId': instance.actorId, 'actorId': instance.actorId,
'actorDisplayName': instance.actorDisplayName, 'actorDisplayName': instance.actorDisplayName,
'timestamp': instance.timestamp, 'timestamp': instance.timestamp,
}; };
const _$GetReactionsResponseObjectActorTypeEnumMap = { const _$GetReactionsResponseObjectActorTypeEnumMap = {
GetReactionsResponseObjectActorType.guests: 'guests', GetReactionsResponseObjectActorType.guests: 'guests',

View File

@@ -7,7 +7,11 @@ part of 'reactMessageParams.dart';
// ************************************************************************** // **************************************************************************
ReactMessageParams _$ReactMessageParamsFromJson(Map<String, dynamic> json) => ReactMessageParams _$ReactMessageParamsFromJson(Map<String, dynamic> json) =>
ReactMessageParams(json['reaction'] as String); ReactMessageParams(
json['reaction'] as String,
);
Map<String, dynamic> _$ReactMessageParamsToJson(ReactMessageParams instance) => Map<String, dynamic> _$ReactMessageParamsToJson(ReactMessageParams instance) =>
<String, dynamic>{'reaction': instance.reaction}; <String, dynamic>{
'reaction': instance.reaction,
};

View File

@@ -9,20 +9,18 @@ part of 'getRoomParams.dart';
GetRoomParams _$GetRoomParamsFromJson(Map<String, dynamic> json) => GetRoomParams _$GetRoomParamsFromJson(Map<String, dynamic> json) =>
GetRoomParams( GetRoomParams(
noStatusUpdate: $enumDecodeNullable( noStatusUpdate: $enumDecodeNullable(
_$GetRoomParamsStatusUpdateEnumMap, _$GetRoomParamsStatusUpdateEnumMap, json['noStatusUpdate']),
json['noStatusUpdate'],
),
includeStatus: json['includeStatus'] as bool?, includeStatus: json['includeStatus'] as bool?,
modifiedSince: (json['modifiedSince'] as num?)?.toInt(), modifiedSince: (json['modifiedSince'] as num?)?.toInt(),
); );
Map<String, dynamic> _$GetRoomParamsToJson( Map<String, dynamic> _$GetRoomParamsToJson(GetRoomParams instance) =>
GetRoomParams instance, <String, dynamic>{
) => <String, dynamic>{ 'noStatusUpdate':
'noStatusUpdate': _$GetRoomParamsStatusUpdateEnumMap[instance.noStatusUpdate], _$GetRoomParamsStatusUpdateEnumMap[instance.noStatusUpdate],
'includeStatus': GetRoomParams._format(instance.includeStatus), 'includeStatus': GetRoomParams._format(instance.includeStatus),
'modifiedSince': instance.modifiedSince, 'modifiedSince': instance.modifiedSince,
}; };
const _$GetRoomParamsStatusUpdateEnumMap = { const _$GetRoomParamsStatusUpdateEnumMap = {
GetRoomParamsStatusUpdate.defaults: 0, GetRoomParamsStatusUpdate.defaults: 0,

View File

@@ -110,7 +110,6 @@ enum GetRoomResponseObjectConversationType {
@JsonValue(3) public, @JsonValue(3) public,
@JsonValue(4) changelog, @JsonValue(4) changelog,
@JsonValue(5) deleted, @JsonValue(5) deleted,
@JsonValue(6) noteToSelf,
} }
enum GetRoomResponseObjectParticipantNotificationLevel { enum GetRoomResponseObjectParticipantNotificationLevel {
@@ -162,7 +161,6 @@ enum GetRoomResponseObjectMessageActorType {
enum GetRoomResponseObjectMessageType { enum GetRoomResponseObjectMessageType {
@JsonValue('comment') comment, @JsonValue('comment') comment,
@JsonValue('voice-message') voiceMessage,
@JsonValue('comment_deleted') deletedComment, @JsonValue('comment_deleted') deletedComment,
@JsonValue('system') system, @JsonValue('system') system,
@JsonValue('command') command, @JsonValue('command') command,

View File

@@ -8,97 +8,101 @@ part of 'getRoomResponse.dart';
GetRoomResponse _$GetRoomResponseFromJson(Map<String, dynamic> json) => GetRoomResponse _$GetRoomResponseFromJson(Map<String, dynamic> json) =>
GetRoomResponse( GetRoomResponse(
(json['data'] as List<dynamic>) (json['data'] as List<dynamic>)
.map( .map((e) => GetRoomResponseObject.fromJson(e as Map<String, dynamic>))
(e) => GetRoomResponseObject.fromJson(e as Map<String, dynamic>), .toSet(),
) )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
.toSet(),
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$GetRoomResponseToJson(GetRoomResponse instance) => Map<String, dynamic> _$GetRoomResponseToJson(GetRoomResponse instance) {
<String, dynamic>{ final val = <String, dynamic>{};
'headers': ?instance.headers,
'data': instance.data.map((e) => e.toJson()).toList(), void writeNotNull(String key, dynamic value) {
}; if (value != null) {
val[key] = value;
}
}
writeNotNull('headers', instance.headers);
val['data'] = instance.data.map((e) => e.toJson()).toList();
return val;
}
GetRoomResponseObject _$GetRoomResponseObjectFromJson( GetRoomResponseObject _$GetRoomResponseObjectFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetRoomResponseObject( GetRoomResponseObject(
(json['id'] as num).toInt(), (json['id'] as num).toInt(),
json['token'] as String, json['token'] as String,
$enumDecode(_$GetRoomResponseObjectConversationTypeEnumMap, json['type']), $enumDecode(_$GetRoomResponseObjectConversationTypeEnumMap, json['type']),
json['name'] as String, json['name'] as String,
json['displayName'] as String, json['displayName'] as String,
json['description'] as String, json['description'] as String,
(json['participantType'] as num).toInt(), (json['participantType'] as num).toInt(),
(json['participantFlags'] as num).toInt(), (json['participantFlags'] as num).toInt(),
(json['readOnly'] as num).toInt(), (json['readOnly'] as num).toInt(),
(json['listable'] as num).toInt(), (json['listable'] as num).toInt(),
(json['lastPing'] as num).toInt(), (json['lastPing'] as num).toInt(),
json['sessionId'] as String, json['sessionId'] as String,
json['hasPassword'] as bool, json['hasPassword'] as bool,
json['hasCall'] as bool, json['hasCall'] as bool,
(json['callFlag'] as num).toInt(), (json['callFlag'] as num).toInt(),
json['canStartCall'] as bool, json['canStartCall'] as bool,
json['canDeleteConversation'] as bool, json['canDeleteConversation'] as bool,
json['canLeaveConversation'] as bool, json['canLeaveConversation'] as bool,
(json['lastActivity'] as num).toInt(), (json['lastActivity'] as num).toInt(),
json['isFavorite'] as bool, json['isFavorite'] as bool,
$enumDecode( $enumDecode(_$GetRoomResponseObjectParticipantNotificationLevelEnumMap,
_$GetRoomResponseObjectParticipantNotificationLevelEnumMap, json['notificationLevel']),
json['notificationLevel'], (json['unreadMessages'] as num).toInt(),
), json['unreadMention'] as bool,
(json['unreadMessages'] as num).toInt(), json['unreadMentionDirect'] as bool,
json['unreadMention'] as bool, (json['lastReadMessage'] as num).toInt(),
json['unreadMentionDirect'] as bool, (json['lastCommonReadMessage'] as num).toInt(),
(json['lastReadMessage'] as num).toInt(), GetChatResponseObject.fromJson(
(json['lastCommonReadMessage'] as num).toInt(), json['lastMessage'] as Map<String, dynamic>),
GetChatResponseObject.fromJson(json['lastMessage'] as Map<String, dynamic>), json['status'] as String?,
json['status'] as String?, json['statusIcon'] as String?,
json['statusIcon'] as String?, json['statusMessage'] as String?,
json['statusMessage'] as String?, )..sort = json['sort'] as String?;
)..sort = json['sort'] as String?;
Map<String, dynamic> _$GetRoomResponseObjectToJson( Map<String, dynamic> _$GetRoomResponseObjectToJson(
GetRoomResponseObject instance, GetRoomResponseObject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'token': instance.token, 'token': instance.token,
'type': _$GetRoomResponseObjectConversationTypeEnumMap[instance.type]!, 'type': _$GetRoomResponseObjectConversationTypeEnumMap[instance.type]!,
'name': instance.name, 'name': instance.name,
'displayName': instance.displayName, 'displayName': instance.displayName,
'description': instance.description, 'description': instance.description,
'participantType': instance.participantType, 'participantType': instance.participantType,
'participantFlags': instance.participantFlags, 'participantFlags': instance.participantFlags,
'readOnly': instance.readOnly, 'readOnly': instance.readOnly,
'listable': instance.listable, 'listable': instance.listable,
'lastPing': instance.lastPing, 'lastPing': instance.lastPing,
'sessionId': instance.sessionId, 'sessionId': instance.sessionId,
'hasPassword': instance.hasPassword, 'hasPassword': instance.hasPassword,
'hasCall': instance.hasCall, 'hasCall': instance.hasCall,
'callFlag': instance.callFlag, 'callFlag': instance.callFlag,
'canStartCall': instance.canStartCall, 'canStartCall': instance.canStartCall,
'canDeleteConversation': instance.canDeleteConversation, 'canDeleteConversation': instance.canDeleteConversation,
'canLeaveConversation': instance.canLeaveConversation, 'canLeaveConversation': instance.canLeaveConversation,
'lastActivity': instance.lastActivity, 'lastActivity': instance.lastActivity,
'isFavorite': instance.isFavorite, 'isFavorite': instance.isFavorite,
'notificationLevel': 'notificationLevel':
_$GetRoomResponseObjectParticipantNotificationLevelEnumMap[instance _$GetRoomResponseObjectParticipantNotificationLevelEnumMap[
.notificationLevel]!, instance.notificationLevel]!,
'unreadMessages': instance.unreadMessages, 'unreadMessages': instance.unreadMessages,
'unreadMention': instance.unreadMention, 'unreadMention': instance.unreadMention,
'unreadMentionDirect': instance.unreadMentionDirect, 'unreadMentionDirect': instance.unreadMentionDirect,
'lastReadMessage': instance.lastReadMessage, 'lastReadMessage': instance.lastReadMessage,
'lastCommonReadMessage': instance.lastCommonReadMessage, 'lastCommonReadMessage': instance.lastCommonReadMessage,
'lastMessage': instance.lastMessage.toJson(), 'lastMessage': instance.lastMessage.toJson(),
'status': instance.status, 'status': instance.status,
'statusIcon': instance.statusIcon, 'statusIcon': instance.statusIcon,
'statusMessage': instance.statusMessage, 'statusMessage': instance.statusMessage,
'sort': instance.sort, 'sort': instance.sort,
}; };
const _$GetRoomResponseObjectConversationTypeEnumMap = { const _$GetRoomResponseObjectConversationTypeEnumMap = {
GetRoomResponseObjectConversationType.oneToOne: 1, GetRoomResponseObjectConversationType.oneToOne: 1,
@@ -106,7 +110,6 @@ const _$GetRoomResponseObjectConversationTypeEnumMap = {
GetRoomResponseObjectConversationType.public: 3, GetRoomResponseObjectConversationType.public: 3,
GetRoomResponseObjectConversationType.changelog: 4, GetRoomResponseObjectConversationType.changelog: 4,
GetRoomResponseObjectConversationType.deleted: 5, GetRoomResponseObjectConversationType.deleted: 5,
GetRoomResponseObjectConversationType.noteToSelf: 6,
}; };
const _$GetRoomResponseObjectParticipantNotificationLevelEnumMap = { const _$GetRoomResponseObjectParticipantNotificationLevelEnumMap = {

View File

@@ -12,8 +12,17 @@ SendMessageParams _$SendMessageParamsFromJson(Map<String, dynamic> json) =>
replyTo: json['replyTo'] as String?, replyTo: json['replyTo'] as String?,
); );
Map<String, dynamic> _$SendMessageParamsToJson(SendMessageParams instance) => Map<String, dynamic> _$SendMessageParamsToJson(SendMessageParams instance) {
<String, dynamic>{ final val = <String, dynamic>{
'message': instance.message, 'message': instance.message,
'replyTo': ?instance.replyTo, };
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('replyTo', instance.replyTo);
return val;
}

View File

@@ -12,5 +12,7 @@ SetReadMarkerParams _$SetReadMarkerParamsFromJson(Map<String, dynamic> json) =>
); );
Map<String, dynamic> _$SetReadMarkerParamsToJson( Map<String, dynamic> _$SetReadMarkerParamsToJson(
SetReadMarkerParams instance, SetReadMarkerParams instance) =>
) => <String, dynamic>{'lastReadMessage': instance.lastReadMessage}; <String, dynamic>{
'lastReadMessage': instance.lastReadMessage,
};

View File

@@ -58,9 +58,11 @@ abstract class TalkApi<T extends ApiResponse?> extends ApiRequest {
assembled?.headers = data.headers; assembled?.headers = data.headers;
return assembled; return assembled;
} catch (e) { } catch (e) {
var message = 'Error assembling Talk API ${T.toString()} message: ${e.toString()} response with request body: $body and request headers: ${headers.toString()}'; // TODO report error
log(message); log('Error assembling Talk API ${T.toString()} message: ${e.toString()} response on ${endpoint.path} with request body: $body and request headers: ${headers.toString()}');
throw Exception(message);
} }
throw Exception('Error assembling Talk API response');
} }
} }

View File

@@ -7,9 +7,13 @@ part of 'downloadFileResponse.dart';
// ************************************************************************** // **************************************************************************
DownloadFileResponse _$DownloadFileResponseFromJson( DownloadFileResponse _$DownloadFileResponseFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => DownloadFileResponse(json['path'] as String); DownloadFileResponse(
json['path'] as String,
);
Map<String, dynamic> _$DownloadFileResponseToJson( Map<String, dynamic> _$DownloadFileResponseToJson(
DownloadFileResponse instance, DownloadFileResponse instance) =>
) => <String, dynamic>{'path': instance.path}; <String, dynamic>{
'path': instance.path,
};

View File

@@ -7,7 +7,11 @@ part of 'listFilesParams.dart';
// ************************************************************************** // **************************************************************************
ListFilesParams _$ListFilesParamsFromJson(Map<String, dynamic> json) => ListFilesParams _$ListFilesParamsFromJson(Map<String, dynamic> json) =>
ListFilesParams(json['path'] as String); ListFilesParams(
json['path'] as String,
);
Map<String, dynamic> _$ListFilesParamsToJson(ListFilesParams instance) => Map<String, dynamic> _$ListFilesParamsToJson(ListFilesParams instance) =>
<String, dynamic>{'path': instance.path}; <String, dynamic>{
'path': instance.path,
};

View File

@@ -8,16 +8,23 @@ part of 'listFilesResponse.dart';
ListFilesResponse _$ListFilesResponseFromJson(Map<String, dynamic> json) => ListFilesResponse _$ListFilesResponseFromJson(Map<String, dynamic> json) =>
ListFilesResponse( ListFilesResponse(
(json['files'] as List<dynamic>) (json['files'] as List<dynamic>)
.map((e) => CacheableFile.fromJson(e as Map<String, dynamic>)) .map((e) => CacheableFile.fromJson(e as Map<String, dynamic>))
.toSet(), .toSet(),
) )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$ListFilesResponseToJson(ListFilesResponse instance) => Map<String, dynamic> _$ListFilesResponseToJson(ListFilesResponse instance) {
<String, dynamic>{ final val = <String, dynamic>{};
'headers': ?instance.headers,
'files': instance.files.map((e) => e.toJson()).toList(), void writeNotNull(String key, dynamic value) {
}; if (value != null) {
val[key] = value;
}
}
writeNotNull('headers', instance.headers);
val['files'] = instance.files.map((e) => e.toJson()).toList();
return val;
}

View File

@@ -8,43 +8,45 @@ part of 'getBreakersResponse.dart';
GetBreakersResponse _$GetBreakersResponseFromJson(Map<String, dynamic> json) => GetBreakersResponse _$GetBreakersResponseFromJson(Map<String, dynamic> json) =>
GetBreakersResponse( GetBreakersResponse(
GetBreakersReponseObject.fromJson( GetBreakersReponseObject.fromJson(json['global'] as Map<String, dynamic>),
json['global'] as Map<String, dynamic>, (json['regional'] as Map<String, dynamic>).map(
), (k, e) => MapEntry(
(json['regional'] as Map<String, dynamic>).map( k, GetBreakersReponseObject.fromJson(e as Map<String, dynamic>)),
(k, e) => MapEntry( ),
k, )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
GetBreakersReponseObject.fromJson(e as Map<String, dynamic>),
),
),
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$GetBreakersResponseToJson( Map<String, dynamic> _$GetBreakersResponseToJson(GetBreakersResponse instance) {
GetBreakersResponse instance, final val = <String, dynamic>{};
) => <String, dynamic>{
'headers': ?instance.headers, void writeNotNull(String key, dynamic value) {
'global': instance.global.toJson(), if (value != null) {
'regional': instance.regional.map((k, e) => MapEntry(k, e.toJson())), val[key] = value;
}; }
}
writeNotNull('headers', instance.headers);
val['global'] = instance.global.toJson();
val['regional'] = instance.regional.map((k, e) => MapEntry(k, e.toJson()));
return val;
}
GetBreakersReponseObject _$GetBreakersReponseObjectFromJson( GetBreakersReponseObject _$GetBreakersReponseObjectFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetBreakersReponseObject( GetBreakersReponseObject(
(json['areas'] as List<dynamic>) (json['areas'] as List<dynamic>)
.map((e) => $enumDecode(_$BreakerAreaEnumMap, e)) .map((e) => $enumDecode(_$BreakerAreaEnumMap, e))
.toList(), .toList(),
json['message'] as String, json['message'] as String,
); );
Map<String, dynamic> _$GetBreakersReponseObjectToJson( Map<String, dynamic> _$GetBreakersReponseObjectToJson(
GetBreakersReponseObject instance, GetBreakersReponseObject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'areas': instance.areas.map((e) => _$BreakerAreaEnumMap[e]!).toList(), 'areas': instance.areas.map((e) => _$BreakerAreaEnumMap[e]!).toList(),
'message': instance.message, 'message': instance.message,
}; };
const _$BreakerAreaEnumMap = { const _$BreakerAreaEnumMap = {
BreakerArea.global: 'GLOBAL', BreakerArea.global: 'GLOBAL',

View File

@@ -7,12 +7,15 @@ part of 'addCustomTimetableEventParams.dart';
// ************************************************************************** // **************************************************************************
AddCustomTimetableEventParams _$AddCustomTimetableEventParamsFromJson( AddCustomTimetableEventParams _$AddCustomTimetableEventParamsFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => AddCustomTimetableEventParams( AddCustomTimetableEventParams(
json['user'] as String, json['user'] as String,
CustomTimetableEvent.fromJson(json['event'] as Map<String, dynamic>), CustomTimetableEvent.fromJson(json['event'] as Map<String, dynamic>),
); );
Map<String, dynamic> _$AddCustomTimetableEventParamsToJson( Map<String, dynamic> _$AddCustomTimetableEventParamsToJson(
AddCustomTimetableEventParams instance, AddCustomTimetableEventParams instance) =>
) => <String, dynamic>{'user': instance.user, 'event': instance.event.toJson()}; <String, dynamic>{
'user': instance.user,
'event': instance.event.toJson(),
};

View File

@@ -7,29 +7,29 @@ part of 'customTimetableEvent.dart';
// ************************************************************************** // **************************************************************************
CustomTimetableEvent _$CustomTimetableEventFromJson( CustomTimetableEvent _$CustomTimetableEventFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => CustomTimetableEvent( CustomTimetableEvent(
id: json['id'] as String, id: json['id'] as String,
title: json['title'] as String, title: json['title'] as String,
description: json['description'] as String, description: json['description'] as String,
startDate: MhslApi.dateTimeFromJson(json['startDate'] as String), startDate: MhslApi.dateTimeFromJson(json['startDate'] as String),
endDate: MhslApi.dateTimeFromJson(json['endDate'] as String), endDate: MhslApi.dateTimeFromJson(json['endDate'] as String),
color: json['color'] as String?, color: json['color'] as String?,
rrule: json['rrule'] as String, rrule: json['rrule'] as String,
createdAt: MhslApi.dateTimeFromJson(json['createdAt'] as String), createdAt: MhslApi.dateTimeFromJson(json['createdAt'] as String),
updatedAt: MhslApi.dateTimeFromJson(json['updatedAt'] as String), updatedAt: MhslApi.dateTimeFromJson(json['updatedAt'] as String),
); );
Map<String, dynamic> _$CustomTimetableEventToJson( Map<String, dynamic> _$CustomTimetableEventToJson(
CustomTimetableEvent instance, CustomTimetableEvent instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'title': instance.title, 'title': instance.title,
'description': instance.description, 'description': instance.description,
'startDate': MhslApi.dateTimeToJson(instance.startDate), 'startDate': MhslApi.dateTimeToJson(instance.startDate),
'endDate': MhslApi.dateTimeToJson(instance.endDate), 'endDate': MhslApi.dateTimeToJson(instance.endDate),
'color': instance.color, 'color': instance.color,
'rrule': instance.rrule, 'rrule': instance.rrule,
'createdAt': MhslApi.dateTimeToJson(instance.createdAt), 'createdAt': MhslApi.dateTimeToJson(instance.createdAt),
'updatedAt': MhslApi.dateTimeToJson(instance.updatedAt), 'updatedAt': MhslApi.dateTimeToJson(instance.updatedAt),
}; };

View File

@@ -7,9 +7,13 @@ part of 'getCustomTimetableEventParams.dart';
// ************************************************************************** // **************************************************************************
GetCustomTimetableEventParams _$GetCustomTimetableEventParamsFromJson( GetCustomTimetableEventParams _$GetCustomTimetableEventParamsFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetCustomTimetableEventParams(json['user'] as String); GetCustomTimetableEventParams(
json['user'] as String,
);
Map<String, dynamic> _$GetCustomTimetableEventParamsToJson( Map<String, dynamic> _$GetCustomTimetableEventParamsToJson(
GetCustomTimetableEventParams instance, GetCustomTimetableEventParams instance) =>
) => <String, dynamic>{'user': instance.user}; <String, dynamic>{
'user': instance.user,
};

View File

@@ -7,19 +7,26 @@ part of 'getCustomTimetableEventResponse.dart';
// ************************************************************************** // **************************************************************************
GetCustomTimetableEventResponse _$GetCustomTimetableEventResponseFromJson( GetCustomTimetableEventResponse _$GetCustomTimetableEventResponseFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) =>
GetCustomTimetableEventResponse( GetCustomTimetableEventResponse(
(json['events'] as List<dynamic>) (json['events'] as List<dynamic>)
.map( .map((e) => CustomTimetableEvent.fromJson(e as Map<String, dynamic>))
(e) => CustomTimetableEvent.fromJson(e as Map<String, dynamic>), .toList(),
) )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
.toList(),
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$GetCustomTimetableEventResponseToJson( Map<String, dynamic> _$GetCustomTimetableEventResponseToJson(
GetCustomTimetableEventResponse instance, GetCustomTimetableEventResponse instance) {
) => <String, dynamic>{'headers': ?instance.headers, 'events': instance.events}; final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('headers', instance.headers);
val['events'] = instance.events;
return val;
}

View File

@@ -7,9 +7,13 @@ part of 'removeCustomTimetableEventParams.dart';
// ************************************************************************** // **************************************************************************
RemoveCustomTimetableEventParams _$RemoveCustomTimetableEventParamsFromJson( RemoveCustomTimetableEventParams _$RemoveCustomTimetableEventParamsFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => RemoveCustomTimetableEventParams(json['id'] as String); RemoveCustomTimetableEventParams(
json['id'] as String,
);
Map<String, dynamic> _$RemoveCustomTimetableEventParamsToJson( Map<String, dynamic> _$RemoveCustomTimetableEventParamsToJson(
RemoveCustomTimetableEventParams instance, RemoveCustomTimetableEventParams instance) =>
) => <String, dynamic>{'id': instance.id}; <String, dynamic>{
'id': instance.id,
};

View File

@@ -7,12 +7,15 @@ part of 'updateCustomTimetableEventParams.dart';
// ************************************************************************** // **************************************************************************
UpdateCustomTimetableEventParams _$UpdateCustomTimetableEventParamsFromJson( UpdateCustomTimetableEventParams _$UpdateCustomTimetableEventParamsFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => UpdateCustomTimetableEventParams( UpdateCustomTimetableEventParams(
json['id'] as String, json['id'] as String,
CustomTimetableEvent.fromJson(json['event'] as Map<String, dynamic>), CustomTimetableEvent.fromJson(json['event'] as Map<String, dynamic>),
); );
Map<String, dynamic> _$UpdateCustomTimetableEventParamsToJson( Map<String, dynamic> _$UpdateCustomTimetableEventParamsToJson(
UpdateCustomTimetableEventParams instance, UpdateCustomTimetableEventParams instance) =>
) => <String, dynamic>{'id': instance.id, 'event': instance.event.toJson()}; <String, dynamic>{
'id': instance.id,
'event': instance.event.toJson(),
};

View File

@@ -7,17 +7,17 @@ part of 'notifyRegisterParams.dart';
// ************************************************************************** // **************************************************************************
NotifyRegisterParams _$NotifyRegisterParamsFromJson( NotifyRegisterParams _$NotifyRegisterParamsFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => NotifyRegisterParams( NotifyRegisterParams(
username: json['username'] as String, username: json['username'] as String,
password: json['password'] as String, password: json['password'] as String,
fcmToken: json['fcmToken'] as String, fcmToken: json['fcmToken'] as String,
); );
Map<String, dynamic> _$NotifyRegisterParamsToJson( Map<String, dynamic> _$NotifyRegisterParamsToJson(
NotifyRegisterParams instance, NotifyRegisterParams instance) =>
) => <String, dynamic>{ <String, dynamic>{
'username': instance.username, 'username': instance.username,
'password': instance.password, 'password': instance.password,
'fcmToken': instance.fcmToken, 'fcmToken': instance.fcmToken,
}; };

View File

@@ -7,21 +7,21 @@ part of 'updateUserIndexParams.dart';
// ************************************************************************** // **************************************************************************
UpdateUserIndexParams _$UpdateUserIndexParamsFromJson( UpdateUserIndexParams _$UpdateUserIndexParamsFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => UpdateUserIndexParams( UpdateUserIndexParams(
user: json['user'] as String, user: json['user'] as String,
username: json['username'] as String, username: json['username'] as String,
device: json['device'] as String, device: json['device'] as String,
appVersion: (json['appVersion'] as num).toInt(), appVersion: (json['appVersion'] as num).toInt(),
deviceInfo: json['deviceInfo'] as String, deviceInfo: json['deviceInfo'] as String,
); );
Map<String, dynamic> _$UpdateUserIndexParamsToJson( Map<String, dynamic> _$UpdateUserIndexParamsToJson(
UpdateUserIndexParams instance, UpdateUserIndexParams instance) =>
) => <String, dynamic>{ <String, dynamic>{
'user': instance.user, 'user': instance.user,
'username': instance.username, 'username': instance.username,
'device': instance.device, 'device': instance.device,
'appVersion': instance.appVersion, 'appVersion': instance.appVersion,
'deviceInfo': instance.deviceInfo, 'deviceInfo': instance.deviceInfo,
}; };

View File

@@ -4,7 +4,7 @@ import 'dart:developer';
import 'package:device_info_plus/device_info_plus.dart'; import 'package:device_info_plus/device_info_plus.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info/package_info.dart';
import '../../../../../model/accountData.dart'; import '../../../../../model/accountData.dart';
import '../../../mhslApi.dart'; import '../../../mhslApi.dart';

View File

@@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:localstore/localstore.dart'; import 'package:localstore/localstore.dart';
import 'apiResponse.dart'; import 'apiResponse.dart';
import 'webuntis/webuntisError.dart';
abstract class RequestCache<T extends ApiResponse?> { abstract class RequestCache<T extends ApiResponse?> {
static const int cacheNothing = 0; static const int cacheNothing = 0;
@@ -39,7 +40,7 @@ abstract class RequestCache<T extends ApiResponse?> {
'json': jsonEncode(newValue), 'json': jsonEncode(newValue),
'lastupdate': DateTime.now().millisecondsSinceEpoch 'lastupdate': DateTime.now().millisecondsSinceEpoch
}); });
} on Exception catch(e) { } on WebuntisError catch(e) {
onError(e); onError(e);
} }
} }

View File

@@ -13,4 +13,7 @@ AuthenticateParams _$AuthenticateParamsFromJson(Map<String, dynamic> json) =>
); );
Map<String, dynamic> _$AuthenticateParamsToJson(AuthenticateParams instance) => Map<String, dynamic> _$AuthenticateParamsToJson(AuthenticateParams instance) =>
<String, dynamic>{'user': instance.user, 'password': instance.password}; <String, dynamic>{
'user': instance.user,
'password': instance.password,
};

View File

@@ -7,24 +7,30 @@ part of 'authenticateResponse.dart';
// ************************************************************************** // **************************************************************************
AuthenticateResponse _$AuthenticateResponseFromJson( AuthenticateResponse _$AuthenticateResponseFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) =>
AuthenticateResponse( AuthenticateResponse(
json['sessionId'] as String, json['sessionId'] as String,
(json['personType'] as num).toInt(), (json['personType'] as num).toInt(),
(json['personId'] as num).toInt(), (json['personId'] as num).toInt(),
(json['klasseId'] as num).toInt(), (json['klasseId'] as num).toInt(),
) )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$AuthenticateResponseToJson( Map<String, dynamic> _$AuthenticateResponseToJson(
AuthenticateResponse instance, AuthenticateResponse instance) {
) => <String, dynamic>{ final val = <String, dynamic>{};
'headers': ?instance.headers,
'sessionId': instance.sessionId, void writeNotNull(String key, dynamic value) {
'personType': instance.personType, if (value != null) {
'personId': instance.personId, val[key] = value;
'klasseId': instance.klasseId, }
}; }
writeNotNull('headers', instance.headers);
val['sessionId'] = instance.sessionId;
val['personType'] = instance.personType;
val['personId'] = instance.personId;
val['klasseId'] = instance.klasseId;
return val;
}

View File

@@ -8,40 +8,44 @@ part of 'getHolidaysResponse.dart';
GetHolidaysResponse _$GetHolidaysResponseFromJson(Map<String, dynamic> json) => GetHolidaysResponse _$GetHolidaysResponseFromJson(Map<String, dynamic> json) =>
GetHolidaysResponse( GetHolidaysResponse(
(json['result'] as List<dynamic>) (json['result'] as List<dynamic>)
.map( .map((e) =>
(e) => GetHolidaysResponseObject.fromJson(e as Map<String, dynamic>))
GetHolidaysResponseObject.fromJson(e as Map<String, dynamic>), .toSet(),
) )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
.toSet(),
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$GetHolidaysResponseToJson( Map<String, dynamic> _$GetHolidaysResponseToJson(GetHolidaysResponse instance) {
GetHolidaysResponse instance, final val = <String, dynamic>{};
) => <String, dynamic>{
'headers': ?instance.headers, void writeNotNull(String key, dynamic value) {
'result': instance.result.map((e) => e.toJson()).toList(), if (value != null) {
}; val[key] = value;
}
}
writeNotNull('headers', instance.headers);
val['result'] = instance.result.map((e) => e.toJson()).toList();
return val;
}
GetHolidaysResponseObject _$GetHolidaysResponseObjectFromJson( GetHolidaysResponseObject _$GetHolidaysResponseObjectFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetHolidaysResponseObject( GetHolidaysResponseObject(
(json['id'] as num).toInt(), (json['id'] as num).toInt(),
json['name'] as String, json['name'] as String,
json['longName'] as String, json['longName'] as String,
(json['startDate'] as num).toInt(), (json['startDate'] as num).toInt(),
(json['endDate'] as num).toInt(), (json['endDate'] as num).toInt(),
); );
Map<String, dynamic> _$GetHolidaysResponseObjectToJson( Map<String, dynamic> _$GetHolidaysResponseObjectToJson(
GetHolidaysResponseObject instance, GetHolidaysResponseObject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'name': instance.name, 'name': instance.name,
'longName': instance.longName, 'longName': instance.longName,
'startDate': instance.startDate, 'startDate': instance.startDate,
'endDate': instance.endDate, 'endDate': instance.endDate,
}; };

View File

@@ -8,38 +8,44 @@ part of 'getRoomsResponse.dart';
GetRoomsResponse _$GetRoomsResponseFromJson(Map<String, dynamic> json) => GetRoomsResponse _$GetRoomsResponseFromJson(Map<String, dynamic> json) =>
GetRoomsResponse( GetRoomsResponse(
(json['result'] as List<dynamic>) (json['result'] as List<dynamic>)
.map( .map(
(e) => GetRoomsResponseObject.fromJson(e as Map<String, dynamic>), (e) => GetRoomsResponseObject.fromJson(e as Map<String, dynamic>))
) .toSet(),
.toSet(), )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$GetRoomsResponseToJson(GetRoomsResponse instance) => Map<String, dynamic> _$GetRoomsResponseToJson(GetRoomsResponse instance) {
<String, dynamic>{ final val = <String, dynamic>{};
'headers': ?instance.headers,
'result': instance.result.map((e) => e.toJson()).toList(), void writeNotNull(String key, dynamic value) {
}; if (value != null) {
val[key] = value;
}
}
writeNotNull('headers', instance.headers);
val['result'] = instance.result.map((e) => e.toJson()).toList();
return val;
}
GetRoomsResponseObject _$GetRoomsResponseObjectFromJson( GetRoomsResponseObject _$GetRoomsResponseObjectFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetRoomsResponseObject( GetRoomsResponseObject(
(json['id'] as num).toInt(), (json['id'] as num).toInt(),
json['name'] as String, json['name'] as String,
json['longName'] as String, json['longName'] as String,
json['active'] as bool, json['active'] as bool,
json['building'] as String, json['building'] as String,
); );
Map<String, dynamic> _$GetRoomsResponseObjectToJson( Map<String, dynamic> _$GetRoomsResponseObjectToJson(
GetRoomsResponseObject instance, GetRoomsResponseObject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'name': instance.name, 'name': instance.name,
'longName': instance.longName, 'longName': instance.longName,
'active': instance.active, 'active': instance.active,
'building': instance.building, 'building': instance.building,
}; };

View File

@@ -8,40 +8,44 @@ part of 'getSubjectsResponse.dart';
GetSubjectsResponse _$GetSubjectsResponseFromJson(Map<String, dynamic> json) => GetSubjectsResponse _$GetSubjectsResponseFromJson(Map<String, dynamic> json) =>
GetSubjectsResponse( GetSubjectsResponse(
(json['result'] as List<dynamic>) (json['result'] as List<dynamic>)
.map( .map((e) =>
(e) => GetSubjectsResponseObject.fromJson(e as Map<String, dynamic>))
GetSubjectsResponseObject.fromJson(e as Map<String, dynamic>), .toSet(),
) )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
.toSet(),
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$GetSubjectsResponseToJson( Map<String, dynamic> _$GetSubjectsResponseToJson(GetSubjectsResponse instance) {
GetSubjectsResponse instance, final val = <String, dynamic>{};
) => <String, dynamic>{
'headers': ?instance.headers, void writeNotNull(String key, dynamic value) {
'result': instance.result.map((e) => e.toJson()).toList(), if (value != null) {
}; val[key] = value;
}
}
writeNotNull('headers', instance.headers);
val['result'] = instance.result.map((e) => e.toJson()).toList();
return val;
}
GetSubjectsResponseObject _$GetSubjectsResponseObjectFromJson( GetSubjectsResponseObject _$GetSubjectsResponseObjectFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetSubjectsResponseObject( GetSubjectsResponseObject(
(json['id'] as num).toInt(), (json['id'] as num).toInt(),
json['name'] as String, json['name'] as String,
json['longName'] as String, json['longName'] as String,
json['alternateName'] as String, json['alternateName'] as String,
json['active'] as bool, json['active'] as bool,
); );
Map<String, dynamic> _$GetSubjectsResponseObjectToJson( Map<String, dynamic> _$GetSubjectsResponseObjectToJson(
GetSubjectsResponseObject instance, GetSubjectsResponseObject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'name': instance.name, 'name': instance.name,
'longName': instance.longName, 'longName': instance.longName,
'alternateName': instance.alternateName, 'alternateName': instance.alternateName,
'active': instance.active, 'active': instance.active,
}; };

View File

@@ -9,68 +9,85 @@ part of 'getTimetableParams.dart';
GetTimetableParams _$GetTimetableParamsFromJson(Map<String, dynamic> json) => GetTimetableParams _$GetTimetableParamsFromJson(Map<String, dynamic> json) =>
GetTimetableParams( GetTimetableParams(
options: GetTimetableParamsOptions.fromJson( options: GetTimetableParamsOptions.fromJson(
json['options'] as Map<String, dynamic>, json['options'] as Map<String, dynamic>),
),
); );
Map<String, dynamic> _$GetTimetableParamsToJson(GetTimetableParams instance) => Map<String, dynamic> _$GetTimetableParamsToJson(GetTimetableParams instance) =>
<String, dynamic>{'options': instance.options.toJson()}; <String, dynamic>{
'options': instance.options.toJson(),
};
GetTimetableParamsOptions _$GetTimetableParamsOptionsFromJson( GetTimetableParamsOptions _$GetTimetableParamsOptionsFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetTimetableParamsOptions( GetTimetableParamsOptions(
element: GetTimetableParamsOptionsElement.fromJson( element: GetTimetableParamsOptionsElement.fromJson(
json['element'] as Map<String, dynamic>, json['element'] as Map<String, dynamic>),
), startDate: (json['startDate'] as num?)?.toInt(),
startDate: (json['startDate'] as num?)?.toInt(), endDate: (json['endDate'] as num?)?.toInt(),
endDate: (json['endDate'] as num?)?.toInt(), onlyBaseTimetable: json['onlyBaseTimetable'] as bool?,
onlyBaseTimetable: json['onlyBaseTimetable'] as bool?, showBooking: json['showBooking'] as bool?,
showBooking: json['showBooking'] as bool?, showInfo: json['showInfo'] as bool?,
showInfo: json['showInfo'] as bool?, showSubstText: json['showSubstText'] as bool?,
showSubstText: json['showSubstText'] as bool?, showLsText: json['showLsText'] as bool?,
showLsText: json['showLsText'] as bool?, showLsNumber: json['showLsNumber'] as bool?,
showLsNumber: json['showLsNumber'] as bool?, showStudentgroup: json['showStudentgroup'] as bool?,
showStudentgroup: json['showStudentgroup'] as bool?, klasseFields: (json['klasseFields'] as List<dynamic>?)
klasseFields: (json['klasseFields'] as List<dynamic>?) ?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e))
?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e)) .toList(),
.toList(), roomFields: (json['roomFields'] as List<dynamic>?)
roomFields: (json['roomFields'] as List<dynamic>?) ?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e))
?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e)) .toList(),
.toList(), subjectFields: (json['subjectFields'] as List<dynamic>?)
subjectFields: (json['subjectFields'] as List<dynamic>?) ?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e))
?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e)) .toList(),
.toList(), teacherFields: (json['teacherFields'] as List<dynamic>?)
teacherFields: (json['teacherFields'] as List<dynamic>?) ?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e))
?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e)) .toList(),
.toList(), );
);
Map<String, dynamic> _$GetTimetableParamsOptionsToJson( Map<String, dynamic> _$GetTimetableParamsOptionsToJson(
GetTimetableParamsOptions instance, GetTimetableParamsOptions instance) {
) => <String, dynamic>{ final val = <String, dynamic>{
'element': instance.element.toJson(), 'element': instance.element.toJson(),
'startDate': ?instance.startDate, };
'endDate': ?instance.endDate,
'onlyBaseTimetable': ?instance.onlyBaseTimetable, void writeNotNull(String key, dynamic value) {
'showBooking': ?instance.showBooking, if (value != null) {
'showInfo': ?instance.showInfo, val[key] = value;
'showSubstText': ?instance.showSubstText, }
'showLsText': ?instance.showLsText, }
'showLsNumber': ?instance.showLsNumber,
'showStudentgroup': ?instance.showStudentgroup, writeNotNull('startDate', instance.startDate);
'klasseFields': ?instance.klasseFields writeNotNull('endDate', instance.endDate);
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!) writeNotNull('onlyBaseTimetable', instance.onlyBaseTimetable);
.toList(), writeNotNull('showBooking', instance.showBooking);
'roomFields': ?instance.roomFields writeNotNull('showInfo', instance.showInfo);
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!) writeNotNull('showSubstText', instance.showSubstText);
.toList(), writeNotNull('showLsText', instance.showLsText);
'subjectFields': ?instance.subjectFields writeNotNull('showLsNumber', instance.showLsNumber);
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!) writeNotNull('showStudentgroup', instance.showStudentgroup);
.toList(), writeNotNull(
'teacherFields': ?instance.teacherFields 'klasseFields',
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!) instance.klasseFields
.toList(), ?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
}; .toList());
writeNotNull(
'roomFields',
instance.roomFields
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
.toList());
writeNotNull(
'subjectFields',
instance.subjectFields
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
.toList());
writeNotNull(
'teacherFields',
instance.teacherFields
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
.toList());
return val;
}
const _$GetTimetableParamsOptionsFieldsEnumMap = { const _$GetTimetableParamsOptionsFieldsEnumMap = {
GetTimetableParamsOptionsFields.id: 'id', GetTimetableParamsOptionsFields.id: 'id',
@@ -80,24 +97,31 @@ const _$GetTimetableParamsOptionsFieldsEnumMap = {
}; };
GetTimetableParamsOptionsElement _$GetTimetableParamsOptionsElementFromJson( GetTimetableParamsOptionsElement _$GetTimetableParamsOptionsElementFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetTimetableParamsOptionsElement( GetTimetableParamsOptionsElement(
id: (json['id'] as num).toInt(), id: (json['id'] as num).toInt(),
type: (json['type'] as num).toInt(), type: (json['type'] as num).toInt(),
keyType: $enumDecodeNullable( keyType: $enumDecodeNullable(
_$GetTimetableParamsOptionsElementKeyTypeEnumMap, _$GetTimetableParamsOptionsElementKeyTypeEnumMap, json['keyType']),
json['keyType'], );
),
);
Map<String, dynamic> _$GetTimetableParamsOptionsElementToJson( Map<String, dynamic> _$GetTimetableParamsOptionsElementToJson(
GetTimetableParamsOptionsElement instance, GetTimetableParamsOptionsElement instance) {
) => <String, dynamic>{ final val = <String, dynamic>{
'id': instance.id, 'id': instance.id,
'type': instance.type, 'type': instance.type,
'keyType': };
?_$GetTimetableParamsOptionsElementKeyTypeEnumMap[instance.keyType],
}; void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('keyType',
_$GetTimetableParamsOptionsElementKeyTypeEnumMap[instance.keyType]);
return val;
}
const _$GetTimetableParamsOptionsElementKeyTypeEnumMap = { const _$GetTimetableParamsOptionsElementKeyTypeEnumMap = {
GetTimetableParamsOptionsElementKeyType.id: 'id', GetTimetableParamsOptionsElementKeyType.id: 'id',

View File

@@ -7,199 +7,192 @@ part of 'getTimetableResponse.dart';
// ************************************************************************** // **************************************************************************
GetTimetableResponse _$GetTimetableResponseFromJson( GetTimetableResponse _$GetTimetableResponseFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) =>
GetTimetableResponse( GetTimetableResponse(
(json['result'] as List<dynamic>) (json['result'] as List<dynamic>)
.map( .map((e) =>
(e) => GetTimetableResponseObject.fromJson( GetTimetableResponseObject.fromJson(e as Map<String, dynamic>))
e as Map<String, dynamic>, .toSet(),
), )..headers = (json['headers'] as Map<String, dynamic>?)?.map(
)
.toSet(),
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String), (k, e) => MapEntry(k, e as String),
); );
Map<String, dynamic> _$GetTimetableResponseToJson( Map<String, dynamic> _$GetTimetableResponseToJson(
GetTimetableResponse instance, GetTimetableResponse instance) {
) => <String, dynamic>{ final val = <String, dynamic>{};
'headers': ?instance.headers,
'result': instance.result.map((e) => e.toJson()).toList(), void writeNotNull(String key, dynamic value) {
}; if (value != null) {
val[key] = value;
}
}
writeNotNull('headers', instance.headers);
val['result'] = instance.result.map((e) => e.toJson()).toList();
return val;
}
GetTimetableResponseObject _$GetTimetableResponseObjectFromJson( GetTimetableResponseObject _$GetTimetableResponseObjectFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetTimetableResponseObject( GetTimetableResponseObject(
id: (json['id'] as num).toInt(), id: (json['id'] as num).toInt(),
date: (json['date'] as num).toInt(), date: (json['date'] as num).toInt(),
startTime: (json['startTime'] as num).toInt(), startTime: (json['startTime'] as num).toInt(),
endTime: (json['endTime'] as num).toInt(), endTime: (json['endTime'] as num).toInt(),
lstype: json['lstype'] as String?, lstype: json['lstype'] as String?,
code: json['code'] as String?, code: json['code'] as String?,
info: json['info'] as String?, info: json['info'] as String?,
substText: json['substText'] as String?, substText: json['substText'] as String?,
lstext: json['lstext'] as String?, lstext: json['lstext'] as String?,
lsnumber: (json['lsnumber'] as num?)?.toInt(), lsnumber: (json['lsnumber'] as num?)?.toInt(),
statflags: json['statflags'] as String?, statflags: json['statflags'] as String?,
activityType: json['activityType'] as String?, activityType: json['activityType'] as String?,
sg: json['sg'] as String?, sg: json['sg'] as String?,
bkRemark: json['bkRemark'] as String?, bkRemark: json['bkRemark'] as String?,
kl: (json['kl'] as List<dynamic>) kl: (json['kl'] as List<dynamic>)
.map( .map((e) => GetTimetableResponseObjectClass.fromJson(
(e) => e as Map<String, dynamic>))
GetTimetableResponseObjectClass.fromJson(e as Map<String, dynamic>), .toList(),
) te: (json['te'] as List<dynamic>)
.toList(), .map((e) => GetTimetableResponseObjectTeacher.fromJson(
te: (json['te'] as List<dynamic>) e as Map<String, dynamic>))
.map( .toList(),
(e) => GetTimetableResponseObjectTeacher.fromJson( su: (json['su'] as List<dynamic>)
e as Map<String, dynamic>, .map((e) => GetTimetableResponseObjectSubject.fromJson(
), e as Map<String, dynamic>))
) .toList(),
.toList(), ro: (json['ro'] as List<dynamic>)
su: (json['su'] as List<dynamic>) .map((e) => GetTimetableResponseObjectRoom.fromJson(
.map( e as Map<String, dynamic>))
(e) => GetTimetableResponseObjectSubject.fromJson( .toList(),
e as Map<String, dynamic>, )..bkText = json['bkText'] as String?;
),
)
.toList(),
ro: (json['ro'] as List<dynamic>)
.map(
(e) =>
GetTimetableResponseObjectRoom.fromJson(e as Map<String, dynamic>),
)
.toList(),
)..bkText = json['bkText'] as String?;
Map<String, dynamic> _$GetTimetableResponseObjectToJson( Map<String, dynamic> _$GetTimetableResponseObjectToJson(
GetTimetableResponseObject instance, GetTimetableResponseObject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'date': instance.date, 'date': instance.date,
'startTime': instance.startTime, 'startTime': instance.startTime,
'endTime': instance.endTime, 'endTime': instance.endTime,
'lstype': instance.lstype, 'lstype': instance.lstype,
'code': instance.code, 'code': instance.code,
'info': instance.info, 'info': instance.info,
'substText': instance.substText, 'substText': instance.substText,
'lstext': instance.lstext, 'lstext': instance.lstext,
'lsnumber': instance.lsnumber, 'lsnumber': instance.lsnumber,
'statflags': instance.statflags, 'statflags': instance.statflags,
'activityType': instance.activityType, 'activityType': instance.activityType,
'sg': instance.sg, 'sg': instance.sg,
'bkRemark': instance.bkRemark, 'bkRemark': instance.bkRemark,
'bkText': instance.bkText, 'bkText': instance.bkText,
'kl': instance.kl.map((e) => e.toJson()).toList(), 'kl': instance.kl.map((e) => e.toJson()).toList(),
'te': instance.te.map((e) => e.toJson()).toList(), 'te': instance.te.map((e) => e.toJson()).toList(),
'su': instance.su.map((e) => e.toJson()).toList(), 'su': instance.su.map((e) => e.toJson()).toList(),
'ro': instance.ro.map((e) => e.toJson()).toList(), 'ro': instance.ro.map((e) => e.toJson()).toList(),
}; };
GetTimetableResponseObjectFields _$GetTimetableResponseObjectFieldsFromJson( GetTimetableResponseObjectFields _$GetTimetableResponseObjectFieldsFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetTimetableResponseObjectFields( GetTimetableResponseObjectFields(
(json['te'] as List<dynamic>?) (json['te'] as List<dynamic>?)
?.map( ?.map((e) => GetTimetableResponseObjectFieldsObject.fromJson(
(e) => GetTimetableResponseObjectFieldsObject.fromJson( e as Map<String, dynamic>))
e as Map<String, dynamic>, .toList(),
),
)
.toList(),
);
Map<String, dynamic> _$GetTimetableResponseObjectFieldsToJson(
GetTimetableResponseObjectFields instance,
) => <String, dynamic>{'te': instance.te?.map((e) => e.toJson()).toList()};
GetTimetableResponseObjectFieldsObject
_$GetTimetableResponseObjectFieldsObjectFromJson(Map<String, dynamic> json) =>
GetTimetableResponseObjectFieldsObject(
id: (json['id'] as num?)?.toInt(),
name: json['name'] as String?,
longname: json['longname'] as String?,
externalkey: json['externalkey'] as String?,
); );
Map<String, dynamic> _$GetTimetableResponseObjectFieldsToJson(
GetTimetableResponseObjectFields instance) =>
<String, dynamic>{
'te': instance.te?.map((e) => e.toJson()).toList(),
};
GetTimetableResponseObjectFieldsObject
_$GetTimetableResponseObjectFieldsObjectFromJson(
Map<String, dynamic> json) =>
GetTimetableResponseObjectFieldsObject(
id: (json['id'] as num?)?.toInt(),
name: json['name'] as String?,
longname: json['longname'] as String?,
externalkey: json['externalkey'] as String?,
);
Map<String, dynamic> _$GetTimetableResponseObjectFieldsObjectToJson( Map<String, dynamic> _$GetTimetableResponseObjectFieldsObjectToJson(
GetTimetableResponseObjectFieldsObject instance, GetTimetableResponseObjectFieldsObject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'name': instance.name, 'name': instance.name,
'longname': instance.longname, 'longname': instance.longname,
'externalkey': instance.externalkey, 'externalkey': instance.externalkey,
}; };
GetTimetableResponseObjectClass _$GetTimetableResponseObjectClassFromJson( GetTimetableResponseObjectClass _$GetTimetableResponseObjectClassFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetTimetableResponseObjectClass( GetTimetableResponseObjectClass(
(json['id'] as num).toInt(), (json['id'] as num).toInt(),
json['name'] as String, json['name'] as String,
json['longname'] as String, json['longname'] as String,
json['externalkey'] as String?, json['externalkey'] as String?,
); );
Map<String, dynamic> _$GetTimetableResponseObjectClassToJson( Map<String, dynamic> _$GetTimetableResponseObjectClassToJson(
GetTimetableResponseObjectClass instance, GetTimetableResponseObjectClass instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'name': instance.name, 'name': instance.name,
'longname': instance.longname, 'longname': instance.longname,
'externalkey': instance.externalkey, 'externalkey': instance.externalkey,
}; };
GetTimetableResponseObjectTeacher _$GetTimetableResponseObjectTeacherFromJson( GetTimetableResponseObjectTeacher _$GetTimetableResponseObjectTeacherFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetTimetableResponseObjectTeacher( GetTimetableResponseObjectTeacher(
(json['id'] as num).toInt(), (json['id'] as num).toInt(),
json['name'] as String, json['name'] as String,
json['longname'] as String, json['longname'] as String,
(json['orgid'] as num?)?.toInt(), (json['orgid'] as num?)?.toInt(),
json['orgname'] as String?, json['orgname'] as String?,
json['externalkey'] as String?, json['externalkey'] as String?,
); );
Map<String, dynamic> _$GetTimetableResponseObjectTeacherToJson( Map<String, dynamic> _$GetTimetableResponseObjectTeacherToJson(
GetTimetableResponseObjectTeacher instance, GetTimetableResponseObjectTeacher instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'name': instance.name, 'name': instance.name,
'longname': instance.longname, 'longname': instance.longname,
'orgid': instance.orgid, 'orgid': instance.orgid,
'orgname': instance.orgname, 'orgname': instance.orgname,
'externalkey': instance.externalkey, 'externalkey': instance.externalkey,
}; };
GetTimetableResponseObjectSubject _$GetTimetableResponseObjectSubjectFromJson( GetTimetableResponseObjectSubject _$GetTimetableResponseObjectSubjectFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetTimetableResponseObjectSubject( GetTimetableResponseObjectSubject(
(json['id'] as num).toInt(), (json['id'] as num).toInt(),
json['name'] as String, json['name'] as String,
json['longname'] as String, json['longname'] as String,
); );
Map<String, dynamic> _$GetTimetableResponseObjectSubjectToJson( Map<String, dynamic> _$GetTimetableResponseObjectSubjectToJson(
GetTimetableResponseObjectSubject instance, GetTimetableResponseObjectSubject instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'name': instance.name, 'name': instance.name,
'longname': instance.longname, 'longname': instance.longname,
}; };
GetTimetableResponseObjectRoom _$GetTimetableResponseObjectRoomFromJson( GetTimetableResponseObjectRoom _$GetTimetableResponseObjectRoomFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => GetTimetableResponseObjectRoom( GetTimetableResponseObjectRoom(
(json['id'] as num).toInt(), (json['id'] as num).toInt(),
json['name'] as String, json['name'] as String,
json['longname'] as String, json['longname'] as String,
); );
Map<String, dynamic> _$GetTimetableResponseObjectRoomToJson( Map<String, dynamic> _$GetTimetableResponseObjectRoomToJson(
GetTimetableResponseObjectRoom instance, GetTimetableResponseObjectRoom instance) =>
) => <String, dynamic>{ <String, dynamic>{
'id': instance.id, 'id': instance.id,
'name': instance.name, 'name': instance.name,
'longname': instance.longname, 'longname': instance.longname,
}; };

View File

@@ -19,7 +19,7 @@ abstract class WebuntisApi extends ApiRequest {
WebuntisApi(this.method, this.genericParam, {this.authenticatedResponse = true}); WebuntisApi(this.method, this.genericParam, {this.authenticatedResponse = true});
Future<String> query(WebuntisApi untis, {bool retry = false}) async { Future<String> query(WebuntisApi untis) async {
var query = '{"id":"ID","method":"$method","params":${untis._body()},"jsonrpc":"2.0"}'; var query = '{"id":"ID","method":"$method","params":${untis._body()},"jsonrpc":"2.0"}';
var sessionId = '0'; var sessionId = '0';
@@ -32,9 +32,8 @@ abstract class WebuntisApi extends ApiRequest {
dynamic jsonData = jsonDecode(data.body); dynamic jsonData = jsonDecode(data.body);
if(jsonData['error'] != null) { if(jsonData['error'] != null) {
if(jsonData['error']['code'] == -8520) { if(jsonData['error']['code'] == -8520) {
if(retry) throw WebuntisError('Authentication was tried (probably session timeout), but was not successful!', 1);
await Authenticate.createSession(); await Authenticate.createSession();
return await this.query(untis, retry: true); this.query(untis);
} else { } else {
throw WebuntisError(jsonData['error']['message'], jsonData['error']['code']); throw WebuntisError(jsonData['error']['message'], jsonData['error']['code']);
} }

View File

@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
import 'state/app/modules/app_modules.dart'; import 'state/app/modules/app_modules.dart';
import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart'; import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:badges/badges.dart' as badges;
import 'api/mhsl/breaker/getBreakers/getBreakersResponse.dart'; import 'api/mhsl/breaker/getBreakers/getBreakersResponse.dart';
import 'api/mhsl/server/userIndex/update/updateUserindex.dart'; import 'api/mhsl/server/userIndex/update/updateUserindex.dart';
@@ -92,34 +93,57 @@ class _AppState extends State<App> with WidgetsBindingObserver {
} }
@override @override
Widget build(BuildContext context) => Consumer<SettingsProvider>(builder: (context, settings, child) => PersistentTabView( Widget build(BuildContext context) => PersistentTabView(
controller: Main.bottomNavigator, controller: Main.bottomNavigator,
navBarOverlap: const NavBarOverlap.none(), navBarOverlap: const NavBarOverlap.none(),
backgroundColor: Theme.of(context).colorScheme.primary, backgroundColor: Theme.of(context).colorScheme.primary,
handleAndroidBackButtonPress: false, handleAndroidBackButtonPress: true,
screenTransitionAnimation: const ScreenTransitionAnimation(curve: Curves.easeOutQuad, duration: Duration(milliseconds: 200)), screenTransitionAnimation: const ScreenTransitionAnimation(curve: Curves.easeOutQuad, duration: Duration(milliseconds: 200)),
tabs: [ tabs: [
...AppModule.getBottomBarModules(context).map((e) => e.toBottomTab(context)), AppModule.getModule(Modules.timetable).toBottomTab(context),
AppModule.getModule(Modules.talk).toBottomTab(
PersistentTabConfig( context,
screen: const Breaker(breaker: BreakerArea.more, child: Overhang()), itemBuilder: (icon) => Consumer<ChatListProps>(
item: ItemConfig( builder: (context, value, child) {
activeForegroundColor: Theme.of(context).primaryColor, if(value.primaryLoading()) return Icon(icon);
inactiveForegroundColor: Theme.of(context).colorScheme.secondary, var messages = value.getRoomsResponse.data.map((e) => e.unreadMessages).reduce((a, b) => a+b);
icon: const Icon(Icons.apps), return badges.Badge(
title: 'Mehr' showBadge: messages > 0,
), position: badges.BadgePosition.topEnd(top: -3, end: -3),
), stackFit: StackFit.loose,
], badgeStyle: badges.BadgeStyle(
navBarBuilder: (config) => Style6BottomNavBar( padding: const EdgeInsets.all(3),
navBarConfig: config, badgeColor: Theme.of(context).primaryColor,
navBarDecoration: NavBarDecoration( elevation: 1,
border: const Border(top: BorderSide(width: 1, color: Colors.grey)), ),
color: Theme.of(context).colorScheme.surface, badgeContent: Text('$messages', style: const TextStyle(color: Colors.white, fontSize: 10, fontWeight: FontWeight.bold)),
child: Icon(icon),
);
},
), ),
), ),
)); AppModule.getModule(Modules.blocFiles).toBottomTab(context),
AppModule.getModule(Modules.files).toBottomTab(context),
PersistentTabConfig(
screen: const Breaker(breaker: BreakerArea.more, child: Overhang()),
item: ItemConfig(
activeForegroundColor: Theme.of(context).primaryColor,
inactiveForegroundColor: Theme.of(context).colorScheme.secondary,
icon: const Icon(Icons.apps),
title: 'Mehr'
),
),
],
navBarBuilder: (config) => Style6BottomNavBar(
navBarConfig: config,
navBarDecoration: NavBarDecoration(
border: const Border(top: BorderSide(width: 1, color: Colors.grey)),
color: Theme.of(context).colorScheme.surface,
),
),
);
@override @override
void dispose() { void dispose() {

View File

@@ -7,13 +7,13 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hydrated_bloc/hydrated_bloc.dart'; import 'package:hydrated_bloc/hydrated_bloc.dart';
import 'package:jiffy/jiffy.dart'; import 'package:jiffy/jiffy.dart';
import 'package:loader_overlay/loader_overlay.dart'; import 'package:loader_overlay/loader_overlay.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart'; import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'api/mhsl/breaker/getBreakers/getBreakersResponse.dart'; import 'api/mhsl/breaker/getBreakers/getBreakersResponse.dart';
import 'app.dart'; import 'app.dart';
@@ -42,16 +42,13 @@ Future<void> main() async {
var initialisationTasks = [ var initialisationTasks = [
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform) Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform)
.then((value) async => log("Firebase token: ${await FirebaseMessaging.instance.getToken() ?? "Error: no Firebase token!"}")) .then((value) async => log("Firebase token: ${await FirebaseMessaging.instance.getToken() ?? "Error: no Firebase token!"}"))
.onError((error, stackTrace) => log('Error initializing Firebase: $error')), .onError((error, stackTrace) => log('Error initializing Firebase: $error', stackTrace: stackTrace)),
PlatformAssetBundle().load('assets/ca/lets-encrypt-r3.pem').then(addCertificateAsTrusted), PlatformAssetBundle().load('assets/ca/lets-encrypt-r3.pem').then(addCertificateAsTrusted),
PlatformAssetBundle().load('assets/ca/lets-encrypt-r10.pem').then(addCertificateAsTrusted), PlatformAssetBundle().load('assets/ca/lets-encrypt-r10.pem').then(addCertificateAsTrusted),
PlatformAssetBundle().load('assets/ca/lets-encrypt-r13.pem').then(addCertificateAsTrusted),
Future(() async { Future(() async {
await HydratedStorage.build( await HydratedStorage.build(storageDirectory: await getTemporaryDirectory()).then((storage) => HydratedBloc.storage = storage);
storageDirectory: HydratedStorageDirectory((await getTemporaryDirectory()).path)
).then((storage) => HydratedBloc.storage = storage);
}) })
]; ];

View File

@@ -23,11 +23,7 @@ class _BreakerState extends State<Breaker> {
builder: (context, value, child) { builder: (context, value, child) {
var blocked = value.isBlocked(widget.breaker); var blocked = value.isBlocked(widget.breaker);
if(blocked != null) { if(blocked != null) {
return PlaceholderView( return PlaceholderView(icon: Icons.security_outlined, text: "Die App/ Dieser Bereich wurde als Schutzmaßnahme deaktiviert!\n\n${blocked.isEmpty ? "Es wurde vom Server kein Grund übermittelt." : blocked}");
icon: Icons.app_blocking_outlined,
text: 'Die App / Dieser Bereich ist zurzeit nicht verfügbar!\n\n'
"${blocked.isEmpty ? "Es wurde vom Server kein Grund übermittelt.\nAktualisiere die App und versuche es später erneut" : blocked}"
);
} }
return widget.child; return widget.child;

View File

@@ -1,5 +1,4 @@
import 'package:flutter/foundation.dart'; import 'package:package_info/package_info.dart';
import 'package:package_info_plus/package_info_plus.dart';
import '../../api/apiResponse.dart'; import '../../api/apiResponse.dart';
import '../../api/mhsl/breaker/getBreakers/getBreakersCache.dart'; import '../../api/mhsl/breaker/getBreakers/getBreakersCache.dart';
@@ -11,10 +10,8 @@ class BreakerProps extends DataHolder {
GetBreakersResponse get getBreakersResponse => _getBreakersResponse!; GetBreakersResponse get getBreakersResponse => _getBreakersResponse!;
PackageInfo? packageInfo; PackageInfo? packageInfo;
String? isBlocked(BreakerArea? type) { String? isBlocked(BreakerArea? type) {
if(kDebugMode) return null;
if(packageInfo == null) { if(packageInfo == null) {
PackageInfo.fromPlatform().then((value) => packageInfo = value); PackageInfo.fromPlatform().then((value) => packageInfo = value);
return null; return null;

View File

@@ -1,5 +1,5 @@
import 'package:flutter_app_badge/flutter_app_badge.dart'; import 'package:flutter_app_badger/flutter_app_badger.dart';
import '../../api/apiResponse.dart'; import '../../api/apiResponse.dart';
import '../../api/marianumcloud/talk/room/getRoomCache.dart'; import '../../api/marianumcloud/talk/room/getRoomCache.dart';
@@ -20,7 +20,7 @@ class ChatListProps extends DataHolder {
onUpdate: (GetRoomResponse data) => { onUpdate: (GetRoomResponse data) => {
_getRoomResponse = data, _getRoomResponse = data,
notifyListeners(), notifyListeners(),
FlutterAppBadge.count(data.data.map((e) => e.unreadMessages).reduce((a, b) => a+b)) FlutterAppBadger.updateBadgeCount(data.data.map((e) => e.unreadMessages).reduce((a, b) => a+b))
} }
); );
} }

View File

@@ -41,7 +41,7 @@ class EndpointData {
Endpoint webuntis() => EndpointOptions( Endpoint webuntis() => EndpointOptions(
live: Endpoint( live: Endpoint(
domain: 'marianum-fulda.webuntis.com', domain: 'peleus.webuntis.com',
), ),
staged: Endpoint( staged: Endpoint(
domain: 'mhsl.eu', domain: 'mhsl.eu',

View File

@@ -44,7 +44,7 @@ class NotificationController {
} }
static Future<void> onAppOpenedByNotification(RemoteMessage message, BuildContext context) async { static Future<void> onAppOpenedByNotification(RemoteMessage message, BuildContext context) async {
NotificationTasks.navigateToTalk(context); NotificationTasks.navigateToTalk();
NotificationTasks.updateProviders(context); NotificationTasks.updateProviders(context);
DebugTile(context).run(() { DebugTile(context).run(() {

View File

@@ -15,6 +15,9 @@ class NotificationService {
); );
final iosSettings = DarwinInitializationSettings( final iosSettings = DarwinInitializationSettings(
onDidReceiveLocalNotification: (id, title, body, payload) {
// TODO Navigate to Talk section (This runs when an Notification is tapped)
},
); );

View File

@@ -1,16 +1,15 @@
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_app_badge/flutter_app_badge.dart'; import 'package:flutter_app_badger/flutter_app_badger.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../main.dart'; import '../main.dart';
import '../model/chatList/chatListProps.dart'; import '../model/chatList/chatListProps.dart';
import '../model/chatList/chatProps.dart'; import '../model/chatList/chatProps.dart';
import '../state/app/modules/app_modules.dart';
class NotificationTasks { class NotificationTasks {
static void updateBadgeCount(RemoteMessage notification) { static void updateBadgeCount(RemoteMessage notification) {
FlutterAppBadge.count(int.parse(notification.data['unreadCount'] ?? 0)); FlutterAppBadger.updateBadgeCount(int.parse(notification.data['unreadCount'] ?? 0));
} }
static void updateProviders(BuildContext context) { static void updateProviders(BuildContext context) {
@@ -18,9 +17,7 @@ class NotificationTasks {
Provider.of<ChatProps>(context, listen: false).run(); Provider.of<ChatProps>(context, listen: false).run();
} }
static void navigateToTalk(BuildContext context) { static void navigateToTalk() {
var talkTab = AppModule.getBottomBarModules(context).map((e) => e.module).toList().indexOf(Modules.talk); Main.bottomNavigator.jumpToTab(1);
if(talkTab == -1) return;
Main.bottomNavigator.jumpToTab(talkTab);
} }
} }

View File

@@ -1,8 +1,8 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import '../../infrastructure/dataLoader/data_loader.dart'; import '../../infrastructure/dataLoader/http_data_loader.dart';
abstract class HolidayDataLoader<TResult> extends DataLoader<TResult> { abstract class HolidayDataLoader<TResult> extends HttpDataLoader<TResult> {
HolidayDataLoader() : super(Dio(BaseOptions( HolidayDataLoader() : super(Dio(BaseOptions(
baseUrl: 'https://ferien-api.de/api/v1/', baseUrl: 'https://ferien-api.de/api/v1/',
))); )));

View File

@@ -1,8 +1,8 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import '../../infrastructure/dataLoader/data_loader.dart'; import '../../infrastructure/dataLoader/http_data_loader.dart';
abstract class MhslDataLoader<TResult> extends DataLoader<TResult> { abstract class MhslDataLoader<TResult> extends HttpDataLoader<TResult> {
MhslDataLoader() : super(Dio(BaseOptions( MhslDataLoader() : super(Dio(BaseOptions(
baseUrl: 'https://mhsl.eu/marianum/marianummobile/' baseUrl: 'https://mhsl.eu/marianum/marianummobile/'
))); )));

View File

@@ -2,26 +2,21 @@ import 'dart:convert';
import 'dart:developer'; import 'dart:developer';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
abstract class DataLoader<TResult> { abstract class HttpDataLoader<TResult> {
final Dio dio; final Dio dio;
DataLoader(this.dio) { HttpDataLoader(this.dio) {
dio.options.connectTimeout = const Duration(seconds: 10).inMilliseconds; dio.options.connectTimeout = const Duration(seconds: 10).inMilliseconds;
dio.options.sendTimeout = const Duration(seconds: 30).inMilliseconds; dio.options.sendTimeout = const Duration(seconds: 30).inMilliseconds;
dio.options.receiveTimeout = const Duration(seconds: 30).inMilliseconds; dio.options.receiveTimeout = const Duration(seconds: 30).inMilliseconds;
} }
Future<TResult> run() async { Future<TResult> run() async {
var fetcher = fetch(); var response = await fetch();
await Future.wait([
fetcher,
Future.delayed(const Duration(milliseconds: 500)) // TODO tune or remove
]);
var response = await fetcher;
try { try {
return assemble(DataLoaderResult( return assemble(DataLoaderResult(
json: jsonDecode(response.data!), json: await compute(jsonDecode, response.data!),
headers: response.headers.map.map((key, value) => MapEntry(key, value.join(';'))), headers: response.headers.map.map((key, value) => MapEntry(key, value.join(';'))),
)); ));
} catch(trace, e) { } catch(trace, e) {

View File

@@ -4,7 +4,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'loadable_state_state.freezed.dart'; part 'loadable_state_state.freezed.dart';
@freezed @freezed
abstract class LoadableStateState with _$LoadableStateState { class LoadableStateState with _$LoadableStateState {
const factory LoadableStateState({ const factory LoadableStateState({
required List<ConnectivityResult>? connections, required List<ConnectivityResult>? connections,
}) = _LoadableStateState; }) = _LoadableStateState;

View File

@@ -1,5 +1,5 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file // coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint // 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 // 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
@@ -9,271 +9,139 @@ part of 'loadable_state_state.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; 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');
/// @nodoc /// @nodoc
mixin _$LoadableStateState { mixin _$LoadableStateState {
List<ConnectivityResult>? get connections =>
throw _privateConstructorUsedError;
List<ConnectivityResult>? get connections; @JsonKey(ignore: true)
/// Create a copy of LoadableStateState $LoadableStateStateCopyWith<LoadableStateState> get copyWith =>
/// with the given fields replaced by the non-null parameter values. throw _privateConstructorUsedError;
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$LoadableStateStateCopyWith<LoadableStateState> get copyWith => _$LoadableStateStateCopyWithImpl<LoadableStateState>(this as LoadableStateState, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoadableStateState&&const DeepCollectionEquality().equals(other.connections, connections));
}
@override
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(connections));
@override
String toString() {
return 'LoadableStateState(connections: $connections)';
}
} }
/// @nodoc /// @nodoc
abstract mixin class $LoadableStateStateCopyWith<$Res> { abstract class $LoadableStateStateCopyWith<$Res> {
factory $LoadableStateStateCopyWith(LoadableStateState value, $Res Function(LoadableStateState) _then) = _$LoadableStateStateCopyWithImpl; factory $LoadableStateStateCopyWith(
@useResult LoadableStateState value, $Res Function(LoadableStateState) then) =
$Res call({ _$LoadableStateStateCopyWithImpl<$Res, LoadableStateState>;
List<ConnectivityResult>? connections @useResult
}); $Res call({List<ConnectivityResult>? connections});
} }
/// @nodoc /// @nodoc
class _$LoadableStateStateCopyWithImpl<$Res> class _$LoadableStateStateCopyWithImpl<$Res, $Val extends LoadableStateState>
implements $LoadableStateStateCopyWith<$Res> { implements $LoadableStateStateCopyWith<$Res> {
_$LoadableStateStateCopyWithImpl(this._self, this._then); _$LoadableStateStateCopyWithImpl(this._value, this._then);
final LoadableStateState _self; // ignore: unused_field
final $Res Function(LoadableStateState) _then; final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of LoadableStateState @pragma('vm:prefer-inline')
/// with the given fields replaced by the non-null parameter values. @override
@pragma('vm:prefer-inline') @override $Res call({Object? connections = freezed,}) { $Res call({
return _then(_self.copyWith( Object? connections = freezed,
connections: freezed == connections ? _self.connections : connections // ignore: cast_nullable_to_non_nullable }) {
as List<ConnectivityResult>?, return _then(_value.copyWith(
)); connections: freezed == connections
? _value.connections
: connections // ignore: cast_nullable_to_non_nullable
as List<ConnectivityResult>?,
) as $Val);
}
} }
/// @nodoc
abstract class _$$LoadableStateStateImplCopyWith<$Res>
implements $LoadableStateStateCopyWith<$Res> {
factory _$$LoadableStateStateImplCopyWith(_$LoadableStateStateImpl value,
$Res Function(_$LoadableStateStateImpl) then) =
__$$LoadableStateStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({List<ConnectivityResult>? connections});
} }
/// @nodoc
class __$$LoadableStateStateImplCopyWithImpl<$Res>
extends _$LoadableStateStateCopyWithImpl<$Res, _$LoadableStateStateImpl>
implements _$$LoadableStateStateImplCopyWith<$Res> {
__$$LoadableStateStateImplCopyWithImpl(_$LoadableStateStateImpl _value,
$Res Function(_$LoadableStateStateImpl) _then)
: super(_value, _then);
/// Adds pattern-matching-related methods to [LoadableStateState]. @pragma('vm:prefer-inline')
extension LoadableStateStatePatterns on LoadableStateState { @override
/// A variant of `map` that fallback to returning `orElse`. $Res call({
/// Object? connections = freezed,
/// It is equivalent to doing: }) {
/// ```dart return _then(_$LoadableStateStateImpl(
/// switch (sealedClass) { connections: freezed == connections
/// case final Subclass value: ? _value._connections
/// return ...; : connections // ignore: cast_nullable_to_non_nullable
/// case _: as List<ConnectivityResult>?,
/// return orElse(); ));
/// } }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LoadableStateState value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _LoadableStateState() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LoadableStateState value) $default,){
final _that = this;
switch (_that) {
case _LoadableStateState():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LoadableStateState value)? $default,){
final _that = this;
switch (_that) {
case _LoadableStateState() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<ConnectivityResult>? connections)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _LoadableStateState() when $default != null:
return $default(_that.connections);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<ConnectivityResult>? connections) $default,) {final _that = this;
switch (_that) {
case _LoadableStateState():
return $default(_that.connections);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<ConnectivityResult>? connections)? $default,) {final _that = this;
switch (_that) {
case _LoadableStateState() when $default != null:
return $default(_that.connections);case _:
return null;
}
}
} }
/// @nodoc /// @nodoc
class _$LoadableStateStateImpl implements _LoadableStateState {
const _$LoadableStateStateImpl(
{required final List<ConnectivityResult>? connections})
: _connections = connections;
class _LoadableStateState implements LoadableStateState { final List<ConnectivityResult>? _connections;
const _LoadableStateState({required final List<ConnectivityResult>? connections}): _connections = connections; @override
List<ConnectivityResult>? get connections {
final value = _connections;
if (value == null) return null;
if (_connections is EqualUnmodifiableListView) return _connections;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(value);
}
final List<ConnectivityResult>? _connections; @override
@override List<ConnectivityResult>? get connections { String toString() {
final value = _connections; return 'LoadableStateState(connections: $connections)';
if (value == null) return null; }
if (_connections is EqualUnmodifiableListView) return _connections;
// ignore: implicit_dynamic_type @override
return EqualUnmodifiableListView(value); bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$LoadableStateStateImpl &&
const DeepCollectionEquality()
.equals(other._connections, _connections));
}
@override
int get hashCode => Object.hash(
runtimeType, const DeepCollectionEquality().hash(_connections));
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$LoadableStateStateImplCopyWith<_$LoadableStateStateImpl> get copyWith =>
__$$LoadableStateStateImplCopyWithImpl<_$LoadableStateStateImpl>(
this, _$identity);
} }
abstract class _LoadableStateState implements LoadableStateState {
const factory _LoadableStateState(
{required final List<ConnectivityResult>? connections}) =
_$LoadableStateStateImpl;
/// Create a copy of LoadableStateState @override
/// with the given fields replaced by the non-null parameter values. List<ConnectivityResult>? get connections;
@override @JsonKey(includeFromJson: false, includeToJson: false) @override
@pragma('vm:prefer-inline') @JsonKey(ignore: true)
_$LoadableStateStateCopyWith<_LoadableStateState> get copyWith => __$LoadableStateStateCopyWithImpl<_LoadableStateState>(this, _$identity); _$$LoadableStateStateImplCopyWith<_$LoadableStateStateImpl> get copyWith =>
throw _privateConstructorUsedError;
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadableStateState&&const DeepCollectionEquality().equals(other._connections, _connections));
} }
@override
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_connections));
@override
String toString() {
return 'LoadableStateState(connections: $connections)';
}
}
/// @nodoc
abstract mixin class _$LoadableStateStateCopyWith<$Res> implements $LoadableStateStateCopyWith<$Res> {
factory _$LoadableStateStateCopyWith(_LoadableStateState value, $Res Function(_LoadableStateState) _then) = __$LoadableStateStateCopyWithImpl;
@override @useResult
$Res call({
List<ConnectivityResult>? connections
});
}
/// @nodoc
class __$LoadableStateStateCopyWithImpl<$Res>
implements _$LoadableStateStateCopyWith<$Res> {
__$LoadableStateStateCopyWithImpl(this._self, this._then);
final _LoadableStateState _self;
final $Res Function(_LoadableStateState) _then;
/// Create a copy of LoadableStateState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? connections = freezed,}) {
return _then(_LoadableStateState(
connections: freezed == connections ? _self._connections : connections // ignore: cast_nullable_to_non_nullable
as List<ConnectivityResult>?,
));
}
}
// dart format on

View File

@@ -5,7 +5,7 @@ import 'loading_error.dart';
part 'loadable_state.freezed.dart'; part 'loadable_state.freezed.dart';
@freezed @freezed
abstract class LoadableState<TState> with _$LoadableState<TState> { class LoadableState<TState> with _$LoadableState {
const LoadableState._(); const LoadableState._();
const factory LoadableState({ const factory LoadableState({
@@ -14,7 +14,7 @@ abstract class LoadableState<TState> with _$LoadableState<TState> {
required int? lastFetch, required int? lastFetch,
required void Function()? reFetch, required void Function()? reFetch,
required LoadingError? error, required LoadingError? error,
}) = _LoadableState<TState>; }) = _LoadableState;
bool _hasError() => error != null; bool _hasError() => error != null;
bool _hasData() => data != null; bool _hasData() => data != null;

View File

@@ -1,5 +1,5 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file // coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint // 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 // 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
@@ -9,299 +9,233 @@ part of 'loadable_state.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; 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');
/// @nodoc /// @nodoc
mixin _$LoadableState<TState> { mixin _$LoadableState<TState> {
bool get isLoading => throw _privateConstructorUsedError;
TState? get data => throw _privateConstructorUsedError;
int? get lastFetch => throw _privateConstructorUsedError;
void Function()? get reFetch => throw _privateConstructorUsedError;
LoadingError? get error => throw _privateConstructorUsedError;
bool get isLoading; TState? get data; int? get lastFetch; void Function()? get reFetch; LoadingError? get error; @JsonKey(ignore: true)
/// Create a copy of LoadableState $LoadableStateCopyWith<TState, LoadableState<TState>> get copyWith =>
/// with the given fields replaced by the non-null parameter values. throw _privateConstructorUsedError;
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$LoadableStateCopyWith<TState, LoadableState<TState>> get copyWith => _$LoadableStateCopyWithImpl<TState, LoadableState<TState>>(this as LoadableState<TState>, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoadableState<TState>&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&const DeepCollectionEquality().equals(other.data, data)&&(identical(other.lastFetch, lastFetch) || other.lastFetch == lastFetch)&&(identical(other.reFetch, reFetch) || other.reFetch == reFetch)&&(identical(other.error, error) || other.error == error));
}
@override
int get hashCode => Object.hash(runtimeType,isLoading,const DeepCollectionEquality().hash(data),lastFetch,reFetch,error);
@override
String toString() {
return 'LoadableState<$TState>(isLoading: $isLoading, data: $data, lastFetch: $lastFetch, reFetch: $reFetch, error: $error)';
}
} }
/// @nodoc /// @nodoc
abstract mixin class $LoadableStateCopyWith<TState,$Res> { abstract class $LoadableStateCopyWith<TState, $Res> {
factory $LoadableStateCopyWith(LoadableState<TState> value, $Res Function(LoadableState<TState>) _then) = _$LoadableStateCopyWithImpl; factory $LoadableStateCopyWith(LoadableState<TState> value,
@useResult $Res Function(LoadableState<TState>) then) =
$Res call({ _$LoadableStateCopyWithImpl<TState, $Res, LoadableState<TState>>;
bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error @useResult
}); $Res call(
{bool isLoading,
TState? data,
$LoadingErrorCopyWith<$Res>? get error; int? lastFetch,
void Function()? reFetch,
LoadingError? error});
$LoadingErrorCopyWith<$Res>? get error;
} }
/// @nodoc /// @nodoc
class _$LoadableStateCopyWithImpl<TState,$Res> class _$LoadableStateCopyWithImpl<TState, $Res,
$Val extends LoadableState<TState>>
implements $LoadableStateCopyWith<TState, $Res> { implements $LoadableStateCopyWith<TState, $Res> {
_$LoadableStateCopyWithImpl(this._self, this._then); _$LoadableStateCopyWithImpl(this._value, this._then);
final LoadableState<TState> _self; // ignore: unused_field
final $Res Function(LoadableState<TState>) _then; final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of LoadableState @pragma('vm:prefer-inline')
/// with the given fields replaced by the non-null parameter values. @override
@pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? data = freezed,Object? lastFetch = freezed,Object? reFetch = freezed,Object? error = freezed,}) { $Res call({
return _then(_self.copyWith( Object? isLoading = null,
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable Object? data = freezed,
as bool,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable Object? lastFetch = freezed,
as TState?,lastFetch: freezed == lastFetch ? _self.lastFetch : lastFetch // ignore: cast_nullable_to_non_nullable Object? reFetch = freezed,
as int?,reFetch: freezed == reFetch ? _self.reFetch : reFetch // ignore: cast_nullable_to_non_nullable Object? error = freezed,
as void Function()?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable }) {
as LoadingError?, return _then(_value.copyWith(
)); isLoading: null == isLoading
} ? _value.isLoading
/// Create a copy of LoadableState : isLoading // ignore: cast_nullable_to_non_nullable
/// with the given fields replaced by the non-null parameter values. as bool,
@override data: freezed == data
@pragma('vm:prefer-inline') ? _value.data
$LoadingErrorCopyWith<$Res>? get error { : data // ignore: cast_nullable_to_non_nullable
if (_self.error == null) { as TState?,
return null; lastFetch: freezed == lastFetch
? _value.lastFetch
: lastFetch // ignore: cast_nullable_to_non_nullable
as int?,
reFetch: freezed == reFetch
? _value.reFetch
: reFetch // ignore: cast_nullable_to_non_nullable
as void Function()?,
error: freezed == error
? _value.error
: error // ignore: cast_nullable_to_non_nullable
as LoadingError?,
) as $Val);
} }
return $LoadingErrorCopyWith<$Res>(_self.error!, (value) { @override
return _then(_self.copyWith(error: value)); @pragma('vm:prefer-inline')
}); $LoadingErrorCopyWith<$Res>? get error {
} if (_value.error == null) {
return null;
}
return $LoadingErrorCopyWith<$Res>(_value.error!, (value) {
return _then(_value.copyWith(error: value) as $Val);
});
}
} }
/// @nodoc
abstract class _$$LoadableStateImplCopyWith<TState, $Res>
implements $LoadableStateCopyWith<TState, $Res> {
factory _$$LoadableStateImplCopyWith(_$LoadableStateImpl<TState> value,
$Res Function(_$LoadableStateImpl<TState>) then) =
__$$LoadableStateImplCopyWithImpl<TState, $Res>;
@override
@useResult
$Res call(
{bool isLoading,
TState? data,
int? lastFetch,
void Function()? reFetch,
LoadingError? error});
/// Adds pattern-matching-related methods to [LoadableState]. @override
extension LoadableStatePatterns<TState> on LoadableState<TState> { $LoadingErrorCopyWith<$Res>? get error;
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LoadableState<TState> value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _LoadableState() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LoadableState<TState> value) $default,){
final _that = this;
switch (_that) {
case _LoadableState():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LoadableState<TState> value)? $default,){
final _that = this;
switch (_that) {
case _LoadableState() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _LoadableState() when $default != null:
return $default(_that.isLoading,_that.data,_that.lastFetch,_that.reFetch,_that.error);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error) $default,) {final _that = this;
switch (_that) {
case _LoadableState():
return $default(_that.isLoading,_that.data,_that.lastFetch,_that.reFetch,_that.error);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error)? $default,) {final _that = this;
switch (_that) {
case _LoadableState() when $default != null:
return $default(_that.isLoading,_that.data,_that.lastFetch,_that.reFetch,_that.error);case _:
return null;
}
} }
/// @nodoc
class __$$LoadableStateImplCopyWithImpl<TState, $Res>
extends _$LoadableStateCopyWithImpl<TState, $Res,
_$LoadableStateImpl<TState>>
implements _$$LoadableStateImplCopyWith<TState, $Res> {
__$$LoadableStateImplCopyWithImpl(_$LoadableStateImpl<TState> _value,
$Res Function(_$LoadableStateImpl<TState>) _then)
: super(_value, _then);
@pragma('vm:prefer-inline')
@override
$Res call({
Object? isLoading = null,
Object? data = freezed,
Object? lastFetch = freezed,
Object? reFetch = freezed,
Object? error = freezed,
}) {
return _then(_$LoadableStateImpl<TState>(
isLoading: null == isLoading
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
data: freezed == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as TState?,
lastFetch: freezed == lastFetch
? _value.lastFetch
: lastFetch // ignore: cast_nullable_to_non_nullable
as int?,
reFetch: freezed == reFetch
? _value.reFetch
: reFetch // ignore: cast_nullable_to_non_nullable
as void Function()?,
error: freezed == error
? _value.error
: error // ignore: cast_nullable_to_non_nullable
as LoadingError?,
));
}
} }
/// @nodoc /// @nodoc
class _$LoadableStateImpl<TState> extends _LoadableState<TState> {
const _$LoadableStateImpl(
{required this.isLoading,
required this.data,
required this.lastFetch,
required this.reFetch,
required this.error})
: super._();
class _LoadableState<TState> extends LoadableState<TState> { @override
const _LoadableState({required this.isLoading, required this.data, required this.lastFetch, required this.reFetch, required this.error}): super._(); final bool isLoading;
@override
final TState? data;
@override
final int? lastFetch;
@override
final void Function()? reFetch;
@override
final LoadingError? error;
@override final bool isLoading; @override
@override final TState? data; String toString() {
@override final int? lastFetch; return 'LoadableState<$TState>(isLoading: $isLoading, data: $data, lastFetch: $lastFetch, reFetch: $reFetch, error: $error)';
@override final void Function()? reFetch;
@override final LoadingError? error;
/// Create a copy of LoadableState
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$LoadableStateCopyWith<TState, _LoadableState<TState>> get copyWith => __$LoadableStateCopyWithImpl<TState, _LoadableState<TState>>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadableState<TState>&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&const DeepCollectionEquality().equals(other.data, data)&&(identical(other.lastFetch, lastFetch) || other.lastFetch == lastFetch)&&(identical(other.reFetch, reFetch) || other.reFetch == reFetch)&&(identical(other.error, error) || other.error == error));
}
@override
int get hashCode => Object.hash(runtimeType,isLoading,const DeepCollectionEquality().hash(data),lastFetch,reFetch,error);
@override
String toString() {
return 'LoadableState<$TState>(isLoading: $isLoading, data: $data, lastFetch: $lastFetch, reFetch: $reFetch, error: $error)';
}
}
/// @nodoc
abstract mixin class _$LoadableStateCopyWith<TState,$Res> implements $LoadableStateCopyWith<TState, $Res> {
factory _$LoadableStateCopyWith(_LoadableState<TState> value, $Res Function(_LoadableState<TState>) _then) = __$LoadableStateCopyWithImpl;
@override @useResult
$Res call({
bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error
});
@override $LoadingErrorCopyWith<$Res>? get error;
}
/// @nodoc
class __$LoadableStateCopyWithImpl<TState,$Res>
implements _$LoadableStateCopyWith<TState, $Res> {
__$LoadableStateCopyWithImpl(this._self, this._then);
final _LoadableState<TState> _self;
final $Res Function(_LoadableState<TState>) _then;
/// Create a copy of LoadableState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? isLoading = null,Object? data = freezed,Object? lastFetch = freezed,Object? reFetch = freezed,Object? error = freezed,}) {
return _then(_LoadableState<TState>(
isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
as TState?,lastFetch: freezed == lastFetch ? _self.lastFetch : lastFetch // ignore: cast_nullable_to_non_nullable
as int?,reFetch: freezed == reFetch ? _self.reFetch : reFetch // ignore: cast_nullable_to_non_nullable
as void Function()?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
as LoadingError?,
));
}
/// Create a copy of LoadableState
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$LoadingErrorCopyWith<$Res>? get error {
if (_self.error == null) {
return null;
} }
return $LoadingErrorCopyWith<$Res>(_self.error!, (value) { @override
return _then(_self.copyWith(error: value)); bool operator ==(Object other) {
}); return identical(this, other) ||
} (other.runtimeType == runtimeType &&
other is _$LoadableStateImpl<TState> &&
(identical(other.isLoading, isLoading) ||
other.isLoading == isLoading) &&
const DeepCollectionEquality().equals(other.data, data) &&
(identical(other.lastFetch, lastFetch) ||
other.lastFetch == lastFetch) &&
(identical(other.reFetch, reFetch) || other.reFetch == reFetch) &&
(identical(other.error, error) || other.error == error));
}
@override
int get hashCode => Object.hash(runtimeType, isLoading,
const DeepCollectionEquality().hash(data), lastFetch, reFetch, error);
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$LoadableStateImplCopyWith<TState, _$LoadableStateImpl<TState>>
get copyWith => __$$LoadableStateImplCopyWithImpl<TState,
_$LoadableStateImpl<TState>>(this, _$identity);
} }
// dart format on abstract class _LoadableState<TState> extends LoadableState<TState> {
const factory _LoadableState(
{required final bool isLoading,
required final TState? data,
required final int? lastFetch,
required final void Function()? reFetch,
required final LoadingError? error}) = _$LoadableStateImpl<TState>;
const _LoadableState._() : super._();
@override
bool get isLoading;
@override
TState? get data;
@override
int? get lastFetch;
@override
void Function()? get reFetch;
@override
LoadingError? get error;
@override
@JsonKey(ignore: true)
_$$LoadableStateImplCopyWith<TState, _$LoadableStateImpl<TState>>
get copyWith => throw _privateConstructorUsedError;
}

View File

@@ -3,7 +3,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'loading_error.freezed.dart'; part 'loading_error.freezed.dart';
@freezed @freezed
abstract class LoadingError with _$LoadingError { class LoadingError with _$LoadingError {
const factory LoadingError({ const factory LoadingError({
required String message, required String message,
@Default(false) bool allowRetry, @Default(false) bool allowRetry,

View File

@@ -1,5 +1,5 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file // coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint // 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 // 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
@@ -9,266 +9,144 @@ part of 'loading_error.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; 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');
/// @nodoc /// @nodoc
mixin _$LoadingError { mixin _$LoadingError {
String get message => throw _privateConstructorUsedError;
bool get allowRetry => throw _privateConstructorUsedError;
String get message; bool get allowRetry; @JsonKey(ignore: true)
/// Create a copy of LoadingError $LoadingErrorCopyWith<LoadingError> get copyWith =>
/// with the given fields replaced by the non-null parameter values. throw _privateConstructorUsedError;
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$LoadingErrorCopyWith<LoadingError> get copyWith => _$LoadingErrorCopyWithImpl<LoadingError>(this as LoadingError, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoadingError&&(identical(other.message, message) || other.message == message)&&(identical(other.allowRetry, allowRetry) || other.allowRetry == allowRetry));
}
@override
int get hashCode => Object.hash(runtimeType,message,allowRetry);
@override
String toString() {
return 'LoadingError(message: $message, allowRetry: $allowRetry)';
}
} }
/// @nodoc /// @nodoc
abstract mixin class $LoadingErrorCopyWith<$Res> { abstract class $LoadingErrorCopyWith<$Res> {
factory $LoadingErrorCopyWith(LoadingError value, $Res Function(LoadingError) _then) = _$LoadingErrorCopyWithImpl; factory $LoadingErrorCopyWith(
@useResult LoadingError value, $Res Function(LoadingError) then) =
$Res call({ _$LoadingErrorCopyWithImpl<$Res, LoadingError>;
String message, bool allowRetry @useResult
}); $Res call({String message, bool allowRetry});
} }
/// @nodoc /// @nodoc
class _$LoadingErrorCopyWithImpl<$Res> class _$LoadingErrorCopyWithImpl<$Res, $Val extends LoadingError>
implements $LoadingErrorCopyWith<$Res> { implements $LoadingErrorCopyWith<$Res> {
_$LoadingErrorCopyWithImpl(this._self, this._then); _$LoadingErrorCopyWithImpl(this._value, this._then);
final LoadingError _self; // ignore: unused_field
final $Res Function(LoadingError) _then; final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of LoadingError @pragma('vm:prefer-inline')
/// with the given fields replaced by the non-null parameter values. @override
@pragma('vm:prefer-inline') @override $Res call({Object? message = null,Object? allowRetry = null,}) { $Res call({
return _then(_self.copyWith( Object? message = null,
message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable Object? allowRetry = null,
as String,allowRetry: null == allowRetry ? _self.allowRetry : allowRetry // ignore: cast_nullable_to_non_nullable }) {
as bool, return _then(_value.copyWith(
)); message: null == message
? _value.message
: message // ignore: cast_nullable_to_non_nullable
as String,
allowRetry: null == allowRetry
? _value.allowRetry
: allowRetry // ignore: cast_nullable_to_non_nullable
as bool,
) as $Val);
}
} }
/// @nodoc
abstract class _$$LoadingErrorImplCopyWith<$Res>
implements $LoadingErrorCopyWith<$Res> {
factory _$$LoadingErrorImplCopyWith(
_$LoadingErrorImpl value, $Res Function(_$LoadingErrorImpl) then) =
__$$LoadingErrorImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String message, bool allowRetry});
} }
/// @nodoc
class __$$LoadingErrorImplCopyWithImpl<$Res>
extends _$LoadingErrorCopyWithImpl<$Res, _$LoadingErrorImpl>
implements _$$LoadingErrorImplCopyWith<$Res> {
__$$LoadingErrorImplCopyWithImpl(
_$LoadingErrorImpl _value, $Res Function(_$LoadingErrorImpl) _then)
: super(_value, _then);
/// Adds pattern-matching-related methods to [LoadingError]. @pragma('vm:prefer-inline')
extension LoadingErrorPatterns on LoadingError { @override
/// A variant of `map` that fallback to returning `orElse`. $Res call({
/// Object? message = null,
/// It is equivalent to doing: Object? allowRetry = null,
/// ```dart }) {
/// switch (sealedClass) { return _then(_$LoadingErrorImpl(
/// case final Subclass value: message: null == message
/// return ...; ? _value.message
/// case _: : message // ignore: cast_nullable_to_non_nullable
/// return orElse(); as String,
/// } allowRetry: null == allowRetry
/// ``` ? _value.allowRetry
: allowRetry // ignore: cast_nullable_to_non_nullable
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LoadingError value)? $default,{required TResult orElse(),}){ as bool,
final _that = this; ));
switch (_that) { }
case _LoadingError() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LoadingError value) $default,){
final _that = this;
switch (_that) {
case _LoadingError():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LoadingError value)? $default,){
final _that = this;
switch (_that) {
case _LoadingError() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String message, bool allowRetry)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _LoadingError() when $default != null:
return $default(_that.message,_that.allowRetry);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String message, bool allowRetry) $default,) {final _that = this;
switch (_that) {
case _LoadingError():
return $default(_that.message,_that.allowRetry);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String message, bool allowRetry)? $default,) {final _that = this;
switch (_that) {
case _LoadingError() when $default != null:
return $default(_that.message,_that.allowRetry);case _:
return null;
}
}
} }
/// @nodoc /// @nodoc
class _$LoadingErrorImpl implements _LoadingError {
const _$LoadingErrorImpl({required this.message, this.allowRetry = false});
class _LoadingError implements LoadingError { @override
const _LoadingError({required this.message, this.allowRetry = false}); final String message;
@override
@JsonKey()
final bool allowRetry;
@override final String message; @override
@override@JsonKey() final bool allowRetry; String toString() {
return 'LoadingError(message: $message, allowRetry: $allowRetry)';
}
/// Create a copy of LoadingError @override
/// with the given fields replaced by the non-null parameter values. bool operator ==(Object other) {
@override @JsonKey(includeFromJson: false, includeToJson: false) return identical(this, other) ||
@pragma('vm:prefer-inline') (other.runtimeType == runtimeType &&
_$LoadingErrorCopyWith<_LoadingError> get copyWith => __$LoadingErrorCopyWithImpl<_LoadingError>(this, _$identity); other is _$LoadingErrorImpl &&
(identical(other.message, message) || other.message == message) &&
(identical(other.allowRetry, allowRetry) ||
other.allowRetry == allowRetry));
}
@override
int get hashCode => Object.hash(runtimeType, message, allowRetry);
@JsonKey(ignore: true)
@override @override
bool operator ==(Object other) { @pragma('vm:prefer-inline')
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadingError&&(identical(other.message, message) || other.message == message)&&(identical(other.allowRetry, allowRetry) || other.allowRetry == allowRetry)); _$$LoadingErrorImplCopyWith<_$LoadingErrorImpl> get copyWith =>
__$$LoadingErrorImplCopyWithImpl<_$LoadingErrorImpl>(this, _$identity);
} }
abstract class _LoadingError implements LoadingError {
const factory _LoadingError(
{required final String message,
final bool allowRetry}) = _$LoadingErrorImpl;
@override @override
int get hashCode => Object.hash(runtimeType,message,allowRetry); String get message;
@override
@override bool get allowRetry;
String toString() { @override
return 'LoadingError(message: $message, allowRetry: $allowRetry)'; @JsonKey(ignore: true)
_$$LoadingErrorImplCopyWith<_$LoadingErrorImpl> get copyWith =>
throw _privateConstructorUsedError;
} }
}
/// @nodoc
abstract mixin class _$LoadingErrorCopyWith<$Res> implements $LoadingErrorCopyWith<$Res> {
factory _$LoadingErrorCopyWith(_LoadingError value, $Res Function(_LoadingError) _then) = __$LoadingErrorCopyWithImpl;
@override @useResult
$Res call({
String message, bool allowRetry
});
}
/// @nodoc
class __$LoadingErrorCopyWithImpl<$Res>
implements _$LoadingErrorCopyWith<$Res> {
__$LoadingErrorCopyWithImpl(this._self, this._then);
final _LoadingError _self;
final $Res Function(_LoadingError) _then;
/// Create a copy of LoadingError
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? message = null,Object? allowRetry = null,}) {
return _then(_LoadingError(
message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
as String,allowRetry: null == allowRetry ? _self.allowRetry : allowRetry // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
// dart format on

View File

@@ -17,16 +17,19 @@ class LoadableStateConsumer<TController extends Bloc<LoadableHydratedBlocEvent<T
final Widget Function(TState state, bool loading) child; final Widget Function(TState state, bool loading) child;
final void Function(TState state)? onLoad; final void Function(TState state)? onLoad;
final bool wrapWithScrollView; final bool wrapWithScrollView;
const LoadableStateConsumer({required this.child, this.onLoad, this.wrapWithScrollView = false, super.key}); final TController? controllerByValue;
const LoadableStateConsumer({required this.child, this.onLoad, this.wrapWithScrollView = false, this.controllerByValue = null, super.key});
static Duration animationDuration = const Duration(milliseconds: 200); static Duration animationDuration = const Duration(milliseconds: 200);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var loadableState = context.watch<TController>().state; var loadableState = controllerByValue != null
? controllerByValue!.state
: context.watch<TController>().state;
if(!loadableState.isLoading && onLoad != null) { if(!loadableState.isLoading && onLoad != null) {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) => onLoad!(loadableState.data!)); WidgetsBinding.instance.addPostFrameCallback((timeStamp) => onLoad!(loadableState.data));
} }
var childWidget = ConditionalWrapper( var childWidget = ConditionalWrapper(
@@ -48,7 +51,7 @@ class LoadableStateConsumer<TController extends Bloc<LoadableHydratedBlocEvent<T
child: SizedBox( child: SizedBox(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
child: loadableState.showContent() child: loadableState.showContent()
? child(loadableState.data!, loadableState.isLoading) ? child(loadableState.data, loadableState.isLoading)
: const SizedBox.shrink(), : const SizedBox.shrink(),
), ),
); );

View File

@@ -30,16 +30,17 @@ abstract class LoadableHydratedBloc<
isLoading: state.isLoading, isLoading: state.isLoading,
data: event.state(innerState ?? fromNothing()), data: event.state(innerState ?? fromNothing()),
lastFetch: state.lastFetch, lastFetch: state.lastFetch,
reFetch: retry, reFetch: fetch,
error: state.error, error: state.error,
)); ));
if(event.fetch) fetch();
}); });
on<DataGathered<TState>>((event, emit) => emit(LoadableState( on<DataGathered<TState>>((event, emit) => emit(LoadableState(
isLoading: false, isLoading: false,
data: event.state(innerState ?? fromNothing()), data: event.state(innerState ?? fromNothing()),
lastFetch: DateTime.now().millisecondsSinceEpoch, lastFetch: DateTime.now().millisecondsSinceEpoch,
reFetch: retry, reFetch: fetch,
error: null, error: null,
))); )));
@@ -55,7 +56,7 @@ abstract class LoadableHydratedBloc<
isLoading: false, isLoading: false,
data: innerState, data: innerState,
lastFetch: state.lastFetch, lastFetch: state.lastFetch,
reFetch: retry, reFetch: fetch,
error: event.error error: event.error
))); )));
@@ -66,19 +67,14 @@ abstract class LoadableHydratedBloc<
TState? get innerState => state.data; TState? get innerState => state.data;
TRepository get repo => _repository; TRepository get repo => _repository;
void retry() {
log('Fetch retry triggered for ${TState.toString()}');
add(RefetchStarted<TState>());
fetch();
}
void fetch() { void fetch() {
log('Fetching data for ${TState.toString()}'); log('Fetching data for ${TState.toString()}');
add(RefetchStarted<TState>());
gatherData().catchError( gatherData().catchError(
(e) { (e) {
log('Error while fetching ${TState.toString()}: ${e.toString()}'); log('Error while fetching ${TState.toString()}: ${e.toString()}');
add(Error(LoadingError( add(Error(LoadingError(
message: e.message ?? e.toString(), message: e.toString(),
allowRetry: true, allowRetry: true,
))); )));
}, },
@@ -92,7 +88,7 @@ abstract class LoadableHydratedBloc<
var rawData = LoadableSaveContext.unwrap(json); var rawData = LoadableSaveContext.unwrap(json);
return LoadableState( return LoadableState(
isLoading: true, isLoading: true,
data: fromStorage(rawData.data), data: fromStorage(rawData.data), // TODO fromStorage in isolate
lastFetch: rawData.meta.timestamp, lastFetch: rawData.meta.timestamp,
reFetch: null, reFetch: null,
error: null, error: null,
@@ -103,7 +99,7 @@ abstract class LoadableHydratedBloc<
Map<String, dynamic>? toJson(LoadableState<TState> state) { Map<String, dynamic>? toJson(LoadableState<TState> state) {
Map<String, dynamic>? data; Map<String, dynamic>? data;
try { try {
data = state.data == null ? null : toStorage(state.data!); data = state.data == null ? null : toStorage(state.data); // TODO toStorage in isolate
} catch(e) { } catch(e) {
log('Failed to save state ${TState.toString()}: ${e.toString()}'); log('Failed to save state ${TState.toString()}: ${e.toString()}');
} }

View File

@@ -3,7 +3,8 @@ import '../../loadableState/loading_error.dart';
class LoadableHydratedBlocEvent<TState> {} class LoadableHydratedBlocEvent<TState> {}
class Emit<TState> extends LoadableHydratedBlocEvent<TState> { class Emit<TState> extends LoadableHydratedBlocEvent<TState> {
final TState Function(TState state) state; final TState Function(TState state) state;
Emit(this.state); final bool fetch;
Emit(this.state, {this.fetch = false});
} }
class DataGathered<TState> extends LoadableHydratedBlocEvent<TState> { class DataGathered<TState> extends LoadableHydratedBlocEvent<TState> {
final TState Function(TState state) state; final TState Function(TState state) state;

View File

@@ -4,7 +4,7 @@ part 'loadable_save_context.freezed.dart';
part 'loadable_save_context.g.dart'; part 'loadable_save_context.g.dart';
@freezed @freezed
abstract class LoadableSaveContext with _$LoadableSaveContext { class LoadableSaveContext with _$LoadableSaveContext {
const LoadableSaveContext._(); const LoadableSaveContext._();
const factory LoadableSaveContext({ const factory LoadableSaveContext({
required int timestamp, required int timestamp,

View File

@@ -1,5 +1,5 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file // coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint // 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 // 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
@@ -9,269 +9,147 @@ part of 'loadable_save_context.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; 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');
LoadableSaveContext _$LoadableSaveContextFromJson(Map<String, dynamic> json) {
return _LoadableSaveContext.fromJson(json);
}
/// @nodoc /// @nodoc
mixin _$LoadableSaveContext { mixin _$LoadableSaveContext {
int get timestamp => throw _privateConstructorUsedError;
int get timestamp; Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of LoadableSaveContext @JsonKey(ignore: true)
/// with the given fields replaced by the non-null parameter values. $LoadableSaveContextCopyWith<LoadableSaveContext> get copyWith =>
@JsonKey(includeFromJson: false, includeToJson: false) throw _privateConstructorUsedError;
@pragma('vm:prefer-inline')
$LoadableSaveContextCopyWith<LoadableSaveContext> get copyWith => _$LoadableSaveContextCopyWithImpl<LoadableSaveContext>(this as LoadableSaveContext, _$identity);
/// Serializes this LoadableSaveContext to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoadableSaveContext&&(identical(other.timestamp, timestamp) || other.timestamp == timestamp));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,timestamp);
@override
String toString() {
return 'LoadableSaveContext(timestamp: $timestamp)';
}
} }
/// @nodoc /// @nodoc
abstract mixin class $LoadableSaveContextCopyWith<$Res> { abstract class $LoadableSaveContextCopyWith<$Res> {
factory $LoadableSaveContextCopyWith(LoadableSaveContext value, $Res Function(LoadableSaveContext) _then) = _$LoadableSaveContextCopyWithImpl; factory $LoadableSaveContextCopyWith(
@useResult LoadableSaveContext value, $Res Function(LoadableSaveContext) then) =
$Res call({ _$LoadableSaveContextCopyWithImpl<$Res, LoadableSaveContext>;
int timestamp @useResult
}); $Res call({int timestamp});
} }
/// @nodoc /// @nodoc
class _$LoadableSaveContextCopyWithImpl<$Res> class _$LoadableSaveContextCopyWithImpl<$Res, $Val extends LoadableSaveContext>
implements $LoadableSaveContextCopyWith<$Res> { implements $LoadableSaveContextCopyWith<$Res> {
_$LoadableSaveContextCopyWithImpl(this._self, this._then); _$LoadableSaveContextCopyWithImpl(this._value, this._then);
final LoadableSaveContext _self; // ignore: unused_field
final $Res Function(LoadableSaveContext) _then; final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of LoadableSaveContext @pragma('vm:prefer-inline')
/// with the given fields replaced by the non-null parameter values. @override
@pragma('vm:prefer-inline') @override $Res call({Object? timestamp = null,}) { $Res call({
return _then(_self.copyWith( Object? timestamp = null,
timestamp: null == timestamp ? _self.timestamp : timestamp // ignore: cast_nullable_to_non_nullable }) {
as int, return _then(_value.copyWith(
)); timestamp: null == timestamp
? _value.timestamp
: timestamp // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
} }
/// @nodoc
abstract class _$$LoadableSaveContextImplCopyWith<$Res>
implements $LoadableSaveContextCopyWith<$Res> {
factory _$$LoadableSaveContextImplCopyWith(_$LoadableSaveContextImpl value,
$Res Function(_$LoadableSaveContextImpl) then) =
__$$LoadableSaveContextImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({int timestamp});
} }
/// @nodoc
class __$$LoadableSaveContextImplCopyWithImpl<$Res>
extends _$LoadableSaveContextCopyWithImpl<$Res, _$LoadableSaveContextImpl>
implements _$$LoadableSaveContextImplCopyWith<$Res> {
__$$LoadableSaveContextImplCopyWithImpl(_$LoadableSaveContextImpl _value,
$Res Function(_$LoadableSaveContextImpl) _then)
: super(_value, _then);
/// Adds pattern-matching-related methods to [LoadableSaveContext]. @pragma('vm:prefer-inline')
extension LoadableSaveContextPatterns on LoadableSaveContext { @override
/// A variant of `map` that fallback to returning `orElse`. $Res call({
/// Object? timestamp = null,
/// It is equivalent to doing: }) {
/// ```dart return _then(_$LoadableSaveContextImpl(
/// switch (sealedClass) { timestamp: null == timestamp
/// case final Subclass value: ? _value.timestamp
/// return ...; : timestamp // ignore: cast_nullable_to_non_nullable
/// case _: as int,
/// return orElse(); ));
/// } }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LoadableSaveContext value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _LoadableSaveContext() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LoadableSaveContext value) $default,){
final _that = this;
switch (_that) {
case _LoadableSaveContext():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LoadableSaveContext value)? $default,){
final _that = this;
switch (_that) {
case _LoadableSaveContext() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int timestamp)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _LoadableSaveContext() when $default != null:
return $default(_that.timestamp);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int timestamp) $default,) {final _that = this;
switch (_that) {
case _LoadableSaveContext():
return $default(_that.timestamp);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int timestamp)? $default,) {final _that = this;
switch (_that) {
case _LoadableSaveContext() when $default != null:
return $default(_that.timestamp);case _:
return null;
}
}
} }
/// @nodoc /// @nodoc
@JsonSerializable() @JsonSerializable()
class _$LoadableSaveContextImpl extends _LoadableSaveContext {
const _$LoadableSaveContextImpl({required this.timestamp}) : super._();
class _LoadableSaveContext extends LoadableSaveContext { factory _$LoadableSaveContextImpl.fromJson(Map<String, dynamic> json) =>
const _LoadableSaveContext({required this.timestamp}): super._(); _$$LoadableSaveContextImplFromJson(json);
factory _LoadableSaveContext.fromJson(Map<String, dynamic> json) => _$LoadableSaveContextFromJson(json);
@override final int timestamp; @override
final int timestamp;
/// Create a copy of LoadableSaveContext @override
/// with the given fields replaced by the non-null parameter values. String toString() {
@override @JsonKey(includeFromJson: false, includeToJson: false) return 'LoadableSaveContext(timestamp: $timestamp)';
@pragma('vm:prefer-inline') }
_$LoadableSaveContextCopyWith<_LoadableSaveContext> get copyWith => __$LoadableSaveContextCopyWithImpl<_LoadableSaveContext>(this, _$identity);
@override @override
Map<String, dynamic> toJson() { bool operator ==(Object other) {
return _$LoadableSaveContextToJson(this, ); return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$LoadableSaveContextImpl &&
(identical(other.timestamp, timestamp) ||
other.timestamp == timestamp));
}
@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(runtimeType, timestamp);
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$LoadableSaveContextImplCopyWith<_$LoadableSaveContextImpl> get copyWith =>
__$$LoadableSaveContextImplCopyWithImpl<_$LoadableSaveContextImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$LoadableSaveContextImplToJson(
this,
);
}
} }
@override abstract class _LoadableSaveContext extends LoadableSaveContext {
bool operator ==(Object other) { const factory _LoadableSaveContext({required final int timestamp}) =
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadableSaveContext&&(identical(other.timestamp, timestamp) || other.timestamp == timestamp)); _$LoadableSaveContextImpl;
const _LoadableSaveContext._() : super._();
factory _LoadableSaveContext.fromJson(Map<String, dynamic> json) =
_$LoadableSaveContextImpl.fromJson;
@override
int get timestamp;
@override
@JsonKey(ignore: true)
_$$LoadableSaveContextImplCopyWith<_$LoadableSaveContextImpl> get copyWith =>
throw _privateConstructorUsedError;
} }
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,timestamp);
@override
String toString() {
return 'LoadableSaveContext(timestamp: $timestamp)';
}
}
/// @nodoc
abstract mixin class _$LoadableSaveContextCopyWith<$Res> implements $LoadableSaveContextCopyWith<$Res> {
factory _$LoadableSaveContextCopyWith(_LoadableSaveContext value, $Res Function(_LoadableSaveContext) _then) = __$LoadableSaveContextCopyWithImpl;
@override @useResult
$Res call({
int timestamp
});
}
/// @nodoc
class __$LoadableSaveContextCopyWithImpl<$Res>
implements _$LoadableSaveContextCopyWith<$Res> {
__$LoadableSaveContextCopyWithImpl(this._self, this._then);
final _LoadableSaveContext _self;
final $Res Function(_LoadableSaveContext) _then;
/// Create a copy of LoadableSaveContext
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? timestamp = null,}) {
return _then(_LoadableSaveContext(
timestamp: null == timestamp ? _self.timestamp : timestamp // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
// dart format on

View File

@@ -6,9 +6,14 @@ part of 'loadable_save_context.dart';
// JsonSerializableGenerator // JsonSerializableGenerator
// ************************************************************************** // **************************************************************************
_LoadableSaveContext _$LoadableSaveContextFromJson(Map<String, dynamic> json) => _$LoadableSaveContextImpl _$$LoadableSaveContextImplFromJson(
_LoadableSaveContext(timestamp: (json['timestamp'] as num).toInt()); Map<String, dynamic> json) =>
_$LoadableSaveContextImpl(
timestamp: (json['timestamp'] as num).toInt(),
);
Map<String, dynamic> _$LoadableSaveContextToJson( Map<String, dynamic> _$$LoadableSaveContextImplToJson(
_LoadableSaveContext instance, _$LoadableSaveContextImpl instance) =>
) => <String, dynamic>{'timestamp': instance.timestamp}; <String, dynamic>{
'timestamp': instance.timestamp,
};

View File

@@ -0,0 +1,48 @@
import 'dart:async';
import 'package:bloc/bloc.dart';
import 'package:flutter/material.dart';
import 'bloc_module.dart';
class SwappingBloc<TBloc> {
final TBloc initialBloc;
final StreamController<TBloc> updater = StreamController<TBloc>();
SwappingBloc(this.initialBloc);
void swap(TBloc bloc) {
updater.add(bloc);
}
}
class SwappingBlocModule<TBloc extends StateStreamableSource<TState>, TState> extends StatefulWidget {
final SwappingBloc<TBloc> bloc;
final Widget Function(BuildContext context, TBloc bloc, TState state) child;
const SwappingBlocModule({super.key, required this.bloc, required this.child});
@override
State<SwappingBlocModule<TBloc, TState>> createState() => _SwappingBlocModuleState<TBloc, TState>();
}
class _SwappingBlocModuleState<TBloc extends StateStreamableSource<TState>, TState> extends State<SwappingBlocModule<TBloc, TState>> {
late TBloc bloc;
@override
void initState() {
super.initState();
bloc = widget.bloc.initialBloc;
widget.bloc.updater.stream.listen((event) {
setState(() {
bloc = event;
});
});
}
@override
Widget build(BuildContext context) => BlocModule<TBloc, TState>(
autoRebuild: true,
create: (context) => bloc,
child: (context, bloc, state) => widget.child(context, bloc, state),
);
}

View File

@@ -1,129 +1,51 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart'; import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart';
import 'package:provider/provider.dart';
import '../../../api/mhsl/breaker/getBreakers/getBreakersResponse.dart'; import '../../../api/mhsl/breaker/getBreakers/getBreakersResponse.dart';
import '../../../model/breakers/Breaker.dart'; import '../../../model/breakers/Breaker.dart';
import '../../../model/chatList/chatListProps.dart';
import '../../../storage/base/settingsProvider.dart';
import '../../../view/pages/files/files.dart'; import '../../../view/pages/files/files.dart';
import '../../../view/pages/more/roomplan/roomplan.dart'; import '../../../view/pages/more/roomplan/roomplan.dart';
import '../../../view/pages/talk/chatList.dart'; import '../../../view/pages/talk/chatList.dart';
import '../../../view/pages/timetable/timetable.dart'; import '../../../view/pages/timetable/timetable.dart';
import '../../../widget/centeredLeading.dart'; import '../../../widget/centeredLeading.dart';
import 'files/view/files_view.dart';
import 'gradeAverages/view/grade_averages_view.dart'; import 'gradeAverages/view/grade_averages_view.dart';
import 'holidays/view/holidays_view.dart'; import 'holidays/view/holidays_view.dart';
import 'marianumMessage/view/marianum_message_list_view.dart'; import 'marianumMessage/view/marianum_message_list_view.dart';
import 'package:badges/badges.dart' as badges;
class AppModule { class AppModule {
Modules module;
String name; String name;
Widget Function() icon; IconData icon;
BreakerArea breakerArea;
Widget Function() create; Widget Function() create;
AppModule(this.module, {required this.name, required this.icon, this.breakerArea = BreakerArea.global, required this.create}); AppModule(this.name, this.icon, this.create);
static Map<Modules, AppModule> modules(BuildContext context, { showFiltered = false }) { static Map<Modules, AppModule> modules() => {
var settings = Provider.of<SettingsProvider>(context, listen: false); Modules.timetable: AppModule('Vertretung', Icons.calendar_month, Timetable.new),
var available = { Modules.talk: AppModule('Talk', Icons.chat, ChatList.new),
Modules.timetable: AppModule( Modules.files: AppModule('Files', Icons.folder, Files.new),
Modules.timetable, Modules.blocFiles: AppModule('BlocFiles', Icons.folder, FilesView.new),
name: 'Stundenplan', Modules.marianumMessage: AppModule('Marianum Message', Icons.newspaper, MarianumMessageListView.new),
icon: () => Icon(Icons.calendar_month), Modules.roomPlan: AppModule('Raumplan', Icons.location_pin, Roomplan.new),
breakerArea: BreakerArea.timetable, Modules.gradeAveragesCalculator: AppModule('Notendurschnittsrechner', Icons.calculate, GradeAveragesView.new),
create: Timetable.new, Modules.holidays: AppModule('Schulferien', Icons.flight, HolidaysView.new),
), };
Modules.talk: AppModule(
Modules.talk,
name: 'Talk',
icon: () => Consumer<ChatListProps>(
builder: (context, value, child) {
if(value.primaryLoading()) return Icon(Icons.chat);
var messages = value.getRoomsResponse.data.map((e) => e.unreadMessages).reduce((a, b) => a+b);
return badges.Badge(
showBadge: messages > 0,
position: badges.BadgePosition.topEnd(top: -3, end: -3),
stackFit: StackFit.loose,
badgeStyle: badges.BadgeStyle(
padding: const EdgeInsets.all(3),
badgeColor: Theme.of(context).primaryColor,
elevation: 1,
),
badgeContent: Text('$messages', style: const TextStyle(color: Colors.white, fontSize: 10, fontWeight: FontWeight.bold)),
child: Icon(Icons.chat),
);
},
),
breakerArea: BreakerArea.talk,
create: ChatList.new,
),
Modules.files: AppModule(
Modules.files,
name: 'Dateien',
icon: () => Icon(Icons.folder),
breakerArea: BreakerArea.files,
create: Files.new,
),
Modules.marianumMessage: AppModule(
Modules.marianumMessage,
name: 'Marianum Message',
icon: () => Icon(Icons.newspaper),
breakerArea: BreakerArea.more,
create: MarianumMessageListView.new,
),
Modules.roomPlan: AppModule(
Modules.roomPlan,
name: 'Raumplan',
icon: () => Icon(Icons.location_pin),
breakerArea: BreakerArea.more,
create: Roomplan.new,
),
Modules.gradeAveragesCalculator: AppModule(
Modules.gradeAveragesCalculator,
name: 'Notendurschnittsrechner',
icon: () => Icon(Icons.calculate),
breakerArea: BreakerArea.more,
create: GradeAveragesView.new,
),
Modules.holidays: AppModule(
Modules.holidays,
name: 'Schulferien',
icon: () => Icon(Icons.flight),
breakerArea: BreakerArea.more,
create: HolidaysView.new,
),
};
if(!showFiltered) available.removeWhere((key, value) => settings.val().modulesSettings.hiddenModules.contains(key)); static AppModule getModule(Modules module) => modules()[module]!;
return { for (var element in settings.val().modulesSettings.moduleOrder.where((element) => available.containsKey(element))) element : available[element]! }; Widget toListTile(BuildContext context) => ListTile(
} leading: CenteredLeading(Icon(icon)),
static List<AppModule> getBottomBarModules(BuildContext context) => modules(context).values.toList().getRange(0, 3).toList();
static List<AppModule> getOverhangModules(BuildContext context) => modules(context).values.skip(3).toList();
Widget toListTile(BuildContext context, {Key? key, bool isReorder = false, Function()? onVisibleChange, bool isVisible = true}) => ListTile(
key: key,
leading: CenteredLeading(icon()),
title: Text(name), title: Text(name),
onTap: isReorder ? null : () => pushScreen(context, withNavBar: false, screen: create()), onTap: () => pushScreen(context, withNavBar: false, screen: create()),
trailing: isReorder trailing: const Icon(Icons.arrow_right),
? Row(mainAxisSize: MainAxisSize.min, children: [
IconButton(onPressed: onVisibleChange, icon: Icon(isVisible ? Icons.visibility_outlined : Icons.visibility_off_outlined)),
Icon(Icons.drag_handle_outlined)
])
: const Icon(Icons.arrow_right),
); );
PersistentTabConfig toBottomTab(BuildContext context, {Widget Function(IconData icon)? iconBuilder}) => PersistentTabConfig( PersistentTabConfig toBottomTab(BuildContext context, {Widget Function(IconData icon)? itemBuilder}) => PersistentTabConfig(
screen: Breaker(breaker: breakerArea, child: create()), screen: Breaker(breaker: BreakerArea.global, child: create()),
item: ItemConfig( item: ItemConfig(
activeForegroundColor: Theme.of(context).primaryColor, activeForegroundColor: Theme.of(context).primaryColor,
inactiveForegroundColor: Theme.of(context).colorScheme.secondary, inactiveForegroundColor: Theme.of(context).colorScheme.secondary,
icon: icon(), icon: itemBuilder == null ? Icon(icon) : itemBuilder(icon),
title: name title: name
), ),
); );
@@ -133,6 +55,7 @@ enum Modules {
timetable, timetable,
talk, talk,
files, files,
blocFiles,
marianumMessage, marianumMessage,
roomPlan, roomPlan,
gradeAveragesCalculator, gradeAveragesCalculator,

View File

@@ -0,0 +1,71 @@
import 'dart:developer';
import 'package:sorted/sorted.dart';
import '../../../infrastructure/utilityWidgets/loadableHydratedBloc/loadable_hydrated_bloc.dart';
import '../../../infrastructure/utilityWidgets/loadableHydratedBloc/loadable_hydrated_bloc_event.dart';
import '../repository/files_repository.dart';
import 'files_event.dart';
import 'files_state.dart';
class FilesBloc extends LoadableHydratedBloc<FilesEvent, FilesState, FilesRepository> {
static const String basePath = '/';
FilesBloc() {
add(Emit((state) => state.copyWith(currentFolder: basePath)));
on<EnterFolder>((event, emit) {
add(Emit((state) {
log('setFolder');
return state.copyWith(currentFolder: event.absolutePath);
}, fetch: true));
});
}
List<File>? getVisibleFiles() => innerState?.files[innerState?.currentFolder];
String getCurrentFolder() => innerState?.currentFolder ?? basePath;
String getCurrentFolderName() {
var folder = innerState?.currentFolder.split('/').reversed.elementAt(1);
return folder!.isEmpty ? 'Dateien' : folder;
}
bool canGoBack() => innerState?.currentFolder != basePath;
String goBackLocation() {
var pathSegments = innerState?.currentFolder.split(basePath) ?? [];
if (pathSegments.isNotEmpty) {
pathSegments.removeLast();
pathSegments.removeLast();
}
return pathSegments.join(basePath) + basePath;
}
List currentSortConfiguration() => [
SortedComparable<File, DateTime>((file) => file.updatedAt ?? DateTime.now()),
];
@override
FilesState fromNothing() => const FilesState(currentFolder: basePath, files: {});
@override
FilesState fromStorage(Map<String, dynamic> json) => FilesState.fromJson(json);
@override
Future<void> gatherData() async {
var fetchFolder = getCurrentFolder();
log(fetchFolder);
var files = await repo.getFileList(fetchFolder);
var newFileMap = Map.of(innerState?.files ?? <String, List<File>>{});
newFileMap[fetchFolder] = files;
if(fetchFolder != getCurrentFolder()) {
log('Fetch aborted due to folder change (expected "$fetchFolder" got "${getCurrentFolder()}")');
return;
}
add(DataGathered((state) => state.copyWith(files: newFileMap)));
}
@override
FilesRepository repository() => FilesRepository();
@override
Map<String, dynamic>? toStorage(FilesState state) => state.toJson();
}

View File

@@ -0,0 +1,10 @@
import '../../../infrastructure/utilityWidgets/loadableHydratedBloc/loadable_hydrated_bloc_event.dart';
import 'files_state.dart';
sealed class FilesEvent extends LoadableHydratedBlocEvent<FilesState> {}
class EnterFolder extends FilesEvent {
String absolutePath;
EnterFolder(this.absolutePath);
}

View File

@@ -0,0 +1,29 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'files_state.freezed.dart';
part 'files_state.g.dart';
@freezed
class FilesState with _$FilesState {
const factory FilesState({
required String currentFolder,
required Map<String, List<File>> files,
}) = _FilesState;
factory FilesState.fromJson(Map<String, Object?> json) => _$FilesStateFromJson(json);
}
@freezed
class File with _$File {
const factory File({
required String path,
required bool isFolder,
required String name,
required DateTime? createdAt,
required DateTime? updatedAt,
required int? size,
required String? mimeType,
}) = _File;
factory File.fromJson(Map<String, Object?> json) => _$FileFromJson(json);
}

View File

@@ -0,0 +1,439 @@
// 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 'files_state.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');
FilesState _$FilesStateFromJson(Map<String, dynamic> json) {
return _FilesState.fromJson(json);
}
/// @nodoc
mixin _$FilesState {
String get currentFolder => throw _privateConstructorUsedError;
Map<String, List<File>> get files => throw _privateConstructorUsedError;
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$FilesStateCopyWith<FilesState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $FilesStateCopyWith<$Res> {
factory $FilesStateCopyWith(
FilesState value, $Res Function(FilesState) then) =
_$FilesStateCopyWithImpl<$Res, FilesState>;
@useResult
$Res call({String currentFolder, Map<String, List<File>> files});
}
/// @nodoc
class _$FilesStateCopyWithImpl<$Res, $Val extends FilesState>
implements $FilesStateCopyWith<$Res> {
_$FilesStateCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@pragma('vm:prefer-inline')
@override
$Res call({
Object? currentFolder = null,
Object? files = null,
}) {
return _then(_value.copyWith(
currentFolder: null == currentFolder
? _value.currentFolder
: currentFolder // ignore: cast_nullable_to_non_nullable
as String,
files: null == files
? _value.files
: files // ignore: cast_nullable_to_non_nullable
as Map<String, List<File>>,
) as $Val);
}
}
/// @nodoc
abstract class _$$FilesStateImplCopyWith<$Res>
implements $FilesStateCopyWith<$Res> {
factory _$$FilesStateImplCopyWith(
_$FilesStateImpl value, $Res Function(_$FilesStateImpl) then) =
__$$FilesStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String currentFolder, Map<String, List<File>> files});
}
/// @nodoc
class __$$FilesStateImplCopyWithImpl<$Res>
extends _$FilesStateCopyWithImpl<$Res, _$FilesStateImpl>
implements _$$FilesStateImplCopyWith<$Res> {
__$$FilesStateImplCopyWithImpl(
_$FilesStateImpl _value, $Res Function(_$FilesStateImpl) _then)
: super(_value, _then);
@pragma('vm:prefer-inline')
@override
$Res call({
Object? currentFolder = null,
Object? files = null,
}) {
return _then(_$FilesStateImpl(
currentFolder: null == currentFolder
? _value.currentFolder
: currentFolder // ignore: cast_nullable_to_non_nullable
as String,
files: null == files
? _value._files
: files // ignore: cast_nullable_to_non_nullable
as Map<String, List<File>>,
));
}
}
/// @nodoc
@JsonSerializable()
class _$FilesStateImpl implements _FilesState {
const _$FilesStateImpl(
{required this.currentFolder,
required final Map<String, List<File>> files})
: _files = files;
factory _$FilesStateImpl.fromJson(Map<String, dynamic> json) =>
_$$FilesStateImplFromJson(json);
@override
final String currentFolder;
final Map<String, List<File>> _files;
@override
Map<String, List<File>> get files {
if (_files is EqualUnmodifiableMapView) return _files;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(_files);
}
@override
String toString() {
return 'FilesState(currentFolder: $currentFolder, files: $files)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$FilesStateImpl &&
(identical(other.currentFolder, currentFolder) ||
other.currentFolder == currentFolder) &&
const DeepCollectionEquality().equals(other._files, _files));
}
@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(
runtimeType, currentFolder, const DeepCollectionEquality().hash(_files));
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$FilesStateImplCopyWith<_$FilesStateImpl> get copyWith =>
__$$FilesStateImplCopyWithImpl<_$FilesStateImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$FilesStateImplToJson(
this,
);
}
}
abstract class _FilesState implements FilesState {
const factory _FilesState(
{required final String currentFolder,
required final Map<String, List<File>> files}) = _$FilesStateImpl;
factory _FilesState.fromJson(Map<String, dynamic> json) =
_$FilesStateImpl.fromJson;
@override
String get currentFolder;
@override
Map<String, List<File>> get files;
@override
@JsonKey(ignore: true)
_$$FilesStateImplCopyWith<_$FilesStateImpl> get copyWith =>
throw _privateConstructorUsedError;
}
File _$FileFromJson(Map<String, dynamic> json) {
return _File.fromJson(json);
}
/// @nodoc
mixin _$File {
String get path => throw _privateConstructorUsedError;
bool get isFolder => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
DateTime? get createdAt => throw _privateConstructorUsedError;
DateTime? get updatedAt => throw _privateConstructorUsedError;
int? get size => throw _privateConstructorUsedError;
String? get mimeType => throw _privateConstructorUsedError;
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$FileCopyWith<File> get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $FileCopyWith<$Res> {
factory $FileCopyWith(File value, $Res Function(File) then) =
_$FileCopyWithImpl<$Res, File>;
@useResult
$Res call(
{String path,
bool isFolder,
String name,
DateTime? createdAt,
DateTime? updatedAt,
int? size,
String? mimeType});
}
/// @nodoc
class _$FileCopyWithImpl<$Res, $Val extends File>
implements $FileCopyWith<$Res> {
_$FileCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
@pragma('vm:prefer-inline')
@override
$Res call({
Object? path = null,
Object? isFolder = null,
Object? name = null,
Object? createdAt = freezed,
Object? updatedAt = freezed,
Object? size = freezed,
Object? mimeType = freezed,
}) {
return _then(_value.copyWith(
path: null == path
? _value.path
: path // ignore: cast_nullable_to_non_nullable
as String,
isFolder: null == isFolder
? _value.isFolder
: isFolder // ignore: cast_nullable_to_non_nullable
as bool,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
createdAt: freezed == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime?,
updatedAt: freezed == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime?,
size: freezed == size
? _value.size
: size // ignore: cast_nullable_to_non_nullable
as int?,
mimeType: freezed == mimeType
? _value.mimeType
: mimeType // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
}
/// @nodoc
abstract class _$$FileImplCopyWith<$Res> implements $FileCopyWith<$Res> {
factory _$$FileImplCopyWith(
_$FileImpl value, $Res Function(_$FileImpl) then) =
__$$FileImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{String path,
bool isFolder,
String name,
DateTime? createdAt,
DateTime? updatedAt,
int? size,
String? mimeType});
}
/// @nodoc
class __$$FileImplCopyWithImpl<$Res>
extends _$FileCopyWithImpl<$Res, _$FileImpl>
implements _$$FileImplCopyWith<$Res> {
__$$FileImplCopyWithImpl(_$FileImpl _value, $Res Function(_$FileImpl) _then)
: super(_value, _then);
@pragma('vm:prefer-inline')
@override
$Res call({
Object? path = null,
Object? isFolder = null,
Object? name = null,
Object? createdAt = freezed,
Object? updatedAt = freezed,
Object? size = freezed,
Object? mimeType = freezed,
}) {
return _then(_$FileImpl(
path: null == path
? _value.path
: path // ignore: cast_nullable_to_non_nullable
as String,
isFolder: null == isFolder
? _value.isFolder
: isFolder // ignore: cast_nullable_to_non_nullable
as bool,
name: null == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
createdAt: freezed == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime?,
updatedAt: freezed == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime?,
size: freezed == size
? _value.size
: size // ignore: cast_nullable_to_non_nullable
as int?,
mimeType: freezed == mimeType
? _value.mimeType
: mimeType // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$FileImpl implements _File {
const _$FileImpl(
{required this.path,
required this.isFolder,
required this.name,
required this.createdAt,
required this.updatedAt,
required this.size,
required this.mimeType});
factory _$FileImpl.fromJson(Map<String, dynamic> json) =>
_$$FileImplFromJson(json);
@override
final String path;
@override
final bool isFolder;
@override
final String name;
@override
final DateTime? createdAt;
@override
final DateTime? updatedAt;
@override
final int? size;
@override
final String? mimeType;
@override
String toString() {
return 'File(path: $path, isFolder: $isFolder, name: $name, createdAt: $createdAt, updatedAt: $updatedAt, size: $size, mimeType: $mimeType)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$FileImpl &&
(identical(other.path, path) || other.path == path) &&
(identical(other.isFolder, isFolder) ||
other.isFolder == isFolder) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.createdAt, createdAt) ||
other.createdAt == createdAt) &&
(identical(other.updatedAt, updatedAt) ||
other.updatedAt == updatedAt) &&
(identical(other.size, size) || other.size == size) &&
(identical(other.mimeType, mimeType) ||
other.mimeType == mimeType));
}
@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(
runtimeType, path, isFolder, name, createdAt, updatedAt, size, mimeType);
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$FileImplCopyWith<_$FileImpl> get copyWith =>
__$$FileImplCopyWithImpl<_$FileImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$FileImplToJson(
this,
);
}
}
abstract class _File implements File {
const factory _File(
{required final String path,
required final bool isFolder,
required final String name,
required final DateTime? createdAt,
required final DateTime? updatedAt,
required final int? size,
required final String? mimeType}) = _$FileImpl;
factory _File.fromJson(Map<String, dynamic> json) = _$FileImpl.fromJson;
@override
String get path;
@override
bool get isFolder;
@override
String get name;
@override
DateTime? get createdAt;
@override
DateTime? get updatedAt;
@override
int? get size;
@override
String? get mimeType;
@override
@JsonKey(ignore: true)
_$$FileImplCopyWith<_$FileImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -0,0 +1,50 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'files_state.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$FilesStateImpl _$$FilesStateImplFromJson(Map<String, dynamic> json) =>
_$FilesStateImpl(
currentFolder: json['currentFolder'] as String,
files: (json['files'] as Map<String, dynamic>).map(
(k, e) => MapEntry(
k,
(e as List<dynamic>)
.map((e) => File.fromJson(e as Map<String, dynamic>))
.toList()),
),
);
Map<String, dynamic> _$$FilesStateImplToJson(_$FilesStateImpl instance) =>
<String, dynamic>{
'currentFolder': instance.currentFolder,
'files': instance.files,
};
_$FileImpl _$$FileImplFromJson(Map<String, dynamic> json) => _$FileImpl(
path: json['path'] as String,
isFolder: json['isFolder'] as bool,
name: json['name'] as String,
createdAt: json['createdAt'] == null
? null
: DateTime.parse(json['createdAt'] as String),
updatedAt: json['updatedAt'] == null
? null
: DateTime.parse(json['updatedAt'] as String),
size: (json['size'] as num?)?.toInt(),
mimeType: json['mimeType'] as String?,
);
Map<String, dynamic> _$$FileImplToJson(_$FileImpl instance) =>
<String, dynamic>{
'path': instance.path,
'isFolder': instance.isFolder,
'name': instance.name,
'createdAt': instance.createdAt?.toIso8601String(),
'updatedAt': instance.updatedAt?.toIso8601String(),
'size': instance.size,
'mimeType': instance.mimeType,
};

View File

@@ -0,0 +1,31 @@
import 'package:nextcloud/nextcloud.dart';
import '../../../../../api/marianumcloud/webdav/webdavApi.dart';
import '../../../infrastructure/repository/repository.dart';
import '../bloc/files_state.dart';
class FilesRepository extends Repository<FilesState> {
Future<List<File>> getFileList(String path) async {
var webdav = await WebdavApi.webdav;
var response = await webdav.propfind(PathUri.parse(path)); // TODO move to custom data loader
var davFiles = response.toWebDavFiles();
davFiles.removeWhere((file) {
var filePath = file.path.path;
return filePath.isEmpty || filePath == path;
});
var files = davFiles.map((davFile) => File(
path: davFile.path.path,
isFolder: davFile.isDirectory,
name: davFile.name,
createdAt: davFile.createdDate,
updatedAt: davFile.lastModified,
size: davFile.size,
mimeType: davFile.mimeType
));
return files.toList();
}
}

View File

@@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
import '../../../infrastructure/loadableState/loadable_state.dart';
import '../../../infrastructure/utilityWidgets/bloc_module.dart';
import '../bloc/files_bloc.dart';
import '../bloc/files_state.dart';
import 'folder_view.dart';
class FilesView extends StatelessWidget {
const FilesView({super.key});
@override
Widget build(BuildContext context) => BlocModule<FilesBloc, LoadableState<FilesState>>(
create: (context) => FilesBloc(),
autoRebuild: true,
child: (context, bloc, state) => FolderView(bloc),
);
}

View File

@@ -0,0 +1,57 @@
import 'dart:developer';
import 'package:filesize/filesize.dart';
import 'package:flutter/material.dart';
import 'package:jiffy/jiffy.dart';
import '../../../../../widget/centeredLeading.dart';
import '../../../../../widget/list_view_util.dart';
import '../../../infrastructure/loadableState/view/loadable_state_consumer.dart';
import '../bloc/files_bloc.dart';
import '../bloc/files_event.dart';
import '../bloc/files_state.dart';
class FolderView extends StatelessWidget {
final FilesBloc bloc;
const FolderView(this.bloc, {super.key});
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(
leading: !bloc.canGoBack() ? null : IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () {
bloc.add(EnterFolder(bloc.goBackLocation()));
Navigator.of(context).pop();
},
),
title: Text(bloc.getCurrentFolderName()),
actions: [
IconButton(onPressed: () {
log(bloc.innerState?.toJson().toString() ?? 'leer');
}, icon: const Icon(Icons.bug_report)),
IconButton(onPressed: () {
bloc.add(EnterFolder('/'));
}, icon: const Icon(Icons.home)),
],
),
body: LoadableStateConsumer<FilesBloc, FilesState>(
controllerByValue: bloc,
child: (state, loading) => ListViewUtil.fromList<File>(bloc.getVisibleFiles(), (file) => ListTile(
leading: CenteredLeading(Icon(file.isFolder ? Icons.folder : Icons.description_outlined)),
title: Text(file.name),
subtitle: file.isFolder
? Text('geändert ${Jiffy.parseFromDateTime(file.updatedAt ?? DateTime.now()).fromNow()}')
: Text('${filesize(file.size)}, ${Jiffy.parseFromDateTime(file.updatedAt ?? DateTime.now()).fromNow()}'),
trailing: Icon(file.isFolder ? Icons.arrow_right : null),
onTap: () {
log(file.path);
if(!file.isFolder) return;
Navigator.of(context).push(MaterialPageRoute(builder: (context) => FolderView(bloc)));
bloc.add(EnterFolder(file.path));
},
))
)
);
}

View File

@@ -4,7 +4,7 @@ part 'grade_averages_state.freezed.dart';
part 'grade_averages_state.g.dart'; part 'grade_averages_state.g.dart';
@freezed @freezed
abstract class GradeAveragesState with _$GradeAveragesState { class GradeAveragesState with _$GradeAveragesState {
const factory GradeAveragesState({ const factory GradeAveragesState({
required GradeAveragesGradingSystem gradingSystem, required GradeAveragesGradingSystem gradingSystem,
required List<int> grades, required List<int> grades,

View File

@@ -1,5 +1,5 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file // coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint // 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 // 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
@@ -9,278 +9,172 @@ part of 'grade_averages_state.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; 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');
GradeAveragesState _$GradeAveragesStateFromJson(Map<String, dynamic> json) {
return _GradeAveragesState.fromJson(json);
}
/// @nodoc /// @nodoc
mixin _$GradeAveragesState { mixin _$GradeAveragesState {
GradeAveragesGradingSystem get gradingSystem =>
throw _privateConstructorUsedError;
List<int> get grades => throw _privateConstructorUsedError;
GradeAveragesGradingSystem get gradingSystem; List<int> get grades; Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of GradeAveragesState @JsonKey(ignore: true)
/// with the given fields replaced by the non-null parameter values. $GradeAveragesStateCopyWith<GradeAveragesState> get copyWith =>
@JsonKey(includeFromJson: false, includeToJson: false) throw _privateConstructorUsedError;
@pragma('vm:prefer-inline')
$GradeAveragesStateCopyWith<GradeAveragesState> get copyWith => _$GradeAveragesStateCopyWithImpl<GradeAveragesState>(this as GradeAveragesState, _$identity);
/// Serializes this GradeAveragesState to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is GradeAveragesState&&(identical(other.gradingSystem, gradingSystem) || other.gradingSystem == gradingSystem)&&const DeepCollectionEquality().equals(other.grades, grades));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,gradingSystem,const DeepCollectionEquality().hash(grades));
@override
String toString() {
return 'GradeAveragesState(gradingSystem: $gradingSystem, grades: $grades)';
}
} }
/// @nodoc /// @nodoc
abstract mixin class $GradeAveragesStateCopyWith<$Res> { abstract class $GradeAveragesStateCopyWith<$Res> {
factory $GradeAveragesStateCopyWith(GradeAveragesState value, $Res Function(GradeAveragesState) _then) = _$GradeAveragesStateCopyWithImpl; factory $GradeAveragesStateCopyWith(
@useResult GradeAveragesState value, $Res Function(GradeAveragesState) then) =
$Res call({ _$GradeAveragesStateCopyWithImpl<$Res, GradeAveragesState>;
GradeAveragesGradingSystem gradingSystem, List<int> grades @useResult
}); $Res call({GradeAveragesGradingSystem gradingSystem, List<int> grades});
} }
/// @nodoc /// @nodoc
class _$GradeAveragesStateCopyWithImpl<$Res> class _$GradeAveragesStateCopyWithImpl<$Res, $Val extends GradeAveragesState>
implements $GradeAveragesStateCopyWith<$Res> { implements $GradeAveragesStateCopyWith<$Res> {
_$GradeAveragesStateCopyWithImpl(this._self, this._then); _$GradeAveragesStateCopyWithImpl(this._value, this._then);
final GradeAveragesState _self; // ignore: unused_field
final $Res Function(GradeAveragesState) _then; final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of GradeAveragesState @pragma('vm:prefer-inline')
/// with the given fields replaced by the non-null parameter values. @override
@pragma('vm:prefer-inline') @override $Res call({Object? gradingSystem = null,Object? grades = null,}) { $Res call({
return _then(_self.copyWith( Object? gradingSystem = null,
gradingSystem: null == gradingSystem ? _self.gradingSystem : gradingSystem // ignore: cast_nullable_to_non_nullable Object? grades = null,
as GradeAveragesGradingSystem,grades: null == grades ? _self.grades : grades // ignore: cast_nullable_to_non_nullable }) {
as List<int>, return _then(_value.copyWith(
)); gradingSystem: null == gradingSystem
? _value.gradingSystem
: gradingSystem // ignore: cast_nullable_to_non_nullable
as GradeAveragesGradingSystem,
grades: null == grades
? _value.grades
: grades // ignore: cast_nullable_to_non_nullable
as List<int>,
) as $Val);
}
} }
/// @nodoc
abstract class _$$GradeAveragesStateImplCopyWith<$Res>
implements $GradeAveragesStateCopyWith<$Res> {
factory _$$GradeAveragesStateImplCopyWith(_$GradeAveragesStateImpl value,
$Res Function(_$GradeAveragesStateImpl) then) =
__$$GradeAveragesStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({GradeAveragesGradingSystem gradingSystem, List<int> grades});
} }
/// @nodoc
class __$$GradeAveragesStateImplCopyWithImpl<$Res>
extends _$GradeAveragesStateCopyWithImpl<$Res, _$GradeAveragesStateImpl>
implements _$$GradeAveragesStateImplCopyWith<$Res> {
__$$GradeAveragesStateImplCopyWithImpl(_$GradeAveragesStateImpl _value,
$Res Function(_$GradeAveragesStateImpl) _then)
: super(_value, _then);
/// Adds pattern-matching-related methods to [GradeAveragesState]. @pragma('vm:prefer-inline')
extension GradeAveragesStatePatterns on GradeAveragesState { @override
/// A variant of `map` that fallback to returning `orElse`. $Res call({
/// Object? gradingSystem = null,
/// It is equivalent to doing: Object? grades = null,
/// ```dart }) {
/// switch (sealedClass) { return _then(_$GradeAveragesStateImpl(
/// case final Subclass value: gradingSystem: null == gradingSystem
/// return ...; ? _value.gradingSystem
/// case _: : gradingSystem // ignore: cast_nullable_to_non_nullable
/// return orElse(); as GradeAveragesGradingSystem,
/// } grades: null == grades
/// ``` ? _value._grades
: grades // ignore: cast_nullable_to_non_nullable
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _GradeAveragesState value)? $default,{required TResult orElse(),}){ as List<int>,
final _that = this; ));
switch (_that) { }
case _GradeAveragesState() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _GradeAveragesState value) $default,){
final _that = this;
switch (_that) {
case _GradeAveragesState():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _GradeAveragesState value)? $default,){
final _that = this;
switch (_that) {
case _GradeAveragesState() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( GradeAveragesGradingSystem gradingSystem, List<int> grades)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _GradeAveragesState() when $default != null:
return $default(_that.gradingSystem,_that.grades);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( GradeAveragesGradingSystem gradingSystem, List<int> grades) $default,) {final _that = this;
switch (_that) {
case _GradeAveragesState():
return $default(_that.gradingSystem,_that.grades);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( GradeAveragesGradingSystem gradingSystem, List<int> grades)? $default,) {final _that = this;
switch (_that) {
case _GradeAveragesState() when $default != null:
return $default(_that.gradingSystem,_that.grades);case _:
return null;
}
}
} }
/// @nodoc /// @nodoc
@JsonSerializable() @JsonSerializable()
class _$GradeAveragesStateImpl implements _GradeAveragesState {
const _$GradeAveragesStateImpl(
{required this.gradingSystem, required final List<int> grades})
: _grades = grades;
class _GradeAveragesState implements GradeAveragesState { factory _$GradeAveragesStateImpl.fromJson(Map<String, dynamic> json) =>
const _GradeAveragesState({required this.gradingSystem, required final List<int> grades}): _grades = grades; _$$GradeAveragesStateImplFromJson(json);
factory _GradeAveragesState.fromJson(Map<String, dynamic> json) => _$GradeAveragesStateFromJson(json);
@override final GradeAveragesGradingSystem gradingSystem; @override
final List<int> _grades; final GradeAveragesGradingSystem gradingSystem;
@override List<int> get grades { final List<int> _grades;
if (_grades is EqualUnmodifiableListView) return _grades; @override
// ignore: implicit_dynamic_type List<int> get grades {
return EqualUnmodifiableListView(_grades); if (_grades is EqualUnmodifiableListView) return _grades;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_grades);
}
@override
String toString() {
return 'GradeAveragesState(gradingSystem: $gradingSystem, grades: $grades)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$GradeAveragesStateImpl &&
(identical(other.gradingSystem, gradingSystem) ||
other.gradingSystem == gradingSystem) &&
const DeepCollectionEquality().equals(other._grades, _grades));
}
@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(
runtimeType, gradingSystem, const DeepCollectionEquality().hash(_grades));
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$GradeAveragesStateImplCopyWith<_$GradeAveragesStateImpl> get copyWith =>
__$$GradeAveragesStateImplCopyWithImpl<_$GradeAveragesStateImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$GradeAveragesStateImplToJson(
this,
);
}
} }
abstract class _GradeAveragesState implements GradeAveragesState {
const factory _GradeAveragesState(
{required final GradeAveragesGradingSystem gradingSystem,
required final List<int> grades}) = _$GradeAveragesStateImpl;
/// Create a copy of GradeAveragesState factory _GradeAveragesState.fromJson(Map<String, dynamic> json) =
/// with the given fields replaced by the non-null parameter values. _$GradeAveragesStateImpl.fromJson;
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$GradeAveragesStateCopyWith<_GradeAveragesState> get copyWith => __$GradeAveragesStateCopyWithImpl<_GradeAveragesState>(this, _$identity);
@override @override
Map<String, dynamic> toJson() { GradeAveragesGradingSystem get gradingSystem;
return _$GradeAveragesStateToJson(this, ); @override
List<int> get grades;
@override
@JsonKey(ignore: true)
_$$GradeAveragesStateImplCopyWith<_$GradeAveragesStateImpl> get copyWith =>
throw _privateConstructorUsedError;
} }
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _GradeAveragesState&&(identical(other.gradingSystem, gradingSystem) || other.gradingSystem == gradingSystem)&&const DeepCollectionEquality().equals(other._grades, _grades));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,gradingSystem,const DeepCollectionEquality().hash(_grades));
@override
String toString() {
return 'GradeAveragesState(gradingSystem: $gradingSystem, grades: $grades)';
}
}
/// @nodoc
abstract mixin class _$GradeAveragesStateCopyWith<$Res> implements $GradeAveragesStateCopyWith<$Res> {
factory _$GradeAveragesStateCopyWith(_GradeAveragesState value, $Res Function(_GradeAveragesState) _then) = __$GradeAveragesStateCopyWithImpl;
@override @useResult
$Res call({
GradeAveragesGradingSystem gradingSystem, List<int> grades
});
}
/// @nodoc
class __$GradeAveragesStateCopyWithImpl<$Res>
implements _$GradeAveragesStateCopyWith<$Res> {
__$GradeAveragesStateCopyWithImpl(this._self, this._then);
final _GradeAveragesState _self;
final $Res Function(_GradeAveragesState) _then;
/// Create a copy of GradeAveragesState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? gradingSystem = null,Object? grades = null,}) {
return _then(_GradeAveragesState(
gradingSystem: null == gradingSystem ? _self.gradingSystem : gradingSystem // ignore: cast_nullable_to_non_nullable
as GradeAveragesGradingSystem,grades: null == grades ? _self._grades : grades // ignore: cast_nullable_to_non_nullable
as List<int>,
));
}
}
// dart format on

View File

@@ -6,23 +6,23 @@ part of 'grade_averages_state.dart';
// JsonSerializableGenerator // JsonSerializableGenerator
// ************************************************************************** // **************************************************************************
_GradeAveragesState _$GradeAveragesStateFromJson(Map<String, dynamic> json) => _$GradeAveragesStateImpl _$$GradeAveragesStateImplFromJson(
_GradeAveragesState( Map<String, dynamic> json) =>
_$GradeAveragesStateImpl(
gradingSystem: $enumDecode( gradingSystem: $enumDecode(
_$GradeAveragesGradingSystemEnumMap, _$GradeAveragesGradingSystemEnumMap, json['gradingSystem']),
json['gradingSystem'],
),
grades: (json['grades'] as List<dynamic>) grades: (json['grades'] as List<dynamic>)
.map((e) => (e as num).toInt()) .map((e) => (e as num).toInt())
.toList(), .toList(),
); );
Map<String, dynamic> _$GradeAveragesStateToJson( Map<String, dynamic> _$$GradeAveragesStateImplToJson(
_GradeAveragesState instance, _$GradeAveragesStateImpl instance) =>
) => <String, dynamic>{ <String, dynamic>{
'gradingSystem': _$GradeAveragesGradingSystemEnumMap[instance.gradingSystem]!, 'gradingSystem':
'grades': instance.grades, _$GradeAveragesGradingSystemEnumMap[instance.gradingSystem]!,
}; 'grades': instance.grades,
};
const _$GradeAveragesGradingSystemEnumMap = { const _$GradeAveragesGradingSystemEnumMap = {
GradeAveragesGradingSystem.highSchool: 'highSchool', GradeAveragesGradingSystem.highSchool: 'highSchool',

View File

@@ -5,7 +5,7 @@ part 'holidays_state.freezed.dart';
part 'holidays_state.g.dart'; part 'holidays_state.g.dart';
@freezed @freezed
abstract class HolidaysState with _$HolidaysState { class HolidaysState with _$HolidaysState {
const factory HolidaysState({ const factory HolidaysState({
required bool showPastHolidays, required bool showPastHolidays,
required bool showDisclaimer, required bool showDisclaimer,
@@ -16,7 +16,7 @@ abstract class HolidaysState with _$HolidaysState {
} }
@freezed @freezed
abstract class Holiday with _$Holiday { class Holiday with _$Holiday {
const factory Holiday({ const factory Holiday({
required String start, required String start,
required String end, required String end,

View File

@@ -1,5 +1,5 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file // coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint // 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 // 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
@@ -9,583 +9,455 @@ part of 'holidays_state.dart';
// FreezedGenerator // FreezedGenerator
// ************************************************************************** // **************************************************************************
// dart format off
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
/// @nodoc final _privateConstructorUsedError = UnsupportedError(
mixin _$HolidaysState implements DiagnosticableTreeMixin { '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');
bool get showPastHolidays; bool get showDisclaimer; List<Holiday> get holidays;
/// Create a copy of HolidaysState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$HolidaysStateCopyWith<HolidaysState> get copyWith => _$HolidaysStateCopyWithImpl<HolidaysState>(this as HolidaysState, _$identity);
/// Serializes this HolidaysState to a JSON map.
Map<String, dynamic> toJson();
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
properties
..add(DiagnosticsProperty('type', 'HolidaysState'))
..add(DiagnosticsProperty('showPastHolidays', showPastHolidays))..add(DiagnosticsProperty('showDisclaimer', showDisclaimer))..add(DiagnosticsProperty('holidays', holidays));
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is HolidaysState&&(identical(other.showPastHolidays, showPastHolidays) || other.showPastHolidays == showPastHolidays)&&(identical(other.showDisclaimer, showDisclaimer) || other.showDisclaimer == showDisclaimer)&&const DeepCollectionEquality().equals(other.holidays, holidays));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,showPastHolidays,showDisclaimer,const DeepCollectionEquality().hash(holidays));
@override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
return 'HolidaysState(showPastHolidays: $showPastHolidays, showDisclaimer: $showDisclaimer, holidays: $holidays)';
}
HolidaysState _$HolidaysStateFromJson(Map<String, dynamic> json) {
return _HolidaysState.fromJson(json);
} }
/// @nodoc /// @nodoc
abstract mixin class $HolidaysStateCopyWith<$Res> { mixin _$HolidaysState {
factory $HolidaysStateCopyWith(HolidaysState value, $Res Function(HolidaysState) _then) = _$HolidaysStateCopyWithImpl; bool get showPastHolidays => throw _privateConstructorUsedError;
@useResult bool get showDisclaimer => throw _privateConstructorUsedError;
$Res call({ List<Holiday> get holidays => throw _privateConstructorUsedError;
bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays
});
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$HolidaysStateCopyWith<HolidaysState> get copyWith =>
throw _privateConstructorUsedError;
} }
/// @nodoc /// @nodoc
class _$HolidaysStateCopyWithImpl<$Res> abstract class $HolidaysStateCopyWith<$Res> {
factory $HolidaysStateCopyWith(
HolidaysState value, $Res Function(HolidaysState) then) =
_$HolidaysStateCopyWithImpl<$Res, HolidaysState>;
@useResult
$Res call(
{bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays});
}
/// @nodoc
class _$HolidaysStateCopyWithImpl<$Res, $Val extends HolidaysState>
implements $HolidaysStateCopyWith<$Res> { implements $HolidaysStateCopyWith<$Res> {
_$HolidaysStateCopyWithImpl(this._self, this._then); _$HolidaysStateCopyWithImpl(this._value, this._then);
final HolidaysState _self; // ignore: unused_field
final $Res Function(HolidaysState) _then; final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of HolidaysState @pragma('vm:prefer-inline')
/// with the given fields replaced by the non-null parameter values. @override
@pragma('vm:prefer-inline') @override $Res call({Object? showPastHolidays = null,Object? showDisclaimer = null,Object? holidays = null,}) { $Res call({
return _then(_self.copyWith( Object? showPastHolidays = null,
showPastHolidays: null == showPastHolidays ? _self.showPastHolidays : showPastHolidays // ignore: cast_nullable_to_non_nullable Object? showDisclaimer = null,
as bool,showDisclaimer: null == showDisclaimer ? _self.showDisclaimer : showDisclaimer // ignore: cast_nullable_to_non_nullable Object? holidays = null,
as bool,holidays: null == holidays ? _self.holidays : holidays // ignore: cast_nullable_to_non_nullable }) {
as List<Holiday>, return _then(_value.copyWith(
)); showPastHolidays: null == showPastHolidays
? _value.showPastHolidays
: showPastHolidays // ignore: cast_nullable_to_non_nullable
as bool,
showDisclaimer: null == showDisclaimer
? _value.showDisclaimer
: showDisclaimer // ignore: cast_nullable_to_non_nullable
as bool,
holidays: null == holidays
? _value.holidays
: holidays // ignore: cast_nullable_to_non_nullable
as List<Holiday>,
) as $Val);
}
} }
/// @nodoc
abstract class _$$HolidaysStateImplCopyWith<$Res>
implements $HolidaysStateCopyWith<$Res> {
factory _$$HolidaysStateImplCopyWith(
_$HolidaysStateImpl value, $Res Function(_$HolidaysStateImpl) then) =
__$$HolidaysStateImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays});
} }
/// @nodoc
class __$$HolidaysStateImplCopyWithImpl<$Res>
extends _$HolidaysStateCopyWithImpl<$Res, _$HolidaysStateImpl>
implements _$$HolidaysStateImplCopyWith<$Res> {
__$$HolidaysStateImplCopyWithImpl(
_$HolidaysStateImpl _value, $Res Function(_$HolidaysStateImpl) _then)
: super(_value, _then);
/// Adds pattern-matching-related methods to [HolidaysState]. @pragma('vm:prefer-inline')
extension HolidaysStatePatterns on HolidaysState { @override
/// A variant of `map` that fallback to returning `orElse`. $Res call({
/// Object? showPastHolidays = null,
/// It is equivalent to doing: Object? showDisclaimer = null,
/// ```dart Object? holidays = null,
/// switch (sealedClass) { }) {
/// case final Subclass value: return _then(_$HolidaysStateImpl(
/// return ...; showPastHolidays: null == showPastHolidays
/// case _: ? _value.showPastHolidays
/// return orElse(); : showPastHolidays // ignore: cast_nullable_to_non_nullable
/// } as bool,
/// ``` showDisclaimer: null == showDisclaimer
? _value.showDisclaimer
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _HolidaysState value)? $default,{required TResult orElse(),}){ : showDisclaimer // ignore: cast_nullable_to_non_nullable
final _that = this; as bool,
switch (_that) { holidays: null == holidays
case _HolidaysState() when $default != null: ? _value._holidays
return $default(_that);case _: : holidays // ignore: cast_nullable_to_non_nullable
return orElse(); as List<Holiday>,
));
} }
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _HolidaysState value) $default,){
final _that = this;
switch (_that) {
case _HolidaysState():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _HolidaysState value)? $default,){
final _that = this;
switch (_that) {
case _HolidaysState() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _HolidaysState() when $default != null:
return $default(_that.showPastHolidays,_that.showDisclaimer,_that.holidays);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays) $default,) {final _that = this;
switch (_that) {
case _HolidaysState():
return $default(_that.showPastHolidays,_that.showDisclaimer,_that.holidays);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays)? $default,) {final _that = this;
switch (_that) {
case _HolidaysState() when $default != null:
return $default(_that.showPastHolidays,_that.showDisclaimer,_that.holidays);case _:
return null;
}
}
} }
/// @nodoc /// @nodoc
@JsonSerializable() @JsonSerializable()
class _$HolidaysStateImpl
with DiagnosticableTreeMixin
implements _HolidaysState {
const _$HolidaysStateImpl(
{required this.showPastHolidays,
required this.showDisclaimer,
required final List<Holiday> holidays})
: _holidays = holidays;
class _HolidaysState with DiagnosticableTreeMixin implements HolidaysState { factory _$HolidaysStateImpl.fromJson(Map<String, dynamic> json) =>
const _HolidaysState({required this.showPastHolidays, required this.showDisclaimer, required final List<Holiday> holidays}): _holidays = holidays; _$$HolidaysStateImplFromJson(json);
factory _HolidaysState.fromJson(Map<String, dynamic> json) => _$HolidaysStateFromJson(json);
@override final bool showPastHolidays; @override
@override final bool showDisclaimer; final bool showPastHolidays;
final List<Holiday> _holidays; @override
@override List<Holiday> get holidays { final bool showDisclaimer;
if (_holidays is EqualUnmodifiableListView) return _holidays; final List<Holiday> _holidays;
// ignore: implicit_dynamic_type @override
return EqualUnmodifiableListView(_holidays); List<Holiday> get holidays {
if (_holidays is EqualUnmodifiableListView) return _holidays;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_holidays);
}
@override
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
return 'HolidaysState(showPastHolidays: $showPastHolidays, showDisclaimer: $showDisclaimer, holidays: $holidays)';
}
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties
..add(DiagnosticsProperty('type', 'HolidaysState'))
..add(DiagnosticsProperty('showPastHolidays', showPastHolidays))
..add(DiagnosticsProperty('showDisclaimer', showDisclaimer))
..add(DiagnosticsProperty('holidays', holidays));
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$HolidaysStateImpl &&
(identical(other.showPastHolidays, showPastHolidays) ||
other.showPastHolidays == showPastHolidays) &&
(identical(other.showDisclaimer, showDisclaimer) ||
other.showDisclaimer == showDisclaimer) &&
const DeepCollectionEquality().equals(other._holidays, _holidays));
}
@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(runtimeType, showPastHolidays, showDisclaimer,
const DeepCollectionEquality().hash(_holidays));
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$HolidaysStateImplCopyWith<_$HolidaysStateImpl> get copyWith =>
__$$HolidaysStateImplCopyWithImpl<_$HolidaysStateImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$HolidaysStateImplToJson(
this,
);
}
} }
abstract class _HolidaysState implements HolidaysState {
const factory _HolidaysState(
{required final bool showPastHolidays,
required final bool showDisclaimer,
required final List<Holiday> holidays}) = _$HolidaysStateImpl;
/// Create a copy of HolidaysState factory _HolidaysState.fromJson(Map<String, dynamic> json) =
/// with the given fields replaced by the non-null parameter values. _$HolidaysStateImpl.fromJson;
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$HolidaysStateCopyWith<_HolidaysState> get copyWith => __$HolidaysStateCopyWithImpl<_HolidaysState>(this, _$identity);
@override @override
Map<String, dynamic> toJson() { bool get showPastHolidays;
return _$HolidaysStateToJson(this, ); @override
} bool get showDisclaimer;
@override @override
void debugFillProperties(DiagnosticPropertiesBuilder properties) { List<Holiday> get holidays;
properties @override
..add(DiagnosticsProperty('type', 'HolidaysState')) @JsonKey(ignore: true)
..add(DiagnosticsProperty('showPastHolidays', showPastHolidays))..add(DiagnosticsProperty('showDisclaimer', showDisclaimer))..add(DiagnosticsProperty('holidays', holidays)); _$$HolidaysStateImplCopyWith<_$HolidaysStateImpl> get copyWith =>
throw _privateConstructorUsedError;
} }
@override Holiday _$HolidayFromJson(Map<String, dynamic> json) {
bool operator ==(Object other) { return _Holiday.fromJson(json);
return identical(this, other) || (other.runtimeType == runtimeType&&other is _HolidaysState&&(identical(other.showPastHolidays, showPastHolidays) || other.showPastHolidays == showPastHolidays)&&(identical(other.showDisclaimer, showDisclaimer) || other.showDisclaimer == showDisclaimer)&&const DeepCollectionEquality().equals(other._holidays, _holidays));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,showPastHolidays,showDisclaimer,const DeepCollectionEquality().hash(_holidays));
@override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
return 'HolidaysState(showPastHolidays: $showPastHolidays, showDisclaimer: $showDisclaimer, holidays: $holidays)';
}
} }
/// @nodoc /// @nodoc
abstract mixin class _$HolidaysStateCopyWith<$Res> implements $HolidaysStateCopyWith<$Res> { mixin _$Holiday {
factory _$HolidaysStateCopyWith(_HolidaysState value, $Res Function(_HolidaysState) _then) = __$HolidaysStateCopyWithImpl; String get start => throw _privateConstructorUsedError;
@override @useResult String get end => throw _privateConstructorUsedError;
$Res call({ int get year => throw _privateConstructorUsedError;
bool showPastHolidays, bool showDisclaimer, List<Holiday> holidays String get stateCode => throw _privateConstructorUsedError;
}); String get name => throw _privateConstructorUsedError;
String get slug => throw _privateConstructorUsedError;
}
/// @nodoc
class __$HolidaysStateCopyWithImpl<$Res>
implements _$HolidaysStateCopyWith<$Res> {
__$HolidaysStateCopyWithImpl(this._self, this._then);
final _HolidaysState _self;
final $Res Function(_HolidaysState) _then;
/// Create a copy of HolidaysState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? showPastHolidays = null,Object? showDisclaimer = null,Object? holidays = null,}) {
return _then(_HolidaysState(
showPastHolidays: null == showPastHolidays ? _self.showPastHolidays : showPastHolidays // ignore: cast_nullable_to_non_nullable
as bool,showDisclaimer: null == showDisclaimer ? _self.showDisclaimer : showDisclaimer // ignore: cast_nullable_to_non_nullable
as bool,holidays: null == holidays ? _self._holidays : holidays // ignore: cast_nullable_to_non_nullable
as List<Holiday>,
));
}
}
/// @nodoc
mixin _$Holiday implements DiagnosticableTreeMixin {
String get start; String get end; int get year; String get stateCode; String get name; String get slug;
/// Create a copy of Holiday
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$HolidayCopyWith<Holiday> get copyWith => _$HolidayCopyWithImpl<Holiday>(this as Holiday, _$identity);
/// Serializes this Holiday to a JSON map.
Map<String, dynamic> toJson();
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
properties
..add(DiagnosticsProperty('type', 'Holiday'))
..add(DiagnosticsProperty('start', start))..add(DiagnosticsProperty('end', end))..add(DiagnosticsProperty('year', year))..add(DiagnosticsProperty('stateCode', stateCode))..add(DiagnosticsProperty('name', name))..add(DiagnosticsProperty('slug', slug));
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is Holiday&&(identical(other.start, start) || other.start == start)&&(identical(other.end, end) || other.end == end)&&(identical(other.year, year) || other.year == year)&&(identical(other.stateCode, stateCode) || other.stateCode == stateCode)&&(identical(other.name, name) || other.name == name)&&(identical(other.slug, slug) || other.slug == slug));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,start,end,year,stateCode,name,slug);
@override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
return 'Holiday(start: $start, end: $end, year: $year, stateCode: $stateCode, name: $name, slug: $slug)';
}
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$HolidayCopyWith<Holiday> get copyWith => throw _privateConstructorUsedError;
} }
/// @nodoc /// @nodoc
abstract mixin class $HolidayCopyWith<$Res> { abstract class $HolidayCopyWith<$Res> {
factory $HolidayCopyWith(Holiday value, $Res Function(Holiday) _then) = _$HolidayCopyWithImpl; factory $HolidayCopyWith(Holiday value, $Res Function(Holiday) then) =
@useResult _$HolidayCopyWithImpl<$Res, Holiday>;
$Res call({ @useResult
String start, String end, int year, String stateCode, String name, String slug $Res call(
}); {String start,
String end,
int year,
String stateCode,
String name,
String slug});
} }
/// @nodoc /// @nodoc
class _$HolidayCopyWithImpl<$Res> class _$HolidayCopyWithImpl<$Res, $Val extends Holiday>
implements $HolidayCopyWith<$Res> { implements $HolidayCopyWith<$Res> {
_$HolidayCopyWithImpl(this._self, this._then); _$HolidayCopyWithImpl(this._value, this._then);
final Holiday _self; // ignore: unused_field
final $Res Function(Holiday) _then; final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Holiday @pragma('vm:prefer-inline')
/// with the given fields replaced by the non-null parameter values. @override
@pragma('vm:prefer-inline') @override $Res call({Object? start = null,Object? end = null,Object? year = null,Object? stateCode = null,Object? name = null,Object? slug = null,}) { $Res call({
return _then(_self.copyWith( Object? start = null,
start: null == start ? _self.start : start // ignore: cast_nullable_to_non_nullable Object? end = null,
as String,end: null == end ? _self.end : end // ignore: cast_nullable_to_non_nullable Object? year = null,
as String,year: null == year ? _self.year : year // ignore: cast_nullable_to_non_nullable Object? stateCode = null,
as int,stateCode: null == stateCode ? _self.stateCode : stateCode // ignore: cast_nullable_to_non_nullable Object? name = null,
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable Object? slug = null,
as String,slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable }) {
as String, return _then(_value.copyWith(
)); start: null == start
? _value.start
: start // ignore: cast_nullable_to_non_nullable
as String,
end: null == end
? _value.end
: end // ignore: cast_nullable_to_non_nullable
as String,
year: null == year
? _value.year
: year // ignore: cast_nullable_to_non_nullable
as int,
stateCode: null == stateCode
? _value.stateCode
: stateCode // ignore: cast_nullable_to_non_nullable
as String,
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,
) as $Val);
}
} }
/// @nodoc
abstract class _$$HolidayImplCopyWith<$Res> implements $HolidayCopyWith<$Res> {
factory _$$HolidayImplCopyWith(
_$HolidayImpl value, $Res Function(_$HolidayImpl) then) =
__$$HolidayImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{String start,
String end,
int year,
String stateCode,
String name,
String slug});
} }
/// @nodoc
class __$$HolidayImplCopyWithImpl<$Res>
extends _$HolidayCopyWithImpl<$Res, _$HolidayImpl>
implements _$$HolidayImplCopyWith<$Res> {
__$$HolidayImplCopyWithImpl(
_$HolidayImpl _value, $Res Function(_$HolidayImpl) _then)
: super(_value, _then);
/// Adds pattern-matching-related methods to [Holiday]. @pragma('vm:prefer-inline')
extension HolidayPatterns on Holiday { @override
/// A variant of `map` that fallback to returning `orElse`. $Res call({
/// Object? start = null,
/// It is equivalent to doing: Object? end = null,
/// ```dart Object? year = null,
/// switch (sealedClass) { Object? stateCode = null,
/// case final Subclass value: Object? name = null,
/// return ...; Object? slug = null,
/// case _: }) {
/// return orElse(); return _then(_$HolidayImpl(
/// } start: null == start
/// ``` ? _value.start
: start // ignore: cast_nullable_to_non_nullable
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _Holiday value)? $default,{required TResult orElse(),}){ as String,
final _that = this; end: null == end
switch (_that) { ? _value.end
case _Holiday() when $default != null: : end // ignore: cast_nullable_to_non_nullable
return $default(_that);case _: as String,
return orElse(); year: null == year
? _value.year
} : year // ignore: cast_nullable_to_non_nullable
} as int,
/// A `switch`-like method, using callbacks. stateCode: null == stateCode
/// ? _value.stateCode
/// Callbacks receives the raw object, upcasted. : stateCode // ignore: cast_nullable_to_non_nullable
/// It is equivalent to doing: as String,
/// ```dart name: null == name
/// switch (sealedClass) { ? _value.name
/// case final Subclass value: : name // ignore: cast_nullable_to_non_nullable
/// return ...; as String,
/// case final Subclass2 value: slug: null == slug
/// return ...; ? _value.slug
/// } : slug // ignore: cast_nullable_to_non_nullable
/// ``` as String,
));
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _Holiday value) $default,){ }
final _that = this;
switch (_that) {
case _Holiday():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _Holiday value)? $default,){
final _that = this;
switch (_that) {
case _Holiday() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String start, String end, int year, String stateCode, String name, String slug)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _Holiday() when $default != null:
return $default(_that.start,_that.end,_that.year,_that.stateCode,_that.name,_that.slug);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String start, String end, int year, String stateCode, String name, String slug) $default,) {final _that = this;
switch (_that) {
case _Holiday():
return $default(_that.start,_that.end,_that.year,_that.stateCode,_that.name,_that.slug);case _:
throw StateError('Unexpected subclass');
}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String start, String end, int year, String stateCode, String name, String slug)? $default,) {final _that = this;
switch (_that) {
case _Holiday() when $default != null:
return $default(_that.start,_that.end,_that.year,_that.stateCode,_that.name,_that.slug);case _:
return null;
}
}
} }
/// @nodoc /// @nodoc
@JsonSerializable() @JsonSerializable()
class _$HolidayImpl with DiagnosticableTreeMixin implements _Holiday {
const _$HolidayImpl(
{required this.start,
required this.end,
required this.year,
required this.stateCode,
required this.name,
required this.slug});
class _Holiday with DiagnosticableTreeMixin implements Holiday { factory _$HolidayImpl.fromJson(Map<String, dynamic> json) =>
const _Holiday({required this.start, required this.end, required this.year, required this.stateCode, required this.name, required this.slug}); _$$HolidayImplFromJson(json);
factory _Holiday.fromJson(Map<String, dynamic> json) => _$HolidayFromJson(json);
@override final String start; @override
@override final String end; final String start;
@override final int year; @override
@override final String stateCode; final String end;
@override final String name; @override
@override final String slug; final int year;
@override
final String stateCode;
@override
final String name;
@override
final String slug;
/// Create a copy of Holiday @override
/// with the given fields replaced by the non-null parameter values. String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
@override @JsonKey(includeFromJson: false, includeToJson: false) return 'Holiday(start: $start, end: $end, year: $year, stateCode: $stateCode, name: $name, slug: $slug)';
@pragma('vm:prefer-inline') }
_$HolidayCopyWith<_Holiday> get copyWith => __$HolidayCopyWithImpl<_Holiday>(this, _$identity);
@override @override
Map<String, dynamic> toJson() { void debugFillProperties(DiagnosticPropertiesBuilder properties) {
return _$HolidayToJson(this, ); super.debugFillProperties(properties);
} properties
@override ..add(DiagnosticsProperty('type', 'Holiday'))
void debugFillProperties(DiagnosticPropertiesBuilder properties) { ..add(DiagnosticsProperty('start', start))
properties ..add(DiagnosticsProperty('end', end))
..add(DiagnosticsProperty('type', 'Holiday')) ..add(DiagnosticsProperty('year', year))
..add(DiagnosticsProperty('start', start))..add(DiagnosticsProperty('end', end))..add(DiagnosticsProperty('year', year))..add(DiagnosticsProperty('stateCode', stateCode))..add(DiagnosticsProperty('name', name))..add(DiagnosticsProperty('slug', slug)); ..add(DiagnosticsProperty('stateCode', stateCode))
..add(DiagnosticsProperty('name', name))
..add(DiagnosticsProperty('slug', slug));
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$HolidayImpl &&
(identical(other.start, start) || other.start == start) &&
(identical(other.end, end) || other.end == end) &&
(identical(other.year, year) || other.year == year) &&
(identical(other.stateCode, stateCode) ||
other.stateCode == stateCode) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.slug, slug) || other.slug == slug));
}
@JsonKey(ignore: true)
@override
int get hashCode =>
Object.hash(runtimeType, start, end, year, stateCode, name, slug);
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$HolidayImplCopyWith<_$HolidayImpl> get copyWith =>
__$$HolidayImplCopyWithImpl<_$HolidayImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$HolidayImplToJson(
this,
);
}
} }
@override abstract class _Holiday implements Holiday {
bool operator ==(Object other) { const factory _Holiday(
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Holiday&&(identical(other.start, start) || other.start == start)&&(identical(other.end, end) || other.end == end)&&(identical(other.year, year) || other.year == year)&&(identical(other.stateCode, stateCode) || other.stateCode == stateCode)&&(identical(other.name, name) || other.name == name)&&(identical(other.slug, slug) || other.slug == slug)); {required final String start,
required final String end,
required final int year,
required final String stateCode,
required final String name,
required final String slug}) = _$HolidayImpl;
factory _Holiday.fromJson(Map<String, dynamic> json) = _$HolidayImpl.fromJson;
@override
String get start;
@override
String get end;
@override
int get year;
@override
String get stateCode;
@override
String get name;
@override
String get slug;
@override
@JsonKey(ignore: true)
_$$HolidayImplCopyWith<_$HolidayImpl> get copyWith =>
throw _privateConstructorUsedError;
} }
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,start,end,year,stateCode,name,slug);
@override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
return 'Holiday(start: $start, end: $end, year: $year, stateCode: $stateCode, name: $name, slug: $slug)';
}
}
/// @nodoc
abstract mixin class _$HolidayCopyWith<$Res> implements $HolidayCopyWith<$Res> {
factory _$HolidayCopyWith(_Holiday value, $Res Function(_Holiday) _then) = __$HolidayCopyWithImpl;
@override @useResult
$Res call({
String start, String end, int year, String stateCode, String name, String slug
});
}
/// @nodoc
class __$HolidayCopyWithImpl<$Res>
implements _$HolidayCopyWith<$Res> {
__$HolidayCopyWithImpl(this._self, this._then);
final _Holiday _self;
final $Res Function(_Holiday) _then;
/// Create a copy of Holiday
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? start = null,Object? end = null,Object? year = null,Object? stateCode = null,Object? name = null,Object? slug = null,}) {
return _then(_Holiday(
start: null == start ? _self.start : start // ignore: cast_nullable_to_non_nullable
as String,end: null == end ? _self.end : end // ignore: cast_nullable_to_non_nullable
as String,year: null == year ? _self.year : year // ignore: cast_nullable_to_non_nullable
as int,stateCode: null == stateCode ? _self.stateCode : stateCode // ignore: cast_nullable_to_non_nullable
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
// dart format on

View File

@@ -6,8 +6,8 @@ part of 'holidays_state.dart';
// JsonSerializableGenerator // JsonSerializableGenerator
// ************************************************************************** // **************************************************************************
_HolidaysState _$HolidaysStateFromJson(Map<String, dynamic> json) => _$HolidaysStateImpl _$$HolidaysStateImplFromJson(Map<String, dynamic> json) =>
_HolidaysState( _$HolidaysStateImpl(
showPastHolidays: json['showPastHolidays'] as bool, showPastHolidays: json['showPastHolidays'] as bool,
showDisclaimer: json['showDisclaimer'] as bool, showDisclaimer: json['showDisclaimer'] as bool,
holidays: (json['holidays'] as List<dynamic>) holidays: (json['holidays'] as List<dynamic>)
@@ -15,27 +15,29 @@ _HolidaysState _$HolidaysStateFromJson(Map<String, dynamic> json) =>
.toList(), .toList(),
); );
Map<String, dynamic> _$HolidaysStateToJson(_HolidaysState instance) => Map<String, dynamic> _$$HolidaysStateImplToJson(_$HolidaysStateImpl instance) =>
<String, dynamic>{ <String, dynamic>{
'showPastHolidays': instance.showPastHolidays, 'showPastHolidays': instance.showPastHolidays,
'showDisclaimer': instance.showDisclaimer, 'showDisclaimer': instance.showDisclaimer,
'holidays': instance.holidays, 'holidays': instance.holidays,
}; };
_Holiday _$HolidayFromJson(Map<String, dynamic> json) => _Holiday( _$HolidayImpl _$$HolidayImplFromJson(Map<String, dynamic> json) =>
start: json['start'] as String, _$HolidayImpl(
end: json['end'] as String, start: json['start'] as String,
year: (json['year'] as num).toInt(), end: json['end'] as String,
stateCode: json['stateCode'] as String, year: (json['year'] as num).toInt(),
name: json['name'] as String, stateCode: json['stateCode'] as String,
slug: json['slug'] as String, name: json['name'] as String,
); slug: json['slug'] as String,
);
Map<String, dynamic> _$HolidayToJson(_Holiday instance) => <String, dynamic>{ Map<String, dynamic> _$$HolidayImplToJson(_$HolidayImpl instance) =>
'start': instance.start, <String, dynamic>{
'end': instance.end, 'start': instance.start,
'year': instance.year, 'end': instance.end,
'stateCode': instance.stateCode, 'year': instance.year,
'name': instance.name, 'stateCode': instance.stateCode,
'slug': instance.slug, 'name': instance.name,
}; 'slug': instance.slug,
};

View File

@@ -1,7 +1,7 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import '../../../basis/dataloader/holiday_data_loader.dart'; import '../../../basis/dataloader/holiday_data_loader.dart';
import '../../../infrastructure/dataLoader/data_loader.dart'; import '../../../infrastructure/dataLoader/http_data_loader.dart';
import '../bloc/holidays_state.dart'; import '../bloc/holidays_state.dart';
class HolidaysGetHolidays extends HolidayDataLoader<List<Holiday>> { class HolidaysGetHolidays extends HolidayDataLoader<List<Holiday>> {

View File

@@ -5,7 +5,7 @@ part 'marianum_message_state.g.dart';
@freezed @freezed
abstract class MarianumMessageState with _$MarianumMessageState { class MarianumMessageState with _$MarianumMessageState {
const factory MarianumMessageState({ const factory MarianumMessageState({
required MarianumMessageList messageList, required MarianumMessageList messageList,
}) = _MarianumMessageState; }) = _MarianumMessageState;
@@ -14,7 +14,7 @@ abstract class MarianumMessageState with _$MarianumMessageState {
} }
@freezed @freezed
abstract class MarianumMessageList with _$MarianumMessageList { class MarianumMessageList with _$MarianumMessageList {
const factory MarianumMessageList({ const factory MarianumMessageList({
required String base, required String base,
required List<MarianumMessage> messages, required List<MarianumMessage> messages,
@@ -24,7 +24,7 @@ abstract class MarianumMessageList with _$MarianumMessageList {
} }
@freezed @freezed
abstract class MarianumMessage with _$MarianumMessage { class MarianumMessage with _$MarianumMessage {
const factory MarianumMessage({ const factory MarianumMessage({
required String name, required String name,
required String date, required String date,

View File

@@ -6,38 +6,45 @@ part of 'marianum_message_state.dart';
// JsonSerializableGenerator // JsonSerializableGenerator
// ************************************************************************** // **************************************************************************
_MarianumMessageState _$MarianumMessageStateFromJson( _$MarianumMessageStateImpl _$$MarianumMessageStateImplFromJson(
Map<String, dynamic> json, Map<String, dynamic> json) =>
) => _MarianumMessageState( _$MarianumMessageStateImpl(
messageList: MarianumMessageList.fromJson( messageList: MarianumMessageList.fromJson(
json['messageList'] as Map<String, dynamic>, json['messageList'] as Map<String, dynamic>),
), );
);
Map<String, dynamic> _$MarianumMessageStateToJson( Map<String, dynamic> _$$MarianumMessageStateImplToJson(
_MarianumMessageState instance, _$MarianumMessageStateImpl instance) =>
) => <String, dynamic>{'messageList': instance.messageList}; <String, dynamic>{
'messageList': instance.messageList,
};
_MarianumMessageList _$MarianumMessageListFromJson(Map<String, dynamic> json) => _$MarianumMessageListImpl _$$MarianumMessageListImplFromJson(
_MarianumMessageList( Map<String, dynamic> json) =>
_$MarianumMessageListImpl(
base: json['base'] as String, base: json['base'] as String,
messages: (json['messages'] as List<dynamic>) messages: (json['messages'] as List<dynamic>)
.map((e) => MarianumMessage.fromJson(e as Map<String, dynamic>)) .map((e) => MarianumMessage.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
); );
Map<String, dynamic> _$MarianumMessageListToJson( Map<String, dynamic> _$$MarianumMessageListImplToJson(
_MarianumMessageList instance, _$MarianumMessageListImpl instance) =>
) => <String, dynamic>{'base': instance.base, 'messages': instance.messages}; <String, dynamic>{
'base': instance.base,
'messages': instance.messages,
};
_MarianumMessage _$MarianumMessageFromJson(Map<String, dynamic> json) => _$MarianumMessageImpl _$$MarianumMessageImplFromJson(
_MarianumMessage( Map<String, dynamic> json) =>
_$MarianumMessageImpl(
name: json['name'] as String, name: json['name'] as String,
date: json['date'] as String, date: json['date'] as String,
url: json['url'] as String, url: json['url'] as String,
); );
Map<String, dynamic> _$MarianumMessageToJson(_MarianumMessage instance) => Map<String, dynamic> _$$MarianumMessageImplToJson(
_$MarianumMessageImpl instance) =>
<String, dynamic>{ <String, dynamic>{
'name': instance.name, 'name': instance.name,
'date': instance.date, 'date': instance.date,

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