29 Commits

Author SHA1 Message Date
a52817231e fixed list view breaking layout 2026-02-01 17:16:42 +01:00
f6933b6529 Merge pull request 'develop-polls' (#93) from develop-polls into develop
Reviewed-on: #93
Reviewed-by: Elias Müller <elias@elias-mueller.com>
2026-02-01 14:56:23 +00:00
e4243e53ac resolved pr issues 2026-02-01 15:55:43 +01:00
0aead45191 Merge remote-tracking branch 'origin/develop' into develop-polls
# Conflicts:
#	devtools_options.yaml
2026-02-01 15:37:26 +01:00
dacefd321b updated poll list design 2026-02-01 15:35:40 +01:00
92a9a7358e changed link to directly open the chat 2026-02-01 15:20:01 +01:00
174e6ac0b7 fixed finished polls causing errors, made poll list dense 2026-02-01 15:07:48 +01:00
c9eaed782a update grade averages UI and enable devtools extensions 2026-02-01 15:06:49 +01:00
567184bcf9 filtered system messages for poll votes 2026-02-01 13:56:39 +01:00
541d6ef164 fixed issues with null values in votes map 2026-02-01 13:32:18 +01:00
3469d02033 changed poll dialog to only show results 2026-02-01 03:23:36 +01:00
699aec8ab5 Merge branch 'develop' into develop-polls 2026-02-01 00:06:51 +01:00
7a3a022ecd Merge remote-tracking branch 'origin/develop' into develop 2026-01-31 23:41:05 +01:00
9d8a99df7c added screen_brightness 2026-01-31 23:33:31 +01:00
a47e52e8e7 added screen_brightness 2026-01-31 23:31:53 +01:00
a1fd21de04 Merge pull request 'develop-fileDownload' (#92) from develop-fileDownload into develop
Reviewed-on: #92
Reviewed-by: Elias Müller <elias@elias-mueller.com>
2026-01-31 22:15:50 +00:00
b3d8586c04 Merge remote-tracking branch 'origin/develop' into develop-fileDownload
# Conflicts:
#	pubspec.yaml
2026-01-31 22:59:46 +01:00
0409c5463f combined actions to popup menu 2026-01-31 22:55:49 +01:00
7a3b69fade update dependencies and bump version to 0.1.7+45
- Bump version to `0.1.7+45` and update SDK constraint to `>=3.8.0 <4.0.0`.
- Update numerous dependencies
2026-01-31 22:40:50 +01:00
df275c0108 added file saver 2026-01-31 22:17:31 +01:00
0525453d48 migrate launcher icons configuration to standalone file 2026-01-31 21:09:56 +01:00
4e8b2f34f9 bumped version 2026-01-26 17:13:58 +01:00
bc6a069c90 fixed voice-message preventing chat loading 2026-01-26 16:44:39 +01:00
bfa0b0f5c0 feat: add devtools extensions and fix poll dialog UI/UX
- Enabled `provider` and `shared_preferences` extensions in `devtools_options.yaml`.
- Added logging for message object data on chat bubble tap.
- Fixed layout issues in poll dialog by wrapping `LoadingSpinner` in a `Column` and changing `ListView` to a `Column` in `pollOptionsList.dart`.
- Updated poll submission button to wait for the poll state to load before allowing interaction.
2026-01-18 10:28:17 +01:00
274b77f705 Merge branch 'develop' into develop-polls 2026-01-17 23:22:52 +01:00
Marianum
c7ea80bea9 updated xCode settings 2025-12-10 14:37:36 +01:00
1c787fdc4d feat: Bump version to 0.1.5+43 2025-12-03 17:23:11 +01:00
b68bec9ebd WIP: add option to vote on polls 2025-10-10 11:39:57 +02:00
81f65750b7 added functionality to show own votes in polls 2025-10-10 02:01:43 +02:00
82 changed files with 3919 additions and 2679 deletions

View File

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

View File

@@ -19,7 +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.7.3' apply false id "com.android.application" version "8.9.1" apply false
id "com.android.library" version "8.9.1" apply false
id "org.jetbrains.kotlin.android" version "2.1.10" apply false id "org.jetbrains.kotlin.android" version "2.1.10" apply false
} }

View File

@@ -1 +1,4 @@
extensions: extensions:
- hive_ce: true
- shared_preferences: true
- provider: true

View File

@@ -0,0 +1,9 @@
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

View File

@@ -36,53 +36,53 @@ PODS:
- SwiftyGif - SwiftyGif
- emoji_picker_flutter (0.0.1): - emoji_picker_flutter (0.0.1):
- Flutter - Flutter
- fast_rsa (0.6.0): - 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.2.0): - Firebase/CoreOnly (12.4.0):
- FirebaseCore (~> 12.2.0) - FirebaseCore (~> 12.4.0)
- Firebase/InAppMessaging (12.2.0): - Firebase/InAppMessaging (12.4.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseInAppMessaging (~> 12.2.0-beta) - FirebaseInAppMessaging (~> 12.4.0-beta)
- Firebase/Messaging (12.2.0): - Firebase/Messaging (12.4.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseMessaging (~> 12.2.0) - FirebaseMessaging (~> 12.4.0)
- firebase_core (4.1.0): - firebase_core (4.2.1):
- Firebase/CoreOnly (= 12.2.0) - Firebase/CoreOnly (= 12.4.0)
- Flutter - Flutter
- firebase_in_app_messaging (0.9.0-1): - firebase_in_app_messaging (0.9.0-4):
- Firebase/InAppMessaging (= 12.2.0) - Firebase/InAppMessaging (= 12.4.0)
- firebase_core - firebase_core
- Flutter - Flutter
- firebase_messaging (16.0.1): - firebase_messaging (16.0.4):
- Firebase/Messaging (= 12.2.0) - Firebase/Messaging (= 12.4.0)
- firebase_core - firebase_core
- Flutter - Flutter
- FirebaseABTesting (12.2.0): - FirebaseABTesting (12.4.0):
- FirebaseCore (~> 12.2.0) - FirebaseCore (~> 12.4.0)
- FirebaseCore (12.2.0): - FirebaseCore (12.4.0):
- FirebaseCoreInternal (~> 12.2.0) - FirebaseCoreInternal (~> 12.4.0)
- GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/Logger (~> 8.1) - GoogleUtilities/Logger (~> 8.1)
- FirebaseCoreInternal (12.2.0): - FirebaseCoreInternal (12.4.0):
- "GoogleUtilities/NSData+zlib (~> 8.1)" - "GoogleUtilities/NSData+zlib (~> 8.1)"
- FirebaseInAppMessaging (12.2.0-beta): - FirebaseInAppMessaging (12.4.0-beta):
- FirebaseABTesting (~> 12.2.0) - FirebaseABTesting (~> 12.4.0)
- FirebaseCore (~> 12.2.0) - FirebaseCore (~> 12.4.0)
- FirebaseInstallations (~> 12.2.0) - FirebaseInstallations (~> 12.4.0)
- GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/UserDefaults (~> 8.1) - GoogleUtilities/UserDefaults (~> 8.1)
- nanopb (~> 3.30910.0) - nanopb (~> 3.30910.0)
- FirebaseInstallations (12.2.0): - FirebaseInstallations (12.4.0):
- FirebaseCore (~> 12.2.0) - FirebaseCore (~> 12.4.0)
- GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/UserDefaults (~> 8.1) - GoogleUtilities/UserDefaults (~> 8.1)
- PromisesObjC (~> 2.4) - PromisesObjC (~> 2.4)
- FirebaseMessaging (12.2.0): - FirebaseMessaging (12.4.0):
- FirebaseCore (~> 12.2.0) - FirebaseCore (~> 12.4.0)
- FirebaseInstallations (~> 12.2.0) - FirebaseInstallations (~> 12.4.0)
- GoogleDataTransport (~> 10.1) - GoogleDataTransport (~> 10.1)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1) - GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/Environment (~> 8.1) - GoogleUtilities/Environment (~> 8.1)
@@ -127,9 +127,6 @@ PODS:
- Flutter - Flutter
- in_app_review (2.0.0): - in_app_review (2.0.0):
- Flutter - Flutter
- libphonenumber_plugin (0.0.1):
- Flutter
- PhoneNumberKit
- nanopb (3.30910.0): - nanopb (3.30910.0):
- nanopb/decode (= 3.30910.0) - nanopb/decode (= 3.30910.0)
- nanopb/encode (= 3.30910.0) - nanopb/encode (= 3.30910.0)
@@ -181,7 +178,6 @@ DEPENDENCIES:
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/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`) - 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`) - open_filex (from `.symlinks/plugins/open_filex/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/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`)
@@ -240,8 +236,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_picker_ios/ios" :path: ".symlinks/plugins/image_picker_ios/ios"
in_app_review: in_app_review:
:path: ".symlinks/plugins/in_app_review/ios" :path: ".symlinks/plugins/in_app_review/ios"
libphonenumber_plugin:
:path: ".symlinks/plugins/libphonenumber_plugin/ios"
open_filex: open_filex:
:path: ".symlinks/plugins/open_filex/ios" :path: ".symlinks/plugins/open_filex/ios"
package_info_plus: package_info_plus:
@@ -265,40 +259,39 @@ SPEC CHECKSUMS:
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60 DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
emoji_picker_flutter: ece213fc274bdddefb77d502d33080dc54e616cc emoji_picker_flutter: ece213fc274bdddefb77d502d33080dc54e616cc
fast_rsa: 8cf0f70421610bbe9462db881cdeef1cdd626153 fast_rsa: fb70897d51040b094c780d5f1d7358614738b879
file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be
Firebase: 26f6f8d460603af3df970ad505b16b15f5e2e9a1 Firebase: f07b15ae5a6ec0f93713e30b923d9970d144af3e
firebase_core: 3ff52146406557dddd01d570e807e203ec7e1302 firebase_core: f1aafb21c14f497e5498f7ffc4dc63cbb52b2594
firebase_in_app_messaging: 42894eb8e92aa83ac58f1c534dc9f9f9546f23b9 firebase_in_app_messaging: 04dfc07ab81578ef83bf0c0229be258ddf287c4f
firebase_messaging: 3dcc998dd98e1e54af75d0cccae8606eba43553c firebase_messaging: c17a29984eafce4b2997fe078bb0a9e0b06f5dde
FirebaseABTesting: 32f3fc079d72c9b93e000b60877c4e4f62ef7031 FirebaseABTesting: c05b5ec9f1d9f21a65909525de301d375032d9a4
FirebaseCore: 311c48a147ad4a0ab7febbaed89e8025c67510cd FirebaseCore: bb595f3114953664e3c1dc032f008a244147cfd3
FirebaseCoreInternal: 56ea29f3dad2894f81b060f706f9d53509b6ed3b FirebaseCoreInternal: d7f5a043c2cd01a08103ab586587c1468047bca6
FirebaseInAppMessaging: fecba63d44c5cd8f874e9d661a5aa5047380c7d0 FirebaseInAppMessaging: 606dd4d4d5590a3d8229f363fdebb485235985b2
FirebaseInstallations: 3e884b01feabdf67582a80f3250425a00979b4ed FirebaseInstallations: ae9f4902cb5bf1d0c5eaa31ec1f4e5495a0714e2
FirebaseMessaging: 43ec73bbfedd0c385a849bb91593ab4ad4b9e48e FirebaseMessaging: d33971b7bb252745ea6cd31ab190d1a1df4b8ed5
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_app_badge: ca742dd659a157c1090ef7cd881cb78f48f3bcdf flutter_app_badge: ca742dd659a157c1090ef7cd881cb78f48f3bcdf
flutter_local_notifications: a5a732f069baa862e728d839dd2ebb904737effb flutter_local_notifications: a5a732f069baa862e728d839dd2ebb904737effb
flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf flutter_native_splash: c32d145d68aeda5502d5f543ee38c192065986cf
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7 GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326
in_app_review: 5596fe56fab799e8edb3561c03d053363ab13457 in_app_review: 7dd1ea365263f834b8464673f9df72c80c17c937
libphonenumber_plugin: d134f173b22bfa5ede50887071f087f309277f8c
nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 nanopb: fad817b59e0457d11a5dfbde799381cd727c1275
open_filex: 432f3cd11432da3e39f47fcc0df2b1603854eff1 open_filex: 432f3cd11432da3e39f47fcc0df2b1603854eff1
package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499 package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880
PhoneNumberKit: ced55861269312a5e3bc2ef82a58d6255b1c976a PhoneNumberKit: ced55861269312a5e3bc2ef82a58d6255b1c976a
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
SDWebImage: 9f177d83116802728e122410fb25ad88f5c7608a SDWebImage: 9f177d83116802728e122410fb25ad88f5c7608a
share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a
shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7 shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0 sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
syncfusion_flutter_pdfviewer: 90dc48305d2e33d4aa20681d1e98ddeda891bc14 syncfusion_flutter_pdfviewer: 90dc48305d2e33d4aa20681d1e98ddeda891bc14
url_launcher_ios: 694010445543906933d732453a59da0a173ae33d url_launcher_ios: 7a95fa5b60cc718a708b8f2966718e93db0cef1b
PODFILE CHECKSUM: e21c9d4c7b9623c73c6784ddc132fd50a603ad93 PODFILE CHECKSUM: e21c9d4c7b9623c73c6784ddc132fd50a603ad93

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 */,
@@ -196,7 +196,7 @@
files = ( files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
6483E4432A911EA00063B51E /* GoogleService-Info.plist in Resources */, 33FDB0982EE9ABDC000B2391 /* 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,10 +213,14 @@
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";
@@ -246,10 +250,14 @@
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = (
);
name = "[CP] Copy Pods Resources"; name = "[CP] Copy Pods Resources";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${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-resources.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";

View File

@@ -8,39 +8,42 @@ 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((e) => .map(
GetHolidaysResponseObject.fromJson(e as Map<String, dynamic>)) (e) =>
.toList(), GetHolidaysResponseObject.fromJson(e as Map<String, dynamic>),
)..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,
<String, dynamic>{ ) => <String, dynamic>{
if (instance.headers case final value?) 'headers': value, 'headers': ?instance.headers,
'data': instance.data.map((e) => e.toJson()).toList(), 'data': instance.data.map((e) => e.toJson()).toList(),
}; };
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

@@ -7,40 +7,39 @@ 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((e) => .map(
AutocompleteResponseObject.fromJson(e as Map<String, dynamic>)) (e) => AutocompleteResponseObject.fromJson(e as Map<String, dynamic>),
.toList(), )
); .toList(),
);
Map<String, dynamic> _$AutocompleteResponseToJson( Map<String, dynamic> _$AutocompleteResponseToJson(
AutocompleteResponse instance) => AutocompleteResponse instance,
<String, dynamic>{ ) => <String, dynamic>{'data': instance.data.map((e) => e.toJson()).toList()};
'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 String?,
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,34 +8,35 @@ part of 'getChatParams.dart';
GetChatParams _$GetChatParamsFromJson(Map<String, dynamic> json) => GetChatParams _$GetChatParamsFromJson(Map<String, dynamic> json) =>
GetChatParams( GetChatParams(
lookIntoFuture: lookIntoFuture: $enumDecode(
$enumDecode(_$GetChatParamsSwitchEnumMap, json['lookIntoFuture']), _$GetChatParamsSwitchEnumMap,
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, json['setReadMarker']), _$GetChatParamsSwitchEnumMap,
json['setReadMarker'],
),
includeLastKnown: $enumDecodeNullable( includeLastKnown: $enumDecodeNullable(
_$GetChatParamsSwitchEnumMap, json['includeLastKnown']), _$GetChatParamsSwitchEnumMap,
json['includeLastKnown'],
),
); );
Map<String, dynamic> _$GetChatParamsToJson(GetChatParams instance) => Map<String, dynamic> _$GetChatParamsToJson(
<String, dynamic>{ GetChatParams instance,
'lookIntoFuture': _$GetChatParamsSwitchEnumMap[instance.lookIntoFuture]!, ) => <String, dynamic>{
if (instance.limit case final value?) 'limit': value, 'lookIntoFuture': _$GetChatParamsSwitchEnumMap[instance.lookIntoFuture]!,
if (instance.lastKnownMessageId case final value?) 'limit': ?instance.limit,
'lastKnownMessageId': value, 'lastKnownMessageId': ?instance.lastKnownMessageId,
if (instance.lastCommonReadId case final value?) 'lastCommonReadId': ?instance.lastCommonReadId,
'lastCommonReadId': value, 'timeout': ?instance.timeout,
if (instance.timeout case final value?) 'timeout': value, 'setReadMarker': ?_$GetChatParamsSwitchEnumMap[instance.setReadMarker],
if (_$GetChatParamsSwitchEnumMap[instance.setReadMarker] 'includeLastKnown': ?_$GetChatParamsSwitchEnumMap[instance.includeLastKnown],
case final value?) };
'setReadMarker': value,
if (_$GetChatParamsSwitchEnumMap[instance.includeLastKnown]
case final value?)
'includeLastKnown': value,
};
const _$GetChatParamsSwitchEnumMap = { const _$GetChatParamsSwitchEnumMap = {
GetChatParamsSwitch.on: 1, GetChatParamsSwitch.on: 1,

View File

@@ -8,70 +8,72 @@ 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((e) => GetChatResponseObject.fromJson(e as Map<String, dynamic>)) .map(
.toSet(), (e) => GetChatResponseObject.fromJson(e as Map<String, dynamic>),
)..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>{ <String, dynamic>{
if (instance.headers case final value?) 'headers': value, 'headers': ?instance.headers,
'data': instance.data.map((e) => e.toJson()).toList(), 'data': instance.data.map((e) => e.toJson()).toList(),
}; };
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, json['actorType']), _$GetRoomResponseObjectMessageActorTypeEnumMap,
json['actorId'] as String, json['actorType'],
json['actorDisplayName'] as String, ),
(json['timestamp'] as num).toInt(), json['actorId'] as String,
json['systemMessage'] as String, json['actorDisplayName'] as String,
$enumDecode( (json['timestamp'] as num).toInt(),
_$GetRoomResponseObjectMessageTypeEnumMap, json['messageType']), json['systemMessage'] as String,
json['isReplyable'] as bool, $enumDecode(_$GetRoomResponseObjectMessageTypeEnumMap, json['messageType']),
json['referenceId'] as String, json['isReplyable'] as bool,
json['message'] as String, json['referenceId'] as String,
_fromJson(json['messageParameters']), json['message'] as String,
(json['reactions'] as Map<String, dynamic>?)?.map( _fromJson(json['messageParameters']),
(k, e) => MapEntry(k, (e as num).toInt()), (json['reactions'] as Map<String, dynamic>?)?.map(
), (k, e) => MapEntry(k, (e as num).toInt()),
(json['reactionsSelf'] as List<dynamic>?) ),
?.map((e) => e as String) (json['reactionsSelf'] as List<dynamic>?)?.map((e) => e as String).toList(),
.toList(), json['parent'] == null
json['parent'] == null ? null
? null : GetChatResponseObject.fromJson(json['parent'] as Map<String, dynamic>),
: 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': 'messageParameters': instance.messageParameters?.map(
instance.messageParameters?.map((k, e) => MapEntry(k, e.toJson())), (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',
@@ -83,6 +85,7 @@ 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',

View File

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

View File

@@ -7,66 +7,77 @@ 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((e) => .map(
GetParticipantsResponseObject.fromJson(e as Map<String, dynamic>)) (e) => GetParticipantsResponseObject.fromJson(
.toSet(), e as Map<String, dynamic>,
)..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>{ ) => <String, dynamic>{
if (instance.headers case final value?) 'headers': value, 'headers': ?instance.headers,
'data': instance.data.map((e) => e.toJson()).toList(), 'data': instance.data.map((e) => e.toJson()).toList(),
}; };
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(_$GetParticipantsResponseObjectParticipantTypeEnumMap, $enumDecode(
json['participantType']), _$GetParticipantsResponseObjectParticipantTypeEnumMap,
(json['lastPing'] as num).toInt(), json['participantType'],
$enumDecode(_$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap, ),
json['inCall']), (json['lastPing'] as num).toInt(),
(json['permissions'] as num).toInt(), $enumDecode(
(json['attendeePermissions'] as num).toInt(), _$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap,
json['sessionId'] as String?, json['inCall'],
(json['sessionIds'] as List<dynamic>).map((e) => e as String).toList(), ),
json['status'] as String?, (json['permissions'] as num).toInt(),
json['statusIcon'] as String?, (json['attendeePermissions'] as num).toInt(),
json['statusMessage'] as String?, json['sessionId'] as String?,
json['roomToken'] as String?, (json['sessionIds'] as List<dynamic>).map((e) => e as String).toList(),
); 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': _$GetParticipantsResponseObjectParticipantTypeEnumMap[ 'participantType':
instance.participantType]!, _$GetParticipantsResponseObjectParticipantTypeEnumMap[instance
'lastPing': instance.lastPing, .participantType]!,
'inCall': _$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap[ 'lastPing': instance.lastPing,
instance.inCall]!, 'inCall':
'permissions': instance.permissions, _$GetParticipantsResponseObjectParticipantsInCallFlagsEnumMap[instance
'attendeePermissions': instance.attendeePermissions, .inCall]!,
'sessionId': instance.sessionId, 'permissions': instance.permissions,
'sessionIds': instance.sessionIds, 'attendeePermissions': instance.attendeePermissions,
'status': instance.status, 'sessionId': instance.sessionId,
'statusIcon': instance.statusIcon, 'sessionIds': instance.sessionIds,
'statusMessage': instance.statusMessage, 'status': instance.status,
'roomToken': instance.roomToken, 'statusIcon': instance.statusIcon,
}; 'statusMessage': instance.statusMessage,
'roomToken': instance.roomToken,
};
const _$GetParticipantsResponseObjectParticipantTypeEnumMap = { const _$GetParticipantsResponseObjectParticipantTypeEnumMap = {
GetParticipantsResponseObjectParticipantType.owner: 1, GetParticipantsResponseObjectParticipantType.owner: 1,

View File

@@ -0,0 +1,18 @@
import 'dart:convert';
import 'package:http/http.dart' as http;
import '../talkApi.dart';
import 'getPollStateResponse.dart';
class GetPollState extends TalkApi<GetPollStateResponse> {
String token;
int pollId;
GetPollState({required this.token, required this.pollId}) : super('v1/poll/$token/$pollId', null);
@override
GetPollStateResponse assemble(String raw) => GetPollStateResponse.fromJson(jsonDecode(raw)['ocs']);
@override
Future<http.Response> request(Uri uri, Object? body, Map<String, String>? headers) => http.get(uri, headers: headers);
}

View File

@@ -0,0 +1,50 @@
import 'package:json_annotation/json_annotation.dart';
import '../../../apiResponse.dart';
part 'getPollStateResponse.g.dart';
@JsonSerializable(explicitToJson: true)
class GetPollStateResponse extends ApiResponse {
GetPollStateResponseObject data;
GetPollStateResponse(this.data);
factory GetPollStateResponse.fromJson(Map<String, dynamic> json) => _$GetPollStateResponseFromJson(json);
Map<String, dynamic> toJson() => _$GetPollStateResponseToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetPollStateResponseObject {
int id;
String question;
List<String> options;
dynamic votes;
String actorType;
String actorId;
String actorDisplayName;
int status;
int resultMode;
int maxVotes;
List<int> votedSelf;
int? numVoters;
List<dynamic>? details;
GetPollStateResponseObject(
this.id,
this.question,
this.options,
this.votes,
this.actorType,
this.actorId,
this.actorDisplayName,
this.status,
this.resultMode,
this.maxVotes,
this.votedSelf,
this.numVoters,
this.details);
factory GetPollStateResponseObject.fromJson(Map<String, dynamic> json) => _$GetPollStateResponseObjectFromJson(json);
Map<String, dynamic> toJson() => _$GetPollStateResponseObjectToJson(this);
}

View File

@@ -0,0 +1,62 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'getPollStateResponse.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
GetPollStateResponse _$GetPollStateResponseFromJson(
Map<String, dynamic> json,
) =>
GetPollStateResponse(
GetPollStateResponseObject.fromJson(
json['data'] as Map<String, dynamic>,
),
)
..headers = (json['headers'] as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as String),
);
Map<String, dynamic> _$GetPollStateResponseToJson(
GetPollStateResponse instance,
) => <String, dynamic>{
'headers': ?instance.headers,
'data': instance.data.toJson(),
};
GetPollStateResponseObject _$GetPollStateResponseObjectFromJson(
Map<String, dynamic> json,
) => GetPollStateResponseObject(
(json['id'] as num).toInt(),
json['question'] as String,
(json['options'] as List<dynamic>).map((e) => e as String).toList(),
json['votes'],
json['actorType'] as String,
json['actorId'] as String,
json['actorDisplayName'] as String,
(json['status'] as num).toInt(),
(json['resultMode'] as num).toInt(),
(json['maxVotes'] as num).toInt(),
(json['votedSelf'] as List<dynamic>).map((e) => (e as num).toInt()).toList(),
(json['numVoters'] as num?)?.toInt(),
json['details'] as List<dynamic>?,
);
Map<String, dynamic> _$GetPollStateResponseObjectToJson(
GetPollStateResponseObject instance,
) => <String, dynamic>{
'id': instance.id,
'question': instance.question,
'options': instance.options,
'votes': instance.votes,
'actorType': instance.actorType,
'actorId': instance.actorId,
'actorDisplayName': instance.actorDisplayName,
'status': instance.status,
'resultMode': instance.resultMode,
'maxVotes': instance.maxVotes,
'votedSelf': instance.votedSelf,
'numVoters': instance.numVoters,
'details': instance.details,
};

View File

@@ -7,47 +7,53 @@ 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((e) => GetReactionsResponseObject.fromJson( .map(
e as Map<String, dynamic>)) (e) => GetReactionsResponseObject.fromJson(
.toList()), e as Map<String, dynamic>,
), ),
)..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>{ ) => <String, dynamic>{
if (instance.headers case final value?) 'headers': value, 'headers': ?instance.headers,
'data': instance.data 'data': instance.data.map(
.map((k, e) => MapEntry(k, e.map((e) => e.toJson()).toList())), (k, e) => MapEntry(k, e.map((e) => e.toJson()).toList()),
}; ),
};
GetReactionsResponseObject _$GetReactionsResponseObjectFromJson( GetReactionsResponseObject _$GetReactionsResponseObjectFromJson(
Map<String, dynamic> json) => Map<String, dynamic> json,
GetReactionsResponseObject( ) => GetReactionsResponseObject(
$enumDecode( $enumDecode(_$GetReactionsResponseObjectActorTypeEnumMap, json['actorType']),
_$GetReactionsResponseObjectActorTypeEnumMap, json['actorType']), json['actorId'] as String,
json['actorId'] as String, json['actorDisplayName'] as String,
json['actorDisplayName'] as String, (json['timestamp'] as num).toInt(),
(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,11 +7,7 @@ part of 'reactMessageParams.dart';
// ************************************************************************** // **************************************************************************
ReactMessageParams _$ReactMessageParamsFromJson(Map<String, dynamic> json) => ReactMessageParams _$ReactMessageParamsFromJson(Map<String, dynamic> json) =>
ReactMessageParams( ReactMessageParams(json['reaction'] as String);
json['reaction'] as String,
);
Map<String, dynamic> _$ReactMessageParamsToJson(ReactMessageParams instance) => Map<String, dynamic> _$ReactMessageParamsToJson(ReactMessageParams instance) =>
<String, dynamic>{ <String, dynamic>{'reaction': instance.reaction};
'reaction': instance.reaction,
};

View File

@@ -9,18 +9,20 @@ part of 'getRoomParams.dart';
GetRoomParams _$GetRoomParamsFromJson(Map<String, dynamic> json) => GetRoomParams _$GetRoomParamsFromJson(Map<String, dynamic> json) =>
GetRoomParams( GetRoomParams(
noStatusUpdate: $enumDecodeNullable( noStatusUpdate: $enumDecodeNullable(
_$GetRoomParamsStatusUpdateEnumMap, json['noStatusUpdate']), _$GetRoomParamsStatusUpdateEnumMap,
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(GetRoomParams instance) => Map<String, dynamic> _$GetRoomParamsToJson(
<String, dynamic>{ GetRoomParams instance,
'noStatusUpdate': ) => <String, dynamic>{
_$GetRoomParamsStatusUpdateEnumMap[instance.noStatusUpdate], '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

@@ -162,6 +162,7 @@ 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,93 +8,97 @@ 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((e) => GetRoomResponseObject.fromJson(e as Map<String, dynamic>)) .map(
.toSet(), (e) => GetRoomResponseObject.fromJson(e as Map<String, dynamic>),
)..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>{ <String, dynamic>{
if (instance.headers case final value?) 'headers': value, 'headers': ?instance.headers,
'data': instance.data.map((e) => e.toJson()).toList(), 'data': instance.data.map((e) => e.toJson()).toList(),
}; };
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(_$GetRoomResponseObjectParticipantNotificationLevelEnumMap, $enumDecode(
json['notificationLevel']), _$GetRoomResponseObjectParticipantNotificationLevelEnumMap,
(json['unreadMessages'] as num).toInt(), json['notificationLevel'],
json['unreadMention'] as bool, ),
json['unreadMentionDirect'] as bool, (json['unreadMessages'] as num).toInt(),
(json['lastReadMessage'] as num).toInt(), json['unreadMention'] as bool,
(json['lastCommonReadMessage'] as num).toInt(), json['unreadMentionDirect'] as bool,
GetChatResponseObject.fromJson( (json['lastReadMessage'] as num).toInt(),
json['lastMessage'] as Map<String, dynamic>), (json['lastCommonReadMessage'] as num).toInt(),
json['status'] as String?, GetChatResponseObject.fromJson(json['lastMessage'] as Map<String, dynamic>),
json['statusIcon'] as String?, json['status'] as String?,
json['statusMessage'] as String?, json['statusIcon'] as String?,
)..sort = json['sort'] as String?; json['statusMessage'] 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[ _$GetRoomResponseObjectParticipantNotificationLevelEnumMap[instance
instance.notificationLevel]!, .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,

View File

@@ -15,5 +15,5 @@ SendMessageParams _$SendMessageParamsFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> _$SendMessageParamsToJson(SendMessageParams instance) => Map<String, dynamic> _$SendMessageParamsToJson(SendMessageParams instance) =>
<String, dynamic>{ <String, dynamic>{
'message': instance.message, 'message': instance.message,
if (instance.replyTo case final value?) 'replyTo': value, 'replyTo': ?instance.replyTo,
}; };

View File

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

View File

@@ -0,0 +1,26 @@
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:http/http.dart';
import '../getPoll/getPollStateResponse.dart';
import '../talkApi.dart';
import 'votePollParams.dart';
@Deprecated('VotePoll is broken')
class VotePoll extends TalkApi {
String token;
int pollId;
VotePoll({required this.token, required this.pollId, required VotePollParams params}) : super('v1/poll/$token/$pollId', params);
@override
GetPollStateResponse assemble(String raw) => GetPollStateResponse.fromJson(jsonDecode(raw)['ocs']);
@override
Future<Response>? request(Uri uri, Object? body, Map<String, String>? headers) {
if(body is VotePollParams) {
return http.post(uri, headers: headers, body: body.toJson().toString());
}
return null;
}
}

View File

@@ -0,0 +1,15 @@
import 'package:json_annotation/json_annotation.dart';
import '../../../apiParams.dart';
part 'votePollParams.g.dart';
@JsonSerializable()
@Deprecated('VotePoll is broken')
class VotePollParams extends ApiParams {
List<int> optionIds;
VotePollParams({required this.optionIds});
factory VotePollParams.fromJson(Map<String, dynamic> json) => _$VotePollParamsFromJson(json);
Map<String, dynamic> toJson() => _$VotePollParamsToJson(this);
}

View File

@@ -0,0 +1,17 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'votePollParams.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
VotePollParams _$VotePollParamsFromJson(Map<String, dynamic> json) =>
VotePollParams(
optionIds: (json['optionIds'] as List<dynamic>)
.map((e) => (e as num).toInt())
.toList(),
);
Map<String, dynamic> _$VotePollParamsToJson(VotePollParams instance) =>
<String, dynamic>{'optionIds': instance.optionIds};

View File

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

View File

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

View File

@@ -8,15 +8,16 @@ 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>{ <String, dynamic>{
if (instance.headers case final value?) 'headers': value, 'headers': ?instance.headers,
'files': instance.files.map((e) => e.toJson()).toList(), 'files': instance.files.map((e) => e.toJson()).toList(),
}; };

View File

@@ -8,38 +8,43 @@ part of 'getBreakersResponse.dart';
GetBreakersResponse _$GetBreakersResponseFromJson(Map<String, dynamic> json) => GetBreakersResponse _$GetBreakersResponseFromJson(Map<String, dynamic> json) =>
GetBreakersResponse( GetBreakersResponse(
GetBreakersReponseObject.fromJson(json['global'] as Map<String, dynamic>), GetBreakersReponseObject.fromJson(
(json['regional'] as Map<String, dynamic>).map( json['global'] as Map<String, dynamic>,
(k, e) => MapEntry( ),
k, GetBreakersReponseObject.fromJson(e as Map<String, dynamic>)), (json['regional'] as Map<String, dynamic>).map(
), (k, e) => MapEntry(
)..headers = (json['headers'] as Map<String, dynamic>?)?.map( k,
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,
<String, dynamic>{ ) => <String, dynamic>{
if (instance.headers case final value?) 'headers': value, 'headers': ?instance.headers,
'global': instance.global.toJson(), 'global': instance.global.toJson(),
'regional': instance.regional.map((k, e) => MapEntry(k, e.toJson())), 'regional': instance.regional.map((k, e) => MapEntry(k, e.toJson())),
}; };
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,15 +7,12 @@ 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>{ ) => <String, dynamic>{'user': instance.user, 'event': instance.event.toJson()};
'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,13 +7,9 @@ part of 'getCustomTimetableEventParams.dart';
// ************************************************************************** // **************************************************************************
GetCustomTimetableEventParams _$GetCustomTimetableEventParamsFromJson( GetCustomTimetableEventParams _$GetCustomTimetableEventParamsFromJson(
Map<String, dynamic> json) => Map<String, dynamic> json,
GetCustomTimetableEventParams( ) => GetCustomTimetableEventParams(json['user'] as String);
json['user'] as String,
);
Map<String, dynamic> _$GetCustomTimetableEventParamsToJson( Map<String, dynamic> _$GetCustomTimetableEventParamsToJson(
GetCustomTimetableEventParams instance) => GetCustomTimetableEventParams instance,
<String, dynamic>{ ) => <String, dynamic>{'user': instance.user};
'user': instance.user,
};

View File

@@ -7,18 +7,19 @@ 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((e) => CustomTimetableEvent.fromJson(e as Map<String, dynamic>)) .map(
.toList(), (e) => CustomTimetableEvent.fromJson(e as Map<String, dynamic>),
)..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>{ ) => <String, dynamic>{'headers': ?instance.headers, 'events': instance.events};
if (instance.headers case final value?) 'headers': value,
'events': instance.events,
};

View File

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

View File

@@ -7,15 +7,12 @@ 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>{ ) => <String, dynamic>{'id': instance.id, 'event': instance.event.toJson()};
'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

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

View File

@@ -7,22 +7,24 @@ 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>{ ) => <String, dynamic>{
if (instance.headers case final value?) 'headers': value, 'headers': ?instance.headers,
'sessionId': instance.sessionId, 'sessionId': instance.sessionId,
'personType': instance.personType, 'personType': instance.personType,
'personId': instance.personId, 'personId': instance.personId,
'klasseId': instance.klasseId, 'klasseId': instance.klasseId,
}; };

View File

@@ -8,37 +8,40 @@ 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((e) => .map(
GetHolidaysResponseObject.fromJson(e as Map<String, dynamic>)) (e) =>
.toSet(), GetHolidaysResponseObject.fromJson(e as Map<String, dynamic>),
)..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,
<String, dynamic>{ ) => <String, dynamic>{
if (instance.headers case final value?) 'headers': value, 'headers': ?instance.headers,
'result': instance.result.map((e) => e.toJson()).toList(), 'result': instance.result.map((e) => e.toJson()).toList(),
}; };
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,36 +8,38 @@ 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(), )
)..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> _$GetRoomsResponseToJson(GetRoomsResponse instance) => Map<String, dynamic> _$GetRoomsResponseToJson(GetRoomsResponse instance) =>
<String, dynamic>{ <String, dynamic>{
if (instance.headers case final value?) 'headers': value, 'headers': ?instance.headers,
'result': instance.result.map((e) => e.toJson()).toList(), 'result': instance.result.map((e) => e.toJson()).toList(),
}; };
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,37 +8,40 @@ 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((e) => .map(
GetSubjectsResponseObject.fromJson(e as Map<String, dynamic>)) (e) =>
.toSet(), GetSubjectsResponseObject.fromJson(e as Map<String, dynamic>),
)..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,
<String, dynamic>{ ) => <String, dynamic>{
if (instance.headers case final value?) 'headers': value, 'headers': ?instance.headers,
'result': instance.result.map((e) => e.toJson()).toList(), 'result': instance.result.map((e) => e.toJson()).toList(),
}; };
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,78 +9,68 @@ 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>{ <String, dynamic>{'options': instance.options.toJson()};
'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(), ),
endDate: (json['endDate'] as num?)?.toInt(), startDate: (json['startDate'] as num?)?.toInt(),
onlyBaseTimetable: json['onlyBaseTimetable'] as bool?, endDate: (json['endDate'] as num?)?.toInt(),
showBooking: json['showBooking'] as bool?, onlyBaseTimetable: json['onlyBaseTimetable'] as bool?,
showInfo: json['showInfo'] as bool?, showBooking: json['showBooking'] as bool?,
showSubstText: json['showSubstText'] as bool?, showInfo: json['showInfo'] as bool?,
showLsText: json['showLsText'] as bool?, showSubstText: json['showSubstText'] as bool?,
showLsNumber: json['showLsNumber'] as bool?, showLsText: json['showLsText'] as bool?,
showStudentgroup: json['showStudentgroup'] as bool?, showLsNumber: json['showLsNumber'] as bool?,
klasseFields: (json['klasseFields'] as List<dynamic>?) showStudentgroup: json['showStudentgroup'] as bool?,
?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e)) klasseFields: (json['klasseFields'] as List<dynamic>?)
.toList(), ?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e))
roomFields: (json['roomFields'] as List<dynamic>?) .toList(),
?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e)) roomFields: (json['roomFields'] as List<dynamic>?)
.toList(), ?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e))
subjectFields: (json['subjectFields'] as List<dynamic>?) .toList(),
?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e)) subjectFields: (json['subjectFields'] as List<dynamic>?)
.toList(), ?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e))
teacherFields: (json['teacherFields'] as List<dynamic>?) .toList(),
?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e)) teacherFields: (json['teacherFields'] as List<dynamic>?)
.toList(), ?.map((e) => $enumDecode(_$GetTimetableParamsOptionsFieldsEnumMap, e))
); .toList(),
);
Map<String, dynamic> _$GetTimetableParamsOptionsToJson( Map<String, dynamic> _$GetTimetableParamsOptionsToJson(
GetTimetableParamsOptions instance) => GetTimetableParamsOptions instance,
<String, dynamic>{ ) => <String, dynamic>{
'element': instance.element.toJson(), 'element': instance.element.toJson(),
if (instance.startDate case final value?) 'startDate': value, 'startDate': ?instance.startDate,
if (instance.endDate case final value?) 'endDate': value, 'endDate': ?instance.endDate,
if (instance.onlyBaseTimetable case final value?) 'onlyBaseTimetable': ?instance.onlyBaseTimetable,
'onlyBaseTimetable': value, 'showBooking': ?instance.showBooking,
if (instance.showBooking case final value?) 'showBooking': value, 'showInfo': ?instance.showInfo,
if (instance.showInfo case final value?) 'showInfo': value, 'showSubstText': ?instance.showSubstText,
if (instance.showSubstText case final value?) 'showSubstText': value, 'showLsText': ?instance.showLsText,
if (instance.showLsText case final value?) 'showLsText': value, 'showLsNumber': ?instance.showLsNumber,
if (instance.showLsNumber case final value?) 'showLsNumber': value, 'showStudentgroup': ?instance.showStudentgroup,
if (instance.showStudentgroup case final value?) 'klasseFields': ?instance.klasseFields
'showStudentgroup': value, ?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
if (instance.klasseFields .toList(),
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!) 'roomFields': ?instance.roomFields
.toList() ?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
case final value?) .toList(),
'klasseFields': value, 'subjectFields': ?instance.subjectFields
if (instance.roomFields ?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!) .toList(),
.toList() 'teacherFields': ?instance.teacherFields
case final value?) ?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
'roomFields': value, .toList(),
if (instance.subjectFields };
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
.toList()
case final value?)
'subjectFields': value,
if (instance.teacherFields
?.map((e) => _$GetTimetableParamsOptionsFieldsEnumMap[e]!)
.toList()
case final value?)
'teacherFields': value,
};
const _$GetTimetableParamsOptionsFieldsEnumMap = { const _$GetTimetableParamsOptionsFieldsEnumMap = {
GetTimetableParamsOptionsFields.id: 'id', GetTimetableParamsOptionsFields.id: 'id',
@@ -90,23 +80,24 @@ 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, json['keyType']), _$GetTimetableParamsOptionsElementKeyTypeEnumMap,
); json['keyType'],
),
);
Map<String, dynamic> _$GetTimetableParamsOptionsElementToJson( Map<String, dynamic> _$GetTimetableParamsOptionsElementToJson(
GetTimetableParamsOptionsElement instance) => GetTimetableParamsOptionsElement instance,
<String, dynamic>{ ) => <String, dynamic>{
'id': instance.id, 'id': instance.id,
'type': instance.type, 'type': instance.type,
if (_$GetTimetableParamsOptionsElementKeyTypeEnumMap[instance.keyType] 'keyType':
case final value?) ?_$GetTimetableParamsOptionsElementKeyTypeEnumMap[instance.keyType],
'keyType': value, };
};
const _$GetTimetableParamsOptionsElementKeyTypeEnumMap = { const _$GetTimetableParamsOptionsElementKeyTypeEnumMap = {
GetTimetableParamsOptionsElementKeyType.id: 'id', GetTimetableParamsOptionsElementKeyType.id: 'id',

View File

@@ -7,184 +7,199 @@ 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((e) => .map(
GetTimetableResponseObject.fromJson(e as Map<String, dynamic>)) (e) => GetTimetableResponseObject.fromJson(
.toSet(), e as Map<String, dynamic>,
)..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>{ ) => <String, dynamic>{
if (instance.headers case final value?) 'headers': value, 'headers': ?instance.headers,
'result': instance.result.map((e) => e.toJson()).toList(), 'result': instance.result.map((e) => e.toJson()).toList(),
}; };
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((e) => GetTimetableResponseObjectClass.fromJson( .map(
e as Map<String, dynamic>)) (e) =>
.toList(), GetTimetableResponseObjectClass.fromJson(e as Map<String, dynamic>),
te: (json['te'] as List<dynamic>) )
.map((e) => GetTimetableResponseObjectTeacher.fromJson( .toList(),
e as Map<String, dynamic>)) te: (json['te'] as List<dynamic>)
.toList(), .map(
su: (json['su'] as List<dynamic>) (e) => GetTimetableResponseObjectTeacher.fromJson(
.map((e) => GetTimetableResponseObjectSubject.fromJson( e as Map<String, dynamic>,
e as Map<String, dynamic>)) ),
.toList(), )
ro: (json['ro'] as List<dynamic>) .toList(),
.map((e) => GetTimetableResponseObjectRoom.fromJson( su: (json['su'] as List<dynamic>)
e as Map<String, dynamic>)) .map(
.toList(), (e) => GetTimetableResponseObjectSubject.fromJson(
)..bkText = json['bkText'] as String?; e as Map<String, dynamic>,
),
)
.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((e) => GetTimetableResponseObjectFieldsObject.fromJson( ?.map(
e as Map<String, dynamic>)) (e) => GetTimetableResponseObjectFieldsObject.fromJson(
.toList(), e as Map<String, dynamic>,
); ),
)
.toList(),
);
Map<String, dynamic> _$GetTimetableResponseObjectFieldsToJson( Map<String, dynamic> _$GetTimetableResponseObjectFieldsToJson(
GetTimetableResponseObjectFields instance) => GetTimetableResponseObjectFields instance,
<String, dynamic>{ ) => <String, dynamic>{'te': instance.te?.map((e) => e.toJson()).toList()};
'te': instance.te?.map((e) => e.toJson()).toList(),
};
GetTimetableResponseObjectFieldsObject GetTimetableResponseObjectFieldsObject
_$GetTimetableResponseObjectFieldsObjectFromJson( _$GetTimetableResponseObjectFieldsObjectFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> json) => GetTimetableResponseObjectFieldsObject(
GetTimetableResponseObjectFieldsObject( id: (json['id'] as num?)?.toInt(),
id: (json['id'] as num?)?.toInt(), name: json['name'] as String?,
name: json['name'] as String?, longname: json['longname'] as String?,
longname: json['longname'] as String?, externalkey: json['externalkey'] 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

@@ -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
class LoadableStateState with _$LoadableStateState { abstract 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 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// 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,150 +9,271 @@ 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;
/// Create a copy of LoadableStateState List<ConnectivityResult>? get connections;
/// with the given fields replaced by the non-null parameter values. /// Create a copy of LoadableStateState
@JsonKey(includeFromJson: false, includeToJson: false) /// with the given fields replaced by the non-null parameter values.
$LoadableStateStateCopyWith<LoadableStateState> get copyWith => @JsonKey(includeFromJson: false, includeToJson: false)
throw _privateConstructorUsedError; @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 class $LoadableStateStateCopyWith<$Res> { abstract mixin class $LoadableStateStateCopyWith<$Res> {
factory $LoadableStateStateCopyWith( factory $LoadableStateStateCopyWith(LoadableStateState value, $Res Function(LoadableStateState) _then) = _$LoadableStateStateCopyWithImpl;
LoadableStateState value, $Res Function(LoadableStateState) then) = @useResult
_$LoadableStateStateCopyWithImpl<$Res, LoadableStateState>; $Res call({
@useResult List<ConnectivityResult>? connections
$Res call({List<ConnectivityResult>? connections}); });
}
}
/// @nodoc /// @nodoc
class _$LoadableStateStateCopyWithImpl<$Res, $Val extends LoadableStateState> class _$LoadableStateStateCopyWithImpl<$Res>
implements $LoadableStateStateCopyWith<$Res> { implements $LoadableStateStateCopyWith<$Res> {
_$LoadableStateStateCopyWithImpl(this._value, this._then); _$LoadableStateStateCopyWithImpl(this._self, this._then);
// ignore: unused_field final LoadableStateState _self;
final $Val _value; final $Res Function(LoadableStateState) _then;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of LoadableStateState /// Create a copy of LoadableStateState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline') @override $Res call({Object? connections = freezed,}) {
@override return _then(_self.copyWith(
$Res call({ connections: freezed == connections ? _self.connections : connections // ignore: cast_nullable_to_non_nullable
Object? connections = freezed, 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);
/// Create a copy of LoadableStateState /// Adds pattern-matching-related methods to [LoadableStateState].
/// with the given fields replaced by the non-null parameter values. extension LoadableStateStatePatterns on LoadableStateState {
@pragma('vm:prefer-inline') /// A variant of `map` that fallback to returning `orElse`.
@override ///
$Res call({ /// It is equivalent to doing:
Object? connections = freezed, /// ```dart
}) { /// switch (sealedClass) {
return _then(_$LoadableStateStateImpl( /// case final Subclass value:
connections: freezed == connections /// return ...;
? _value._connections /// case _:
: connections // ignore: cast_nullable_to_non_nullable /// return orElse();
as List<ConnectivityResult>?, /// }
)); /// ```
}
@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;
final List<ConnectivityResult>? _connections; class _LoadableStateState implements LoadableStateState {
@override const _LoadableStateState({required final List<ConnectivityResult>? connections}): _connections = connections;
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);
}
@override final List<ConnectivityResult>? _connections;
String toString() { @override List<ConnectivityResult>? get connections {
return 'LoadableStateState(connections: $connections)'; final value = _connections;
} if (value == null) return null;
if (_connections is EqualUnmodifiableListView) return _connections;
@override // ignore: implicit_dynamic_type
bool operator ==(Object other) { return EqualUnmodifiableListView(value);
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));
/// Create a copy of LoadableStateState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@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;
@override /// Create a copy of LoadableStateState
List<ConnectivityResult>? get connections; /// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$LoadableStateStateCopyWith<_LoadableStateState> get copyWith => __$LoadableStateStateCopyWithImpl<_LoadableStateState>(this, _$identity);
/// Create a copy of LoadableStateState
/// with the given fields replaced by the non-null parameter values.
@override @override
@JsonKey(includeFromJson: false, includeToJson: false) bool operator ==(Object other) {
_$$LoadableStateStateImplCopyWith<_$LoadableStateStateImpl> get copyWith => return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadableStateState&&const DeepCollectionEquality().equals(other._connections, _connections));
throw _privateConstructorUsedError;
} }
@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
class LoadableState<TState> with _$LoadableState { abstract class LoadableState<TState> with _$LoadableState<TState> {
const LoadableState._(); const LoadableState._();
const factory LoadableState({ const factory LoadableState({
@@ -14,7 +14,7 @@ class LoadableState<TState> with _$LoadableState {
required int? lastFetch, required int? lastFetch,
required void Function()? reFetch, required void Function()? reFetch,
required LoadingError? error, required LoadingError? error,
}) = _LoadableState; }) = _LoadableState<TState>;
bool _hasError() => error != null; bool _hasError() => error != null;
bool _hasData() => data != null; bool _hasData() => data != null;

View File

@@ -1,5 +1,5 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// 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,246 +9,299 @@ 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;
/// Create a copy of LoadableState bool get isLoading; TState? get data; int? get lastFetch; void Function()? get reFetch; LoadingError? get error;
/// with the given fields replaced by the non-null parameter values. /// Create a copy of LoadableState
@JsonKey(includeFromJson: false, includeToJson: false) /// with the given fields replaced by the non-null parameter values.
$LoadableStateCopyWith<TState, LoadableState<TState>> get copyWith => @JsonKey(includeFromJson: false, includeToJson: false)
throw _privateConstructorUsedError; @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 class $LoadableStateCopyWith<TState, $Res> { abstract mixin class $LoadableStateCopyWith<TState,$Res> {
factory $LoadableStateCopyWith(LoadableState<TState> value, factory $LoadableStateCopyWith(LoadableState<TState> value, $Res Function(LoadableState<TState>) _then) = _$LoadableStateCopyWithImpl;
$Res Function(LoadableState<TState>) then) = @useResult
_$LoadableStateCopyWithImpl<TState, $Res, LoadableState<TState>>; $Res call({
@useResult bool isLoading, TState? data, int? lastFetch, void Function()? reFetch, LoadingError? error
$Res call( });
{bool isLoading,
TState? data,
int? lastFetch, $LoadingErrorCopyWith<$Res>? get error;
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._value, this._then); _$LoadableStateCopyWithImpl(this._self, this._then);
// ignore: unused_field final LoadableState<TState> _self;
final $Val _value; final $Res Function(LoadableState<TState>) _then;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of LoadableState /// Create a copy of LoadableState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline') @override $Res call({Object? isLoading = null,Object? data = freezed,Object? lastFetch = freezed,Object? reFetch = freezed,Object? error = freezed,}) {
@override return _then(_self.copyWith(
$Res call({ isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
Object? isLoading = null, as bool,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
Object? data = freezed, as TState?,lastFetch: freezed == lastFetch ? _self.lastFetch : lastFetch // ignore: cast_nullable_to_non_nullable
Object? lastFetch = freezed, as int?,reFetch: freezed == reFetch ? _self.reFetch : reFetch // ignore: cast_nullable_to_non_nullable
Object? reFetch = freezed, as void Function()?,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
Object? error = freezed, as LoadingError?,
}) { ));
return _then(_value.copyWith( }
isLoading: null == isLoading /// Create a copy of LoadableState
? _value.isLoading /// with the given fields replaced by the non-null parameter values.
: isLoading // ignore: cast_nullable_to_non_nullable @override
as bool, @pragma('vm:prefer-inline')
data: freezed == data $LoadingErrorCopyWith<$Res>? get error {
? _value.data if (_self.error == null) {
: data // ignore: cast_nullable_to_non_nullable return null;
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?,
) as $Val);
} }
/// Create a copy of LoadableState return $LoadingErrorCopyWith<$Res>(_self.error!, (value) {
/// with the given fields replaced by the non-null parameter values. return _then(_self.copyWith(error: value));
@override });
@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});
@override /// Adds pattern-matching-related methods to [LoadableState].
$LoadingErrorCopyWith<$Res>? get error; extension LoadableStatePatterns<TState> on LoadableState<TState> {
/// 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);
/// Create a copy of LoadableState
/// with the given fields replaced by the non-null parameter values.
@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._();
@override class _LoadableState<TState> extends LoadableState<TState> {
final bool isLoading; const _LoadableState({required this.isLoading, required this.data, required this.lastFetch, required this.reFetch, required this.error}): super._();
@override
final TState? data;
@override
final int? lastFetch;
@override
final void Function()? reFetch;
@override
final LoadingError? error;
@override @override final bool isLoading;
String toString() { @override final TState? data;
return 'LoadableState<$TState>(isLoading: $isLoading, data: $data, lastFetch: $lastFetch, reFetch: $reFetch, error: $error)'; @override final int? lastFetch;
} @override final void Function()? reFetch;
@override final LoadingError? error;
@override /// Create a copy of LoadableState
bool operator ==(Object other) { /// with the given fields replaced by the non-null parameter values.
return identical(this, other) || @override @JsonKey(includeFromJson: false, includeToJson: false)
(other.runtimeType == runtimeType && @pragma('vm:prefer-inline')
other is _$LoadableStateImpl<TState> && _$LoadableStateCopyWith<TState, _LoadableState<TState>> get copyWith => __$LoadableStateCopyWithImpl<TState, _LoadableState<TState>>(this, _$identity);
(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);
/// Create a copy of LoadableState
/// with the given fields replaced by the non-null parameter values. @override
@JsonKey(includeFromJson: false, includeToJson: false) bool operator ==(Object other) {
@override 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));
@pragma('vm:prefer-inline')
_$$LoadableStateImplCopyWith<TState, _$LoadableStateImpl<TState>>
get copyWith => __$$LoadableStateImplCopyWithImpl<TState,
_$LoadableStateImpl<TState>>(this, _$identity);
} }
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 @override
bool get isLoading; int get hashCode => Object.hash(runtimeType,isLoading,const DeepCollectionEquality().hash(data),lastFetch,reFetch,error);
@override
TState? get data;
@override
int? get lastFetch;
@override
void Function()? get reFetch;
@override
LoadingError? get error;
/// Create a copy of LoadableState @override
/// with the given fields replaced by the non-null parameter values. String toString() {
@override return 'LoadableState<$TState>(isLoading: $isLoading, data: $data, lastFetch: $lastFetch, reFetch: $reFetch, error: $error)';
@JsonKey(includeFromJson: false, includeToJson: false)
_$$LoadableStateImplCopyWith<TState, _$LoadableStateImpl<TState>>
get copyWith => throw _privateConstructorUsedError;
} }
}
/// @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) {
return _then(_self.copyWith(error: value));
});
}
}
// dart format on

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
class LoadingError with _$LoadingError { abstract 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 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// 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,155 +9,266 @@ 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;
/// Create a copy of LoadingError String get message; bool get allowRetry;
/// with the given fields replaced by the non-null parameter values. /// Create a copy of LoadingError
@JsonKey(includeFromJson: false, includeToJson: false) /// with the given fields replaced by the non-null parameter values.
$LoadingErrorCopyWith<LoadingError> get copyWith => @JsonKey(includeFromJson: false, includeToJson: false)
throw _privateConstructorUsedError; @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 class $LoadingErrorCopyWith<$Res> { abstract mixin class $LoadingErrorCopyWith<$Res> {
factory $LoadingErrorCopyWith( factory $LoadingErrorCopyWith(LoadingError value, $Res Function(LoadingError) _then) = _$LoadingErrorCopyWithImpl;
LoadingError value, $Res Function(LoadingError) then) = @useResult
_$LoadingErrorCopyWithImpl<$Res, LoadingError>; $Res call({
@useResult String message, bool allowRetry
$Res call({String message, bool allowRetry}); });
}
}
/// @nodoc /// @nodoc
class _$LoadingErrorCopyWithImpl<$Res, $Val extends LoadingError> class _$LoadingErrorCopyWithImpl<$Res>
implements $LoadingErrorCopyWith<$Res> { implements $LoadingErrorCopyWith<$Res> {
_$LoadingErrorCopyWithImpl(this._value, this._then); _$LoadingErrorCopyWithImpl(this._self, this._then);
// ignore: unused_field final LoadingError _self;
final $Val _value; final $Res Function(LoadingError) _then;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of LoadingError /// Create a copy of LoadingError
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline') @override $Res call({Object? message = null,Object? allowRetry = null,}) {
@override return _then(_self.copyWith(
$Res call({ message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
Object? message = null, as String,allowRetry: null == allowRetry ? _self.allowRetry : allowRetry // ignore: cast_nullable_to_non_nullable
Object? allowRetry = null, 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);
/// Create a copy of LoadingError /// Adds pattern-matching-related methods to [LoadingError].
/// with the given fields replaced by the non-null parameter values. extension LoadingErrorPatterns on LoadingError {
@pragma('vm:prefer-inline') /// A variant of `map` that fallback to returning `orElse`.
@override ///
$Res call({ /// It is equivalent to doing:
Object? message = null, /// ```dart
Object? allowRetry = null, /// switch (sealedClass) {
}) { /// case final Subclass value:
return _then(_$LoadingErrorImpl( /// return ...;
message: null == message /// case _:
? _value.message /// return orElse();
: message // ignore: cast_nullable_to_non_nullable /// }
as String, /// ```
allowRetry: null == allowRetry
? _value.allowRetry @optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LoadingError value)? $default,{required TResult orElse(),}){
: allowRetry // ignore: cast_nullable_to_non_nullable final _that = this;
as bool, 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});
@override class _LoadingError implements LoadingError {
final String message; const _LoadingError({required this.message, this.allowRetry = false});
@override
@JsonKey()
final bool allowRetry;
@override @override final String message;
String toString() { @override@JsonKey() final bool allowRetry;
return 'LoadingError(message: $message, allowRetry: $allowRetry)';
}
@override /// Create a copy of LoadingError
bool operator ==(Object other) { /// with the given fields replaced by the non-null parameter values.
return identical(this, other) || @override @JsonKey(includeFromJson: false, includeToJson: false)
(other.runtimeType == runtimeType && @pragma('vm:prefer-inline')
other is _$LoadingErrorImpl && _$LoadingErrorCopyWith<_LoadingError> get copyWith => __$LoadingErrorCopyWithImpl<_LoadingError>(this, _$identity);
(identical(other.message, message) || other.message == message) &&
(identical(other.allowRetry, allowRetry) ||
other.allowRetry == allowRetry));
}
@override
int get hashCode => Object.hash(runtimeType, message, allowRetry);
/// Create a copy of LoadingError
/// with the given fields replaced by the non-null parameter values. @override
@JsonKey(includeFromJson: false, includeToJson: false) bool operator ==(Object other) {
@override return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadingError&&(identical(other.message, message) || other.message == message)&&(identical(other.allowRetry, allowRetry) || other.allowRetry == allowRetry));
@pragma('vm:prefer-inline')
_$$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
String get message; int get hashCode => Object.hash(runtimeType,message,allowRetry);
@override
bool get allowRetry;
/// Create a copy of LoadingError @override
/// with the given fields replaced by the non-null parameter values. String toString() {
@override return 'LoadingError(message: $message, allowRetry: $allowRetry)';
@JsonKey(includeFromJson: false, includeToJson: false)
_$$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

@@ -26,7 +26,7 @@ class LoadableStateConsumer<TController extends Bloc<LoadableHydratedBlocEvent<T
var loadableState = context.watch<TController>().state; var loadableState = 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 +48,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

@@ -103,7 +103,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!);
} catch(e) { } catch(e) {
log('Failed to save state ${TState.toString()}: ${e.toString()}'); log('Failed to save state ${TState.toString()}: ${e.toString()}');
} }

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
class LoadableSaveContext with _$LoadableSaveContext { abstract 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 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// 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,160 +9,269 @@ 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;
/// Create a copy of LoadableSaveContext
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$LoadableSaveContextCopyWith<LoadableSaveContext> get copyWith => _$LoadableSaveContextCopyWithImpl<LoadableSaveContext>(this as LoadableSaveContext, _$identity);
/// Serializes this LoadableSaveContext to a JSON map. /// Serializes this LoadableSaveContext to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError; 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)';
}
/// Create a copy of LoadableSaveContext
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$LoadableSaveContextCopyWith<LoadableSaveContext> get copyWith =>
throw _privateConstructorUsedError;
} }
/// @nodoc /// @nodoc
abstract class $LoadableSaveContextCopyWith<$Res> { abstract mixin class $LoadableSaveContextCopyWith<$Res> {
factory $LoadableSaveContextCopyWith( factory $LoadableSaveContextCopyWith(LoadableSaveContext value, $Res Function(LoadableSaveContext) _then) = _$LoadableSaveContextCopyWithImpl;
LoadableSaveContext value, $Res Function(LoadableSaveContext) then) = @useResult
_$LoadableSaveContextCopyWithImpl<$Res, LoadableSaveContext>; $Res call({
@useResult int timestamp
$Res call({int timestamp}); });
}
}
/// @nodoc /// @nodoc
class _$LoadableSaveContextCopyWithImpl<$Res, $Val extends LoadableSaveContext> class _$LoadableSaveContextCopyWithImpl<$Res>
implements $LoadableSaveContextCopyWith<$Res> { implements $LoadableSaveContextCopyWith<$Res> {
_$LoadableSaveContextCopyWithImpl(this._value, this._then); _$LoadableSaveContextCopyWithImpl(this._self, this._then);
// ignore: unused_field final LoadableSaveContext _self;
final $Val _value; final $Res Function(LoadableSaveContext) _then;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of LoadableSaveContext /// Create a copy of LoadableSaveContext
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline') @override $Res call({Object? timestamp = null,}) {
@override return _then(_self.copyWith(
$Res call({ timestamp: null == timestamp ? _self.timestamp : timestamp // ignore: cast_nullable_to_non_nullable
Object? timestamp = null, 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);
/// Create a copy of LoadableSaveContext /// Adds pattern-matching-related methods to [LoadableSaveContext].
/// with the given fields replaced by the non-null parameter values. extension LoadableSaveContextPatterns on LoadableSaveContext {
@pragma('vm:prefer-inline') /// A variant of `map` that fallback to returning `orElse`.
@override ///
$Res call({ /// It is equivalent to doing:
Object? timestamp = null, /// ```dart
}) { /// switch (sealedClass) {
return _then(_$LoadableSaveContextImpl( /// case final Subclass value:
timestamp: null == timestamp /// return ...;
? _value.timestamp /// case _:
: timestamp // ignore: cast_nullable_to_non_nullable /// return orElse();
as int, /// }
)); /// ```
}
@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._();
factory _$LoadableSaveContextImpl.fromJson(Map<String, dynamic> json) => class _LoadableSaveContext extends LoadableSaveContext {
_$$LoadableSaveContextImplFromJson(json); const _LoadableSaveContext({required this.timestamp}): super._();
factory _LoadableSaveContext.fromJson(Map<String, dynamic> json) => _$LoadableSaveContextFromJson(json);
@override @override final int timestamp;
final int timestamp;
@override /// Create a copy of LoadableSaveContext
String toString() { /// with the given fields replaced by the non-null parameter values.
return 'LoadableSaveContext(timestamp: $timestamp)'; @override @JsonKey(includeFromJson: false, includeToJson: false)
} @pragma('vm:prefer-inline')
_$LoadableSaveContextCopyWith<_LoadableSaveContext> get copyWith => __$LoadableSaveContextCopyWithImpl<_LoadableSaveContext>(this, _$identity);
@override @override
bool operator ==(Object other) { Map<String, dynamic> toJson() {
return identical(this, other) || return _$LoadableSaveContextToJson(this, );
(other.runtimeType == runtimeType &&
other is _$LoadableSaveContextImpl &&
(identical(other.timestamp, timestamp) ||
other.timestamp == timestamp));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, timestamp);
/// Create a copy of LoadableSaveContext
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$LoadableSaveContextImplCopyWith<_$LoadableSaveContextImpl> get copyWith =>
__$$LoadableSaveContextImplCopyWithImpl<_$LoadableSaveContextImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$LoadableSaveContextImplToJson(
this,
);
}
} }
abstract class _LoadableSaveContext extends LoadableSaveContext { @override
const factory _LoadableSaveContext({required final int timestamp}) = bool operator ==(Object other) {
_$LoadableSaveContextImpl; return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoadableSaveContext&&(identical(other.timestamp, timestamp) || other.timestamp == timestamp));
const _LoadableSaveContext._() : super._();
factory _LoadableSaveContext.fromJson(Map<String, dynamic> json) =
_$LoadableSaveContextImpl.fromJson;
@override
int get timestamp;
/// Create a copy of LoadableSaveContext
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$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,14 +6,9 @@ part of 'loadable_save_context.dart';
// JsonSerializableGenerator // JsonSerializableGenerator
// ************************************************************************** // **************************************************************************
_$LoadableSaveContextImpl _$$LoadableSaveContextImplFromJson( _LoadableSaveContext _$LoadableSaveContextFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> json) => _LoadableSaveContext(timestamp: (json['timestamp'] as num).toInt());
_$LoadableSaveContextImpl(
timestamp: (json['timestamp'] as num).toInt(),
);
Map<String, dynamic> _$$LoadableSaveContextImplToJson( Map<String, dynamic> _$LoadableSaveContextToJson(
_$LoadableSaveContextImpl instance) => _LoadableSaveContext instance,
<String, dynamic>{ ) => <String, dynamic>{'timestamp': instance.timestamp};
'timestamp': instance.timestamp,
};

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
class GradeAveragesState with _$GradeAveragesState { abstract 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 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND // GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// 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,185 +9,278 @@ 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; GradeAveragesGradingSystem get gradingSystem; List<int> get grades;
List<int> get grades => throw _privateConstructorUsedError; /// Create a copy of GradeAveragesState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$GradeAveragesStateCopyWith<GradeAveragesState> get copyWith => _$GradeAveragesStateCopyWithImpl<GradeAveragesState>(this as GradeAveragesState, _$identity);
/// Serializes this GradeAveragesState to a JSON map. /// Serializes this GradeAveragesState to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError; 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)';
}
/// Create a copy of GradeAveragesState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$GradeAveragesStateCopyWith<GradeAveragesState> get copyWith =>
throw _privateConstructorUsedError;
} }
/// @nodoc /// @nodoc
abstract class $GradeAveragesStateCopyWith<$Res> { abstract mixin class $GradeAveragesStateCopyWith<$Res> {
factory $GradeAveragesStateCopyWith( factory $GradeAveragesStateCopyWith(GradeAveragesState value, $Res Function(GradeAveragesState) _then) = _$GradeAveragesStateCopyWithImpl;
GradeAveragesState value, $Res Function(GradeAveragesState) then) = @useResult
_$GradeAveragesStateCopyWithImpl<$Res, GradeAveragesState>; $Res call({
@useResult GradeAveragesGradingSystem gradingSystem, List<int> grades
$Res call({GradeAveragesGradingSystem gradingSystem, List<int> grades}); });
}
}
/// @nodoc /// @nodoc
class _$GradeAveragesStateCopyWithImpl<$Res, $Val extends GradeAveragesState> class _$GradeAveragesStateCopyWithImpl<$Res>
implements $GradeAveragesStateCopyWith<$Res> { implements $GradeAveragesStateCopyWith<$Res> {
_$GradeAveragesStateCopyWithImpl(this._value, this._then); _$GradeAveragesStateCopyWithImpl(this._self, this._then);
// ignore: unused_field final GradeAveragesState _self;
final $Val _value; final $Res Function(GradeAveragesState) _then;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of GradeAveragesState /// Create a copy of GradeAveragesState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @pragma('vm:prefer-inline') @override $Res call({Object? gradingSystem = null,Object? grades = null,}) {
@override return _then(_self.copyWith(
$Res call({ gradingSystem: null == gradingSystem ? _self.gradingSystem : gradingSystem // ignore: cast_nullable_to_non_nullable
Object? gradingSystem = null, as GradeAveragesGradingSystem,grades: null == grades ? _self.grades : grades // ignore: cast_nullable_to_non_nullable
Object? grades = null, 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);
/// Create a copy of GradeAveragesState /// Adds pattern-matching-related methods to [GradeAveragesState].
/// with the given fields replaced by the non-null parameter values. extension GradeAveragesStatePatterns on GradeAveragesState {
@pragma('vm:prefer-inline') /// A variant of `map` that fallback to returning `orElse`.
@override ///
$Res call({ /// It is equivalent to doing:
Object? gradingSystem = null, /// ```dart
Object? grades = null, /// switch (sealedClass) {
}) { /// case final Subclass value:
return _then(_$GradeAveragesStateImpl( /// return ...;
gradingSystem: null == gradingSystem /// case _:
? _value.gradingSystem /// return orElse();
: gradingSystem // ignore: cast_nullable_to_non_nullable /// }
as GradeAveragesGradingSystem, /// ```
grades: null == grades
? _value._grades @optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _GradeAveragesState value)? $default,{required TResult orElse(),}){
: grades // ignore: cast_nullable_to_non_nullable final _that = this;
as List<int>, 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;
factory _$GradeAveragesStateImpl.fromJson(Map<String, dynamic> json) => class _GradeAveragesState implements GradeAveragesState {
_$$GradeAveragesStateImplFromJson(json); const _GradeAveragesState({required this.gradingSystem, required final List<int> grades}): _grades = grades;
factory _GradeAveragesState.fromJson(Map<String, dynamic> json) => _$GradeAveragesStateFromJson(json);
@override @override final GradeAveragesGradingSystem gradingSystem;
final GradeAveragesGradingSystem gradingSystem; final List<int> _grades;
final List<int> _grades; @override List<int> get grades {
@override if (_grades is EqualUnmodifiableListView) return _grades;
List<int> get grades { // ignore: implicit_dynamic_type
if (_grades is EqualUnmodifiableListView) return _grades; return EqualUnmodifiableListView(_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(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, gradingSystem, const DeepCollectionEquality().hash(_grades));
/// Create a copy of GradeAveragesState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@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;
factory _GradeAveragesState.fromJson(Map<String, dynamic> json) = /// Create a copy of GradeAveragesState
_$GradeAveragesStateImpl.fromJson; /// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$GradeAveragesStateCopyWith<_GradeAveragesState> get copyWith => __$GradeAveragesStateCopyWithImpl<_GradeAveragesState>(this, _$identity);
@override @override
GradeAveragesGradingSystem get gradingSystem; Map<String, dynamic> toJson() {
@override return _$GradeAveragesStateToJson(this, );
List<int> get grades;
/// Create a copy of GradeAveragesState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$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
// ************************************************************************** // **************************************************************************
_$GradeAveragesStateImpl _$$GradeAveragesStateImplFromJson( _GradeAveragesState _$GradeAveragesStateFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> json) => _GradeAveragesState(
_$GradeAveragesStateImpl(
gradingSystem: $enumDecode( gradingSystem: $enumDecode(
_$GradeAveragesGradingSystemEnumMap, json['gradingSystem']), _$GradeAveragesGradingSystemEnumMap,
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> _$$GradeAveragesStateImplToJson( Map<String, dynamic> _$GradeAveragesStateToJson(
_$GradeAveragesStateImpl instance) => _GradeAveragesState instance,
<String, dynamic>{ ) => <String, dynamic>{
'gradingSystem': 'gradingSystem': _$GradeAveragesGradingSystemEnumMap[instance.gradingSystem]!,
_$GradeAveragesGradingSystemEnumMap[instance.gradingSystem]!, 'grades': instance.grades,
'grades': instance.grades, };
};
const _$GradeAveragesGradingSystemEnumMap = { const _$GradeAveragesGradingSystemEnumMap = {
GradeAveragesGradingSystem.highSchool: 'highSchool', GradeAveragesGradingSystem.highSchool: 'highSchool',

View File

@@ -51,7 +51,7 @@ class GradeAveragesView extends StatelessWidget {
color: Theme.of(context).colorScheme.onSurface color: Theme.of(context).colorScheme.onSurface
), ),
const SizedBox(width: 15), const SizedBox(width: 15),
Text(isMiddleSchool ? 'Notensystem' : 'Punktesystem'), Text(isMiddleSchool ? 'Realschule' : 'Oberstufe'),
], ],
), ),
)).toList(), )).toList(),
@@ -80,11 +80,19 @@ class GradeAveragesView extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const SizedBox(height: 30), const SizedBox(height: 30),
Text(bloc.average().toStringAsFixed(2), style: const TextStyle(fontSize: 30, fontWeight: FontWeight.bold)), Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Ø', style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold)),
SizedBox(width: 5),
Text(bloc.average().toStringAsFixed(2), style: const TextStyle(fontSize: 30, fontWeight: FontWeight.bold))
],
),
const SizedBox(height: 10), const SizedBox(height: 10),
const Divider(), const Divider(),
const SizedBox(height: 10), const SizedBox(height: 10),
Text(bloc.isMiddleSchool() ? 'Wähle unten die Anzahl deiner jeweiligen Noten aus' : 'Wähle unten die Anzahl deiner jeweiligen Punkte aus'), Text(bloc.isMiddleSchool() ? 'Wähle die Anzahl deiner jeweiligen Noten aus' : 'Wähle die Anzahl deiner jeweiligen Punkte aus'),
const SizedBox(height: 10), const SizedBox(height: 10),
const Expanded( const Expanded(
child: GradeAveragesListView() child: GradeAveragesListView()

View File

@@ -5,7 +5,7 @@ part 'holidays_state.freezed.dart';
part 'holidays_state.g.dart'; part 'holidays_state.g.dart';
@freezed @freezed
class HolidaysState with _$HolidaysState { abstract 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 @@ class HolidaysState with _$HolidaysState {
} }
@freezed @freezed
class Holiday with _$Holiday { abstract class Holiday with _$Holiday {
const factory Holiday({ const factory Holiday({
required String start, required String start,
required String end, required String end,

View File

@@ -6,8 +6,8 @@ part of 'holidays_state.dart';
// JsonSerializableGenerator // JsonSerializableGenerator
// ************************************************************************** // **************************************************************************
_$HolidaysStateImpl _$$HolidaysStateImplFromJson(Map<String, dynamic> json) => _HolidaysState _$HolidaysStateFromJson(Map<String, dynamic> json) =>
_$HolidaysStateImpl( _HolidaysState(
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,29 +15,27 @@ _$HolidaysStateImpl _$$HolidaysStateImplFromJson(Map<String, dynamic> json) =>
.toList(), .toList(),
); );
Map<String, dynamic> _$$HolidaysStateImplToJson(_$HolidaysStateImpl instance) => Map<String, dynamic> _$HolidaysStateToJson(_HolidaysState instance) =>
<String, dynamic>{ <String, dynamic>{
'showPastHolidays': instance.showPastHolidays, 'showPastHolidays': instance.showPastHolidays,
'showDisclaimer': instance.showDisclaimer, 'showDisclaimer': instance.showDisclaimer,
'holidays': instance.holidays, 'holidays': instance.holidays,
}; };
_$HolidayImpl _$$HolidayImplFromJson(Map<String, dynamic> json) => _Holiday _$HolidayFromJson(Map<String, dynamic> json) => _Holiday(
_$HolidayImpl( 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> _$$HolidayImplToJson(_$HolidayImpl instance) => Map<String, dynamic> _$HolidayToJson(_Holiday 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

@@ -5,7 +5,7 @@ part 'marianum_message_state.g.dart';
@freezed @freezed
class MarianumMessageState with _$MarianumMessageState { abstract class MarianumMessageState with _$MarianumMessageState {
const factory MarianumMessageState({ const factory MarianumMessageState({
required MarianumMessageList messageList, required MarianumMessageList messageList,
}) = _MarianumMessageState; }) = _MarianumMessageState;
@@ -14,7 +14,7 @@ class MarianumMessageState with _$MarianumMessageState {
} }
@freezed @freezed
class MarianumMessageList with _$MarianumMessageList { abstract 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 @@ class MarianumMessageList with _$MarianumMessageList {
} }
@freezed @freezed
class MarianumMessage with _$MarianumMessage { abstract 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,45 +6,38 @@ part of 'marianum_message_state.dart';
// JsonSerializableGenerator // JsonSerializableGenerator
// ************************************************************************** // **************************************************************************
_$MarianumMessageStateImpl _$$MarianumMessageStateImplFromJson( _MarianumMessageState _$MarianumMessageStateFromJson(
Map<String, dynamic> json) => Map<String, dynamic> json,
_$MarianumMessageStateImpl( ) => _MarianumMessageState(
messageList: MarianumMessageList.fromJson( messageList: MarianumMessageList.fromJson(
json['messageList'] as Map<String, dynamic>), json['messageList'] as Map<String, dynamic>,
); ),
);
Map<String, dynamic> _$$MarianumMessageStateImplToJson( Map<String, dynamic> _$MarianumMessageStateToJson(
_$MarianumMessageStateImpl instance) => _MarianumMessageState instance,
<String, dynamic>{ ) => <String, dynamic>{'messageList': instance.messageList};
'messageList': instance.messageList,
};
_$MarianumMessageListImpl _$$MarianumMessageListImplFromJson( _MarianumMessageList _$MarianumMessageListFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> json) => _MarianumMessageList(
_$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> _$$MarianumMessageListImplToJson( Map<String, dynamic> _$MarianumMessageListToJson(
_$MarianumMessageListImpl instance) => _MarianumMessageList instance,
<String, dynamic>{ ) => <String, dynamic>{'base': instance.base, 'messages': instance.messages};
'base': instance.base,
'messages': instance.messages,
};
_$MarianumMessageImpl _$$MarianumMessageImplFromJson( _MarianumMessage _$MarianumMessageFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> json) => _MarianumMessage(
_$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> _$$MarianumMessageImplToJson( Map<String, dynamic> _$MarianumMessageToJson(_MarianumMessage instance) =>
_$MarianumMessageImpl instance) =>
<String, dynamic>{ <String, dynamic>{
'name': instance.name, 'name': instance.name,
'date': instance.date, 'date': instance.date,

View File

@@ -7,35 +7,43 @@ part of 'settings.dart';
// ************************************************************************** // **************************************************************************
Settings _$SettingsFromJson(Map<String, dynamic> json) => Settings( Settings _$SettingsFromJson(Map<String, dynamic> json) => Settings(
appTheme: Settings._themeFromJson(json['appTheme'] as String), appTheme: Settings._themeFromJson(json['appTheme'] as String),
devToolsEnabled: json['devToolsEnabled'] as bool, devToolsEnabled: json['devToolsEnabled'] as bool,
modulesSettings: ModulesSettings.fromJson( modulesSettings: ModulesSettings.fromJson(
json['modulesSettings'] as Map<String, dynamic>), json['modulesSettings'] as Map<String, dynamic>,
timetableSettings: TimetableSettings.fromJson( ),
json['timetableSettings'] as Map<String, dynamic>), timetableSettings: TimetableSettings.fromJson(
talkSettings: json['timetableSettings'] as Map<String, dynamic>,
TalkSettings.fromJson(json['talkSettings'] as Map<String, dynamic>), ),
fileSettings: talkSettings: TalkSettings.fromJson(
FileSettings.fromJson(json['fileSettings'] as Map<String, dynamic>), json['talkSettings'] as Map<String, dynamic>,
holidaysSettings: HolidaysSettings.fromJson( ),
json['holidaysSettings'] as Map<String, dynamic>), fileSettings: FileSettings.fromJson(
fileViewSettings: FileViewSettings.fromJson( json['fileSettings'] as Map<String, dynamic>,
json['fileViewSettings'] as Map<String, dynamic>), ),
notificationSettings: NotificationSettings.fromJson( holidaysSettings: HolidaysSettings.fromJson(
json['notificationSettings'] as Map<String, dynamic>), json['holidaysSettings'] as Map<String, dynamic>,
devToolsSettings: DevToolsSettings.fromJson( ),
json['devToolsSettings'] as Map<String, dynamic>), fileViewSettings: FileViewSettings.fromJson(
); json['fileViewSettings'] as Map<String, dynamic>,
),
notificationSettings: NotificationSettings.fromJson(
json['notificationSettings'] as Map<String, dynamic>,
),
devToolsSettings: DevToolsSettings.fromJson(
json['devToolsSettings'] as Map<String, dynamic>,
),
);
Map<String, dynamic> _$SettingsToJson(Settings instance) => <String, dynamic>{ Map<String, dynamic> _$SettingsToJson(Settings instance) => <String, dynamic>{
'appTheme': Settings._themeToJson(instance.appTheme), 'appTheme': Settings._themeToJson(instance.appTheme),
'devToolsEnabled': instance.devToolsEnabled, 'devToolsEnabled': instance.devToolsEnabled,
'modulesSettings': instance.modulesSettings.toJson(), 'modulesSettings': instance.modulesSettings.toJson(),
'timetableSettings': instance.timetableSettings.toJson(), 'timetableSettings': instance.timetableSettings.toJson(),
'talkSettings': instance.talkSettings.toJson(), 'talkSettings': instance.talkSettings.toJson(),
'fileSettings': instance.fileSettings.toJson(), 'fileSettings': instance.fileSettings.toJson(),
'holidaysSettings': instance.holidaysSettings.toJson(), 'holidaysSettings': instance.holidaysSettings.toJson(),
'fileViewSettings': instance.fileViewSettings.toJson(), 'fileViewSettings': instance.fileViewSettings.toJson(),
'notificationSettings': instance.notificationSettings.toJson(), 'notificationSettings': instance.notificationSettings.toJson(),
'devToolsSettings': instance.devToolsSettings.toJson(), 'devToolsSettings': instance.devToolsSettings.toJson(),
}; };

View File

@@ -7,10 +7,10 @@ part of 'fileSettings.dart';
// ************************************************************************** // **************************************************************************
FileSettings _$FileSettingsFromJson(Map<String, dynamic> json) => FileSettings( FileSettings _$FileSettingsFromJson(Map<String, dynamic> json) => FileSettings(
sortFoldersToTop: json['sortFoldersToTop'] as bool, sortFoldersToTop: json['sortFoldersToTop'] as bool,
ascending: json['ascending'] as bool, ascending: json['ascending'] as bool,
sortBy: $enumDecode(_$SortOptionEnumMap, json['sortBy']), sortBy: $enumDecode(_$SortOptionEnumMap, json['sortBy']),
); );
Map<String, dynamic> _$FileSettingsToJson(FileSettings instance) => Map<String, dynamic> _$FileSettingsToJson(FileSettings instance) =>
<String, dynamic>{ <String, dynamic>{

View File

@@ -12,6 +12,4 @@ FileViewSettings _$FileViewSettingsFromJson(Map<String, dynamic> json) =>
); );
Map<String, dynamic> _$FileViewSettingsToJson(FileViewSettings instance) => Map<String, dynamic> _$FileViewSettingsToJson(FileViewSettings instance) =>
<String, dynamic>{ <String, dynamic>{'alwaysOpenExternally': instance.alwaysOpenExternally};
'alwaysOpenExternally': instance.alwaysOpenExternally,
};

View File

@@ -16,13 +16,14 @@ ModulesSettings _$ModulesSettingsFromJson(Map<String, dynamic> json) =>
.toList(), .toList(),
); );
Map<String, dynamic> _$ModulesSettingsToJson(ModulesSettings instance) => Map<String, dynamic> _$ModulesSettingsToJson(
<String, dynamic>{ ModulesSettings instance,
'moduleOrder': ) => <String, dynamic>{
instance.moduleOrder.map((e) => _$ModulesEnumMap[e]!).toList(), 'moduleOrder': instance.moduleOrder.map((e) => _$ModulesEnumMap[e]!).toList(),
'hiddenModules': 'hiddenModules': instance.hiddenModules
instance.hiddenModules.map((e) => _$ModulesEnumMap[e]!).toList(), .map((e) => _$ModulesEnumMap[e]!)
}; .toList(),
};
const _$ModulesEnumMap = { const _$ModulesEnumMap = {
Modules.timetable: 'timetable', Modules.timetable: 'timetable',

View File

@@ -7,15 +7,15 @@ part of 'notificationSettings.dart';
// ************************************************************************** // **************************************************************************
NotificationSettings _$NotificationSettingsFromJson( NotificationSettings _$NotificationSettingsFromJson(
Map<String, dynamic> json) => Map<String, dynamic> json,
NotificationSettings( ) => NotificationSettings(
askUsageDismissed: json['askUsageDismissed'] as bool, askUsageDismissed: json['askUsageDismissed'] as bool,
enabled: json['enabled'] as bool, enabled: json['enabled'] as bool,
); );
Map<String, dynamic> _$NotificationSettingsToJson( Map<String, dynamic> _$NotificationSettingsToJson(
NotificationSettings instance) => NotificationSettings instance,
<String, dynamic>{ ) => <String, dynamic>{
'askUsageDismissed': instance.askUsageDismissed, 'askUsageDismissed': instance.askUsageDismissed,
'enabled': instance.enabled, 'enabled': instance.enabled,
}; };

View File

@@ -7,11 +7,11 @@ part of 'talkSettings.dart';
// ************************************************************************** // **************************************************************************
TalkSettings _$TalkSettingsFromJson(Map<String, dynamic> json) => TalkSettings( TalkSettings _$TalkSettingsFromJson(Map<String, dynamic> json) => TalkSettings(
sortFavoritesToTop: json['sortFavoritesToTop'] as bool, sortFavoritesToTop: json['sortFavoritesToTop'] as bool,
sortUnreadToTop: json['sortUnreadToTop'] as bool, sortUnreadToTop: json['sortUnreadToTop'] as bool,
drafts: Map<String, String>.from(json['drafts'] as Map), drafts: Map<String, String>.from(json['drafts'] as Map),
draftReplies: Map<String, int>.from(json['draftReplies'] as Map), draftReplies: Map<String, int>.from(json['draftReplies'] as Map),
); );
Map<String, dynamic> _$TalkSettingsToJson(TalkSettings instance) => Map<String, dynamic> _$TalkSettingsToJson(TalkSettings instance) =>
<String, dynamic>{ <String, dynamic>{

View File

@@ -9,16 +9,18 @@ part of 'timetableSettings.dart';
TimetableSettings _$TimetableSettingsFromJson(Map<String, dynamic> json) => TimetableSettings _$TimetableSettingsFromJson(Map<String, dynamic> json) =>
TimetableSettings( TimetableSettings(
connectDoubleLessons: json['connectDoubleLessons'] as bool, connectDoubleLessons: json['connectDoubleLessons'] as bool,
timetableNameMode: timetableNameMode: $enumDecode(
$enumDecode(_$TimetableNameModeEnumMap, json['timetableNameMode']), _$TimetableNameModeEnumMap,
json['timetableNameMode'],
),
); );
Map<String, dynamic> _$TimetableSettingsToJson(TimetableSettings instance) => Map<String, dynamic> _$TimetableSettingsToJson(
<String, dynamic>{ TimetableSettings instance,
'connectDoubleLessons': instance.connectDoubleLessons, ) => <String, dynamic>{
'timetableNameMode': 'connectDoubleLessons': instance.connectDoubleLessons,
_$TimetableNameModeEnumMap[instance.timetableNameMode]!, 'timetableNameMode': _$TimetableNameModeEnumMap[instance.timetableNameMode]!,
}; };
const _$TimetableNameModeEnumMap = { const _$TimetableNameModeEnumMap = {
TimetableNameMode.name: 'name', TimetableNameMode.name: 'name',

23
lib/utils/FileSaver.dart Normal file
View File

@@ -0,0 +1,23 @@
import 'dart:io';
import 'package:permission_handler/permission_handler.dart';
// only tested on android!
class FileSaver {
static Future<String> getExternalDocumentPath() async {
var permission = await Permission.storage.status;
if(!permission.isGranted) {
await Permission.storage.request();
}
var directory = Directory('/storage/emulated/0/Download');
final externalPath = directory.path;
await Directory(externalPath).create(recursive: true);
return externalPath;
}
static Future<File> writeBytes(List<int> bytes, String name) async {
final path = await getExternalDocumentPath();
var file = File('$path/$name');
return file.writeAsBytes(bytes);
}
}

10
lib/utils/UrlOpener.dart Normal file
View File

@@ -0,0 +1,10 @@
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:url_launcher/url_launcher_string.dart';
class UrlOpener {
static Future<void> onOpen(LinkableElement link) async {
if(await canLaunchUrlString(link.url)) {
await launchUrlString(link.url);
}
}
}

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:screen_brightness/screen_brightness.dart';
import 'appSharePlatformView.dart'; import 'appSharePlatformView.dart';
@@ -10,6 +11,18 @@ class QrShareView extends StatefulWidget {
} }
class _QrShareViewState extends State<QrShareView> { class _QrShareViewState extends State<QrShareView> {
@override
void initState() {
ScreenBrightness.instance.setApplicationScreenBrightness(1.0);
super.initState();
}
@override
void dispose() {
ScreenBrightness.instance.resetApplicationScreenBrightness();
super.dispose();
}
@override @override
Widget build(BuildContext context) => DefaultTabController( Widget build(BuildContext context) => DefaultTabController(
length: 2, length: 2,

View File

@@ -51,6 +51,7 @@ class _ChatViewState extends State<ChatView> {
var elementDate = DateTime.fromMillisecondsSinceEpoch(element.timestamp * 1000); var elementDate = DateTime.fromMillisecondsSinceEpoch(element.timestamp * 1000);
if(element.systemMessage.contains('reaction')) return; if(element.systemMessage.contains('reaction')) return;
if(element.systemMessage.contains('poll_voted')) return;
var commonRead = int.parse(data.getChatResponse.headers?['x-chat-last-common-read'] ?? '0'); var commonRead = int.parse(data.getChatResponse.headers?['x-chat-last-common-read'] ?? '0');
if(!elementDate.isSameDay(lastDate)) { if(!elementDate.isSameDay(lastDate)) {
@@ -128,7 +129,7 @@ class _ChatViewState extends State<ChatView> {
), ),
), ),
Container( Container(
color: Theme.of(context).colorScheme.background, color: Theme.of(context).colorScheme.surface,
child: TalkNavigator.isSecondaryVisible(context) child: TalkNavigator.isSecondaryVisible(context)
? ChatTextfield(widget.room.token, selfId: widget.selfId) ? ChatTextfield(widget.room.token, selfId: widget.selfId)
: SafeArea(child: ChatTextfield(widget.room.token, selfId: widget.selfId) : SafeArea(child: ChatTextfield(widget.room.token, selfId: widget.selfId)

View File

@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:jiffy/jiffy.dart'; import 'package:jiffy/jiffy.dart';
import 'package:open_filex/open_filex.dart'; import 'package:open_filex/open_filex.dart';
import '../../../../api/marianumcloud/talk/getPoll/getPollState.dart';
import '../../../../extensions/text.dart'; import '../../../../extensions/text.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@@ -18,11 +19,13 @@ import '../../../../api/marianumcloud/talk/reactMessage/reactMessageParams.dart'
import '../../../../api/marianumcloud/talk/room/getRoomResponse.dart'; import '../../../../api/marianumcloud/talk/room/getRoomResponse.dart';
import '../../../../model/chatList/chatProps.dart'; import '../../../../model/chatList/chatProps.dart';
import '../../../../widget/debug/debugTile.dart'; import '../../../../widget/debug/debugTile.dart';
import '../../../../widget/loadingSpinner.dart';
import '../../files/fileElement.dart'; import '../../files/fileElement.dart';
import 'answerReference.dart'; import 'answerReference.dart';
import 'chatBubbleStyles.dart'; import 'chatBubbleStyles.dart';
import 'chatMessage.dart'; import 'chatMessage.dart';
import '../messageReactions.dart'; import '../messageReactions.dart';
import 'pollOptionsList.dart';
class ChatBubble extends StatefulWidget { class ChatBubble extends StatefulWidget {
final BuildContext context; final BuildContext context;
@@ -297,6 +300,34 @@ class _ChatBubbleState extends State<ChatBubble> with SingleTickerProviderStateM
onLongPress: showOptionsDialog, onLongPress: showOptionsDialog,
onDoubleTap: showOptionsDialog, onDoubleTap: showOptionsDialog,
onTap: () { onTap: () {
if(message.originalData?['object']?.type == RichObjectStringObjectType.talkPoll) {
var pollId = int.parse(message.originalData!['object']!.id);
var pollState = GetPollState(token: widget.bubbleData.token, pollId: pollId).run();
showDialog(context: context, builder: (context) => AlertDialog(
title: Text(message.originalData!['object']!.name, overflow: TextOverflow.ellipsis),
content: FutureBuilder(
future: pollState,
builder: (context, snapshot) {
if(snapshot.connectionState == ConnectionState.waiting) return const Column(mainAxisSize: MainAxisSize.min, children: [LoadingSpinner()]);
var pollData = snapshot.data!.data;
return SingleChildScrollView(
child: PollOptionsList(
pollData: pollData,
chatToken: widget.chatData.token,
),
);
}
),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: const Text('Zurück')
),
],
));
}
if(message.file == null) return; if(message.file == null) return;
if(downloadProgress > 0) { if(downloadProgress > 0) {

View File

@@ -2,12 +2,12 @@
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_linkify/flutter_linkify.dart'; import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:url_launcher/url_launcher_string.dart';
import '../../../../api/marianumcloud/talk/chat/getChatResponse.dart'; import '../../../../api/marianumcloud/talk/chat/getChatResponse.dart';
import '../../../../api/marianumcloud/talk/chat/richObjectStringProcessor.dart'; import '../../../../api/marianumcloud/talk/chat/richObjectStringProcessor.dart';
import '../../../../model/accountData.dart'; import '../../../../model/accountData.dart';
import '../../../../model/endpointData.dart'; import '../../../../model/endpointData.dart';
import '../../../../utils/UrlOpener.dart';
class ChatMessage { class ChatMessage {
String originalMessage; String originalMessage;
@@ -29,9 +29,17 @@ class ChatMessage {
var contentWidget = Linkify( var contentWidget = Linkify(
text: content, text: content,
onOpen: onOpen, onOpen: UrlOpener.onOpen,
); );
if(originalData?['object']?.type == RichObjectStringObjectType.talkPoll) {
return ListTile(
leading: const Icon(Icons.poll_outlined),
title: Text(originalData!['object']!.name),
contentPadding: const EdgeInsets.only(left: 10),
);
}
if(file == null) return contentWidget; if(file == null) return contentWidget;
return Padding( return Padding(
@@ -65,10 +73,4 @@ class ChatMessage {
) )
); );
} }
Future<void> onOpen(LinkableElement link) async {
if(await canLaunchUrlString(link.url)) {
await launchUrlString(link.url);
}
}
} }

View File

@@ -0,0 +1,67 @@
import 'package:flutter/material.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
import '../../../../api/marianumcloud/talk/getPoll/getPollStateResponse.dart';
import '../../../../utils/UrlOpener.dart';
class PollOptionsList extends StatefulWidget {
final GetPollStateResponseObject pollData;
final String chatToken;
const PollOptionsList({super.key, required this.pollData, required this.chatToken});
@override
State<PollOptionsList> createState() => _PollOptionsListState();
}
class _PollOptionsListState extends State<PollOptionsList> {
@override
Widget build(BuildContext context) => Column(
children: [
...widget.pollData.options.map<Widget>((option) {
var optionId = widget.pollData.options.indexOf(option);
var votedSelf = widget.pollData.votedSelf.contains(optionId);
var portionsVisible = widget.pollData.votes is Map<String, dynamic>;
var votes = portionsVisible
? (widget.pollData.votes['option-$optionId'] as num?) ?? 0
: 0;
var numVoters = widget.pollData.numVoters ?? 0;
double portion = numVoters == 0 ? 0 : (votes / numVoters);
return ListTile(
// enabled: false,
isThreeLine: portionsVisible,
dense: true,
title: Text(
option,
style: Theme.of(context).textTheme.bodyLarge,
),
leading: Icon(
votedSelf ? Icons.check_circle_outlined : Icons.circle_outlined,
color: votedSelf
? Theme.of(context).colorScheme.primary.withValues(alpha: 0.6)
: Theme.of(context).colorScheme.onSurfaceVariant.withValues(alpha: 0.6),
),
subtitle: portionsVisible ? Row(
children: [
Expanded(
child: LinearProgressIndicator(value: portion.clamp(0.0, 1.0)),
),
Container(
margin: const EdgeInsets.only(left: 10),
child: Text('${(portion * 100).round()}%'),
),
],
) : null,
);
}),
ListTile(
title: Linkify(
text: 'Wenn du abstimmen möchtest, verwende die Webversion unter https://cloud.marianum-fulda.de/call/${widget.chatToken}',
onOpen: UrlOpener.onOpen,
style: Theme.of(context).textTheme.bodySmall,
),
)
],
);
}

View File

@@ -9,6 +9,8 @@ import 'package:share_plus/share_plus.dart';
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart'; import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
import '../storage/base/settingsProvider.dart'; import '../storage/base/settingsProvider.dart';
import '../utils/FileSaver.dart';
import 'infoDialog.dart';
import 'placeholderView.dart'; import 'placeholderView.dart';
import 'sharePositionOrigin.dart'; import 'sharePositionOrigin.dart';
@@ -21,6 +23,12 @@ class FileViewer extends StatefulWidget {
State<FileViewer> createState() => _FileViewerState(); State<FileViewer> createState() => _FileViewerState();
} }
enum FileViewingActions {
openExternal,
share,
save
}
class _FileViewerState extends State<FileViewer> { class _FileViewerState extends State<FileViewer> {
PhotoViewController photoViewController = PhotoViewController(); PhotoViewController photoViewController = PhotoViewController();
@@ -38,22 +46,57 @@ class _FileViewerState extends State<FileViewer> {
AppBar appbar({List actions = const []}) => AppBar( AppBar appbar({List actions = const []}) => AppBar(
title: Text(widget.path.split('/').last), title: Text(widget.path.split('/').last),
actions: [ actions: [
IconButton( ...actions,
onPressed: () => Navigator.of(context).push( PopupMenuButton<FileViewingActions>(
MaterialPageRoute(builder: (context) => FileViewer(path: widget.path, openExternal: true)) onSelected: (value) async {
), switch(value) {
icon: const Icon(Icons.open_in_new) case FileViewingActions.openExternal:
), Navigator.of(context).push(
IconButton( MaterialPageRoute(builder: (context) => FileViewer(path: widget.path, openExternal: true))
onPressed: () { );
Share.shareXFiles( break;
[XFile(widget.path)], case FileViewingActions.share:
sharePositionOrigin: SharePositionOrigin.get(context), SharePlus.instance.share(
); ShareParams(
files: [XFile(widget.path)],
sharePositionOrigin: SharePositionOrigin.get(context)
)
);
break;
case FileViewingActions.save:
await FileSaver.writeBytes(await File(widget.path).readAsBytes(), widget.path.split('/').last);
if(!context.mounted) return;
InfoDialog.show(context, 'Die Datei wurde im Downloads Ordner gespeichert.');
break;
}
}, },
icon: const Icon(Icons.share_outlined), itemBuilder: (context) => <PopupMenuEntry<FileViewingActions>>[
const PopupMenuItem(
value: FileViewingActions.openExternal,
child: ListTile(
leading: Icon(Icons.open_in_new),
title: Text('Extern öffnen'),
dense: true,
),
),
const PopupMenuItem(
value: FileViewingActions.share,
child: ListTile(
leading: Icon(Icons.share_outlined),
title: Text('Teilen'),
dense: true,
),
),
if(Platform.isAndroid) const PopupMenuItem(
value: FileViewingActions.save,
child: ListTile(
leading: Icon(Icons.save_alt_outlined),
title: Text('Speichern'),
dense: true,
),
),
],
), ),
...actions
], ],
); );

View File

@@ -1,36 +1,14 @@
name: marianum_mobile name: marianum_mobile
description: Mobile client for Webuntis and Nextcloud with Talk integration description: Mobile client for Webuntis and Nextcloud with Talk integration
# The following line prevents the package from being accidentally published to publish_to: 'none'
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.1.4+42
version: 0.1.7+45
environment: environment:
sdk: '>3.0.0' sdk: ">=3.8.0 <4.0.0"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependency_overrides: dependency_overrides:
intl: any intl: 0.20.2
dependencies: dependencies:
flutter: flutter:
@@ -46,6 +24,7 @@ dependencies:
bottom_sheet: ^4.0.4 bottom_sheet: ^4.0.4
bubble: ^1.2.1 bubble: ^1.2.1
cached_network_image: ^3.4.1 cached_network_image: ^3.4.1
collection: ^1.19.0
connectivity_plus: ^6.1.2 connectivity_plus: ^6.1.2
crypto: ^3.0.6 crypto: ^3.0.6
cupertino_icons: ^1.0.8 cupertino_icons: ^1.0.8
@@ -64,11 +43,9 @@ dependencies:
url: https://github.com/Harsh223/flowder.git url: https://github.com/Harsh223/flowder.git
flutter_app_badge: ^2.0.2 flutter_app_badge: ^2.0.2
flutter_bloc: ^9.0.0 flutter_bloc: ^9.0.0
flutter_launcher_icons: ^0.14.3
flutter_linkify: ^6.0.0 flutter_linkify: ^6.0.0
flutter_local_notifications: ^19.4.1 flutter_local_notifications: ^19.4.1
flutter_login: ^5.0.0 flutter_login: ^5.0.0
flutter_native_splash: ^2.4.4
flutter_split_view: ^0.1.2 flutter_split_view: ^0.1.2
freezed_annotation: ^3.1.0 freezed_annotation: ^3.1.0
http: ^1.3.0 http: ^1.3.0
@@ -84,8 +61,10 @@ dependencies:
path: packages/nextcloud path: packages/nextcloud
ref: 3683491a94670393e46cbc83ad85b994f7df7481 ref: 3683491a94670393e46cbc83ad85b994f7df7481
url: https://github.com/provokateurin/nextcloud-neon url: https://github.com/provokateurin/nextcloud-neon
open_filex: ^4.7.0
package_info_plus: ^8.1.3 package_info_plus: ^8.1.3
path_provider: ^2.1.5 path_provider: ^2.1.5
permission_handler: ^12.0.1
persistent_bottom_nav_bar_v2: ^6.1.0 persistent_bottom_nav_bar_v2: ^6.1.0
photo_view: ^0.15.0 photo_view: ^0.15.0
pretty_json: ^2.0.0 pretty_json: ^2.0.0
@@ -93,6 +72,7 @@ dependencies:
qr_flutter: ^4.1.0 qr_flutter: ^4.1.0
rrule: ^0.2.17 rrule: ^0.2.17
rrule_generator: ^0.9.0 rrule_generator: ^0.9.0
screen_brightness: ^2.1.7
share_plus: ^11.1.0 share_plus: ^11.1.0
shared_preferences: ^2.3.5 shared_preferences: ^2.3.5
syncfusion_flutter_calendar: ^31.1.17 syncfusion_flutter_calendar: ^31.1.17
@@ -100,39 +80,19 @@ dependencies:
time_range_picker: ^2.3.0 time_range_picker: ^2.3.0
url_launcher: ^6.3.1 url_launcher: ^6.3.1
uuid: ^4.5.1 uuid: ^4.5.1
open_filex: ^4.7.0
collection: ^1.19.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_launcher_icons: ^0.14.3
sdk: flutter flutter_native_splash: ^2.4.4
json_serializable: any
build_runner: any
# The "flutter_lints" package below contains a set of recommended lints to build_runner: ^2.10.5
# encourage good coding practices. The lint set provided by the package is freezed: ^3.2.4
# activated in the `analysis_options.yaml` file located at the root of your json_serializable: ^6.11.4
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: any
freezed: any
# For information on the generic Dart part of this file, see the flutter_lints: ^6.0.0
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages.
flutter: flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
assets: assets:
- assets/ca/ - assets/ca/
- assets/background/ - assets/background/
@@ -163,14 +123,4 @@ flutter:
# weight: 700 # weight: 700
# #
# For details regarding fonts from package dependencies, # For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages # see https://flutter.dev/custom-fonts/#from-packages
flutter_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