Compare commits
	
		
			37 Commits
		
	
	
		
			a20c2598fc
			...
			3.1.0+115
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 5ecd39b6a9 | |||
| 8854305e99 | |||
| 903cade296 | |||
| e48410a528 | |||
| 170ea4f2c0 | |||
| 19f0e11384 | |||
| 80bf6c3bbe | |||
| 8352ce8b5b | |||
| c06abf6e42 | |||
| 37cc0a5291 | |||
| 25ae18d6a9 | |||
| 18db50d80c | |||
| 903008d397 | |||
| 4499d4ec8e | |||
| 3a4faac8cb | |||
| e6c58b7b63 | |||
| a7454edec0 | |||
| cbf1952eb7 | |||
| 6d06f0a1b4 | |||
| f2d2a9efd8 | |||
| d44c8217b0 | |||
| 446c33d8b0 | |||
| 996462f1fd | |||
| 778f6bb79f | |||
| 8747f948b9 | |||
| 9546d6e4b8 | |||
| f8d1940af6 | |||
| b2b0891d24 | |||
| 274168d4bc | |||
| 2c98b348d5 | |||
| afc7887ddd | |||
| 99ff78a3d5 | |||
| 2ad85addf6 | |||
| 552b4b2572 | |||
| 594ac39e3d | |||
| 23321171f3 | |||
| ee72d79c93 | 
							
								
								
									
										2
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							| @@ -59,7 +59,7 @@ jobs: | ||||
|           sudo apt-get install -y libnotify-dev | ||||
|           sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev | ||||
|           sudo apt-get install -y gstreamer-1.0 | ||||
|           sudo apt-get install -y libsecret-1-0 | ||||
|           sudo apt-get install -y libsecret-1-dev | ||||
|       - run: flutter pub get | ||||
|       - run: flutter build linux | ||||
|       - name: Archive production artifacts | ||||
|   | ||||
| @@ -8,6 +8,9 @@ | ||||
|  | ||||
| Hello there! Welcome to the main repository of the DysonNetwork (also known as the Solar Network). The code here is mainly about the front-end app (also known as Solian). But you can still post issues here to get help and request new features! | ||||
|  | ||||
| 如果你看得懂这行字,你可以前往我们的文档来了解更多: | ||||
| [Suki - Solar Network](https://kb.solsynth.dev/zh/solar-network) | ||||
|  | ||||
| ## Server | ||||
|  | ||||
| The backend of the Solar Network project is located at [Solsynth/DysonNetwork](https://github.com/Solsynth/DysonNetwork) | ||||
| @@ -25,8 +28,6 @@ The content below will lead you to the world of Solar Network. | ||||
|  | ||||
| ### For Normal Users | ||||
|  | ||||
| **The v3 Release is not ready, yet.** | ||||
|  | ||||
| 1. Go to the Github Releases page, and download the latest release / pre-release according to your platform. | ||||
|    - **What's the difference between stable and pre-release?** The pre-release is untested by the other users and includes the new cutting-edge features, usually the pre-release is the feature drop. At the same time, due to we're not doing the API versioning, some breaking changes may break the stable release, so use the pre-release one instead. | ||||
| 2. Create an account on the Solar Network | ||||
|   | ||||
| @@ -41,7 +41,16 @@ | ||||
|                 <action android:name="android.intent.action.MAIN" /> | ||||
|                 <category android:name="android.intent.category.LAUNCHER" /> | ||||
|             </intent-filter> | ||||
|              | ||||
|  | ||||
|             <!-- Deeplinking --> | ||||
|             <intent-filter android:autoVerify="true"> | ||||
|                 <action android:name="android.intent.action.VIEW" /> | ||||
|                 <category android:name="android.intent.category.DEFAULT" /> | ||||
|                 <category android:name="android.intent.category.BROWSABLE" /> | ||||
|                 <data android:scheme="http" android:host="solian.app" /> | ||||
|                 <data android:scheme="https" /> | ||||
|             </intent-filter> | ||||
|  | ||||
|             <!-- Share Intent Filters --> | ||||
|             <intent-filter> | ||||
|                 <action android:name="android.intent.action.SEND" /> | ||||
|   | ||||
| @@ -375,7 +375,9 @@ | ||||
|   "postContent": "Content", | ||||
|   "postSettings": "Settings", | ||||
|   "postPublisherUnselected": "Publisher Unspecified", | ||||
|   "postVisibility": "Visibility", | ||||
|   "postType": "Post Type", | ||||
|   "articleAttachmentHint": "Attachments must be uploaded and inserted into the article body to be visible.", | ||||
|   "postVisibility": "Post Visibility", | ||||
|   "postVisibilityPublic": "Public", | ||||
|   "postVisibilityFriends": "Friends Only", | ||||
|   "postVisibilityUnlisted": "Unlisted", | ||||
| @@ -588,6 +590,7 @@ | ||||
|   "yes": "Yes", | ||||
|   "navigateToChat": "Navigate to Chat", | ||||
|   "wouldYouLikeToNavigateToChat": "Would You like to navigate to the chat?", | ||||
|   "abuseReports": "Abuse Reports", | ||||
|   "abuseReport": "Report", | ||||
|   "abuseReportTitle": "Report Content", | ||||
|   "abuseReportDescription": "Help us keep the community safe by reporting inappropriate content or behavior.", | ||||
| @@ -695,5 +698,9 @@ | ||||
|   "postForwardingTo": "Forwarding to", | ||||
|   "postReplyingTo": "Replying to", | ||||
|   "postEditing": "You are editing an existing post", | ||||
|   "postArticle": "Article" | ||||
|   "postArticle": "Article", | ||||
|   "aboutDeviceName": "Device Name", | ||||
|   "aboutDeviceIdentifier": "Device Identifier", | ||||
|   "donate": "Donate", | ||||
|   "donateDescription": "Support us to continue developing the Solar Network and keep the server up and running." | ||||
| } | ||||
| @@ -45,10 +45,10 @@ PODS: | ||||
|   - Firebase/Messaging (11.15.0): | ||||
|     - Firebase/CoreOnly | ||||
|     - FirebaseMessaging (~> 11.15.0) | ||||
|   - firebase_core (3.15.0): | ||||
|   - firebase_core (3.15.2): | ||||
|     - Firebase/CoreOnly (= 11.15.0) | ||||
|     - Flutter | ||||
|   - firebase_messaging (15.2.8): | ||||
|   - firebase_messaging (15.2.10): | ||||
|     - Firebase/Messaging (= 11.15.0) | ||||
|     - firebase_core | ||||
|     - Flutter | ||||
| @@ -130,7 +130,7 @@ PODS: | ||||
|     - Flutter | ||||
|   - irondash_engine_context (0.0.1): | ||||
|     - Flutter | ||||
|   - Kingfisher (8.3.3) | ||||
|   - Kingfisher (8.5.0) | ||||
|   - livekit_client (2.4.9): | ||||
|     - Flutter | ||||
|     - flutter_webrtc | ||||
| @@ -178,23 +178,23 @@ PODS: | ||||
|   - sqflite_darwin (0.0.4): | ||||
|     - Flutter | ||||
|     - FlutterMacOS | ||||
|   - sqlite3 (3.50.1): | ||||
|     - sqlite3/common (= 3.50.1) | ||||
|   - sqlite3/common (3.50.1) | ||||
|   - sqlite3/dbstatvtab (3.50.1): | ||||
|   - sqlite3 (3.50.3): | ||||
|     - sqlite3/common (= 3.50.3) | ||||
|   - sqlite3/common (3.50.3) | ||||
|   - sqlite3/dbstatvtab (3.50.3): | ||||
|     - sqlite3/common | ||||
|   - sqlite3/fts5 (3.50.1): | ||||
|   - sqlite3/fts5 (3.50.3): | ||||
|     - sqlite3/common | ||||
|   - sqlite3/math (3.50.1): | ||||
|   - sqlite3/math (3.50.3): | ||||
|     - sqlite3/common | ||||
|   - sqlite3/perf-threadsafe (3.50.1): | ||||
|   - sqlite3/perf-threadsafe (3.50.3): | ||||
|     - sqlite3/common | ||||
|   - sqlite3/rtree (3.50.1): | ||||
|   - sqlite3/rtree (3.50.3): | ||||
|     - sqlite3/common | ||||
|   - sqlite3_flutter_libs (0.0.1): | ||||
|     - Flutter | ||||
|     - FlutterMacOS | ||||
|     - sqlite3 (~> 3.50.1) | ||||
|     - sqlite3 (~> 3.50.3) | ||||
|     - sqlite3/dbstatvtab | ||||
|     - sqlite3/fts5 | ||||
|     - sqlite3/math | ||||
| @@ -362,8 +362,8 @@ SPEC CHECKSUMS: | ||||
|   DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60 | ||||
|   file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be | ||||
|   Firebase: d99ac19b909cd2c548339c2241ecd0d1599ab02e | ||||
|   firebase_core: c727a02c560a53f1f1e56e18f16515eb5753c492 | ||||
|   firebase_messaging: 4158969b04b667f5435731ec9d6e453bb58b0c4c | ||||
|   firebase_core: 995454a784ff288be5689b796deb9e9fa3601818 | ||||
|   firebase_messaging: f4a41dd102ac18b840eba3f39d67e77922d3f707 | ||||
|   FirebaseCore: efb3893e5b94f32b86e331e3bd6dadf18b66568e | ||||
|   FirebaseCoreInternal: 9afa45b1159304c963da48addb78275ef701c6b4 | ||||
|   FirebaseInstallations: 317270fec08a5d418fdbc8429282238cab3ac843 | ||||
| @@ -382,9 +382,9 @@ SPEC CHECKSUMS: | ||||
|   GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 | ||||
|   image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a | ||||
|   irondash_engine_context: 8e58ca8e0212ee9d1c7dc6a42121849986c88486 | ||||
|   Kingfisher: ff82cb91d9266ddb56cbb2f72d32c26f00d3e5be | ||||
|   Kingfisher: ff0d31a1f07bdff6a1ebb3ba08b8e6e567b6500c | ||||
|   livekit_client: 3f79d79233a5bd13d5b541732624ef959d7c538e | ||||
|   local_auth_darwin: 553ce4f9b16d3fdfeafce9cf042e7c9f77c1c391 | ||||
|   local_auth_darwin: d2e8c53ef0c4f43c646462e3415432c4dab3ae19 | ||||
|   media_kit_libs_ios_video: 5a18affdb97d1f5d466dc79988b13eff6c5e2854 | ||||
|   media_kit_video: 1746e198cb697d1ffb734b1d05ec429d1fcd1474 | ||||
|   nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 | ||||
| @@ -403,8 +403,8 @@ SPEC CHECKSUMS: | ||||
|   shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7 | ||||
|   sign_in_with_apple: c5dcc141574c8c54d5ac99dd2163c0c72ad22418 | ||||
|   sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0 | ||||
|   sqlite3: 1d85290c3321153511f6e900ede7a1608718bbd5 | ||||
|   sqlite3_flutter_libs: e7fc8c9ea2200ff3271f08f127842131746b70e2 | ||||
|   sqlite3: 83105acd294c9137c026e2da1931c30b4588ab81 | ||||
|   sqlite3_flutter_libs: ce0522d143cee6ef5e16587acfce8f476316e005 | ||||
|   super_native_extensions: b763c02dc3a8fd078389f410bf15149179020cb4 | ||||
|   SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 | ||||
|   url_launcher_ios: 694010445543906933d732453a59da0a173ae33d | ||||
|   | ||||
| @@ -772,6 +772,7 @@ | ||||
| 				ENABLE_BITCODE = NO; | ||||
| 				INFOPLIST_FILE = Runner/Info.plist; | ||||
| 				INFOPLIST_KEY_CFBundleDisplayName = Solian; | ||||
| 				INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking"; | ||||
| 				IPHONEOS_DEPLOYMENT_TARGET = 13.0; | ||||
| 				LD_RUNPATH_SEARCH_PATHS = ( | ||||
| 					"$(inherited)", | ||||
| @@ -1202,6 +1203,7 @@ | ||||
| 				ENABLE_BITCODE = NO; | ||||
| 				INFOPLIST_FILE = Runner/Info.plist; | ||||
| 				INFOPLIST_KEY_CFBundleDisplayName = Solian; | ||||
| 				INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking"; | ||||
| 				IPHONEOS_DEPLOYMENT_TARGET = 13.0; | ||||
| 				LD_RUNPATH_SEARCH_PATHS = ( | ||||
| 					"$(inherited)", | ||||
| @@ -1229,6 +1231,7 @@ | ||||
| 				ENABLE_BITCODE = NO; | ||||
| 				INFOPLIST_FILE = Runner/Info.plist; | ||||
| 				INFOPLIST_KEY_CFBundleDisplayName = Solian; | ||||
| 				INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking"; | ||||
| 				IPHONEOS_DEPLOYMENT_TARGET = 13.0; | ||||
| 				LD_RUNPATH_SEARCH_PATHS = ( | ||||
| 					"$(inherited)", | ||||
|   | ||||
| @@ -27,6 +27,7 @@ import UIKit | ||||
|         UNUserNotificationCenter.current().setNotificationCategories([replyableMessageCategory]) | ||||
|          | ||||
|         GeneratedPluginRegistrant.register(with: self) | ||||
|          | ||||
|         return super.application(application, didFinishLaunchingWithOptions: launchOptions) | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -1,8 +1,10 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> | ||||
|     <device id="retina6_12" orientation="portrait" appearance="light"/> | ||||
|     <dependencies> | ||||
|         <deployment identifier="iOS"/> | ||||
|         <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> | ||||
|         <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/> | ||||
|         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||||
|     </dependencies> | ||||
|     <scenes> | ||||
|         <!--Flutter View Controller--> | ||||
| @@ -14,13 +16,14 @@ | ||||
|                         <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> | ||||
|                     </layoutGuides> | ||||
|                     <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> | ||||
|                         <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> | ||||
|                         <rect key="frame" x="0.0" y="0.0" width="393" height="852"/> | ||||
|                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||||
|                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> | ||||
|                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||||
|                     </view> | ||||
|                 </viewController> | ||||
|                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> | ||||
|             </objects> | ||||
|             <point key="canvasLocation" x="-26" y="-76"/> | ||||
|         </scene> | ||||
|     </scenes> | ||||
| </document> | ||||
|   | ||||
| @@ -2,16 +2,10 @@ | ||||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||||
| <plist version="1.0"> | ||||
| <dict> | ||||
| 	<key>CLIENT_ID</key> | ||||
| 	<string>961776991058-stt7et4qvn3cpscl4r61gl1hnlatqkig.apps.googleusercontent.com</string> | ||||
| 	<key>REVERSED_CLIENT_ID</key> | ||||
| 	<string>com.googleusercontent.apps.961776991058-stt7et4qvn3cpscl4r61gl1hnlatqkig</string> | ||||
| 	<key>PLIST_VERSION</key> | ||||
| 	<string>1</string> | ||||
| 	<key>AppGroupId</key> | ||||
| 	<string>$(CUSTOM_GROUP_ID)</string> | ||||
| 	<key>BUNDLE_ID</key> | ||||
| 	<string>dev.solsynth.solian</string> | ||||
| 	<key>ITSAppUsesNonExemptEncryption</key> | ||||
| 	<false/> | ||||
| 	<key>CADisableMinimumFrameDurationOnPhone</key> | ||||
| 	<true/> | ||||
| 	<key>CFBundleDevelopmentRegion</key> | ||||
| @@ -32,31 +26,46 @@ | ||||
| 	<string>$(FLUTTER_BUILD_NAME)</string> | ||||
| 	<key>CFBundleSignature</key> | ||||
| 	<string>????</string> | ||||
| 	<key>CFBundleURLTypes</key> | ||||
| 	<array> | ||||
| 		<dict> | ||||
| 			<key>CFBundleTypeRole</key> | ||||
| 			<string>Editor</string> | ||||
| 			<key>CFBundleURLSchemes</key> | ||||
| 			<array> | ||||
| 				<string>ShareMedia-$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||||
| 			</array> | ||||
| 		</dict> | ||||
| 	</array> | ||||
| 	<key>CFBundleVersion</key> | ||||
| 	<string>$(FLUTTER_BUILD_NUMBER)</string> | ||||
|     <key>CFBundleURLTypes</key> | ||||
|     <array> | ||||
|         <dict> | ||||
|             <key>CFBundleTypeRole</key> | ||||
|             <string>Editor</string> | ||||
|             <key>CFBundleURLSchemes</key> | ||||
|             <array> | ||||
|                 <string>ShareMedia-$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||||
|             </array> | ||||
|         </dict> | ||||
|     </array> | ||||
| 	<key>CLIENT_ID</key> | ||||
| 	<string>961776991058-stt7et4qvn3cpscl4r61gl1hnlatqkig.apps.googleusercontent.com</string> | ||||
| 	<key>ITSAppUsesNonExemptEncryption</key> | ||||
| 	<false/> | ||||
| 	<key>LSRequiresIPhoneOS</key> | ||||
| 	<true/> | ||||
| 	<key>NSCalendarsUsageDescription</key> | ||||
| 	<string>Grant access to Calander help us to shows Solar Calander with your own events.</string> | ||||
| 	<key>NSCameraUsageDescription</key> | ||||
| 	<string>Grant access to Camera will allow Solian take photo or video for your post.</string> | ||||
| 	<key>NSFaceIDUsageDescription</key> | ||||
| 	<string>Allow the Solar Network verify your ownership of the logged in account and continue your action quickly.</string> | ||||
| 	<key>NSMicrophoneUsageDescription</key> | ||||
| 	<string>Grant access to Microphone will allow Solian record audio for your post.</string> | ||||
| 	<key>NSPhotoLibraryAddUsageDescription</key> | ||||
| 	<string>Grant access to Photo Library will allow Solian download photo to album for you.</string> | ||||
| 	<key>NSPhotoLibraryUsageDescription</key> | ||||
| 	<string>Grant access to Photo Library will allow Solian upload photo or video for your post.</string> | ||||
| 	<key>NSUserActivityTypes</key> | ||||
| 	<array> | ||||
| 		<string>INStartCallIntent</string> | ||||
| 		<string>INSendMessageIntent</string> | ||||
| 	</array> | ||||
| 	<key>PLIST_VERSION</key> | ||||
| 	<string>1</string> | ||||
| 	<key>REVERSED_CLIENT_ID</key> | ||||
| 	<string>com.googleusercontent.apps.961776991058-stt7et4qvn3cpscl4r61gl1hnlatqkig</string> | ||||
| 	<key>UIApplicationSupportsIndirectInputEvents</key> | ||||
| 	<true/> | ||||
| 	<key>UIBackgroundModes</key> | ||||
| @@ -74,25 +83,16 @@ | ||||
| 	<false/> | ||||
| 	<key>UISupportedInterfaceOrientations</key> | ||||
| 	<array> | ||||
| 		<string>UIInterfaceOrientationPortrait</string> | ||||
| 		<string>UIInterfaceOrientationLandscapeLeft</string> | ||||
| 		<string>UIInterfaceOrientationLandscapeRight</string> | ||||
| 		<string>UIInterfaceOrientationPortrait</string> | ||||
| 	</array> | ||||
| 	<key>UISupportedInterfaceOrientations~ipad</key> | ||||
| 	<array> | ||||
| 		<string>UIInterfaceOrientationPortrait</string> | ||||
| 		<string>UIInterfaceOrientationPortraitUpsideDown</string> | ||||
| 		<string>UIInterfaceOrientationLandscapeLeft</string> | ||||
| 		<string>UIInterfaceOrientationLandscapeRight</string> | ||||
| 	</array> | ||||
| 	<key>NSFaceIDUsageDescription</key> | ||||
| 	<string>Allow the Solar Network verify your ownership of the logged in account and continue your action quickly.</string> | ||||
| 	<key>AppGroupId</key> | ||||
| 	<string>$(CUSTOM_GROUP_ID)</string> | ||||
| 	<key>NSUserActivityTypes</key> | ||||
| 	<array> | ||||
| 		<string>INStartCallIntent</string> | ||||
| 		<string>INSendMessageIntent</string> | ||||
| 		<string>UIInterfaceOrientationPortrait</string> | ||||
| 		<string>UIInterfaceOrientationPortraitUpsideDown</string> | ||||
| 	</array> | ||||
| </dict> | ||||
| </plist> | ||||
|   | ||||
| @@ -38,7 +38,7 @@ class MessageRepository { | ||||
|     if (lastMessage == null) return false; | ||||
|     try { | ||||
|       final resp = await _apiClient.post( | ||||
|         '/chat/${room.id}/sync', | ||||
|         '/sphere/chat/${room.id}/sync', | ||||
|         data: { | ||||
|           'last_sync_timestamp': | ||||
|               lastMessage.toRemoteMessage().updatedAt.millisecondsSinceEpoch, | ||||
| @@ -154,7 +154,7 @@ class MessageRepository { | ||||
|     // Use cached total count if available, otherwise fetch it | ||||
|     if (_totalCount == null) { | ||||
|       final response = await _apiClient.get( | ||||
|         '/chat/$roomId/messages', | ||||
|         '/sphere/chat/$roomId/messages', | ||||
|         queryParameters: {'offset': 0, 'take': 1}, | ||||
|       ); | ||||
|       _totalCount = int.parse(response.headers['x-total']?.firstOrNull ?? '0'); | ||||
| @@ -165,7 +165,7 @@ class MessageRepository { | ||||
|     } | ||||
|  | ||||
|     final response = await _apiClient.get( | ||||
|       '/chat/$roomId/messages', | ||||
|       '/sphere/chat/$roomId/messages', | ||||
|       queryParameters: {'offset': offset, 'take': take}, | ||||
|     ); | ||||
|  | ||||
| @@ -269,8 +269,8 @@ class MessageRepository { | ||||
|       // Send to server | ||||
|       final response = await _apiClient.request( | ||||
|         editingTo == null | ||||
|             ? '/chat/$roomId/messages' | ||||
|             : '/chat/$roomId/messages/${editingTo.id}', | ||||
|             ? '/sphere/chat/$roomId/messages' | ||||
|             : '/sphere/chat/$roomId/messages/${editingTo.id}', | ||||
|         data: { | ||||
|           'content': content, | ||||
|           'attachments_id': cloudAttachments.map((e) => e.id).toList(), | ||||
| @@ -325,7 +325,7 @@ class MessageRepository { | ||||
|       // Send to server | ||||
|       var remoteMessage = message.toRemoteMessage(); | ||||
|       final response = await _apiClient.post( | ||||
|         '/chat/${message.roomId}/messages', | ||||
|         '/sphere/chat/${message.roomId}/messages', | ||||
|         data: { | ||||
|           'content': remoteMessage.content, | ||||
|           'attachments_id': remoteMessage.attachments, | ||||
| @@ -423,7 +423,7 @@ class MessageRepository { | ||||
|     try { | ||||
|       // Update on server | ||||
|       final response = await _apiClient.put( | ||||
|         '/chat/${room.id}/messages/$messageId', | ||||
|         '/sphere/chat/${room.id}/messages/$messageId', | ||||
|         data: {'content': content, 'attachments': attachments, 'meta': meta}, | ||||
|       ); | ||||
|  | ||||
| @@ -444,7 +444,7 @@ class MessageRepository { | ||||
|  | ||||
|   Future<void> deleteMessage(String messageId) async { | ||||
|     try { | ||||
|       await _apiClient.delete('/chat/${room.id}/messages/$messageId'); | ||||
|       await _apiClient.delete('/sphere/chat/${room.id}/messages/$messageId'); | ||||
|       pendingMessages.remove(messageId); | ||||
|       await _database.deleteMessage(messageId); | ||||
|     } catch (e) { | ||||
| @@ -464,7 +464,7 @@ class MessageRepository { | ||||
|  | ||||
|       // If not found locally, fetch from the server | ||||
|       final response = await _apiClient.get( | ||||
|         '/chat/${room.id}/messages/$messageId', | ||||
|         '/sphere/chat/${room.id}/messages/$messageId', | ||||
|       ); | ||||
|       final remoteMessage = SnChatMessage.fromJson(response.data); | ||||
|       final message = LocalChatMessage.fromRemoteMessage( | ||||
|   | ||||
							
								
								
									
										23
									
								
								lib/models/abuse_report.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								lib/models/abuse_report.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| import 'package:freezed_annotation/freezed_annotation.dart'; | ||||
|  | ||||
| part 'abuse_report.freezed.dart'; | ||||
| part 'abuse_report.g.dart'; | ||||
|  | ||||
| @freezed | ||||
| sealed class SnAbuseReport with _$SnAbuseReport { | ||||
|   const factory SnAbuseReport({ | ||||
|     required String id, | ||||
|     required String resourceIdentifier, | ||||
|     required int type, | ||||
|     required String reason, | ||||
|     required DateTime? resolvedAt, | ||||
|     required String? resolution, | ||||
|     required String accountId, | ||||
|     required DateTime createdAt, | ||||
|     required DateTime updatedAt, | ||||
|     required DateTime? deletedAt, | ||||
|   }) = _SnAbuseReport; | ||||
|  | ||||
|   factory SnAbuseReport.fromJson(Map<String, dynamic> json) => | ||||
|       _$SnAbuseReportFromJson(json); | ||||
| } | ||||
							
								
								
									
										298
									
								
								lib/models/abuse_report.freezed.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										298
									
								
								lib/models/abuse_report.freezed.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,298 @@ | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // ignore_for_file: type=lint | ||||
| // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark | ||||
|  | ||||
| part of 'abuse_report.dart'; | ||||
|  | ||||
| // ************************************************************************** | ||||
| // FreezedGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| // dart format off | ||||
| T _$identity<T>(T value) => value; | ||||
|  | ||||
| /// @nodoc | ||||
| mixin _$SnAbuseReport { | ||||
|  | ||||
|  String get id; String get resourceIdentifier; int get type; String get reason; DateTime? get resolvedAt; String? get resolution; String get accountId; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; | ||||
| /// Create a copy of SnAbuseReport | ||||
| /// with the given fields replaced by the non-null parameter values. | ||||
| @JsonKey(includeFromJson: false, includeToJson: false) | ||||
| @pragma('vm:prefer-inline') | ||||
| $SnAbuseReportCopyWith<SnAbuseReport> get copyWith => _$SnAbuseReportCopyWithImpl<SnAbuseReport>(this as SnAbuseReport, _$identity); | ||||
|  | ||||
|   /// Serializes this SnAbuseReport to a JSON map. | ||||
|   Map<String, dynamic> toJson(); | ||||
|  | ||||
|  | ||||
| @override | ||||
| bool operator ==(Object other) { | ||||
|   return identical(this, other) || (other.runtimeType == runtimeType&&other is SnAbuseReport&&(identical(other.id, id) || other.id == id)&&(identical(other.resourceIdentifier, resourceIdentifier) || other.resourceIdentifier == resourceIdentifier)&&(identical(other.type, type) || other.type == type)&&(identical(other.reason, reason) || other.reason == reason)&&(identical(other.resolvedAt, resolvedAt) || other.resolvedAt == resolvedAt)&&(identical(other.resolution, resolution) || other.resolution == resolution)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)); | ||||
| } | ||||
|  | ||||
| @JsonKey(includeFromJson: false, includeToJson: false) | ||||
| @override | ||||
| int get hashCode => Object.hash(runtimeType,id,resourceIdentifier,type,reason,resolvedAt,resolution,accountId,createdAt,updatedAt,deletedAt); | ||||
|  | ||||
| @override | ||||
| String toString() { | ||||
|   return 'SnAbuseReport(id: $id, resourceIdentifier: $resourceIdentifier, type: $type, reason: $reason, resolvedAt: $resolvedAt, resolution: $resolution, accountId: $accountId, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)'; | ||||
| } | ||||
|  | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| abstract mixin class $SnAbuseReportCopyWith<$Res>  { | ||||
|   factory $SnAbuseReportCopyWith(SnAbuseReport value, $Res Function(SnAbuseReport) _then) = _$SnAbuseReportCopyWithImpl; | ||||
| @useResult | ||||
| $Res call({ | ||||
|  String id, String resourceIdentifier, int type, String reason, DateTime? resolvedAt, String? resolution, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt | ||||
| }); | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| } | ||||
| /// @nodoc | ||||
| class _$SnAbuseReportCopyWithImpl<$Res> | ||||
|     implements $SnAbuseReportCopyWith<$Res> { | ||||
|   _$SnAbuseReportCopyWithImpl(this._self, this._then); | ||||
|  | ||||
|   final SnAbuseReport _self; | ||||
|   final $Res Function(SnAbuseReport) _then; | ||||
|  | ||||
| /// Create a copy of SnAbuseReport | ||||
| /// with the given fields replaced by the non-null parameter values. | ||||
| @pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? resourceIdentifier = null,Object? type = null,Object? reason = null,Object? resolvedAt = freezed,Object? resolution = freezed,Object? accountId = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { | ||||
|   return _then(_self.copyWith( | ||||
| id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable | ||||
| as String,resourceIdentifier: null == resourceIdentifier ? _self.resourceIdentifier : resourceIdentifier // ignore: cast_nullable_to_non_nullable | ||||
| as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable | ||||
| as int,reason: null == reason ? _self.reason : reason // ignore: cast_nullable_to_non_nullable | ||||
| as String,resolvedAt: freezed == resolvedAt ? _self.resolvedAt : resolvedAt // ignore: cast_nullable_to_non_nullable | ||||
| as DateTime?,resolution: freezed == resolution ? _self.resolution : resolution // ignore: cast_nullable_to_non_nullable | ||||
| as String?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable | ||||
| as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable | ||||
| as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable | ||||
| as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable | ||||
| as DateTime?, | ||||
|   )); | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnAbuseReport]. | ||||
| extension SnAbuseReportPatterns on SnAbuseReport { | ||||
| /// 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( _SnAbuseReport value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAbuseReport() 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( _SnAbuseReport value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAbuseReport(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnAbuseReport value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAbuseReport() 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 id,  String resourceIdentifier,  int type,  String reason,  DateTime? resolvedAt,  String? resolution,  String accountId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAbuseReport() when $default != null: | ||||
| return $default(_that.id,_that.resourceIdentifier,_that.type,_that.reason,_that.resolvedAt,_that.resolution,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  String resourceIdentifier,  int type,  String reason,  DateTime? resolvedAt,  String? resolution,  String accountId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAbuseReport(): | ||||
| return $default(_that.id,_that.resourceIdentifier,_that.type,_that.reason,_that.resolvedAt,_that.resolution,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  String resourceIdentifier,  int type,  String reason,  DateTime? resolvedAt,  String? resolution,  String accountId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAbuseReport() when $default != null: | ||||
| return $default(_that.id,_that.resourceIdentifier,_that.type,_that.reason,_that.resolvedAt,_that.resolution,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| class _SnAbuseReport implements SnAbuseReport { | ||||
|   const _SnAbuseReport({required this.id, required this.resourceIdentifier, required this.type, required this.reason, required this.resolvedAt, required this.resolution, required this.accountId, required this.createdAt, required this.updatedAt, required this.deletedAt}); | ||||
|   factory _SnAbuseReport.fromJson(Map<String, dynamic> json) => _$SnAbuseReportFromJson(json); | ||||
|  | ||||
| @override final  String id; | ||||
| @override final  String resourceIdentifier; | ||||
| @override final  int type; | ||||
| @override final  String reason; | ||||
| @override final  DateTime? resolvedAt; | ||||
| @override final  String? resolution; | ||||
| @override final  String accountId; | ||||
| @override final  DateTime createdAt; | ||||
| @override final  DateTime updatedAt; | ||||
| @override final  DateTime? deletedAt; | ||||
|  | ||||
| /// Create a copy of SnAbuseReport | ||||
| /// with the given fields replaced by the non-null parameter values. | ||||
| @override @JsonKey(includeFromJson: false, includeToJson: false) | ||||
| @pragma('vm:prefer-inline') | ||||
| _$SnAbuseReportCopyWith<_SnAbuseReport> get copyWith => __$SnAbuseReportCopyWithImpl<_SnAbuseReport>(this, _$identity); | ||||
|  | ||||
| @override | ||||
| Map<String, dynamic> toJson() { | ||||
|   return _$SnAbuseReportToJson(this, ); | ||||
| } | ||||
|  | ||||
| @override | ||||
| bool operator ==(Object other) { | ||||
|   return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnAbuseReport&&(identical(other.id, id) || other.id == id)&&(identical(other.resourceIdentifier, resourceIdentifier) || other.resourceIdentifier == resourceIdentifier)&&(identical(other.type, type) || other.type == type)&&(identical(other.reason, reason) || other.reason == reason)&&(identical(other.resolvedAt, resolvedAt) || other.resolvedAt == resolvedAt)&&(identical(other.resolution, resolution) || other.resolution == resolution)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)); | ||||
| } | ||||
|  | ||||
| @JsonKey(includeFromJson: false, includeToJson: false) | ||||
| @override | ||||
| int get hashCode => Object.hash(runtimeType,id,resourceIdentifier,type,reason,resolvedAt,resolution,accountId,createdAt,updatedAt,deletedAt); | ||||
|  | ||||
| @override | ||||
| String toString() { | ||||
|   return 'SnAbuseReport(id: $id, resourceIdentifier: $resourceIdentifier, type: $type, reason: $reason, resolvedAt: $resolvedAt, resolution: $resolution, accountId: $accountId, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt)'; | ||||
| } | ||||
|  | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| abstract mixin class _$SnAbuseReportCopyWith<$Res> implements $SnAbuseReportCopyWith<$Res> { | ||||
|   factory _$SnAbuseReportCopyWith(_SnAbuseReport value, $Res Function(_SnAbuseReport) _then) = __$SnAbuseReportCopyWithImpl; | ||||
| @override @useResult | ||||
| $Res call({ | ||||
|  String id, String resourceIdentifier, int type, String reason, DateTime? resolvedAt, String? resolution, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt | ||||
| }); | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| } | ||||
| /// @nodoc | ||||
| class __$SnAbuseReportCopyWithImpl<$Res> | ||||
|     implements _$SnAbuseReportCopyWith<$Res> { | ||||
|   __$SnAbuseReportCopyWithImpl(this._self, this._then); | ||||
|  | ||||
|   final _SnAbuseReport _self; | ||||
|   final $Res Function(_SnAbuseReport) _then; | ||||
|  | ||||
| /// Create a copy of SnAbuseReport | ||||
| /// with the given fields replaced by the non-null parameter values. | ||||
| @override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? resourceIdentifier = null,Object? type = null,Object? reason = null,Object? resolvedAt = freezed,Object? resolution = freezed,Object? accountId = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { | ||||
|   return _then(_SnAbuseReport( | ||||
| id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable | ||||
| as String,resourceIdentifier: null == resourceIdentifier ? _self.resourceIdentifier : resourceIdentifier // ignore: cast_nullable_to_non_nullable | ||||
| as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable | ||||
| as int,reason: null == reason ? _self.reason : reason // ignore: cast_nullable_to_non_nullable | ||||
| as String,resolvedAt: freezed == resolvedAt ? _self.resolvedAt : resolvedAt // ignore: cast_nullable_to_non_nullable | ||||
| as DateTime?,resolution: freezed == resolution ? _self.resolution : resolution // ignore: cast_nullable_to_non_nullable | ||||
| as String?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable | ||||
| as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable | ||||
| as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable | ||||
| as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable | ||||
| as DateTime?, | ||||
|   )); | ||||
| } | ||||
|  | ||||
|  | ||||
| } | ||||
|  | ||||
| // dart format on | ||||
							
								
								
									
										41
									
								
								lib/models/abuse_report.g.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								lib/models/abuse_report.g.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,41 @@ | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
|  | ||||
| part of 'abuse_report.dart'; | ||||
|  | ||||
| // ************************************************************************** | ||||
| // JsonSerializableGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| _SnAbuseReport _$SnAbuseReportFromJson(Map<String, dynamic> json) => | ||||
|     _SnAbuseReport( | ||||
|       id: json['id'] as String, | ||||
|       resourceIdentifier: json['resource_identifier'] as String, | ||||
|       type: (json['type'] as num).toInt(), | ||||
|       reason: json['reason'] as String, | ||||
|       resolvedAt: | ||||
|           json['resolved_at'] == null | ||||
|               ? null | ||||
|               : DateTime.parse(json['resolved_at'] as String), | ||||
|       resolution: json['resolution'] as String?, | ||||
|       accountId: json['account_id'] as String, | ||||
|       createdAt: DateTime.parse(json['created_at'] as String), | ||||
|       updatedAt: DateTime.parse(json['updated_at'] as String), | ||||
|       deletedAt: | ||||
|           json['deleted_at'] == null | ||||
|               ? null | ||||
|               : DateTime.parse(json['deleted_at'] as String), | ||||
|     ); | ||||
|  | ||||
| Map<String, dynamic> _$SnAbuseReportToJson(_SnAbuseReport instance) => | ||||
|     <String, dynamic>{ | ||||
|       'id': instance.id, | ||||
|       'resource_identifier': instance.resourceIdentifier, | ||||
|       'type': instance.type, | ||||
|       'reason': instance.reason, | ||||
|       'resolved_at': instance.resolvedAt?.toIso8601String(), | ||||
|       'resolution': instance.resolution, | ||||
|       'account_id': instance.accountId, | ||||
|       'created_at': instance.createdAt.toIso8601String(), | ||||
|       'updated_at': instance.updatedAt.toIso8601String(), | ||||
|       'deleted_at': instance.deletedAt?.toIso8601String(), | ||||
|     }; | ||||
							
								
								
									
										38
									
								
								lib/models/abuse_report_type.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								lib/models/abuse_report_type.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| enum AbuseReportType { | ||||
|   copyright(0), | ||||
|   harassment(1), | ||||
|   impersonation(2), | ||||
|   offensiveContent(3), | ||||
|   spam(4), | ||||
|   privacyViolation(5), | ||||
|   illegalContent(6), | ||||
|   other(7); | ||||
|  | ||||
|   const AbuseReportType(this.value); | ||||
|   final int value; | ||||
|  | ||||
|   static AbuseReportType fromValue(int value) { | ||||
|     return values.firstWhere((e) => e.value == value); | ||||
|   } | ||||
|  | ||||
|   String get displayName { | ||||
|     switch (this) { | ||||
|       case AbuseReportType.copyright: | ||||
|         return 'Copyright'; | ||||
|       case AbuseReportType.harassment: | ||||
|         return 'Harassment'; | ||||
|       case AbuseReportType.impersonation: | ||||
|         return 'Impersonation'; | ||||
|       case AbuseReportType.offensiveContent: | ||||
|         return 'Offensive Content'; | ||||
|       case AbuseReportType.spam: | ||||
|         return 'Spam'; | ||||
|       case AbuseReportType.privacyViolation: | ||||
|         return 'Privacy Violation'; | ||||
|       case AbuseReportType.illegalContent: | ||||
|         return 'Illegal Content'; | ||||
|       case AbuseReportType.other: | ||||
|         return 'Other'; | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -82,6 +81,130 @@ as DateTime?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnActivity]. | ||||
| extension SnActivityPatterns on SnActivity { | ||||
| /// 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( _SnActivity value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnActivity() 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( _SnActivity value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnActivity(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnActivity value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnActivity() 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 id,  String type,  String resourceIdentifier,  dynamic data,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnActivity() when $default != null: | ||||
| return $default(_that.id,_that.type,_that.resourceIdentifier,_that.data,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  String type,  String resourceIdentifier,  dynamic data,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnActivity(): | ||||
| return $default(_that.id,_that.type,_that.resourceIdentifier,_that.data,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  String type,  String resourceIdentifier,  dynamic data,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnActivity() when $default != null: | ||||
| return $default(_that.id,_that.type,_that.resourceIdentifier,_that.data,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -246,6 +369,130 @@ $SnAccountCopyWith<$Res>? get account { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnCheckInResult]. | ||||
| extension SnCheckInResultPatterns on SnCheckInResult { | ||||
| /// 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( _SnCheckInResult value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnCheckInResult() 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( _SnCheckInResult value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnCheckInResult(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnCheckInResult value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnCheckInResult() 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 id,  int level,  List<SnFortuneTip> tips,  String accountId,  SnAccount? account,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnCheckInResult() when $default != null: | ||||
| return $default(_that.id,_that.level,_that.tips,_that.accountId,_that.account,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  int level,  List<SnFortuneTip> tips,  String accountId,  SnAccount? account,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnCheckInResult(): | ||||
| return $default(_that.id,_that.level,_that.tips,_that.accountId,_that.account,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  int level,  List<SnFortuneTip> tips,  String accountId,  SnAccount? account,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnCheckInResult() when $default != null: | ||||
| return $default(_that.id,_that.level,_that.tips,_that.accountId,_that.account,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -413,6 +660,130 @@ as String, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnFortuneTip]. | ||||
| extension SnFortuneTipPatterns on SnFortuneTip { | ||||
| /// 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( _SnFortuneTip value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnFortuneTip() 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( _SnFortuneTip value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnFortuneTip(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnFortuneTip value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnFortuneTip() 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 isPositive,  String title,  String content)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnFortuneTip() when $default != null: | ||||
| return $default(_that.isPositive,_that.title,_that.content);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 isPositive,  String title,  String content)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnFortuneTip(): | ||||
| return $default(_that.isPositive,_that.title,_that.content);} | ||||
| } | ||||
| /// 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 isPositive,  String title,  String content)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnFortuneTip() when $default != null: | ||||
| return $default(_that.isPositive,_that.title,_that.content);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -564,6 +935,130 @@ $SnCheckInResultCopyWith<$Res>? get checkInResult { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnEventCalendarEntry]. | ||||
| extension SnEventCalendarEntryPatterns on SnEventCalendarEntry { | ||||
| /// 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( _SnEventCalendarEntry value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnEventCalendarEntry() 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( _SnEventCalendarEntry value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnEventCalendarEntry(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnEventCalendarEntry value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnEventCalendarEntry() 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( DateTime date,  SnCheckInResult? checkInResult,  List<dynamic> statuses)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnEventCalendarEntry() when $default != null: | ||||
| return $default(_that.date,_that.checkInResult,_that.statuses);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( DateTime date,  SnCheckInResult? checkInResult,  List<dynamic> statuses)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnEventCalendarEntry(): | ||||
| return $default(_that.date,_that.checkInResult,_that.statuses);} | ||||
| } | ||||
| /// 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( DateTime date,  SnCheckInResult? checkInResult,  List<dynamic> statuses)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnEventCalendarEntry() when $default != null: | ||||
| return $default(_that.date,_that.checkInResult,_that.statuses);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -76,6 +75,130 @@ as String, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [AppToken]. | ||||
| extension AppTokenPatterns on AppToken { | ||||
| /// 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( _AppToken value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _AppToken() 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( _AppToken value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _AppToken(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _AppToken value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _AppToken() 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 token)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _AppToken() when $default != null: | ||||
| return $default(_that.token);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 token)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _AppToken(): | ||||
| return $default(_that.token);} | ||||
| } | ||||
| /// 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 token)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _AppToken() when $default != null: | ||||
| return $default(_that.token);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -227,6 +350,130 @@ as DateTime?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnAuthChallenge]. | ||||
| extension SnAuthChallengePatterns on SnAuthChallenge { | ||||
| /// 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( _SnAuthChallenge value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthChallenge() 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( _SnAuthChallenge value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthChallenge(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnAuthChallenge value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthChallenge() 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 id,  DateTime expiredAt,  int stepRemain,  int stepTotal,  int failedAttempts,  int platform,  int type,  List<String> blacklistFactors,  List<dynamic> audiences,  List<dynamic> scopes,  String ipAddress,  String userAgent,  String deviceId,  String? nonce,  String? location,  String accountId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthChallenge() when $default != null: | ||||
| return $default(_that.id,_that.expiredAt,_that.stepRemain,_that.stepTotal,_that.failedAttempts,_that.platform,_that.type,_that.blacklistFactors,_that.audiences,_that.scopes,_that.ipAddress,_that.userAgent,_that.deviceId,_that.nonce,_that.location,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  DateTime expiredAt,  int stepRemain,  int stepTotal,  int failedAttempts,  int platform,  int type,  List<String> blacklistFactors,  List<dynamic> audiences,  List<dynamic> scopes,  String ipAddress,  String userAgent,  String deviceId,  String? nonce,  String? location,  String accountId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthChallenge(): | ||||
| return $default(_that.id,_that.expiredAt,_that.stepRemain,_that.stepTotal,_that.failedAttempts,_that.platform,_that.type,_that.blacklistFactors,_that.audiences,_that.scopes,_that.ipAddress,_that.userAgent,_that.deviceId,_that.nonce,_that.location,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  DateTime expiredAt,  int stepRemain,  int stepTotal,  int failedAttempts,  int platform,  int type,  List<String> blacklistFactors,  List<dynamic> audiences,  List<dynamic> scopes,  String ipAddress,  String userAgent,  String deviceId,  String? nonce,  String? location,  String accountId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthChallenge() when $default != null: | ||||
| return $default(_that.id,_that.expiredAt,_that.stepRemain,_that.stepTotal,_that.failedAttempts,_that.platform,_that.type,_that.blacklistFactors,_that.audiences,_that.scopes,_that.ipAddress,_that.userAgent,_that.deviceId,_that.nonce,_that.location,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -432,6 +679,130 @@ $SnAuthChallengeCopyWith<$Res> get challenge { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnAuthSession]. | ||||
| extension SnAuthSessionPatterns on SnAuthSession { | ||||
| /// 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( _SnAuthSession value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthSession() 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( _SnAuthSession value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthSession(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnAuthSession value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthSession() 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 id,  String? label,  DateTime lastGrantedAt,  DateTime expiredAt,  String accountId,  String challengeId,  SnAuthChallenge challenge,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthSession() when $default != null: | ||||
| return $default(_that.id,_that.label,_that.lastGrantedAt,_that.expiredAt,_that.accountId,_that.challengeId,_that.challenge,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  String? label,  DateTime lastGrantedAt,  DateTime expiredAt,  String accountId,  String challengeId,  SnAuthChallenge challenge,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthSession(): | ||||
| return $default(_that.id,_that.label,_that.lastGrantedAt,_that.expiredAt,_that.accountId,_that.challengeId,_that.challenge,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  String? label,  DateTime lastGrantedAt,  DateTime expiredAt,  String accountId,  String challengeId,  SnAuthChallenge challenge,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthSession() when $default != null: | ||||
| return $default(_that.id,_that.label,_that.lastGrantedAt,_that.expiredAt,_that.accountId,_that.challengeId,_that.challenge,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -600,6 +971,130 @@ as Map<String, dynamic>?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnAuthFactor]. | ||||
| extension SnAuthFactorPatterns on SnAuthFactor { | ||||
| /// 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( _SnAuthFactor value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthFactor() 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( _SnAuthFactor value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthFactor(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnAuthFactor value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthFactor() 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 id,  int type,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt,  DateTime? expiredAt,  DateTime? enabledAt,  int trustworthy,  Map<String, dynamic>? createdResponse)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthFactor() when $default != null: | ||||
| return $default(_that.id,_that.type,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.expiredAt,_that.enabledAt,_that.trustworthy,_that.createdResponse);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 id,  int type,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt,  DateTime? expiredAt,  DateTime? enabledAt,  int trustworthy,  Map<String, dynamic>? createdResponse)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthFactor(): | ||||
| return $default(_that.id,_that.type,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.expiredAt,_that.enabledAt,_that.trustworthy,_that.createdResponse);} | ||||
| } | ||||
| /// 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 id,  int type,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt,  DateTime? expiredAt,  DateTime? enabledAt,  int trustworthy,  Map<String, dynamic>? createdResponse)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthFactor() when $default != null: | ||||
| return $default(_that.id,_that.type,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.expiredAt,_that.enabledAt,_that.trustworthy,_that.createdResponse);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -763,6 +1258,130 @@ as bool, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnAuthDevice]. | ||||
| extension SnAuthDevicePatterns on SnAuthDevice { | ||||
| /// 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( _SnAuthDevice value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthDevice() 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( _SnAuthDevice value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthDevice(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnAuthDevice value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthDevice() 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( dynamic label,  String userAgent,  String deviceId,  int platform,  List<SnAuthSession> sessions,  bool isCurrent)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthDevice() when $default != null: | ||||
| return $default(_that.label,_that.userAgent,_that.deviceId,_that.platform,_that.sessions,_that.isCurrent);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( dynamic label,  String userAgent,  String deviceId,  int platform,  List<SnAuthSession> sessions,  bool isCurrent)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthDevice(): | ||||
| return $default(_that.label,_that.userAgent,_that.deviceId,_that.platform,_that.sessions,_that.isCurrent);} | ||||
| } | ||||
| /// 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( dynamic label,  String userAgent,  String deviceId,  int platform,  List<SnAuthSession> sessions,  bool isCurrent)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAuthDevice() when $default != null: | ||||
| return $default(_that.label,_that.userAgent,_that.deviceId,_that.platform,_that.sessions,_that.isCurrent);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -921,6 +1540,130 @@ as DateTime?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnAccountConnection]. | ||||
| extension SnAccountConnectionPatterns on SnAccountConnection { | ||||
| /// 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( _SnAccountConnection value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAccountConnection() 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( _SnAccountConnection value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAccountConnection(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnAccountConnection value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAccountConnection() 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 id,  String accountId,  String provider,  String providedIdentifier,  Map<String, dynamic> meta,  DateTime lastUsedAt,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAccountConnection() when $default != null: | ||||
| return $default(_that.id,_that.accountId,_that.provider,_that.providedIdentifier,_that.meta,_that.lastUsedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  String accountId,  String provider,  String providedIdentifier,  Map<String, dynamic> meta,  DateTime lastUsedAt,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAccountConnection(): | ||||
| return $default(_that.id,_that.accountId,_that.provider,_that.providedIdentifier,_that.meta,_that.lastUsedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  String accountId,  String provider,  String providedIdentifier,  Map<String, dynamic> meta,  DateTime lastUsedAt,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnAccountConnection() when $default != null: | ||||
| return $default(_that.id,_that.accountId,_that.provider,_that.providedIdentifier,_that.meta,_that.lastUsedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -100,6 +99,136 @@ as List<AutoCompletionItem>, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [AutoCompletionResponse]. | ||||
| extension AutoCompletionResponsePatterns on AutoCompletionResponse { | ||||
| /// 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( AutoCompletionAccountResponse value)?  account,TResult Function( AutoCompletionStickerResponse value)?  sticker,required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case AutoCompletionAccountResponse() when account != null: | ||||
| return account(_that);case AutoCompletionStickerResponse() when sticker != null: | ||||
| return sticker(_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?>({required TResult Function( AutoCompletionAccountResponse value)  account,required TResult Function( AutoCompletionStickerResponse value)  sticker,}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case AutoCompletionAccountResponse(): | ||||
| return account(_that);case AutoCompletionStickerResponse(): | ||||
| return sticker(_that);} | ||||
| } | ||||
| /// 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( AutoCompletionAccountResponse value)?  account,TResult? Function( AutoCompletionStickerResponse value)?  sticker,}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case AutoCompletionAccountResponse() when account != null: | ||||
| return account(_that);case AutoCompletionStickerResponse() when sticker != null: | ||||
| return sticker(_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 type,  List<AutoCompletionItem> items)?  account,TResult Function( String type,  List<AutoCompletionItem> items)?  sticker,required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case AutoCompletionAccountResponse() when account != null: | ||||
| return account(_that.type,_that.items);case AutoCompletionStickerResponse() when sticker != null: | ||||
| return sticker(_that.type,_that.items);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?>({required TResult Function( String type,  List<AutoCompletionItem> items)  account,required TResult Function( String type,  List<AutoCompletionItem> items)  sticker,}) {final _that = this; | ||||
| switch (_that) { | ||||
| case AutoCompletionAccountResponse(): | ||||
| return account(_that.type,_that.items);case AutoCompletionStickerResponse(): | ||||
| return sticker(_that.type,_that.items);} | ||||
| } | ||||
| /// 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 type,  List<AutoCompletionItem> items)?  account,TResult? Function( String type,  List<AutoCompletionItem> items)?  sticker,}) {final _that = this; | ||||
| switch (_that) { | ||||
| case AutoCompletionAccountResponse() when account != null: | ||||
| return account(_that.type,_that.items);case AutoCompletionStickerResponse() when sticker != null: | ||||
| return sticker(_that.type,_that.items);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -330,6 +459,130 @@ as dynamic, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [AutoCompletionItem]. | ||||
| extension AutoCompletionItemPatterns on AutoCompletionItem { | ||||
| /// 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( _AutoCompletionItem value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _AutoCompletionItem() 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( _AutoCompletionItem value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _AutoCompletionItem(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _AutoCompletionItem value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _AutoCompletionItem() 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 id,  String displayName,  String? secondaryText,  String type,  dynamic data)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _AutoCompletionItem() when $default != null: | ||||
| return $default(_that.id,_that.displayName,_that.secondaryText,_that.type,_that.data);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 id,  String displayName,  String? secondaryText,  String type,  dynamic data)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _AutoCompletionItem(): | ||||
| return $default(_that.id,_that.displayName,_that.secondaryText,_that.type,_that.data);} | ||||
| } | ||||
| /// 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 id,  String displayName,  String? secondaryText,  String type,  dynamic data)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _AutoCompletionItem() when $default != null: | ||||
| return $default(_that.id,_that.displayName,_that.secondaryText,_that.type,_that.data);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -147,6 +146,130 @@ $CustomAppLinksCopyWith<$Res>? get links { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [CustomApp]. | ||||
| extension CustomAppPatterns on CustomApp { | ||||
| /// 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( _CustomApp value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomApp() 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( _CustomApp value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomApp(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _CustomApp value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomApp() 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 id,  String slug,  String name,  String? description,  int status,  SnCloudFile? picture,  SnCloudFile? background,  SnVerificationMark? verification,  CustomAppOauthConfig? oauthConfig,  CustomAppLinks? links,  List<CustomAppSecret> secrets,  String publisherId)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomApp() when $default != null: | ||||
| return $default(_that.id,_that.slug,_that.name,_that.description,_that.status,_that.picture,_that.background,_that.verification,_that.oauthConfig,_that.links,_that.secrets,_that.publisherId);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 id,  String slug,  String name,  String? description,  int status,  SnCloudFile? picture,  SnCloudFile? background,  SnVerificationMark? verification,  CustomAppOauthConfig? oauthConfig,  CustomAppLinks? links,  List<CustomAppSecret> secrets,  String publisherId)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomApp(): | ||||
| return $default(_that.id,_that.slug,_that.name,_that.description,_that.status,_that.picture,_that.background,_that.verification,_that.oauthConfig,_that.links,_that.secrets,_that.publisherId);} | ||||
| } | ||||
| /// 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 id,  String slug,  String name,  String? description,  int status,  SnCloudFile? picture,  SnCloudFile? background,  SnVerificationMark? verification,  CustomAppOauthConfig? oauthConfig,  CustomAppLinks? links,  List<CustomAppSecret> secrets,  String publisherId)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomApp() when $default != null: | ||||
| return $default(_that.id,_that.slug,_that.name,_that.description,_that.status,_that.picture,_that.background,_that.verification,_that.oauthConfig,_that.links,_that.secrets,_that.publisherId);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -370,6 +493,130 @@ as String?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [CustomAppLinks]. | ||||
| extension CustomAppLinksPatterns on CustomAppLinks { | ||||
| /// 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( _CustomAppLinks value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppLinks() 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( _CustomAppLinks value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppLinks(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _CustomAppLinks value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppLinks() 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? homePage,  String? privacyPolicy,  String? termsOfService)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppLinks() when $default != null: | ||||
| return $default(_that.homePage,_that.privacyPolicy,_that.termsOfService);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? homePage,  String? privacyPolicy,  String? termsOfService)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppLinks(): | ||||
| return $default(_that.homePage,_that.privacyPolicy,_that.termsOfService);} | ||||
| } | ||||
| /// 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? homePage,  String? privacyPolicy,  String? termsOfService)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppLinks() when $default != null: | ||||
| return $default(_that.homePage,_that.privacyPolicy,_that.termsOfService);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -513,6 +760,130 @@ as bool, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [CustomAppOauthConfig]. | ||||
| extension CustomAppOauthConfigPatterns on CustomAppOauthConfig { | ||||
| /// 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( _CustomAppOauthConfig value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppOauthConfig() 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( _CustomAppOauthConfig value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppOauthConfig(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _CustomAppOauthConfig value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppOauthConfig() 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? clientUri,  List<String> redirectUris,  List<String>? postLogoutRedirectUris,  List<String> allowedScopes,  List<String> allowedGrantTypes,  bool requirePkce,  bool allowOfflineAccess)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppOauthConfig() when $default != null: | ||||
| return $default(_that.clientUri,_that.redirectUris,_that.postLogoutRedirectUris,_that.allowedScopes,_that.allowedGrantTypes,_that.requirePkce,_that.allowOfflineAccess);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? clientUri,  List<String> redirectUris,  List<String>? postLogoutRedirectUris,  List<String> allowedScopes,  List<String> allowedGrantTypes,  bool requirePkce,  bool allowOfflineAccess)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppOauthConfig(): | ||||
| return $default(_that.clientUri,_that.redirectUris,_that.postLogoutRedirectUris,_that.allowedScopes,_that.allowedGrantTypes,_that.requirePkce,_that.allowOfflineAccess);} | ||||
| } | ||||
| /// 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? clientUri,  List<String> redirectUris,  List<String>? postLogoutRedirectUris,  List<String> allowedScopes,  List<String> allowedGrantTypes,  bool requirePkce,  bool allowOfflineAccess)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppOauthConfig() when $default != null: | ||||
| return $default(_that.clientUri,_that.redirectUris,_that.postLogoutRedirectUris,_that.allowedScopes,_that.allowedGrantTypes,_that.requirePkce,_that.allowOfflineAccess);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -689,6 +1060,130 @@ as String, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [CustomAppSecret]. | ||||
| extension CustomAppSecretPatterns on CustomAppSecret { | ||||
| /// 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( _CustomAppSecret value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppSecret() 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( _CustomAppSecret value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppSecret(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _CustomAppSecret value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppSecret() 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 id,  String secret,  String? description,  DateTime? expiredAt,  bool isOidc,  String appId)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppSecret() when $default != null: | ||||
| return $default(_that.id,_that.secret,_that.description,_that.expiredAt,_that.isOidc,_that.appId);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 id,  String secret,  String? description,  DateTime? expiredAt,  bool isOidc,  String appId)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppSecret(): | ||||
| return $default(_that.id,_that.secret,_that.description,_that.expiredAt,_that.isOidc,_that.appId);} | ||||
| } | ||||
| /// 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 id,  String secret,  String? description,  DateTime? expiredAt,  bool isOidc,  String appId)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CustomAppSecret() when $default != null: | ||||
| return $default(_that.id,_that.secret,_that.description,_that.expiredAt,_that.isOidc,_that.appId);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -76,6 +75,130 @@ as int, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [DeveloperStats]. | ||||
| extension DeveloperStatsPatterns on DeveloperStats { | ||||
| /// 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( _DeveloperStats value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _DeveloperStats() 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( _DeveloperStats value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _DeveloperStats(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _DeveloperStats value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _DeveloperStats() 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 totalCustomApps)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _DeveloperStats() when $default != null: | ||||
| return $default(_that.totalCustomApps);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 totalCustomApps)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _DeveloperStats(): | ||||
| return $default(_that.totalCustomApps);} | ||||
| } | ||||
| /// 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 totalCustomApps)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _DeveloperStats() when $default != null: | ||||
| return $default(_that.totalCustomApps);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -85,6 +84,130 @@ as DateTime?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnEmbedLink]. | ||||
| extension SnEmbedLinkPatterns on SnEmbedLink { | ||||
| /// 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( _SnEmbedLink value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnEmbedLink() 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( _SnEmbedLink value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnEmbedLink(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnEmbedLink value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnEmbedLink() 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(@JsonKey(name: 'Type')  String type, @JsonKey(name: 'Url')  String url, @JsonKey(name: 'Title')  String title, @JsonKey(name: 'Description')  String? description, @JsonKey(name: 'ImageUrl')  String? imageUrl, @JsonKey(name: 'FaviconUrl')  String faviconUrl, @JsonKey(name: 'SiteName')  String siteName, @JsonKey(name: 'ContentType')  String? contentType, @JsonKey(name: 'Author')  String? author, @JsonKey(name: 'PublishedDate')  DateTime? publishedDate)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnEmbedLink() when $default != null: | ||||
| return $default(_that.type,_that.url,_that.title,_that.description,_that.imageUrl,_that.faviconUrl,_that.siteName,_that.contentType,_that.author,_that.publishedDate);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(@JsonKey(name: 'Type')  String type, @JsonKey(name: 'Url')  String url, @JsonKey(name: 'Title')  String title, @JsonKey(name: 'Description')  String? description, @JsonKey(name: 'ImageUrl')  String? imageUrl, @JsonKey(name: 'FaviconUrl')  String faviconUrl, @JsonKey(name: 'SiteName')  String siteName, @JsonKey(name: 'ContentType')  String? contentType, @JsonKey(name: 'Author')  String? author, @JsonKey(name: 'PublishedDate')  DateTime? publishedDate)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnEmbedLink(): | ||||
| return $default(_that.type,_that.url,_that.title,_that.description,_that.imageUrl,_that.faviconUrl,_that.siteName,_that.contentType,_that.author,_that.publishedDate);} | ||||
| } | ||||
| /// 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(@JsonKey(name: 'Type')  String type, @JsonKey(name: 'Url')  String url, @JsonKey(name: 'Title')  String title, @JsonKey(name: 'Description')  String? description, @JsonKey(name: 'ImageUrl')  String? imageUrl, @JsonKey(name: 'FaviconUrl')  String faviconUrl, @JsonKey(name: 'SiteName')  String siteName, @JsonKey(name: 'ContentType')  String? contentType, @JsonKey(name: 'Author')  String? author, @JsonKey(name: 'PublishedDate')  DateTime? publishedDate)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnEmbedLink() when $default != null: | ||||
| return $default(_that.type,_that.url,_that.title,_that.description,_that.imageUrl,_that.faviconUrl,_that.siteName,_that.contentType,_that.author,_that.publishedDate);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -245,6 +368,130 @@ as DateTime?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnScrappedLink]. | ||||
| extension SnScrappedLinkPatterns on SnScrappedLink { | ||||
| /// 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( _SnScrappedLink value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnScrappedLink() 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( _SnScrappedLink value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnScrappedLink(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnScrappedLink value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnScrappedLink() 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 type,  String url,  String title,  String? description,  String? imageUrl,  String faviconUrl,  String siteName,  String? contentType,  String? author,  DateTime? publishedDate)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnScrappedLink() when $default != null: | ||||
| return $default(_that.type,_that.url,_that.title,_that.description,_that.imageUrl,_that.faviconUrl,_that.siteName,_that.contentType,_that.author,_that.publishedDate);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 type,  String url,  String title,  String? description,  String? imageUrl,  String faviconUrl,  String siteName,  String? contentType,  String? author,  DateTime? publishedDate)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnScrappedLink(): | ||||
| return $default(_that.type,_that.url,_that.title,_that.description,_that.imageUrl,_that.faviconUrl,_that.siteName,_that.contentType,_that.author,_that.publishedDate);} | ||||
| } | ||||
| /// 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 type,  String url,  String title,  String? description,  String? imageUrl,  String faviconUrl,  String siteName,  String? contentType,  String? author,  DateTime? publishedDate)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnScrappedLink() when $default != null: | ||||
| return $default(_that.type,_that.url,_that.title,_that.description,_that.imageUrl,_that.faviconUrl,_that.siteName,_that.contentType,_that.author,_that.publishedDate);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -77,6 +76,130 @@ as UniversalFileType, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [UniversalFile]. | ||||
| extension UniversalFilePatterns on UniversalFile { | ||||
| /// 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( _UniversalFile value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _UniversalFile() 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( _UniversalFile value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _UniversalFile(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _UniversalFile value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _UniversalFile() 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( dynamic data,  UniversalFileType type)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _UniversalFile() when $default != null: | ||||
| return $default(_that.data,_that.type);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( dynamic data,  UniversalFileType type)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _UniversalFile(): | ||||
| return $default(_that.data,_that.type);} | ||||
| } | ||||
| /// 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( dynamic data,  UniversalFileType type)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _UniversalFile() when $default != null: | ||||
| return $default(_that.data,_that.type);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -224,6 +347,130 @@ as DateTime?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnCloudFile]. | ||||
| extension SnCloudFilePatterns on SnCloudFile { | ||||
| /// 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( _SnCloudFile value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnCloudFile() 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( _SnCloudFile value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnCloudFile(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnCloudFile value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnCloudFile() 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 id,  String name,  String? description,  Map<String, dynamic>? fileMeta,  Map<String, dynamic>? userMeta,  String? mimeType,  String? hash,  int size,  DateTime? uploadedAt,  String? uploadedTo,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnCloudFile() when $default != null: | ||||
| return $default(_that.id,_that.name,_that.description,_that.fileMeta,_that.userMeta,_that.mimeType,_that.hash,_that.size,_that.uploadedAt,_that.uploadedTo,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  String name,  String? description,  Map<String, dynamic>? fileMeta,  Map<String, dynamic>? userMeta,  String? mimeType,  String? hash,  int size,  DateTime? uploadedAt,  String? uploadedTo,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnCloudFile(): | ||||
| return $default(_that.id,_that.name,_that.description,_that.fileMeta,_that.userMeta,_that.mimeType,_that.hash,_that.size,_that.uploadedAt,_that.uploadedTo,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  String name,  String? description,  Map<String, dynamic>? fileMeta,  Map<String, dynamic>? userMeta,  String? mimeType,  String? hash,  int size,  DateTime? uploadedAt,  String? uploadedTo,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnCloudFile() when $default != null: | ||||
| return $default(_that.id,_that.name,_that.description,_that.fileMeta,_that.userMeta,_that.mimeType,_that.hash,_that.size,_that.uploadedAt,_that.uploadedTo,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -152,6 +151,130 @@ $SnPublisherCopyWith<$Res> get publisher { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnPost]. | ||||
| extension SnPostPatterns on SnPost { | ||||
| /// 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( _SnPost value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPost() 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( _SnPost value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPost(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnPost value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPost() 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 id,  String? title,  String? description,  String? language,  DateTime? editedAt,  DateTime? publishedAt,  int visibility,  String? content,  int type,  Map<String, dynamic>? meta,  int viewsUnique,  int viewsTotal,  int upvotes,  int downvotes,  int repliesCount,  String? threadedPostId,  SnPost? threadedPost,  String? repliedPostId,  SnPost? repliedPost,  String? forwardedPostId,  SnPost? forwardedPost,  List<SnCloudFile> attachments,  SnPublisher publisher,  Map<String, int> reactionsCount,  List<dynamic> reactions,  List<PostTag> tags,  List<PostCategory> categories,  List<dynamic> collections,  DateTime? createdAt,  DateTime? updatedAt,  DateTime? deletedAt,  bool isTruncated)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPost() when $default != null: | ||||
| return $default(_that.id,_that.title,_that.description,_that.language,_that.editedAt,_that.publishedAt,_that.visibility,_that.content,_that.type,_that.meta,_that.viewsUnique,_that.viewsTotal,_that.upvotes,_that.downvotes,_that.repliesCount,_that.threadedPostId,_that.threadedPost,_that.repliedPostId,_that.repliedPost,_that.forwardedPostId,_that.forwardedPost,_that.attachments,_that.publisher,_that.reactionsCount,_that.reactions,_that.tags,_that.categories,_that.collections,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.isTruncated);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 id,  String? title,  String? description,  String? language,  DateTime? editedAt,  DateTime? publishedAt,  int visibility,  String? content,  int type,  Map<String, dynamic>? meta,  int viewsUnique,  int viewsTotal,  int upvotes,  int downvotes,  int repliesCount,  String? threadedPostId,  SnPost? threadedPost,  String? repliedPostId,  SnPost? repliedPost,  String? forwardedPostId,  SnPost? forwardedPost,  List<SnCloudFile> attachments,  SnPublisher publisher,  Map<String, int> reactionsCount,  List<dynamic> reactions,  List<PostTag> tags,  List<PostCategory> categories,  List<dynamic> collections,  DateTime? createdAt,  DateTime? updatedAt,  DateTime? deletedAt,  bool isTruncated)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPost(): | ||||
| return $default(_that.id,_that.title,_that.description,_that.language,_that.editedAt,_that.publishedAt,_that.visibility,_that.content,_that.type,_that.meta,_that.viewsUnique,_that.viewsTotal,_that.upvotes,_that.downvotes,_that.repliesCount,_that.threadedPostId,_that.threadedPost,_that.repliedPostId,_that.repliedPost,_that.forwardedPostId,_that.forwardedPost,_that.attachments,_that.publisher,_that.reactionsCount,_that.reactions,_that.tags,_that.categories,_that.collections,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.isTruncated);} | ||||
| } | ||||
| /// 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 id,  String? title,  String? description,  String? language,  DateTime? editedAt,  DateTime? publishedAt,  int visibility,  String? content,  int type,  Map<String, dynamic>? meta,  int viewsUnique,  int viewsTotal,  int upvotes,  int downvotes,  int repliesCount,  String? threadedPostId,  SnPost? threadedPost,  String? repliedPostId,  SnPost? repliedPost,  String? forwardedPostId,  SnPost? forwardedPost,  List<SnCloudFile> attachments,  SnPublisher publisher,  Map<String, int> reactionsCount,  List<dynamic> reactions,  List<PostTag> tags,  List<PostCategory> categories,  List<dynamic> collections,  DateTime? createdAt,  DateTime? updatedAt,  DateTime? deletedAt,  bool isTruncated)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPost() when $default != null: | ||||
| return $default(_that.id,_that.title,_that.description,_that.language,_that.editedAt,_that.publishedAt,_that.visibility,_that.content,_that.type,_that.meta,_that.viewsUnique,_that.viewsTotal,_that.upvotes,_that.downvotes,_that.repliesCount,_that.threadedPostId,_that.threadedPost,_that.repliedPostId,_that.repliedPost,_that.forwardedPostId,_that.forwardedPost,_that.attachments,_that.publisher,_that.reactionsCount,_that.reactions,_that.tags,_that.categories,_that.collections,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.isTruncated);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -440,6 +563,130 @@ as int, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnPublisherStats]. | ||||
| extension SnPublisherStatsPatterns on SnPublisherStats { | ||||
| /// 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( _SnPublisherStats value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisherStats() 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( _SnPublisherStats value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisherStats(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnPublisherStats value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisherStats() 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 postsCreated,  int stickerPacksCreated,  int stickersCreated,  int upvoteReceived,  int downvoteReceived)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisherStats() when $default != null: | ||||
| return $default(_that.postsCreated,_that.stickerPacksCreated,_that.stickersCreated,_that.upvoteReceived,_that.downvoteReceived);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 postsCreated,  int stickerPacksCreated,  int stickersCreated,  int upvoteReceived,  int downvoteReceived)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisherStats(): | ||||
| return $default(_that.postsCreated,_that.stickerPacksCreated,_that.stickersCreated,_that.upvoteReceived,_that.downvoteReceived);} | ||||
| } | ||||
| /// 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 postsCreated,  int stickerPacksCreated,  int stickersCreated,  int upvoteReceived,  int downvoteReceived)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisherStats() when $default != null: | ||||
| return $default(_that.postsCreated,_that.stickerPacksCreated,_that.stickersCreated,_that.upvoteReceived,_that.downvoteReceived);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -583,6 +830,130 @@ as String, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnSubscriptionStatus]. | ||||
| extension SnSubscriptionStatusPatterns on SnSubscriptionStatus { | ||||
| /// 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( _SnSubscriptionStatus value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnSubscriptionStatus() 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( _SnSubscriptionStatus value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnSubscriptionStatus(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnSubscriptionStatus value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnSubscriptionStatus() 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 isSubscribed,  String publisherId,  String publisherName)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnSubscriptionStatus() when $default != null: | ||||
| return $default(_that.isSubscribed,_that.publisherId,_that.publisherName);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 isSubscribed,  String publisherId,  String publisherName)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnSubscriptionStatus(): | ||||
| return $default(_that.isSubscribed,_that.publisherId,_that.publisherName);} | ||||
| } | ||||
| /// 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 isSubscribed,  String publisherId,  String publisherName)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnSubscriptionStatus() when $default != null: | ||||
| return $default(_that.isSubscribed,_that.publisherId,_that.publisherName);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -718,6 +1089,130 @@ as int, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [ReactInfo]. | ||||
| extension ReactInfoPatterns on ReactInfo { | ||||
| /// 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( _ReactInfo value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _ReactInfo() 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( _ReactInfo value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _ReactInfo(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _ReactInfo value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _ReactInfo() 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 icon,  int attitude)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _ReactInfo() when $default != null: | ||||
| return $default(_that.icon,_that.attitude);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 icon,  int attitude)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _ReactInfo(): | ||||
| return $default(_that.icon,_that.attitude);} | ||||
| } | ||||
| /// 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 icon,  int attitude)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _ReactInfo() when $default != null: | ||||
| return $default(_that.icon,_that.attitude);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -79,6 +78,130 @@ as List<SnPost>, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [PostCategory]. | ||||
| extension PostCategoryPatterns on PostCategory { | ||||
| /// 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( _PostCategory value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _PostCategory() 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( _PostCategory value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _PostCategory(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _PostCategory value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _PostCategory() 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 id,  String slug,  String? name,  List<SnPost> posts)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _PostCategory() when $default != null: | ||||
| return $default(_that.id,_that.slug,_that.name,_that.posts);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 id,  String slug,  String? name,  List<SnPost> posts)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _PostCategory(): | ||||
| return $default(_that.id,_that.slug,_that.name,_that.posts);} | ||||
| } | ||||
| /// 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 id,  String slug,  String? name,  List<SnPost> posts)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _PostCategory() when $default != null: | ||||
| return $default(_that.id,_that.slug,_that.name,_that.posts);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -79,6 +78,130 @@ as List<SnPost>, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [PostTag]. | ||||
| extension PostTagPatterns on PostTag { | ||||
| /// 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( _PostTag value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _PostTag() 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( _PostTag value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _PostTag(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _PostTag value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _PostTag() 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 id,  String slug,  String? name,  List<SnPost> posts)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _PostTag() when $default != null: | ||||
| return $default(_that.id,_that.slug,_that.name,_that.posts);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 id,  String slug,  String? name,  List<SnPost> posts)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _PostTag(): | ||||
| return $default(_that.id,_that.slug,_that.name,_that.posts);} | ||||
| } | ||||
| /// 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 id,  String slug,  String? name,  List<SnPost> posts)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _PostTag() when $default != null: | ||||
| return $default(_that.id,_that.slug,_that.name,_that.posts);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -137,6 +136,130 @@ $SnVerificationMarkCopyWith<$Res>? get verification { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnPublisher]. | ||||
| extension SnPublisherPatterns on SnPublisher { | ||||
| /// 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( _SnPublisher value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisher() 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( _SnPublisher value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisher(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnPublisher value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisher() 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 id,  int type,  String name,  String nick,  String bio,  SnCloudFile? picture,  SnCloudFile? background,  SnAccount? account,  String? accountId,  DateTime? createdAt,  DateTime? updatedAt,  DateTime? deletedAt,  String? realmId,  SnVerificationMark? verification)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisher() when $default != null: | ||||
| return $default(_that.id,_that.type,_that.name,_that.nick,_that.bio,_that.picture,_that.background,_that.account,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.realmId,_that.verification);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 id,  int type,  String name,  String nick,  String bio,  SnCloudFile? picture,  SnCloudFile? background,  SnAccount? account,  String? accountId,  DateTime? createdAt,  DateTime? updatedAt,  DateTime? deletedAt,  String? realmId,  SnVerificationMark? verification)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisher(): | ||||
| return $default(_that.id,_that.type,_that.name,_that.nick,_that.bio,_that.picture,_that.background,_that.account,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.realmId,_that.verification);} | ||||
| } | ||||
| /// 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 id,  int type,  String name,  String nick,  String bio,  SnCloudFile? picture,  SnCloudFile? background,  SnAccount? account,  String? accountId,  DateTime? createdAt,  DateTime? updatedAt,  DateTime? deletedAt,  String? realmId,  SnVerificationMark? verification)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisher() when $default != null: | ||||
| return $default(_that.id,_that.type,_that.name,_that.nick,_that.bio,_that.picture,_that.background,_that.account,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt,_that.realmId,_that.verification);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -376,6 +499,130 @@ $SnAccountCopyWith<$Res>? get account { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnPublisherMember]. | ||||
| extension SnPublisherMemberPatterns on SnPublisherMember { | ||||
| /// 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( _SnPublisherMember value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisherMember() 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( _SnPublisherMember value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisherMember(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnPublisherMember value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisherMember() 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 publisherId,  SnPublisher? publisher,  String accountId,  SnAccount? account,  int role,  DateTime? joinedAt,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisherMember() when $default != null: | ||||
| return $default(_that.publisherId,_that.publisher,_that.accountId,_that.account,_that.role,_that.joinedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);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 publisherId,  SnPublisher? publisher,  String accountId,  SnAccount? account,  int role,  DateTime? joinedAt,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisherMember(): | ||||
| return $default(_that.publisherId,_that.publisher,_that.accountId,_that.account,_that.role,_that.joinedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 publisherId,  SnPublisher? publisher,  String accountId,  SnAccount? account,  int role,  DateTime? joinedAt,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnPublisherMember() when $default != null: | ||||
| return $default(_that.publisherId,_that.publisher,_that.accountId,_that.account,_that.role,_that.joinedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -113,6 +112,130 @@ $SnCloudFileCopyWith<$Res>? get background { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnRealm]. | ||||
| extension SnRealmPatterns on SnRealm { | ||||
| /// 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( _SnRealm value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRealm() 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( _SnRealm value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRealm(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnRealm value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRealm() 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 id,  String slug,  String name,  String description,  String? verifiedAs,  DateTime? verifiedAt,  bool isCommunity,  bool isPublic,  SnCloudFile? picture,  SnCloudFile? background,  String accountId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRealm() when $default != null: | ||||
| return $default(_that.id,_that.slug,_that.name,_that.description,_that.verifiedAs,_that.verifiedAt,_that.isCommunity,_that.isPublic,_that.picture,_that.background,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  String slug,  String name,  String description,  String? verifiedAs,  DateTime? verifiedAt,  bool isCommunity,  bool isPublic,  SnCloudFile? picture,  SnCloudFile? background,  String accountId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRealm(): | ||||
| return $default(_that.id,_that.slug,_that.name,_that.description,_that.verifiedAs,_that.verifiedAt,_that.isCommunity,_that.isPublic,_that.picture,_that.background,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  String slug,  String name,  String description,  String? verifiedAs,  DateTime? verifiedAt,  bool isCommunity,  bool isPublic,  SnCloudFile? picture,  SnCloudFile? background,  String accountId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRealm() when $default != null: | ||||
| return $default(_that.id,_that.slug,_that.name,_that.description,_that.verifiedAs,_that.verifiedAt,_that.isCommunity,_that.isPublic,_that.picture,_that.background,_that.accountId,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -328,6 +451,130 @@ $SnAccountCopyWith<$Res>? get account { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnRealmMember]. | ||||
| extension SnRealmMemberPatterns on SnRealmMember { | ||||
| /// 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( _SnRealmMember value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRealmMember() 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( _SnRealmMember value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRealmMember(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnRealmMember value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRealmMember() 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 realmId,  SnRealm? realm,  String accountId,  SnAccount? account,  int role,  DateTime? joinedAt,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRealmMember() when $default != null: | ||||
| return $default(_that.realmId,_that.realm,_that.accountId,_that.account,_that.role,_that.joinedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);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 realmId,  SnRealm? realm,  String accountId,  SnAccount? account,  int role,  DateTime? joinedAt,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRealmMember(): | ||||
| return $default(_that.realmId,_that.realm,_that.accountId,_that.account,_that.role,_that.joinedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 realmId,  SnRealm? realm,  String accountId,  SnAccount? account,  int role,  DateTime? joinedAt,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRealmMember() when $default != null: | ||||
| return $default(_that.realmId,_that.realm,_that.accountId,_that.account,_that.role,_that.joinedAt,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -102,6 +101,130 @@ $SnAccountCopyWith<$Res> get related { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnRelationship]. | ||||
| extension SnRelationshipPatterns on SnRelationship { | ||||
| /// 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( _SnRelationship value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRelationship() 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( _SnRelationship value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRelationship(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnRelationship value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRelationship() 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( DateTime? createdAt,  DateTime? updatedAt,  DateTime? deletedAt,  String accountId,  SnAccount account,  String relatedId,  SnAccount related,  DateTime? expiredAt,  int status)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRelationship() when $default != null: | ||||
| return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.accountId,_that.account,_that.relatedId,_that.related,_that.expiredAt,_that.status);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( DateTime? createdAt,  DateTime? updatedAt,  DateTime? deletedAt,  String accountId,  SnAccount account,  String relatedId,  SnAccount related,  DateTime? expiredAt,  int status)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRelationship(): | ||||
| return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.accountId,_that.account,_that.relatedId,_that.related,_that.expiredAt,_that.status);} | ||||
| } | ||||
| /// 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( DateTime? createdAt,  DateTime? updatedAt,  DateTime? deletedAt,  String accountId,  SnAccount account,  String relatedId,  SnAccount related,  DateTime? expiredAt,  int status)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnRelationship() when $default != null: | ||||
| return $default(_that.createdAt,_that.updatedAt,_that.deletedAt,_that.accountId,_that.account,_that.relatedId,_that.related,_that.expiredAt,_that.status);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -105,6 +104,130 @@ $SnStickerPackCopyWith<$Res>? get pack { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnSticker]. | ||||
| extension SnStickerPatterns on SnSticker { | ||||
| /// 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( _SnSticker value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnSticker() 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( _SnSticker value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnSticker(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnSticker value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnSticker() 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 id,  String slug,  String imageId,  SnCloudFile image,  String packId,  SnStickerPack? pack,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnSticker() when $default != null: | ||||
| return $default(_that.id,_that.slug,_that.imageId,_that.image,_that.packId,_that.pack,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  String slug,  String imageId,  SnCloudFile image,  String packId,  SnStickerPack? pack,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnSticker(): | ||||
| return $default(_that.id,_that.slug,_that.imageId,_that.image,_that.packId,_that.pack,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  String slug,  String imageId,  SnCloudFile image,  String packId,  SnStickerPack? pack,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnSticker() when $default != null: | ||||
| return $default(_that.id,_that.slug,_that.imageId,_that.image,_that.packId,_that.pack,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -295,6 +418,130 @@ $SnPublisherCopyWith<$Res>? get publisher { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnStickerPack]. | ||||
| extension SnStickerPackPatterns on SnStickerPack { | ||||
| /// 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( _SnStickerPack value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnStickerPack() 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( _SnStickerPack value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnStickerPack(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnStickerPack value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnStickerPack() 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 id,  String name,  String description,  String prefix,  String publisherId,  SnPublisher? publisher,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnStickerPack() when $default != null: | ||||
| return $default(_that.id,_that.name,_that.description,_that.prefix,_that.publisherId,_that.publisher,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  String name,  String description,  String prefix,  String publisherId,  SnPublisher? publisher,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnStickerPack(): | ||||
| return $default(_that.id,_that.name,_that.description,_that.prefix,_that.publisherId,_that.publisher,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  String name,  String description,  String prefix,  String publisherId,  SnPublisher? publisher,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnStickerPack() when $default != null: | ||||
| return $default(_that.id,_that.name,_that.description,_that.prefix,_that.publisherId,_that.publisher,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -14,6 +14,7 @@ sealed class SnAccount with _$SnAccount { | ||||
|     required String language, | ||||
|     required bool isSuperuser, | ||||
|     required SnAccountProfile profile, | ||||
|     required SnWalletSubscriptionRef? perkSubscription, | ||||
|     @Default([]) List<SnAccountBadge> badges, | ||||
|     required DateTime createdAt, | ||||
|     required DateTime updatedAt, | ||||
| @@ -45,7 +46,6 @@ sealed class SnAccountProfile with _$SnAccountProfile { | ||||
|     required SnCloudFile? picture, | ||||
|     required SnCloudFile? background, | ||||
|     required SnVerificationMark? verification, | ||||
|     required SnWalletSubscriptionRef? stellarMembership, | ||||
|     required DateTime createdAt, | ||||
|     required DateTime updatedAt, | ||||
|     required DateTime? deletedAt, | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -13,6 +13,12 @@ _SnAccount _$SnAccountFromJson(Map<String, dynamic> json) => _SnAccount( | ||||
|   language: json['language'] as String, | ||||
|   isSuperuser: json['is_superuser'] as bool, | ||||
|   profile: SnAccountProfile.fromJson(json['profile'] as Map<String, dynamic>), | ||||
|   perkSubscription: | ||||
|       json['perk_subscription'] == null | ||||
|           ? null | ||||
|           : SnWalletSubscriptionRef.fromJson( | ||||
|             json['perk_subscription'] as Map<String, dynamic>, | ||||
|           ), | ||||
|   badges: | ||||
|       (json['badges'] as List<dynamic>?) | ||||
|           ?.map((e) => SnAccountBadge.fromJson(e as Map<String, dynamic>)) | ||||
| @@ -34,6 +40,7 @@ Map<String, dynamic> _$SnAccountToJson(_SnAccount instance) => | ||||
|       'language': instance.language, | ||||
|       'is_superuser': instance.isSuperuser, | ||||
|       'profile': instance.profile.toJson(), | ||||
|       'perk_subscription': instance.perkSubscription?.toJson(), | ||||
|       'badges': instance.badges.map((e) => e.toJson()).toList(), | ||||
|       'created_at': instance.createdAt.toIso8601String(), | ||||
|       'updated_at': instance.updatedAt.toIso8601String(), | ||||
| @@ -84,12 +91,6 @@ _SnAccountProfile _$SnAccountProfileFromJson(Map<String, dynamic> json) => | ||||
|               : SnVerificationMark.fromJson( | ||||
|                 json['verification'] as Map<String, dynamic>, | ||||
|               ), | ||||
|       stellarMembership: | ||||
|           json['stellar_membership'] == null | ||||
|               ? null | ||||
|               : SnWalletSubscriptionRef.fromJson( | ||||
|                 json['stellar_membership'] as Map<String, dynamic>, | ||||
|               ), | ||||
|       createdAt: DateTime.parse(json['created_at'] as String), | ||||
|       updatedAt: DateTime.parse(json['updated_at'] as String), | ||||
|       deletedAt: | ||||
| @@ -118,7 +119,6 @@ Map<String, dynamic> _$SnAccountProfileToJson(_SnAccountProfile instance) => | ||||
|       'picture': instance.picture?.toJson(), | ||||
|       'background': instance.background?.toJson(), | ||||
|       'verification': instance.verification?.toJson(), | ||||
|       'stellar_membership': instance.stellarMembership?.toJson(), | ||||
|       'created_at': instance.createdAt.toIso8601String(), | ||||
|       'updated_at': instance.updatedAt.toIso8601String(), | ||||
|       'deleted_at': instance.deletedAt?.toIso8601String(), | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -94,6 +93,130 @@ $SnAccountCopyWith<$Res>? get account { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnWallet]. | ||||
| extension SnWalletPatterns on SnWallet { | ||||
| /// 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( _SnWallet value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWallet() 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( _SnWallet value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWallet(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnWallet value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWallet() 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 id,  List<SnWalletPocket> pockets,  String accountId,  SnAccount? account,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWallet() when $default != null: | ||||
| return $default(_that.id,_that.pockets,_that.accountId,_that.account,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  List<SnWalletPocket> pockets,  String accountId,  SnAccount? account,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWallet(): | ||||
| return $default(_that.id,_that.pockets,_that.accountId,_that.account,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  List<SnWalletPocket> pockets,  String accountId,  SnAccount? account,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWallet() when $default != null: | ||||
| return $default(_that.id,_that.pockets,_that.accountId,_that.account,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -263,6 +386,130 @@ as DateTime?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnWalletPocket]. | ||||
| extension SnWalletPocketPatterns on SnWalletPocket { | ||||
| /// 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( _SnWalletPocket value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletPocket() 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( _SnWalletPocket value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletPocket(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnWalletPocket value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletPocket() 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 id,  String currency,  double amount,  String walletId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletPocket() when $default != null: | ||||
| return $default(_that.id,_that.currency,_that.amount,_that.walletId,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  String currency,  double amount,  String walletId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletPocket(): | ||||
| return $default(_that.id,_that.currency,_that.amount,_that.walletId,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  String currency,  double amount,  String walletId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletPocket() when $default != null: | ||||
| return $default(_that.id,_that.currency,_that.amount,_that.walletId,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -443,6 +690,130 @@ $SnWalletCopyWith<$Res>? get payeeWallet { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnTransaction]. | ||||
| extension SnTransactionPatterns on SnTransaction { | ||||
| /// 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( _SnTransaction value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnTransaction() 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( _SnTransaction value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnTransaction(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnTransaction value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnTransaction() 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 id,  String currency,  double amount,  String? remarks,  int type,  String? payerWalletId,  SnWallet? payerWallet,  String? payeeWalletId,  SnWallet? payeeWallet,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnTransaction() when $default != null: | ||||
| return $default(_that.id,_that.currency,_that.amount,_that.remarks,_that.type,_that.payerWalletId,_that.payerWallet,_that.payeeWalletId,_that.payeeWallet,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  String currency,  double amount,  String? remarks,  int type,  String? payerWalletId,  SnWallet? payerWallet,  String? payeeWalletId,  SnWallet? payeeWallet,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnTransaction(): | ||||
| return $default(_that.id,_that.currency,_that.amount,_that.remarks,_that.type,_that.payerWalletId,_that.payerWallet,_that.payeeWalletId,_that.payeeWallet,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  String currency,  double amount,  String? remarks,  int type,  String? payerWalletId,  SnWallet? payerWallet,  String? payeeWalletId,  SnWallet? payeeWallet,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnTransaction() when $default != null: | ||||
| return $default(_that.id,_that.currency,_that.amount,_that.remarks,_that.type,_that.payerWalletId,_that.payerWallet,_that.payeeWalletId,_that.payeeWallet,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -653,6 +1024,130 @@ $SnAccountCopyWith<$Res>? get account { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnWalletSubscription]. | ||||
| extension SnWalletSubscriptionPatterns on SnWalletSubscription { | ||||
| /// 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( _SnWalletSubscription value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletSubscription() 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( _SnWalletSubscription value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletSubscription(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnWalletSubscription value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletSubscription() 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 id,  DateTime begunAt,  DateTime? endedAt,  String identifier,  bool isActive,  bool isFreeTrial,  int status,  String? paymentMethod,  Map<String, dynamic>? paymentDetails,  double? basePrice,  String? couponId,  dynamic coupon,  DateTime? renewalAt,  String accountId,  SnAccount? account,  bool isAvailable,  double? finalPrice,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletSubscription() when $default != null: | ||||
| return $default(_that.id,_that.begunAt,_that.endedAt,_that.identifier,_that.isActive,_that.isFreeTrial,_that.status,_that.paymentMethod,_that.paymentDetails,_that.basePrice,_that.couponId,_that.coupon,_that.renewalAt,_that.accountId,_that.account,_that.isAvailable,_that.finalPrice,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  DateTime begunAt,  DateTime? endedAt,  String identifier,  bool isActive,  bool isFreeTrial,  int status,  String? paymentMethod,  Map<String, dynamic>? paymentDetails,  double? basePrice,  String? couponId,  dynamic coupon,  DateTime? renewalAt,  String accountId,  SnAccount? account,  bool isAvailable,  double? finalPrice,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletSubscription(): | ||||
| return $default(_that.id,_that.begunAt,_that.endedAt,_that.identifier,_that.isActive,_that.isFreeTrial,_that.status,_that.paymentMethod,_that.paymentDetails,_that.basePrice,_that.couponId,_that.coupon,_that.renewalAt,_that.accountId,_that.account,_that.isAvailable,_that.finalPrice,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  DateTime begunAt,  DateTime? endedAt,  String identifier,  bool isActive,  bool isFreeTrial,  int status,  String? paymentMethod,  Map<String, dynamic>? paymentDetails,  double? basePrice,  String? couponId,  dynamic coupon,  DateTime? renewalAt,  String accountId,  SnAccount? account,  bool isAvailable,  double? finalPrice,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletSubscription() when $default != null: | ||||
| return $default(_that.id,_that.begunAt,_that.endedAt,_that.identifier,_that.isActive,_that.isFreeTrial,_that.status,_that.paymentMethod,_that.paymentDetails,_that.basePrice,_that.couponId,_that.coupon,_that.renewalAt,_that.accountId,_that.account,_that.isAvailable,_that.finalPrice,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -850,6 +1345,130 @@ as String, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnWalletSubscriptionRef]. | ||||
| extension SnWalletSubscriptionRefPatterns on SnWalletSubscriptionRef { | ||||
| /// 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( _SnWalletSubscriptionRef value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletSubscriptionRef() 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( _SnWalletSubscriptionRef value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletSubscriptionRef(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnWalletSubscriptionRef value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletSubscriptionRef() 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 id,  bool isActive,  String accountId,  DateTime createdAt,  DateTime? deletedAt,  DateTime updatedAt,  String identifier)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletSubscriptionRef() when $default != null: | ||||
| return $default(_that.id,_that.isActive,_that.accountId,_that.createdAt,_that.deletedAt,_that.updatedAt,_that.identifier);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 id,  bool isActive,  String accountId,  DateTime createdAt,  DateTime? deletedAt,  DateTime updatedAt,  String identifier)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletSubscriptionRef(): | ||||
| return $default(_that.id,_that.isActive,_that.accountId,_that.createdAt,_that.deletedAt,_that.updatedAt,_that.identifier);} | ||||
| } | ||||
| /// 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 id,  bool isActive,  String accountId,  DateTime createdAt,  DateTime? deletedAt,  DateTime updatedAt,  String identifier)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletSubscriptionRef() when $default != null: | ||||
| return $default(_that.id,_that.isActive,_that.accountId,_that.createdAt,_that.deletedAt,_that.updatedAt,_that.identifier);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -1035,6 +1654,130 @@ $SnTransactionCopyWith<$Res>? get transaction { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnWalletOrder]. | ||||
| extension SnWalletOrderPatterns on SnWalletOrder { | ||||
| /// 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( _SnWalletOrder value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletOrder() 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( _SnWalletOrder value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletOrder(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnWalletOrder value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletOrder() 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 id,  int status,  String currency,  dynamic remarks,  String appIdentifier,  Map<String, dynamic> meta,  int amount,  DateTime expiredAt,  String? payeeWalletId,  SnWallet? payeeWallet,  String? transactionId,  SnTransaction? transaction,  String? issuerAppId,  dynamic issuerApp,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletOrder() when $default != null: | ||||
| return $default(_that.id,_that.status,_that.currency,_that.remarks,_that.appIdentifier,_that.meta,_that.amount,_that.expiredAt,_that.payeeWalletId,_that.payeeWallet,_that.transactionId,_that.transaction,_that.issuerAppId,_that.issuerApp,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  int status,  String currency,  dynamic remarks,  String appIdentifier,  Map<String, dynamic> meta,  int amount,  DateTime expiredAt,  String? payeeWalletId,  SnWallet? payeeWallet,  String? transactionId,  SnTransaction? transaction,  String? issuerAppId,  dynamic issuerApp,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletOrder(): | ||||
| return $default(_that.id,_that.status,_that.currency,_that.remarks,_that.appIdentifier,_that.meta,_that.amount,_that.expiredAt,_that.payeeWalletId,_that.payeeWallet,_that.transactionId,_that.transaction,_that.issuerAppId,_that.issuerApp,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  int status,  String currency,  dynamic remarks,  String appIdentifier,  Map<String, dynamic> meta,  int amount,  DateTime expiredAt,  String? payeeWalletId,  SnWallet? payeeWallet,  String? transactionId,  SnTransaction? transaction,  String? issuerAppId,  dynamic issuerApp,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWalletOrder() when $default != null: | ||||
| return $default(_that.id,_that.status,_that.currency,_that.remarks,_that.appIdentifier,_that.meta,_that.amount,_that.expiredAt,_that.payeeWalletId,_that.payeeWallet,_that.transactionId,_that.transaction,_that.issuerAppId,_that.issuerApp,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -76,6 +75,130 @@ as bool, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnWebFeedConfig]. | ||||
| extension SnWebFeedConfigPatterns on SnWebFeedConfig { | ||||
| /// 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( _SnWebFeedConfig value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebFeedConfig() 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( _SnWebFeedConfig value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebFeedConfig(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnWebFeedConfig value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebFeedConfig() 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 scrapPage)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebFeedConfig() when $default != null: | ||||
| return $default(_that.scrapPage);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 scrapPage)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebFeedConfig(): | ||||
| return $default(_that.scrapPage);} | ||||
| } | ||||
| /// 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 scrapPage)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebFeedConfig() when $default != null: | ||||
| return $default(_that.scrapPage);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -240,6 +363,130 @@ $SnWebFeedConfigCopyWith<$Res> get config { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnWebFeed]. | ||||
| extension SnWebFeedPatterns on SnWebFeed { | ||||
| /// 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( _SnWebFeed value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebFeed() 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( _SnWebFeed value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebFeed(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnWebFeed value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebFeed() 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 id,  String url,  String title,  String? description,  SnScrappedLink? preview,  SnWebFeedConfig config,  String publisherId,  List<SnWebArticle> articles,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebFeed() when $default != null: | ||||
| return $default(_that.id,_that.url,_that.title,_that.description,_that.preview,_that.config,_that.publisherId,_that.articles,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  String url,  String title,  String? description,  SnScrappedLink? preview,  SnWebFeedConfig config,  String publisherId,  List<SnWebArticle> articles,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebFeed(): | ||||
| return $default(_that.id,_that.url,_that.title,_that.description,_that.preview,_that.config,_that.publisherId,_that.articles,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  String url,  String title,  String? description,  SnScrappedLink? preview,  SnWebFeedConfig config,  String publisherId,  List<SnWebArticle> articles,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebFeed() when $default != null: | ||||
| return $default(_that.id,_that.url,_that.title,_that.description,_that.preview,_that.config,_that.publisherId,_that.articles,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| @@ -456,6 +703,130 @@ $SnWebFeedCopyWith<$Res>? get feed { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [SnWebArticle]. | ||||
| extension SnWebArticlePatterns on SnWebArticle { | ||||
| /// 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( _SnWebArticle value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebArticle() 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( _SnWebArticle value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebArticle(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _SnWebArticle value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebArticle() 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 id,  String title,  String url,  String? author,  Map<String, dynamic>? meta,  SnScrappedLink? preview,  SnWebFeed? feed,  String? content,  DateTime? publishedAt,  String feedId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebArticle() when $default != null: | ||||
| return $default(_that.id,_that.title,_that.url,_that.author,_that.meta,_that.preview,_that.feed,_that.content,_that.publishedAt,_that.feedId,_that.createdAt,_that.updatedAt,_that.deletedAt);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 id,  String title,  String url,  String? author,  Map<String, dynamic>? meta,  SnScrappedLink? preview,  SnWebFeed? feed,  String? content,  DateTime? publishedAt,  String feedId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebArticle(): | ||||
| return $default(_that.id,_that.title,_that.url,_that.author,_that.meta,_that.preview,_that.feed,_that.content,_that.publishedAt,_that.feedId,_that.createdAt,_that.updatedAt,_that.deletedAt);} | ||||
| } | ||||
| /// 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 id,  String title,  String url,  String? author,  Map<String, dynamic>? meta,  SnScrappedLink? preview,  SnWebFeed? feed,  String? content,  DateTime? publishedAt,  String feedId,  DateTime createdAt,  DateTime updatedAt,  DateTime? deletedAt)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _SnWebArticle() when $default != null: | ||||
| return $default(_that.id,_that.title,_that.url,_that.author,_that.meta,_that.preview,_that.feed,_that.content,_that.publishedAt,_that.feedId,_that.createdAt,_that.updatedAt,_that.deletedAt);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -4,28 +4,27 @@ import 'package:island/models/webfeed.dart'; | ||||
| import 'package:island/pods/network.dart'; | ||||
|  | ||||
| /// Provider that fetches a single article by its ID | ||||
| final articleDetailProvider = FutureProvider.autoDispose.family<SnWebArticle, String>( | ||||
|   (ref, articleId) async { | ||||
|     final dio = ref.watch(apiClientProvider); | ||||
|      | ||||
|     try { | ||||
|       final response = await dio.get<Map<String, dynamic>>( | ||||
|         '/feeds/articles/$articleId', | ||||
|       ); | ||||
|        | ||||
|       if (response.statusCode == 200 && response.data != null) { | ||||
|         return SnWebArticle.fromJson(response.data!); | ||||
|       } else { | ||||
|         throw Exception('Failed to load article'); | ||||
| final articleDetailProvider = FutureProvider.autoDispose | ||||
|     .family<SnWebArticle, String>((ref, articleId) async { | ||||
|       final dio = ref.watch(apiClientProvider); | ||||
|  | ||||
|       try { | ||||
|         final response = await dio.get<Map<String, dynamic>>( | ||||
|           '/sphere/feeds/articles/$articleId', | ||||
|         ); | ||||
|  | ||||
|         if (response.statusCode == 200 && response.data != null) { | ||||
|           return SnWebArticle.fromJson(response.data!); | ||||
|         } else { | ||||
|           throw Exception('Failed to load article'); | ||||
|         } | ||||
|       } on DioException catch (e) { | ||||
|         if (e.response?.statusCode == 404) { | ||||
|           throw Exception('Article not found'); | ||||
|         } else { | ||||
|           throw Exception('Failed to load article: ${e.message}'); | ||||
|         } | ||||
|       } catch (e) { | ||||
|         throw Exception('Failed to load article: $e'); | ||||
|       } | ||||
|     } on DioException catch (e) { | ||||
|       if (e.response?.statusCode == 404) { | ||||
|         throw Exception('Article not found'); | ||||
|       } else { | ||||
|         throw Exception('Failed to load article: ${e.message}'); | ||||
|       } | ||||
|     } catch (e) { | ||||
|       throw Exception('Failed to load article: $e'); | ||||
|     } | ||||
|   }, | ||||
| ); | ||||
|     }); | ||||
|   | ||||
| @@ -246,7 +246,9 @@ class CallNotifier extends _$CallNotifier { | ||||
|     try { | ||||
|       final apiClient = ref.read(apiClientProvider); | ||||
|       final ongoingCall = await ref.read(ongoingCallProvider(roomId).future); | ||||
|       final response = await apiClient.get('/chat/realtime/$roomId/join'); | ||||
|       final response = await apiClient.get( | ||||
|         '/sphere/chat/realtime/$roomId/join', | ||||
|       ); | ||||
|       if (response.statusCode == 200 && response.data != null) { | ||||
|         final data = response.data; | ||||
|         // Parse join response | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -78,6 +77,130 @@ as String?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [CallState]. | ||||
| extension CallStatePatterns on CallState { | ||||
| /// 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( _CallState value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CallState() 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( _CallState value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CallState(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _CallState value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CallState() 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 isConnected,  bool isMicrophoneEnabled,  bool isCameraEnabled,  bool isScreenSharing,  Duration duration,  String? error)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CallState() when $default != null: | ||||
| return $default(_that.isConnected,_that.isMicrophoneEnabled,_that.isCameraEnabled,_that.isScreenSharing,_that.duration,_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 isConnected,  bool isMicrophoneEnabled,  bool isCameraEnabled,  bool isScreenSharing,  Duration duration,  String? error)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CallState(): | ||||
| return $default(_that.isConnected,_that.isMicrophoneEnabled,_that.isCameraEnabled,_that.isScreenSharing,_that.duration,_that.error);} | ||||
| } | ||||
| /// 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 isConnected,  bool isMicrophoneEnabled,  bool isCameraEnabled,  bool isScreenSharing,  Duration duration,  String? error)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CallState() when $default != null: | ||||
| return $default(_that.isConnected,_that.isMicrophoneEnabled,_that.isCameraEnabled,_that.isScreenSharing,_that.duration,_that.error);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
|  | ||||
|  | ||||
| @@ -225,6 +348,130 @@ $CallParticipantCopyWith<$Res> get participant { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [CallParticipantLive]. | ||||
| extension CallParticipantLivePatterns on CallParticipantLive { | ||||
| /// 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( _CallParticipantLive value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CallParticipantLive() 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( _CallParticipantLive value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CallParticipantLive(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _CallParticipantLive value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _CallParticipantLive() 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( CallParticipant participant,  Participant remoteParticipant)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CallParticipantLive() when $default != null: | ||||
| return $default(_that.participant,_that.remoteParticipant);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( CallParticipant participant,  Participant remoteParticipant)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CallParticipantLive(): | ||||
| return $default(_that.participant,_that.remoteParticipant);} | ||||
| } | ||||
| /// 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( CallParticipant participant,  Participant remoteParticipant)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _CallParticipantLive() when $default != null: | ||||
| return $default(_that.participant,_that.remoteParticipant);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -6,7 +6,7 @@ part of 'call.dart'; | ||||
| // RiverpodGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$callNotifierHash() => r'47eaba43aa2af1a107725998f4a34af2c94fbc55'; | ||||
| String _$callNotifierHash() => r'107174cd6cfab6bfafe44f8c4a72a67bcb93217b'; | ||||
|  | ||||
| /// See also [CallNotifier]. | ||||
| @ProviderFor(CallNotifier) | ||||
|   | ||||
| @@ -9,7 +9,7 @@ class ChatSummary extends _$ChatSummary { | ||||
|   @override | ||||
|   Future<Map<String, SnChatSummary>> build() async { | ||||
|     final client = ref.watch(apiClientProvider); | ||||
|     final resp = await client.get('/chat/summary'); | ||||
|     final resp = await client.get('/sphere/chat/summary'); | ||||
|  | ||||
|     final Map<String, dynamic> data = resp.data; | ||||
|     return data.map( | ||||
|   | ||||
| @@ -6,7 +6,7 @@ part of 'chat_summary.dart'; | ||||
| // RiverpodGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$chatSummaryHash() => r'19aad48b5fabb33a76b742400d3b738ceb81c40c'; | ||||
| String _$chatSummaryHash() => r'87a10e4cefa37dc5fa8eadb175ef1b2bed6070bf'; | ||||
|  | ||||
| /// See also [ChatSummary]. | ||||
| @ProviderFor(ChatSummary) | ||||
|   | ||||
| @@ -10,7 +10,7 @@ part 'config.g.dart'; | ||||
|  | ||||
| const kTokenPairStoreKey = 'dyn_user_tk'; | ||||
|  | ||||
| const kNetworkServerDefault = 'https://nt.solian.app'; | ||||
| const kNetworkServerDefault = 'https://api.solian.app'; | ||||
| const kNetworkServerStoreKey = 'app_server_url'; | ||||
|  | ||||
| const kAppbarTransparentStoreKey = 'app_bar_transparent'; | ||||
| @@ -82,7 +82,7 @@ class AppSettingsNotifier extends _$AppSettingsNotifier { | ||||
|   Size? _getWindowSizeFromPrefs(SharedPreferences prefs) { | ||||
|     final sizeString = prefs.getString(kAppWindowSize); | ||||
|     if (sizeString == null) return null; | ||||
|      | ||||
|  | ||||
|     try { | ||||
|       final parts = sizeString.split(','); | ||||
|       if (parts.length == 2) { | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -81,6 +80,130 @@ as Size?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [AppSettings]. | ||||
| extension AppSettingsPatterns on AppSettings { | ||||
| /// 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( _AppSettings value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _AppSettings() 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( _AppSettings value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _AppSettings(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _AppSettings value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _AppSettings() 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 autoTranslate,  bool soundEffects,  bool aprilFoolFeatures,  bool enterToSend,  bool appBarTransparent,  String? customFonts,  int? appColorScheme,  Size? windowSize)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _AppSettings() when $default != null: | ||||
| return $default(_that.autoTranslate,_that.soundEffects,_that.aprilFoolFeatures,_that.enterToSend,_that.appBarTransparent,_that.customFonts,_that.appColorScheme,_that.windowSize);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 autoTranslate,  bool soundEffects,  bool aprilFoolFeatures,  bool enterToSend,  bool appBarTransparent,  String? customFonts,  int? appColorScheme,  Size? windowSize)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _AppSettings(): | ||||
| return $default(_that.autoTranslate,_that.soundEffects,_that.aprilFoolFeatures,_that.enterToSend,_that.appBarTransparent,_that.customFonts,_that.appColorScheme,_that.windowSize);} | ||||
| } | ||||
| /// 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 autoTranslate,  bool soundEffects,  bool aprilFoolFeatures,  bool enterToSend,  bool appBarTransparent,  String? customFonts,  int? appColorScheme,  Size? windowSize)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _AppSettings() when $default != null: | ||||
| return $default(_that.autoTranslate,_that.soundEffects,_that.aprilFoolFeatures,_that.enterToSend,_that.appBarTransparent,_that.customFonts,_that.appColorScheme,_that.windowSize);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -9,10 +9,10 @@ part 'event_calendar.g.dart'; | ||||
| class EventCalendarQuery { | ||||
|   /// Username to fetch calendar for, null means current user ('me') | ||||
|   final String? uname; | ||||
|    | ||||
|  | ||||
|   /// Year to fetch calendar for | ||||
|   final int year; | ||||
|    | ||||
|  | ||||
|   /// Month to fetch calendar for | ||||
|   final int month; | ||||
|  | ||||
| @@ -43,14 +43,12 @@ Future<List<SnEventCalendarEntry>> eventCalendar( | ||||
|   EventCalendarQuery query, | ||||
| ) async { | ||||
|   final client = ref.watch(apiClientProvider); | ||||
|   final resp = await client.get('/accounts/${query.uname ?? 'me'}/calendar',  | ||||
|     queryParameters: { | ||||
|       'year': query.year, | ||||
|       'month': query.month, | ||||
|     }, | ||||
|   final resp = await client.get( | ||||
|     '/id/accounts/${query.uname ?? 'me'}/calendar', | ||||
|     queryParameters: {'year': query.year, 'month': query.month}, | ||||
|   ); | ||||
|   return resp.data | ||||
|       .map((e) => SnEventCalendarEntry.fromJson(e)) | ||||
|       .cast<SnEventCalendarEntry>() | ||||
|       .toList(); | ||||
| } | ||||
| } | ||||
|   | ||||
| @@ -6,7 +6,7 @@ part of 'event_calendar.dart'; | ||||
| // RiverpodGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$eventCalendarHash() => r'6f2454404fa8660b96334d654490e1a40ee53e10'; | ||||
| String _$eventCalendarHash() => r'72232fc044ac3c99b855dca37ff2f06a64be0afb'; | ||||
|  | ||||
| /// Copied from Dart SDK | ||||
| class _SystemHash { | ||||
|   | ||||
| @@ -14,7 +14,7 @@ class UserInfoNotifier extends StateNotifier<AsyncValue<SnAccount?>> { | ||||
|   Future<void> fetchUser() async { | ||||
|     try { | ||||
|       final client = _ref.read(apiClientProvider); | ||||
|       final response = await client.get('/accounts/me'); | ||||
|       final response = await client.get('/id/accounts/me'); | ||||
|       final user = SnAccount.fromJson(response.data); | ||||
|       state = AsyncValue.data(user); | ||||
|     } catch (error, stackTrace) { | ||||
|   | ||||
| @@ -10,7 +10,7 @@ final webFeedListProvider = FutureProvider.family<List<SnWebFeed>, String>(( | ||||
|   pubName, | ||||
| ) async { | ||||
|   final client = ref.watch(apiClientProvider); | ||||
|   final response = await client.get('/publishers/$pubName/feeds'); | ||||
|   final response = await client.get('/sphere/publishers/$pubName/feeds'); | ||||
|   return (response.data as List) | ||||
|       .map((json) => SnWebFeed.fromJson(json)) | ||||
|       .toList(); | ||||
| @@ -39,7 +39,7 @@ class WebFeedNotifier | ||||
|     try { | ||||
|       final client = ref.read(apiClientProvider); | ||||
|       final response = await client.get( | ||||
|         '/publishers/${arg.pubName}/feeds/${arg.feedId}', | ||||
|         '/sphere/publishers/${arg.pubName}/feeds/${arg.feedId}', | ||||
|       ); | ||||
|       return SnWebFeed.fromJson(response.data); | ||||
|     } catch (e) { | ||||
| @@ -51,7 +51,7 @@ class WebFeedNotifier | ||||
|     state = const AsyncValue.loading(); | ||||
|     try { | ||||
|       final client = ref.read(apiClientProvider); | ||||
|       final url = '/publishers/${feed.publisherId}/feeds'; | ||||
|       final url = '/sphere/publishers/${feed.publisherId}/feeds'; | ||||
|  | ||||
|       final response = | ||||
|           feed.id.isEmpty | ||||
| @@ -72,7 +72,7 @@ class WebFeedNotifier | ||||
|     state = const AsyncValue.loading(); | ||||
|     try { | ||||
|       final client = ref.read(apiClientProvider); | ||||
|       await client.delete('/publishers/${arg.pubName}/feeds/$feedId'); | ||||
|       await client.delete('/sphere/publishers/${arg.pubName}/feeds/$feedId'); | ||||
|       state = AsyncValue.data( | ||||
|         SnWebFeed( | ||||
|           id: '', | ||||
| @@ -98,7 +98,7 @@ class WebFeedNotifier | ||||
|     try { | ||||
|       final client = ref.read(apiClientProvider); | ||||
|       await client.post( | ||||
|         '/publishers/${arg.pubName}/feeds/$feedId/scrap', | ||||
|         '/sphere/publishers/${arg.pubName}/feeds/$feedId/scrap', | ||||
|         options: Options( | ||||
|           sendTimeout: const Duration(seconds: 60), | ||||
|           receiveTimeout: const Duration(seconds: 180), | ||||
| @@ -107,7 +107,7 @@ class WebFeedNotifier | ||||
|  | ||||
|       // Reload the feed | ||||
|       final response = await client.get( | ||||
|         '/publishers/${arg.pubName}/feeds/$feedId', | ||||
|         '/sphere/publishers/${arg.pubName}/feeds/$feedId', | ||||
|       ); | ||||
|       state = AsyncValue.data(SnWebFeed.fromJson(response.data)); | ||||
|     } catch (error, stackTrace) { | ||||
|   | ||||
| @@ -26,6 +26,7 @@ sealed class WebSocketPacket with _$WebSocketPacket { | ||||
|   const factory WebSocketPacket({ | ||||
|     required String type, | ||||
|     required Map<String, dynamic>? data, | ||||
|     String? endpoint, | ||||
|     String? errorMessage, | ||||
|   }) = _WebSocketPacket; | ||||
|  | ||||
| @@ -65,7 +66,7 @@ class WebSocketService { | ||||
|       } else { | ||||
|         _channel = IOWebSocketChannel.connect( | ||||
|           Uri.parse(url), | ||||
|           headers: {'Authorization': 'Bearer $token'}, | ||||
|           headers: {'Authorization': 'AtField $token'}, | ||||
|         ); | ||||
|       } | ||||
|       await _channel!.ready; | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -48,6 +47,148 @@ $WebSocketStateCopyWith(WebSocketState _, $Res Function(WebSocketState) __); | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [WebSocketState]. | ||||
| extension WebSocketStatePatterns on WebSocketState { | ||||
| /// 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( _Connected value)?  connected,TResult Function( _Connecting value)?  connecting,TResult Function( _Disconnected value)?  disconnected,TResult Function( _Error value)?  error,required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _Connected() when connected != null: | ||||
| return connected(_that);case _Connecting() when connecting != null: | ||||
| return connecting(_that);case _Disconnected() when disconnected != null: | ||||
| return disconnected(_that);case _Error() when error != null: | ||||
| return error(_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?>({required TResult Function( _Connected value)  connected,required TResult Function( _Connecting value)  connecting,required TResult Function( _Disconnected value)  disconnected,required TResult Function( _Error value)  error,}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _Connected(): | ||||
| return connected(_that);case _Connecting(): | ||||
| return connecting(_that);case _Disconnected(): | ||||
| return disconnected(_that);case _Error(): | ||||
| return error(_that);} | ||||
| } | ||||
| /// 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( _Connected value)?  connected,TResult? Function( _Connecting value)?  connecting,TResult? Function( _Disconnected value)?  disconnected,TResult? Function( _Error value)?  error,}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _Connected() when connected != null: | ||||
| return connected(_that);case _Connecting() when connecting != null: | ||||
| return connecting(_that);case _Disconnected() when disconnected != null: | ||||
| return disconnected(_that);case _Error() when error != null: | ||||
| return error(_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()?  connected,TResult Function()?  connecting,TResult Function()?  disconnected,TResult Function( String message)?  error,required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _Connected() when connected != null: | ||||
| return connected();case _Connecting() when connecting != null: | ||||
| return connecting();case _Disconnected() when disconnected != null: | ||||
| return disconnected();case _Error() when error != null: | ||||
| return error(_that.message);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?>({required TResult Function()  connected,required TResult Function()  connecting,required TResult Function()  disconnected,required TResult Function( String message)  error,}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _Connected(): | ||||
| return connected();case _Connecting(): | ||||
| return connecting();case _Disconnected(): | ||||
| return disconnected();case _Error(): | ||||
| return error(_that.message);} | ||||
| } | ||||
| /// 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()?  connected,TResult? Function()?  connecting,TResult? Function()?  disconnected,TResult? Function( String message)?  error,}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _Connected() when connected != null: | ||||
| return connected();case _Connecting() when connecting != null: | ||||
| return connecting();case _Disconnected() when disconnected != null: | ||||
| return disconnected();case _Error() when error != null: | ||||
| return error(_that.message);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
|  | ||||
|  | ||||
| @@ -238,7 +379,7 @@ as String, | ||||
| /// @nodoc | ||||
| mixin _$WebSocketPacket implements DiagnosticableTreeMixin { | ||||
|  | ||||
|  String get type; Map<String, dynamic>? get data; String? get errorMessage; | ||||
|  String get type; Map<String, dynamic>? get data; String? get endpoint; String? get errorMessage; | ||||
| /// Create a copy of WebSocketPacket | ||||
| /// with the given fields replaced by the non-null parameter values. | ||||
| @JsonKey(includeFromJson: false, includeToJson: false) | ||||
| @@ -252,21 +393,21 @@ $WebSocketPacketCopyWith<WebSocketPacket> get copyWith => _$WebSocketPacketCopyW | ||||
| void debugFillProperties(DiagnosticPropertiesBuilder properties) { | ||||
|   properties | ||||
|     ..add(DiagnosticsProperty('type', 'WebSocketPacket')) | ||||
|     ..add(DiagnosticsProperty('type', type))..add(DiagnosticsProperty('data', data))..add(DiagnosticsProperty('errorMessage', errorMessage)); | ||||
|     ..add(DiagnosticsProperty('type', type))..add(DiagnosticsProperty('data', data))..add(DiagnosticsProperty('endpoint', endpoint))..add(DiagnosticsProperty('errorMessage', errorMessage)); | ||||
| } | ||||
|  | ||||
| @override | ||||
| bool operator ==(Object other) { | ||||
|   return identical(this, other) || (other.runtimeType == runtimeType&&other is WebSocketPacket&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other.data, data)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); | ||||
|   return identical(this, other) || (other.runtimeType == runtimeType&&other is WebSocketPacket&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other.data, data)&&(identical(other.endpoint, endpoint) || other.endpoint == endpoint)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); | ||||
| } | ||||
|  | ||||
| @JsonKey(includeFromJson: false, includeToJson: false) | ||||
| @override | ||||
| int get hashCode => Object.hash(runtimeType,type,const DeepCollectionEquality().hash(data),errorMessage); | ||||
| int get hashCode => Object.hash(runtimeType,type,const DeepCollectionEquality().hash(data),endpoint,errorMessage); | ||||
|  | ||||
| @override | ||||
| String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { | ||||
|   return 'WebSocketPacket(type: $type, data: $data, errorMessage: $errorMessage)'; | ||||
|   return 'WebSocketPacket(type: $type, data: $data, endpoint: $endpoint, errorMessage: $errorMessage)'; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -277,7 +418,7 @@ abstract mixin class $WebSocketPacketCopyWith<$Res>  { | ||||
|   factory $WebSocketPacketCopyWith(WebSocketPacket value, $Res Function(WebSocketPacket) _then) = _$WebSocketPacketCopyWithImpl; | ||||
| @useResult | ||||
| $Res call({ | ||||
|  String type, Map<String, dynamic>? data, String? errorMessage | ||||
|  String type, Map<String, dynamic>? data, String? endpoint, String? errorMessage | ||||
| }); | ||||
|  | ||||
|  | ||||
| @@ -294,11 +435,12 @@ class _$WebSocketPacketCopyWithImpl<$Res> | ||||
|  | ||||
| /// Create a copy of WebSocketPacket | ||||
| /// with the given fields replaced by the non-null parameter values. | ||||
| @pragma('vm:prefer-inline') @override $Res call({Object? type = null,Object? data = freezed,Object? errorMessage = freezed,}) { | ||||
| @pragma('vm:prefer-inline') @override $Res call({Object? type = null,Object? data = freezed,Object? endpoint = freezed,Object? errorMessage = freezed,}) { | ||||
|   return _then(_self.copyWith( | ||||
| type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable | ||||
| as String,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable | ||||
| as Map<String, dynamic>?,errorMessage: freezed == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable | ||||
| as Map<String, dynamic>?,endpoint: freezed == endpoint ? _self.endpoint : endpoint // ignore: cast_nullable_to_non_nullable | ||||
| as String?,errorMessage: freezed == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable | ||||
| as String?, | ||||
|   )); | ||||
| } | ||||
| @@ -306,11 +448,135 @@ as String?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [WebSocketPacket]. | ||||
| extension WebSocketPacketPatterns on WebSocketPacket { | ||||
| /// 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( _WebSocketPacket value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _WebSocketPacket() 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( _WebSocketPacket value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _WebSocketPacket(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _WebSocketPacket value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _WebSocketPacket() 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 type,  Map<String, dynamic>? data,  String? endpoint,  String? errorMessage)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _WebSocketPacket() when $default != null: | ||||
| return $default(_that.type,_that.data,_that.endpoint,_that.errorMessage);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 type,  Map<String, dynamic>? data,  String? endpoint,  String? errorMessage)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _WebSocketPacket(): | ||||
| return $default(_that.type,_that.data,_that.endpoint,_that.errorMessage);} | ||||
| } | ||||
| /// 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 type,  Map<String, dynamic>? data,  String? endpoint,  String? errorMessage)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _WebSocketPacket() when $default != null: | ||||
| return $default(_that.type,_that.data,_that.endpoint,_that.errorMessage);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
| class _WebSocketPacket with DiagnosticableTreeMixin implements WebSocketPacket { | ||||
|   const _WebSocketPacket({required this.type, required final  Map<String, dynamic>? data, this.errorMessage}): _data = data; | ||||
|   const _WebSocketPacket({required this.type, required final  Map<String, dynamic>? data, this.endpoint, this.errorMessage}): _data = data; | ||||
|   factory _WebSocketPacket.fromJson(Map<String, dynamic> json) => _$WebSocketPacketFromJson(json); | ||||
|  | ||||
| @override final  String type; | ||||
| @@ -323,6 +589,7 @@ class _WebSocketPacket with DiagnosticableTreeMixin implements WebSocketPacket { | ||||
|   return EqualUnmodifiableMapView(value); | ||||
| } | ||||
|  | ||||
| @override final  String? endpoint; | ||||
| @override final  String? errorMessage; | ||||
|  | ||||
| /// Create a copy of WebSocketPacket | ||||
| @@ -339,21 +606,21 @@ Map<String, dynamic> toJson() { | ||||
| void debugFillProperties(DiagnosticPropertiesBuilder properties) { | ||||
|   properties | ||||
|     ..add(DiagnosticsProperty('type', 'WebSocketPacket')) | ||||
|     ..add(DiagnosticsProperty('type', type))..add(DiagnosticsProperty('data', data))..add(DiagnosticsProperty('errorMessage', errorMessage)); | ||||
|     ..add(DiagnosticsProperty('type', type))..add(DiagnosticsProperty('data', data))..add(DiagnosticsProperty('endpoint', endpoint))..add(DiagnosticsProperty('errorMessage', errorMessage)); | ||||
| } | ||||
|  | ||||
| @override | ||||
| bool operator ==(Object other) { | ||||
|   return identical(this, other) || (other.runtimeType == runtimeType&&other is _WebSocketPacket&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other._data, _data)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); | ||||
|   return identical(this, other) || (other.runtimeType == runtimeType&&other is _WebSocketPacket&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other._data, _data)&&(identical(other.endpoint, endpoint) || other.endpoint == endpoint)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); | ||||
| } | ||||
|  | ||||
| @JsonKey(includeFromJson: false, includeToJson: false) | ||||
| @override | ||||
| int get hashCode => Object.hash(runtimeType,type,const DeepCollectionEquality().hash(_data),errorMessage); | ||||
| int get hashCode => Object.hash(runtimeType,type,const DeepCollectionEquality().hash(_data),endpoint,errorMessage); | ||||
|  | ||||
| @override | ||||
| String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) { | ||||
|   return 'WebSocketPacket(type: $type, data: $data, errorMessage: $errorMessage)'; | ||||
|   return 'WebSocketPacket(type: $type, data: $data, endpoint: $endpoint, errorMessage: $errorMessage)'; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -364,7 +631,7 @@ abstract mixin class _$WebSocketPacketCopyWith<$Res> implements $WebSocketPacket | ||||
|   factory _$WebSocketPacketCopyWith(_WebSocketPacket value, $Res Function(_WebSocketPacket) _then) = __$WebSocketPacketCopyWithImpl; | ||||
| @override @useResult | ||||
| $Res call({ | ||||
|  String type, Map<String, dynamic>? data, String? errorMessage | ||||
|  String type, Map<String, dynamic>? data, String? endpoint, String? errorMessage | ||||
| }); | ||||
|  | ||||
|  | ||||
| @@ -381,11 +648,12 @@ class __$WebSocketPacketCopyWithImpl<$Res> | ||||
|  | ||||
| /// Create a copy of WebSocketPacket | ||||
| /// with the given fields replaced by the non-null parameter values. | ||||
| @override @pragma('vm:prefer-inline') $Res call({Object? type = null,Object? data = freezed,Object? errorMessage = freezed,}) { | ||||
| @override @pragma('vm:prefer-inline') $Res call({Object? type = null,Object? data = freezed,Object? endpoint = freezed,Object? errorMessage = freezed,}) { | ||||
|   return _then(_WebSocketPacket( | ||||
| type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable | ||||
| as String,data: freezed == data ? _self._data : data // ignore: cast_nullable_to_non_nullable | ||||
| as Map<String, dynamic>?,errorMessage: freezed == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable | ||||
| as Map<String, dynamic>?,endpoint: freezed == endpoint ? _self.endpoint : endpoint // ignore: cast_nullable_to_non_nullable | ||||
| as String?,errorMessage: freezed == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable | ||||
| as String?, | ||||
|   )); | ||||
| } | ||||
|   | ||||
| @@ -10,6 +10,7 @@ _WebSocketPacket _$WebSocketPacketFromJson(Map<String, dynamic> json) => | ||||
|     _WebSocketPacket( | ||||
|       type: json['type'] as String, | ||||
|       data: json['data'] as Map<String, dynamic>?, | ||||
|       endpoint: json['endpoint'] as String?, | ||||
|       errorMessage: json['error_message'] as String?, | ||||
|     ); | ||||
|  | ||||
| @@ -17,5 +18,6 @@ Map<String, dynamic> _$WebSocketPacketToJson(_WebSocketPacket instance) => | ||||
|     <String, dynamic>{ | ||||
|       'type': instance.type, | ||||
|       'data': instance.data, | ||||
|       'endpoint': instance.endpoint, | ||||
|       'error_message': instance.errorMessage, | ||||
|     }; | ||||
|   | ||||
							
								
								
									
										130
									
								
								lib/route.dart
									
									
									
									
									
								
							
							
						
						
									
										130
									
								
								lib/route.dart
									
									
									
									
									
								
							| @@ -11,7 +11,7 @@ import 'package:island/screens/posts/post_search.dart'; | ||||
| import 'package:island/widgets/app_wrapper.dart'; | ||||
| import 'package:island/screens/tabs.dart'; | ||||
| import 'package:island/screens/explore.dart'; | ||||
| import 'package:island/screens/article_detail_screen.dart'; | ||||
| import 'package:island/screens/discovery/article_detail.dart'; | ||||
| import 'package:island/screens/account.dart'; | ||||
| import 'package:island/screens/notification.dart'; | ||||
| import 'package:island/screens/wallet.dart'; | ||||
| @@ -41,6 +41,8 @@ import 'package:island/screens/realm/realms.dart'; | ||||
| import 'package:island/screens/realm/realm_detail.dart'; | ||||
| import 'package:island/screens/account/event_calendar.dart'; | ||||
| import 'package:island/screens/discovery/realms.dart'; | ||||
| import 'package:island/screens/reports/report_detail.dart'; | ||||
| import 'package:island/screens/reports/report_list.dart'; | ||||
|  | ||||
| // Shell route keys for nested navigation | ||||
| final rootNavigatorKey = GlobalKey<NavigatorState>(); | ||||
| @@ -61,6 +63,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|         routes: [ | ||||
|           // Standalone routes without bottom navigation | ||||
|           GoRoute( | ||||
|             name: 'postCompose', | ||||
|             path: '/posts/compose', | ||||
|             builder: | ||||
|                 (context, state) => PostComposeScreen( | ||||
| @@ -71,6 +74,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                 ), | ||||
|           ), | ||||
|           GoRoute( | ||||
|             name: 'postEdit', | ||||
|             path: '/posts/:id/edit', | ||||
|             builder: (context, state) { | ||||
|               final id = state.pathParameters['id']!; | ||||
| @@ -78,6 +82,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|             }, | ||||
|           ), | ||||
|           GoRoute( | ||||
|             name: 'chatCall', | ||||
|             path: '/chat/:id/call', | ||||
|             builder: (context, state) { | ||||
|               final id = state.pathParameters['id']!; | ||||
| @@ -85,6 +90,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|             }, | ||||
|           ), | ||||
|           GoRoute( | ||||
|             name: 'accountCalendar', | ||||
|             path: '/account/:name/calendar', | ||||
|             builder: (context, state) { | ||||
|               final name = state.pathParameters['name']!; | ||||
| @@ -96,11 +102,13 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                 (context, state, child) => CreatorHubShellScreen(child: child), | ||||
|             routes: [ | ||||
|               GoRoute( | ||||
|                 name: 'creatorHub', | ||||
|                 path: '/creators', | ||||
|                 builder: (context, state) => const CreatorHubScreen(), | ||||
|               ), | ||||
|               // Web Feed Routes | ||||
|               GoRoute( | ||||
|                 name: 'creatorFeeds', | ||||
|                 path: '/creators/:name/feeds', | ||||
|                 builder: (context, state) { | ||||
|                   final name = state.pathParameters['name']!; | ||||
| @@ -108,6 +116,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                 }, | ||||
|                 routes: [ | ||||
|                   GoRoute( | ||||
|                     name: 'creatorFeedNew', | ||||
|                     path: 'new', | ||||
|                     builder: (context, state) { | ||||
|                       return WebFeedNewScreen( | ||||
| @@ -116,6 +125,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                     }, | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'creatorFeedEdit', | ||||
|                     path: ':feedId', | ||||
|                     builder: (context, state) { | ||||
|                       return WebFeedEditScreen( | ||||
| @@ -127,6 +137,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                 ], | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'creatorPosts', | ||||
|                 path: '/creators/:name/posts', | ||||
|                 builder: (context, state) { | ||||
|                   final name = state.pathParameters['name']!; | ||||
| @@ -134,6 +145,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                 }, | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'creatorStickers', | ||||
|                 path: '/creators/:name/stickers', | ||||
|                 builder: (context, state) { | ||||
|                   final name = state.pathParameters['name']!; | ||||
| @@ -141,6 +153,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                 }, | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'creatorStickerPackNew', | ||||
|                 path: '/creators/:name/stickers/new', | ||||
|                 builder: (context, state) { | ||||
|                   final name = state.pathParameters['name']!; | ||||
| @@ -148,6 +161,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                 }, | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'creatorStickerPackEdit', | ||||
|                 path: '/creators/:name/stickers/:packId/edit', | ||||
|                 builder: (context, state) { | ||||
|                   final name = state.pathParameters['name']!; | ||||
| @@ -156,6 +170,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                 }, | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'creatorStickerPackDetail', | ||||
|                 path: '/creators/:name/stickers/:packId', | ||||
|                 builder: (context, state) { | ||||
|                   final name = state.pathParameters['name']!; | ||||
| @@ -164,6 +179,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                 }, | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'creatorStickerNew', | ||||
|                 path: '/creators/:name/stickers/:packId/new', | ||||
|                 builder: (context, state) { | ||||
|                   final packId = state.pathParameters['packId']!; | ||||
| @@ -171,6 +187,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                 }, | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'creatorStickerEdit', | ||||
|                 path: '/creators/:name/stickers/:packId/:id/edit', | ||||
|                 builder: (context, state) { | ||||
|                   final packId = state.pathParameters['packId']!; | ||||
| @@ -179,10 +196,12 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                 }, | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'creatorNew', | ||||
|                 path: '/creators/new', | ||||
|                 builder: (context, state) => const NewPublisherScreen(), | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'creatorEdit', | ||||
|                 path: '/creators/:name/edit', | ||||
|                 builder: (context, state) { | ||||
|                   final name = state.pathParameters['name']!; | ||||
| @@ -197,10 +216,12 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                     DeveloperHubShellScreen(child: child), | ||||
|             routes: [ | ||||
|               GoRoute( | ||||
|                 name: 'developerHub', | ||||
|                 path: '/developers', | ||||
|                 builder: (context, state) => const DeveloperHubScreen(), | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'developerApps', | ||||
|                 path: '/developers/:name/apps', | ||||
|                 builder: | ||||
|                     (context, state) => CustomAppsScreen( | ||||
| @@ -208,6 +229,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                     ), | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'developerAppNew', | ||||
|                 path: '/developers/:name/apps/new', | ||||
|                 builder: | ||||
|                     (context, state) => NewCustomAppScreen( | ||||
| @@ -215,6 +237,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                     ), | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'developerAppEdit', | ||||
|                 path: '/developers/:name/apps/:id', | ||||
|                 builder: | ||||
|                     (context, state) => EditAppScreen( | ||||
| @@ -227,10 +250,12 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|  | ||||
|           // Web articles | ||||
|           GoRoute( | ||||
|             name: 'articles', | ||||
|             path: '/feeds/articles', | ||||
|             builder: (context, state) => const ArticlesScreen(), | ||||
|           ), | ||||
|           GoRoute( | ||||
|             name: 'articleDetail', | ||||
|             path: '/feeds/articles/:id', | ||||
|             builder: (context, state) { | ||||
|               final id = state.pathParameters['id']!; | ||||
| @@ -240,24 +265,43 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|  | ||||
|           // Auth routes | ||||
|           GoRoute( | ||||
|             name: 'login', | ||||
|             path: '/auth/login', | ||||
|             builder: (context, state) => const LoginScreen(), | ||||
|           ), | ||||
|           GoRoute( | ||||
|             name: 'createAccount', | ||||
|             path: '/auth/create-account', | ||||
|             builder: (context, state) => const CreateAccountScreen(), | ||||
|           ), | ||||
|  | ||||
|           // Other routes | ||||
|           GoRoute( | ||||
|             name: 'settings', | ||||
|             path: '/settings', | ||||
|             builder: (context, state) => const SettingsScreen(), | ||||
|           ), | ||||
|           GoRoute( | ||||
|             name: 'about', | ||||
|             path: '/about', | ||||
|             builder: (context, state) => const AboutScreen(), | ||||
|           ), | ||||
|  | ||||
|           GoRoute( | ||||
|             name: 'reportList', | ||||
|             path: '/safety/reports/me', | ||||
|             builder: (context, state) => const AbuseReportListScreen(), | ||||
|           ), | ||||
|  | ||||
|           GoRoute( | ||||
|             name: 'reportDetail', | ||||
|             path: '/safety/reports/me/:id', | ||||
|             builder: (context, state) { | ||||
|               final id = state.pathParameters['id']!; | ||||
|               return AbuseReportDetailScreen(reportId: id); | ||||
|             }, | ||||
|           ), | ||||
|  | ||||
|           // Main tabs with TabsScreen shell | ||||
|           ShellRoute( | ||||
|             navigatorKey: _tabsShellKey, | ||||
| @@ -266,37 +310,36 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|             }, | ||||
|             routes: [ | ||||
|               // Explore tab | ||||
|               ShellRoute( | ||||
|                 builder: | ||||
|                     (context, state, child) => ExploreShellScreen(child: child), | ||||
|                 routes: [ | ||||
|                   GoRoute( | ||||
|                     path: '/', | ||||
|                     builder: (context, state) => const ExploreScreen(), | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     path: '/posts/search', | ||||
|                     builder: (context, state) => const PostSearchScreen(), | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     path: '/posts/:id', | ||||
|                     builder: (context, state) { | ||||
|                       final id = state.pathParameters['id']!; | ||||
|                       return PostDetailScreen(id: id); | ||||
|                     }, | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     path: '/publishers/:name', | ||||
|                     builder: (context, state) { | ||||
|                       final name = state.pathParameters['name']!; | ||||
|                       return PublisherProfileScreen(name: name); | ||||
|                     }, | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     path: '/discovery/realms', | ||||
|                     builder: (context, state) => const DiscoveryRealmsScreen(), | ||||
|                   ), | ||||
|                 ], | ||||
|               GoRoute( | ||||
|                 name: 'explore', | ||||
|                 path: '/', | ||||
|                 builder: (context, state) => const ExploreScreen(), | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'postSearch', | ||||
|                 path: '/posts/search', | ||||
|                 builder: (context, state) => const PostSearchScreen(), | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'postDetail', | ||||
|                 path: '/posts/:id', | ||||
|                 builder: (context, state) { | ||||
|                   final id = state.pathParameters['id']!; | ||||
|                   return PostDetailScreen(id: id); | ||||
|                 }, | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'publisherProfile', | ||||
|                 path: '/publishers/:name', | ||||
|                 builder: (context, state) { | ||||
|                   final name = state.pathParameters['name']!; | ||||
|                   return PublisherProfileScreen(name: name); | ||||
|                 }, | ||||
|               ), | ||||
|               GoRoute( | ||||
|                 name: 'discoveryRealms', | ||||
|                 path: '/discovery/realms', | ||||
|                 builder: (context, state) => const DiscoveryRealmsScreen(), | ||||
|               ), | ||||
|  | ||||
|               // Chat tab | ||||
| @@ -305,14 +348,17 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                     (context, state, child) => ChatShellScreen(child: child), | ||||
|                 routes: [ | ||||
|                   GoRoute( | ||||
|                     name: 'chatList', | ||||
|                     path: '/chat', | ||||
|                     builder: (context, state) => const ChatListScreen(), | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'chatNew', | ||||
|                     path: '/chat/new', | ||||
|                     builder: (context, state) => const NewChatScreen(), | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'chatRoom', | ||||
|                     path: '/chat/:id', | ||||
|                     builder: (context, state) { | ||||
|                       final id = state.pathParameters['id']!; | ||||
| @@ -320,6 +366,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                     }, | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'chatEdit', | ||||
|                     path: '/chat/:id/edit', | ||||
|                     builder: (context, state) { | ||||
|                       final id = state.pathParameters['id']!; | ||||
| @@ -327,6 +374,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                     }, | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'chatDetail', | ||||
|                     path: '/chat/:id/detail', | ||||
|                     builder: (context, state) { | ||||
|                       final id = state.pathParameters['id']!; | ||||
| @@ -338,14 +386,17 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|  | ||||
|               // Realms tab | ||||
|               GoRoute( | ||||
|                 name: 'realmList', | ||||
|                 path: '/realms', | ||||
|                 builder: (context, state) => const RealmListScreen(), | ||||
|                 routes: [ | ||||
|                   GoRoute( | ||||
|                     name: 'realmNew', | ||||
|                     path: 'new', | ||||
|                     builder: (context, state) => const NewRealmScreen(), | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'realmDetail', | ||||
|                     path: ':slug', | ||||
|                     builder: (context, state) { | ||||
|                       final slug = state.pathParameters['slug']!; | ||||
| @@ -353,6 +404,7 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                     }, | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'realmEdit', | ||||
|                     path: ':slug/edit', | ||||
|                     builder: (context, state) { | ||||
|                       final slug = state.pathParameters['slug']!; | ||||
| @@ -368,22 +420,27 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                     (context, state, child) => AccountShellScreen(child: child), | ||||
|                 routes: [ | ||||
|                   GoRoute( | ||||
|                     name: 'account', | ||||
|                     path: '/account', | ||||
|                     builder: (context, state) => const AccountScreen(), | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'notifications', | ||||
|                     path: '/account/notifications', | ||||
|                     builder: (context, state) => const NotificationScreen(), | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'wallet', | ||||
|                     path: '/account/wallet', | ||||
|                     builder: (context, state) => const WalletScreen(), | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'relationships', | ||||
|                     path: '/account/relationships', | ||||
|                     builder: (context, state) => const RelationshipScreen(), | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'accountProfile', | ||||
|                     path: '/account/:name', | ||||
|                     builder: (context, state) { | ||||
|                       final name = state.pathParameters['name']!; | ||||
| @@ -391,15 +448,18 @@ final routerProvider = Provider<GoRouter>((ref) { | ||||
|                     }, | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'profileUpdate', | ||||
|                     path: '/account/me/update', | ||||
|                     builder: (context, state) => const UpdateProfileScreen(), | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     name: 'leveling', | ||||
|                     path: '/account/me/leveling', | ||||
|                     builder: (context, state) => const LevelingScreen(), | ||||
|                   ), | ||||
|                   GoRoute( | ||||
|                     path: '/account/settings', | ||||
|                     name: 'accountSettings', | ||||
|                     path: '/account/me/settings', | ||||
|                     builder: (context, state) => const AccountSettingsScreen(), | ||||
|                   ), | ||||
|                 ], | ||||
| @@ -426,6 +486,10 @@ class AppRouter { | ||||
|     context.push(path); | ||||
|   } | ||||
|  | ||||
|   static void pushNamed(BuildContext context, String name) { | ||||
|     context.pushNamed(name); | ||||
|   } | ||||
|  | ||||
|   static void pop(BuildContext context) { | ||||
|     context.pop(); | ||||
|   } | ||||
|   | ||||
| @@ -1,17 +1,19 @@ | ||||
| import 'dart:io'; | ||||
|  | ||||
| import 'package:device_info_plus/device_info_plus.dart'; | ||||
| import 'package:flutter/foundation.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:flutter/services.dart'; | ||||
| import 'package:gap/gap.dart'; | ||||
| import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||||
| import 'package:island/pods/network.dart'; | ||||
| import 'package:island/services/notify.dart'; | ||||
| import 'package:island/services/udid.native.dart'; | ||||
| import 'package:island/widgets/alert.dart'; | ||||
| import 'package:island/widgets/app_scaffold.dart'; | ||||
| import 'package:material_symbols_icons/symbols.dart'; | ||||
| import 'package:package_info_plus/package_info_plus.dart'; | ||||
| import 'package:styled_widget/styled_widget.dart'; | ||||
| import 'package:url_launcher/url_launcher.dart'; | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:url_launcher/url_launcher_string.dart'; | ||||
|  | ||||
| class AboutScreen extends ConsumerStatefulWidget { | ||||
|   const AboutScreen({super.key}); | ||||
| @@ -90,7 +92,7 @@ class _AboutScreenState extends ConsumerState<AboutScreen> { | ||||
|   Widget build(BuildContext context) { | ||||
|     final theme = Theme.of(context); | ||||
|  | ||||
|     return Scaffold( | ||||
|     return AppScaffold( | ||||
|       appBar: AppBar(title: Text('about'.tr()), elevation: 0), | ||||
|       body: | ||||
|           _isLoading | ||||
| @@ -167,34 +169,16 @@ class _AboutScreenState extends ConsumerState<AboutScreen> { | ||||
|                           _buildInfoItem( | ||||
|                             context, | ||||
|                             icon: Symbols.label, | ||||
|                             label: 'Device Name', | ||||
|                             label: 'aboutDeviceName'.tr(), | ||||
|                             value: _deviceInfo?.data['name'], | ||||
|                           ), | ||||
|                           _buildInfoItem( | ||||
|                             context, | ||||
|                             icon: Symbols.fingerprint, | ||||
|                             label: 'Device Identifier', | ||||
|                             label: 'aboutDeviceIdentifier'.tr(), | ||||
|                             value: _deviceUdid ?? 'N/A', | ||||
|                             copyable: true, | ||||
|                           ), | ||||
|                           const Divider(height: 1), | ||||
|                           _buildListTile( | ||||
|                             context, | ||||
|                             icon: Symbols.notifications_active, | ||||
|                             title: 'Reactivate Push Notifications', | ||||
|                             onTap: () async { | ||||
|                               showLoadingModal(context); | ||||
|                               try { | ||||
|                                 await subscribePushNotification( | ||||
|                                   ref.watch(apiClientProvider), | ||||
|                                 ); | ||||
|                               } catch (err) { | ||||
|                                 showErrorAlert(err); | ||||
|                               } finally { | ||||
|                                 if (context.mounted) hideLoadingModal(context); | ||||
|                               } | ||||
|                             }, | ||||
|                           ), | ||||
|                         ], | ||||
|                       ), | ||||
|  | ||||
| @@ -265,6 +249,18 @@ class _AboutScreenState extends ConsumerState<AboutScreen> { | ||||
|                                 'https://github.com/Solsynth/Solian/blob/v3/LICENSE.txt', | ||||
|                               ), | ||||
|                         ), | ||||
|                         if (kIsWeb || !(Platform.isMacOS || Platform.isIOS)) | ||||
|                           _buildListTile( | ||||
|                             context, | ||||
|                             icon: Symbols.favorite, | ||||
|                             title: 'donate'.tr(), | ||||
|                             subtitle: 'donateDescription'.tr(), | ||||
|                             onTap: () { | ||||
|                               launchUrlString( | ||||
|                                 'https://afdian.com/@littlesheep', | ||||
|                               ); | ||||
|                             }, | ||||
|                           ), | ||||
|                       ], | ||||
|                     ), | ||||
|  | ||||
|   | ||||
| @@ -98,7 +98,10 @@ class AccountScreen extends HookConsumerWidget { | ||||
|                           radius: 24, | ||||
|                         ), | ||||
|                         onTap: () { | ||||
|                           context.push('/account/${user.value!.name}'); | ||||
|                           context.pushNamed( | ||||
|                             'accountProfile', | ||||
|                             pathParameters: {'name': user.value!.name}, | ||||
|                           ); | ||||
|                         }, | ||||
|                       ), | ||||
|                       Expanded( | ||||
| @@ -143,7 +146,7 @@ class AccountScreen extends HookConsumerWidget { | ||||
|                 progress: user.value!.profile.levelingProgress, | ||||
|               ), | ||||
|               onTap: () { | ||||
|                 context.push('/account/me/leveling'); | ||||
|                 context.pushNamed('leveling'); | ||||
|               }, | ||||
|             ).padding(horizontal: 12), | ||||
|             Row( | ||||
| @@ -161,7 +164,7 @@ class AccountScreen extends HookConsumerWidget { | ||||
|                         ], | ||||
|                       ).padding(horizontal: 16, vertical: 12), | ||||
|                       onTap: () { | ||||
|                         context.push('/creators'); | ||||
|                         context.pushNamed('creatorHub'); | ||||
|                       }, | ||||
|                     ), | ||||
|                   ).height(140), | ||||
| @@ -179,7 +182,7 @@ class AccountScreen extends HookConsumerWidget { | ||||
|                         ], | ||||
|                       ).padding(horizontal: 16, vertical: 12), | ||||
|                       onTap: () { | ||||
|                         context.push('/developers'); | ||||
|                         context.pushNamed('developerHub'); | ||||
|                       }, | ||||
|                     ), | ||||
|                   ).height(140), | ||||
| @@ -202,7 +205,7 @@ class AccountScreen extends HookConsumerWidget { | ||||
|                 ], | ||||
|               ), | ||||
|               onTap: () { | ||||
|                 context.push('/account/notifications'); | ||||
|                 context.pushNamed('notifications'); | ||||
|               }, | ||||
|             ), | ||||
|             ListTile( | ||||
| @@ -212,7 +215,7 @@ class AccountScreen extends HookConsumerWidget { | ||||
|               contentPadding: EdgeInsets.symmetric(horizontal: 24), | ||||
|               title: Text('wallet').tr(), | ||||
|               onTap: () { | ||||
|                 context.push('/account/wallet'); | ||||
|                 context.pushNamed('wallet'); | ||||
|               }, | ||||
|             ), | ||||
|             ListTile( | ||||
| @@ -222,9 +225,17 @@ class AccountScreen extends HookConsumerWidget { | ||||
|               contentPadding: EdgeInsets.symmetric(horizontal: 24), | ||||
|               title: Text('relationships').tr(), | ||||
|               onTap: () { | ||||
|                 context.push('/account/relationship'); | ||||
|                 context.pushNamed('relationships'); | ||||
|               }, | ||||
|             ), | ||||
|             ListTile( | ||||
|               minTileHeight: 48, | ||||
|               title: Text('abuseReports').tr(), | ||||
|               contentPadding: const EdgeInsets.only(left: 24, right: 17), | ||||
|               leading: const Icon(Symbols.gavel), | ||||
|               trailing: const Icon(Symbols.chevron_right), | ||||
|               onTap: () => context.pushNamed('reportList'), | ||||
|             ), | ||||
|             const Divider(height: 1).padding(vertical: 8), | ||||
|             ListTile( | ||||
|               minTileHeight: 48, | ||||
| @@ -233,7 +244,7 @@ class AccountScreen extends HookConsumerWidget { | ||||
|               contentPadding: EdgeInsets.symmetric(horizontal: 24), | ||||
|               title: Text('appSettings').tr(), | ||||
|               onTap: () { | ||||
|                 context.push('/settings'); | ||||
|                 context.pushNamed('settings'); | ||||
|               }, | ||||
|             ), | ||||
|             ListTile( | ||||
| @@ -243,7 +254,7 @@ class AccountScreen extends HookConsumerWidget { | ||||
|               contentPadding: EdgeInsets.symmetric(horizontal: 24), | ||||
|               title: Text('updateYourProfile').tr(), | ||||
|               onTap: () { | ||||
|                 context.push('/account/me/update'); | ||||
|                 context.pushNamed('profileUpdate'); | ||||
|               }, | ||||
|             ), | ||||
|             ListTile( | ||||
| @@ -253,7 +264,7 @@ class AccountScreen extends HookConsumerWidget { | ||||
|               contentPadding: EdgeInsets.symmetric(horizontal: 24), | ||||
|               title: Text('accountSettings').tr(), | ||||
|               onTap: () { | ||||
|                 context.push('/account/me/settings'); | ||||
|                 context.pushNamed('accountSettings'); | ||||
|               }, | ||||
|             ), | ||||
|             if (kDebugMode) const Divider(height: 1).padding(vertical: 8), | ||||
| @@ -288,7 +299,7 @@ class AccountScreen extends HookConsumerWidget { | ||||
|               contentPadding: EdgeInsets.symmetric(horizontal: 24), | ||||
|               title: Text('about').tr(), | ||||
|               onTap: () { | ||||
|                 context.push('/about'); | ||||
|                 context.pushNamed('about'); | ||||
|               }, | ||||
|             ), | ||||
|             ListTile( | ||||
| @@ -328,7 +339,7 @@ class _UnauthorizedAccountScreen extends StatelessWidget { | ||||
|                   child: Card( | ||||
|                     child: InkWell( | ||||
|                       onTap: () { | ||||
|                         context.push('/auth/create'); | ||||
|                         context.pushNamed('createAccount'); | ||||
|                       }, | ||||
|                       child: Padding( | ||||
|                         padding: const EdgeInsets.all(16), | ||||
| @@ -350,7 +361,7 @@ class _UnauthorizedAccountScreen extends StatelessWidget { | ||||
|                   child: Card( | ||||
|                     child: InkWell( | ||||
|                       onTap: () { | ||||
|                         context.push('/auth/login'); | ||||
|                         context.pushNamed('login'); | ||||
|                       }, | ||||
|                       child: Padding( | ||||
|                         padding: const EdgeInsets.all(16), | ||||
| @@ -372,13 +383,13 @@ class _UnauthorizedAccountScreen extends StatelessWidget { | ||||
|                   children: [ | ||||
|                     TextButton( | ||||
|                       onPressed: () { | ||||
|                         context.push('/about'); | ||||
|                         context.pushNamed('about'); | ||||
|                       }, | ||||
|                       child: Text('about').tr(), | ||||
|                     ), | ||||
|                     TextButton( | ||||
|                       onPressed: () { | ||||
|                         context.push('/settings'); | ||||
|                         context.pushNamed('settings'); | ||||
|                       }, | ||||
|                       child: Text('appSettings').tr(), | ||||
|                     ), | ||||
|   | ||||
| @@ -27,7 +27,7 @@ part 'leveling.g.dart'; | ||||
| Future<SnWalletSubscription?> accountStellarSubscription(Ref ref) async { | ||||
|   try { | ||||
|     final client = ref.watch(apiClientProvider); | ||||
|     final resp = await client.get('/subscriptions/fuzzy/solian.stellar'); | ||||
|     final resp = await client.get('/id/subscriptions/fuzzy/solian.stellar'); | ||||
|     return SnWalletSubscription.fromJson(resp.data); | ||||
|   } catch (err) { | ||||
|     if (err is DioException && err.response?.statusCode == 404) return null; | ||||
| @@ -432,7 +432,7 @@ class LevelingScreen extends HookConsumerWidget { | ||||
|         'id': 'solian.stellar.nova', | ||||
|         'name': 'membershipTierNova'.tr(), | ||||
|         'price': 'membershipPriceNova'.tr(), | ||||
|         'color': Colors.indigo, | ||||
|         'color': Color.fromRGBO(57, 197, 187, 1), | ||||
|       }, | ||||
|       { | ||||
|         'id': 'solian.stellar.supernova', | ||||
|   | ||||
| @@ -28,14 +28,14 @@ part 'settings.g.dart'; | ||||
| @riverpod | ||||
| Future<List<SnAuthFactor>> authFactors(Ref ref) async { | ||||
|   final client = ref.read(apiClientProvider); | ||||
|   final res = await client.get('/accounts/me/factors'); | ||||
|   final res = await client.get('/id/accounts/me/factors'); | ||||
|   return res.data.map<SnAuthFactor>((e) => SnAuthFactor.fromJson(e)).toList(); | ||||
| } | ||||
|  | ||||
| @riverpod | ||||
| Future<List<SnContactMethod>> contactMethods(Ref ref) async { | ||||
|   final client = ref.read(apiClientProvider); | ||||
|   final resp = await client.get('/accounts/me/contacts'); | ||||
|   final resp = await client.get('/id/accounts/me/contacts'); | ||||
|   return resp.data | ||||
|       .map<SnContactMethod>((e) => SnContactMethod.fromJson(e)) | ||||
|       .toList(); | ||||
| @@ -44,7 +44,7 @@ Future<List<SnContactMethod>> contactMethods(Ref ref) async { | ||||
| @riverpod | ||||
| Future<List<SnAccountConnection>> accountConnections(Ref ref) async { | ||||
|   final client = ref.read(apiClientProvider); | ||||
|   final resp = await client.get('/accounts/me/connections'); | ||||
|   final resp = await client.get('/id/accounts/me/connections'); | ||||
|   return resp.data | ||||
|       .map<SnAccountConnection>((e) => SnAccountConnection.fromJson(e)) | ||||
|       .toList(); | ||||
| @@ -68,7 +68,7 @@ class AccountSettingsScreen extends HookConsumerWidget { | ||||
|       try { | ||||
|         showLoadingModal(context); | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.delete('/accounts/me'); | ||||
|         await client.delete('/id/accounts/me'); | ||||
|         if (context.mounted) { | ||||
|           showSnackBar('accountDeletionSent'.tr()); | ||||
|         } | ||||
| @@ -94,7 +94,7 @@ class AccountSettingsScreen extends HookConsumerWidget { | ||||
|         final userInfo = ref.read(userInfoProvider); | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.post( | ||||
|           '/accounts/recovery/password', | ||||
|           '/id/accounts/recovery/password', | ||||
|           data: {'account': userInfo.value!.name, 'captcha_token': captchaTk}, | ||||
|         ); | ||||
|         if (context.mounted) { | ||||
|   | ||||
| @@ -6,7 +6,7 @@ part of 'settings.dart'; | ||||
| // RiverpodGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$authFactorsHash() => r'4bb65bc0c065c4091c209ee81e57ddef41051ae2'; | ||||
| String _$authFactorsHash() => r'24fe2f7b375b019d87fc3b85cbedbe857f399c0f'; | ||||
|  | ||||
| /// See also [authFactors]. | ||||
| @ProviderFor(authFactors) | ||||
| @@ -25,7 +25,7 @@ final authFactorsProvider = | ||||
| @Deprecated('Will be removed in 3.0. Use Ref instead') | ||||
| // ignore: unused_element | ||||
| typedef AuthFactorsRef = AutoDisposeFutureProviderRef<List<SnAuthFactor>>; | ||||
| String _$contactMethodsHash() => r'4d7952fc196dce4dc646314565a49c115fd1d292'; | ||||
| String _$contactMethodsHash() => r'76a1a93f61c51c44b32b4821f5112d58406155f0'; | ||||
|  | ||||
| /// See also [contactMethods]. | ||||
| @ProviderFor(contactMethods) | ||||
| @@ -45,7 +45,7 @@ final contactMethodsProvider = | ||||
| // ignore: unused_element | ||||
| typedef ContactMethodsRef = AutoDisposeFutureProviderRef<List<SnContactMethod>>; | ||||
| String _$accountConnectionsHash() => | ||||
|     r'38a309d596e0ea2539cd92ea86984e1e4fb346e4'; | ||||
|     r'9f69e7f23e3e53c528d38b93d76f0c9efc9a83db'; | ||||
|  | ||||
| /// See also [accountConnections]. | ||||
| @ProviderFor(accountConnections) | ||||
|   | ||||
| @@ -31,7 +31,7 @@ class AuthFactorSheet extends HookConsumerWidget { | ||||
|       try { | ||||
|         showLoadingModal(context); | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.delete('/accounts/me/factors/${factor.id}'); | ||||
|         await client.delete('/id/accounts/me/factors/${factor.id}'); | ||||
|         if (context.mounted) Navigator.pop(context, true); | ||||
|       } catch (err) { | ||||
|         showErrorAlert(err); | ||||
| @@ -49,7 +49,7 @@ class AuthFactorSheet extends HookConsumerWidget { | ||||
|       try { | ||||
|         showLoadingModal(context); | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.post('/accounts/me/factors/${factor.id}/disable'); | ||||
|         await client.post('/id/accounts/me/factors/${factor.id}/disable'); | ||||
|         if (context.mounted) Navigator.pop(context, true); | ||||
|       } catch (err) { | ||||
|         showErrorAlert(err); | ||||
| @@ -106,7 +106,7 @@ class AuthFactorSheet extends HookConsumerWidget { | ||||
|         showLoadingModal(context); | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.post( | ||||
|           '/accounts/me/factors/${factor.id}/enable', | ||||
|           '/id/accounts/me/factors/${factor.id}/enable', | ||||
|           data: jsonEncode(password), | ||||
|         ); | ||||
|         if (context.mounted) Navigator.pop(context, true); | ||||
| @@ -193,7 +193,7 @@ class AuthFactorNewSheet extends HookConsumerWidget { | ||||
|         showLoadingModal(context); | ||||
|         final apiClient = ref.read(apiClientProvider); | ||||
|         final resp = await apiClient.post( | ||||
|           '/accounts/me/factors', | ||||
|           '/id/accounts/me/factors', | ||||
|           data: {'type': factorType.value, 'secret': secretController.text}, | ||||
|         ); | ||||
|         final factor = SnAuthFactor.fromJson(resp.data); | ||||
|   | ||||
| @@ -74,7 +74,7 @@ class AccountConnectionSheet extends HookConsumerWidget { | ||||
|       try { | ||||
|         showLoadingModal(context); | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.delete('/accounts/me/connections/${connection.id}'); | ||||
|         await client.delete('/id/accounts/me/connections/${connection.id}'); | ||||
|         if (context.mounted) Navigator.pop(context, true); | ||||
|       } catch (err) { | ||||
|         showErrorAlert(err); | ||||
| @@ -174,7 +174,7 @@ class AccountConnectionNewSheet extends HookConsumerWidget { | ||||
|             if (context.mounted) showLoadingModal(context); | ||||
|  | ||||
|             await client.post( | ||||
|               '/auth/connect/apple/mobile', | ||||
|               '/id/auth/connect/apple/mobile', | ||||
|               data: { | ||||
|                 'identity_token': credential.identityToken!, | ||||
|                 'authorization_code': credential.authorizationCode, | ||||
| @@ -336,7 +336,7 @@ class AccountConnectionsSheet extends HookConsumerWidget { | ||||
|                                 try { | ||||
|                                   final client = ref.read(apiClientProvider); | ||||
|                                   await client.delete( | ||||
|                                     '/accounts/me/connections/${connection.id}', | ||||
|                                     '/id/accounts/me/connections/${connection.id}', | ||||
|                                   ); | ||||
|                                   ref.invalidate(accountConnectionsProvider); | ||||
|                                   return true; | ||||
|   | ||||
| @@ -25,7 +25,7 @@ class ContactMethodSheet extends HookConsumerWidget { | ||||
|       try { | ||||
|         showLoadingModal(context); | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.delete('/accounts/me/contacts/${contact.id}'); | ||||
|         await client.delete('/id/accounts/me/contacts/${contact.id}'); | ||||
|         if (context.mounted) Navigator.pop(context, true); | ||||
|       } catch (err) { | ||||
|         showErrorAlert(err); | ||||
| @@ -38,7 +38,7 @@ class ContactMethodSheet extends HookConsumerWidget { | ||||
|       try { | ||||
|         showLoadingModal(context); | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.post('/accounts/me/contacts/${contact.id}/verify'); | ||||
|         await client.post('/id/accounts/me/contacts/${contact.id}/verify'); | ||||
|         if (context.mounted) { | ||||
|           showSnackBar('contactMethodVerificationSent'.tr()); | ||||
|         } | ||||
| @@ -53,7 +53,7 @@ class ContactMethodSheet extends HookConsumerWidget { | ||||
|       try { | ||||
|         showLoadingModal(context); | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.post('/accounts/me/contacts/${contact.id}/primary'); | ||||
|         await client.post('/id/accounts/me/contacts/${contact.id}/primary'); | ||||
|         if (context.mounted) Navigator.pop(context, true); | ||||
|       } catch (err) { | ||||
|         showErrorAlert(err); | ||||
| @@ -160,7 +160,7 @@ class ContactMethodNewSheet extends HookConsumerWidget { | ||||
|         showLoadingModal(context); | ||||
|         final apiClient = ref.read(apiClientProvider); | ||||
|         await apiClient.post( | ||||
|           '/accounts/me/contacts', | ||||
|           '/id/accounts/me/contacts', | ||||
|           data: {'type': contactType.value, 'content': contentController.text}, | ||||
|         ); | ||||
|         if (context.mounted) { | ||||
|   | ||||
| @@ -77,7 +77,7 @@ class UpdateProfileScreen extends HookConsumerWidget { | ||||
|         } | ||||
|         final client = ref.watch(apiClientProvider); | ||||
|         await client.patch( | ||||
|           '/accounts/me/profile', | ||||
|           '/id/accounts/me/profile', | ||||
|           data: {'${position}_id': cloudFile.id}, | ||||
|         ); | ||||
|         final userNotifier = ref.read(userInfoProvider.notifier); | ||||
| @@ -102,7 +102,7 @@ class UpdateProfileScreen extends HookConsumerWidget { | ||||
|       try { | ||||
|         final client = ref.watch(apiClientProvider); | ||||
|         await client.patch( | ||||
|           '/accounts/me', | ||||
|           '/id/accounts/me', | ||||
|           data: { | ||||
|             'name': usernameController.text, | ||||
|             'nick': nicknameController.text, | ||||
| @@ -154,7 +154,7 @@ class UpdateProfileScreen extends HookConsumerWidget { | ||||
|       try { | ||||
|         final client = ref.watch(apiClientProvider); | ||||
|         await client.patch( | ||||
|           '/accounts/me/profile', | ||||
|           '/id/accounts/me/profile', | ||||
|           data: { | ||||
|             'bio': bioController.text, | ||||
|             'first_name': firstNameController.text, | ||||
|   | ||||
| @@ -22,6 +22,7 @@ import 'package:island/widgets/account/status.dart'; | ||||
| import 'package:island/widgets/alert.dart'; | ||||
| import 'package:island/widgets/app_scaffold.dart'; | ||||
| import 'package:island/widgets/content/cloud_files.dart'; | ||||
| import 'package:island/widgets/safety/abuse_report_helper.dart'; | ||||
| import 'package:material_symbols_icons/symbols.dart'; | ||||
| import 'package:palette_generator/palette_generator.dart'; | ||||
| import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||||
| @@ -38,14 +39,14 @@ Future<SnAccount> account(Ref ref, String uname) async { | ||||
|     } | ||||
|   } | ||||
|   final apiClient = ref.watch(apiClientProvider); | ||||
|   final resp = await apiClient.get("/accounts/$uname"); | ||||
|   final resp = await apiClient.get("/id/accounts/$uname"); | ||||
|   return SnAccount.fromJson(resp.data); | ||||
| } | ||||
|  | ||||
| @riverpod | ||||
| Future<List<SnAccountBadge>> accountBadges(Ref ref, String uname) async { | ||||
|   final apiClient = ref.watch(apiClientProvider); | ||||
|   final resp = await apiClient.get("/accounts/$uname/badges"); | ||||
|   final resp = await apiClient.get("/id/accounts/$uname/badges"); | ||||
|   return List<SnAccountBadge>.from( | ||||
|     resp.data.map((x) => SnAccountBadge.fromJson(x)), | ||||
|   ); | ||||
| @@ -77,7 +78,7 @@ Future<SnChatRoom?> accountDirectChat(Ref ref, String uname) async { | ||||
|   final account = await ref.watch(accountProvider(uname).future); | ||||
|   final apiClient = ref.watch(apiClientProvider); | ||||
|   try { | ||||
|     final resp = await apiClient.get("/chat/direct/${account.id}"); | ||||
|     final resp = await apiClient.get("/sphere/chat/direct/${account.id}"); | ||||
|     return SnChatRoom.fromJson(resp.data); | ||||
|   } catch (err) { | ||||
|     if (err is DioException && err.response?.statusCode == 404) { | ||||
| @@ -94,7 +95,7 @@ Future<SnRelationship?> accountRelationship(Ref ref, String uname) async { | ||||
|   final account = await ref.watch(accountProvider(uname).future); | ||||
|   final apiClient = ref.watch(apiClientProvider); | ||||
|   try { | ||||
|     final resp = await apiClient.get("/relationships/${account.id}"); | ||||
|     final resp = await apiClient.get("/id/relationships/${account.id}"); | ||||
|     return SnRelationship.fromJson(resp.data); | ||||
|   } catch (err) { | ||||
|     if (err is DioException && err.response?.statusCode == 404) { | ||||
| @@ -134,7 +135,24 @@ class AccountProfileScreen extends HookConsumerWidget { | ||||
|       showLoadingModal(context); | ||||
|       try { | ||||
|         final client = ref.watch(apiClientProvider); | ||||
|         await client.post('/relationships/${account.value!.id}/friends'); | ||||
|         await client.post('/id/relationships/${account.value!.id}/friends'); | ||||
|         ref.invalidate(accountRelationshipProvider(name)); | ||||
|       } catch (err) { | ||||
|         showErrorAlert(err); | ||||
|       } finally { | ||||
|         if (context.mounted) hideLoadingModal(context); | ||||
|       } | ||||
|     } | ||||
|  | ||||
|     Future<void> blockAction() async { | ||||
|       showLoadingModal(context); | ||||
|       try { | ||||
|         final client = ref.watch(apiClientProvider); | ||||
|         if (accountRelationship.value == null) { | ||||
|           await client.post('/id/relationships/${account.value!.id}/block'); | ||||
|         } else { | ||||
|           await client.delete('/id/relationships/${account.value!.id}/block'); | ||||
|         } | ||||
|         ref.invalidate(accountRelationshipProvider(name)); | ||||
|       } catch (err) { | ||||
|         showErrorAlert(err); | ||||
| @@ -146,18 +164,23 @@ class AccountProfileScreen extends HookConsumerWidget { | ||||
|     Future<void> directMessageAction() async { | ||||
|       if (!account.hasValue) return; | ||||
|       if (accountChat.value != null) { | ||||
|         context.push('/chat/${accountChat.value!.id}'); | ||||
|         context.pushNamed( | ||||
|           'chatRoom', | ||||
|           pathParameters: {'id': accountChat.value!.id}, | ||||
|         ); | ||||
|         return; | ||||
|       } | ||||
|       showLoadingModal(context); | ||||
|       try { | ||||
|         final client = ref.watch(apiClientProvider); | ||||
|         final resp = await client.post( | ||||
|           '/chat/direct', | ||||
|           '/sphere/chat/direct', | ||||
|           data: {'related_user_id': account.value!.id}, | ||||
|         ); | ||||
|         final chat = SnChatRoom.fromJson(resp.data); | ||||
|         if (context.mounted) context.push('/chat/${chat.id}'); | ||||
|         if (context.mounted) { | ||||
|           context.pushNamed('chatRoom', pathParameters: {'id': chat.id}); | ||||
|         } | ||||
|         ref.invalidate(accountDirectChatProvider(name)); | ||||
|       } catch (err) { | ||||
|         showErrorAlert(err); | ||||
| @@ -396,49 +419,108 @@ class AccountProfileScreen extends HookConsumerWidget { | ||||
|                     child: Row( | ||||
|                       spacing: 8, | ||||
|                       children: [ | ||||
|                         Expanded( | ||||
|                           child: FilledButton.icon( | ||||
|                             style: ButtonStyle( | ||||
|                               backgroundColor: WidgetStatePropertyAll( | ||||
|                                 accountRelationship.value == null | ||||
|                                     ? null | ||||
|                                     : Theme.of(context).colorScheme.secondary, | ||||
|                               ), | ||||
|                               foregroundColor: WidgetStatePropertyAll( | ||||
|                                 accountRelationship.value == null | ||||
|                                     ? null | ||||
|                                     : Theme.of(context).colorScheme.onSecondary, | ||||
|                               ), | ||||
|                             ), | ||||
|                             onPressed: relationshipAction, | ||||
|                             label: | ||||
|                                 Text( | ||||
|                         if (accountRelationship.value == null || | ||||
|                             accountRelationship.value!.status > -100) | ||||
|                           Expanded( | ||||
|                             child: FilledButton.icon( | ||||
|                               style: ButtonStyle( | ||||
|                                 backgroundColor: WidgetStatePropertyAll( | ||||
|                                   accountRelationship.value == null | ||||
|                                       ? 'addFriendShort' | ||||
|                                       : 'added', | ||||
|                                 ).tr(), | ||||
|                             icon: | ||||
|                                 accountRelationship.value == null | ||||
|                                     ? const Icon(Symbols.person_add) | ||||
|                                     : const Icon(Symbols.person_check), | ||||
|                                       ? null | ||||
|                                       : Theme.of(context).colorScheme.secondary, | ||||
|                                 ), | ||||
|                                 foregroundColor: WidgetStatePropertyAll( | ||||
|                                   accountRelationship.value == null | ||||
|                                       ? null | ||||
|                                       : Theme.of( | ||||
|                                         context, | ||||
|                                       ).colorScheme.onSecondary, | ||||
|                                 ), | ||||
|                               ), | ||||
|                               onPressed: relationshipAction, | ||||
|                               label: | ||||
|                                   Text( | ||||
|                                     accountRelationship.value == null | ||||
|                                         ? 'addFriendShort' | ||||
|                                         : 'added', | ||||
|                                   ).tr(), | ||||
|                               icon: | ||||
|                                   accountRelationship.value == null | ||||
|                                       ? const Icon(Symbols.person_add) | ||||
|                                       : const Icon(Symbols.person_check), | ||||
|                             ), | ||||
|                           ), | ||||
|                         ), | ||||
|                         Expanded( | ||||
|                           child: FilledButton.icon( | ||||
|                             onPressed: directMessageAction, | ||||
|                             icon: const Icon(Symbols.message), | ||||
|                             label: | ||||
|                                 Text( | ||||
|                                   accountChat.value == null | ||||
|                                       ? 'createDirectMessage' | ||||
|                                       : 'gotoDirectMessage', | ||||
|                                   maxLines: 1, | ||||
|                                 ).tr(), | ||||
|                         if (accountRelationship.value == null || | ||||
|                             accountRelationship.value!.status <= -100) | ||||
|                           Expanded( | ||||
|                             child: FilledButton.icon( | ||||
|                               style: ButtonStyle( | ||||
|                                 backgroundColor: WidgetStatePropertyAll( | ||||
|                                   accountRelationship.value == null | ||||
|                                       ? null | ||||
|                                       : Theme.of(context).colorScheme.secondary, | ||||
|                                 ), | ||||
|                                 foregroundColor: WidgetStatePropertyAll( | ||||
|                                   accountRelationship.value == null | ||||
|                                       ? null | ||||
|                                       : Theme.of( | ||||
|                                         context, | ||||
|                                       ).colorScheme.onSecondary, | ||||
|                                 ), | ||||
|                               ), | ||||
|                               onPressed: blockAction, | ||||
|                               label: | ||||
|                                   Text( | ||||
|                                     accountRelationship.value == null | ||||
|                                         ? 'blockUser' | ||||
|                                         : 'unblockUser', | ||||
|                                   ).tr(), | ||||
|                               icon: | ||||
|                                   accountRelationship.value == null | ||||
|                                       ? const Icon(Symbols.block) | ||||
|                                       : const Icon(Symbols.person_cancel), | ||||
|                             ), | ||||
|                           ), | ||||
|                         ), | ||||
|                       ], | ||||
|                     ).padding(horizontal: 16), | ||||
|                   ), | ||||
|                 SliverToBoxAdapter( | ||||
|                   child: Row( | ||||
|                     spacing: 8, | ||||
|                     children: [ | ||||
|                       Expanded( | ||||
|                         child: FilledButton.icon( | ||||
|                           onPressed: directMessageAction, | ||||
|                           icon: const Icon(Symbols.message), | ||||
|                           label: | ||||
|                               Text( | ||||
|                                 accountChat.value == null | ||||
|                                     ? 'createDirectMessage' | ||||
|                                     : 'gotoDirectMessage', | ||||
|                                 maxLines: 1, | ||||
|                               ).tr(), | ||||
|                         ), | ||||
|                       ), | ||||
|                       IconButton.filled( | ||||
|                         onPressed: () { | ||||
|                           showAbuseReportSheet( | ||||
|                             context, | ||||
|                             resourceIdentifier: 'account/${data.id}', | ||||
|                           ); | ||||
|                         }, | ||||
|                         icon: Icon( | ||||
|                           Symbols.flag, | ||||
|                           color: Theme.of(context).colorScheme.onError, | ||||
|                         ), | ||||
|                         style: ButtonStyle( | ||||
|                           backgroundColor: WidgetStatePropertyAll( | ||||
|                             Theme.of(context).colorScheme.error, | ||||
|                           ), | ||||
|                         ), | ||||
|                       ), | ||||
|                     ], | ||||
|                   ).padding(horizontal: 16, top: 4), | ||||
|                 ), | ||||
|                 SliverToBoxAdapter( | ||||
|                   child: const Divider(height: 1).padding(top: 12), | ||||
|                 ), | ||||
|   | ||||
| @@ -6,7 +6,7 @@ part of 'profile.dart'; | ||||
| // RiverpodGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$accountHash() => r'd2b0579617e6264452d98f47f695a9cdf45b24ec'; | ||||
| String _$accountHash() => r'ce7264a04f69e32a5cb07bc10ca5fa47ae1fddaa'; | ||||
|  | ||||
| /// Copied from Dart SDK | ||||
| class _SystemHash { | ||||
| @@ -145,7 +145,7 @@ class _AccountProviderElement | ||||
|   String get uname => (origin as AccountProvider).uname; | ||||
| } | ||||
|  | ||||
| String _$accountBadgesHash() => r'4bfe5fb0d6ac0d4cde4563460bde289289188f6d'; | ||||
| String _$accountBadgesHash() => r'1de05e122c23ff2c6ac6d318977165761e2ad177'; | ||||
|  | ||||
| /// See also [accountBadges]. | ||||
| @ProviderFor(accountBadges) | ||||
| @@ -395,7 +395,7 @@ class _AccountAppbarForcegroundColorProviderElement | ||||
|   String get uname => (origin as AccountAppbarForcegroundColorProvider).uname; | ||||
| } | ||||
|  | ||||
| String _$accountDirectChatHash() => r'60d0015fc2a3c8fc2190bb41d6818cf3027d9d0a'; | ||||
| String _$accountDirectChatHash() => r'149ea3a3730672cfbbb8c16fe1f2caa0bb9f0e17'; | ||||
|  | ||||
| /// See also [accountDirectChat]. | ||||
| @ProviderFor(accountDirectChat) | ||||
| @@ -517,7 +517,7 @@ class _AccountDirectChatProviderElement | ||||
| } | ||||
|  | ||||
| String _$accountRelationshipHash() => | ||||
|     r'cb7d0d3f8cd4f23ad9d2d529872c540dac483d4f'; | ||||
|     r'9a3a4e8c6c6706f73df95feccb86736fcad33f30'; | ||||
|  | ||||
| /// See also [accountRelationship]. | ||||
| @ProviderFor(accountRelationship) | ||||
|   | ||||
| @@ -20,7 +20,7 @@ part 'relationship.g.dart'; | ||||
| @riverpod | ||||
| Future<List<SnRelationship>> sentFriendRequest(Ref ref) async { | ||||
|   final client = ref.read(apiClientProvider); | ||||
|   final resp = await client.get('/relationships/requests'); | ||||
|   final resp = await client.get('/id/relationships/requests'); | ||||
|   return resp.data | ||||
|       .map((e) => SnRelationship.fromJson(e)) | ||||
|       .cast<SnRelationship>() | ||||
| @@ -42,7 +42,7 @@ class RelationshipListNotifier extends _$RelationshipListNotifier | ||||
|     final take = 20; | ||||
|  | ||||
|     final response = await client.get( | ||||
|       '/relationships', | ||||
|       '/id/relationships', | ||||
|       queryParameters: {'offset': offset, 'take': take}, | ||||
|     ); | ||||
|  | ||||
| @@ -221,7 +221,7 @@ class RelationshipScreen extends HookConsumerWidget { | ||||
|       if (result == null) return; | ||||
|  | ||||
|       final client = ref.read(apiClientProvider); | ||||
|       await client.post('/relationships/${result.id}/friends'); | ||||
|       await client.post('/id/relationships/${result.id}/friends'); | ||||
|       ref.invalidate(sentFriendRequestProvider); | ||||
|     } | ||||
|  | ||||
| @@ -235,7 +235,7 @@ class RelationshipScreen extends HookConsumerWidget { | ||||
|         submitting.value = true; | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.post( | ||||
|           '/relationships/${relationship.accountId}/friends/${isAccept ? 'accept' : 'decline'}', | ||||
|           '/id/relationships/${relationship.accountId}/friends/${isAccept ? 'accept' : 'decline'}', | ||||
|         ); | ||||
|         relationshipNotifier.forceRefresh(); | ||||
|         if (!context.mounted) return; | ||||
| @@ -262,7 +262,7 @@ class RelationshipScreen extends HookConsumerWidget { | ||||
|     ) async { | ||||
|       final client = ref.read(apiClientProvider); | ||||
|       await client.patch( | ||||
|         '/relationships/${relationship.accountId}', | ||||
|         '/id/relationships/${relationship.accountId}', | ||||
|         data: {'status': newStatus}, | ||||
|       ); | ||||
|       relationshipNotifier.forceRefresh(); | ||||
| @@ -345,7 +345,7 @@ class _SentFriendRequestsSheet extends HookConsumerWidget { | ||||
|     Future<void> cancelRequest(SnRelationship request) async { | ||||
|       try { | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.delete('/relationships/${request.relatedId}/friends'); | ||||
|         await client.delete('/id/relationships/${request.relatedId}/friends'); | ||||
|         ref.invalidate(sentFriendRequestProvider); | ||||
|       } catch (err) { | ||||
|         showErrorAlert(err); | ||||
|   | ||||
| @@ -6,7 +6,7 @@ part of 'relationship.dart'; | ||||
| // RiverpodGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$sentFriendRequestHash() => r'2efa72835b1740e0fe96bd347bce0f98b6ae80d6'; | ||||
| String _$sentFriendRequestHash() => r'dc02ace6cb755a01ab862c9fcff3b26de7f946cb'; | ||||
|  | ||||
| /// See also [sentFriendRequest]. | ||||
| @ProviderFor(sentFriendRequest) | ||||
| @@ -27,7 +27,7 @@ final sentFriendRequestProvider = | ||||
| typedef SentFriendRequestRef = | ||||
|     AutoDisposeFutureProviderRef<List<SnRelationship>>; | ||||
| String _$relationshipListNotifierHash() => | ||||
|     r'560410cba6e4c26affd91aa86b3666319bd31f24'; | ||||
|     r'0a134ce69489a4f2002d2223853855b6f22e4e9f'; | ||||
|  | ||||
| /// See also [RelationshipListNotifier]. | ||||
| @ProviderFor(RelationshipListNotifier) | ||||
|   | ||||
							
								
								
									
										17
									
								
								lib/screens/auth/captcha.config.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								lib/screens/auth/captcha.config.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||||
| import 'package:island/pods/network.dart'; | ||||
| import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||||
|  | ||||
| part 'captcha.config.g.dart'; | ||||
|  | ||||
| @riverpod | ||||
| Future<String> captchaUrl(Ref ref) async { | ||||
|   final apiClient = ref.watch(apiClientProvider); | ||||
|   final resp = await apiClient.get('/.well-known/services'); | ||||
|   final serviceMapping = await resp.data; | ||||
|   var baseUrl = serviceMapping['DysonNetwork.Pass'] as String; | ||||
|   // The backend using self-signed certicates on development | ||||
|   // Which mobile simulator might not accept, use this to avoid errors | ||||
|   if (baseUrl.contains('https://localhost')) baseUrl = 'http://localhost:5216'; | ||||
|   return '$baseUrl/captcha'; | ||||
| } | ||||
							
								
								
									
										26
									
								
								lib/screens/auth/captcha.config.g.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								lib/screens/auth/captcha.config.g.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
|  | ||||
| part of 'captcha.config.dart'; | ||||
|  | ||||
| // ************************************************************************** | ||||
| // RiverpodGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$captchaUrlHash() => r'bbed0d18272dd205069642b3c6583ea2eef735d1'; | ||||
|  | ||||
| /// See also [captchaUrl]. | ||||
| @ProviderFor(captchaUrl) | ||||
| final captchaUrlProvider = AutoDisposeFutureProvider<String>.internal( | ||||
|   captchaUrl, | ||||
|   name: r'captchaUrlProvider', | ||||
|   debugGetCreateSourceHash: | ||||
|       const bool.fromEnvironment('dart.vm.product') ? null : _$captchaUrlHash, | ||||
|   dependencies: null, | ||||
|   allTransitiveDependencies: null, | ||||
| ); | ||||
|  | ||||
| @Deprecated('Will be removed in 3.0. Use Ref instead') | ||||
| // ignore: unused_element | ||||
| typedef CaptchaUrlRef = AutoDisposeFutureProviderRef<String>; | ||||
| // ignore_for_file: type=lint | ||||
| // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package | ||||
| @@ -1,7 +1,7 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:flutter_inappwebview/flutter_inappwebview.dart'; | ||||
| import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||||
| import 'package:island/pods/config.dart'; | ||||
| import 'package:island/screens/auth/captcha.config.dart'; | ||||
| import 'package:island/widgets/app_scaffold.dart'; | ||||
|  | ||||
| class CaptchaScreen extends ConsumerWidget { | ||||
| @@ -9,13 +9,15 @@ class CaptchaScreen extends ConsumerWidget { | ||||
|  | ||||
|   @override | ||||
|   Widget build(BuildContext context, WidgetRef ref) { | ||||
|     final serverUrl = ref.watch(serverUrlProvider); | ||||
|     final captchaUrl = ref.watch(captchaUrlProvider); | ||||
|  | ||||
|     if (!captchaUrl.hasValue) return Center(child: CircularProgressIndicator()); | ||||
|  | ||||
|     return AppScaffold( | ||||
|       appBar: AppBar(title: Text("Anti-Robot")), | ||||
|       body: InAppWebView( | ||||
|         initialUrlRequest: URLRequest( | ||||
|           url: WebUri('$serverUrl/auth/captcha?redirect_uri=solink://captcha'), | ||||
|           url: WebUri('${captchaUrl.value}?redirect_uri=solian://captcha'), | ||||
|         ), | ||||
|         shouldOverrideUrlLoading: (controller, navigationAction) async { | ||||
|           Uri? url = navigationAction.request.url; | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
| import 'dart:ui_web' as ui; | ||||
| import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||||
| import 'package:island/pods/config.dart'; | ||||
| import 'package:island/screens/auth/captcha.config.dart'; | ||||
| import 'package:island/widgets/app_scaffold.dart'; | ||||
| import 'package:web/web.dart' as web; | ||||
| import 'package:flutter/material.dart'; | ||||
| @@ -17,7 +18,7 @@ class CaptchaScreen extends ConsumerStatefulWidget { | ||||
| class _CaptchaScreenState extends ConsumerState<CaptchaScreen> { | ||||
|   bool _isInitialized = false; | ||||
|  | ||||
|   void _setupWebListener(String serverUrl) { | ||||
|   void _setupWebListener(String serverUrl) async { | ||||
|     web.window.onMessage.listen((event) { | ||||
|       if (event.data != null && event.data is String) { | ||||
|         final message = event.data as String; | ||||
| @@ -29,9 +30,11 @@ class _CaptchaScreenState extends ConsumerState<CaptchaScreen> { | ||||
|       } | ||||
|     }); | ||||
|  | ||||
|     final captchaUrl = await ref.watch(captchaUrlProvider.future); | ||||
|  | ||||
|     final iframe = | ||||
|         web.HTMLIFrameElement() | ||||
|           ..src = '$serverUrl/auth/captcha' | ||||
|           ..src = captchaUrl | ||||
|           ..style.border = 'none' | ||||
|           ..width = '100%' | ||||
|           ..height = '100%'; | ||||
|   | ||||
| @@ -49,7 +49,7 @@ class CreateAccountScreen extends HookConsumerWidget { | ||||
|         showLoadingModal(context); | ||||
|         final client = ref.watch(apiClientProvider); | ||||
|         await client.post( | ||||
|           '/accounts', | ||||
|           '/id/accounts', | ||||
|           data: { | ||||
|             'name': usernameController.text, | ||||
|             'nick': nicknameController.text, | ||||
| @@ -305,7 +305,7 @@ class _PostCreateModal extends HookConsumerWidget { | ||||
|             TextButton( | ||||
|               onPressed: () { | ||||
|                 Navigator.pop(context); | ||||
|                 context.pushReplacement('/auth/login'); | ||||
|                 context.pushReplacementNamed('login'); | ||||
|               }, | ||||
|               child: Text('login'.tr()), | ||||
|             ), | ||||
|   | ||||
| @@ -178,7 +178,7 @@ class _LoginCheckScreen extends HookConsumerWidget { | ||||
|       // Get token if challenge is completed | ||||
|       final client = ref.watch(apiClientProvider); | ||||
|       final tokenResp = await client.post( | ||||
|         '/auth/token', | ||||
|         '/id/auth/token', | ||||
|         data: { | ||||
|           'grant_type': 'authorization_code', | ||||
|           'code': code ?? challenge!.id, | ||||
| @@ -215,7 +215,7 @@ class _LoginCheckScreen extends HookConsumerWidget { | ||||
|         if (name != null) { | ||||
|           final client = ref.watch(apiClientProvider); | ||||
|           await client.patch( | ||||
|             '/accounts/me/sessions/current/label', | ||||
|             '/id/accounts/me/sessions/current/label', | ||||
|             data: jsonEncode(name), | ||||
|           ); | ||||
|         } | ||||
| @@ -225,6 +225,7 @@ class _LoginCheckScreen extends HookConsumerWidget { | ||||
|     useEffect(() { | ||||
|       if (challenge != null && challenge?.stepRemain == 0) { | ||||
|         Future(() { | ||||
|           if (isBusy.value) return; | ||||
|           isBusy.value = true; | ||||
|           getToken().catchError((err) { | ||||
|             showErrorAlert(err); | ||||
| @@ -265,7 +266,7 @@ class _LoginCheckScreen extends HookConsumerWidget { | ||||
|         // Pass challenge | ||||
|         final client = ref.watch(apiClientProvider); | ||||
|         final resp = await client.patch( | ||||
|           '/auth/challenge/${challenge!.id}', | ||||
|           '/id/auth/challenge/${challenge!.id}', | ||||
|           data: {'factor_id': factor!.id, 'password': pwd}, | ||||
|         ); | ||||
|         final result = SnAuthChallenge.fromJson(resp.data); | ||||
| @@ -412,7 +413,7 @@ class _LoginPickerScreen extends HookConsumerWidget { | ||||
|  | ||||
|       try { | ||||
|         await client.post( | ||||
|           '/auth/challenge/${challenge!.id}/factors/${factorPicked.value!.id}', | ||||
|           '/id/auth/challenge/${challenge!.id}/factors/${factorPicked.value!.id}', | ||||
|           data: | ||||
|               hintController.text.isNotEmpty | ||||
|                   ? jsonEncode(hintController.text) | ||||
| @@ -555,7 +556,7 @@ class _LoginLookupScreen extends HookConsumerWidget { | ||||
|       try { | ||||
|         final client = ref.watch(apiClientProvider); | ||||
|         await client.post( | ||||
|           '/accounts/recovery/password', | ||||
|           '/id/accounts/recovery/password', | ||||
|           data: {'account': uname, 'captcha_token': captchaTk}, | ||||
|         ); | ||||
|         showInfoAlert('loginResetPasswordSent'.tr(), 'done'.tr()); | ||||
| @@ -573,7 +574,7 @@ class _LoginLookupScreen extends HookConsumerWidget { | ||||
|       try { | ||||
|         final client = ref.watch(apiClientProvider); | ||||
|         final resp = await client.post( | ||||
|           '/auth/challenge', | ||||
|           '/id/auth/challenge', | ||||
|           data: { | ||||
|             'account': uname, | ||||
|             'device_id': await getUdid(), | ||||
| @@ -593,7 +594,7 @@ class _LoginLookupScreen extends HookConsumerWidget { | ||||
|         final result = SnAuthChallenge.fromJson(resp.data); | ||||
|         onChallenge(result); | ||||
|         final factorResp = await client.get( | ||||
|           '/auth/challenge/${result.id}/factors', | ||||
|           '/id/auth/challenge/${result.id}/factors', | ||||
|         ); | ||||
|         onFactor( | ||||
|           List<SnAuthFactor>.from( | ||||
| @@ -622,7 +623,7 @@ class _LoginLookupScreen extends HookConsumerWidget { | ||||
|  | ||||
|         if (context.mounted) showLoadingModal(context); | ||||
|         final resp = await client.post( | ||||
|           '/auth/login/apple/mobile', | ||||
|           '/id/auth/login/apple/mobile', | ||||
|           data: { | ||||
|             'identity_token': credential.identityToken!, | ||||
|             'authorization_code': credential.authorizationCode, | ||||
| @@ -633,7 +634,7 @@ class _LoginLookupScreen extends HookConsumerWidget { | ||||
|         final challenge = SnAuthChallenge.fromJson(resp.data); | ||||
|         onChallenge(challenge); | ||||
|         final factorResp = await client.get( | ||||
|           '/auth/challenge/${challenge.id}/factors', | ||||
|           '/id/auth/challenge/${challenge.id}/factors', | ||||
|         ); | ||||
|         onFactor( | ||||
|           List<SnAuthFactor>.from( | ||||
| @@ -658,11 +659,11 @@ class _LoginLookupScreen extends HookConsumerWidget { | ||||
|  | ||||
|       final client = ref.watch(apiClientProvider); | ||||
|       try { | ||||
|         final resp = await client.get('/auth/challenge/$challengeId'); | ||||
|         final resp = await client.get('/id/auth/challenge/$challengeId'); | ||||
|         final challenge = SnAuthChallenge.fromJson(resp.data); | ||||
|         onChallenge(challenge); | ||||
|         final factorResp = await client.get( | ||||
|           '/auth/challenge/${challenge.id}/factors', | ||||
|           '/id/auth/challenge/${challenge.id}/factors', | ||||
|         ); | ||||
|         onFactor( | ||||
|           List<SnAuthFactor>.from( | ||||
|   | ||||
| @@ -120,7 +120,7 @@ class _OidcScreenState extends ConsumerState<OidcScreen> { | ||||
|                       final queryParams = url.queryParameters; | ||||
|  | ||||
|                       // Check if we're on the token page | ||||
|                       if (path.endsWith('/auth/callback')) { | ||||
|                       if (path.endsWith('/id/auth/callback')) { | ||||
|                         // Extract token from URL | ||||
|                         final challenge = queryParams['challenge']; | ||||
|                         // Return the token and close the webview | ||||
|   | ||||
| @@ -165,7 +165,7 @@ class ChatRoomListTile extends HookConsumerWidget { | ||||
| @riverpod | ||||
| Future<List<SnChatRoom>> chatroomsJoined(Ref ref) async { | ||||
|   final client = ref.watch(apiClientProvider); | ||||
|   final resp = await client.get('/chat'); | ||||
|   final resp = await client.get('/sphere/chat'); | ||||
|   return resp.data | ||||
|       .map((e) => SnChatRoom.fromJson(e)) | ||||
|       .cast<SnChatRoom>() | ||||
| @@ -233,7 +233,10 @@ class ChatListScreen extends HookConsumerWidget { | ||||
|       if (result == null) return; | ||||
|       final client = ref.read(apiClientProvider); | ||||
|       try { | ||||
|         await client.post('/chat/direct', data: {'related_user_id': result.id}); | ||||
|         await client.post( | ||||
|           '/sphere/chat/direct', | ||||
|           data: {'related_user_id': result.id}, | ||||
|         ); | ||||
|         ref.invalidate(chatroomsJoinedProvider); | ||||
|       } catch (err) { | ||||
|         showErrorAlert(err); | ||||
| @@ -295,6 +298,7 @@ class ChatListScreen extends HookConsumerWidget { | ||||
|             ), | ||||
|             onPressed: () { | ||||
|               showModalBottomSheet( | ||||
|                 useRootNavigator: true, | ||||
|                 isScrollControlled: true, | ||||
|                 context: context, | ||||
|                 builder: (context) => const _ChatInvitesSheet(), | ||||
| @@ -319,7 +323,7 @@ class ChatListScreen extends HookConsumerWidget { | ||||
|                       leading: const Icon(Symbols.add), | ||||
|                       onTap: () { | ||||
|                         Navigator.pop(context); | ||||
|                         context.push('/chat/new').then((value) { | ||||
|                         context.pushNamed('chatNew').then((value) { | ||||
|                           if (value != null) { | ||||
|                             ref.invalidate(chatroomsJoinedProvider); | ||||
|                           } | ||||
| @@ -400,7 +404,10 @@ class ChatListScreen extends HookConsumerWidget { | ||||
|                               room: item, | ||||
|                               isDirect: item.type == 1, | ||||
|                               onTap: () { | ||||
|                                 context.push('/chat/${item.id}'); | ||||
|                                 context.pushNamed( | ||||
|                                   'chatRoom', | ||||
|                                   pathParameters: {'id': item.id}, | ||||
|                                 ); | ||||
|                               }, | ||||
|                             ); | ||||
|                           }, | ||||
| @@ -436,7 +443,7 @@ Future<SnChatRoom?> chatroom(Ref ref, String? identifier) async { | ||||
|   if (identifier == null) return null; | ||||
|   try { | ||||
|     final client = ref.watch(apiClientProvider); | ||||
|     final resp = await client.get('/chat/$identifier'); | ||||
|     final resp = await client.get('/sphere/chat/$identifier'); | ||||
|     return SnChatRoom.fromJson(resp.data); | ||||
|   } catch (err) { | ||||
|     if (err is DioException && err.response?.statusCode == 404) { | ||||
| @@ -451,7 +458,7 @@ Future<SnChatMember?> chatroomIdentity(Ref ref, String? identifier) async { | ||||
|   if (identifier == null) return null; | ||||
|   try { | ||||
|     final client = ref.watch(apiClientProvider); | ||||
|     final resp = await client.get('/chat/$identifier/members/me'); | ||||
|     final resp = await client.get('/sphere/chat/$identifier/members/me'); | ||||
|     return SnChatMember.fromJson(resp.data); | ||||
|   } catch (err) { | ||||
|     if (err is DioException && err.response?.statusCode == 404) { | ||||
| @@ -575,7 +582,7 @@ class EditChatScreen extends HookConsumerWidget { | ||||
|       try { | ||||
|         final client = ref.watch(apiClientProvider); | ||||
|         final resp = await client.request( | ||||
|           id == null ? '/chat' : '/chat/$id', | ||||
|           id == null ? '/sphere/chat' : '/sphere/chat/$id', | ||||
|           data: { | ||||
|             'name': nameController.text, | ||||
|             'description': descriptionController.text, | ||||
| @@ -602,127 +609,129 @@ class EditChatScreen extends HookConsumerWidget { | ||||
|         title: Text(id == null ? 'createChatRoom' : 'editChatRoom').tr(), | ||||
|         leading: const PageBackButton(), | ||||
|       ), | ||||
|       body: Column( | ||||
|         children: [ | ||||
|           RealmSelectionDropdown( | ||||
|             value: currentRealm.value, | ||||
|             realms: joinedRealms.when( | ||||
|               data: (realms) => realms, | ||||
|               loading: () => [], | ||||
|               error: (_, _) => [], | ||||
|       body: SingleChildScrollView( | ||||
|         child: Column( | ||||
|           children: [ | ||||
|             RealmSelectionDropdown( | ||||
|               value: currentRealm.value, | ||||
|               realms: joinedRealms.when( | ||||
|                 data: (realms) => realms, | ||||
|                 loading: () => [], | ||||
|                 error: (_, _) => [], | ||||
|               ), | ||||
|               onChanged: (SnRealm? value) { | ||||
|                 currentRealm.value = value; | ||||
|               }, | ||||
|               isLoading: joinedRealms.isLoading, | ||||
|               error: joinedRealms.error?.toString(), | ||||
|             ), | ||||
|             onChanged: (SnRealm? value) { | ||||
|               currentRealm.value = value; | ||||
|             }, | ||||
|             isLoading: joinedRealms.isLoading, | ||||
|             error: joinedRealms.error?.toString(), | ||||
|           ), | ||||
|           AspectRatio( | ||||
|             aspectRatio: 16 / 7, | ||||
|             child: Stack( | ||||
|               clipBehavior: Clip.none, | ||||
|               fit: StackFit.expand, | ||||
|               children: [ | ||||
|                 GestureDetector( | ||||
|                   child: Container( | ||||
|                     color: Theme.of(context).colorScheme.surfaceContainerHigh, | ||||
|                     child: | ||||
|                         background.value != null | ||||
|                             ? CloudFileWidget( | ||||
|                               item: background.value!, | ||||
|                               fit: BoxFit.cover, | ||||
|                             ) | ||||
|                             : const SizedBox.shrink(), | ||||
|                   ), | ||||
|                   onTap: () { | ||||
|                     setPicture('background'); | ||||
|                   }, | ||||
|                 ), | ||||
|                 Positioned( | ||||
|                   left: 20, | ||||
|                   bottom: -32, | ||||
|                   child: GestureDetector( | ||||
|                     child: ProfilePictureWidget( | ||||
|                       fileId: picture.value?.id, | ||||
|                       radius: 40, | ||||
|                       fallbackIcon: Symbols.group, | ||||
|             AspectRatio( | ||||
|               aspectRatio: 16 / 7, | ||||
|               child: Stack( | ||||
|                 clipBehavior: Clip.none, | ||||
|                 fit: StackFit.expand, | ||||
|                 children: [ | ||||
|                   GestureDetector( | ||||
|                     child: Container( | ||||
|                       color: Theme.of(context).colorScheme.surfaceContainerHigh, | ||||
|                       child: | ||||
|                           background.value != null | ||||
|                               ? CloudFileWidget( | ||||
|                                 item: background.value!, | ||||
|                                 fit: BoxFit.cover, | ||||
|                               ) | ||||
|                               : const SizedBox.shrink(), | ||||
|                     ), | ||||
|                     onTap: () { | ||||
|                       setPicture('picture'); | ||||
|                       setPicture('background'); | ||||
|                     }, | ||||
|                   ), | ||||
|                 ), | ||||
|               ], | ||||
|                   Positioned( | ||||
|                     left: 20, | ||||
|                     bottom: -32, | ||||
|                     child: GestureDetector( | ||||
|                       child: ProfilePictureWidget( | ||||
|                         fileId: picture.value?.id, | ||||
|                         radius: 40, | ||||
|                         fallbackIcon: Symbols.group, | ||||
|                       ), | ||||
|                       onTap: () { | ||||
|                         setPicture('picture'); | ||||
|                       }, | ||||
|                     ), | ||||
|                   ), | ||||
|                 ], | ||||
|               ), | ||||
|             ).padding(bottom: 32), | ||||
|             Form( | ||||
|               key: formKey, | ||||
|               child: Column( | ||||
|                 crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                 children: [ | ||||
|                   TextFormField( | ||||
|                     controller: nameController, | ||||
|                     decoration: const InputDecoration(labelText: 'Name'), | ||||
|                     onTapOutside: | ||||
|                         (_) => FocusManager.instance.primaryFocus?.unfocus(), | ||||
|                   ), | ||||
|                   const SizedBox(height: 16), | ||||
|                   TextFormField( | ||||
|                     controller: descriptionController, | ||||
|                     decoration: const InputDecoration( | ||||
|                       labelText: 'Description', | ||||
|                       alignLabelWithHint: true, | ||||
|                     ), | ||||
|                     minLines: 3, | ||||
|                     maxLines: null, | ||||
|                     onTapOutside: | ||||
|                         (_) => FocusManager.instance.primaryFocus?.unfocus(), | ||||
|                   ), | ||||
|                   const SizedBox(height: 16), | ||||
|                   Card( | ||||
|                     margin: EdgeInsets.zero, | ||||
|                     child: Column( | ||||
|                       children: [ | ||||
|                         CheckboxListTile( | ||||
|                           secondary: const Icon(Symbols.public), | ||||
|                           title: Text('publicChat').tr(), | ||||
|                           subtitle: Text('publicChatDescription').tr(), | ||||
|                           value: isPublic.value, | ||||
|                           onChanged: (value) { | ||||
|                             isPublic.value = value ?? true; | ||||
|                           }, | ||||
|                           shape: RoundedRectangleBorder( | ||||
|                             borderRadius: BorderRadius.circular(8), | ||||
|                           ), | ||||
|                         ), | ||||
|                         CheckboxListTile( | ||||
|                           secondary: const Icon(Symbols.travel_explore), | ||||
|                           title: Text('communityChat').tr(), | ||||
|                           subtitle: Text('communityChatDescription').tr(), | ||||
|                           value: isCommunity.value, | ||||
|                           onChanged: (value) { | ||||
|                             isCommunity.value = value ?? false; | ||||
|                           }, | ||||
|                           shape: RoundedRectangleBorder( | ||||
|                             borderRadius: BorderRadius.circular(8), | ||||
|                           ), | ||||
|                         ), | ||||
|                       ], | ||||
|                     ), | ||||
|                   ), | ||||
|                   const SizedBox(height: 16), | ||||
|                   Align( | ||||
|                     alignment: Alignment.centerRight, | ||||
|                     child: TextButton.icon( | ||||
|                       onPressed: submitting.value ? null : performAction, | ||||
|                       label: const Text('Save'), | ||||
|                       icon: const Icon(Symbols.save), | ||||
|                     ), | ||||
|                   ), | ||||
|                 ], | ||||
|               ).padding(all: 24), | ||||
|             ), | ||||
|           ).padding(bottom: 32), | ||||
|           Form( | ||||
|             key: formKey, | ||||
|             child: Column( | ||||
|               crossAxisAlignment: CrossAxisAlignment.start, | ||||
|               children: [ | ||||
|                 TextFormField( | ||||
|                   controller: nameController, | ||||
|                   decoration: const InputDecoration(labelText: 'Name'), | ||||
|                   onTapOutside: | ||||
|                       (_) => FocusManager.instance.primaryFocus?.unfocus(), | ||||
|                 ), | ||||
|                 const SizedBox(height: 16), | ||||
|                 TextFormField( | ||||
|                   controller: descriptionController, | ||||
|                   decoration: const InputDecoration( | ||||
|                     labelText: 'Description', | ||||
|                     alignLabelWithHint: true, | ||||
|                   ), | ||||
|                   minLines: 3, | ||||
|                   maxLines: null, | ||||
|                   onTapOutside: | ||||
|                       (_) => FocusManager.instance.primaryFocus?.unfocus(), | ||||
|                 ), | ||||
|                 const SizedBox(height: 16), | ||||
|                 Card( | ||||
|                   margin: EdgeInsets.zero, | ||||
|                   child: Column( | ||||
|                     children: [ | ||||
|                       CheckboxListTile( | ||||
|                         secondary: const Icon(Symbols.public), | ||||
|                         title: Text('publicChat').tr(), | ||||
|                         subtitle: Text('publicChatDescription').tr(), | ||||
|                         value: isPublic.value, | ||||
|                         onChanged: (value) { | ||||
|                           isPublic.value = value ?? true; | ||||
|                         }, | ||||
|                         shape: RoundedRectangleBorder( | ||||
|                           borderRadius: BorderRadius.circular(8), | ||||
|                         ), | ||||
|                       ), | ||||
|                       CheckboxListTile( | ||||
|                         secondary: const Icon(Symbols.travel_explore), | ||||
|                         title: Text('communityChat').tr(), | ||||
|                         subtitle: Text('communityChatDescription').tr(), | ||||
|                         value: isCommunity.value, | ||||
|                         onChanged: (value) { | ||||
|                           isCommunity.value = value ?? false; | ||||
|                         }, | ||||
|                         shape: RoundedRectangleBorder( | ||||
|                           borderRadius: BorderRadius.circular(8), | ||||
|                         ), | ||||
|                       ), | ||||
|                     ], | ||||
|                   ), | ||||
|                 ), | ||||
|                 const SizedBox(height: 16), | ||||
|                 Align( | ||||
|                   alignment: Alignment.centerRight, | ||||
|                   child: TextButton.icon( | ||||
|                     onPressed: submitting.value ? null : performAction, | ||||
|                     label: const Text('Save'), | ||||
|                     icon: const Icon(Symbols.save), | ||||
|                   ), | ||||
|                 ), | ||||
|               ], | ||||
|             ).padding(all: 24), | ||||
|           ), | ||||
|         ], | ||||
|           ], | ||||
|         ), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| @@ -731,7 +740,7 @@ class EditChatScreen extends HookConsumerWidget { | ||||
| @riverpod | ||||
| Future<List<SnChatMember>> chatroomInvites(Ref ref) async { | ||||
|   final client = ref.watch(apiClientProvider); | ||||
|   final resp = await client.get('/chat/invites'); | ||||
|   final resp = await client.get('/sphere/chat/invites'); | ||||
|   return resp.data | ||||
|       .map((e) => SnChatMember.fromJson(e)) | ||||
|       .cast<SnChatMember>() | ||||
| @@ -748,7 +757,7 @@ class _ChatInvitesSheet extends HookConsumerWidget { | ||||
|     Future<void> acceptInvite(SnChatMember invite) async { | ||||
|       try { | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.post('/chat/invites/${invite.chatRoom!.id}/accept'); | ||||
|         await client.post('/sphere/chat/invites/${invite.chatRoom!.id}/accept'); | ||||
|         ref.invalidate(chatroomInvitesProvider); | ||||
|         ref.invalidate(chatroomsJoinedProvider); | ||||
|       } catch (err) { | ||||
| @@ -759,7 +768,9 @@ class _ChatInvitesSheet extends HookConsumerWidget { | ||||
|     Future<void> declineInvite(SnChatMember invite) async { | ||||
|       try { | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.post('/chat/invites/${invite.chatRoom!.id}/decline'); | ||||
|         await client.post( | ||||
|           '/sphere/chat/invites/${invite.chatRoom!.id}/decline', | ||||
|         ); | ||||
|         ref.invalidate(chatroomInvitesProvider); | ||||
|       } catch (err) { | ||||
|         showErrorAlert(err); | ||||
|   | ||||
| @@ -6,7 +6,7 @@ part of 'chat.dart'; | ||||
| // RiverpodGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$chatroomsJoinedHash() => r'0c93fd3cb8fe5c87626836ced4f244bfa7598582'; | ||||
| String _$chatroomsJoinedHash() => r'3bb6389af07e81007680484d04bf5fe6f6c10571'; | ||||
|  | ||||
| /// See also [chatroomsJoined]. | ||||
| @ProviderFor(chatroomsJoined) | ||||
| @@ -25,7 +25,7 @@ final chatroomsJoinedProvider = | ||||
| @Deprecated('Will be removed in 3.0. Use Ref instead') | ||||
| // ignore: unused_element | ||||
| typedef ChatroomsJoinedRef = AutoDisposeFutureProviderRef<List<SnChatRoom>>; | ||||
| String _$chatroomHash() => r'8dac7aaac50932e6dd213039102d43c1cf5f1d4e'; | ||||
| String _$chatroomHash() => r'2b17d94728026420d18d6c383d2400cf4a070913'; | ||||
|  | ||||
| /// Copied from Dart SDK | ||||
| class _SystemHash { | ||||
| @@ -164,7 +164,7 @@ class _ChatroomProviderElement | ||||
|   String? get identifier => (origin as ChatroomProvider).identifier; | ||||
| } | ||||
|  | ||||
| String _$chatroomIdentityHash() => r'ad6ad09b6fc4cf7c4abe146ea97f8e364a3d4fd0'; | ||||
| String _$chatroomIdentityHash() => r'35e19a5a3e31752c79b97ba0358a7ec8fb8f6e99'; | ||||
|  | ||||
| /// See also [chatroomIdentity]. | ||||
| @ProviderFor(chatroomIdentity) | ||||
| @@ -286,7 +286,7 @@ class _ChatroomIdentityProviderElement | ||||
|   String? get identifier => (origin as ChatroomIdentityProvider).identifier; | ||||
| } | ||||
|  | ||||
| String _$chatroomInvitesHash() => r'c15f06c1e9c6074e6159d9d1f4404f31250ce523'; | ||||
| String _$chatroomInvitesHash() => r'5cd6391b09c5517ede19bacce43b45c8d71dd087'; | ||||
|  | ||||
| /// See also [chatroomInvites]. | ||||
| @ProviderFor(chatroomInvites) | ||||
|   | ||||
| @@ -376,7 +376,11 @@ class ChatRoomScreen extends HookConsumerWidget { | ||||
|       final wsState = ref.read(websocketStateProvider.notifier); | ||||
|       wsState.sendMessage( | ||||
|         jsonEncode( | ||||
|           WebSocketPacket(type: 'messages.read', data: {'chat_room_id': id}), | ||||
|           WebSocketPacket( | ||||
|             type: 'messages.read', | ||||
|             data: {'chat_room_id': id}, | ||||
|             endpoint: 'DysonNetwork.Sphere', | ||||
|           ), | ||||
|         ), | ||||
|       ); | ||||
|     } | ||||
| @@ -393,7 +397,11 @@ class ChatRoomScreen extends HookConsumerWidget { | ||||
|       final wsState = ref.read(websocketStateProvider.notifier); | ||||
|       wsState.sendMessage( | ||||
|         jsonEncode( | ||||
|           WebSocketPacket(type: 'messages.typing', data: {'chat_room_id': id}), | ||||
|           WebSocketPacket( | ||||
|             type: 'messages.typing', | ||||
|             data: {'chat_room_id': id}, | ||||
|             endpoint: 'DysonNetwork.Sphere', | ||||
|           ), | ||||
|         ), | ||||
|       ); | ||||
|  | ||||
| @@ -687,7 +695,7 @@ class ChatRoomScreen extends HookConsumerWidget { | ||||
|           IconButton( | ||||
|             icon: const Icon(Icons.more_vert), | ||||
|             onPressed: () { | ||||
|               context.push('/chat/$id/detail'); | ||||
|               context.pushNamed('chatDetail', pathParameters: {'id': id}); | ||||
|             }, | ||||
|           ), | ||||
|           const Gap(8), | ||||
|   | ||||
| @@ -389,7 +389,10 @@ class _ChatRoomActionMenu extends HookConsumerWidget { | ||||
|             if ((chatIdentity.value?.role ?? 0) >= 50) | ||||
|               PopupMenuItem( | ||||
|                 onTap: () { | ||||
|                   context.pushReplacement('/chat/$id/edit'); | ||||
|                   context.pushReplacementNamed( | ||||
|                     'chatEdit', | ||||
|                     pathParameters: {'id': id}, | ||||
|                   ); | ||||
|                 }, | ||||
|                 child: Row( | ||||
|                   children: [ | ||||
| @@ -421,7 +424,7 @@ class _ChatRoomActionMenu extends HookConsumerWidget { | ||||
|                   ).then((confirm) { | ||||
|                     if (confirm) { | ||||
|                       final client = ref.watch(apiClientProvider); | ||||
|                       client.delete('/chat/$id'); | ||||
|                       client.delete('/sphere/chat/$id'); | ||||
|                       ref.invalidate(chatroomsJoinedProvider); | ||||
|                       if (context.mounted) { | ||||
|                         context.pop(); | ||||
| @@ -454,7 +457,7 @@ class _ChatRoomActionMenu extends HookConsumerWidget { | ||||
|                   ).then((confirm) { | ||||
|                     if (confirm) { | ||||
|                       final client = ref.watch(apiClientProvider); | ||||
|                       client.delete('/chat/$id/members/me'); | ||||
|                       client.delete('/sphere/chat/$id/members/me'); | ||||
|                       ref.invalidate(chatroomsJoinedProvider); | ||||
|                       if (context.mounted) { | ||||
|                         context.pop(); | ||||
| @@ -502,7 +505,7 @@ class ChatMemberNotifier extends StateNotifier<ChatRoomMemberState> { | ||||
|  | ||||
|     try { | ||||
|       final response = await _apiClient.get( | ||||
|         '/chat/$roomId/members', | ||||
|         '/sphere/chat/$roomId/members', | ||||
|         queryParameters: {'offset': offset, 'take': take}, | ||||
|       ); | ||||
|  | ||||
| @@ -540,7 +543,7 @@ class ChatMemberListNotifier extends _$ChatMemberListNotifier | ||||
|  | ||||
|     final apiClient = ref.watch(apiClientProvider); | ||||
|     final response = await apiClient.get( | ||||
|       '/chat/$roomId/members', | ||||
|       '/sphere/chat/$roomId/members', | ||||
|       queryParameters: {'offset': offset, 'take': take}, | ||||
|     ); | ||||
|  | ||||
| @@ -592,7 +595,7 @@ class _ChatMemberListSheet extends HookConsumerWidget { | ||||
|       try { | ||||
|         final apiClient = ref.watch(apiClientProvider); | ||||
|         await apiClient.post( | ||||
|           '/chat/invites/$roomId', | ||||
|           '/sphere/chat/invites/$roomId', | ||||
|           data: {'related_user_id': result.id, 'role': 0}, | ||||
|         ); | ||||
|         // Refresh both providers | ||||
| @@ -846,7 +849,7 @@ class _ChatMemberRoleSheet extends HookConsumerWidget { | ||||
|  | ||||
|                       final apiClient = ref.read(apiClientProvider); | ||||
|                       await apiClient.patch( | ||||
|                         '/chat/$roomId/members/${member.accountId}/role', | ||||
|                         '/sphere/chat/$roomId/members/${member.accountId}/role', | ||||
|                         data: newRole, | ||||
|                       ); | ||||
|  | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -76,6 +75,130 @@ as String?, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [ChatRoomMemberState]. | ||||
| extension ChatRoomMemberStatePatterns on ChatRoomMemberState { | ||||
| /// 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( _ChatRoomMemberState value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _ChatRoomMemberState() 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( _ChatRoomMemberState value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _ChatRoomMemberState(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _ChatRoomMemberState value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _ChatRoomMemberState() 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<SnChatMember> members,  bool isLoading,  int total,  String? error)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _ChatRoomMemberState() when $default != null: | ||||
| return $default(_that.members,_that.isLoading,_that.total,_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( List<SnChatMember> members,  bool isLoading,  int total,  String? error)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _ChatRoomMemberState(): | ||||
| return $default(_that.members,_that.isLoading,_that.total,_that.error);} | ||||
| } | ||||
| /// 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<SnChatMember> members,  bool isLoading,  int total,  String? error)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _ChatRoomMemberState() when $default != null: | ||||
| return $default(_that.members,_that.isLoading,_that.total,_that.error);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -7,7 +7,7 @@ part of 'room_detail.dart'; | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$chatMemberListNotifierHash() => | ||||
|     r'f2191a631ba00ae3de39ccac10e4cdd065ffee17'; | ||||
|     r'c8fbf4b95df6dae24b1ba21063e9a43351832974'; | ||||
|  | ||||
| /// Copied from Dart SDK | ||||
| class _SystemHash { | ||||
|   | ||||
| @@ -29,7 +29,7 @@ part 'hub.g.dart'; | ||||
| Future<SnPublisherStats?> publisherStats(Ref ref, String? uname) async { | ||||
|   if (uname == null) return null; | ||||
|   final apiClient = ref.watch(apiClientProvider); | ||||
|   final resp = await apiClient.get('/publishers/$uname/stats'); | ||||
|   final resp = await apiClient.get('/sphere/publishers/$uname/stats'); | ||||
|   return SnPublisherStats.fromJson(resp.data); | ||||
| } | ||||
|  | ||||
| @@ -37,7 +37,9 @@ Future<SnPublisherStats?> publisherStats(Ref ref, String? uname) async { | ||||
| Future<SnPublisherMember?> publisherIdentity(Ref ref, String uname) async { | ||||
|   try { | ||||
|     final apiClient = ref.watch(apiClientProvider); | ||||
|     final response = await apiClient.get('/publishers/$uname/members/me'); | ||||
|     final response = await apiClient.get( | ||||
|       '/sphere/publishers/$uname/members/me', | ||||
|     ); | ||||
|     return SnPublisherMember.fromJson(response.data); | ||||
|   } catch (err) { | ||||
|     if (err is DioException && err.response?.statusCode == 404) { | ||||
| @@ -51,14 +53,14 @@ Future<SnPublisherMember?> publisherIdentity(Ref ref, String uname) async { | ||||
| Future<Map<String, bool>> publisherFeatures(Ref ref, String? uname) async { | ||||
|   if (uname == null) return {}; | ||||
|   final apiClient = ref.watch(apiClientProvider); | ||||
|   final response = await apiClient.get('/publishers/$uname/features'); | ||||
|   final response = await apiClient.get('/sphere/publishers/$uname/features'); | ||||
|   return Map<String, bool>.from(response.data); | ||||
| } | ||||
|  | ||||
| @riverpod | ||||
| Future<List<SnPublisherMember>> publisherInvites(Ref ref) async { | ||||
|   final client = ref.watch(apiClientProvider); | ||||
|   final resp = await client.get('/publishers/invites'); | ||||
|   final resp = await client.get('/sphere/publishers/invites'); | ||||
|   return resp.data | ||||
|       .map((e) => SnPublisherMember.fromJson(e)) | ||||
|       .cast<SnPublisherMember>() | ||||
| @@ -81,7 +83,7 @@ class PublisherMemberListNotifier extends _$PublisherMemberListNotifier | ||||
|     final offset = cursor != null ? int.parse(cursor) : 0; | ||||
|  | ||||
|     final response = await apiClient.get( | ||||
|       '/publishers/$uname/members', | ||||
|       '/sphere/publishers/$uname/members', | ||||
|       queryParameters: {'offset': offset, 'take': _pageSize}, | ||||
|     ); | ||||
|  | ||||
| @@ -141,14 +143,19 @@ class CreatorHubScreen extends HookConsumerWidget { | ||||
|     ); | ||||
|  | ||||
|     void updatePublisher() { | ||||
|       context.push('/creators/${currentPublisher.value!.name}/edit').then(( | ||||
|         value, | ||||
|       ) async { | ||||
|         if (value == null) return; | ||||
|         final data = await ref.refresh(publishersManagedProvider.future); | ||||
|         currentPublisher.value = | ||||
|             data.where((e) => e.id == currentPublisher.value!.id).firstOrNull; | ||||
|       }); | ||||
|       context | ||||
|           .pushNamed( | ||||
|             'creatorEdit', | ||||
|             pathParameters: {'name': currentPublisher.value!.name}, | ||||
|           ) | ||||
|           .then((value) async { | ||||
|             if (value == null) return; | ||||
|             final data = await ref.refresh(publishersManagedProvider.future); | ||||
|             currentPublisher.value = | ||||
|                 data | ||||
|                     .where((e) => e.id == currentPublisher.value!.id) | ||||
|                     .firstOrNull; | ||||
|           }); | ||||
|     } | ||||
|  | ||||
|     void deletePublisher() { | ||||
| @@ -156,7 +163,7 @@ class CreatorHubScreen extends HookConsumerWidget { | ||||
|         (confirm) { | ||||
|           if (confirm) { | ||||
|             final client = ref.watch(apiClientProvider); | ||||
|             client.delete('/publishers/${currentPublisher.value!.name}'); | ||||
|             client.delete('/sphere/publishers/${currentPublisher.value!.name}'); | ||||
|             ref.invalidate(publishersManagedProvider); | ||||
|             currentPublisher.value = null; | ||||
|           } | ||||
| @@ -324,7 +331,7 @@ class CreatorHubScreen extends HookConsumerWidget { | ||||
|                             subtitle: Text('createPublisherHint').tr(), | ||||
|                             trailing: const Icon(Symbols.chevron_right), | ||||
|                             onTap: () { | ||||
|                               context.push('/creators/new').then((value) { | ||||
|                               context.pushNamed('creatorNew').then((value) { | ||||
|                                 if (value != null) { | ||||
|                                   ref.invalidate(publishersManagedProvider); | ||||
|                                 } | ||||
| @@ -348,8 +355,11 @@ class CreatorHubScreen extends HookConsumerWidget { | ||||
|                               horizontal: 24, | ||||
|                             ), | ||||
|                             onTap: () { | ||||
|                               context.push( | ||||
|                                 '/creators/${currentPublisher.value!.name}/stickers', | ||||
|                               context.pushNamed( | ||||
|                                 'creatorStickers', | ||||
|                                 pathParameters: { | ||||
|                                   'name': currentPublisher.value!.name, | ||||
|                                 }, | ||||
|                               ); | ||||
|                             }, | ||||
|                           ), | ||||
| @@ -362,8 +372,11 @@ class CreatorHubScreen extends HookConsumerWidget { | ||||
|                               horizontal: 24, | ||||
|                             ), | ||||
|                             onTap: () { | ||||
|                               context.push( | ||||
|                                 '/creators/${currentPublisher.value!.name}/posts', | ||||
|                               context.pushNamed( | ||||
|                                 'creatorPosts', | ||||
|                                 pathParameters: { | ||||
|                                   'name': currentPublisher.value!.name, | ||||
|                                 }, | ||||
|                               ); | ||||
|                             }, | ||||
|                           ), | ||||
|   | ||||
| @@ -6,7 +6,7 @@ part of 'hub.dart'; | ||||
| // RiverpodGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$publisherStatsHash() => r'315705881d116b2aeac93f94f5ee2bc816d9f0f6'; | ||||
| String _$publisherStatsHash() => r'eea4ed98bf165cc785874f83b912bb7e23d1f7bc'; | ||||
|  | ||||
| /// Copied from Dart SDK | ||||
| class _SystemHash { | ||||
| @@ -149,7 +149,7 @@ class _PublisherStatsProviderElement | ||||
|   String? get uname => (origin as PublisherStatsProvider).uname; | ||||
| } | ||||
|  | ||||
| String _$publisherIdentityHash() => r'f7fd986a303a729ca5557022fceb37cd01fa17f3'; | ||||
| String _$publisherIdentityHash() => r'299372f25fa4b2bf8e11a8ba2d645100fc38e76f'; | ||||
|  | ||||
| /// See also [publisherIdentity]. | ||||
| @ProviderFor(publisherIdentity) | ||||
| @@ -271,7 +271,7 @@ class _PublisherIdentityProviderElement | ||||
|   String get uname => (origin as PublisherIdentityProvider).uname; | ||||
| } | ||||
|  | ||||
| String _$publisherFeaturesHash() => r'34db65d9a4b6b0c6961733ae79e67f25d5d111d3'; | ||||
| String _$publisherFeaturesHash() => r'08bace2d9a3da227ecec0cbf8709e55ee0646ca2'; | ||||
|  | ||||
| /// See also [publisherFeatures]. | ||||
| @ProviderFor(publisherFeatures) | ||||
| @@ -393,7 +393,7 @@ class _PublisherFeaturesProviderElement | ||||
|   String? get uname => (origin as PublisherFeaturesProvider).uname; | ||||
| } | ||||
|  | ||||
| String _$publisherInvitesHash() => r'488cd443407895ce11f4edff07cb6ea58f2aa018'; | ||||
| String _$publisherInvitesHash() => r'93aafc2f02af0a7a055ec1770b3999363dfaabdc'; | ||||
|  | ||||
| /// See also [publisherInvites]. | ||||
| @ProviderFor(publisherInvites) | ||||
| @@ -414,7 +414,7 @@ final publisherInvitesProvider = | ||||
| typedef PublisherInvitesRef = | ||||
|     AutoDisposeFutureProviderRef<List<SnPublisherMember>>; | ||||
| String _$publisherMemberListNotifierHash() => | ||||
|     r'237e8f39c9757a6cbdff817853c697539242ad2a'; | ||||
|     r'b4afd5d591a6f3d29f1b45fb1b6d17cb34f3f11b'; | ||||
|  | ||||
| abstract class _$PublisherMemberListNotifier | ||||
|     extends | ||||
|   | ||||
| @@ -30,8 +30,9 @@ class CreatorPostListScreen extends HookConsumerWidget { | ||||
|                     subtitle: Text('Create a regular post'), | ||||
|                     onTap: () async { | ||||
|                       Navigator.pop(context); | ||||
|                       final result = await context.push( | ||||
|                         '/posts/compose?type=0', | ||||
|                       final result = await context.pushNamed( | ||||
|                         'postCompose', | ||||
|                         queryParameters: {'type': '0'}, | ||||
|                       ); | ||||
|                       if (result == true) { | ||||
|                         refreshKey.value++; | ||||
| @@ -44,8 +45,9 @@ class CreatorPostListScreen extends HookConsumerWidget { | ||||
|                     subtitle: Text('Create a detailed article'), | ||||
|                     onTap: () async { | ||||
|                       Navigator.pop(context); | ||||
|                       final result = await context.push( | ||||
|                         '/posts/compose?type=1', | ||||
|                       final result = await context.pushNamed( | ||||
|                         'postCompose', | ||||
|                         queryParameters: {'type': '1'}, | ||||
|                       ); | ||||
|                       if (result == true) { | ||||
|                         refreshKey.value++; | ||||
|   | ||||
| @@ -29,7 +29,7 @@ part 'publishers.g.dart'; | ||||
| @riverpod | ||||
| Future<List<SnPublisher>> publishersManaged(Ref ref) async { | ||||
|   final client = ref.watch(apiClientProvider); | ||||
|   final resp = await client.get('/publishers'); | ||||
|   final resp = await client.get('/sphere/publishers'); | ||||
|   return resp.data | ||||
|       .map((e) => SnPublisher.fromJson(e)) | ||||
|       .cast<SnPublisher>() | ||||
| @@ -40,7 +40,7 @@ Future<List<SnPublisher>> publishersManaged(Ref ref) async { | ||||
| Future<SnPublisher?> publisher(Ref ref, String? identifier) async { | ||||
|   if (identifier == null) return null; | ||||
|   final client = ref.watch(apiClientProvider); | ||||
|   final resp = await client.get('/publishers/$identifier'); | ||||
|   final resp = await client.get('/sphere/publishers/$identifier'); | ||||
|   return SnPublisher.fromJson(resp.data); | ||||
| } | ||||
|  | ||||
| @@ -160,11 +160,11 @@ class EditPublisherScreen extends HookConsumerWidget { | ||||
|       try { | ||||
|         final client = ref.watch(apiClientProvider); | ||||
|         final resp = await client.request( | ||||
|           name == null | ||||
|           '/sphere${name == null | ||||
|               ? currentRealm.value == null | ||||
|                   ? '/publishers/individual' | ||||
|                   : '/publishers/organization/${currentRealm.value!.slug}' | ||||
|               : '/publishers/$name', | ||||
|               : '/publishers/$name'}', | ||||
|           data: { | ||||
|             'name': nameController.text, | ||||
|             'nick': nickController.text, | ||||
|   | ||||
| @@ -6,7 +6,7 @@ part of 'publishers.dart'; | ||||
| // RiverpodGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$publishersManagedHash() => r'1ea611c8d45c46002976c99bf4ee7f60bd6dbf8e'; | ||||
| String _$publishersManagedHash() => r'ea83759fed9bd5119738b4d09f12b4476959e0a3'; | ||||
|  | ||||
| /// See also [publishersManaged]. | ||||
| @ProviderFor(publishersManaged) | ||||
| @@ -25,7 +25,7 @@ final publishersManagedProvider = | ||||
| @Deprecated('Will be removed in 3.0. Use Ref instead') | ||||
| // ignore: unused_element | ||||
| typedef PublishersManagedRef = AutoDisposeFutureProviderRef<List<SnPublisher>>; | ||||
| String _$publisherHash() => r'd66f2efba7ae449b9b460a4da34ce48cf3b16fe5'; | ||||
| String _$publisherHash() => r'18fb5c6b3d79dd8af4fbee108dec1a0e8a034038'; | ||||
|  | ||||
| /// Copied from Dart SDK | ||||
| class _SystemHash { | ||||
|   | ||||
| @@ -74,7 +74,7 @@ class StickerPackDetailScreen extends HookConsumerWidget { | ||||
|           IconButton( | ||||
|             icon: const Icon(Symbols.add_circle), | ||||
|             onPressed: () { | ||||
|               context.push('/creators/stickers/$id/new').then(( | ||||
|               context.pushNamed('creatorStickerNew', pathParameters: {'packId': id}).then(( | ||||
|                 value, | ||||
|               ) { | ||||
|                 if (value != null) { | ||||
| @@ -173,9 +173,9 @@ class StickerPackDetailScreen extends HookConsumerWidget { | ||||
|                                         title: 'edit'.tr(), | ||||
|                                         image: MenuImage.icon(Symbols.edit), | ||||
|                                         callback: () { | ||||
|                                           context | ||||
|                                               .push( | ||||
|                                                 '/creators/stickers/$id/edit/${sticker.id}', | ||||
|                                           context.pushNamed( | ||||
|                                                 'creatorStickerEdit', | ||||
|                                                 pathParameters: {'packId': id, 'id': sticker.id}, | ||||
|                                               ) | ||||
|                                               .then((value) { | ||||
|                                                 if (value != null) { | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -74,6 +73,130 @@ as String, | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [StickerWithPackQuery]. | ||||
| extension StickerWithPackQueryPatterns on StickerWithPackQuery { | ||||
| /// 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( _StickerWithPackQuery value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _StickerWithPackQuery() 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( _StickerWithPackQuery value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _StickerWithPackQuery(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _StickerWithPackQuery value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _StickerWithPackQuery() 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 packId,  String id)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _StickerWithPackQuery() when $default != null: | ||||
| return $default(_that.packId,_that.id);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 packId,  String id)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _StickerWithPackQuery(): | ||||
| return $default(_that.packId,_that.id);} | ||||
| } | ||||
| /// 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 packId,  String id)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _StickerWithPackQuery() when $default != null: | ||||
| return $default(_that.packId,_that.id);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -28,13 +28,16 @@ class StickersScreen extends HookConsumerWidget { | ||||
|         actions: [ | ||||
|           IconButton( | ||||
|             onPressed: () { | ||||
|               context.push('/creators/stickers/new?pubName=pubName').then(( | ||||
|                 value, | ||||
|               ) { | ||||
|                 if (value != null) { | ||||
|                   ref.invalidate(stickerPacksNotifierProvider(pubName)); | ||||
|                 } | ||||
|               }); | ||||
|               context | ||||
|                   .pushNamed( | ||||
|                     'creatorStickerPackNew', | ||||
|                     queryParameters: {'pubName': pubName}, | ||||
|                   ) | ||||
|                   .then((value) { | ||||
|                     if (value != null) { | ||||
|                       ref.invalidate(stickerPacksNotifierProvider(pubName)); | ||||
|                     } | ||||
|                   }); | ||||
|             }, | ||||
|             icon: const Icon(Symbols.add_circle), | ||||
|           ), | ||||
| @@ -71,7 +74,10 @@ class SliverStickerPacksList extends HookConsumerWidget { | ||||
|                 subtitle: Text(sticker.description), | ||||
|                 trailing: const Icon(Symbols.chevron_right), | ||||
|                 onTap: () { | ||||
|                   context.push('/creators/$pubName/stickers/${sticker.id}'); | ||||
|                   context.pushNamed( | ||||
|                     'creatorStickerPackDetail', | ||||
|                     pathParameters: {'pubName': pubName, 'packId': sticker.id}, | ||||
|                   ); | ||||
|                 }, | ||||
|               ); | ||||
|             }, | ||||
| @@ -99,7 +105,7 @@ class StickerPacksNotifier extends _$StickerPacksNotifier | ||||
|  | ||||
|     try { | ||||
|       final response = await client.get( | ||||
|         '/stickers', | ||||
|         '/sphere/stickers', | ||||
|         queryParameters: { | ||||
|           'offset': offset, | ||||
|           'take': _pageSize, | ||||
| @@ -129,7 +135,7 @@ class StickerPacksNotifier extends _$StickerPacksNotifier | ||||
| Future<SnStickerPack?> stickerPack(Ref ref, String? packId) async { | ||||
|   if (packId == null) return null; | ||||
|   final apiClient = ref.watch(apiClientProvider); | ||||
|   final resp = await apiClient.get('/stickers/$packId'); | ||||
|   final resp = await apiClient.get('/sphere/stickers/$packId'); | ||||
|   return SnStickerPack.fromJson(resp.data); | ||||
| } | ||||
|  | ||||
| @@ -175,7 +181,7 @@ class EditStickerPacksScreen extends HookConsumerWidget { | ||||
|         submitting.value = true; | ||||
|         final apiClient = ref.watch(apiClientProvider); | ||||
|         final resp = await apiClient.request( | ||||
|           '/stickers', | ||||
|           '/sphere/stickers', | ||||
|           data: { | ||||
|             'name': nameController.text, | ||||
|             'description': descriptionController.text, | ||||
|   | ||||
| @@ -6,7 +6,7 @@ part of 'stickers.dart'; | ||||
| // RiverpodGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$stickerPackHash() => r'4f70d26e695ba1d8c7273d12730f77da79361733'; | ||||
| String _$stickerPackHash() => r'71ef84471237c8191918095094bdfc87d3920e77'; | ||||
|  | ||||
| /// Copied from Dart SDK | ||||
| class _SystemHash { | ||||
| @@ -148,7 +148,7 @@ class _StickerPackProviderElement | ||||
| } | ||||
|  | ||||
| String _$stickerPacksNotifierHash() => | ||||
|     r'dc0cc4ec27fdd6d5da28f982ff10c852f8107a18'; | ||||
|     r'0a8edcf9c35396c411f1214f5e77b1e8fac6a3e6'; | ||||
|  | ||||
| abstract class _$StickerPacksNotifier | ||||
|     extends BuildlessAutoDisposeAsyncNotifier<CursorPagingData<SnStickerPack>> { | ||||
|   | ||||
| @@ -6,6 +6,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||||
| import 'package:island/models/webfeed.dart'; | ||||
| import 'package:island/pods/webfeed.dart'; | ||||
| import 'package:island/widgets/alert.dart'; | ||||
| import 'package:island/widgets/app_scaffold.dart'; | ||||
| import 'package:material_symbols_icons/symbols.dart'; | ||||
| import 'package:styled_widget/styled_widget.dart'; | ||||
|  | ||||
| @@ -183,7 +184,7 @@ class WebFeedEditScreen extends HookConsumerWidget { | ||||
|       } | ||||
|     }, [pubName, feedId, ref, context]); | ||||
|  | ||||
|     return Scaffold( | ||||
|     return AppScaffold( | ||||
|       appBar: AppBar( | ||||
|         title: Text(hasFeedId ? 'Edit Web Feed' : 'New Web Feed'), | ||||
|         actions: [ | ||||
|   | ||||
| @@ -20,7 +20,7 @@ class WebFeedListScreen extends ConsumerWidget { | ||||
|       floatingActionButton: FloatingActionButton( | ||||
|         child: const Icon(Symbols.add), | ||||
|         onPressed: () { | ||||
|           context.push('/creators/$pubName/feeds/new'); | ||||
|           context.pushNamed('creatorFeedNew', pathParameters: {'name': pubName}); | ||||
|         }, | ||||
|       ), | ||||
|       body: feedsAsync.when( | ||||
| @@ -62,7 +62,7 @@ class WebFeedListScreen extends ConsumerWidget { | ||||
|                     ), | ||||
|                     trailing: const Icon(Symbols.chevron_right), | ||||
|                     onTap: () { | ||||
|                       context.push('/creators/$pubName/feeds/${feed.id}'); | ||||
|                       context.pushNamed('creatorFeedEdit', pathParameters: {'name': pubName, 'feedId': feed.id}); | ||||
|                     }, | ||||
|                   ), | ||||
|                 ); | ||||
|   | ||||
| @@ -37,7 +37,7 @@ class CustomAppsScreen extends HookConsumerWidget { | ||||
|           IconButton( | ||||
|             icon: const Icon(Symbols.add), | ||||
|             onPressed: () { | ||||
|               context.push('/developers/$publisherName/apps/new'); | ||||
|               context.pushNamed('developerAppNew', pathParameters: {'name': publisherName}); | ||||
|             }, | ||||
|           ), | ||||
|         ], | ||||
| @@ -121,9 +121,7 @@ class CustomAppsScreen extends HookConsumerWidget { | ||||
|                               ], | ||||
|                           onSelected: (value) { | ||||
|                             if (value == 'edit') { | ||||
|                               context.push( | ||||
|                                 '/developers/$publisherName/apps/${app.id}', | ||||
|                               ); | ||||
|                               context.pushNamed('developerAppEdit', pathParameters: {'name': publisherName, 'id': app.id}); | ||||
|                             } else if (value == 'delete') { | ||||
|                               showConfirmAlert( | ||||
|                                 'deleteCustomAppHint'.tr(), | ||||
|   | ||||
| @@ -25,14 +25,14 @@ part 'hub.g.dart'; | ||||
| Future<DeveloperStats?> developerStats(Ref ref, String? uname) async { | ||||
|   if (uname == null) return null; | ||||
|   final apiClient = ref.watch(apiClientProvider); | ||||
|   final resp = await apiClient.get('/developers/$uname/stats'); | ||||
|   final resp = await apiClient.get('/sphere/developers/$uname/stats'); | ||||
|   return DeveloperStats.fromJson(resp.data); | ||||
| } | ||||
|  | ||||
| @riverpod | ||||
| Future<List<SnPublisher>> developers(Ref ref) async { | ||||
|   final client = ref.watch(apiClientProvider); | ||||
|   final resp = await client.get('/developers'); | ||||
|   final resp = await client.get('/sphere/developers'); | ||||
|   return resp.data | ||||
|       .map((e) => SnPublisher.fromJson(e)) | ||||
|       .cast<SnPublisher>() | ||||
| @@ -243,8 +243,11 @@ class DeveloperHubScreen extends HookConsumerWidget { | ||||
|                               horizontal: 24, | ||||
|                             ), | ||||
|                             onTap: () { | ||||
|                               context.push( | ||||
|                                 '/developers/${currentDeveloper.value!.name}/apps', | ||||
|                               context.pushNamed( | ||||
|                                 'developerApps', | ||||
|                                 pathParameters: { | ||||
|                                   'name': currentDeveloper.value!.name, | ||||
|                                 }, | ||||
|                               ); | ||||
|                             }, | ||||
|                           ), | ||||
| @@ -336,7 +339,7 @@ class _DeveloperEnrollmentSheet extends HookConsumerWidget { | ||||
|     Future<void> enroll(SnPublisher publisher) async { | ||||
|       try { | ||||
|         final client = ref.read(apiClientProvider); | ||||
|         await client.post('/developers/${publisher.name}/enroll'); | ||||
|         await client.post('/sphere/developers/${publisher.name}/enroll'); | ||||
|         if (context.mounted) { | ||||
|           Navigator.pop(context, true); | ||||
|         } | ||||
|   | ||||
| @@ -6,7 +6,7 @@ part of 'hub.dart'; | ||||
| // RiverpodGenerator | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$developerStatsHash() => r'783398cbde09c3d956c3e20b02a1cebd1f8ab748'; | ||||
| String _$developerStatsHash() => r'baa708f3586e8987e221cc8ab825d759658c0f55'; | ||||
|  | ||||
| /// Copied from Dart SDK | ||||
| class _SystemHash { | ||||
| @@ -149,7 +149,7 @@ class _DeveloperStatsProviderElement | ||||
|   String? get uname => (origin as DeveloperStatsProvider).uname; | ||||
| } | ||||
|  | ||||
| String _$developersHash() => r'f52639d3c21aafbf235c8ae33f35448baf2989a1'; | ||||
| String _$developersHash() => r'f11335fdf553c661110281edeec70ef89c64727d'; | ||||
|  | ||||
| /// See also [developers]. | ||||
| @ProviderFor(developers) | ||||
|   | ||||
| @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; | ||||
| import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||||
| import 'package:island/models/webfeed.dart'; | ||||
| import 'package:island/pods/network.dart'; | ||||
| import 'package:island/widgets/app_scaffold.dart'; | ||||
| import 'package:island/widgets/web_article_card.dart'; | ||||
| import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||||
| import 'package:riverpod_paging_utils/riverpod_paging_utils.dart'; | ||||
| @@ -38,7 +39,7 @@ class ArticlesListNotifier extends _$ArticlesListNotifier | ||||
|  | ||||
|     try { | ||||
|       final response = await client.get( | ||||
|         '/feeds/articles', | ||||
|         '/sphere/feeds/articles', | ||||
|         queryParameters: queryParams, | ||||
|       ); | ||||
|  | ||||
| @@ -124,7 +125,7 @@ class ArticlesScreen extends ConsumerWidget { | ||||
|  | ||||
|   @override | ||||
|   Widget build(BuildContext context, WidgetRef ref) { | ||||
|     return Scaffold( | ||||
|     return AppScaffold( | ||||
|       appBar: AppBar(title: Text(title ?? 'Articles')), | ||||
|       body: Center( | ||||
|         child: ConstrainedBox( | ||||
|   | ||||
| @@ -7,7 +7,7 @@ part of 'articles.dart'; | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$articlesListNotifierHash() => | ||||
|     r'924f2344c3bbf0ff7b92fe69e88d3b64a534b538'; | ||||
|     r'579741af4d90c7c81f2e2697e57c4895b7a9dabc'; | ||||
|  | ||||
| /// Copied from Dart SDK | ||||
| class _SystemHash { | ||||
|   | ||||
| @@ -17,6 +17,7 @@ class DiscoveryRealmsScreen extends HookConsumerWidget { | ||||
|     final currentQuery = useState<String?>(null); | ||||
|  | ||||
|     return AppScaffold( | ||||
|       noBackground: false, | ||||
|       appBar: AppBar(title: Text('discoverRealms'.tr())), | ||||
|       body: Stack( | ||||
|         children: [ | ||||
|   | ||||
| @@ -9,8 +9,11 @@ import 'package:island/models/activity.dart'; | ||||
| import 'package:island/models/publisher.dart'; | ||||
| import 'package:island/models/realm.dart'; | ||||
| import 'package:island/models/webfeed.dart'; | ||||
| import 'package:island/pods/event_calendar.dart'; | ||||
| import 'package:island/pods/userinfo.dart'; | ||||
| import 'package:island/services/responsive.dart'; | ||||
| import 'package:island/widgets/account/event_calendar.dart'; | ||||
| import 'package:island/widgets/account/fortune_graph.dart'; | ||||
| import 'package:island/widgets/app_scaffold.dart'; | ||||
| import 'package:island/models/post.dart'; | ||||
| import 'package:island/widgets/check_in.dart'; | ||||
| @@ -27,42 +30,11 @@ import 'package:styled_widget/styled_widget.dart'; | ||||
|  | ||||
| part 'explore.g.dart'; | ||||
|  | ||||
| class ExploreShellScreen extends HookConsumerWidget { | ||||
|   final Widget child; | ||||
|   const ExploreShellScreen({super.key, required this.child}); | ||||
|  | ||||
|   @override | ||||
|   Widget build(BuildContext context, WidgetRef ref) { | ||||
|     final isWide = MediaQuery.of(context).size.width > 640; | ||||
|  | ||||
|     if (isWide) { | ||||
|       return AppBackground( | ||||
|         isRoot: true, | ||||
|         child: Row( | ||||
|           children: [ | ||||
|             Flexible(flex: 2, child: ExploreScreen(isAside: true)), | ||||
|             VerticalDivider(width: 1), | ||||
|             Flexible(flex: 3, child: child), | ||||
|           ], | ||||
|         ), | ||||
|       ); | ||||
|     } | ||||
|  | ||||
|     return AppBackground(isRoot: true, child: child); | ||||
|   } | ||||
| } | ||||
|  | ||||
| class ExploreScreen extends HookConsumerWidget { | ||||
|   final bool isAside; | ||||
|   const ExploreScreen({super.key, this.isAside = false}); | ||||
|   const ExploreScreen({super.key}); | ||||
|  | ||||
|   @override | ||||
|   Widget build(BuildContext context, WidgetRef ref) { | ||||
|     final isWide = isWideScreen(context); | ||||
|     if (isWide && !isAside) { | ||||
|       return const EmptyPageHolder(); | ||||
|     } | ||||
|  | ||||
|     final tabController = useTabController(initialLength: 3); | ||||
|     final currentFilter = useState<String?>(null); | ||||
|  | ||||
| @@ -89,8 +61,31 @@ class ExploreScreen extends HookConsumerWidget { | ||||
|       activityListNotifierProvider(currentFilter.value).notifier, | ||||
|     ); | ||||
|  | ||||
|     final now = DateTime.now(); | ||||
|  | ||||
|     final query = useState( | ||||
|       EventCalendarQuery(uname: 'me', year: now.year, month: now.month), | ||||
|     ); | ||||
|  | ||||
|     final events = ref.watch(eventCalendarProvider(query.value)); | ||||
|  | ||||
|     final selectedDay = useState(now); | ||||
|  | ||||
|     void onMonthChanged(int year, int month) { | ||||
|       query.value = EventCalendarQuery( | ||||
|         uname: query.value.uname, | ||||
|         year: year, | ||||
|         month: month, | ||||
|       ); | ||||
|     } | ||||
|  | ||||
|     // Function to handle day selection for synchronizing between widgets | ||||
|     void onDaySelected(DateTime day) { | ||||
|       selectedDay.value = day; | ||||
|     } | ||||
|  | ||||
|     return AppScaffold( | ||||
|       extendBody: false, // Prevent conflicts with tabs navigation | ||||
|       noBackground: false, | ||||
|       appBar: AppBar( | ||||
|         toolbarHeight: 0, | ||||
|         bottom: PreferredSize( | ||||
| @@ -145,7 +140,7 @@ class ExploreScreen extends HookConsumerWidget { | ||||
|                   ), | ||||
|                   IconButton( | ||||
|                     onPressed: () { | ||||
|                       context.push('/feeds/articles'); | ||||
|                       context.pushNamed('articles'); | ||||
|                     }, | ||||
|                     icon: Icon( | ||||
|                       Symbols.auto_stories, | ||||
| @@ -155,7 +150,7 @@ class ExploreScreen extends HookConsumerWidget { | ||||
|                   ), | ||||
|                   IconButton( | ||||
|                     onPressed: () { | ||||
|                       context.push('/posts/search'); | ||||
|                       context.pushNamed('postSearch'); | ||||
|                     }, | ||||
|                     icon: Icon( | ||||
|                       Symbols.search, | ||||
| @@ -175,7 +170,7 @@ class ExploreScreen extends HookConsumerWidget { | ||||
|       floatingActionButton: FloatingActionButton( | ||||
|         heroTag: Key("explore-page-fab"), | ||||
|         onPressed: () { | ||||
|           context.push('/posts/compose').then((value) { | ||||
|           context.pushNamed('postCompose').then((value) { | ||||
|             if (value != null) { | ||||
|               activitiesNotifier.forceRefresh(); | ||||
|             } | ||||
| @@ -184,23 +179,76 @@ class ExploreScreen extends HookConsumerWidget { | ||||
|         child: const Icon(Symbols.edit), | ||||
|       ), | ||||
|       floatingActionButtonLocation: TabbedFabLocation(context), | ||||
|       body: TabBarView( | ||||
|         controller: tabController, | ||||
|         physics: const NeverScrollableScrollPhysics(), | ||||
|         children: [ | ||||
|           _buildActivityList(ref, null), | ||||
|           _buildActivityList(ref, 'subscriptions'), | ||||
|           _buildActivityList(ref, 'friends'), | ||||
|         ], | ||||
|       body: Builder( | ||||
|         builder: (context) { | ||||
|           final isWider = isWiderScreen(context); | ||||
|  | ||||
|           final bodyView = TabBarView( | ||||
|             controller: tabController, | ||||
|             physics: const NeverScrollableScrollPhysics(), | ||||
|             children: [ | ||||
|               _buildActivityList(context, ref, null), | ||||
|               _buildActivityList(context, ref, 'subscriptions'), | ||||
|               _buildActivityList(context, ref, 'friends'), | ||||
|             ], | ||||
|           ); | ||||
|  | ||||
|           if (isWider) { | ||||
|             return Row( | ||||
|               children: [ | ||||
|                 Flexible(flex: 3, child: bodyView), | ||||
|                 const VerticalDivider(width: 1), | ||||
|                 Flexible( | ||||
|                   flex: 2, | ||||
|                   child: SingleChildScrollView( | ||||
|                     child: Column( | ||||
|                       children: [ | ||||
|                         CheckInWidget(), | ||||
|                         Card( | ||||
|                           margin: EdgeInsets.only(left: 16, right: 16, top: 8), | ||||
|                           child: Column( | ||||
|                             children: [ | ||||
|                               // Use the reusable EventCalendarWidget | ||||
|                               EventCalendarWidget( | ||||
|                                 events: events, | ||||
|                                 initialDate: now, | ||||
|                                 showEventDetails: true, | ||||
|                                 onMonthChanged: onMonthChanged, | ||||
|                                 onDaySelected: onDaySelected, | ||||
|                               ), | ||||
|                             ], | ||||
|                           ), | ||||
|                         ), | ||||
|                         FortuneGraphWidget( | ||||
|                           events: events, | ||||
|                           constrainWidth: true, | ||||
|                           onPointSelected: onDaySelected, | ||||
|                         ), | ||||
|                       ], | ||||
|                     ), | ||||
|                   ), | ||||
|                 ), | ||||
|               ], | ||||
|             ); | ||||
|           } | ||||
|  | ||||
|           return bodyView; | ||||
|         }, | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
|  | ||||
|   Widget _buildActivityList(WidgetRef ref, String? filter) { | ||||
|   Widget _buildActivityList( | ||||
|     BuildContext context, | ||||
|     WidgetRef ref, | ||||
|     String? filter, | ||||
|   ) { | ||||
|     final activitiesNotifier = ref.watch( | ||||
|       activityListNotifierProvider(filter).notifier, | ||||
|     ); | ||||
|  | ||||
|     final isWider = isWiderScreen(context); | ||||
|  | ||||
|     return RefreshIndicator( | ||||
|       onRefresh: () => Future.sync(activitiesNotifier.forceRefresh), | ||||
|       child: PagingHelperView( | ||||
| @@ -214,7 +262,7 @@ class ExploreScreen extends HookConsumerWidget { | ||||
|                 widgetCount: widgetCount, | ||||
|                 endItemView: endItemView, | ||||
|                 activitiesNotifier: activitiesNotifier, | ||||
|                 contentOnly: filter != null, | ||||
|                 contentOnly: isWider || filter != null, | ||||
|               ), | ||||
|             ), | ||||
|       ), | ||||
| @@ -338,7 +386,7 @@ class _ActivityListView extends HookConsumerWidget { | ||||
|                             bottom: 16, | ||||
|                           ) | ||||
|                           : null, | ||||
|                   onRefresh: (_) { | ||||
|                   onRefresh: () { | ||||
|                     activitiesNotifier.forceRefresh(); | ||||
|                   }, | ||||
|                   onUpdate: (post) { | ||||
| @@ -400,7 +448,7 @@ class ActivityListNotifier extends _$ActivityListNotifier | ||||
|     }; | ||||
|  | ||||
|     final response = await client.get( | ||||
|       '/activities', | ||||
|       '/sphere/activities', | ||||
|       queryParameters: queryParameters, | ||||
|     ); | ||||
|  | ||||
|   | ||||
| @@ -7,7 +7,7 @@ part of 'explore.dart'; | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$activityListNotifierHash() => | ||||
|     r'98b62fb9b958023d2c9e320af7ec1f1244836f49'; | ||||
|     r'b75fd5c08d5f84ca433e16b7387d317ea72b91c9'; | ||||
|  | ||||
| /// Copied from Dart SDK | ||||
| class _SystemHash { | ||||
|   | ||||
| @@ -36,7 +36,7 @@ class NotificationUnreadCountNotifier | ||||
|  | ||||
|     try { | ||||
|       final client = ref.read(apiClientProvider); | ||||
|       final response = await client.get('/notifications/count'); | ||||
|       final response = await client.get('/pusher/notifications/count'); | ||||
|       return (response.data as num).toInt(); | ||||
|     } catch (_) { | ||||
|       return 0; | ||||
| @@ -82,7 +82,7 @@ class NotificationListNotifier extends _$NotificationListNotifier | ||||
|     final queryParams = {'offset': offset, 'take': _pageSize}; | ||||
|  | ||||
|     final response = await client.get( | ||||
|       '/notifications', | ||||
|       '/pusher/notifications', | ||||
|       queryParameters: queryParams, | ||||
|     ); | ||||
|     final total = int.parse(response.headers.value('X-Total') ?? '0'); | ||||
|   | ||||
| @@ -7,7 +7,7 @@ part of 'notification.dart'; | ||||
| // ************************************************************************** | ||||
|  | ||||
| String _$notificationUnreadCountNotifierHash() => | ||||
|     r'0d5b07caa625c24575c5581d5fcd3089effc2844'; | ||||
|     r'd199abf0d16944587e747798399a267a790341f3'; | ||||
|  | ||||
| /// See also [NotificationUnreadCountNotifier]. | ||||
| @ProviderFor(NotificationUnreadCountNotifier) | ||||
| @@ -28,7 +28,7 @@ final notificationUnreadCountNotifierProvider = | ||||
|  | ||||
| typedef _$NotificationUnreadCountNotifier = AutoDisposeAsyncNotifier<int>; | ||||
| String _$notificationListNotifierHash() => | ||||
|     r'934a47bc2ce9e75699a4f53e2169470fd0c04a53'; | ||||
|     r'5099466db475bbcf1ab6b514eb072f1dc4c6f930'; | ||||
|  | ||||
| /// See also [NotificationListNotifier]. | ||||
| @ProviderFor(NotificationListNotifier) | ||||
|   | ||||
| @@ -1,6 +1,5 @@ | ||||
| // dart format width=80 | ||||
| // coverage:ignore-file | ||||
| // GENERATED CODE - DO NOT MODIFY BY HAND | ||||
| // coverage:ignore-file | ||||
| // 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 | ||||
|  | ||||
| @@ -106,6 +105,130 @@ $SnPostCopyWith<$Res>? get forwardingTo { | ||||
| } | ||||
|  | ||||
|  | ||||
| /// Adds pattern-matching-related methods to [PostComposeInitialState]. | ||||
| extension PostComposeInitialStatePatterns on PostComposeInitialState { | ||||
| /// 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( _PostComposeInitialState value)?  $default,{required TResult orElse(),}){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _PostComposeInitialState() 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( _PostComposeInitialState value)  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _PostComposeInitialState(): | ||||
| return $default(_that);} | ||||
| } | ||||
| /// 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( _PostComposeInitialState value)?  $default,){ | ||||
| final _that = this; | ||||
| switch (_that) { | ||||
| case _PostComposeInitialState() 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? title,  String? description,  String? content,  List<UniversalFile> attachments,  int? visibility,  SnPost? replyingTo,  SnPost? forwardingTo)?  $default,{required TResult orElse(),}) {final _that = this; | ||||
| switch (_that) { | ||||
| case _PostComposeInitialState() when $default != null: | ||||
| return $default(_that.title,_that.description,_that.content,_that.attachments,_that.visibility,_that.replyingTo,_that.forwardingTo);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? title,  String? description,  String? content,  List<UniversalFile> attachments,  int? visibility,  SnPost? replyingTo,  SnPost? forwardingTo)  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _PostComposeInitialState(): | ||||
| return $default(_that.title,_that.description,_that.content,_that.attachments,_that.visibility,_that.replyingTo,_that.forwardingTo);} | ||||
| } | ||||
| /// 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? title,  String? description,  String? content,  List<UniversalFile> attachments,  int? visibility,  SnPost? replyingTo,  SnPost? forwardingTo)?  $default,) {final _that = this; | ||||
| switch (_that) { | ||||
| case _PostComposeInitialState() when $default != null: | ||||
| return $default(_that.title,_that.description,_that.content,_that.attachments,_that.visibility,_that.replyingTo,_that.forwardingTo);case _: | ||||
|   return null; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
| } | ||||
|  | ||||
| /// @nodoc | ||||
| @JsonSerializable() | ||||
|  | ||||
|   | ||||
| @@ -321,8 +321,15 @@ class ArticleComposeScreen extends HookConsumerWidget { | ||||
|             builder: (context, attachments, _) { | ||||
|               if (attachments.isEmpty) return const SizedBox.shrink(); | ||||
|               return Column( | ||||
|                 crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                 children: [ | ||||
|                   const Gap(16), | ||||
|                   Text( | ||||
|                     'articleAttachmentHint'.tr(), | ||||
|                     style: Theme.of(context).textTheme.bodySmall?.copyWith( | ||||
|                       color: Theme.of(context).colorScheme.onSurfaceVariant, | ||||
|                     ), | ||||
|                   ).padding(bottom: 8), | ||||
|                   ValueListenableBuilder<Map<int, double>>( | ||||
|                     valueListenable: state.attachmentProgress, | ||||
|                     builder: (context, progressMap, _) { | ||||
| @@ -332,8 +339,8 @@ class ArticleComposeScreen extends HookConsumerWidget { | ||||
|                         children: [ | ||||
|                           for (var idx = 0; idx < attachments.length; idx++) | ||||
|                             SizedBox( | ||||
|                               width: 120, | ||||
|                               height: 120, | ||||
|                               width: 280, | ||||
|                               height: 280, | ||||
|                               child: AttachmentPreview( | ||||
|                                 item: attachments[idx], | ||||
|                                 progress: progressMap[idx], | ||||
| @@ -358,6 +365,12 @@ class ArticleComposeScreen extends HookConsumerWidget { | ||||
|                                     delta, | ||||
|                                   ); | ||||
|                                 }, | ||||
|                                 onInsert: | ||||
|                                     () => ComposeLogic.insertAttachment( | ||||
|                                       ref, | ||||
|                                       state, | ||||
|                                       idx, | ||||
|                                     ), | ||||
|                               ), | ||||
|                             ), | ||||
|                         ], | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user