Compare commits
124 Commits
b70d3795d1
...
1.2.1+18
| Author | SHA1 | Date | |
|---|---|---|---|
| 95ea3e558f | |||
| 0006a94632 | |||
| 7ea18dbe12 | |||
| 6004b74724 | |||
| 4d82ae8058 | |||
| 7fe26d0df0 | |||
| 80bade0e03 | |||
| b63db7fe76 | |||
| 49f73f5f04 | |||
| 98749f42c0 | |||
| f0e6bd64f4 | |||
| 3bea3a114a | |||
| 454f711656 | |||
| 82e4c923e7 | |||
| 5b4d8282ae | |||
| cf767a1d94 | |||
| af93a8386a | |||
| 29ca263130 | |||
| 7332f68d9c | |||
| e9e6f3313e | |||
| 85764c37c2 | |||
| ef1f29f905 | |||
| 22026efa7d | |||
| 4a3e6a9e15 | |||
| 00092ba7b6 | |||
| b5da8ece4a | |||
| dfe9165bc9 | |||
| 3d45b54236 | |||
| 7f63fe7f0e | |||
| bc5dbab9c5 | |||
| 9910fc7a92 | |||
| 2356eac118 | |||
| 0135b8d838 | |||
| 8ec33ccbf4 | |||
| d267316a35 | |||
| 138da60e55 | |||
| 4562c2f991 | |||
| 8009f4ca9b | |||
| 54dee9702b | |||
| 94385564bd | |||
| 0b2309816f | |||
| 8283272a3b | |||
| eb02a47e9a | |||
| 7c0c1ec94f | |||
| 272044a77e | |||
| 39c22b1cf6 | |||
| 98c3bb912d | |||
| 035b92d9b8 | |||
| 0bfc0bd61b | |||
| de00a20eee | |||
| 73982f48d6 | |||
| 1d36b30361 | |||
| dea743a307 | |||
| c48bd3e758 | |||
| 56bbf73b5e | |||
| 4f6c5aa053 | |||
| d8e79fb4f9 | |||
| 06e0fa465b | |||
| 895a257f50 | |||
| d9804ba00b | |||
| 62ff1c2f1c | |||
| a157596a2e | |||
| 12102bf527 | |||
| c00a018380 | |||
| 53b3cac4ca | |||
| 19eabfaba1 | |||
| ec2eadad6d | |||
| 54e176e75d | |||
| 0a7ccaeefa | |||
| a5f093e185 | |||
| a4f68dd175 | |||
| 8067c35c70 | |||
| ebe381053e | |||
| 03f2470dae | |||
| ea434815cf | |||
| bbea4b4359 | |||
| e0b485cc81 | |||
| 87bb37ac01 | |||
| 989b5babd9 | |||
| 9ea364640d | |||
| a9f55a489d | |||
| 4616f3a3e2 | |||
| 425bae9d13 | |||
| 07771e8979 | |||
| 0ad4854443 | |||
| 4238ea6fdc | |||
| 7d45c06302 | |||
| 7e8993fbd2 | |||
| c88fcc84da | |||
| 11fb79623e | |||
| 98cc313a91 | |||
| bc3401a897 | |||
| 5b6a5d9046 | |||
| 6cbd78e836 | |||
| aefcbad02f | |||
| 70617be687 | |||
| cccb3d5c16 | |||
| a0a3a8d182 | |||
| c6b2ef8459 | |||
| 34a2fe3988 | |||
| 0a5604d0ff | |||
| 5e754ad233 | |||
| 5b9c92e4d3 | |||
| b2a6ca7244 | |||
| 27c60fc8cb | |||
| 8b3c45ab29 | |||
| adb415700a | |||
| 1e4b44a78b | |||
| 9765b200b9 | |||
| 47d03ce1e5 | |||
| c41a71388d | |||
| 7655dfdf37 | |||
| 190bb34958 | |||
| d02ed68afa | |||
| 2bc4513bb6 | |||
| f10393f6d0 | |||
| ecef8dab0c | |||
| 52e58fce3d | |||
| 31d50bfb1f | |||
| ca8ad12d93 | |||
| f799900450 | |||
| dfdf7b23c8 | |||
| 771b2029b0 | |||
| cc9c99f375 |
2
.github/workflows/nightly.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
|||||||
channel: stable
|
channel: stable
|
||||||
cache: true
|
cache: true
|
||||||
- run: flutter pub get
|
- run: flutter pub get
|
||||||
- run: flutter build web
|
- run: flutter build web --release --base-href=/
|
||||||
- name: Archive production artifacts
|
- name: Archive production artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "com.android.application"
|
id "com.android.application"
|
||||||
id 'com.google.gms.google-services'
|
id 'com.google.gms.google-services'
|
||||||
|
id 'com.google.firebase.crashlytics'
|
||||||
id "kotlin-android"
|
id "kotlin-android"
|
||||||
id "dev.flutter.flutter-gradle-plugin"
|
id "dev.flutter.flutter-gradle-plugin"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,12 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name="com.yalantis.ucrop.UCropActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
|
||||||
|
|
||||||
<!-- Don't delete the meta-data below.
|
<!-- Don't delete the meta-data below.
|
||||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
<meta-data
|
<meta-data
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 24 KiB |
@@ -12,6 +12,17 @@ subprojects {
|
|||||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||||
}
|
}
|
||||||
subprojects {
|
subprojects {
|
||||||
|
// TO FIX LIVEKIT ISSUE BY THIS
|
||||||
|
// https://github.com/livekit/client-sdk-flutter/issues/569#issuecomment-2275686786
|
||||||
|
afterEvaluate { project ->
|
||||||
|
if (project.plugins.hasPlugin("com.android.application") ||
|
||||||
|
project.plugins.hasPlugin("com.android.library")) {
|
||||||
|
project.android {
|
||||||
|
compileSdkVersion 34
|
||||||
|
buildToolsVersion "34.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
project.evaluationDependsOn(":app")
|
project.evaluationDependsOn(":app")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ plugins {
|
|||||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||||
id "com.android.application" version '8.4.0' apply false
|
id "com.android.application" version '8.4.0' apply false
|
||||||
id "com.google.gms.google-services" version "4.3.15" apply false
|
id "com.google.gms.google-services" version "4.3.15" apply false
|
||||||
|
id "com.google.firebase.crashlytics" version "2.8.1" apply false
|
||||||
id "org.jetbrains.kotlin.android" version '2.0.0' apply false
|
id "org.jetbrains.kotlin.android" version '2.0.0' apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
assets/fonts/Comfortaa-Bold.ttf
Executable file
BIN
assets/fonts/Comfortaa-Regular.ttf
Executable file
BIN
assets/fonts/NotoColorEmoji-Regular.ttf
Executable file
BIN
assets/fonts/NotoSansHK-Bold.ttf
Executable file
BIN
assets/fonts/NotoSansHK-Regular.ttf
Executable file
BIN
assets/fonts/NotoSansJP-Bold.ttf
Executable file
BIN
assets/fonts/NotoSansJP-Regular.ttf
Executable file
BIN
assets/fonts/NotoSansSC-Bold.ttf
Executable file
BIN
assets/fonts/NotoSansSC-Regular.ttf
Executable file
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 406 KiB |
BIN
assets/icon.png
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 360 KiB |
BIN
assets/logo.png
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 360 KiB |
@@ -1,3 +1,4 @@
|
|||||||
description: This file stores settings for Dart & Flutter DevTools.
|
description: This file stores settings for Dart & Flutter DevTools.
|
||||||
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
|
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
|
||||||
extensions:
|
extensions:
|
||||||
|
- provider: true
|
||||||
264
ios/Podfile.lock
@@ -38,30 +38,84 @@ PODS:
|
|||||||
- file_picker (0.0.1):
|
- file_picker (0.0.1):
|
||||||
- DKImagePickerController/PhotoGallery
|
- DKImagePickerController/PhotoGallery
|
||||||
- Flutter
|
- Flutter
|
||||||
- Firebase/CoreOnly (10.28.0):
|
- Firebase/Analytics (10.29.0):
|
||||||
- FirebaseCore (= 10.28.0)
|
- Firebase/Core
|
||||||
- Firebase/Messaging (10.28.0):
|
- Firebase/Core (10.29.0):
|
||||||
- Firebase/CoreOnly
|
- Firebase/CoreOnly
|
||||||
- FirebaseMessaging (~> 10.28.0)
|
- FirebaseAnalytics (~> 10.29.0)
|
||||||
- firebase_core (3.2.0):
|
- Firebase/CoreOnly (10.29.0):
|
||||||
- Firebase/CoreOnly (= 10.28.0)
|
- FirebaseCore (= 10.29.0)
|
||||||
- Flutter
|
- Firebase/Crashlytics (10.29.0):
|
||||||
- firebase_messaging (15.0.3):
|
- Firebase/CoreOnly
|
||||||
- Firebase/Messaging (= 10.28.0)
|
- FirebaseCrashlytics (~> 10.29.0)
|
||||||
|
- Firebase/Messaging (10.29.0):
|
||||||
|
- Firebase/CoreOnly
|
||||||
|
- FirebaseMessaging (~> 10.29.0)
|
||||||
|
- Firebase/Performance (10.29.0):
|
||||||
|
- Firebase/CoreOnly
|
||||||
|
- FirebasePerformance (~> 10.29.0)
|
||||||
|
- firebase_analytics (11.2.1):
|
||||||
|
- Firebase/Analytics (= 10.29.0)
|
||||||
- firebase_core
|
- firebase_core
|
||||||
- Flutter
|
- Flutter
|
||||||
- FirebaseCore (10.28.0):
|
- firebase_core (3.3.0):
|
||||||
|
- Firebase/CoreOnly (= 10.29.0)
|
||||||
|
- Flutter
|
||||||
|
- firebase_crashlytics (4.0.4):
|
||||||
|
- Firebase/Crashlytics (= 10.29.0)
|
||||||
|
- firebase_core
|
||||||
|
- Flutter
|
||||||
|
- firebase_messaging (15.0.4):
|
||||||
|
- Firebase/Messaging (= 10.29.0)
|
||||||
|
- firebase_core
|
||||||
|
- Flutter
|
||||||
|
- firebase_performance (0.10.0-4):
|
||||||
|
- Firebase/Performance (= 10.29.0)
|
||||||
|
- firebase_core
|
||||||
|
- Flutter
|
||||||
|
- FirebaseABTesting (10.29.0):
|
||||||
|
- FirebaseCore (~> 10.0)
|
||||||
|
- FirebaseAnalytics (10.29.0):
|
||||||
|
- FirebaseAnalytics/AdIdSupport (= 10.29.0)
|
||||||
|
- FirebaseCore (~> 10.0)
|
||||||
|
- FirebaseInstallations (~> 10.0)
|
||||||
|
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
|
||||||
|
- GoogleUtilities/MethodSwizzler (~> 7.11)
|
||||||
|
- GoogleUtilities/Network (~> 7.11)
|
||||||
|
- "GoogleUtilities/NSData+zlib (~> 7.11)"
|
||||||
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
|
- FirebaseAnalytics/AdIdSupport (10.29.0):
|
||||||
|
- FirebaseCore (~> 10.0)
|
||||||
|
- FirebaseInstallations (~> 10.0)
|
||||||
|
- GoogleAppMeasurement (= 10.29.0)
|
||||||
|
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
|
||||||
|
- GoogleUtilities/MethodSwizzler (~> 7.11)
|
||||||
|
- GoogleUtilities/Network (~> 7.11)
|
||||||
|
- "GoogleUtilities/NSData+zlib (~> 7.11)"
|
||||||
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
|
- FirebaseCore (10.29.0):
|
||||||
- FirebaseCoreInternal (~> 10.0)
|
- FirebaseCoreInternal (~> 10.0)
|
||||||
- GoogleUtilities/Environment (~> 7.12)
|
- GoogleUtilities/Environment (~> 7.12)
|
||||||
- GoogleUtilities/Logger (~> 7.12)
|
- GoogleUtilities/Logger (~> 7.12)
|
||||||
|
- FirebaseCoreExtension (10.29.0):
|
||||||
|
- FirebaseCore (~> 10.0)
|
||||||
- FirebaseCoreInternal (10.29.0):
|
- FirebaseCoreInternal (10.29.0):
|
||||||
- "GoogleUtilities/NSData+zlib (~> 7.8)"
|
- "GoogleUtilities/NSData+zlib (~> 7.8)"
|
||||||
|
- FirebaseCrashlytics (10.29.0):
|
||||||
|
- FirebaseCore (~> 10.5)
|
||||||
|
- FirebaseInstallations (~> 10.0)
|
||||||
|
- FirebaseRemoteConfigInterop (~> 10.23)
|
||||||
|
- FirebaseSessions (~> 10.5)
|
||||||
|
- GoogleDataTransport (~> 9.2)
|
||||||
|
- GoogleUtilities/Environment (~> 7.8)
|
||||||
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
|
- PromisesObjC (~> 2.1)
|
||||||
- FirebaseInstallations (10.29.0):
|
- FirebaseInstallations (10.29.0):
|
||||||
- FirebaseCore (~> 10.0)
|
- FirebaseCore (~> 10.0)
|
||||||
- GoogleUtilities/Environment (~> 7.8)
|
- GoogleUtilities/Environment (~> 7.8)
|
||||||
- GoogleUtilities/UserDefaults (~> 7.8)
|
- GoogleUtilities/UserDefaults (~> 7.8)
|
||||||
- PromisesObjC (~> 2.1)
|
- PromisesObjC (~> 2.1)
|
||||||
- FirebaseMessaging (10.28.0):
|
- FirebaseMessaging (10.29.0):
|
||||||
- FirebaseCore (~> 10.0)
|
- FirebaseCore (~> 10.0)
|
||||||
- FirebaseInstallations (~> 10.0)
|
- FirebaseInstallations (~> 10.0)
|
||||||
- GoogleDataTransport (~> 9.3)
|
- GoogleDataTransport (~> 9.3)
|
||||||
@@ -70,12 +124,67 @@ PODS:
|
|||||||
- GoogleUtilities/Reachability (~> 7.8)
|
- GoogleUtilities/Reachability (~> 7.8)
|
||||||
- GoogleUtilities/UserDefaults (~> 7.8)
|
- GoogleUtilities/UserDefaults (~> 7.8)
|
||||||
- nanopb (< 2.30911.0, >= 2.30908.0)
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
|
- FirebasePerformance (10.29.0):
|
||||||
|
- FirebaseCore (~> 10.5)
|
||||||
|
- FirebaseInstallations (~> 10.0)
|
||||||
|
- FirebaseRemoteConfig (~> 10.0)
|
||||||
|
- FirebaseSessions (~> 10.5)
|
||||||
|
- GoogleDataTransport (~> 9.2)
|
||||||
|
- GoogleUtilities/Environment (~> 7.13)
|
||||||
|
- GoogleUtilities/ISASwizzler (~> 7.13)
|
||||||
|
- GoogleUtilities/MethodSwizzler (~> 7.13)
|
||||||
|
- GoogleUtilities/UserDefaults (~> 7.13)
|
||||||
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
|
- FirebaseRemoteConfig (10.29.0):
|
||||||
|
- FirebaseABTesting (~> 10.0)
|
||||||
|
- FirebaseCore (~> 10.0)
|
||||||
|
- FirebaseInstallations (~> 10.0)
|
||||||
|
- FirebaseRemoteConfigInterop (~> 10.23)
|
||||||
|
- FirebaseSharedSwift (~> 10.0)
|
||||||
|
- GoogleUtilities/Environment (~> 7.8)
|
||||||
|
- "GoogleUtilities/NSData+zlib (~> 7.8)"
|
||||||
|
- FirebaseRemoteConfigInterop (10.29.0)
|
||||||
|
- FirebaseSessions (10.29.0):
|
||||||
|
- FirebaseCore (~> 10.5)
|
||||||
|
- FirebaseCoreExtension (~> 10.0)
|
||||||
|
- FirebaseInstallations (~> 10.0)
|
||||||
|
- GoogleDataTransport (~> 9.2)
|
||||||
|
- GoogleUtilities/Environment (~> 7.13)
|
||||||
|
- GoogleUtilities/UserDefaults (~> 7.13)
|
||||||
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
|
- PromisesSwift (~> 2.1)
|
||||||
|
- FirebaseSharedSwift (10.29.0)
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
|
- flutter_keyboard_visibility (0.0.1):
|
||||||
|
- Flutter
|
||||||
- flutter_secure_storage (6.0.0):
|
- flutter_secure_storage (6.0.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- flutter_webrtc (0.11.3):
|
- flutter_webrtc (0.11.3):
|
||||||
- Flutter
|
- Flutter
|
||||||
- WebRTC-SDK (= 125.6422.04)
|
- WebRTC-SDK (= 125.6422.04)
|
||||||
|
- gal (1.0.0):
|
||||||
|
- Flutter
|
||||||
|
- FlutterMacOS
|
||||||
|
- GoogleAppMeasurement (10.29.0):
|
||||||
|
- GoogleAppMeasurement/AdIdSupport (= 10.29.0)
|
||||||
|
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
|
||||||
|
- GoogleUtilities/MethodSwizzler (~> 7.11)
|
||||||
|
- GoogleUtilities/Network (~> 7.11)
|
||||||
|
- "GoogleUtilities/NSData+zlib (~> 7.11)"
|
||||||
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
|
- GoogleAppMeasurement/AdIdSupport (10.29.0):
|
||||||
|
- GoogleAppMeasurement/WithoutAdIdSupport (= 10.29.0)
|
||||||
|
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
|
||||||
|
- GoogleUtilities/MethodSwizzler (~> 7.11)
|
||||||
|
- GoogleUtilities/Network (~> 7.11)
|
||||||
|
- "GoogleUtilities/NSData+zlib (~> 7.11)"
|
||||||
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
|
- GoogleAppMeasurement/WithoutAdIdSupport (10.29.0):
|
||||||
|
- GoogleUtilities/AppDelegateSwizzler (~> 7.11)
|
||||||
|
- GoogleUtilities/MethodSwizzler (~> 7.11)
|
||||||
|
- GoogleUtilities/Network (~> 7.11)
|
||||||
|
- "GoogleUtilities/NSData+zlib (~> 7.11)"
|
||||||
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
- GoogleDataTransport (9.4.1):
|
- GoogleDataTransport (9.4.1):
|
||||||
- GoogleUtilities/Environment (~> 7.7)
|
- GoogleUtilities/Environment (~> 7.7)
|
||||||
- nanopb (< 2.30911.0, >= 2.30908.0)
|
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||||
@@ -88,9 +197,14 @@ PODS:
|
|||||||
- GoogleUtilities/Environment (7.13.3):
|
- GoogleUtilities/Environment (7.13.3):
|
||||||
- GoogleUtilities/Privacy
|
- GoogleUtilities/Privacy
|
||||||
- PromisesObjC (< 3.0, >= 1.2)
|
- PromisesObjC (< 3.0, >= 1.2)
|
||||||
|
- GoogleUtilities/ISASwizzler (7.13.3):
|
||||||
|
- GoogleUtilities/Privacy
|
||||||
- GoogleUtilities/Logger (7.13.3):
|
- GoogleUtilities/Logger (7.13.3):
|
||||||
- GoogleUtilities/Environment
|
- GoogleUtilities/Environment
|
||||||
- GoogleUtilities/Privacy
|
- GoogleUtilities/Privacy
|
||||||
|
- GoogleUtilities/MethodSwizzler (7.13.3):
|
||||||
|
- GoogleUtilities/Logger
|
||||||
|
- GoogleUtilities/Privacy
|
||||||
- GoogleUtilities/Network (7.13.3):
|
- GoogleUtilities/Network (7.13.3):
|
||||||
- GoogleUtilities/Logger
|
- GoogleUtilities/Logger
|
||||||
- "GoogleUtilities/NSData+zlib"
|
- "GoogleUtilities/NSData+zlib"
|
||||||
@@ -105,17 +219,14 @@ PODS:
|
|||||||
- GoogleUtilities/UserDefaults (7.13.3):
|
- GoogleUtilities/UserDefaults (7.13.3):
|
||||||
- GoogleUtilities/Logger
|
- GoogleUtilities/Logger
|
||||||
- GoogleUtilities/Privacy
|
- GoogleUtilities/Privacy
|
||||||
|
- image_cropper (0.0.4):
|
||||||
|
- Flutter
|
||||||
|
- TOCropViewController (~> 2.7.4)
|
||||||
- image_picker_ios (0.0.1):
|
- image_picker_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- livekit_client (2.2.2):
|
- livekit_client (2.2.4):
|
||||||
- Flutter
|
- Flutter
|
||||||
- WebRTC-SDK (= 125.6422.04)
|
- WebRTC-SDK (= 125.6422.04)
|
||||||
- media_kit_libs_ios_video (1.0.4):
|
|
||||||
- Flutter
|
|
||||||
- media_kit_native_event_loop (1.0.0):
|
|
||||||
- Flutter
|
|
||||||
- media_kit_video (0.0.1):
|
|
||||||
- Flutter
|
|
||||||
- nanopb (2.30910.0):
|
- nanopb (2.30910.0):
|
||||||
- nanopb/decode (= 2.30910.0)
|
- nanopb/decode (= 2.30910.0)
|
||||||
- nanopb/encode (= 2.30910.0)
|
- nanopb/encode (= 2.30910.0)
|
||||||
@@ -130,19 +241,16 @@ PODS:
|
|||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- permission_handler_apple (9.3.0):
|
- permission_handler_apple (9.3.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- pointer_interceptor_ios (0.0.1):
|
||||||
|
- Flutter
|
||||||
- PromisesObjC (2.4.0)
|
- PromisesObjC (2.4.0)
|
||||||
|
- PromisesSwift (2.4.0):
|
||||||
|
- PromisesObjC (= 2.4.0)
|
||||||
- protocol_handler_ios (0.0.1):
|
- protocol_handler_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- screen_brightness_ios (0.1.0):
|
- SDWebImage (5.19.6):
|
||||||
- Flutter
|
- SDWebImage/Core (= 5.19.6)
|
||||||
- SDWebImage (5.19.4):
|
- SDWebImage/Core (5.19.6)
|
||||||
- SDWebImage/Core (= 5.19.4)
|
|
||||||
- SDWebImage/Core (5.19.4)
|
|
||||||
- Sentry/HybridSDK (8.32.0)
|
|
||||||
- sentry_flutter (8.5.0):
|
|
||||||
- Flutter
|
|
||||||
- FlutterMacOS
|
|
||||||
- Sentry/HybridSDK (= 8.32.0)
|
|
||||||
- share_plus (0.0.1):
|
- share_plus (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- shared_preferences_foundation (0.0.1):
|
- shared_preferences_foundation (0.0.1):
|
||||||
@@ -152,10 +260,12 @@ PODS:
|
|||||||
- Flutter
|
- Flutter
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- SwiftyGif (5.4.5)
|
- SwiftyGif (5.4.5)
|
||||||
|
- TOCropViewController (2.7.4)
|
||||||
- url_launcher_ios (0.0.1):
|
- url_launcher_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- volume_controller (0.0.1):
|
- video_player_avfoundation (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- FlutterMacOS
|
||||||
- wakelock_plus (0.0.1):
|
- wakelock_plus (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- WebRTC-SDK (125.6422.04)
|
- WebRTC-SDK (125.6422.04)
|
||||||
@@ -164,28 +274,30 @@ DEPENDENCIES:
|
|||||||
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`)
|
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`)
|
||||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||||
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
||||||
|
- firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`)
|
||||||
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
|
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
|
||||||
|
- firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`)
|
||||||
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
|
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
|
||||||
|
- firebase_performance (from `.symlinks/plugins/firebase_performance/ios`)
|
||||||
- Flutter (from `Flutter`)
|
- Flutter (from `Flutter`)
|
||||||
|
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
|
||||||
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
|
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
|
||||||
- flutter_webrtc (from `.symlinks/plugins/flutter_webrtc/ios`)
|
- flutter_webrtc (from `.symlinks/plugins/flutter_webrtc/ios`)
|
||||||
|
- gal (from `.symlinks/plugins/gal/darwin`)
|
||||||
|
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
|
||||||
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||||
- livekit_client (from `.symlinks/plugins/livekit_client/ios`)
|
- livekit_client (from `.symlinks/plugins/livekit_client/ios`)
|
||||||
- media_kit_libs_ios_video (from `.symlinks/plugins/media_kit_libs_ios_video/ios`)
|
|
||||||
- media_kit_native_event_loop (from `.symlinks/plugins/media_kit_native_event_loop/ios`)
|
|
||||||
- media_kit_video (from `.symlinks/plugins/media_kit_video/ios`)
|
|
||||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||||
- pasteboard (from `.symlinks/plugins/pasteboard/ios`)
|
- pasteboard (from `.symlinks/plugins/pasteboard/ios`)
|
||||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||||
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||||
|
- pointer_interceptor_ios (from `.symlinks/plugins/pointer_interceptor_ios/ios`)
|
||||||
- protocol_handler_ios (from `.symlinks/plugins/protocol_handler_ios/ios`)
|
- protocol_handler_ios (from `.symlinks/plugins/protocol_handler_ios/ios`)
|
||||||
- screen_brightness_ios (from `.symlinks/plugins/screen_brightness_ios/ios`)
|
|
||||||
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
|
|
||||||
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
||||||
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||||
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
|
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
|
||||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||||
- volume_controller (from `.symlinks/plugins/volume_controller/ios`)
|
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
|
||||||
- wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
|
- wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
|
||||||
|
|
||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
@@ -193,17 +305,28 @@ SPEC REPOS:
|
|||||||
- DKImagePickerController
|
- DKImagePickerController
|
||||||
- DKPhotoGallery
|
- DKPhotoGallery
|
||||||
- Firebase
|
- Firebase
|
||||||
|
- FirebaseABTesting
|
||||||
|
- FirebaseAnalytics
|
||||||
- FirebaseCore
|
- FirebaseCore
|
||||||
|
- FirebaseCoreExtension
|
||||||
- FirebaseCoreInternal
|
- FirebaseCoreInternal
|
||||||
|
- FirebaseCrashlytics
|
||||||
- FirebaseInstallations
|
- FirebaseInstallations
|
||||||
- FirebaseMessaging
|
- FirebaseMessaging
|
||||||
|
- FirebasePerformance
|
||||||
|
- FirebaseRemoteConfig
|
||||||
|
- FirebaseRemoteConfigInterop
|
||||||
|
- FirebaseSessions
|
||||||
|
- FirebaseSharedSwift
|
||||||
|
- GoogleAppMeasurement
|
||||||
- GoogleDataTransport
|
- GoogleDataTransport
|
||||||
- GoogleUtilities
|
- GoogleUtilities
|
||||||
- nanopb
|
- nanopb
|
||||||
- PromisesObjC
|
- PromisesObjC
|
||||||
|
- PromisesSwift
|
||||||
- SDWebImage
|
- SDWebImage
|
||||||
- Sentry
|
|
||||||
- SwiftyGif
|
- SwiftyGif
|
||||||
|
- TOCropViewController
|
||||||
- WebRTC-SDK
|
- WebRTC-SDK
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
@@ -213,26 +336,32 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/device_info_plus/ios"
|
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||||
file_picker:
|
file_picker:
|
||||||
:path: ".symlinks/plugins/file_picker/ios"
|
:path: ".symlinks/plugins/file_picker/ios"
|
||||||
|
firebase_analytics:
|
||||||
|
:path: ".symlinks/plugins/firebase_analytics/ios"
|
||||||
firebase_core:
|
firebase_core:
|
||||||
:path: ".symlinks/plugins/firebase_core/ios"
|
:path: ".symlinks/plugins/firebase_core/ios"
|
||||||
|
firebase_crashlytics:
|
||||||
|
:path: ".symlinks/plugins/firebase_crashlytics/ios"
|
||||||
firebase_messaging:
|
firebase_messaging:
|
||||||
:path: ".symlinks/plugins/firebase_messaging/ios"
|
:path: ".symlinks/plugins/firebase_messaging/ios"
|
||||||
|
firebase_performance:
|
||||||
|
:path: ".symlinks/plugins/firebase_performance/ios"
|
||||||
Flutter:
|
Flutter:
|
||||||
:path: Flutter
|
:path: Flutter
|
||||||
|
flutter_keyboard_visibility:
|
||||||
|
:path: ".symlinks/plugins/flutter_keyboard_visibility/ios"
|
||||||
flutter_secure_storage:
|
flutter_secure_storage:
|
||||||
:path: ".symlinks/plugins/flutter_secure_storage/ios"
|
:path: ".symlinks/plugins/flutter_secure_storage/ios"
|
||||||
flutter_webrtc:
|
flutter_webrtc:
|
||||||
:path: ".symlinks/plugins/flutter_webrtc/ios"
|
:path: ".symlinks/plugins/flutter_webrtc/ios"
|
||||||
|
gal:
|
||||||
|
:path: ".symlinks/plugins/gal/darwin"
|
||||||
|
image_cropper:
|
||||||
|
:path: ".symlinks/plugins/image_cropper/ios"
|
||||||
image_picker_ios:
|
image_picker_ios:
|
||||||
:path: ".symlinks/plugins/image_picker_ios/ios"
|
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||||
livekit_client:
|
livekit_client:
|
||||||
:path: ".symlinks/plugins/livekit_client/ios"
|
:path: ".symlinks/plugins/livekit_client/ios"
|
||||||
media_kit_libs_ios_video:
|
|
||||||
:path: ".symlinks/plugins/media_kit_libs_ios_video/ios"
|
|
||||||
media_kit_native_event_loop:
|
|
||||||
:path: ".symlinks/plugins/media_kit_native_event_loop/ios"
|
|
||||||
media_kit_video:
|
|
||||||
:path: ".symlinks/plugins/media_kit_video/ios"
|
|
||||||
package_info_plus:
|
package_info_plus:
|
||||||
:path: ".symlinks/plugins/package_info_plus/ios"
|
:path: ".symlinks/plugins/package_info_plus/ios"
|
||||||
pasteboard:
|
pasteboard:
|
||||||
@@ -241,12 +370,10 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
||||||
permission_handler_apple:
|
permission_handler_apple:
|
||||||
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||||
|
pointer_interceptor_ios:
|
||||||
|
:path: ".symlinks/plugins/pointer_interceptor_ios/ios"
|
||||||
protocol_handler_ios:
|
protocol_handler_ios:
|
||||||
:path: ".symlinks/plugins/protocol_handler_ios/ios"
|
:path: ".symlinks/plugins/protocol_handler_ios/ios"
|
||||||
screen_brightness_ios:
|
|
||||||
:path: ".symlinks/plugins/screen_brightness_ios/ios"
|
|
||||||
sentry_flutter:
|
|
||||||
:path: ".symlinks/plugins/sentry_flutter/ios"
|
|
||||||
share_plus:
|
share_plus:
|
||||||
:path: ".symlinks/plugins/share_plus/ios"
|
:path: ".symlinks/plugins/share_plus/ios"
|
||||||
shared_preferences_foundation:
|
shared_preferences_foundation:
|
||||||
@@ -255,8 +382,8 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/sqflite/darwin"
|
:path: ".symlinks/plugins/sqflite/darwin"
|
||||||
url_launcher_ios:
|
url_launcher_ios:
|
||||||
:path: ".symlinks/plugins/url_launcher_ios/ios"
|
:path: ".symlinks/plugins/url_launcher_ios/ios"
|
||||||
volume_controller:
|
video_player_avfoundation:
|
||||||
:path: ".symlinks/plugins/volume_controller/ios"
|
:path: ".symlinks/plugins/video_player_avfoundation/darwin"
|
||||||
wakelock_plus:
|
wakelock_plus:
|
||||||
:path: ".symlinks/plugins/wakelock_plus/ios"
|
:path: ".symlinks/plugins/wakelock_plus/ios"
|
||||||
|
|
||||||
@@ -266,40 +393,53 @@ SPEC CHECKSUMS:
|
|||||||
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
|
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
|
||||||
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
|
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
|
||||||
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
|
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
|
||||||
Firebase: 5121c624121af81cbc81df3bda414b3c28c4f3c3
|
Firebase: cec914dab6fd7b1bd8ab56ea07ce4e03dd251c2d
|
||||||
firebase_core: a9d0180d5285527884d07a41eb4a9ec9ed12cdb6
|
firebase_analytics: 04491d1ee74c8e7c2330c96afc54188a969b06ee
|
||||||
firebase_messaging: ccc82a143a74de75f440a4e413dbbb37ec3fddbc
|
firebase_core: 57aeb91680e5d5e6df6b888064be7c785f146efb
|
||||||
FirebaseCore: 857dc1c6dd1255675047404d8466f7dfaac5d779
|
firebase_crashlytics: e3d3e0c99bad5aaab5908385133dea8ec344693f
|
||||||
|
firebase_messaging: c862b3d2b973ecc769194dc8de09bd22c77ae757
|
||||||
|
firebase_performance: 8643e815a354ee94da1192cd69335a48a7b625a4
|
||||||
|
FirebaseABTesting: d87f56707159bae64e269757a6e963d490f2eebe
|
||||||
|
FirebaseAnalytics: 23717de130b779aa506e757edb9713d24b6ffeda
|
||||||
|
FirebaseCore: 30e9c1cbe3d38f5f5e75f48bfcea87d7c358ec16
|
||||||
|
FirebaseCoreExtension: 705ca5b14bf71d2564a0ddc677df1fc86ffa600f
|
||||||
FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934
|
FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934
|
||||||
|
FirebaseCrashlytics: 34647b41e18de773717fdd348a22206f2f9bc774
|
||||||
FirebaseInstallations: 913cf60d0400ebd5d6b63a28b290372ab44590dd
|
FirebaseInstallations: 913cf60d0400ebd5d6b63a28b290372ab44590dd
|
||||||
FirebaseMessaging: 087a7c7cadef7b9239f005bc4db823894844f323
|
FirebaseMessaging: 7b5d8033e183ab59eb5b852a53201559e976d366
|
||||||
|
FirebasePerformance: d0ac4aa90f8c1aedeb8d0329a56e2d77d8d9e004
|
||||||
|
FirebaseRemoteConfig: 48ef3f243742a8d72422ccfc9f986e19d7de53fd
|
||||||
|
FirebaseRemoteConfigInterop: 6efda51fb5e2f15b16585197e26eaa09574e8a4d
|
||||||
|
FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc
|
||||||
|
FirebaseSharedSwift: 20530f495084b8d840f78a100d8c5ee613375f6e
|
||||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||||
|
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
|
||||||
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
|
flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12
|
||||||
flutter_webrtc: 75b868e4f9e817c7a9a42ca4b6169063de4eec9f
|
flutter_webrtc: 75b868e4f9e817c7a9a42ca4b6169063de4eec9f
|
||||||
|
gal: 61e868295d28fe67ffa297fae6dacebf56fd53e1
|
||||||
|
GoogleAppMeasurement: f9de05ee17401e3355f68e8fc8b5064d429f5918
|
||||||
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
|
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
|
||||||
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
|
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
|
||||||
|
image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf
|
||||||
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
|
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
|
||||||
livekit_client: c767049a635d5b6d43de3273dca3c439b8a6e970
|
livekit_client: d079c5f040d4bf2b80440ff0ae997725a183e4bc
|
||||||
media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1
|
|
||||||
media_kit_native_event_loop: e6b2ab20cf0746eb1c33be961fcf79667304fa2a
|
|
||||||
media_kit_video: 5da63f157170e5bf303bf85453b7ef6971218a2e
|
|
||||||
nanopb: 438bc412db1928dac798aa6fd75726007be04262
|
nanopb: 438bc412db1928dac798aa6fd75726007be04262
|
||||||
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
|
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
|
||||||
pasteboard: 982969ebaa7c78af3e6cc7761e8f5e77565d9ce0
|
pasteboard: 982969ebaa7c78af3e6cc7761e8f5e77565d9ce0
|
||||||
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
||||||
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
||||||
|
pointer_interceptor_ios: 508241697ff0947f853c061945a8b822463947c1
|
||||||
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
||||||
|
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
|
||||||
protocol_handler_ios: a5db8abc38526ee326988b808be621e5fd568990
|
protocol_handler_ios: a5db8abc38526ee326988b808be621e5fd568990
|
||||||
screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625
|
SDWebImage: a79252b60f4678812d94316c91da69ec83089c9f
|
||||||
SDWebImage: 066c47b573f408f18caa467d71deace7c0f8280d
|
|
||||||
Sentry: 96ae1dcdf01a644bc3a3b1dc279cecaf48a833fb
|
|
||||||
sentry_flutter: f1d86adcb93a959bc47a40d8d55059bdf7569bc5
|
|
||||||
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
|
share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad
|
||||||
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
||||||
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
|
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
|
||||||
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
||||||
|
TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654
|
||||||
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
|
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
|
||||||
volume_controller: 531ddf792994285c9b17f9d8a7e4dcdd29b3eae9
|
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
|
||||||
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
|
wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
|
||||||
WebRTC-SDK: c3d69a87e7185fad3568f6f3cff7c9ac5890acf3
|
WebRTC-SDK: c3d69a87e7185fad3568f6f3cff7c9ac5890acf3
|
||||||
|
|
||||||
|
|||||||
@@ -254,6 +254,7 @@
|
|||||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
B1CDA9DD5B638A2BB88053CB /* [CP] Check Pods Manifest.lock */,
|
B1CDA9DD5B638A2BB88053CB /* [CP] Check Pods Manifest.lock */,
|
||||||
|
7356FAC42C72724B0051A465 /* [Crashlytics] Clear dSYM */,
|
||||||
9740EEB61CF901F6004384FC /* Run Script */,
|
9740EEB61CF901F6004384FC /* Run Script */,
|
||||||
97C146EA1CF9000F007C117D /* Sources */,
|
97C146EA1CF9000F007C117D /* Sources */,
|
||||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||||
@@ -263,6 +264,7 @@
|
|||||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
287A33C298CA352A7E7F32A4 /* [CP] Embed Pods Frameworks */,
|
287A33C298CA352A7E7F32A4 /* [CP] Embed Pods Frameworks */,
|
||||||
0818E8E4321C0D7433E07576 /* [CP] Copy Pods Resources */,
|
0818E8E4321C0D7433E07576 /* [CP] Copy Pods Resources */,
|
||||||
|
1A9FD6BE5DEE99CDA7399504 /* [Crashlytics] Upload dSYM */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -365,6 +367,24 @@
|
|||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
|
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
|
||||||
showEnvVarsInLog = 0;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
|
1A9FD6BE5DEE99CDA7399504 /* [Crashlytics] Upload dSYM */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "[Crashlytics] Upload dSYM";
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\n#!/bin/bash\nsleep 1 # Without this, there seems a chance that the script runs before dSYM generation is finished \n$PODS_ROOT/FirebaseCrashlytics/upload-symbols -gsp $PROJECT_DIR/Runner/GoogleService-Info.plist -p ios $DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME\n";
|
||||||
|
};
|
||||||
259653AE41D478F4C6BAE9B2 /* [CP] Check Pods Manifest.lock */ = {
|
259653AE41D478F4C6BAE9B2 /* [CP] Check Pods Manifest.lock */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
@@ -420,6 +440,24 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||||
};
|
};
|
||||||
|
7356FAC42C72724B0051A465 /* [Crashlytics] Clear dSYM */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "[Crashlytics] Clear dSYM";
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "\n#!/bin/bash\nrm -rf $DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME\n";
|
||||||
|
};
|
||||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
alwaysOutOfDate = 1;
|
alwaysOutOfDate = 1;
|
||||||
@@ -433,7 +471,7 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
|
||||||
};
|
};
|
||||||
B1CDA9DD5B638A2BB88053CB /* [CP] Check Pods Manifest.lock */ = {
|
B1CDA9DD5B638A2BB88053CB /* [CP] Check Pods Manifest.lock */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
import Flutter
|
import Flutter
|
||||||
|
|
||||||
@UIApplicationMain
|
@main
|
||||||
@objc class AppDelegate: FlutterAppDelegate {
|
@objc class AppDelegate: FlutterAppDelegate {
|
||||||
override func application(
|
override func application(
|
||||||
_ application: UIApplication,
|
_ application: UIApplication,
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 320 KiB |
|
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 822 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 815 B After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 20 KiB |
@@ -1,10 +1,15 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:solian/exts.dart';
|
import 'package:solian/exts.dart';
|
||||||
|
import 'package:solian/platform.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
import 'package:solian/providers/content/channel.dart';
|
import 'package:solian/providers/content/channel.dart';
|
||||||
|
import 'package:solian/providers/content/realm.dart';
|
||||||
import 'package:solian/providers/relation.dart';
|
import 'package:solian/providers/relation.dart';
|
||||||
|
import 'package:solian/providers/stickers.dart';
|
||||||
|
import 'package:solian/providers/theme_switcher.dart';
|
||||||
import 'package:solian/providers/websocket.dart';
|
import 'package:solian/providers/websocket.dart';
|
||||||
import 'package:solian/services.dart';
|
import 'package:solian/services.dart';
|
||||||
import 'package:solian/widgets/sized_container.dart';
|
import 'package:solian/widgets/sized_container.dart';
|
||||||
@@ -21,6 +26,7 @@ class BootstrapperShell extends StatefulWidget {
|
|||||||
class _BootstrapperShellState extends State<BootstrapperShell> {
|
class _BootstrapperShellState extends State<BootstrapperShell> {
|
||||||
bool _isBusy = true;
|
bool _isBusy = true;
|
||||||
bool _isErrored = false;
|
bool _isErrored = false;
|
||||||
|
bool _isDismissable = true;
|
||||||
String? _subtitle;
|
String? _subtitle;
|
||||||
|
|
||||||
Color get _unFocusColor =>
|
Color get _unFocusColor =>
|
||||||
@@ -29,6 +35,38 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
int _periodCursor = 0;
|
int _periodCursor = 0;
|
||||||
|
|
||||||
late final List<({String label, Future<void> Function() action})> _periods = [
|
late final List<({String label, Future<void> Function() action})> _periods = [
|
||||||
|
(
|
||||||
|
label: 'bsLoadingTheme',
|
||||||
|
action: () async {
|
||||||
|
await context.read<ThemeSwitcher>().restoreTheme();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
label: 'bsCheckForUpdate',
|
||||||
|
action: () async {
|
||||||
|
if (PlatformInfo.isWeb) return;
|
||||||
|
try {
|
||||||
|
final info = await PackageInfo.fromPlatform();
|
||||||
|
final localVersionString = '${info.version}+${info.buildNumber}';
|
||||||
|
final resp = await GetConnect().get(
|
||||||
|
'https://git.solsynth.dev/api/v1/repos/hydrogen/solian/tags?limit=1',
|
||||||
|
);
|
||||||
|
if (resp.body[0]['name'] != localVersionString) {
|
||||||
|
setState(() {
|
||||||
|
_isErrored = true;
|
||||||
|
_subtitle = PlatformInfo.isIOS || PlatformInfo.isMacOS
|
||||||
|
? 'bsCheckForUpdateDescApple'.tr
|
||||||
|
: 'bsCheckForUpdateDescCommon'.tr;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
setState(() {
|
||||||
|
_isErrored = true;
|
||||||
|
_subtitle = 'bsCheckForUpdateFailed'.tr;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
(
|
(
|
||||||
label: 'bsCheckingServer',
|
label: 'bsCheckingServer',
|
||||||
action: () async {
|
action: () async {
|
||||||
@@ -38,12 +76,14 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
_isErrored = true;
|
_isErrored = true;
|
||||||
_subtitle = 'bsCheckingServerDown'.tr;
|
_subtitle = 'bsCheckingServerDown'.tr;
|
||||||
|
_isDismissable = false;
|
||||||
});
|
});
|
||||||
throw Exception('unable connect to server');
|
throw Exception('unable connect to server');
|
||||||
} else if (resp.statusCode == null) {
|
} else if (resp.statusCode == null) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isErrored = true;
|
_isErrored = true;
|
||||||
_subtitle = 'bsCheckingServerFail'.tr;
|
_subtitle = 'bsCheckingServerFail'.tr;
|
||||||
|
_isDismissable = false;
|
||||||
});
|
});
|
||||||
throw Exception('unable connect to server');
|
throw Exception('unable connect to server');
|
||||||
}
|
}
|
||||||
@@ -72,12 +112,15 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
label: 'bsPreparingData',
|
label: 'bsPreparingData',
|
||||||
action: () async {
|
action: () async {
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
if (auth.isAuthorized.isTrue) {
|
await Future.wait([
|
||||||
await Future.wait([
|
Get.find<StickerProvider>().refreshAvailableStickers(),
|
||||||
|
if (auth.isAuthorized.isTrue)
|
||||||
Get.find<ChannelProvider>().refreshAvailableChannel(),
|
Get.find<ChannelProvider>().refreshAvailableChannel(),
|
||||||
Get.find<RelationshipProvider>().refreshFriendList(),
|
if (auth.isAuthorized.isTrue)
|
||||||
]);
|
Get.find<RelationshipProvider>().refreshRelativeList(),
|
||||||
}
|
if (auth.isAuthorized.isTrue)
|
||||||
|
Get.find<RealmProvider>().refreshAvailableRealms(),
|
||||||
|
]);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
@@ -101,7 +144,7 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
try {
|
try {
|
||||||
for (var idx = 0; idx < _periods.length; idx++) {
|
for (var idx = 0; idx < _periods.length; idx++) {
|
||||||
await _periods[idx].action();
|
await _periods[idx].action();
|
||||||
if (_isErrored) break;
|
if (_isErrored && !_isDismissable) break;
|
||||||
if (_periodCursor < _periods.length - 1) {
|
if (_periodCursor < _periods.length - 1) {
|
||||||
setState(() => _periodCursor++);
|
setState(() => _periodCursor++);
|
||||||
}
|
}
|
||||||
@@ -120,27 +163,31 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (_isBusy || _isErrored) {
|
if (_isBusy || _isErrored) {
|
||||||
return Material(
|
return GestureDetector(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
child: Material(
|
||||||
child: Column(
|
color: Theme.of(context).colorScheme.surface,
|
||||||
mainAxisSize: MainAxisSize.max,
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
SizedBox(
|
children: [
|
||||||
height: 280,
|
SizedBox(
|
||||||
child: Align(
|
height: 280,
|
||||||
alignment: Alignment.bottomCenter,
|
child: Align(
|
||||||
child: Image.asset('assets/logo.png', width: 80, height: 80)
|
alignment: Alignment.bottomCenter,
|
||||||
.animate(onPlay: (c) => c.repeat())
|
child: ClipRRect(
|
||||||
.rotate(duration: 850.ms, curve: Curves.easeInOut),
|
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||||
|
child:
|
||||||
|
Image.asset('assets/logo.png', width: 80, height: 80),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Column(
|
||||||
GestureDetector(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
children: [
|
||||||
if (_isErrored)
|
if (_isErrored && !_isDismissable && !_isBusy)
|
||||||
const Icon(Icons.cancel, size: 24)
|
const Icon(Icons.cancel, size: 24),
|
||||||
else
|
if (_isErrored && _isDismissable && !_isBusy)
|
||||||
|
const Icon(Icons.warning, size: 24),
|
||||||
|
if ((_isErrored && _isDismissable && _isBusy) || _isBusy)
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
@@ -151,15 +198,33 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
maxWidth: 280,
|
maxWidth: 280,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
if (_subtitle == null)
|
||||||
_subtitle ??
|
Text(
|
||||||
'${_periods[_periodCursor].label.tr} (${_periodCursor + 1}/${_periods.length})',
|
'${_periods[_periodCursor].label.tr} (${_periodCursor + 1}/${_periods.length})',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
color: _unFocusColor,
|
color: _unFocusColor,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
if (_subtitle != null)
|
||||||
|
Text(
|
||||||
|
_subtitle!,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: _unFocusColor,
|
||||||
|
),
|
||||||
|
).paddingOnly(bottom: 4),
|
||||||
|
if (!_isBusy && _isErrored && _isDismissable)
|
||||||
|
Text(
|
||||||
|
'bsDismissibleErrorHint'.tr,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: _unFocusColor,
|
||||||
|
),
|
||||||
|
).paddingOnly(bottom: 5),
|
||||||
Text(
|
Text(
|
||||||
'2024 © Solsynth LLC',
|
'2024 © Solsynth LLC',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
@@ -173,18 +238,25 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
onTap: () {
|
],
|
||||||
if (_isBusy) return;
|
),
|
||||||
setState(() {
|
|
||||||
_isBusy = true;
|
|
||||||
_isErrored = false;
|
|
||||||
_periodCursor = 0;
|
|
||||||
});
|
|
||||||
_runPeriods();
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
onTap: () {
|
||||||
|
if (_isBusy) return;
|
||||||
|
if (_isDismissable) {
|
||||||
|
setState(() {
|
||||||
|
_isBusy = false;
|
||||||
|
_isErrored = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
_isBusy = true;
|
||||||
|
_isErrored = false;
|
||||||
|
_periodCursor = 0;
|
||||||
|
});
|
||||||
|
_runPeriods();
|
||||||
|
}
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class ChatEventController {
|
|||||||
Channel? channel;
|
Channel? channel;
|
||||||
String? scope;
|
String? scope;
|
||||||
|
|
||||||
initialize() async {
|
Future<void> initialize() async {
|
||||||
if (!PlatformInfo.isWeb) {
|
if (!PlatformInfo.isWeb) {
|
||||||
database = await createHistoryDb();
|
database = await createHistoryDb();
|
||||||
}
|
}
|
||||||
@@ -131,6 +131,8 @@ class ChatEventController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
insertEvent(LocalEvent entry) {
|
insertEvent(LocalEvent entry) {
|
||||||
|
if (entry.channelId != channel?.id) return;
|
||||||
|
|
||||||
final idx = currentEvents.indexWhere((x) => x.data.uuid == entry.data.uuid);
|
final idx = currentEvents.indexWhere((x) => x.data.uuid == entry.data.uuid);
|
||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
currentEvents[idx] = entry;
|
currentEvents[idx] = entry;
|
||||||
|
|||||||
@@ -7,13 +7,17 @@ import 'package:solian/models/post.dart';
|
|||||||
import 'package:solian/models/realm.dart';
|
import 'package:solian/models/realm.dart';
|
||||||
import 'package:solian/widgets/attachments/attachment_editor.dart';
|
import 'package:solian/widgets/attachments/attachment_editor.dart';
|
||||||
import 'package:solian/widgets/posts/editor/post_editor_categories_tags.dart';
|
import 'package:solian/widgets/posts/editor/post_editor_categories_tags.dart';
|
||||||
|
import 'package:solian/widgets/posts/editor/post_editor_date.dart';
|
||||||
import 'package:solian/widgets/posts/editor/post_editor_overview.dart';
|
import 'package:solian/widgets/posts/editor/post_editor_overview.dart';
|
||||||
|
import 'package:solian/widgets/posts/editor/post_editor_publish_zone.dart';
|
||||||
|
import 'package:solian/widgets/posts/editor/post_editor_thumbnail.dart';
|
||||||
import 'package:solian/widgets/posts/editor/post_editor_visibility.dart';
|
import 'package:solian/widgets/posts/editor/post_editor_visibility.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
class PostEditorController extends GetxController {
|
class PostEditorController extends GetxController {
|
||||||
late final SharedPreferences _prefs;
|
late final SharedPreferences _prefs;
|
||||||
|
|
||||||
|
final aliasController = TextEditingController();
|
||||||
final titleController = TextEditingController();
|
final titleController = TextEditingController();
|
||||||
final descriptionController = TextEditingController();
|
final descriptionController = TextEditingController();
|
||||||
final contentController = TextEditingController();
|
final contentController = TextEditingController();
|
||||||
@@ -25,8 +29,11 @@ class PostEditorController extends GetxController {
|
|||||||
Rx<Post?> replyTo = Rx(null);
|
Rx<Post?> replyTo = Rx(null);
|
||||||
Rx<Post?> repostTo = Rx(null);
|
Rx<Post?> repostTo = Rx(null);
|
||||||
Rx<Realm?> realmZone = Rx(null);
|
Rx<Realm?> realmZone = Rx(null);
|
||||||
RxList<int> attachments = RxList<int>.empty(growable: true);
|
Rx<DateTime?> publishedAt = Rx(null);
|
||||||
|
Rx<DateTime?> publishedUntil = Rx(null);
|
||||||
|
RxList<String> attachments = RxList<String>.empty(growable: true);
|
||||||
RxList<String> tags = RxList<String>.empty(growable: true);
|
RxList<String> tags = RxList<String>.empty(growable: true);
|
||||||
|
Rx<String?> thumbnail = Rx(null);
|
||||||
|
|
||||||
RxList<int> visibleUsers = RxList.empty(growable: true);
|
RxList<int> visibleUsers = RxList.empty(growable: true);
|
||||||
RxList<int> invisibleUsers = RxList.empty(growable: true);
|
RxList<int> invisibleUsers = RxList.empty(growable: true);
|
||||||
@@ -41,7 +48,6 @@ class PostEditorController extends GetxController {
|
|||||||
PostEditorController() {
|
PostEditorController() {
|
||||||
SharedPreferences.getInstance().then((inst) {
|
SharedPreferences.getInstance().then((inst) {
|
||||||
_prefs = inst;
|
_prefs = inst;
|
||||||
localRead();
|
|
||||||
_saveTimer = Timer.periodic(
|
_saveTimer = Timer.periodic(
|
||||||
const Duration(seconds: 3),
|
const Duration(seconds: 3),
|
||||||
(Timer t) {
|
(Timer t) {
|
||||||
@@ -88,17 +94,45 @@ class PostEditorController extends GetxController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> editPublishZone(BuildContext context) {
|
||||||
|
return showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => PostEditorPublishZoneDialog(
|
||||||
|
controller: this,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> editPublishDate(BuildContext context) {
|
||||||
|
return showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => PostEditorDateDialog(
|
||||||
|
controller: this,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> editAttachment(BuildContext context) {
|
Future<void> editAttachment(BuildContext context) {
|
||||||
return showModalBottomSheet(
|
return showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
isScrollControlled: true,
|
|
||||||
builder: (context) => AttachmentEditorPopup(
|
builder: (context) => AttachmentEditorPopup(
|
||||||
usage: 'i.attachment',
|
pool: 'interactive',
|
||||||
current: attachments,
|
initialAttachments: attachments,
|
||||||
onUpdate: (value) {
|
onAdd: (String value) {
|
||||||
attachments.value = value;
|
attachments.add(value);
|
||||||
attachments.refresh();
|
|
||||||
},
|
},
|
||||||
|
onRemove: (String value) {
|
||||||
|
attachments.remove(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> editThumbnail(BuildContext context) {
|
||||||
|
return showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => PostEditorThumbnailDialog(
|
||||||
|
controller: this,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -122,10 +156,12 @@ class PostEditorController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void localRead() {
|
void localRead() {
|
||||||
if (_prefs.containsKey('post_editor_local_save')) {
|
SharedPreferences.getInstance().then((inst) {
|
||||||
isRestoreFromLocal.value = true;
|
if (inst.containsKey('post_editor_local_save')) {
|
||||||
payload = jsonDecode(_prefs.getString('post_editor_local_save')!);
|
isRestoreFromLocal.value = true;
|
||||||
}
|
payload = jsonDecode(inst.getString('post_editor_local_save')!);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void localClear() {
|
void localClear() {
|
||||||
@@ -133,6 +169,7 @@ class PostEditorController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void currentClear() {
|
void currentClear() {
|
||||||
|
aliasController.clear();
|
||||||
titleController.clear();
|
titleController.clear();
|
||||||
descriptionController.clear();
|
descriptionController.clear();
|
||||||
contentController.clear();
|
contentController.clear();
|
||||||
@@ -141,6 +178,9 @@ class PostEditorController extends GetxController {
|
|||||||
visibleUsers.clear();
|
visibleUsers.clear();
|
||||||
invisibleUsers.clear();
|
invisibleUsers.clear();
|
||||||
visibility.value = 0;
|
visibility.value = 0;
|
||||||
|
thumbnail.value = null;
|
||||||
|
publishedAt.value = null;
|
||||||
|
publishedUntil.value = null;
|
||||||
isDraft.value = false;
|
isDraft.value = false;
|
||||||
isRestoreFromLocal.value = false;
|
isRestoreFromLocal.value = false;
|
||||||
lastSaveTime.value = null;
|
lastSaveTime.value = null;
|
||||||
@@ -159,12 +199,25 @@ class PostEditorController extends GetxController {
|
|||||||
|
|
||||||
type = value.type;
|
type = value.type;
|
||||||
editTo.value = value;
|
editTo.value = value;
|
||||||
|
realmZone.value = value.realm;
|
||||||
isDraft.value = value.isDraft ?? false;
|
isDraft.value = value.isDraft ?? false;
|
||||||
|
aliasController.text = value.alias ?? '';
|
||||||
titleController.text = value.body['title'] ?? '';
|
titleController.text = value.body['title'] ?? '';
|
||||||
descriptionController.text = value.body['description'] ?? '';
|
descriptionController.text = value.body['description'] ?? '';
|
||||||
contentController.text = value.body['content'] ?? '';
|
contentController.text = value.body['content'] ?? '';
|
||||||
attachments.value = value.body['attachments']?.cast<int>() ?? List.empty();
|
publishedAt.value = value.publishedAt;
|
||||||
|
publishedUntil.value = value.publishedUntil;
|
||||||
|
tags.value = List.from(
|
||||||
|
value.body['tags']?.map((x) => x['alias']).toList() ?? List.empty(),
|
||||||
|
growable: true,
|
||||||
|
);
|
||||||
|
tags.refresh();
|
||||||
|
attachments.value = List.from(
|
||||||
|
value.body['attachments'] ?? List.empty(),
|
||||||
|
growable: true,
|
||||||
|
);
|
||||||
attachments.refresh();
|
attachments.refresh();
|
||||||
|
thumbnail.value = value.body['thumbnail'];
|
||||||
|
|
||||||
contentLength.value = contentController.text.length;
|
contentLength.value = contentController.text.length;
|
||||||
}
|
}
|
||||||
@@ -212,14 +265,19 @@ class PostEditorController extends GetxController {
|
|||||||
|
|
||||||
Map<String, dynamic> get payload {
|
Map<String, dynamic> get payload {
|
||||||
return {
|
return {
|
||||||
|
'alias': aliasController.text,
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': description,
|
'description': description,
|
||||||
'content': contentController.text,
|
'content': contentController.text,
|
||||||
'tags': tags,
|
'thumbnail': thumbnail.value,
|
||||||
|
'tags': tags.map((x) => {'alias': x}).toList(),
|
||||||
'attachments': attachments,
|
'attachments': attachments,
|
||||||
'visible_users': visibleUsers,
|
'visible_users': visibleUsers,
|
||||||
'invisible_users': invisibleUsers,
|
'invisible_users': invisibleUsers,
|
||||||
'visibility': visibility.value,
|
'visibility': visibility.value,
|
||||||
|
'published_at': publishedAt.value?.toUtc().toIso8601String() ??
|
||||||
|
DateTime.now().toUtc().toIso8601String(),
|
||||||
|
'published_until': publishedUntil.value?.toUtc().toIso8601String(),
|
||||||
'is_draft': isDraft.value,
|
'is_draft': isDraft.value,
|
||||||
if (replyTo.value != null) 'reply_to': replyTo.value!.id,
|
if (replyTo.value != null) 'reply_to': replyTo.value!.id,
|
||||||
if (repostTo.value != null) 'repost_to': repostTo.value!.id,
|
if (repostTo.value != null) 'repost_to': repostTo.value!.id,
|
||||||
@@ -229,18 +287,39 @@ class PostEditorController extends GetxController {
|
|||||||
|
|
||||||
set payload(Map<String, dynamic> value) {
|
set payload(Map<String, dynamic> value) {
|
||||||
type = value['type'];
|
type = value['type'];
|
||||||
|
tags.value = List.from(
|
||||||
|
value['tags'].map((x) => x['alias']).toList(),
|
||||||
|
growable: true,
|
||||||
|
);
|
||||||
|
aliasController.text = value['alias'] ?? '';
|
||||||
titleController.text = value['title'] ?? '';
|
titleController.text = value['title'] ?? '';
|
||||||
descriptionController.text = value['description'] ?? '';
|
descriptionController.text = value['description'] ?? '';
|
||||||
contentController.text = value['content'] ?? '';
|
contentController.text = value['content'] ?? '';
|
||||||
attachments.value = value['attachments'].cast<int>() ?? List.empty();
|
attachments.value = List.from(
|
||||||
|
value['attachments'] ?? List.empty(),
|
||||||
|
growable: true,
|
||||||
|
);
|
||||||
attachments.refresh();
|
attachments.refresh();
|
||||||
|
thumbnail.value = value['thumbnail'];
|
||||||
visibility.value = value['visibility'];
|
visibility.value = value['visibility'];
|
||||||
isDraft.value = value['is_draft'];
|
isDraft.value = value['is_draft'];
|
||||||
if (value['visible_users'] != null) {
|
if (value['visible_users'] != null) {
|
||||||
visibleUsers.value = value['visible_users'].cast<int>();
|
visibleUsers.value = List.from(
|
||||||
|
value['visible_users'],
|
||||||
|
growable: true,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (value['invisible_users'] != null) {
|
if (value['invisible_users'] != null) {
|
||||||
invisibleUsers.value = value['invisible_users'].cast<int>();
|
invisibleUsers.value = List.from(
|
||||||
|
value['invisible_users'],
|
||||||
|
growable: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (value['published_at'] != null) {
|
||||||
|
publishedAt.value = DateTime.parse(value['published_at']).toLocal();
|
||||||
|
}
|
||||||
|
if (value['published_until'] != null) {
|
||||||
|
publishedAt.value = DateTime.parse(value['published_until']).toLocal();
|
||||||
}
|
}
|
||||||
if (value['reply_to'] != null) {
|
if (value['reply_to'] != null) {
|
||||||
replyTo.value = Post.fromJson(value['reply_to']);
|
replyTo.value = Post.fromJson(value['reply_to']);
|
||||||
@@ -263,11 +342,13 @@ class PostEditorController extends GetxController {
|
|||||||
|
|
||||||
bool get isNotEmpty {
|
bool get isNotEmpty {
|
||||||
return [
|
return [
|
||||||
|
aliasController.text.isNotEmpty,
|
||||||
titleController.text.isNotEmpty,
|
titleController.text.isNotEmpty,
|
||||||
descriptionController.text.isNotEmpty,
|
descriptionController.text.isNotEmpty,
|
||||||
contentController.text.isNotEmpty,
|
contentController.text.isNotEmpty,
|
||||||
attachments.isNotEmpty,
|
attachments.isNotEmpty,
|
||||||
tags.isNotEmpty
|
tags.isNotEmpty,
|
||||||
|
thumbnail.value != null,
|
||||||
].any((x) => x);
|
].any((x) => x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,12 @@ class PostListController extends GetxController {
|
|||||||
|
|
||||||
/// The polling source modifier.
|
/// The polling source modifier.
|
||||||
/// - `0`: default recommendations
|
/// - `0`: default recommendations
|
||||||
/// - `1`: shuffle mode
|
/// - `1`: friend mode
|
||||||
|
/// - `2`: shuffle mode
|
||||||
RxInt mode = 0.obs;
|
RxInt mode = 0.obs;
|
||||||
|
|
||||||
/// The paging controller for infinite loading.
|
/// The paging controller for infinite loading.
|
||||||
/// Only available when mode is `0`.
|
/// Only available when mode is `0` or `1`.
|
||||||
PagingController<int, Post> pagingController =
|
PagingController<int, Post> pagingController =
|
||||||
PagingController(firstPageKey: 0);
|
PagingController(firstPageKey: 0);
|
||||||
|
|
||||||
@@ -111,10 +112,23 @@ class PostListController extends GetxController {
|
|||||||
author: author,
|
author: author,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
resp = await provider.listRecommendations(
|
switch (mode.value) {
|
||||||
pageKey,
|
case 2:
|
||||||
channel: mode.value == 0 ? null : 'shuffle',
|
resp = await provider.listRecommendations(
|
||||||
);
|
pageKey,
|
||||||
|
channel: 'shuffle',
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
resp = await provider.listRecommendations(
|
||||||
|
pageKey,
|
||||||
|
channel: 'friends',
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
resp = await provider.listRecommendations(pageKey);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
rethrow;
|
rethrow;
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
extension SolianExtenions on BuildContext {
|
extension SolianExtenions on BuildContext {
|
||||||
void showSnackbar(String content) {
|
void showSnackbar(String content, {SnackBarAction? action}) {
|
||||||
ScaffoldMessenger.of(this).showSnackBar(SnackBar(
|
ScaffoldMessenger.of(this).showSnackBar(SnackBar(
|
||||||
content: Text(content),
|
content: Text(content),
|
||||||
|
action: action,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,6 +30,23 @@ extension SolianExtenions on BuildContext {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> showInfoDialog(String title, body) {
|
||||||
|
return showDialog<void>(
|
||||||
|
useRootNavigator: true,
|
||||||
|
context: this,
|
||||||
|
builder: (ctx) => AlertDialog(
|
||||||
|
title: Text(title),
|
||||||
|
content: Text(body),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(ctx),
|
||||||
|
child: Text('okay'.tr),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> showErrorDialog(dynamic exception) {
|
Future<void> showErrorDialog(dynamic exception) {
|
||||||
var stack = StackTrace.current;
|
var stack = StackTrace.current;
|
||||||
var stackTrace = '$stack';
|
var stackTrace = '$stack';
|
||||||
|
|||||||
@@ -85,4 +85,5 @@ class DefaultFirebaseOptions {
|
|||||||
storageBucket: 'solian-0x001.appspot.com',
|
storageBucket: 'solian-0x001.appspot.com',
|
||||||
measurementId: 'G-EF9BZMKBC3',
|
measurementId: 'G-EF9BZMKBC3',
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
}
|
||||||
@@ -1,14 +1,19 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_acrylic/flutter_acrylic.dart';
|
import 'package:flutter_acrylic/flutter_acrylic.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:media_kit/media_kit.dart';
|
|
||||||
import 'package:protocol_handler/protocol_handler.dart';
|
import 'package:protocol_handler/protocol_handler.dart';
|
||||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:solian/bootstrapper.dart';
|
import 'package:solian/bootstrapper.dart';
|
||||||
import 'package:solian/firebase_options.dart';
|
import 'package:solian/firebase_options.dart';
|
||||||
import 'package:solian/platform.dart';
|
import 'package:solian/platform.dart';
|
||||||
|
import 'package:solian/providers/attachment_uploader.dart';
|
||||||
|
import 'package:solian/providers/stickers.dart';
|
||||||
|
import 'package:solian/providers/theme_switcher.dart';
|
||||||
import 'package:solian/providers/websocket.dart';
|
import 'package:solian/providers/websocket.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
import 'package:solian/providers/content/attachment.dart';
|
import 'package:solian/providers/content/attachment.dart';
|
||||||
@@ -25,32 +30,28 @@ import 'package:solian/translations.dart';
|
|||||||
import 'package:flutter_web_plugins/url_strategy.dart' show usePathUrlStrategy;
|
import 'package:flutter_web_plugins/url_strategy.dart' show usePathUrlStrategy;
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
await SentryFlutter.init(
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
(options) {
|
|
||||||
options.dsn =
|
|
||||||
'https://55438cdff9048aa2225df72fdc629c42@o4506965897117696.ingest.us.sentry.io/4507357676437504';
|
|
||||||
options.tracesSampleRate = 1.0;
|
|
||||||
options.profilesSampleRate = 1.0;
|
|
||||||
},
|
|
||||||
appRunner: () async {
|
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
|
||||||
MediaKit.ensureInitialized();
|
|
||||||
|
|
||||||
await Future.wait([
|
await Future.wait([
|
||||||
_initializeFirebase(),
|
_initializeFirebase(),
|
||||||
_initializePlatformComponents(),
|
_initializePlatformComponents(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
GoRouter.optionURLReflectsImperativeAPIs = true;
|
GoRouter.optionURLReflectsImperativeAPIs = true;
|
||||||
|
|
||||||
usePathUrlStrategy();
|
usePathUrlStrategy();
|
||||||
runApp(const SolianApp());
|
runApp(const SolianApp());
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initializeFirebase() async {
|
Future<void> _initializeFirebase() async {
|
||||||
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
||||||
|
FlutterError.onError = (errorDetails) {
|
||||||
|
FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails);
|
||||||
|
};
|
||||||
|
PlatformDispatcher.instance.onError = (error, stack) {
|
||||||
|
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initializePlatformComponents() async {
|
Future<void> _initializePlatformComponents() async {
|
||||||
@@ -71,33 +72,45 @@ Future<void> _initializePlatformComponents() async {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final themeSwitcher = ThemeSwitcher(
|
||||||
|
lightThemeData: SolianTheme.build(Brightness.light),
|
||||||
|
darkThemeData: SolianTheme.build(Brightness.dark),
|
||||||
|
);
|
||||||
|
|
||||||
class SolianApp extends StatelessWidget {
|
class SolianApp extends StatelessWidget {
|
||||||
const SolianApp({super.key});
|
const SolianApp({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GetMaterialApp.router(
|
return ChangeNotifierProvider.value(
|
||||||
title: 'Solian',
|
value: themeSwitcher,
|
||||||
theme: SolianTheme.build(Brightness.light),
|
child: Builder(builder: (context) {
|
||||||
darkTheme: SolianTheme.build(Brightness.dark),
|
final theme = Provider.of<ThemeSwitcher>(context);
|
||||||
themeMode: ThemeMode.system,
|
|
||||||
routerDelegate: AppRouter.instance.routerDelegate,
|
return GetMaterialApp.router(
|
||||||
routeInformationParser: AppRouter.instance.routeInformationParser,
|
title: 'Solian',
|
||||||
routeInformationProvider: AppRouter.instance.routeInformationProvider,
|
theme: theme.lightThemeData,
|
||||||
backButtonDispatcher: AppRouter.instance.backButtonDispatcher,
|
darkTheme: theme.darkThemeData,
|
||||||
translations: SolianMessages(),
|
themeMode: ThemeMode.system,
|
||||||
locale: Get.deviceLocale,
|
routerDelegate: AppRouter.instance.routerDelegate,
|
||||||
fallbackLocale: const Locale('en', 'US'),
|
routeInformationParser: AppRouter.instance.routeInformationParser,
|
||||||
onInit: () => _initializeProviders(context),
|
routeInformationProvider: AppRouter.instance.routeInformationProvider,
|
||||||
builder: (context, child) {
|
backButtonDispatcher: AppRouter.instance.backButtonDispatcher,
|
||||||
return SystemShell(
|
translations: SolianMessages(),
|
||||||
child: ScaffoldMessenger(
|
locale: Get.deviceLocale,
|
||||||
child: BootstrapperShell(
|
fallbackLocale: const Locale('en', 'US'),
|
||||||
child: child ?? const SizedBox(),
|
onInit: () => _initializeProviders(context),
|
||||||
),
|
builder: (context, child) {
|
||||||
),
|
return SystemShell(
|
||||||
|
child: ScaffoldMessenger(
|
||||||
|
child: BootstrapperShell(
|
||||||
|
child: child ?? const SizedBox(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
},
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,11 +118,13 @@ class SolianApp extends StatelessWidget {
|
|||||||
Get.lazyPut(() => AuthProvider());
|
Get.lazyPut(() => AuthProvider());
|
||||||
Get.lazyPut(() => RelationshipProvider());
|
Get.lazyPut(() => RelationshipProvider());
|
||||||
Get.lazyPut(() => PostProvider());
|
Get.lazyPut(() => PostProvider());
|
||||||
|
Get.lazyPut(() => StickerProvider());
|
||||||
Get.lazyPut(() => AttachmentProvider());
|
Get.lazyPut(() => AttachmentProvider());
|
||||||
Get.lazyPut(() => WebSocketProvider());
|
Get.lazyPut(() => WebSocketProvider());
|
||||||
Get.lazyPut(() => StatusProvider());
|
Get.lazyPut(() => StatusProvider());
|
||||||
Get.lazyPut(() => ChannelProvider());
|
Get.lazyPut(() => ChannelProvider());
|
||||||
Get.lazyPut(() => RealmProvider());
|
Get.lazyPut(() => RealmProvider());
|
||||||
Get.lazyPut(() => ChatCallProvider());
|
Get.lazyPut(() => ChatCallProvider());
|
||||||
|
Get.lazyPut(() => AttachmentUploaderController());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ class Attachment {
|
|||||||
DateTime createdAt;
|
DateTime createdAt;
|
||||||
DateTime updatedAt;
|
DateTime updatedAt;
|
||||||
DateTime? deletedAt;
|
DateTime? deletedAt;
|
||||||
|
String rid;
|
||||||
String uuid;
|
String uuid;
|
||||||
int size;
|
int size;
|
||||||
String name;
|
String name;
|
||||||
String alt;
|
String alt;
|
||||||
String usage;
|
|
||||||
String mimetype;
|
String mimetype;
|
||||||
String hash;
|
String hash;
|
||||||
int destination;
|
int destination;
|
||||||
@@ -24,11 +24,11 @@ class Attachment {
|
|||||||
required this.createdAt,
|
required this.createdAt,
|
||||||
required this.updatedAt,
|
required this.updatedAt,
|
||||||
required this.deletedAt,
|
required this.deletedAt,
|
||||||
|
required this.rid,
|
||||||
required this.uuid,
|
required this.uuid,
|
||||||
required this.size,
|
required this.size,
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.alt,
|
required this.alt,
|
||||||
required this.usage,
|
|
||||||
required this.mimetype,
|
required this.mimetype,
|
||||||
required this.hash,
|
required this.hash,
|
||||||
required this.destination,
|
required this.destination,
|
||||||
@@ -40,42 +40,45 @@ class Attachment {
|
|||||||
});
|
});
|
||||||
|
|
||||||
factory Attachment.fromJson(Map<String, dynamic> json) => Attachment(
|
factory Attachment.fromJson(Map<String, dynamic> json) => Attachment(
|
||||||
id: json['id'],
|
id: json['id'],
|
||||||
createdAt: DateTime.parse(json['created_at']),
|
createdAt: DateTime.parse(json['created_at']),
|
||||||
updatedAt: DateTime.parse(json['updated_at']),
|
updatedAt: DateTime.parse(json['updated_at']),
|
||||||
deletedAt: json['deleted_at'] != null ? DateTime.parse(json['deleted_at']) : null,
|
deletedAt: json['deleted_at'] != null
|
||||||
uuid: json['uuid'],
|
? DateTime.parse(json['deleted_at'])
|
||||||
size: json['size'],
|
: null,
|
||||||
name: json['name'],
|
rid: json['rid'],
|
||||||
alt: json['alt'],
|
uuid: json['uuid'],
|
||||||
usage: json['usage'],
|
size: json['size'],
|
||||||
mimetype: json['mimetype'],
|
name: json['name'],
|
||||||
hash: json['hash'],
|
alt: json['alt'],
|
||||||
destination: json['destination'],
|
mimetype: json['mimetype'],
|
||||||
isAnalyzed: json['is_analyzed'],
|
hash: json['hash'],
|
||||||
metadata: json['metadata'],
|
destination: json['destination'],
|
||||||
isMature: json['is_mature'],
|
isAnalyzed: json['is_analyzed'],
|
||||||
account: json['account'] != null ? Account.fromJson(json['account']) : null,
|
metadata: json['metadata'],
|
||||||
accountId: json['account_id'],
|
isMature: json['is_mature'],
|
||||||
);
|
account:
|
||||||
|
json['account'] != null ? Account.fromJson(json['account']) : null,
|
||||||
|
accountId: json['account_id'],
|
||||||
|
);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
'id': id,
|
'id': id,
|
||||||
'created_at': createdAt.toIso8601String(),
|
'created_at': createdAt.toIso8601String(),
|
||||||
'updated_at': updatedAt.toIso8601String(),
|
'updated_at': updatedAt.toIso8601String(),
|
||||||
'deleted_at': deletedAt?.toIso8601String(),
|
'deleted_at': deletedAt?.toIso8601String(),
|
||||||
'uuid': uuid,
|
'rid': rid,
|
||||||
'size': size,
|
'uuid': uuid,
|
||||||
'name': name,
|
'size': size,
|
||||||
'alt': alt,
|
'name': name,
|
||||||
'usage': usage,
|
'alt': alt,
|
||||||
'mimetype': mimetype,
|
'mimetype': mimetype,
|
||||||
'hash': hash,
|
'hash': hash,
|
||||||
'destination': destination,
|
'destination': destination,
|
||||||
'is_analyzed': isAnalyzed,
|
'is_analyzed': isAnalyzed,
|
||||||
'metadata': metadata,
|
'metadata': metadata,
|
||||||
'is_mature': isMature,
|
'is_mature': isMature,
|
||||||
'account': account?.toJson(),
|
'account': account?.toJson(),
|
||||||
'account_id': accountId,
|
'account_id': accountId,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class Call {
|
|||||||
String externalId;
|
String externalId;
|
||||||
int founderId;
|
int founderId;
|
||||||
int channelId;
|
int channelId;
|
||||||
|
List<dynamic> participants;
|
||||||
Channel channel;
|
Channel channel;
|
||||||
|
|
||||||
Call({
|
Call({
|
||||||
@@ -21,6 +22,7 @@ class Call {
|
|||||||
required this.externalId,
|
required this.externalId,
|
||||||
required this.founderId,
|
required this.founderId,
|
||||||
required this.channelId,
|
required this.channelId,
|
||||||
|
required this.participants,
|
||||||
required this.channel,
|
required this.channel,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -34,6 +36,7 @@ class Call {
|
|||||||
externalId: json['external_id'],
|
externalId: json['external_id'],
|
||||||
founderId: json['founder_id'],
|
founderId: json['founder_id'],
|
||||||
channelId: json['channel_id'],
|
channelId: json['channel_id'],
|
||||||
|
participants: json['participants'] ?? List.empty(),
|
||||||
channel: Channel.fromJson(json['channel']),
|
channel: Channel.fromJson(json['channel']),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -46,6 +49,7 @@ class Call {
|
|||||||
'external_id': externalId,
|
'external_id': externalId,
|
||||||
'founder_id': founderId,
|
'founder_id': founderId,
|
||||||
'channel_id': channelId,
|
'channel_id': channelId,
|
||||||
|
'participants': participants,
|
||||||
'channel': channel.toJson(),
|
'channel': channel.toJson(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -63,6 +67,7 @@ class ParticipantTrack {
|
|||||||
{required this.participant,
|
{required this.participant,
|
||||||
required this.videoTrack,
|
required this.videoTrack,
|
||||||
required this.isScreenShare});
|
required this.isScreenShare});
|
||||||
|
|
||||||
VideoTrack? videoTrack;
|
VideoTrack? videoTrack;
|
||||||
Participant participant;
|
Participant participant;
|
||||||
bool isScreenShare;
|
bool isScreenShare;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class Event {
|
|||||||
class EventMessageBody {
|
class EventMessageBody {
|
||||||
String text;
|
String text;
|
||||||
String algorithm;
|
String algorithm;
|
||||||
List<int>? attachments;
|
List<String>? attachments;
|
||||||
int? quoteEvent;
|
int? quoteEvent;
|
||||||
int? relatedEvent;
|
int? relatedEvent;
|
||||||
List<int>? relatedUsers;
|
List<int>? relatedUsers;
|
||||||
@@ -82,7 +82,7 @@ class EventMessageBody {
|
|||||||
text: json['text'] ?? '',
|
text: json['text'] ?? '',
|
||||||
algorithm: json['algorithm'] ?? 'plain',
|
algorithm: json['algorithm'] ?? 'plain',
|
||||||
attachments: json['attachments'] != null
|
attachments: json['attachments'] != null
|
||||||
? List<int>.from(json['attachments'].map((x) => x))
|
? List<String>.from(json['attachments']?.whereType<String>())
|
||||||
: null,
|
: null,
|
||||||
quoteEvent: json['quote_event'],
|
quoteEvent: json['quote_event'],
|
||||||
relatedEvent: json['related_event'],
|
relatedEvent: json['related_event'],
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ class Post {
|
|||||||
DateTime updatedAt;
|
DateTime updatedAt;
|
||||||
DateTime? editedAt;
|
DateTime? editedAt;
|
||||||
DateTime? deletedAt;
|
DateTime? deletedAt;
|
||||||
|
String? alias;
|
||||||
|
String? areaAlias;
|
||||||
dynamic body;
|
dynamic body;
|
||||||
List<Tag>? tags;
|
List<Tag>? tags;
|
||||||
List<Category>? categories;
|
List<Category>? categories;
|
||||||
@@ -20,6 +22,7 @@ class Post {
|
|||||||
Post? repostTo;
|
Post? repostTo;
|
||||||
Realm? realm;
|
Realm? realm;
|
||||||
DateTime? publishedAt;
|
DateTime? publishedAt;
|
||||||
|
DateTime? publishedUntil;
|
||||||
DateTime? pinnedAt;
|
DateTime? pinnedAt;
|
||||||
bool? isDraft;
|
bool? isDraft;
|
||||||
int authorId;
|
int authorId;
|
||||||
@@ -32,6 +35,8 @@ class Post {
|
|||||||
required this.updatedAt,
|
required this.updatedAt,
|
||||||
required this.editedAt,
|
required this.editedAt,
|
||||||
required this.deletedAt,
|
required this.deletedAt,
|
||||||
|
required this.alias,
|
||||||
|
required this.areaAlias,
|
||||||
required this.type,
|
required this.type,
|
||||||
required this.body,
|
required this.body,
|
||||||
required this.tags,
|
required this.tags,
|
||||||
@@ -44,6 +49,7 @@ class Post {
|
|||||||
required this.repostTo,
|
required this.repostTo,
|
||||||
required this.realm,
|
required this.realm,
|
||||||
required this.publishedAt,
|
required this.publishedAt,
|
||||||
|
required this.publishedUntil,
|
||||||
required this.pinnedAt,
|
required this.pinnedAt,
|
||||||
required this.isDraft,
|
required this.isDraft,
|
||||||
required this.authorId,
|
required this.authorId,
|
||||||
@@ -58,6 +64,8 @@ class Post {
|
|||||||
deletedAt: json['deleted_at'] != null
|
deletedAt: json['deleted_at'] != null
|
||||||
? DateTime.parse(json['deleted_at'])
|
? DateTime.parse(json['deleted_at'])
|
||||||
: null,
|
: null,
|
||||||
|
alias: json['alias'],
|
||||||
|
areaAlias: json['area_alias'],
|
||||||
type: json['type'],
|
type: json['type'],
|
||||||
body: json['body'],
|
body: json['body'],
|
||||||
tags: json['tags']?.map((x) => Tag.fromJson(x)).toList().cast<Tag>(),
|
tags: json['tags']?.map((x) => Tag.fromJson(x)).toList().cast<Tag>(),
|
||||||
@@ -80,6 +88,9 @@ class Post {
|
|||||||
publishedAt: json['published_at'] != null
|
publishedAt: json['published_at'] != null
|
||||||
? DateTime.parse(json['published_at'])
|
? DateTime.parse(json['published_at'])
|
||||||
: null,
|
: null,
|
||||||
|
publishedUntil: json['published_until'] != null
|
||||||
|
? DateTime.parse(json['published_until'])
|
||||||
|
: null,
|
||||||
pinnedAt: json['pinned_at'] != null
|
pinnedAt: json['pinned_at'] != null
|
||||||
? DateTime.parse(json['pinned_at'])
|
? DateTime.parse(json['pinned_at'])
|
||||||
: null,
|
: null,
|
||||||
@@ -96,6 +107,8 @@ class Post {
|
|||||||
'updated_at': updatedAt.toIso8601String(),
|
'updated_at': updatedAt.toIso8601String(),
|
||||||
'edited_at': editedAt?.toIso8601String(),
|
'edited_at': editedAt?.toIso8601String(),
|
||||||
'deleted_at': deletedAt?.toIso8601String(),
|
'deleted_at': deletedAt?.toIso8601String(),
|
||||||
|
'alias': alias,
|
||||||
|
'area_alias': areaAlias,
|
||||||
'type': type,
|
'type': type,
|
||||||
'body': body,
|
'body': body,
|
||||||
'tags': tags,
|
'tags': tags,
|
||||||
@@ -108,6 +121,7 @@ class Post {
|
|||||||
'repost_to': repostTo?.toJson(),
|
'repost_to': repostTo?.toJson(),
|
||||||
'realm': realm?.toJson(),
|
'realm': realm?.toJson(),
|
||||||
'published_at': publishedAt?.toIso8601String(),
|
'published_at': publishedAt?.toIso8601String(),
|
||||||
|
'published_until': publishedUntil?.toIso8601String(),
|
||||||
'pinned_at': pinnedAt?.toIso8601String(),
|
'pinned_at': pinnedAt?.toIso8601String(),
|
||||||
'is_draft': isDraft,
|
'is_draft': isDraft,
|
||||||
'author_id': authorId,
|
'author_id': authorId,
|
||||||
|
|||||||
@@ -52,6 +52,17 @@ class Realm {
|
|||||||
'is_community': isCommunity,
|
'is_community': isCommunity,
|
||||||
'account_id': accountId,
|
'account_id': accountId,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
if (other is Realm) {
|
||||||
|
return other.id == id;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => id;
|
||||||
}
|
}
|
||||||
|
|
||||||
class RealmMember {
|
class RealmMember {
|
||||||
|
|||||||
131
lib/models/stickers.dart
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
import 'package:solian/models/account.dart';
|
||||||
|
import 'package:solian/models/attachment.dart';
|
||||||
|
import 'package:solian/services.dart';
|
||||||
|
|
||||||
|
class Sticker {
|
||||||
|
int id;
|
||||||
|
DateTime createdAt;
|
||||||
|
DateTime updatedAt;
|
||||||
|
DateTime? deletedAt;
|
||||||
|
String alias;
|
||||||
|
String name;
|
||||||
|
int attachmentId;
|
||||||
|
Attachment attachment;
|
||||||
|
int packId;
|
||||||
|
StickerPack? pack;
|
||||||
|
int accountId;
|
||||||
|
Account account;
|
||||||
|
|
||||||
|
Sticker({
|
||||||
|
required this.id,
|
||||||
|
required this.createdAt,
|
||||||
|
required this.updatedAt,
|
||||||
|
required this.deletedAt,
|
||||||
|
required this.alias,
|
||||||
|
required this.name,
|
||||||
|
required this.attachmentId,
|
||||||
|
required this.attachment,
|
||||||
|
required this.packId,
|
||||||
|
required this.pack,
|
||||||
|
required this.accountId,
|
||||||
|
required this.account,
|
||||||
|
});
|
||||||
|
|
||||||
|
String get textPlaceholder => '${pack?.prefix}$alias';
|
||||||
|
String get textWarpedPlaceholder => ':$textPlaceholder:';
|
||||||
|
|
||||||
|
String get imageUrl => ServiceFinder.buildUrl(
|
||||||
|
'files',
|
||||||
|
'/attachments/${attachment.rid}',
|
||||||
|
);
|
||||||
|
|
||||||
|
factory Sticker.fromJson(Map<String, dynamic> json) => Sticker(
|
||||||
|
id: json['id'],
|
||||||
|
createdAt: DateTime.parse(json['created_at']),
|
||||||
|
updatedAt: DateTime.parse(json['updated_at']),
|
||||||
|
deletedAt: json['deleted_at'] != null
|
||||||
|
? DateTime.parse(json['deleted_at'])
|
||||||
|
: json['deleted_at'],
|
||||||
|
alias: json['alias'],
|
||||||
|
name: json['name'],
|
||||||
|
attachmentId: json['attachment_id'],
|
||||||
|
attachment: Attachment.fromJson(json['attachment']),
|
||||||
|
packId: json['pack_id'],
|
||||||
|
pack: json['pack'] != null ? StickerPack.fromJson(json['pack']) : null,
|
||||||
|
accountId: json['account_id'],
|
||||||
|
account: Account.fromJson(json['account']),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
'id': id,
|
||||||
|
'created_at': createdAt.toIso8601String(),
|
||||||
|
'updated_at': updatedAt.toIso8601String(),
|
||||||
|
'deleted_at': deletedAt?.toIso8601String(),
|
||||||
|
'alias': alias,
|
||||||
|
'name': name,
|
||||||
|
'attachment_id': attachmentId,
|
||||||
|
'attachment': attachment.toJson(),
|
||||||
|
'pack_id': packId,
|
||||||
|
'account_id': accountId,
|
||||||
|
'account': account.toJson(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class StickerPack {
|
||||||
|
int id;
|
||||||
|
DateTime createdAt;
|
||||||
|
DateTime updatedAt;
|
||||||
|
DateTime? deletedAt;
|
||||||
|
String prefix;
|
||||||
|
String name;
|
||||||
|
String description;
|
||||||
|
List<Sticker>? stickers;
|
||||||
|
int accountId;
|
||||||
|
Account account;
|
||||||
|
|
||||||
|
StickerPack({
|
||||||
|
required this.id,
|
||||||
|
required this.createdAt,
|
||||||
|
required this.updatedAt,
|
||||||
|
required this.deletedAt,
|
||||||
|
required this.prefix,
|
||||||
|
required this.name,
|
||||||
|
required this.description,
|
||||||
|
required this.stickers,
|
||||||
|
required this.accountId,
|
||||||
|
required this.account,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory StickerPack.fromJson(Map<String, dynamic> json) => StickerPack(
|
||||||
|
id: json['id'],
|
||||||
|
createdAt: DateTime.parse(json['created_at']),
|
||||||
|
updatedAt: DateTime.parse(json['updated_at']),
|
||||||
|
deletedAt: json['deleted_at'] != null
|
||||||
|
? DateTime.parse(json['deleted_at'])
|
||||||
|
: json['deleted_at'],
|
||||||
|
prefix: json['prefix'],
|
||||||
|
name: json['name'],
|
||||||
|
description: json['description'],
|
||||||
|
stickers: json['stickers'] == null
|
||||||
|
? []
|
||||||
|
: List<Sticker>.from(
|
||||||
|
json['stickers']!.map((x) => Sticker.fromJson(x))),
|
||||||
|
accountId: json['account_id'],
|
||||||
|
account: Account.fromJson(json['account']),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
'id': id,
|
||||||
|
'created_at': createdAt.toIso8601String(),
|
||||||
|
'updated_at': updatedAt.toIso8601String(),
|
||||||
|
'deleted_at': deletedAt?.toIso8601String(),
|
||||||
|
'prefix': prefix,
|
||||||
|
'name': name,
|
||||||
|
'description': description,
|
||||||
|
'stickers': stickers == null
|
||||||
|
? []
|
||||||
|
: List<dynamic>.from(stickers!.map((x) => x.toJson())),
|
||||||
|
'account_id': accountId,
|
||||||
|
'account': account.toJson(),
|
||||||
|
};
|
||||||
|
}
|
||||||
213
lib/providers/attachment_uploader.dart
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'dart:io';
|
||||||
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:solian/models/attachment.dart';
|
||||||
|
import 'package:solian/providers/content/attachment.dart';
|
||||||
|
|
||||||
|
class AttachmentUploadTask {
|
||||||
|
File file;
|
||||||
|
String usage;
|
||||||
|
Map<String, dynamic>? metadata;
|
||||||
|
|
||||||
|
double progress = 0;
|
||||||
|
bool isUploading = false;
|
||||||
|
bool isCompleted = false;
|
||||||
|
dynamic error;
|
||||||
|
|
||||||
|
AttachmentUploadTask({
|
||||||
|
required this.file,
|
||||||
|
required this.usage,
|
||||||
|
this.metadata,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
class AttachmentUploaderController extends GetxController {
|
||||||
|
RxBool isUploading = false.obs;
|
||||||
|
RxDouble progressOfUpload = 0.0.obs;
|
||||||
|
RxList<AttachmentUploadTask> queueOfUpload = RxList.empty(growable: true);
|
||||||
|
|
||||||
|
Timer? _progressSyncTimer;
|
||||||
|
double _progressOfUpload = 0.0;
|
||||||
|
|
||||||
|
void _syncProgress() {
|
||||||
|
progressOfUpload.value = _progressOfUpload;
|
||||||
|
queueOfUpload.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _startProgressSyncTimer() {
|
||||||
|
if (_progressSyncTimer != null) {
|
||||||
|
_progressSyncTimer!.cancel();
|
||||||
|
}
|
||||||
|
_progressSyncTimer = Timer.periodic(
|
||||||
|
const Duration(milliseconds: 500),
|
||||||
|
(_) => _syncProgress(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _stopProgressSyncTimer() {
|
||||||
|
if (_progressSyncTimer == null) return;
|
||||||
|
_progressSyncTimer!.cancel();
|
||||||
|
_progressSyncTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
void enqueueTask(AttachmentUploadTask task) {
|
||||||
|
if (isUploading.value) throw Exception('uploading blocked');
|
||||||
|
queueOfUpload.add(task);
|
||||||
|
}
|
||||||
|
|
||||||
|
void enqueueTaskBatch(Iterable<AttachmentUploadTask> tasks) {
|
||||||
|
if (isUploading.value) throw Exception('uploading blocked');
|
||||||
|
queueOfUpload.addAll(tasks);
|
||||||
|
}
|
||||||
|
|
||||||
|
void dequeueTask(AttachmentUploadTask task) {
|
||||||
|
if (isUploading.value) throw Exception('uploading blocked');
|
||||||
|
queueOfUpload.remove(task);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Attachment?> performSingleTask(int queueIndex) async {
|
||||||
|
isUploading.value = true;
|
||||||
|
progressOfUpload.value = 0;
|
||||||
|
|
||||||
|
_startProgressSyncTimer();
|
||||||
|
queueOfUpload[queueIndex].isUploading = true;
|
||||||
|
|
||||||
|
final task = queueOfUpload[queueIndex];
|
||||||
|
final result = await _rawUploadAttachment(
|
||||||
|
await task.file.readAsBytes(),
|
||||||
|
task.file.path,
|
||||||
|
task.usage,
|
||||||
|
null,
|
||||||
|
onProgress: (value) {
|
||||||
|
queueOfUpload[queueIndex].progress = value;
|
||||||
|
_progressOfUpload = value;
|
||||||
|
},
|
||||||
|
onError: (err) {
|
||||||
|
queueOfUpload[queueIndex].error = err;
|
||||||
|
queueOfUpload[queueIndex].isUploading = false;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
if (queueOfUpload[queueIndex].error == null) {
|
||||||
|
queueOfUpload.removeAt(queueIndex);
|
||||||
|
}
|
||||||
|
_stopProgressSyncTimer();
|
||||||
|
_syncProgress();
|
||||||
|
|
||||||
|
isUploading.value = false;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> performUploadQueue({
|
||||||
|
required Function(Attachment item) onData,
|
||||||
|
}) async {
|
||||||
|
isUploading.value = true;
|
||||||
|
progressOfUpload.value = 0;
|
||||||
|
|
||||||
|
_startProgressSyncTimer();
|
||||||
|
|
||||||
|
for (var idx = 0; idx < queueOfUpload.length; idx++) {
|
||||||
|
if (queueOfUpload[idx].isUploading || queueOfUpload[idx].error != null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
queueOfUpload[idx].isUploading = true;
|
||||||
|
|
||||||
|
final task = queueOfUpload[idx];
|
||||||
|
final result = await _rawUploadAttachment(
|
||||||
|
await task.file.readAsBytes(),
|
||||||
|
task.file.path,
|
||||||
|
task.usage,
|
||||||
|
null,
|
||||||
|
onProgress: (value) {
|
||||||
|
queueOfUpload[idx].progress = value;
|
||||||
|
_progressOfUpload = (idx + value) / queueOfUpload.length;
|
||||||
|
},
|
||||||
|
onError: (err) {
|
||||||
|
queueOfUpload[idx].error = err;
|
||||||
|
queueOfUpload[idx].isUploading = false;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
_progressOfUpload = (idx + 1) / queueOfUpload.length;
|
||||||
|
if (result != null) onData(result);
|
||||||
|
|
||||||
|
queueOfUpload[idx].isUploading = false;
|
||||||
|
queueOfUpload[idx].isCompleted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
queueOfUpload.removeWhere((x) => x.error == null);
|
||||||
|
_stopProgressSyncTimer();
|
||||||
|
_syncProgress();
|
||||||
|
|
||||||
|
isUploading.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> uploadAttachmentWithCallback(
|
||||||
|
Uint8List data,
|
||||||
|
String path,
|
||||||
|
String pool,
|
||||||
|
Map<String, dynamic>? metadata,
|
||||||
|
Function(Attachment?) callback,
|
||||||
|
) async {
|
||||||
|
if (isUploading.value) throw Exception('uploading blocked');
|
||||||
|
|
||||||
|
isUploading.value = true;
|
||||||
|
final result = await _rawUploadAttachment(
|
||||||
|
data,
|
||||||
|
path,
|
||||||
|
pool,
|
||||||
|
metadata,
|
||||||
|
onProgress: (progress) {
|
||||||
|
progressOfUpload.value = progress;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
isUploading.value = false;
|
||||||
|
callback(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Attachment?> uploadAttachment(
|
||||||
|
Uint8List data,
|
||||||
|
String path,
|
||||||
|
String pool,
|
||||||
|
Map<String, dynamic>? metadata,
|
||||||
|
) async {
|
||||||
|
if (isUploading.value) throw Exception('uploading blocked');
|
||||||
|
|
||||||
|
isUploading.value = true;
|
||||||
|
final result = await _rawUploadAttachment(
|
||||||
|
data,
|
||||||
|
path,
|
||||||
|
pool,
|
||||||
|
metadata,
|
||||||
|
onProgress: (progress) {
|
||||||
|
progressOfUpload.value = progress;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
isUploading.value = false;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Attachment?> _rawUploadAttachment(
|
||||||
|
Uint8List data, String path, String pool, Map<String, dynamic>? metadata,
|
||||||
|
{Function(double)? onProgress, Function(dynamic err)? onError}) async {
|
||||||
|
final AttachmentProvider provider = Get.find();
|
||||||
|
try {
|
||||||
|
final result = await provider.createAttachment(
|
||||||
|
data,
|
||||||
|
path,
|
||||||
|
pool,
|
||||||
|
metadata,
|
||||||
|
onProgress: onProgress,
|
||||||
|
);
|
||||||
|
return result;
|
||||||
|
} catch (err) {
|
||||||
|
if (onError != null) {
|
||||||
|
onError(err);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ class ChatCallProvider extends GetxController {
|
|||||||
|
|
||||||
RxBool isReady = false.obs;
|
RxBool isReady = false.obs;
|
||||||
RxBool isMounted = false.obs;
|
RxBool isMounted = false.obs;
|
||||||
|
RxBool isInitialized = false.obs;
|
||||||
|
|
||||||
String? token;
|
String? token;
|
||||||
String? endpoint;
|
String? endpoint;
|
||||||
@@ -87,7 +88,30 @@ class ChatCallProvider extends GetxController {
|
|||||||
|
|
||||||
void initRoom() {
|
void initRoom() {
|
||||||
initHardware();
|
initHardware();
|
||||||
room = Room();
|
room = Room(
|
||||||
|
roomOptions: const RoomOptions(
|
||||||
|
dynacast: true,
|
||||||
|
adaptiveStream: true,
|
||||||
|
defaultAudioPublishOptions: AudioPublishOptions(
|
||||||
|
name: 'call_voice',
|
||||||
|
stream: 'call_stream',
|
||||||
|
),
|
||||||
|
defaultVideoPublishOptions: VideoPublishOptions(
|
||||||
|
name: 'call_video',
|
||||||
|
stream: 'call_stream',
|
||||||
|
simulcast: true,
|
||||||
|
backupVideoCodec: BackupVideoCodec(enabled: true),
|
||||||
|
),
|
||||||
|
defaultScreenShareCaptureOptions: ScreenShareCaptureOptions(
|
||||||
|
useiOSBroadcastExtension: true,
|
||||||
|
params: VideoParametersPresets.screenShareH1080FPS30,
|
||||||
|
),
|
||||||
|
defaultCameraCaptureOptions: CameraCaptureOptions(
|
||||||
|
maxFrameRate: 30,
|
||||||
|
params: VideoParametersPresets.h1080_169,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
listener = room.createListener();
|
listener = room.createListener();
|
||||||
WakelockPlus.enable();
|
WakelockPlus.enable();
|
||||||
}
|
}
|
||||||
@@ -103,28 +127,6 @@ class ChatCallProvider extends GetxController {
|
|||||||
await room.connect(
|
await room.connect(
|
||||||
url,
|
url,
|
||||||
token,
|
token,
|
||||||
roomOptions: const RoomOptions(
|
|
||||||
dynacast: true,
|
|
||||||
adaptiveStream: true,
|
|
||||||
defaultAudioPublishOptions: AudioPublishOptions(
|
|
||||||
name: 'call_voice',
|
|
||||||
stream: 'call_stream',
|
|
||||||
),
|
|
||||||
defaultVideoPublishOptions: VideoPublishOptions(
|
|
||||||
name: 'call_video',
|
|
||||||
stream: 'call_stream',
|
|
||||||
simulcast: true,
|
|
||||||
backupVideoCodec: BackupVideoCodec(enabled: true),
|
|
||||||
),
|
|
||||||
defaultScreenShareCaptureOptions: ScreenShareCaptureOptions(
|
|
||||||
useiOSBroadcastExtension: true,
|
|
||||||
params: VideoParametersPresets.screenShareH1080FPS30,
|
|
||||||
),
|
|
||||||
defaultCameraCaptureOptions: CameraCaptureOptions(
|
|
||||||
maxFrameRate: 30,
|
|
||||||
params: VideoParametersPresets.h1080_169,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
fastConnectOptions: FastConnectOptions(
|
fastConnectOptions: FastConnectOptions(
|
||||||
microphone: TrackOption(track: audioTrack.value),
|
microphone: TrackOption(track: audioTrack.value),
|
||||||
camera: TrackOption(track: videoTrack.value),
|
camera: TrackOption(track: videoTrack.value),
|
||||||
@@ -151,6 +153,8 @@ class ChatCallProvider extends GetxController {
|
|||||||
void onRoomDidUpdate() => sortParticipants();
|
void onRoomDidUpdate() => sortParticipants();
|
||||||
|
|
||||||
void setupRoom() {
|
void setupRoom() {
|
||||||
|
if (isInitialized.value) return;
|
||||||
|
|
||||||
sortParticipants();
|
sortParticipants();
|
||||||
room.addListener(onRoomDidUpdate);
|
room.addListener(onRoomDidUpdate);
|
||||||
WidgetsBindingCompatible.instance?.addPostFrameCallback(
|
WidgetsBindingCompatible.instance?.addPostFrameCallback(
|
||||||
@@ -160,6 +164,8 @@ class ChatCallProvider extends GetxController {
|
|||||||
if (lkPlatformIsMobile()) {
|
if (lkPlatformIsMobile()) {
|
||||||
Hardware.instance.setSpeakerphoneOn(true);
|
Hardware.instance.setSpeakerphoneOn(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isInitialized.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupRoomListeners({
|
void setupRoomListeners({
|
||||||
@@ -362,6 +368,7 @@ class ChatCallProvider extends GetxController {
|
|||||||
|
|
||||||
void disposeRoom() {
|
void disposeRoom() {
|
||||||
isMounted.value = false;
|
isMounted.value = false;
|
||||||
|
isInitialized.value = false;
|
||||||
current.value = null;
|
current.value = null;
|
||||||
channel.value = null;
|
channel.value = null;
|
||||||
room.removeListener(onRoomDidUpdate);
|
room.removeListener(onRoomDidUpdate);
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import 'dart:typed_data';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:path/path.dart';
|
import 'package:path/path.dart';
|
||||||
import 'package:solian/models/attachment.dart';
|
import 'package:solian/models/attachment.dart';
|
||||||
|
import 'package:solian/models/pagination.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
import 'package:solian/services.dart';
|
import 'package:solian/services.dart';
|
||||||
|
import 'package:dio/dio.dart' as dio;
|
||||||
|
|
||||||
class AttachmentProvider extends GetConnect {
|
class AttachmentProvider extends GetConnect {
|
||||||
static Map<String, String> mimetypeOverrides = {
|
static Map<String, String> mimetypeOverrides = {
|
||||||
@@ -18,18 +20,62 @@ class AttachmentProvider extends GetConnect {
|
|||||||
httpClient.baseUrl = ServiceFinder.buildUrl('files', null);
|
httpClient.baseUrl = ServiceFinder.buildUrl('files', null);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Map<int, Attachment> _cachedResponses = {};
|
final Map<String, Attachment> _cachedResponses = {};
|
||||||
|
|
||||||
Future<Attachment?> getMetadata(int id, {noCache = false}) async {
|
Future<List<Attachment?>> listMetadata(
|
||||||
if (!noCache && _cachedResponses.containsKey(id)) {
|
List<String> rid, {
|
||||||
return _cachedResponses[id]!;
|
noCache = false,
|
||||||
|
}) async {
|
||||||
|
if (rid.isEmpty) return List.empty();
|
||||||
|
|
||||||
|
List<Attachment?> result = List.filled(rid.length, null);
|
||||||
|
List<String> pendingQuery = List.empty(growable: true);
|
||||||
|
if (!noCache) {
|
||||||
|
for (var idx = 0; idx < rid.length; idx++) {
|
||||||
|
if (_cachedResponses.containsKey(rid[idx])) {
|
||||||
|
result[idx] = _cachedResponses[rid[idx]];
|
||||||
|
} else {
|
||||||
|
pendingQuery.add(rid[idx]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final resp = await get('/attachments/$id/meta');
|
final resp = await get(
|
||||||
|
'/attachments?take=${pendingQuery.length}&id=${pendingQuery.join(',')}',
|
||||||
|
);
|
||||||
|
if (resp.statusCode != 200) return result;
|
||||||
|
|
||||||
|
final rawOut = PaginationResult.fromJson(resp.body);
|
||||||
|
if (rawOut.data == null) return result;
|
||||||
|
|
||||||
|
final List<Attachment> out =
|
||||||
|
rawOut.data!.map((x) => Attachment.fromJson(x)).toList();
|
||||||
|
for (final item in out) {
|
||||||
|
if (item.destination != 0 && item.isAnalyzed) {
|
||||||
|
_cachedResponses[item.rid] = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var i = 0; i < out.length; i++) {
|
||||||
|
for (var j = 0; j < rid.length; j++) {
|
||||||
|
if (out[i].rid == rid[j]) {
|
||||||
|
result[j] = out[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Attachment?> getMetadata(String rid, {noCache = false}) async {
|
||||||
|
if (!noCache && _cachedResponses.containsKey(rid)) {
|
||||||
|
return _cachedResponses[rid]!;
|
||||||
|
}
|
||||||
|
|
||||||
|
final resp = await get('/attachments/$rid/meta');
|
||||||
if (resp.statusCode == 200) {
|
if (resp.statusCode == 200) {
|
||||||
final result = Attachment.fromJson(resp.body);
|
final result = Attachment.fromJson(resp.body);
|
||||||
if (result.destination != 0 && result.isAnalyzed) {
|
if (result.destination != 0 && result.isAnalyzed) {
|
||||||
_cachedResponses[id] = result;
|
_cachedResponses[rid] = result;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -37,21 +83,16 @@ class AttachmentProvider extends GetConnect {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Response> createAttachment(
|
Future<Attachment> createAttachment(
|
||||||
Uint8List data,
|
Uint8List data, String path, String pool, Map<String, dynamic>? metadata,
|
||||||
String path,
|
{Function(double)? onProgress}) async {
|
||||||
String usage,
|
|
||||||
Map<String, dynamic>? metadata,
|
|
||||||
) async {
|
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
if (auth.isAuthorized.isFalse) throw Exception('unauthorized');
|
if (auth.isAuthorized.isFalse) throw Exception('unauthorized');
|
||||||
|
|
||||||
final client = auth.configureClient(
|
await auth.ensureCredentials();
|
||||||
'files',
|
|
||||||
timeout: const Duration(minutes: 3),
|
|
||||||
);
|
|
||||||
|
|
||||||
final filePayload = MultipartFile(data, filename: basename(path));
|
final filePayload =
|
||||||
|
dio.MultipartFile.fromBytes(data, filename: basename(path));
|
||||||
final fileAlt = basename(path).contains('.')
|
final fileAlt = basename(path).contains('.')
|
||||||
? basename(path).substring(0, basename(path).lastIndexOf('.'))
|
? basename(path).substring(0, basename(path).lastIndexOf('.'))
|
||||||
: basename(path);
|
: basename(path);
|
||||||
@@ -64,25 +105,35 @@ class AttachmentProvider extends GetConnect {
|
|||||||
if (mimetypeOverrides.keys.contains(fileExt)) {
|
if (mimetypeOverrides.keys.contains(fileExt)) {
|
||||||
mimetypeOverride = mimetypeOverrides[fileExt];
|
mimetypeOverride = mimetypeOverrides[fileExt];
|
||||||
}
|
}
|
||||||
final payload = FormData({
|
final payload = dio.FormData.fromMap({
|
||||||
'alt': fileAlt,
|
'alt': fileAlt,
|
||||||
'file': filePayload,
|
'file': filePayload,
|
||||||
'usage': usage,
|
'pool': pool,
|
||||||
if (mimetypeOverride != null) 'mimetype': mimetypeOverride,
|
if (mimetypeOverride != null) 'mimetype': mimetypeOverride,
|
||||||
'metadata': jsonEncode(metadata),
|
'metadata': jsonEncode(metadata),
|
||||||
});
|
});
|
||||||
final resp = await client.post('/attachments', payload);
|
final resp = await dio.Dio(
|
||||||
|
dio.BaseOptions(
|
||||||
|
baseUrl: ServiceFinder.buildUrl('files', null),
|
||||||
|
headers: {'Authorization': 'Bearer ${auth.credentials!.accessToken}'},
|
||||||
|
),
|
||||||
|
).post(
|
||||||
|
'/attachments',
|
||||||
|
data: payload,
|
||||||
|
onSendProgress: (count, total) {
|
||||||
|
if (onProgress != null) onProgress(count / total);
|
||||||
|
},
|
||||||
|
);
|
||||||
if (resp.statusCode != 200) {
|
if (resp.statusCode != 200) {
|
||||||
throw Exception(resp.bodyString);
|
throw Exception(resp.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
return resp;
|
return Attachment.fromJson(resp.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Response> updateAttachment(
|
Future<Response> updateAttachment(
|
||||||
int id,
|
int id,
|
||||||
String alt,
|
String alt, {
|
||||||
String usage, {
|
|
||||||
bool isMature = false,
|
bool isMature = false,
|
||||||
}) async {
|
}) async {
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
@@ -92,7 +143,6 @@ class AttachmentProvider extends GetConnect {
|
|||||||
|
|
||||||
var resp = await client.put('/attachments/$id', {
|
var resp = await client.put('/attachments/$id', {
|
||||||
'alt': alt,
|
'alt': alt,
|
||||||
'usage': usage,
|
|
||||||
'is_mature': isMature,
|
'is_mature': isMature,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -117,7 +167,7 @@ class AttachmentProvider extends GetConnect {
|
|||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearCache({int? id}) {
|
void clearCache({String? id}) {
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
_cachedResponses.remove(id);
|
_cachedResponses.remove(id);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -9,13 +9,20 @@ class PostProvider extends GetConnect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<Response> listRecommendations(int page,
|
Future<Response> listRecommendations(int page,
|
||||||
{int? realm, String? channel}) async {
|
{String? realm, String? channel}) async {
|
||||||
|
GetConnect client;
|
||||||
|
final AuthProvider auth = Get.find();
|
||||||
final queries = [
|
final queries = [
|
||||||
'take=${10}',
|
'take=${10}',
|
||||||
'offset=$page',
|
'offset=$page',
|
||||||
if (realm != null) 'realmId=$realm',
|
if (realm != null) 'realm=$realm',
|
||||||
];
|
];
|
||||||
final resp = await get(
|
if (auth.isAuthorized.value) {
|
||||||
|
client = auth.configureClient('co');
|
||||||
|
} else {
|
||||||
|
client = ServiceFinder.configureClient('co');
|
||||||
|
}
|
||||||
|
final resp = await client.get(
|
||||||
channel == null
|
channel == null
|
||||||
? '/recommendations?${queries.join('&')}'
|
? '/recommendations?${queries.join('&')}'
|
||||||
: '/recommendations/$channel?${queries.join('&')}',
|
: '/recommendations/$channel?${queries.join('&')}',
|
||||||
@@ -45,14 +52,14 @@ class PostProvider extends GetConnect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<Response> listPost(int page,
|
Future<Response> listPost(int page,
|
||||||
{int? realm, String? author, tag, category}) async {
|
{String? realm, String? author, tag, category}) async {
|
||||||
final queries = [
|
final queries = [
|
||||||
'take=${10}',
|
'take=${10}',
|
||||||
'offset=$page',
|
'offset=$page',
|
||||||
if (tag != null) 'tag=$tag',
|
if (tag != null) 'tag=$tag',
|
||||||
if (category != null) 'category=$category',
|
if (category != null) 'category=$category',
|
||||||
if (author != null) 'author=$author',
|
if (author != null) 'author=$author',
|
||||||
if (realm != null) 'realmId=$realm',
|
if (realm != null) 'realm=$realm',
|
||||||
];
|
];
|
||||||
final resp = await get('/posts?${queries.join('&')}');
|
final resp = await get('/posts?${queries.join('&')}');
|
||||||
if (resp.statusCode != 200) {
|
if (resp.statusCode != 200) {
|
||||||
|
|||||||
@@ -1,7 +1,24 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:solian/models/realm.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
|
|
||||||
class RealmProvider extends GetxController {
|
class RealmProvider extends GetxController {
|
||||||
|
RxBool isLoading = false.obs;
|
||||||
|
RxList<Realm> availableRealms = RxList.empty(growable: true);
|
||||||
|
|
||||||
|
Future<void> refreshAvailableRealms() async {
|
||||||
|
final AuthProvider auth = Get.find();
|
||||||
|
if (auth.isAuthorized.isFalse) throw Exception('unauthorized');
|
||||||
|
|
||||||
|
isLoading.value = true;
|
||||||
|
final resp = await listAvailableRealm();
|
||||||
|
isLoading.value = false;
|
||||||
|
|
||||||
|
availableRealms.value =
|
||||||
|
resp.body.map((x) => Realm.fromJson(x)).toList().cast<Realm>();
|
||||||
|
availableRealms.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
Future<Response> getRealm(String alias) async {
|
Future<Response> getRealm(String alias) async {
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
if (auth.isAuthorized.isFalse) throw Exception('unauthorized');
|
if (auth.isAuthorized.isFalse) throw Exception('unauthorized');
|
||||||
|
|||||||
@@ -4,15 +4,19 @@ import 'package:solian/models/relations.dart';
|
|||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
|
|
||||||
class RelationshipProvider extends GetxController {
|
class RelationshipProvider extends GetxController {
|
||||||
|
final RxInt friendRequestCount = 0.obs;
|
||||||
|
|
||||||
final RxList<Relationship> _friends = RxList.empty(growable: true);
|
final RxList<Relationship> _friends = RxList.empty(growable: true);
|
||||||
|
|
||||||
Future<void> refreshFriendList() async {
|
Future<void> refreshRelativeList() async {
|
||||||
final resp = await listRelationWithStatus(1);
|
final resp = await listRelation();
|
||||||
_friends.value = resp.body
|
final List<Relationship> result = resp.body
|
||||||
.map((e) => Relationship.fromJson(e))
|
.map((e) => Relationship.fromJson(e))
|
||||||
.toList()
|
.toList()
|
||||||
.cast<Relationship>();
|
.cast<Relationship>();
|
||||||
|
_friends.value = result.where((x) => x.status == 1).toList();
|
||||||
_friends.refresh();
|
_friends.refresh();
|
||||||
|
friendRequestCount.value = result.where((x) => x.status == 0).length;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasFriend(Account account) {
|
bool hasFriend(Account account) {
|
||||||
|
|||||||
34
lib/providers/stickers.dart
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:solian/models/pagination.dart';
|
||||||
|
import 'package:solian/models/stickers.dart';
|
||||||
|
import 'package:solian/services.dart';
|
||||||
|
|
||||||
|
class StickerProvider extends GetxController {
|
||||||
|
final RxMap<String, String> aliasImageMapping = RxMap();
|
||||||
|
final RxList<Sticker> availableStickers = RxList.empty(growable: true);
|
||||||
|
|
||||||
|
Future<void> refreshAvailableStickers() async {
|
||||||
|
availableStickers.clear();
|
||||||
|
aliasImageMapping.clear();
|
||||||
|
|
||||||
|
final client = ServiceFinder.configureClient('files');
|
||||||
|
final resp = await client.get(
|
||||||
|
'/stickers/manifest?take=100',
|
||||||
|
);
|
||||||
|
if (resp.statusCode == 200) {
|
||||||
|
final result = PaginationResult.fromJson(resp.body);
|
||||||
|
final out = result.data?.map((e) => StickerPack.fromJson(e)).toList();
|
||||||
|
if (out == null) return;
|
||||||
|
|
||||||
|
for (final pack in out) {
|
||||||
|
for (final sticker in (pack.stickers ?? List<Sticker>.empty())) {
|
||||||
|
sticker.pack = pack;
|
||||||
|
aliasImageMapping[sticker.textPlaceholder.toUpperCase()] =
|
||||||
|
sticker.imageUrl;
|
||||||
|
availableStickers.add(sticker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
availableStickers.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
30
lib/providers/theme_switcher.dart
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
import 'package:solian/theme.dart';
|
||||||
|
|
||||||
|
class ThemeSwitcher extends ChangeNotifier {
|
||||||
|
ThemeData lightThemeData;
|
||||||
|
ThemeData darkThemeData;
|
||||||
|
|
||||||
|
ThemeSwitcher({
|
||||||
|
required this.lightThemeData,
|
||||||
|
required this.darkThemeData,
|
||||||
|
});
|
||||||
|
|
||||||
|
Future<void> restoreTheme() async {
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
if (prefs.containsKey('global_theme_color')) {
|
||||||
|
final value = prefs.getInt('global_theme_color')!;
|
||||||
|
final color = Color(value);
|
||||||
|
lightThemeData = SolianTheme.build(Brightness.light, seedColor: color);
|
||||||
|
darkThemeData = SolianTheme.build(Brightness.dark, seedColor: color);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setTheme(ThemeData light, dark) {
|
||||||
|
lightThemeData = light;
|
||||||
|
darkThemeData = dark;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'package:animations/animations.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:solian/models/realm.dart';
|
import 'package:solian/models/realm.dart';
|
||||||
import 'package:solian/screens/about.dart';
|
import 'package:solian/screens/about.dart';
|
||||||
@@ -5,6 +7,7 @@ import 'package:solian/screens/account.dart';
|
|||||||
import 'package:solian/screens/account/friend.dart';
|
import 'package:solian/screens/account/friend.dart';
|
||||||
import 'package:solian/screens/account/personalize.dart';
|
import 'package:solian/screens/account/personalize.dart';
|
||||||
import 'package:solian/screens/account/profile_page.dart';
|
import 'package:solian/screens/account/profile_page.dart';
|
||||||
|
import 'package:solian/screens/account/stickers.dart';
|
||||||
import 'package:solian/screens/channel/channel_chat.dart';
|
import 'package:solian/screens/channel/channel_chat.dart';
|
||||||
import 'package:solian/screens/channel/channel_detail.dart';
|
import 'package:solian/screens/channel/channel_detail.dart';
|
||||||
import 'package:solian/screens/channel/channel_organize.dart';
|
import 'package:solian/screens/channel/channel_organize.dart';
|
||||||
@@ -18,6 +21,7 @@ import 'package:solian/screens/realms/realm_organize.dart';
|
|||||||
import 'package:solian/screens/realms/realm_view.dart';
|
import 'package:solian/screens/realms/realm_view.dart';
|
||||||
import 'package:solian/screens/home.dart';
|
import 'package:solian/screens/home.dart';
|
||||||
import 'package:solian/screens/posts/post_editor.dart';
|
import 'package:solian/screens/posts/post_editor.dart';
|
||||||
|
import 'package:solian/screens/settings.dart';
|
||||||
import 'package:solian/shells/root_shell.dart';
|
import 'package:solian/shells/root_shell.dart';
|
||||||
import 'package:solian/shells/title_shell.dart';
|
import 'package:solian/shells/title_shell.dart';
|
||||||
|
|
||||||
@@ -34,6 +38,22 @@ abstract class AppRouter {
|
|||||||
_chatRoute,
|
_chatRoute,
|
||||||
_realmRoute,
|
_realmRoute,
|
||||||
_accountRoute,
|
_accountRoute,
|
||||||
|
GoRoute(
|
||||||
|
path: '/about',
|
||||||
|
name: 'about',
|
||||||
|
builder: (context, state) => TitleShell(
|
||||||
|
state: state,
|
||||||
|
child: const AboutScreen(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
GoRoute(
|
||||||
|
path: '/settings',
|
||||||
|
name: 'settings',
|
||||||
|
builder: (context, state) => TitleShell(
|
||||||
|
state: state,
|
||||||
|
child: const SettingScreen(),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -76,14 +96,25 @@ abstract class AppRouter {
|
|||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/posts/editor',
|
path: '/posts/editor',
|
||||||
name: 'postEditor',
|
name: 'postEditor',
|
||||||
builder: (context, state) {
|
pageBuilder: (context, state) {
|
||||||
final arguments = state.extra as PostPublishArguments?;
|
final arguments = state.extra as PostPublishArguments?;
|
||||||
return PostPublishScreen(
|
return CustomTransitionPage(
|
||||||
edit: arguments?.edit,
|
child: PostPublishScreen(
|
||||||
reply: arguments?.reply,
|
edit: arguments?.edit,
|
||||||
repost: arguments?.repost,
|
reply: arguments?.reply,
|
||||||
realm: arguments?.realm,
|
repost: arguments?.repost,
|
||||||
mode: int.tryParse(state.uri.queryParameters['mode'] ?? '0') ?? 0,
|
realm: arguments?.realm,
|
||||||
|
mode: int.tryParse(state.uri.queryParameters['mode'] ?? '0') ?? 0,
|
||||||
|
),
|
||||||
|
transitionsBuilder:
|
||||||
|
(context, animation, secondaryAnimation, child) {
|
||||||
|
return FadeThroughTransition(
|
||||||
|
fillColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
animation: animation,
|
||||||
|
secondaryAnimation: secondaryAnimation,
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -195,6 +226,14 @@ abstract class AppRouter {
|
|||||||
name: 'accountFriend',
|
name: 'accountFriend',
|
||||||
builder: (context, state) => const FriendScreen(),
|
builder: (context, state) => const FriendScreen(),
|
||||||
),
|
),
|
||||||
|
GoRoute(
|
||||||
|
path: '/account/stickers',
|
||||||
|
name: 'accountStickers',
|
||||||
|
builder: (context, state) => TitleShell(
|
||||||
|
state: state,
|
||||||
|
child: const StickerScreen(),
|
||||||
|
),
|
||||||
|
),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/account/personalize',
|
path: '/account/personalize',
|
||||||
name: 'accountPersonalize',
|
name: 'accountPersonalize',
|
||||||
@@ -210,14 +249,6 @@ abstract class AppRouter {
|
|||||||
name: state.pathParameters['name']!,
|
name: state.pathParameters['name']!,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
GoRoute(
|
|
||||||
path: '/about',
|
|
||||||
name: 'about',
|
|
||||||
builder: (context, state) => TitleShell(
|
|
||||||
state: state,
|
|
||||||
child: const AboutScreen(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,11 @@ class AboutScreen extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Image.asset('assets/logo.png', width: 64, height: 64),
|
ClipRRect(
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||||
|
child: Image.asset('assets/logo.png', width: 120, height: 120),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
Text(
|
Text(
|
||||||
'Solian',
|
'Solian',
|
||||||
style: Theme.of(context).textTheme.headlineMedium,
|
style: Theme.of(context).textTheme.headlineMedium,
|
||||||
@@ -44,17 +48,28 @@ class AboutScreen extends StatelessWidget {
|
|||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
TextButton(
|
TextButton(
|
||||||
style: denseButtonStyle,
|
style: denseButtonStyle,
|
||||||
child: const Text('More Information'),
|
child: const Text('App Details'),
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
launchUrlString('https://solsynth.dev/products/solar-network');
|
final info = await PackageInfo.fromPlatform();
|
||||||
|
|
||||||
|
showAboutDialog(
|
||||||
|
context: context,
|
||||||
|
applicationVersion: '${info.version} (${info.buildNumber})',
|
||||||
|
applicationLegalese:
|
||||||
|
'The Solar Network App is an intuitive and self-hostable social network and computing platform. Experience the freedom of a user-friendly design that empowers you to create and connect with communities on your own terms. Embrace the future of social networking with a platform that prioritizes your independence and privacy.',
|
||||||
|
applicationIcon: ClipRRect(
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||||
|
child: Image.asset('assets/logo.png', width: 60, height: 60),
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
style: denseButtonStyle,
|
style: denseButtonStyle,
|
||||||
|
child: const Text('Project Website'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
launchUrlString('https://solsynth.dev');
|
launchUrlString('https://solsynth.dev/products/solar-network');
|
||||||
},
|
},
|
||||||
child: const Text('Official Website'),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
const Text(
|
const Text(
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ import 'package:get/get.dart';
|
|||||||
import 'package:solian/models/account.dart';
|
import 'package:solian/models/account.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
import 'package:solian/providers/account_status.dart';
|
import 'package:solian/providers/account_status.dart';
|
||||||
|
import 'package:solian/providers/relation.dart';
|
||||||
import 'package:solian/router.dart';
|
import 'package:solian/router.dart';
|
||||||
import 'package:solian/screens/auth/signin.dart';
|
import 'package:solian/screens/auth/signin.dart';
|
||||||
import 'package:solian/screens/auth/signup.dart';
|
import 'package:solian/screens/auth/signup.dart';
|
||||||
import 'package:solian/widgets/account/account_heading.dart';
|
import 'package:solian/widgets/account/account_heading.dart';
|
||||||
import 'package:solian/widgets/sized_container.dart';
|
import 'package:solian/widgets/sized_container.dart';
|
||||||
|
import 'package:badges/badges.dart' as badges;
|
||||||
|
|
||||||
class AccountScreen extends StatefulWidget {
|
class AccountScreen extends StatefulWidget {
|
||||||
const AccountScreen({super.key});
|
const AccountScreen({super.key});
|
||||||
@@ -23,10 +25,32 @@ class _AccountScreenState extends State<AccountScreen> {
|
|||||||
(
|
(
|
||||||
const Icon(Icons.color_lens),
|
const Icon(Icons.color_lens),
|
||||||
'accountPersonalize'.tr,
|
'accountPersonalize'.tr,
|
||||||
'accountPersonalize'
|
'accountPersonalize',
|
||||||
|
),
|
||||||
|
(
|
||||||
|
Obx(() {
|
||||||
|
final RelationshipProvider relations = Get.find();
|
||||||
|
return badges.Badge(
|
||||||
|
badgeContent: Text(
|
||||||
|
relations.friendRequestCount.value.toString(),
|
||||||
|
style: const TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
showBadge: relations.friendRequestCount.value > 0,
|
||||||
|
position: badges.BadgePosition.topEnd(
|
||||||
|
top: -12,
|
||||||
|
end: -8,
|
||||||
|
),
|
||||||
|
child: const Icon(Icons.diversity_1),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
'accountFriend'.tr,
|
||||||
|
'accountFriend',
|
||||||
|
),
|
||||||
|
(
|
||||||
|
const Icon(Icons.emoji_symbols),
|
||||||
|
'accountStickers'.tr,
|
||||||
|
'accountStickers',
|
||||||
),
|
),
|
||||||
(const Icon(Icons.diversity_1), 'accountFriend'.tr, 'accountFriend'),
|
|
||||||
(const Icon(Icons.info_outline), 'about'.tr, 'about'),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
@@ -41,7 +65,10 @@ class _AccountScreenState extends State<AccountScreen> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
ActionCard(
|
ActionCard(
|
||||||
icon: const Icon(Icons.login, color: Colors.white),
|
icon: Icon(
|
||||||
|
Icons.login,
|
||||||
|
color: Theme.of(context).colorScheme.onPrimary,
|
||||||
|
),
|
||||||
title: 'signin'.tr,
|
title: 'signin'.tr,
|
||||||
caption: 'signinCaption'.tr,
|
caption: 'signinCaption'.tr,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -59,7 +86,10 @@ class _AccountScreenState extends State<AccountScreen> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
ActionCard(
|
ActionCard(
|
||||||
icon: const Icon(Icons.add, color: Colors.white),
|
icon: Icon(
|
||||||
|
Icons.add,
|
||||||
|
color: Theme.of(context).colorScheme.onPrimary,
|
||||||
|
),
|
||||||
title: 'signup'.tr,
|
title: 'signup'.tr,
|
||||||
caption: 'signupCaption'.tr,
|
caption: 'signupCaption'.tr,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -184,7 +214,7 @@ class ActionCard extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
CircleAvatar(
|
CircleAvatar(
|
||||||
backgroundColor: Colors.indigo,
|
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||||
child: icon,
|
child: icon,
|
||||||
).paddingOnly(bottom: 12),
|
).paddingOnly(bottom: 12),
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:solian/exts.dart';
|
import 'package:solian/exts.dart';
|
||||||
import 'package:solian/models/relations.dart';
|
import 'package:solian/models/relations.dart';
|
||||||
import 'package:solian/providers/relation.dart';
|
import 'package:solian/providers/relation.dart';
|
||||||
|
import 'package:solian/theme.dart';
|
||||||
import 'package:solian/widgets/account/relative_list.dart';
|
import 'package:solian/widgets/account/relative_list.dart';
|
||||||
|
|
||||||
class FriendScreen extends StatefulWidget {
|
class FriendScreen extends StatefulWidget {
|
||||||
@@ -21,15 +21,15 @@ class _FriendScreenState extends State<FriendScreen>
|
|||||||
|
|
||||||
List<Relationship> _relations = List.empty();
|
List<Relationship> _relations = List.empty();
|
||||||
|
|
||||||
List<Relationship> filterByStatus(int status) {
|
List<Relationship> _filterByStatus(int status) {
|
||||||
return _relations.where((x) => x.status == status).toList();
|
return _relations.where((x) => x.status == status).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> loadRelations() async {
|
Future<void> _loadRelations() async {
|
||||||
setState(() => _isBusy = true);
|
setState(() => _isBusy = true);
|
||||||
|
|
||||||
final RelationshipProvider provider = Get.find();
|
final RelationshipProvider relations = Get.find();
|
||||||
final resp = await provider.listRelation();
|
final resp = await relations.listRelation();
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_relations = resp.body
|
_relations = resp.body
|
||||||
@@ -38,9 +38,12 @@ class _FriendScreenState extends State<FriendScreen>
|
|||||||
.cast<Relationship>();
|
.cast<Relationship>();
|
||||||
_isBusy = false;
|
_isBusy = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
relations.friendRequestCount.value =
|
||||||
|
_relations.where((x) => x.status == 0).length;
|
||||||
}
|
}
|
||||||
|
|
||||||
void promptAddFriend() async {
|
void _promptAddFriend() async {
|
||||||
final RelationshipProvider provider = Get.find();
|
final RelationshipProvider provider = Get.find();
|
||||||
|
|
||||||
final controller = TextEditingController();
|
final controller = TextEditingController();
|
||||||
@@ -104,8 +107,8 @@ class _FriendScreenState extends State<FriendScreen>
|
|||||||
super.initState();
|
super.initState();
|
||||||
_tabController = TabController(length: 3, vsync: this);
|
_tabController = TabController(length: 3, vsync: this);
|
||||||
|
|
||||||
loadRelations().then((_) {
|
_loadRelations().then((_) {
|
||||||
if (filterByStatus(0).isEmpty) {
|
if (_filterByStatus(0).isEmpty) {
|
||||||
_tabController.animateTo(1);
|
_tabController.animateTo(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -119,6 +122,19 @@ class _FriendScreenState extends State<FriendScreen>
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
title: Text('accountFriend'.tr),
|
title: Text('accountFriend'.tr),
|
||||||
|
actions: [
|
||||||
|
if (_isBusy)
|
||||||
|
SizedBox(
|
||||||
|
height: 48,
|
||||||
|
width: 48,
|
||||||
|
child: const CircularProgressIndicator(
|
||||||
|
strokeWidth: 3,
|
||||||
|
).paddingAll(14),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: SolianTheme.isLargeScreen(context) ? 8 : 16,
|
||||||
|
),
|
||||||
|
],
|
||||||
bottom: TabBar(
|
bottom: TabBar(
|
||||||
controller: _tabController,
|
controller: _tabController,
|
||||||
tabs: const [
|
tabs: const [
|
||||||
@@ -130,52 +146,40 @@ class _FriendScreenState extends State<FriendScreen>
|
|||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
child: const Icon(Icons.add),
|
child: const Icon(Icons.add),
|
||||||
onPressed: () => promptAddFriend(),
|
onPressed: () => _promptAddFriend(),
|
||||||
),
|
),
|
||||||
body: TabBarView(
|
body: TabBarView(
|
||||||
controller: _tabController,
|
controller: _tabController,
|
||||||
children: [
|
children: [
|
||||||
RefreshIndicator(
|
RefreshIndicator(
|
||||||
onRefresh: () => loadRelations(),
|
onRefresh: () => _loadRelations(),
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
if (_isBusy)
|
|
||||||
SliverToBoxAdapter(
|
|
||||||
child: const LinearProgressIndicator().animate().scaleX(),
|
|
||||||
),
|
|
||||||
SilverRelativeList(
|
SilverRelativeList(
|
||||||
items: filterByStatus(0),
|
items: _filterByStatus(0),
|
||||||
onUpdate: () => loadRelations(),
|
onUpdate: () => _loadRelations(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
RefreshIndicator(
|
RefreshIndicator(
|
||||||
onRefresh: () => loadRelations(),
|
onRefresh: () => _loadRelations(),
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
if (_isBusy)
|
|
||||||
SliverToBoxAdapter(
|
|
||||||
child: const LinearProgressIndicator().animate().scaleX(),
|
|
||||||
),
|
|
||||||
SilverRelativeList(
|
SilverRelativeList(
|
||||||
items: filterByStatus(1),
|
items: _filterByStatus(1),
|
||||||
onUpdate: () => loadRelations(),
|
onUpdate: () => _loadRelations(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
RefreshIndicator(
|
RefreshIndicator(
|
||||||
onRefresh: () => loadRelations(),
|
onRefresh: () => _loadRelations(),
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
if (_isBusy)
|
|
||||||
SliverToBoxAdapter(
|
|
||||||
child: const LinearProgressIndicator().animate().scaleX(),
|
|
||||||
),
|
|
||||||
SilverRelativeList(
|
SilverRelativeList(
|
||||||
items: filterByStatus(3),
|
items: _filterByStatus(3),
|
||||||
onUpdate: () => loadRelations(),
|
onUpdate: () => _loadRelations(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ import 'dart:io';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_animate/flutter_animate.dart';
|
import 'package:flutter_animate/flutter_animate.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:image_cropper/image_cropper.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:solian/exts.dart';
|
import 'package:solian/exts.dart';
|
||||||
|
import 'package:solian/models/attachment.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
import 'package:solian/providers/content/attachment.dart';
|
import 'package:solian/providers/content/attachment.dart';
|
||||||
import 'package:solian/services.dart';
|
import 'package:solian/services.dart';
|
||||||
@@ -34,7 +36,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
|
|
||||||
bool _isBusy = false;
|
bool _isBusy = false;
|
||||||
|
|
||||||
void selectBirthday() async {
|
void _selectBirthday() async {
|
||||||
final DateTime? picked = await showDatePicker(
|
final DateTime? picked = await showDatePicker(
|
||||||
context: context,
|
context: context,
|
||||||
initialDate: _birthday?.toLocal(),
|
initialDate: _birthday?.toLocal(),
|
||||||
@@ -49,48 +51,73 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void syncWidget() async {
|
void _syncWidget() async {
|
||||||
setState(() => _isBusy = true);
|
_isBusy = true;
|
||||||
|
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
final prof = auth.userProfile.value!;
|
final prof = auth.userProfile.value!;
|
||||||
setState(() {
|
_usernameController.text = prof['name'];
|
||||||
_usernameController.text = prof['name'];
|
_nicknameController.text = prof['nick'];
|
||||||
_nicknameController.text = prof['nick'];
|
_descriptionController.text = prof['description'];
|
||||||
_descriptionController.text = prof['description'];
|
_firstNameController.text = prof['profile']['first_name'];
|
||||||
_firstNameController.text = prof['profile']['first_name'];
|
_lastNameController.text = prof['profile']['last_name'];
|
||||||
_lastNameController.text = prof['profile']['last_name'];
|
_avatar = prof['avatar'];
|
||||||
_avatar = prof['avatar'];
|
_banner = prof['banner'];
|
||||||
_banner = prof['banner'];
|
if (prof['profile']['birthday'] != null) {
|
||||||
if (prof['profile']['birthday'] != null) {
|
_birthday = DateTime.parse(prof['profile']['birthday']);
|
||||||
_birthday = DateTime.parse(prof['profile']['birthday']);
|
_birthdayController.text =
|
||||||
_birthdayController.text =
|
DateFormat('yyyy-MM-dd').format(_birthday!.toLocal());
|
||||||
DateFormat('yyyy-MM-dd').format(_birthday!.toLocal());
|
}
|
||||||
}
|
|
||||||
|
|
||||||
_isBusy = false;
|
_isBusy = false;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateImage(String position) async {
|
Future<void> _editImage(String position) async {
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
if (auth.isAuthorized.isFalse) return;
|
if (auth.isAuthorized.isFalse) return;
|
||||||
|
|
||||||
final image = await _imagePicker.pickImage(source: ImageSource.gallery);
|
final image = await _imagePicker.pickImage(source: ImageSource.gallery);
|
||||||
if (image == null) return;
|
if (image == null) return;
|
||||||
|
|
||||||
|
CroppedFile? croppedFile = await ImageCropper().cropImage(
|
||||||
|
sourcePath: image.path,
|
||||||
|
uiSettings: [
|
||||||
|
AndroidUiSettings(
|
||||||
|
toolbarTitle: 'cropImage'.tr,
|
||||||
|
toolbarColor: Theme.of(context).colorScheme.primary,
|
||||||
|
toolbarWidgetColor: Theme.of(context).colorScheme.onPrimary,
|
||||||
|
aspectRatioPresets: [
|
||||||
|
if (position == 'avatar') CropAspectRatioPreset.square,
|
||||||
|
if (position == 'banner') _BannerCropAspectRatioPreset(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
IOSUiSettings(
|
||||||
|
title: 'cropImage'.tr,
|
||||||
|
aspectRatioPresets: [
|
||||||
|
if (position == 'avatar') CropAspectRatioPreset.square,
|
||||||
|
if (position == 'banner') _BannerCropAspectRatioPreset(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
WebUiSettings(
|
||||||
|
context: context,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
if (croppedFile == null) return;
|
||||||
|
final file = File(croppedFile.path);
|
||||||
|
|
||||||
setState(() => _isBusy = true);
|
setState(() => _isBusy = true);
|
||||||
|
|
||||||
final AttachmentProvider provider = Get.find();
|
final AttachmentProvider provider = Get.find();
|
||||||
|
|
||||||
Response? attachResp;
|
Attachment? attachResult;
|
||||||
try {
|
try {
|
||||||
final file = File(image.path);
|
attachResult = await provider.createAttachment(
|
||||||
attachResp = await provider.createAttachment(
|
|
||||||
await file.readAsBytes(),
|
await file.readAsBytes(),
|
||||||
file.path,
|
file.path,
|
||||||
'p.$position',
|
'avatar',
|
||||||
null
|
null,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setState(() => _isBusy = false);
|
setState(() => _isBusy = false);
|
||||||
@@ -102,10 +129,10 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
|
|
||||||
final resp = await client.put(
|
final resp = await client.put(
|
||||||
'/users/me/$position',
|
'/users/me/$position',
|
||||||
{'attachment': attachResp.body['id']},
|
{'attachment': attachResult.id},
|
||||||
);
|
);
|
||||||
if (resp.statusCode == 200) {
|
if (resp.statusCode == 200) {
|
||||||
syncWidget();
|
_syncWidget();
|
||||||
context.showSnackbar('accountPersonalizeApplied'.tr);
|
context.showSnackbar('accountPersonalizeApplied'.tr);
|
||||||
} else {
|
} else {
|
||||||
context.showErrorDialog(resp.bodyString);
|
context.showErrorDialog(resp.bodyString);
|
||||||
@@ -114,7 +141,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
setState(() => _isBusy = false);
|
setState(() => _isBusy = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updatePersonalize() async {
|
void _editUserInfo() async {
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
if (auth.isAuthorized.isFalse) return;
|
if (auth.isAuthorized.isFalse) return;
|
||||||
|
|
||||||
@@ -134,7 +161,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (resp.statusCode == 200) {
|
if (resp.statusCode == 200) {
|
||||||
syncWidget();
|
_syncWidget();
|
||||||
context.showSnackbar('accountPersonalizeApplied'.tr);
|
context.showSnackbar('accountPersonalizeApplied'.tr);
|
||||||
} else {
|
} else {
|
||||||
context.showErrorDialog(resp.bodyString);
|
context.showErrorDialog(resp.bodyString);
|
||||||
@@ -146,8 +173,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
_syncWidget();
|
||||||
Future.delayed(Duration.zero, () => syncWidget());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -168,7 +194,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
left: 40,
|
left: 40,
|
||||||
child: FloatingActionButton.small(
|
child: FloatingActionButton.small(
|
||||||
heroTag: const Key('avatar-editor'),
|
heroTag: const Key('avatar-editor'),
|
||||||
onPressed: () => updateImage('avatar'),
|
onPressed: () => _editImage('avatar'),
|
||||||
child: const Icon(
|
child: const Icon(
|
||||||
Icons.camera,
|
Icons.camera,
|
||||||
),
|
),
|
||||||
@@ -187,7 +213,8 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||||
child: _banner != null
|
child: _banner != null
|
||||||
? Image.network(
|
? Image.network(
|
||||||
ServiceFinder.buildUrl('files', '/attachments/$_banner'),
|
ServiceFinder.buildUrl(
|
||||||
|
'files', '/attachments/$_banner'),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
loadingBuilder: (BuildContext context, Widget child,
|
loadingBuilder: (BuildContext context, Widget child,
|
||||||
ImageChunkEvent? loadingProgress) {
|
ImageChunkEvent? loadingProgress) {
|
||||||
@@ -212,7 +239,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
right: 16,
|
right: 16,
|
||||||
child: FloatingActionButton(
|
child: FloatingActionButton(
|
||||||
heroTag: const Key('banner-editor'),
|
heroTag: const Key('banner-editor'),
|
||||||
onPressed: () => updateImage('banner'),
|
onPressed: () => _editImage('banner'),
|
||||||
child: const Icon(
|
child: const Icon(
|
||||||
Icons.camera_alt,
|
Icons.camera_alt,
|
||||||
),
|
),
|
||||||
@@ -293,18 +320,18 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
border: const OutlineInputBorder(),
|
border: const OutlineInputBorder(),
|
||||||
labelText: 'birthday'.tr,
|
labelText: 'birthday'.tr,
|
||||||
),
|
),
|
||||||
onTap: () => selectBirthday(),
|
onTap: () => _selectBirthday(),
|
||||||
).paddingSymmetric(horizontal: padding),
|
).paddingSymmetric(horizontal: padding),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: _isBusy ? null : () => syncWidget(),
|
onPressed: _isBusy ? null : () => _syncWidget(),
|
||||||
child: Text('reset'.tr),
|
child: Text('reset'.tr),
|
||||||
),
|
),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: _isBusy ? null : () => updatePersonalize(),
|
onPressed: _isBusy ? null : () => _editUserInfo(),
|
||||||
child: Text('apply'.tr),
|
child: Text('apply'.tr),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -325,3 +352,11 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _BannerCropAspectRatioPreset extends CropAspectRatioPresetData {
|
||||||
|
@override
|
||||||
|
(int, int)? get data => (16, 7);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get name => '16x7';
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import 'package:solian/theme.dart';
|
|||||||
import 'package:solian/widgets/account/account_avatar.dart';
|
import 'package:solian/widgets/account/account_avatar.dart';
|
||||||
import 'package:solian/widgets/app_bar_leading.dart';
|
import 'package:solian/widgets/app_bar_leading.dart';
|
||||||
import 'package:solian/widgets/attachments/attachment_list.dart';
|
import 'package:solian/widgets/attachments/attachment_list.dart';
|
||||||
import 'package:solian/widgets/feed/feed_list.dart';
|
|
||||||
import 'package:solian/widgets/posts/post_list.dart';
|
import 'package:solian/widgets/posts/post_list.dart';
|
||||||
|
import 'package:solian/widgets/posts/post_warped_list.dart';
|
||||||
import 'package:solian/widgets/sized_container.dart';
|
import 'package:solian/widgets/sized_container.dart';
|
||||||
|
|
||||||
class AccountProfilePage extends StatefulWidget {
|
class AccountProfilePage extends StatefulWidget {
|
||||||
@@ -40,7 +40,7 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
|||||||
List<Post> _pinnedPosts = List.empty();
|
List<Post> _pinnedPosts = List.empty();
|
||||||
int _totalUpvote = 0, _totalDownvote = 0;
|
int _totalUpvote = 0, _totalDownvote = 0;
|
||||||
|
|
||||||
Future<void> getUserinfo() async {
|
Future<void> _getUserinfo() async {
|
||||||
setState(() => _isBusy = true);
|
setState(() => _isBusy = true);
|
||||||
|
|
||||||
var client = ServiceFinder.configureClient('auth');
|
var client = ServiceFinder.configureClient('auth');
|
||||||
@@ -114,7 +114,7 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
getUserinfo();
|
_getUserinfo();
|
||||||
getPinnedPosts();
|
getPinnedPosts();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,8 +189,11 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
|||||||
: () async {
|
: () async {
|
||||||
setState(() => _isMakingFriend = true);
|
setState(() => _isMakingFriend = true);
|
||||||
try {
|
try {
|
||||||
await _relationshipProvider.makeFriend(widget.name);
|
await _relationshipProvider
|
||||||
context.showSnackbar('accountFriendRequestSent'.tr);
|
.makeFriend(widget.name);
|
||||||
|
context.showSnackbar(
|
||||||
|
'accountFriendRequestSent'.tr,
|
||||||
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
context.showErrorDialog(e);
|
context.showErrorDialog(e);
|
||||||
} finally {
|
} finally {
|
||||||
@@ -274,6 +277,8 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
|||||||
color:
|
color:
|
||||||
Theme.of(context).colorScheme.surfaceContainerLow,
|
Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
child: PostListEntryWidget(
|
child: PostListEntryWidget(
|
||||||
|
backgroundColor:
|
||||||
|
Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
item: element,
|
item: element,
|
||||||
isClickable: true,
|
isClickable: true,
|
||||||
isNestedClickable: true,
|
isNestedClickable: true,
|
||||||
@@ -292,9 +297,10 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
|
|||||||
child: Center(child: CircularProgressIndicator()),
|
child: Center(child: CircularProgressIndicator()),
|
||||||
),
|
),
|
||||||
if (_userinfo != null)
|
if (_userinfo != null)
|
||||||
FeedListWidget(
|
PostWarpedListWidget(
|
||||||
isPinned: false,
|
isPinned: false,
|
||||||
controller: _postController.pagingController,
|
controller: _postController.pagingController,
|
||||||
|
onUpdate: () => _postController.reloadAllOver(),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
|
|||||||
191
lib/screens/account/stickers.dart
Normal file
@@ -0,0 +1,191 @@
|
|||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
||||||
|
import 'package:solian/models/pagination.dart';
|
||||||
|
import 'package:solian/models/stickers.dart';
|
||||||
|
import 'package:solian/platform.dart';
|
||||||
|
import 'package:solian/providers/auth.dart';
|
||||||
|
import 'package:solian/providers/stickers.dart';
|
||||||
|
import 'package:solian/services.dart';
|
||||||
|
import 'package:solian/widgets/stickers/sticker_uploader.dart';
|
||||||
|
|
||||||
|
class StickerScreen extends StatefulWidget {
|
||||||
|
const StickerScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<StickerScreen> createState() => _StickerScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _StickerScreenState extends State<StickerScreen> {
|
||||||
|
final PagingController<int, StickerPack> _pagingController =
|
||||||
|
PagingController(firstPageKey: 0);
|
||||||
|
|
||||||
|
Future<bool> _promptDelete(Sticker item, String prefix) async {
|
||||||
|
final AuthProvider auth = Get.find();
|
||||||
|
if (auth.isAuthorized.isFalse) return false;
|
||||||
|
|
||||||
|
final confirm = await showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => AlertDialog(
|
||||||
|
title: Text('stickerDeletionConfirm'.tr),
|
||||||
|
content: Text(
|
||||||
|
'stickerDeletionConfirmCaption'.trParams({
|
||||||
|
'name': ':${'$prefix${item.alias}'.camelCase}:',
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
child: Text('cancel'.tr),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context, true),
|
||||||
|
child: Text('confirm'.tr),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (confirm != true) return false;
|
||||||
|
|
||||||
|
final client = auth.configureClient('files');
|
||||||
|
final resp = await client.delete('/stickers/${item.id}');
|
||||||
|
|
||||||
|
return resp.statusCode == 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool?> _promptUploadSticker({Sticker? edit}) {
|
||||||
|
return showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) => StickerUploadDialog(
|
||||||
|
edit: edit,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildEmoteEntry(Sticker item, String prefix) {
|
||||||
|
final imageUrl = ServiceFinder.buildUrl(
|
||||||
|
'files',
|
||||||
|
'/attachments/${item.attachment.rid}',
|
||||||
|
);
|
||||||
|
return ListTile(
|
||||||
|
title: Text(item.name),
|
||||||
|
subtitle: Text(item.textWarpedPlaceholder),
|
||||||
|
contentPadding: const EdgeInsets.only(left: 16, right: 14),
|
||||||
|
trailing: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.edit_square),
|
||||||
|
onPressed: () {
|
||||||
|
_promptUploadSticker(edit: item).then((value) {
|
||||||
|
if (value == true) _pagingController.refresh();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.delete),
|
||||||
|
onPressed: () {
|
||||||
|
_promptDelete(item, prefix).then((value) {
|
||||||
|
if (value == true) _pagingController.refresh();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
leading: PlatformInfo.canCacheImage
|
||||||
|
? CachedNetworkImage(
|
||||||
|
imageUrl: imageUrl,
|
||||||
|
width: 28,
|
||||||
|
height: 28,
|
||||||
|
)
|
||||||
|
: Image.network(
|
||||||
|
imageUrl,
|
||||||
|
width: 28,
|
||||||
|
height: 28,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
final AuthProvider auth = Get.find();
|
||||||
|
final name = auth.userProfile.value!['name'];
|
||||||
|
_pagingController.addPageRequestListener((pageKey) async {
|
||||||
|
final client = ServiceFinder.configureClient('files');
|
||||||
|
final resp = await client.get(
|
||||||
|
'/stickers/manifest?take=10&offset=$pageKey&author=$name',
|
||||||
|
);
|
||||||
|
if (resp.statusCode == 200) {
|
||||||
|
final result = PaginationResult.fromJson(resp.body);
|
||||||
|
final out = result.data?.map((e) => StickerPack.fromJson(e)).toList();
|
||||||
|
if (out != null && result.data!.length >= 10) {
|
||||||
|
_pagingController.appendPage(out, pageKey + out.length);
|
||||||
|
} else if (out != null) {
|
||||||
|
_pagingController.appendLastPage(out);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_pagingController.error = resp.bodyString;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
final StickerProvider sticker = Get.find();
|
||||||
|
sticker.refreshAvailableStickers();
|
||||||
|
_pagingController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
floatingActionButton: FloatingActionButton(
|
||||||
|
child: const Icon(Icons.add),
|
||||||
|
onPressed: () {
|
||||||
|
_promptUploadSticker().then((value) {
|
||||||
|
if (value == true) _pagingController.refresh();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
body: RefreshIndicator(
|
||||||
|
onRefresh: () => Future.sync(() => _pagingController.refresh()),
|
||||||
|
child: CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
PagedSliverList<int, StickerPack>(
|
||||||
|
pagingController: _pagingController,
|
||||||
|
builderDelegate: PagedChildBuilderDelegate(
|
||||||
|
itemBuilder: (BuildContext context, item, int index) {
|
||||||
|
return ExpansionTile(
|
||||||
|
title: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(item.name),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
Badge(
|
||||||
|
label: Text('#${item.id}'),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
subtitle: Text(
|
||||||
|
item.description,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
children: item.stickers?.map((x) {
|
||||||
|
x.pack = item;
|
||||||
|
return _buildEmoteEntry(x, item.prefix);
|
||||||
|
}).toList() ??
|
||||||
|
List.empty(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -79,8 +79,8 @@ class _SignInPopupState extends State<SignInPopup> with ProtocolListener {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
const redirect = 'solink://auth?status=done';
|
const redirect = 'solink://auth?status=done';
|
||||||
launchUrlString(
|
launchUrlString(
|
||||||
ServiceFinder.buildUrl('passport',
|
ServiceFinder.buildUrl('capital',
|
||||||
'/mfa?redirect_uri=$redirect&ticketId=${e.ticketId}'),
|
'/auth/mfa?redirect_uri=$redirect&ticketId=${e.ticketId}'),
|
||||||
mode: LaunchMode.inAppWebView,
|
mode: LaunchMode.inAppWebView,
|
||||||
);
|
);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
@@ -136,8 +136,10 @@ class _SignInPopupState extends State<SignInPopup> with ProtocolListener {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Image.asset('assets/logo.png', width: 64, height: 64)
|
ClipRRect(
|
||||||
.paddingOnly(bottom: 4),
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
|
child: Image.asset('assets/logo.png', width: 64, height: 64),
|
||||||
|
).paddingOnly(bottom: 4),
|
||||||
Text(
|
Text(
|
||||||
'signinGreeting'.tr,
|
'signinGreeting'.tr,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
|
|||||||
@@ -70,8 +70,10 @@ class _SignUpPopupState extends State<SignUpPopup> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Image.asset('assets/logo.png', width: 64, height: 64)
|
ClipRRect(
|
||||||
.paddingOnly(bottom: 4),
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
|
child: Image.asset('assets/logo.png', width: 64, height: 64),
|
||||||
|
).paddingOnly(bottom: 4),
|
||||||
Text(
|
Text(
|
||||||
'signupGreeting'.tr,
|
'signupGreeting'.tr,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
|
||||||
|
import 'package:async/async.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:solian/providers/call.dart';
|
import 'package:solian/providers/call.dart';
|
||||||
@@ -8,6 +9,7 @@ import 'package:solian/theme.dart';
|
|||||||
import 'package:solian/widgets/app_bar_leading.dart';
|
import 'package:solian/widgets/app_bar_leading.dart';
|
||||||
import 'package:solian/widgets/chat/call/call_controls.dart';
|
import 'package:solian/widgets/chat/call/call_controls.dart';
|
||||||
import 'package:solian/widgets/chat/call/call_participant.dart';
|
import 'package:solian/widgets/chat/call/call_participant.dart';
|
||||||
|
import 'package:livekit_client/livekit_client.dart' as livekit;
|
||||||
|
|
||||||
class CallScreen extends StatefulWidget {
|
class CallScreen extends StatefulWidget {
|
||||||
const CallScreen({super.key});
|
const CallScreen({super.key});
|
||||||
@@ -16,11 +18,26 @@ class CallScreen extends StatefulWidget {
|
|||||||
State<CallScreen> createState() => _CallScreenState();
|
State<CallScreen> createState() => _CallScreenState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _CallScreenState extends State<CallScreen> {
|
class _CallScreenState extends State<CallScreen> with TickerProviderStateMixin {
|
||||||
Timer? timer;
|
Timer? _timer;
|
||||||
String currentDuration = '00:00:00';
|
String _currentDuration = '00:00:00';
|
||||||
|
|
||||||
String parseDuration() {
|
int _layoutMode = 0;
|
||||||
|
|
||||||
|
bool _showControls = true;
|
||||||
|
CancelableOperation? _hideControlsOperation;
|
||||||
|
|
||||||
|
late final AnimationController _controlsAnimationController =
|
||||||
|
AnimationController(
|
||||||
|
duration: const Duration(milliseconds: 500),
|
||||||
|
vsync: this,
|
||||||
|
);
|
||||||
|
late final Animation<double> _controlsAnimation = CurvedAnimation(
|
||||||
|
parent: _controlsAnimationController,
|
||||||
|
curve: Curves.fastOutSlowIn,
|
||||||
|
);
|
||||||
|
|
||||||
|
String _parseDuration() {
|
||||||
final ChatCallProvider provider = Get.find();
|
final ChatCallProvider provider = Get.find();
|
||||||
if (provider.current.value == null) return '00:00:00';
|
if (provider.current.value == null) return '00:00:00';
|
||||||
Duration duration =
|
Duration duration =
|
||||||
@@ -34,9 +51,141 @@ class _CallScreenState extends State<CallScreen> {
|
|||||||
return formattedTime;
|
return formattedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateDuration() {
|
void _updateDuration() {
|
||||||
setState(() {
|
setState(() {
|
||||||
currentDuration = parseDuration();
|
_currentDuration = _parseDuration();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void _switchLayout() {
|
||||||
|
if (_layoutMode < 1) {
|
||||||
|
setState(() => _layoutMode++);
|
||||||
|
} else {
|
||||||
|
setState(() => _layoutMode = 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _toggleControls() {
|
||||||
|
if (_showControls) {
|
||||||
|
setState(() => _showControls = false);
|
||||||
|
_controlsAnimationController.animateTo(0);
|
||||||
|
_hideControlsOperation?.cancel();
|
||||||
|
} else {
|
||||||
|
setState(() => _showControls = true);
|
||||||
|
_controlsAnimationController.animateTo(1);
|
||||||
|
_planAutoHideControls();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _planAutoHideControls() {
|
||||||
|
_hideControlsOperation = CancelableOperation.fromFuture(
|
||||||
|
Future.delayed(const Duration(seconds: 3), () {
|
||||||
|
if (!mounted) return;
|
||||||
|
if (_showControls) _toggleControls();
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildListLayout() {
|
||||||
|
final ChatCallProvider call = Get.find();
|
||||||
|
return Obx(
|
||||||
|
() => Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||||
|
child: call.focusTrack.value != null
|
||||||
|
? InteractiveParticipantWidget(
|
||||||
|
isFixedAvatar: false,
|
||||||
|
participant: call.focusTrack.value!,
|
||||||
|
onTap: () {},
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
top: 0,
|
||||||
|
child: SizedBox(
|
||||||
|
height: 128,
|
||||||
|
child: ListView.builder(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemCount: math.max(0, call.participantTracks.length),
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
final track = call.participantTracks[index];
|
||||||
|
if (track.participant.sid ==
|
||||||
|
call.focusTrack.value?.participant.sid) {
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 8, left: 8),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
|
child: InteractiveParticipantWidget(
|
||||||
|
isFixedAvatar: true,
|
||||||
|
width: 120,
|
||||||
|
height: 120,
|
||||||
|
color: Theme.of(context).cardColor,
|
||||||
|
participant: track,
|
||||||
|
onTap: () {
|
||||||
|
if (track.participant.sid !=
|
||||||
|
call.focusTrack.value?.participant.sid) {
|
||||||
|
call.changeFocusTrack(track);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildGridLayout() {
|
||||||
|
final ChatCallProvider call = Get.find();
|
||||||
|
return LayoutBuilder(builder: (context, constraints) {
|
||||||
|
double screenWidth = constraints.maxWidth;
|
||||||
|
double screenHeight = constraints.maxHeight;
|
||||||
|
|
||||||
|
int columns = (math.sqrt(call.participantTracks.length)).ceil();
|
||||||
|
int rows = (call.participantTracks.length / columns).ceil();
|
||||||
|
|
||||||
|
double tileWidth = screenWidth / columns;
|
||||||
|
double tileHeight = screenHeight / rows;
|
||||||
|
|
||||||
|
return Obx(
|
||||||
|
() => GridView.builder(
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: columns,
|
||||||
|
childAspectRatio: tileWidth / tileHeight,
|
||||||
|
crossAxisSpacing: 8,
|
||||||
|
mainAxisSpacing: 8,
|
||||||
|
),
|
||||||
|
itemCount: math.max(0, call.participantTracks.length),
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
final track = call.participantTracks[index];
|
||||||
|
return Card(
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
|
child: InteractiveParticipantWidget(
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||||
|
participant: track,
|
||||||
|
onTap: () {
|
||||||
|
if (track.participant.sid !=
|
||||||
|
call.focusTrack.value?.participant.sid) {
|
||||||
|
call.changeFocusTrack(track);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
).paddingAll(8);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +194,18 @@ class _CallScreenState extends State<CallScreen> {
|
|||||||
Get.find<ChatCallProvider>().setupRoom();
|
Get.find<ChatCallProvider>().setupRoom();
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
timer = Timer.periodic(const Duration(seconds: 1), (_) => updateDuration());
|
_updateDuration();
|
||||||
|
_planAutoHideControls();
|
||||||
|
_timer = Timer.periodic(
|
||||||
|
const Duration(seconds: 1),
|
||||||
|
(_) => _updateDuration(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_controlsAnimationController.dispose();
|
||||||
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -68,80 +228,140 @@ class _CallScreenState extends State<CallScreen> {
|
|||||||
),
|
),
|
||||||
const TextSpan(text: '\n'),
|
const TextSpan(text: '\n'),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: currentDuration,
|
text: _currentDuration,
|
||||||
style: Theme.of(context).textTheme.bodySmall,
|
style: Theme.of(context).textTheme.bodySmall,
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Obx(
|
child: GestureDetector(
|
||||||
() => Stack(
|
behavior: HitTestBehavior.translucent,
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Column(
|
SizeTransition(
|
||||||
children: [
|
sizeFactor: _controlsAnimation,
|
||||||
Expanded(
|
axis: Axis.vertical,
|
||||||
child: Container(
|
|
||||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
|
||||||
child: provider.focusTrack.value != null
|
|
||||||
? InteractiveParticipantWidget(
|
|
||||||
isFixed: false,
|
|
||||||
participant: provider.focusTrack.value!,
|
|
||||||
onTap: () {},
|
|
||||||
)
|
|
||||||
: const SizedBox(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (provider.room.localParticipant != null)
|
|
||||||
ControlsWidget(
|
|
||||||
provider.room,
|
|
||||||
provider.room.localParticipant!,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
top: 0,
|
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 128,
|
width: MediaQuery.of(context).size.width,
|
||||||
child: ListView.builder(
|
height: 64,
|
||||||
scrollDirection: Axis.horizontal,
|
child: Row(
|
||||||
itemCount: math.max(0, provider.participantTracks.length),
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
final track = provider.participantTracks[index];
|
children: [
|
||||||
if (track.participant.sid ==
|
Builder(builder: (context) {
|
||||||
provider.focusTrack.value?.participant.sid) {
|
final call = Get.find<ChatCallProvider>();
|
||||||
return Container();
|
final connectionQuality =
|
||||||
}
|
call.room.localParticipant?.connectionQuality ??
|
||||||
|
livekit.ConnectionQuality.unknown;
|
||||||
return Padding(
|
return Expanded(
|
||||||
padding: const EdgeInsets.only(top: 8, left: 8),
|
child: Column(
|
||||||
child: ClipRRect(
|
mainAxisSize: MainAxisSize.min,
|
||||||
borderRadius:
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
const BorderRadius.all(Radius.circular(8)),
|
children: [
|
||||||
child: InteractiveParticipantWidget(
|
Row(
|
||||||
isFixed: true,
|
children: [
|
||||||
width: 120,
|
Text(call.room.serverRegion ?? 'unknown'),
|
||||||
height: 120,
|
const SizedBox(width: 6),
|
||||||
color: Theme.of(context).cardColor,
|
Text(call.room.serverVersion ?? 'unknown')
|
||||||
participant: track,
|
],
|
||||||
onTap: () {
|
),
|
||||||
if (track.participant.sid !=
|
Row(
|
||||||
provider
|
children: [
|
||||||
.focusTrack.value?.participant.sid) {
|
Text(
|
||||||
provider.changeFocusTrack(track);
|
{
|
||||||
}
|
livekit.ConnectionState.disconnected:
|
||||||
},
|
'callStatusDisconnected'.tr,
|
||||||
|
livekit.ConnectionState.connected:
|
||||||
|
'callStatusConnected'.tr,
|
||||||
|
livekit.ConnectionState.connecting:
|
||||||
|
'callStatusConnecting'.tr,
|
||||||
|
livekit.ConnectionState.reconnecting:
|
||||||
|
'callStatusReconnecting'.tr,
|
||||||
|
}[call.room.connectionState]!,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
if (connectionQuality !=
|
||||||
|
livekit.ConnectionQuality.unknown)
|
||||||
|
Icon(
|
||||||
|
{
|
||||||
|
livekit.ConnectionQuality.excellent:
|
||||||
|
Icons.signal_cellular_alt,
|
||||||
|
livekit.ConnectionQuality.good:
|
||||||
|
Icons.signal_cellular_alt_2_bar,
|
||||||
|
livekit.ConnectionQuality.poor:
|
||||||
|
Icons.signal_cellular_alt_1_bar,
|
||||||
|
}[connectionQuality],
|
||||||
|
color: {
|
||||||
|
livekit.ConnectionQuality.excellent:
|
||||||
|
Colors.green,
|
||||||
|
livekit.ConnectionQuality.good:
|
||||||
|
Colors.orange,
|
||||||
|
livekit.ConnectionQuality.poor:
|
||||||
|
Colors.red,
|
||||||
|
}[connectionQuality],
|
||||||
|
size: 16,
|
||||||
|
)
|
||||||
|
else
|
||||||
|
const SizedBox(
|
||||||
|
width: 12,
|
||||||
|
height: 12,
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
color: Colors.white,
|
||||||
|
strokeWidth: 2,
|
||||||
|
),
|
||||||
|
).paddingAll(3),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
}),
|
||||||
|
IconButton(
|
||||||
|
icon: _layoutMode == 0
|
||||||
|
? const Icon(Icons.view_list)
|
||||||
|
: const Icon(Icons.grid_view),
|
||||||
|
onPressed: () {
|
||||||
|
_switchLayout();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).paddingOnly(left: 20, right: 16),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Material(
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
|
elevation: 2,
|
||||||
|
child: Builder(
|
||||||
|
builder: (context) {
|
||||||
|
switch (_layoutMode) {
|
||||||
|
case 1:
|
||||||
|
return _buildGridLayout();
|
||||||
|
default:
|
||||||
|
return _buildListLayout();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (provider.room.localParticipant != null)
|
||||||
|
SizeTransition(
|
||||||
|
sizeFactor: _controlsAnimation,
|
||||||
|
axis: Axis.vertical,
|
||||||
|
child: SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
child: ControlsWidget(
|
||||||
|
provider.room,
|
||||||
|
provider.room.localParticipant!,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
onTap: () {
|
||||||
|
_toggleControls();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -150,16 +370,16 @@ class _CallScreenState extends State<CallScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void deactivate() {
|
void deactivate() {
|
||||||
timer?.cancel();
|
_timer?.cancel();
|
||||||
timer = null;
|
_timer = null;
|
||||||
super.deactivate();
|
super.deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void activate() {
|
void activate() {
|
||||||
timer ??= Timer.periodic(
|
_timer ??= Timer.periodic(
|
||||||
const Duration(seconds: 1),
|
const Duration(seconds: 1),
|
||||||
(_) => updateDuration(),
|
(_) => _updateDuration(),
|
||||||
);
|
);
|
||||||
super.activate();
|
super.activate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import 'package:solian/models/channel.dart';
|
|||||||
import 'package:solian/models/event.dart';
|
import 'package:solian/models/event.dart';
|
||||||
import 'package:solian/models/packet.dart';
|
import 'package:solian/models/packet.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
import 'package:solian/providers/call.dart';
|
|
||||||
import 'package:solian/providers/content/channel.dart';
|
import 'package:solian/providers/content/channel.dart';
|
||||||
import 'package:solian/providers/websocket.dart';
|
import 'package:solian/providers/websocket.dart';
|
||||||
import 'package:solian/router.dart';
|
import 'package:solian/router.dart';
|
||||||
@@ -19,9 +18,8 @@ import 'package:solian/screens/channel/channel_detail.dart';
|
|||||||
import 'package:solian/theme.dart';
|
import 'package:solian/theme.dart';
|
||||||
import 'package:solian/widgets/app_bar_leading.dart';
|
import 'package:solian/widgets/app_bar_leading.dart';
|
||||||
import 'package:solian/widgets/app_bar_title.dart';
|
import 'package:solian/widgets/app_bar_title.dart';
|
||||||
import 'package:solian/widgets/chat/call/call_prejoin.dart';
|
import 'package:solian/widgets/channel/channel_call_indicator.dart';
|
||||||
import 'package:solian/widgets/chat/call/chat_call_action.dart';
|
import 'package:solian/widgets/chat/call/chat_call_action.dart';
|
||||||
import 'package:solian/widgets/chat/chat_event.dart';
|
|
||||||
import 'package:solian/widgets/chat/chat_event_list.dart';
|
import 'package:solian/widgets/chat/chat_event_list.dart';
|
||||||
import 'package:solian/widgets/chat/chat_message_input.dart';
|
import 'package:solian/widgets/chat/chat_message_input.dart';
|
||||||
import 'package:solian/widgets/current_state_action.dart';
|
import 'package:solian/widgets/current_state_action.dart';
|
||||||
@@ -40,7 +38,10 @@ class ChannelChatScreen extends StatefulWidget {
|
|||||||
State<ChannelChatScreen> createState() => _ChannelChatScreenState();
|
State<ChannelChatScreen> createState() => _ChannelChatScreenState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
class _ChannelChatScreenState extends State<ChannelChatScreen>
|
||||||
|
with WidgetsBindingObserver {
|
||||||
|
DateTime? _isOutOfSyncSince;
|
||||||
|
|
||||||
bool _isBusy = false;
|
bool _isBusy = false;
|
||||||
int? _accountId;
|
int? _accountId;
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||||||
|
|
||||||
late final ChatEventController _chatController;
|
late final ChatEventController _chatController;
|
||||||
|
|
||||||
getChannel({String? alias}) async {
|
_getChannel({String? alias}) async {
|
||||||
final ChannelProvider provider = Get.find();
|
final ChannelProvider provider = Get.find();
|
||||||
|
|
||||||
setState(() => _isBusy = true);
|
setState(() => _isBusy = true);
|
||||||
@@ -80,7 +81,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||||||
setState(() => _isBusy = false);
|
setState(() => _isBusy = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
getOngoingCall() async {
|
_getOngoingCall() async {
|
||||||
final ChannelProvider provider = Get.find();
|
final ChannelProvider provider = Get.find();
|
||||||
|
|
||||||
setState(() => _isBusy = true);
|
setState(() => _isBusy = true);
|
||||||
@@ -100,7 +101,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||||||
setState(() => _isBusy = false);
|
setState(() => _isBusy = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void listenMessages() {
|
void _listenMessages() {
|
||||||
final WebSocketProvider provider = Get.find();
|
final WebSocketProvider provider = Get.find();
|
||||||
_subscription = provider.stream.stream.listen((event) {
|
_subscription = provider.stream.stream.listen((event) {
|
||||||
switch (event.method) {
|
switch (event.method) {
|
||||||
@@ -110,66 +111,66 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||||||
break;
|
break;
|
||||||
case 'calls.new':
|
case 'calls.new':
|
||||||
final payload = Call.fromJson(event.payload!);
|
final payload = Call.fromJson(event.payload!);
|
||||||
setState(() => _ongoingCall = payload);
|
if (payload.channel.id == _channel!.id) {
|
||||||
|
setState(() => _ongoingCall = payload);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'calls.end':
|
case 'calls.end':
|
||||||
setState(() => _ongoingCall = null);
|
final payload = Call.fromJson(event.payload!);
|
||||||
|
if (payload.channel.id == _channel!.id) {
|
||||||
|
setState(() => _ongoingCall = null);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void showCallPrejoin() {
|
void _keepUpdateWithServer() {
|
||||||
showModalBottomSheet(
|
_getOngoingCall();
|
||||||
useRootNavigator: true,
|
_chatController.getEvents(_channel!, widget.realm);
|
||||||
context: context,
|
setState(() => _isOutOfSyncSince = null);
|
||||||
builder: (context) => ChatCallPrejoinPopup(
|
|
||||||
ongoingCall: _ongoingCall!,
|
|
||||||
channel: _channel!,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Event? _messageToReplying;
|
Event? _messageToReplying;
|
||||||
Event? _messageToEditing;
|
Event? _messageToEditing;
|
||||||
|
|
||||||
Widget buildHistoryBody(Event item, {bool isMerged = false}) {
|
@override
|
||||||
return ChatEvent(
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||||
key: Key('m${item.uuid}'),
|
switch (state) {
|
||||||
item: item,
|
case AppLifecycleState.resumed:
|
||||||
isMerged: isMerged,
|
if (_isOutOfSyncSince == null) break;
|
||||||
chatController: _chatController,
|
if (DateTime.now().difference(_isOutOfSyncSince!).inSeconds < 60) break;
|
||||||
);
|
_keepUpdateWithServer();
|
||||||
|
break;
|
||||||
|
case AppLifecycleState.paused:
|
||||||
|
if (mounted) {
|
||||||
|
setState(() => _isOutOfSyncSince = DateTime.now());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
WidgetsBinding.instance.addObserver(this);
|
||||||
|
|
||||||
_accountId = Get.find<AuthProvider>().userProfile.value!['id'];
|
_accountId = Get.find<AuthProvider>().userProfile.value!['id'];
|
||||||
|
|
||||||
_chatController = ChatEventController();
|
_chatController = ChatEventController();
|
||||||
_chatController.initialize();
|
_chatController.initialize();
|
||||||
|
|
||||||
getChannel().then((_) {
|
_getOngoingCall();
|
||||||
|
_getChannel().then((_) {
|
||||||
_chatController.getEvents(_channel!, widget.realm);
|
_chatController.getEvents(_channel!, widget.realm);
|
||||||
listenMessages();
|
_listenMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
getOngoingCall();
|
|
||||||
|
|
||||||
super.initState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (_isBusy || _channel == null) {
|
|
||||||
return Material(
|
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: const Center(
|
|
||||||
child: CircularProgressIndicator(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
String title = _channel?.name ?? 'loading'.tr;
|
String title = _channel?.name ?? 'loading'.tr;
|
||||||
String? placeholder;
|
String? placeholder;
|
||||||
|
|
||||||
@@ -183,8 +184,6 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final ChatCallProvider call = Get.find();
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
leading: AppBarLeadingButton.adaptive(context),
|
leading: AppBarLeadingButton.adaptive(context),
|
||||||
@@ -195,7 +194,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||||||
actions: [
|
actions: [
|
||||||
const BackgroundStateWidget(),
|
const BackgroundStateWidget(),
|
||||||
Builder(builder: (context) {
|
Builder(builder: (context) {
|
||||||
if (_isBusy) return const SizedBox();
|
if (_isBusy || _channel == null) return const SizedBox();
|
||||||
|
|
||||||
return ChatCallButton(
|
return ChatCallButton(
|
||||||
realm: _channel!.realm,
|
realm: _channel!.realm,
|
||||||
channel: _channel!,
|
channel: _channel!,
|
||||||
@@ -205,6 +205,8 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.more_vert),
|
icon: const Icon(Icons.more_vert),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
if (_channel == null) return;
|
||||||
|
|
||||||
AppRouter.instance
|
AppRouter.instance
|
||||||
.pushNamed(
|
.pushNamed(
|
||||||
'channelDetail',
|
'channelDetail',
|
||||||
@@ -219,7 +221,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||||||
if (value == false) AppRouter.instance.pop();
|
if (value == false) AppRouter.instance.pop();
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
final resp = Channel.fromJson(value as Map<String, dynamic>);
|
final resp = Channel.fromJson(value as Map<String, dynamic>);
|
||||||
getChannel(alias: resp.alias);
|
_getChannel(alias: resp.alias);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -229,89 +231,94 @@ class _ChannelChatScreenState extends State<ChannelChatScreen> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Builder(builder: (context) {
|
||||||
children: [
|
if (_isBusy || _channel == null) {
|
||||||
if (_ongoingCall != null)
|
return const Center(
|
||||||
MaterialBanner(
|
child: CircularProgressIndicator(),
|
||||||
padding: const EdgeInsets.only(left: 16, top: 4, bottom: 4),
|
);
|
||||||
leading: const Icon(Icons.call_received),
|
}
|
||||||
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
|
|
||||||
dividerColor: Colors.transparent,
|
return Column(
|
||||||
content: Text('callOngoing'.tr),
|
children: [
|
||||||
actions: [
|
if (_ongoingCall != null)
|
||||||
Obx(() {
|
ChannelCallIndicator(
|
||||||
if (call.current.value == null) {
|
channel: _channel!,
|
||||||
return TextButton(
|
ongoingCall: _ongoingCall!,
|
||||||
onPressed: showCallPrejoin,
|
),
|
||||||
child: Text('callJoin'.tr),
|
Expanded(
|
||||||
);
|
child: ChatEventList(
|
||||||
} else if (call.channel.value?.id == _channel?.id) {
|
scope: widget.realm,
|
||||||
return TextButton(
|
channel: _channel!,
|
||||||
onPressed: () => call.gotoScreen(context),
|
chatController: _chatController,
|
||||||
child: Text('callResume'.tr),
|
onEdit: (item) {
|
||||||
);
|
setState(() => _messageToEditing = item);
|
||||||
} else {
|
},
|
||||||
return TextButton(
|
onReply: (item) {
|
||||||
onPressed: null,
|
setState(() => _messageToReplying = item);
|
||||||
child: Text('callJoin'.tr),
|
},
|
||||||
);
|
),
|
||||||
}
|
|
||||||
})
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
Expanded(
|
if (_isOutOfSyncSince != null)
|
||||||
child: ChatEventList(
|
ListTile(
|
||||||
scope: widget.realm,
|
contentPadding: const EdgeInsets.only(left: 16, right: 8),
|
||||||
channel: _channel!,
|
tileColor: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
chatController: _chatController,
|
leading: const Icon(Icons.history_toggle_off),
|
||||||
onEdit: (item) {
|
title: Text('messageOutOfSync'.tr),
|
||||||
setState(() => _messageToEditing = item);
|
subtitle: Text('messageOutOfSyncCaption'.tr),
|
||||||
},
|
trailing: IconButton(
|
||||||
onReply: (item) {
|
icon: const Icon(Icons.close),
|
||||||
setState(() => _messageToReplying = item);
|
onPressed: () {
|
||||||
},
|
setState(() => _isOutOfSyncSince = null);
|
||||||
),
|
|
||||||
),
|
|
||||||
Obx(() {
|
|
||||||
if (_chatController.isLoading.isTrue) {
|
|
||||||
return const LinearProgressIndicator().animate().slideY();
|
|
||||||
} else {
|
|
||||||
return const SizedBox();
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
ClipRect(
|
|
||||||
child: BackdropFilter(
|
|
||||||
filter: ImageFilter.blur(sigmaX: 50, sigmaY: 50),
|
|
||||||
child: SafeArea(
|
|
||||||
child: ChatMessageInput(
|
|
||||||
edit: _messageToEditing,
|
|
||||||
reply: _messageToReplying,
|
|
||||||
realm: widget.realm,
|
|
||||||
placeholder: placeholder,
|
|
||||||
channel: _channel!,
|
|
||||||
onSent: (Event item) {
|
|
||||||
setState(() {
|
|
||||||
_chatController.addPendingEvent(item);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
onReset: () {
|
|
||||||
setState(() {
|
|
||||||
_messageToReplying = null;
|
|
||||||
_messageToEditing = null;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
onTap: _isBusy
|
||||||
|
? null
|
||||||
|
: () {
|
||||||
|
_keepUpdateWithServer();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Obx(() {
|
||||||
|
if (_chatController.isLoading.isTrue) {
|
||||||
|
return const LinearProgressIndicator().animate().slideY();
|
||||||
|
} else {
|
||||||
|
return const SizedBox();
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
ClipRect(
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 50, sigmaY: 50),
|
||||||
|
child: SafeArea(
|
||||||
|
child: ChatMessageInput(
|
||||||
|
edit: _messageToEditing,
|
||||||
|
reply: _messageToReplying,
|
||||||
|
realm: widget.realm,
|
||||||
|
placeholder: placeholder,
|
||||||
|
channel: _channel!,
|
||||||
|
onSent: (Event item) {
|
||||||
|
setState(() {
|
||||||
|
_chatController.addPendingEvent(item);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onReset: () {
|
||||||
|
setState(() {
|
||||||
|
_messageToReplying = null;
|
||||||
|
_messageToEditing = null;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
);
|
||||||
),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_subscription?.cancel();
|
_subscription?.cancel();
|
||||||
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class _DraftBoxScreenState extends State<DraftBoxScreen> {
|
|||||||
final PagingController<int, Post> _pagingController =
|
final PagingController<int, Post> _pagingController =
|
||||||
PagingController(firstPageKey: 0);
|
PagingController(firstPageKey: 0);
|
||||||
|
|
||||||
getPosts(int pageKey) async {
|
_getPosts(int pageKey) async {
|
||||||
final PostProvider provider = Get.find();
|
final PostProvider provider = Get.find();
|
||||||
|
|
||||||
Response resp;
|
Response resp;
|
||||||
@@ -49,7 +49,7 @@ class _DraftBoxScreenState extends State<DraftBoxScreen> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_pagingController.addPageRequestListener(getPosts);
|
_pagingController.addPageRequestListener(_getPosts);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -76,6 +76,9 @@ class _DraftBoxScreenState extends State<DraftBoxScreen> {
|
|||||||
itemBuilder: (context, item, index) {
|
itemBuilder: (context, item, index) {
|
||||||
return PostOwnedListEntry(
|
return PostOwnedListEntry(
|
||||||
item: item,
|
item: item,
|
||||||
|
isFullContent: true,
|
||||||
|
backgroundColor:
|
||||||
|
Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
@@ -85,7 +88,13 @@ class _DraftBoxScreenState extends State<DraftBoxScreen> {
|
|||||||
noReact: true,
|
noReact: true,
|
||||||
),
|
),
|
||||||
).then((value) {
|
).then((value) {
|
||||||
if (value != null) _pagingController.refresh();
|
if (value is Future) {
|
||||||
|
value.then((_) {
|
||||||
|
_pagingController.refresh();
|
||||||
|
});
|
||||||
|
} else if (value != null) {
|
||||||
|
_pagingController.refresh();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
).paddingOnly(left: 12, right: 12, bottom: 4);
|
).paddingOnly(left: 12, right: 12, bottom: 4);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
||||||
import 'package:solian/models/pagination.dart';
|
import 'package:solian/models/pagination.dart';
|
||||||
import 'package:solian/providers/content/posts.dart';
|
import 'package:solian/providers/content/posts.dart';
|
||||||
import 'package:solian/widgets/feed/feed_list.dart';
|
import 'package:solian/widgets/posts/post_warped_list.dart';
|
||||||
|
|
||||||
import '../../models/post.dart';
|
import '../../models/post.dart';
|
||||||
|
|
||||||
@@ -77,7 +77,10 @@ class _FeedSearchScreenState extends State<FeedSearchScreen> {
|
|||||||
onRefresh: () => Future.sync(() => _pagingController.refresh()),
|
onRefresh: () => Future.sync(() => _pagingController.refresh()),
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
FeedListWidget(controller: _pagingController),
|
PostWarpedListWidget(
|
||||||
|
controller: _pagingController,
|
||||||
|
onUpdate: () => _pagingController.refresh(),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ import 'package:solian/providers/auth.dart';
|
|||||||
import 'package:solian/router.dart';
|
import 'package:solian/router.dart';
|
||||||
import 'package:solian/screens/account/notification.dart';
|
import 'package:solian/screens/account/notification.dart';
|
||||||
import 'package:solian/theme.dart';
|
import 'package:solian/theme.dart';
|
||||||
|
import 'package:solian/widgets/account/signin_required_overlay.dart';
|
||||||
import 'package:solian/widgets/app_bar_title.dart';
|
import 'package:solian/widgets/app_bar_title.dart';
|
||||||
import 'package:solian/widgets/current_state_action.dart';
|
import 'package:solian/widgets/current_state_action.dart';
|
||||||
import 'package:solian/widgets/app_bar_leading.dart';
|
import 'package:solian/widgets/app_bar_leading.dart';
|
||||||
import 'package:solian/widgets/feed/feed_list.dart';
|
|
||||||
import 'package:solian/widgets/posts/post_shuffle_swiper.dart';
|
import 'package:solian/widgets/posts/post_shuffle_swiper.dart';
|
||||||
|
import 'package:solian/widgets/posts/post_warped_list.dart';
|
||||||
|
|
||||||
class HomeScreen extends StatefulWidget {
|
class HomeScreen extends StatefulWidget {
|
||||||
const HomeScreen({super.key});
|
const HomeScreen({super.key});
|
||||||
@@ -27,32 +28,37 @@ class _HomeScreenState extends State<HomeScreen>
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_postController = PostListController();
|
_postController = PostListController();
|
||||||
_tabController = TabController(length: 2, vsync: this);
|
_tabController = TabController(length: 3, vsync: this);
|
||||||
_tabController.addListener(() {
|
_tabController.addListener(() {
|
||||||
switch (_tabController.index) {
|
if (_postController.mode.value == _tabController.index) return;
|
||||||
case 0:
|
_postController.mode.value = _tabController.index;
|
||||||
case 1:
|
_postController.reloadAllOver();
|
||||||
if (_postController.mode.value == _tabController.index) return;
|
|
||||||
_postController.mode.value = _tabController.index;
|
|
||||||
_postController.reloadAllOver();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final AuthProvider auth = Get.find();
|
||||||
|
|
||||||
return Material(
|
return Material(
|
||||||
color: Theme.of(context).colorScheme.surface,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
child: const Icon(Icons.add),
|
child: const Icon(Icons.add),
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
showModalBottomSheet(
|
final value = await showModalBottomSheet(
|
||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => const PostCreatePopup(),
|
builder: (context) => const PostCreatePopup(),
|
||||||
);
|
);
|
||||||
|
if (value is Future) {
|
||||||
|
value.then((_) {
|
||||||
|
_postController.reloadAllOver();
|
||||||
|
});
|
||||||
|
} else if (value != null) {
|
||||||
|
_postController.reloadAllOver();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
body: NestedScrollView(
|
body: NestedScrollView(
|
||||||
@@ -75,6 +81,7 @@ class _HomeScreenState extends State<HomeScreen>
|
|||||||
controller: _tabController,
|
controller: _tabController,
|
||||||
tabs: [
|
tabs: [
|
||||||
Tab(text: 'postListNews'.tr),
|
Tab(text: 'postListNews'.tr),
|
||||||
|
Tab(text: 'postListFriends'.tr),
|
||||||
Tab(text: 'postListShuffle'.tr),
|
Tab(text: 'postListShuffle'.tr),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -95,11 +102,29 @@ class _HomeScreenState extends State<HomeScreen>
|
|||||||
RefreshIndicator(
|
RefreshIndicator(
|
||||||
onRefresh: () => _postController.reloadAllOver(),
|
onRefresh: () => _postController.reloadAllOver(),
|
||||||
child: CustomScrollView(slivers: [
|
child: CustomScrollView(slivers: [
|
||||||
FeedListWidget(
|
PostWarpedListWidget(
|
||||||
controller: _postController.pagingController,
|
controller: _postController.pagingController,
|
||||||
|
onUpdate: () => _postController.reloadAllOver(),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
|
Obx(() {
|
||||||
|
if (auth.isAuthorized.value) {
|
||||||
|
return RefreshIndicator(
|
||||||
|
onRefresh: () => _postController.reloadAllOver(),
|
||||||
|
child: CustomScrollView(slivers: [
|
||||||
|
PostWarpedListWidget(
|
||||||
|
controller: _postController.pagingController,
|
||||||
|
onUpdate: () => _postController.reloadAllOver(),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return SigninRequiredOverlay(
|
||||||
|
onSignedIn: () => _postController.reloadAllOver(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}),
|
||||||
PostShuffleSwiper(controller: _postController),
|
PostShuffleSwiper(controller: _postController),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@@ -118,12 +143,10 @@ class _HomeScreenState extends State<HomeScreen>
|
|||||||
|
|
||||||
class PostCreatePopup extends StatelessWidget {
|
class PostCreatePopup extends StatelessWidget {
|
||||||
final bool hideDraftBox;
|
final bool hideDraftBox;
|
||||||
final Function? onCreated;
|
|
||||||
|
|
||||||
const PostCreatePopup({
|
const PostCreatePopup({
|
||||||
super.key,
|
super.key,
|
||||||
this.hideDraftBox = false,
|
this.hideDraftBox = false,
|
||||||
this.onCreated,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -139,32 +162,40 @@ class PostCreatePopup extends StatelessWidget {
|
|||||||
icon: const Icon(Icons.post_add),
|
icon: const Icon(Icons.post_add),
|
||||||
label: 'postEditorModeStory'.tr,
|
label: 'postEditorModeStory'.tr,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(
|
||||||
AppRouter.instance.pushNamed('postEditor', queryParameters: {
|
context,
|
||||||
'mode': 0.toString(),
|
AppRouter.instance.pushNamed(
|
||||||
}).then((val) {
|
'postEditor',
|
||||||
if (val != null && onCreated != null) onCreated!();
|
queryParameters: {
|
||||||
});
|
'mode': 0.toString(),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
icon: const Icon(Icons.description),
|
icon: const Icon(Icons.description),
|
||||||
label: 'postEditorModeArticle'.tr,
|
label: 'postEditorModeArticle'.tr,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(
|
||||||
AppRouter.instance.pushNamed('postEditor', queryParameters: {
|
context,
|
||||||
'mode': 1.toString(),
|
AppRouter.instance.pushNamed(
|
||||||
}).then((val) {
|
'postEditor',
|
||||||
if (val != null && onCreated != null) onCreated!();
|
queryParameters: {
|
||||||
});
|
'mode': 1.toString(),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
icon: const Icon(Icons.drafts),
|
icon: const Icon(Icons.drafts),
|
||||||
label: 'draftBoxOpen'.tr,
|
label: 'draftBoxOpen'.tr,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(
|
||||||
AppRouter.instance.pushNamed('draftBox');
|
context,
|
||||||
|
AppRouter.instance.pushNamed('draftBox'),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
@@ -194,7 +225,12 @@ class PostCreatePopup extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
x.icon,
|
x.icon,
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Text(x.label),
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
x.label,
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
).paddingAll(18),
|
).paddingAll(18),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,14 +3,18 @@ import 'package:get/get.dart';
|
|||||||
import 'package:solian/exts.dart';
|
import 'package:solian/exts.dart';
|
||||||
import 'package:solian/models/post.dart';
|
import 'package:solian/models/post.dart';
|
||||||
import 'package:solian/providers/content/posts.dart';
|
import 'package:solian/providers/content/posts.dart';
|
||||||
import 'package:solian/widgets/sized_container.dart';
|
|
||||||
import 'package:solian/widgets/posts/post_item.dart';
|
import 'package:solian/widgets/posts/post_item.dart';
|
||||||
import 'package:solian/widgets/posts/post_replies.dart';
|
import 'package:solian/widgets/posts/post_replies.dart';
|
||||||
|
|
||||||
class PostDetailScreen extends StatefulWidget {
|
class PostDetailScreen extends StatefulWidget {
|
||||||
final String id;
|
final String id;
|
||||||
|
final Post? post;
|
||||||
|
|
||||||
const PostDetailScreen({super.key, required this.id});
|
const PostDetailScreen({
|
||||||
|
super.key,
|
||||||
|
required this.id,
|
||||||
|
this.post,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<PostDetailScreen> createState() => _PostDetailScreenState();
|
State<PostDetailScreen> createState() => _PostDetailScreenState();
|
||||||
@@ -20,6 +24,11 @@ class _PostDetailScreenState extends State<PostDetailScreen> {
|
|||||||
Post? item;
|
Post? item;
|
||||||
|
|
||||||
Future<Post?> getDetail() async {
|
Future<Post?> getDetail() async {
|
||||||
|
if (widget.post != null) {
|
||||||
|
item = widget.post;
|
||||||
|
return widget.post;
|
||||||
|
}
|
||||||
|
|
||||||
final PostProvider provider = Get.find();
|
final PostProvider provider = Get.find();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -48,14 +57,14 @@ class _PostDetailScreenState extends State<PostDetailScreen> {
|
|||||||
return CustomScrollView(
|
return CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: CenteredContainer(
|
child: PostItem(
|
||||||
child: PostItem(
|
item: item!,
|
||||||
item: item!,
|
isClickable: false,
|
||||||
isClickable: true,
|
isOverrideEmbedClickable: true,
|
||||||
isFullDate: true,
|
isFullDate: true,
|
||||||
isShowReply: false,
|
isFullContent: true,
|
||||||
isContentSelectable: true,
|
isShowReply: false,
|
||||||
),
|
isContentSelectable: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
@@ -63,14 +72,12 @@ class _PostDetailScreenState extends State<PostDetailScreen> {
|
|||||||
.paddingOnly(top: 4),
|
.paddingOnly(top: 4),
|
||||||
),
|
),
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: CenteredContainer(
|
child: Align(
|
||||||
child: Align(
|
alignment: Alignment.centerLeft,
|
||||||
alignment: Alignment.centerLeft,
|
child: Text(
|
||||||
child: Text(
|
'postReplies'.tr,
|
||||||
'postReplies'.tr,
|
style: Theme.of(context).textTheme.headlineSmall,
|
||||||
style: Theme.of(context).textTheme.headlineSmall,
|
).paddingOnly(left: 24, right: 24, top: 16),
|
||||||
).paddingOnly(left: 24, right: 24, top: 16),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
PostReplyList(item: item!),
|
PostReplyList(item: item!),
|
||||||
|
|||||||
@@ -3,15 +3,18 @@ import 'package:flutter_animate/flutter_animate.dart';
|
|||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:markdown_toolbar/markdown_toolbar.dart';
|
||||||
import 'package:solian/controllers/post_editor_controller.dart';
|
import 'package:solian/controllers/post_editor_controller.dart';
|
||||||
import 'package:solian/exts.dart';
|
import 'package:solian/exts.dart';
|
||||||
import 'package:solian/models/post.dart';
|
import 'package:solian/models/post.dart';
|
||||||
import 'package:solian/models/realm.dart';
|
import 'package:solian/models/realm.dart';
|
||||||
|
import 'package:solian/providers/attachment_uploader.dart';
|
||||||
import 'package:solian/providers/auth.dart';
|
import 'package:solian/providers/auth.dart';
|
||||||
import 'package:solian/router.dart';
|
import 'package:solian/router.dart';
|
||||||
import 'package:solian/theme.dart';
|
import 'package:solian/theme.dart';
|
||||||
import 'package:solian/widgets/app_bar_leading.dart';
|
import 'package:solian/widgets/app_bar_leading.dart';
|
||||||
import 'package:solian/widgets/app_bar_title.dart';
|
import 'package:solian/widgets/app_bar_title.dart';
|
||||||
|
import 'package:solian/widgets/markdown_text_content.dart';
|
||||||
import 'package:solian/widgets/posts/post_item.dart';
|
import 'package:solian/widgets/posts/post_item.dart';
|
||||||
import 'package:badges/badges.dart' as badges;
|
import 'package:badges/badges.dart' as badges;
|
||||||
|
|
||||||
@@ -21,7 +24,12 @@ class PostPublishArguments {
|
|||||||
final Post? repost;
|
final Post? repost;
|
||||||
final Realm? realm;
|
final Realm? realm;
|
||||||
|
|
||||||
PostPublishArguments({this.edit, this.reply, this.repost, this.realm});
|
PostPublishArguments({
|
||||||
|
this.edit,
|
||||||
|
this.reply,
|
||||||
|
this.repost,
|
||||||
|
this.realm,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
class PostPublishScreen extends StatefulWidget {
|
class PostPublishScreen extends StatefulWidget {
|
||||||
@@ -46,6 +54,7 @@ class PostPublishScreen extends StatefulWidget {
|
|||||||
|
|
||||||
class _PostPublishScreenState extends State<PostPublishScreen> {
|
class _PostPublishScreenState extends State<PostPublishScreen> {
|
||||||
final _editorController = PostEditorController();
|
final _editorController = PostEditorController();
|
||||||
|
final _contentFocusNode = FocusNode();
|
||||||
|
|
||||||
bool _isBusy = false;
|
bool _isBusy = false;
|
||||||
|
|
||||||
@@ -54,6 +63,14 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
if (auth.isAuthorized.isFalse) return;
|
if (auth.isAuthorized.isFalse) return;
|
||||||
if (_editorController.isEmpty) return;
|
if (_editorController.isEmpty) return;
|
||||||
|
|
||||||
|
final AttachmentUploaderController uploader = Get.find();
|
||||||
|
if (uploader.queueOfUpload.any(
|
||||||
|
((x) => x.isUploading),
|
||||||
|
)) {
|
||||||
|
context.showErrorDialog('attachmentUploadInProgress'.tr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setState(() => _isBusy = true);
|
setState(() => _isBusy = true);
|
||||||
|
|
||||||
final client = auth.configureClient('interactive');
|
final client = auth.configureClient('interactive');
|
||||||
@@ -73,6 +90,7 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
if (resp.statusCode != 200) {
|
if (resp.statusCode != 200) {
|
||||||
context.showErrorDialog(resp.bodyString);
|
context.showErrorDialog(resp.bodyString);
|
||||||
} else {
|
} else {
|
||||||
|
_editorController.currentClear();
|
||||||
_editorController.localClear();
|
_editorController.localClear();
|
||||||
AppRouter.instance.pop(resp.body);
|
AppRouter.instance.pop(resp.body);
|
||||||
}
|
}
|
||||||
@@ -80,28 +98,48 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
setState(() => _isBusy = false);
|
setState(() => _isBusy = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void syncWidget() {
|
void _syncWidget() {
|
||||||
_editorController.mode.value = widget.mode;
|
_editorController.mode.value = widget.mode;
|
||||||
if (widget.edit != null) {
|
if (widget.edit != null) {
|
||||||
_editorController.editTarget = widget.edit;
|
_editorController.editTarget = widget.edit;
|
||||||
}
|
}
|
||||||
|
if (widget.realm != null) {
|
||||||
|
_editorController.realmZone.value = widget.realm;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cancelAction() {
|
void _cancelAction() {
|
||||||
|
_editorController.localClear();
|
||||||
AppRouter.instance.pop();
|
AppRouter.instance.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Post? get _editTo => _editorController.editTo.value;
|
||||||
|
|
||||||
|
Post? get _replyTo => _editorController.replyTo.value;
|
||||||
|
|
||||||
|
Post? get _repostTo => _editorController.repostTo.value;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
syncWidget();
|
if (widget.edit == null && widget.reply == null && widget.repost == null) {
|
||||||
|
_editorController.localRead();
|
||||||
|
}
|
||||||
|
if (widget.reply != null) {
|
||||||
|
_editorController.replyTo.value = widget.reply;
|
||||||
|
}
|
||||||
|
if (widget.repost != null) {
|
||||||
|
_editorController.repostTo.value = widget.repost;
|
||||||
|
}
|
||||||
|
_editorController.contentController.addListener(() => setState(() {}));
|
||||||
|
_syncWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final notifyBannerActions = [
|
final notifyBannerActions = [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: cancelAction,
|
onPressed: _cancelAction,
|
||||||
child: Text('cancel'.tr),
|
child: Text('cancel'.tr),
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
@@ -134,13 +172,23 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
ListTile(
|
ListTile(
|
||||||
tileColor: Theme.of(context).colorScheme.surfaceContainerLow,
|
tileColor: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
title: Text(
|
title: Row(
|
||||||
_editorController.title ?? 'title'.tr,
|
children: [
|
||||||
maxLines: 1,
|
Text(
|
||||||
overflow: TextOverflow.ellipsis,
|
_editorController.title ?? 'title'.tr,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
if (_editorController.aliasController.text.isNotEmpty)
|
||||||
|
Badge(
|
||||||
|
label: Text('#${_editorController.aliasController.text}'),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
_editorController.description ?? 'description'.tr,
|
_editorController.description ?? 'description'.tr,
|
||||||
@@ -162,88 +210,170 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
if (_editTo != null && _editTo!.isDraft != true)
|
||||||
child: ListView(
|
MaterialBanner(
|
||||||
|
leading: const Icon(Icons.edit),
|
||||||
|
leadingPadding: const EdgeInsets.only(left: 10, right: 20),
|
||||||
|
dividerColor: Colors.transparent,
|
||||||
|
content: Text('postEditingNotify'.tr),
|
||||||
|
actions: notifyBannerActions,
|
||||||
|
),
|
||||||
|
if (_replyTo != null)
|
||||||
|
ExpansionTile(
|
||||||
|
leading: const FaIcon(
|
||||||
|
FontAwesomeIcons.reply,
|
||||||
|
size: 18,
|
||||||
|
).paddingOnly(left: 2),
|
||||||
|
title: Text('postReplyingNotify'.trParams(
|
||||||
|
{'username': '@${widget.reply!.author.name}'},
|
||||||
|
)),
|
||||||
|
collapsedBackgroundColor:
|
||||||
|
Theme.of(context).colorScheme.surfaceContainer,
|
||||||
children: [
|
children: [
|
||||||
if (_isBusy)
|
|
||||||
const LinearProgressIndicator().animate().scaleX(),
|
|
||||||
if (widget.edit != null && widget.edit!.isDraft != true)
|
|
||||||
MaterialBanner(
|
|
||||||
leading: const Icon(Icons.edit),
|
|
||||||
leadingPadding:
|
|
||||||
const EdgeInsets.only(left: 10, right: 20),
|
|
||||||
dividerColor: Colors.transparent,
|
|
||||||
content: Text('postEditingNotify'.tr),
|
|
||||||
actions: notifyBannerActions,
|
|
||||||
),
|
|
||||||
if (widget.reply != null)
|
|
||||||
ExpansionTile(
|
|
||||||
leading: const FaIcon(
|
|
||||||
FontAwesomeIcons.reply,
|
|
||||||
size: 18,
|
|
||||||
).paddingOnly(left: 2),
|
|
||||||
title: Text('postReplyingNotify'.trParams(
|
|
||||||
{'username': '@${widget.reply!.author.name}'},
|
|
||||||
)),
|
|
||||||
collapsedBackgroundColor:
|
|
||||||
Theme.of(context).colorScheme.surfaceContainer,
|
|
||||||
children: [
|
|
||||||
PostItem(
|
|
||||||
item: widget.reply!,
|
|
||||||
isReactable: false,
|
|
||||||
).paddingOnly(bottom: 8),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
if (widget.repost != null)
|
|
||||||
ExpansionTile(
|
|
||||||
leading: const FaIcon(
|
|
||||||
FontAwesomeIcons.retweet,
|
|
||||||
size: 18,
|
|
||||||
).paddingOnly(left: 2),
|
|
||||||
title: Text('postRepostingNotify'.trParams(
|
|
||||||
{'username': '@${widget.repost!.author.name}'},
|
|
||||||
)),
|
|
||||||
collapsedBackgroundColor:
|
|
||||||
Theme.of(context).colorScheme.surfaceContainer,
|
|
||||||
children: [
|
|
||||||
PostItem(
|
|
||||||
item: widget.repost!,
|
|
||||||
isReactable: false,
|
|
||||||
).paddingOnly(bottom: 8),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
if (widget.realm != null)
|
|
||||||
MaterialBanner(
|
|
||||||
leading: const Icon(Icons.group),
|
|
||||||
leadingPadding:
|
|
||||||
const EdgeInsets.only(left: 10, right: 20),
|
|
||||||
dividerColor: Colors.transparent,
|
|
||||||
content: Text(
|
|
||||||
'postInRealmNotify'
|
|
||||||
.trParams({'realm': '#${widget.realm!.alias}'}),
|
|
||||||
),
|
|
||||||
actions: notifyBannerActions,
|
|
||||||
),
|
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
constraints: const BoxConstraints(maxHeight: 280),
|
||||||
horizontal: 16,
|
child: SingleChildScrollView(
|
||||||
vertical: 8,
|
child: PostItem(
|
||||||
),
|
item: _replyTo!,
|
||||||
child: TextField(
|
isReactable: false,
|
||||||
maxLines: null,
|
).paddingOnly(bottom: 8),
|
||||||
autofocus: true,
|
|
||||||
autocorrect: true,
|
|
||||||
keyboardType: TextInputType.multiline,
|
|
||||||
controller: _editorController.contentController,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
border: InputBorder.none,
|
|
||||||
hintText: 'postContentPlaceholder'.tr,
|
|
||||||
),
|
|
||||||
onTapOutside: (_) =>
|
|
||||||
FocusManager.instance.primaryFocus?.unfocus(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 120)
|
],
|
||||||
|
),
|
||||||
|
if (_repostTo != null)
|
||||||
|
ExpansionTile(
|
||||||
|
leading: const FaIcon(
|
||||||
|
FontAwesomeIcons.retweet,
|
||||||
|
size: 18,
|
||||||
|
).paddingOnly(left: 2),
|
||||||
|
title: Text('postRepostingNotify'.trParams(
|
||||||
|
{'username': '@${widget.repost!.author.name}'},
|
||||||
|
)),
|
||||||
|
collapsedBackgroundColor:
|
||||||
|
Theme.of(context).colorScheme.surfaceContainer,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
constraints: const BoxConstraints(maxHeight: 280),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: PostItem(
|
||||||
|
item: _repostTo!,
|
||||||
|
isReactable: false,
|
||||||
|
).paddingOnly(bottom: 8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (_isBusy) const LinearProgressIndicator().animate().scaleX(),
|
||||||
|
Expanded(
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
vertical: 8,
|
||||||
|
),
|
||||||
|
child: TextField(
|
||||||
|
maxLines: null,
|
||||||
|
autofocus: true,
|
||||||
|
autocorrect: true,
|
||||||
|
keyboardType: TextInputType.multiline,
|
||||||
|
controller:
|
||||||
|
_editorController.contentController,
|
||||||
|
focusNode: _contentFocusNode,
|
||||||
|
decoration: InputDecoration.collapsed(
|
||||||
|
hintText: 'postContentPlaceholder'.tr,
|
||||||
|
),
|
||||||
|
onTapOutside: (_) => FocusManager
|
||||||
|
.instance.primaryFocus
|
||||||
|
?.unfocus(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 120)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Obx(() {
|
||||||
|
final textStyle = TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.onSurface
|
||||||
|
.withOpacity(0.75),
|
||||||
|
);
|
||||||
|
final showFactors = [
|
||||||
|
_editorController.isRestoreFromLocal.value,
|
||||||
|
_editorController.lastSaveTime.value != null,
|
||||||
|
];
|
||||||
|
final doShow = showFactors.any((x) => x);
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 4,
|
||||||
|
horizontal: 16,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
if (showFactors[0])
|
||||||
|
Text('postRestoreFromLocal'.tr,
|
||||||
|
style: textStyle)
|
||||||
|
.paddingOnly(right: 4),
|
||||||
|
if (showFactors[0])
|
||||||
|
InkWell(
|
||||||
|
child: Text('clear'.tr, style: textStyle),
|
||||||
|
onTap: () {
|
||||||
|
_editorController.localClear();
|
||||||
|
_editorController.currentClear();
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
if (showFactors.where((x) => x).length > 1)
|
||||||
|
Text(
|
||||||
|
'·',
|
||||||
|
style: textStyle,
|
||||||
|
).paddingSymmetric(horizontal: 8),
|
||||||
|
if (showFactors[1])
|
||||||
|
Text(
|
||||||
|
'postAutoSaveAt'.trParams({
|
||||||
|
'date': DateFormat('HH:mm:ss').format(
|
||||||
|
_editorController.lastSaveTime.value ??
|
||||||
|
DateTime.now(),
|
||||||
|
)
|
||||||
|
}),
|
||||||
|
style: textStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.animate(
|
||||||
|
key: const Key('post-editor-hint-animation'),
|
||||||
|
target: doShow ? 1 : 0,
|
||||||
|
)
|
||||||
|
.fade(curve: Curves.easeInOut, duration: 300.ms);
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (SolianTheme.isLargeScreen(context))
|
||||||
|
const VerticalDivider(width: 0.3, thickness: 0.3)
|
||||||
|
.paddingSymmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
),
|
||||||
|
if (SolianTheme.isLargeScreen(context))
|
||||||
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: MarkdownTextContent(
|
||||||
|
content: _editorController.contentController.text,
|
||||||
|
parentId: 'post-editor-preview',
|
||||||
|
).paddingOnly(top: 12, right: 16),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -252,85 +382,39 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Obx(() {
|
const Divider(thickness: 0.3, height: 0.3),
|
||||||
final textStyle = TextStyle(
|
|
||||||
fontSize: 12,
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.onSurface
|
|
||||||
.withOpacity(0.75),
|
|
||||||
);
|
|
||||||
final showFactors = [
|
|
||||||
_editorController.isRestoreFromLocal.value,
|
|
||||||
_editorController.lastSaveTime.value != null,
|
|
||||||
];
|
|
||||||
final doShow = showFactors.any((x) => x);
|
|
||||||
return Container(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: 4,
|
|
||||||
horizontal: 16,
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
if (showFactors[0])
|
|
||||||
Text('postRestoreFromLocal'.tr, style: textStyle)
|
|
||||||
.paddingOnly(right: 4),
|
|
||||||
if (showFactors[0])
|
|
||||||
InkWell(
|
|
||||||
child: Text('clear'.tr, style: textStyle),
|
|
||||||
onTap: () {
|
|
||||||
_editorController.localClear();
|
|
||||||
_editorController.currentClear();
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
if (showFactors.where((x) => x).length > 1)
|
|
||||||
Text(
|
|
||||||
'·',
|
|
||||||
style: textStyle,
|
|
||||||
).paddingSymmetric(horizontal: 8),
|
|
||||||
if (showFactors[1])
|
|
||||||
Text(
|
|
||||||
'postAutoSaveAt'.trParams({
|
|
||||||
'date': DateFormat('HH:mm:ss').format(
|
|
||||||
_editorController.lastSaveTime.value ??
|
|
||||||
DateTime.now(),
|
|
||||||
)
|
|
||||||
}),
|
|
||||||
style: textStyle,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.animate(
|
|
||||||
key: const Key('post-editor-hint-animation'),
|
|
||||||
target: doShow ? 1 : 0,
|
|
||||||
)
|
|
||||||
.fade(curve: Curves.easeInOut, duration: 300.ms);
|
|
||||||
}),
|
|
||||||
if (_editorController.mode.value == 0)
|
|
||||||
Obx(
|
|
||||||
() => TweenAnimationBuilder<double>(
|
|
||||||
tween: Tween(
|
|
||||||
begin: 0,
|
|
||||||
end: _editorController.contentLength.value / 4096,
|
|
||||||
),
|
|
||||||
duration: const Duration(milliseconds: 300),
|
|
||||||
curve: Curves.easeInOut,
|
|
||||||
builder: (context, value, _) => LinearProgressIndicator(
|
|
||||||
minHeight: 2,
|
|
||||||
color: _editorController.contentLength.value > 4096
|
|
||||||
? Colors.red[900]
|
|
||||||
: Theme.of(context).colorScheme.primary,
|
|
||||||
value: value,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 56,
|
height: 56,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
children: [
|
children: [
|
||||||
|
if (_editorController.mode.value == 0)
|
||||||
|
Obx(
|
||||||
|
() => TweenAnimationBuilder<double>(
|
||||||
|
tween: Tween(
|
||||||
|
begin: 0,
|
||||||
|
end: _editorController.contentLength.value /
|
||||||
|
4096,
|
||||||
|
),
|
||||||
|
duration: const Duration(milliseconds: 300),
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
builder: (context, value, _) => SizedBox(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
strokeWidth: 3,
|
||||||
|
backgroundColor: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.secondaryContainer,
|
||||||
|
color: _editorController.contentLength.value >
|
||||||
|
4096
|
||||||
|
? Colors.red[900]
|
||||||
|
: Theme.of(context).colorScheme.primary,
|
||||||
|
value: value,
|
||||||
|
),
|
||||||
|
).paddingAll(10),
|
||||||
|
),
|
||||||
|
).paddingSymmetric(horizontal: 4),
|
||||||
Obx(() {
|
Obx(() {
|
||||||
final isDraft = _editorController.isDraft.value;
|
final isDraft = _editorController.isDraft.value;
|
||||||
return IconButton(
|
return IconButton(
|
||||||
@@ -383,12 +467,90 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.tag),
|
icon: Obx(() {
|
||||||
|
return badges.Badge(
|
||||||
|
badgeContent: Text(
|
||||||
|
_editorController.tags.length.toString(),
|
||||||
|
style: const TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
showBadge: _editorController.tags.isNotEmpty,
|
||||||
|
position: badges.BadgePosition.topEnd(
|
||||||
|
top: -12,
|
||||||
|
end: -8,
|
||||||
|
),
|
||||||
|
child: const Icon(Icons.label),
|
||||||
|
);
|
||||||
|
}),
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_editorController.editCategoriesAndTags(context);
|
_editorController.editCategoriesAndTags(context);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: Obx(() {
|
||||||
|
return badges.Badge(
|
||||||
|
showBadge:
|
||||||
|
_editorController.realmZone.value != null,
|
||||||
|
position: badges.BadgePosition.topEnd(
|
||||||
|
top: -4,
|
||||||
|
end: -6,
|
||||||
|
),
|
||||||
|
child: const Icon(Icons.workspaces),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
onPressed: () {
|
||||||
|
_editorController.editPublishZone(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: Obx(() {
|
||||||
|
return badges.Badge(
|
||||||
|
showBadge:
|
||||||
|
_editorController.thumbnail.value != null,
|
||||||
|
position: badges.BadgePosition.topEnd(
|
||||||
|
top: -4,
|
||||||
|
end: -6,
|
||||||
|
),
|
||||||
|
child: const Icon(Icons.preview),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
onPressed: () {
|
||||||
|
_editorController.editThumbnail(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: Obx(() {
|
||||||
|
return badges.Badge(
|
||||||
|
showBadge:
|
||||||
|
_editorController.publishedAt.value != null ||
|
||||||
|
_editorController.publishedUntil.value !=
|
||||||
|
null,
|
||||||
|
position: badges.BadgePosition.topEnd(
|
||||||
|
top: -4,
|
||||||
|
end: -6,
|
||||||
|
),
|
||||||
|
child: const Icon(Icons.schedule),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
onPressed: () {
|
||||||
|
_editorController.editPublishDate(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
MarkdownToolbar(
|
||||||
|
hideImage: true,
|
||||||
|
useIncludedTextField: false,
|
||||||
|
backgroundColor:
|
||||||
|
Theme.of(context).colorScheme.surface,
|
||||||
|
iconColor: Theme.of(context).colorScheme.onSurface,
|
||||||
|
controller: _editorController.contentController,
|
||||||
|
focusNode: _contentFocusNode,
|
||||||
|
borderRadius:
|
||||||
|
const BorderRadius.all(Radius.circular(20)),
|
||||||
|
width: 40,
|
||||||
|
).paddingSymmetric(horizontal: 2),
|
||||||
],
|
],
|
||||||
).paddingSymmetric(horizontal: 6, vertical: 8),
|
).paddingSymmetric(horizontal: 6, vertical: 8),
|
||||||
),
|
),
|
||||||
@@ -403,6 +565,7 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
_contentFocusNode.dispose();
|
||||||
_editorController.dispose();
|
_editorController.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class _RealmListScreenState extends State<RealmListScreen> {
|
|||||||
|
|
||||||
final List<Realm> _realms = List.empty(growable: true);
|
final List<Realm> _realms = List.empty(growable: true);
|
||||||
|
|
||||||
getRealms() async {
|
_getRealms() async {
|
||||||
final AuthProvider auth = Get.find();
|
final AuthProvider auth = Get.find();
|
||||||
if (auth.isAuthorized.isFalse) return;
|
if (auth.isAuthorized.isFalse) return;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ class _RealmListScreenState extends State<RealmListScreen> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
getRealms();
|
_getRealms();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -71,7 +71,7 @@ class _RealmListScreenState extends State<RealmListScreen> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
AppRouter.instance.pushNamed('realmOrganizing').then(
|
AppRouter.instance.pushNamed('realmOrganizing').then(
|
||||||
(value) {
|
(value) {
|
||||||
if (value != null) getRealms();
|
if (value != null) _getRealms();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -84,7 +84,7 @@ class _RealmListScreenState extends State<RealmListScreen> {
|
|||||||
body: Obx(() {
|
body: Obx(() {
|
||||||
if (auth.isAuthorized.isFalse) {
|
if (auth.isAuthorized.isFalse) {
|
||||||
return SigninRequiredOverlay(
|
return SigninRequiredOverlay(
|
||||||
onSignedIn: () => getRealms(),
|
onSignedIn: () => _getRealms(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,12 +94,12 @@ class _RealmListScreenState extends State<RealmListScreen> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: CenteredContainer(
|
child: CenteredContainer(
|
||||||
child: RefreshIndicator(
|
child: RefreshIndicator(
|
||||||
onRefresh: () => getRealms(),
|
onRefresh: () => _getRealms(),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: _realms.length,
|
itemCount: _realms.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final element = _realms[index];
|
final element = _realms[index];
|
||||||
return buildRealm(element);
|
return _buildEntry(element);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -112,7 +112,7 @@ class _RealmListScreenState extends State<RealmListScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildRealm(Realm element) {
|
Widget _buildEntry(Realm element) {
|
||||||
return Card(
|
return Card(
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import 'package:solian/providers/content/posts.dart';
|
|||||||
import 'package:solian/providers/content/realm.dart';
|
import 'package:solian/providers/content/realm.dart';
|
||||||
import 'package:solian/router.dart';
|
import 'package:solian/router.dart';
|
||||||
import 'package:solian/screens/channel/channel_organize.dart';
|
import 'package:solian/screens/channel/channel_organize.dart';
|
||||||
import 'package:solian/screens/posts/post_editor.dart';
|
|
||||||
import 'package:solian/theme.dart';
|
import 'package:solian/theme.dart';
|
||||||
import 'package:solian/widgets/app_bar_leading.dart';
|
import 'package:solian/widgets/app_bar_leading.dart';
|
||||||
import 'package:solian/widgets/channel/channel_list.dart';
|
import 'package:solian/widgets/channel/channel_list.dart';
|
||||||
@@ -136,6 +135,7 @@ class _RealmViewScreenState extends State<RealmViewScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return TabBarView(
|
return TabBarView(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
children: [
|
children: [
|
||||||
RealmPostListWidget(realm: _realm!),
|
RealmPostListWidget(realm: _realm!),
|
||||||
RealmChannelListWidget(
|
RealmChannelListWidget(
|
||||||
@@ -171,7 +171,7 @@ class _RealmPostListWidgetState extends State<RealmPostListWidget> {
|
|||||||
|
|
||||||
Response resp;
|
Response resp;
|
||||||
try {
|
try {
|
||||||
resp = await provider.listPost(pageKey, realm: widget.realm.id);
|
resp = await provider.listPost(pageKey, realm: widget.realm.alias);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
_pagingController.error = e;
|
_pagingController.error = e;
|
||||||
return;
|
return;
|
||||||
@@ -189,7 +189,6 @@ class _RealmPostListWidgetState extends State<RealmPostListWidget> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
_pagingController.addPageRequestListener(getPosts);
|
_pagingController.addPageRequestListener(getPosts);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,28 +198,6 @@ class _RealmPostListWidgetState extends State<RealmPostListWidget> {
|
|||||||
onRefresh: () => Future.sync(() => _pagingController.refresh()),
|
onRefresh: () => Future.sync(() => _pagingController.refresh()),
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverToBoxAdapter(
|
|
||||||
child: ListTile(
|
|
||||||
leading: const Icon(Icons.post_add),
|
|
||||||
contentPadding: const EdgeInsets.only(left: 24, right: 8),
|
|
||||||
tileColor: Theme.of(context).colorScheme.surfaceContainer,
|
|
||||||
title: Text('postNew'.tr),
|
|
||||||
subtitle: Text(
|
|
||||||
'postNewInRealmHint'
|
|
||||||
.trParams({'realm': '#${widget.realm.alias}'}),
|
|
||||||
),
|
|
||||||
onTap: () {
|
|
||||||
AppRouter.instance
|
|
||||||
.pushNamed(
|
|
||||||
'postEditor',
|
|
||||||
extra: PostPublishArguments(realm: widget.realm),
|
|
||||||
)
|
|
||||||
.then((value) {
|
|
||||||
if (value != null) _pagingController.refresh();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
PostListWidget(controller: _pagingController),
|
PostListWidget(controller: _pagingController),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
115
lib/screens/settings.dart
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
import 'package:solian/controllers/chat_events_controller.dart';
|
||||||
|
import 'package:solian/exts.dart';
|
||||||
|
import 'package:solian/providers/theme_switcher.dart';
|
||||||
|
import 'package:solian/router.dart';
|
||||||
|
import 'package:solian/theme.dart';
|
||||||
|
|
||||||
|
class SettingScreen extends StatefulWidget {
|
||||||
|
const SettingScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<SettingScreen> createState() => _SettingScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SettingScreenState extends State<SettingScreen> {
|
||||||
|
late final SharedPreferences _prefs;
|
||||||
|
|
||||||
|
Widget _buildCaptionHeader(String title) {
|
||||||
|
return Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||||
|
child: Text(title),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildThemeColorButton(String label, Color color) {
|
||||||
|
return IconButton(
|
||||||
|
icon: Icon(Icons.circle, color: color),
|
||||||
|
tooltip: label,
|
||||||
|
onPressed: () {
|
||||||
|
context.read<ThemeSwitcher>().setTheme(
|
||||||
|
SolianTheme.build(
|
||||||
|
Brightness.light,
|
||||||
|
seedColor: color,
|
||||||
|
),
|
||||||
|
SolianTheme.build(
|
||||||
|
Brightness.dark,
|
||||||
|
seedColor: color,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
_prefs.setInt('global_theme_color', color.value);
|
||||||
|
context.clearSnackbar();
|
||||||
|
context.showSnackbar('themeColorApplied'.tr);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static final List<(String, Color)> _presentTheme = [
|
||||||
|
('themeColorRed', const Color.fromRGBO(154, 98, 91, 1)),
|
||||||
|
('themeColorBlue', const Color.fromRGBO(103, 96, 193, 1)),
|
||||||
|
('themeColorMiku', const Color.fromRGBO(56, 120, 126, 1)),
|
||||||
|
('themeColorKagamine', const Color.fromRGBO(244, 183, 63, 1)),
|
||||||
|
('themeColorLuka', const Color.fromRGBO(243, 174, 218, 1)),
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
SharedPreferences.getInstance().then((inst) {
|
||||||
|
_prefs = inst;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Material(
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
_buildCaptionHeader('themeColor'.tr),
|
||||||
|
SizedBox(
|
||||||
|
height: 56,
|
||||||
|
child: ListView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
children: _presentTheme
|
||||||
|
.map((x) => _buildThemeColorButton(x.$1, x.$2))
|
||||||
|
.toList(),
|
||||||
|
).paddingSymmetric(horizontal: 12, vertical: 8),
|
||||||
|
),
|
||||||
|
_buildCaptionHeader('more'.tr),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
TextButton(
|
||||||
|
style: const ButtonStyle(
|
||||||
|
visualDensity: VisualDensity(horizontal: -4, vertical: -4),
|
||||||
|
),
|
||||||
|
child: Text('about'.tr),
|
||||||
|
onPressed: () {
|
||||||
|
AppRouter.instance.pushNamed('about');
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
style: const ButtonStyle(
|
||||||
|
visualDensity: VisualDensity(horizontal: -4, vertical: -4),
|
||||||
|
),
|
||||||
|
child: Text('messageHistoryWipe'.tr),
|
||||||
|
onPressed: () {
|
||||||
|
final chatHistory = ChatEventController();
|
||||||
|
chatHistory.initialize().then((_) async {
|
||||||
|
await chatHistory.database.localEvents.wipeLocalEvents();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).paddingSymmetric(horizontal: 12, vertical: 8),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,15 +5,15 @@ abstract class ServiceFinder {
|
|||||||
|
|
||||||
static const String dealerUrl =
|
static const String dealerUrl =
|
||||||
devFlag ? 'http://localhost:8442' : 'https://api.sn.solsynth.dev';
|
devFlag ? 'http://localhost:8442' : 'https://api.sn.solsynth.dev';
|
||||||
static const String passportUrl =
|
static const String capitalUrl =
|
||||||
devFlag ? 'http://localhost:8444' : 'https://id.solsynth.dev';
|
devFlag ? 'http://localhost:8444' : 'https://solsynth.dev';
|
||||||
|
|
||||||
static String buildUrl(String serviceName, String? append) {
|
static String buildUrl(String serviceName, String? append) {
|
||||||
append ??= '';
|
append ??= '';
|
||||||
if (serviceName == 'dealer') {
|
if (serviceName == 'dealer') {
|
||||||
return '$dealerUrl$append';
|
return '$dealerUrl$append';
|
||||||
} else if (serviceName == 'passport') {
|
} else if (serviceName == 'capital') {
|
||||||
return '$passportUrl$append';
|
return '$capitalUrl$append';
|
||||||
}
|
}
|
||||||
return '$dealerUrl/cgi/$serviceName$append';
|
return '$dealerUrl/cgi/$serviceName$append';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:solian/theme.dart';
|
import 'package:solian/theme.dart';
|
||||||
@@ -29,6 +30,15 @@ class RootShell extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final routeName = state.topRoute?.name;
|
final routeName = state.topRoute?.name;
|
||||||
|
|
||||||
|
if (routeName != null) {
|
||||||
|
FirebaseAnalytics.instance.logEvent(
|
||||||
|
name: 'screen_view',
|
||||||
|
parameters: {
|
||||||
|
'firebase_screen': routeName,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: rootScaffoldKey,
|
key: rootScaffoldKey,
|
||||||
drawer: SolianTheme.isLargeScreen(context)
|
drawer: SolianTheme.isLargeScreen(context)
|
||||||
|
|||||||
@@ -8,13 +8,15 @@ import 'package:solian/widgets/app_bar_leading.dart';
|
|||||||
class TitleShell extends StatelessWidget {
|
class TitleShell extends StatelessWidget {
|
||||||
final bool showAppBar;
|
final bool showAppBar;
|
||||||
final bool isCenteredTitle;
|
final bool isCenteredTitle;
|
||||||
final GoRouterState state;
|
final String? title;
|
||||||
|
final GoRouterState? state;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
const TitleShell({
|
const TitleShell({
|
||||||
super.key,
|
super.key,
|
||||||
required this.child,
|
required this.child,
|
||||||
required this.state,
|
this.title,
|
||||||
|
this.state,
|
||||||
this.showAppBar = true,
|
this.showAppBar = true,
|
||||||
this.isCenteredTitle = false,
|
this.isCenteredTitle = false,
|
||||||
});
|
});
|
||||||
@@ -25,7 +27,9 @@ class TitleShell extends StatelessWidget {
|
|||||||
appBar: showAppBar
|
appBar: showAppBar
|
||||||
? AppBar(
|
? AppBar(
|
||||||
leading: AppBarLeadingButton.adaptive(context),
|
leading: AppBarLeadingButton.adaptive(context),
|
||||||
title: AppBarTitle(state.topRoute?.name?.tr ?? 'page'.tr),
|
title: AppBarTitle(
|
||||||
|
title ?? (state!.topRoute?.name?.tr ?? 'page'.tr),
|
||||||
|
),
|
||||||
centerTitle: isCenteredTitle,
|
centerTitle: isCenteredTitle,
|
||||||
toolbarHeight: SolianTheme.toolbarHeight(context),
|
toolbarHeight: SolianTheme.toolbarHeight(context),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -27,13 +27,25 @@ abstract class SolianTheme {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static ThemeData build(Brightness brightness) {
|
static ThemeData build(Brightness brightness, {Color? seedColor}) {
|
||||||
return ThemeData(
|
return ThemeData(
|
||||||
brightness: brightness,
|
brightness: brightness,
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
colorScheme: ColorScheme.fromSeed(
|
colorScheme: ColorScheme.fromSeed(
|
||||||
brightness: brightness,
|
brightness: brightness,
|
||||||
seedColor: const Color.fromRGBO(154, 98, 91, 1),
|
seedColor: seedColor ?? const Color.fromRGBO(154, 98, 91, 1),
|
||||||
|
),
|
||||||
|
fontFamily: 'Comfortaa',
|
||||||
|
fontFamilyFallback: [
|
||||||
|
'NotoSansSC',
|
||||||
|
'NotoSansHK',
|
||||||
|
'NotoSansJP',
|
||||||
|
if (PlatformInfo.isWeb) 'NotoSansEmoji',
|
||||||
|
],
|
||||||
|
typography: Typography.material2021(
|
||||||
|
colorScheme: brightness == Brightness.light
|
||||||
|
? const ColorScheme.light()
|
||||||
|
: const ColorScheme.dark(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,12 @@ const i18nEnglish = {
|
|||||||
'draft': 'Draft',
|
'draft': 'Draft',
|
||||||
'draftSave': 'Save',
|
'draftSave': 'Save',
|
||||||
'draftBox': 'Draft Box',
|
'draftBox': 'Draft Box',
|
||||||
|
'more': 'More',
|
||||||
'share': 'Share',
|
'share': 'Share',
|
||||||
|
'shareNoUri': 'Share text content',
|
||||||
|
'alias': 'Alias',
|
||||||
'feed': 'Feed',
|
'feed': 'Feed',
|
||||||
|
'unlink': 'Unlink',
|
||||||
'feedSearch': 'Search Feed',
|
'feedSearch': 'Search Feed',
|
||||||
'feedSearchWithTag': 'Searching with tag #@key',
|
'feedSearchWithTag': 'Searching with tag #@key',
|
||||||
'feedSearchWithCategory': 'Searching in category @category',
|
'feedSearchWithCategory': 'Searching in category @category',
|
||||||
@@ -27,11 +31,13 @@ const i18nEnglish = {
|
|||||||
'about': 'About',
|
'about': 'About',
|
||||||
'edit': 'Edit',
|
'edit': 'Edit',
|
||||||
'delete': 'Delete',
|
'delete': 'Delete',
|
||||||
|
'settings': 'Settings',
|
||||||
'search': 'Search',
|
'search': 'Search',
|
||||||
'post': 'Post',
|
'post': 'Post',
|
||||||
'article': 'Article',
|
'article': 'Article',
|
||||||
'reply': 'Reply',
|
'reply': 'Reply',
|
||||||
'repost': 'Repost',
|
'repost': 'Repost',
|
||||||
|
'openInAlbum': 'Open in album',
|
||||||
'openInBrowser': 'Open in browser',
|
'openInBrowser': 'Open in browser',
|
||||||
'notification': 'Notification',
|
'notification': 'Notification',
|
||||||
'errorHappened': 'An error occurred',
|
'errorHappened': 'An error occurred',
|
||||||
@@ -48,6 +54,7 @@ const i18nEnglish = {
|
|||||||
'account': 'Account',
|
'account': 'Account',
|
||||||
'accountPersonalize': 'Personalize',
|
'accountPersonalize': 'Personalize',
|
||||||
'accountPersonalizeApplied': 'Account personalize settings has been saved.',
|
'accountPersonalizeApplied': 'Account personalize settings has been saved.',
|
||||||
|
'accountStickers': 'Stickers',
|
||||||
'accountFriend': 'Friend',
|
'accountFriend': 'Friend',
|
||||||
'accountFriendNew': 'New friend',
|
'accountFriendNew': 'New friend',
|
||||||
'accountFriendNewHint':
|
'accountFriendNewHint':
|
||||||
@@ -99,6 +106,11 @@ const i18nEnglish = {
|
|||||||
'postRestoreFromLocal': 'Restore from local',
|
'postRestoreFromLocal': 'Restore from local',
|
||||||
'postAutoSaveAt': 'Auto saved at @date',
|
'postAutoSaveAt': 'Auto saved at @date',
|
||||||
'postCategoriesAndTags': 'Categories n\' Tags',
|
'postCategoriesAndTags': 'Categories n\' Tags',
|
||||||
|
'postPublishDate': 'Publish Date',
|
||||||
|
'postPublishAt': 'Publish At',
|
||||||
|
'postPublishedUntil': 'Publish Until',
|
||||||
|
'postPublishZone': 'Publish Zone',
|
||||||
|
'postPublishZoneNone': 'None',
|
||||||
'postVisibility': 'Visibility',
|
'postVisibility': 'Visibility',
|
||||||
'postVisibilityAll': 'Everyone',
|
'postVisibilityAll': 'Everyone',
|
||||||
'postVisibilityFriends': 'Friends',
|
'postVisibilityFriends': 'Friends',
|
||||||
@@ -108,8 +120,12 @@ const i18nEnglish = {
|
|||||||
'postVisibleUsers': 'Visible users',
|
'postVisibleUsers': 'Visible users',
|
||||||
'postInvisibleUsers': 'Invisible users',
|
'postInvisibleUsers': 'Invisible users',
|
||||||
'postOverview': 'Overview',
|
'postOverview': 'Overview',
|
||||||
|
'postThumbnail': 'Thumbnail',
|
||||||
|
'postThumbnailAttachmentNew': 'Upload thumbnail',
|
||||||
|
'postThumbnailAttachment': 'Attachment serial number',
|
||||||
'postPinned': 'Pinned',
|
'postPinned': 'Pinned',
|
||||||
'postListNews': 'News',
|
'postListNews': 'News',
|
||||||
|
'postListFriends': 'Friends',
|
||||||
'postListShuffle': 'Random',
|
'postListShuffle': 'Random',
|
||||||
'postEditorModeStory': 'Post a post',
|
'postEditorModeStory': 'Post a post',
|
||||||
'postEditorModeArticle': 'Post an article',
|
'postEditorModeArticle': 'Post an article',
|
||||||
@@ -122,7 +138,7 @@ const i18nEnglish = {
|
|||||||
'postAction': 'Post',
|
'postAction': 'Post',
|
||||||
'postEdited': 'Edited at @date',
|
'postEdited': 'Edited at @date',
|
||||||
'postNewCreated': 'Created at @date',
|
'postNewCreated': 'Created at @date',
|
||||||
'postAttachmentTip': '@count attachment(s)',
|
'attachmentHint': '@count attachment(s)',
|
||||||
'postInRealm': 'In @realm',
|
'postInRealm': 'In @realm',
|
||||||
'postDetail': 'Post',
|
'postDetail': 'Post',
|
||||||
'postReplies': 'Replies',
|
'postReplies': 'Replies',
|
||||||
@@ -150,6 +166,14 @@ const i18nEnglish = {
|
|||||||
'reactCompleted': 'Your reaction has been added',
|
'reactCompleted': 'Your reaction has been added',
|
||||||
'reactUncompleted': 'Your reaction has been removed',
|
'reactUncompleted': 'Your reaction has been removed',
|
||||||
'attachmentUploadBy': 'Upload by',
|
'attachmentUploadBy': 'Upload by',
|
||||||
|
'attachmentAutoUpload': 'Auto Upload',
|
||||||
|
'attachmentUploadQueue': 'Upload Queue',
|
||||||
|
'attachmentUploadQueueStart': 'Start All',
|
||||||
|
'attachmentUploadInProgress':
|
||||||
|
'There are attachments being uploaded. Please wait until all attachments have been uploaded before proceeding...',
|
||||||
|
'attachmentAttached': 'Exists Files',
|
||||||
|
'attachmentUploadBlocked':
|
||||||
|
'Upload blocked, there is currently a task in progress...',
|
||||||
'attachmentAdd': 'Attach attachments',
|
'attachmentAdd': 'Attach attachments',
|
||||||
'attachmentAddGalleryPhoto': 'Gallery photo',
|
'attachmentAddGalleryPhoto': 'Gallery photo',
|
||||||
'attachmentAddGalleryVideo': 'Gallery video',
|
'attachmentAddGalleryVideo': 'Gallery video',
|
||||||
@@ -157,6 +181,10 @@ const i18nEnglish = {
|
|||||||
'attachmentAddCameraVideo': 'Capture video',
|
'attachmentAddCameraVideo': 'Capture video',
|
||||||
'attachmentAddClipboard': 'Paste file',
|
'attachmentAddClipboard': 'Paste file',
|
||||||
'attachmentAddFile': 'Attach file',
|
'attachmentAddFile': 'Attach file',
|
||||||
|
'attachmentAddLink': 'Link attachments',
|
||||||
|
'attachmentAddLinkHint':
|
||||||
|
'Enter attachment serial number to link that attachment',
|
||||||
|
'attachmentAddLinkInput': 'Serial number',
|
||||||
'attachmentSetting': 'Adjust attachment',
|
'attachmentSetting': 'Adjust attachment',
|
||||||
'attachmentAlt': 'Alternative text',
|
'attachmentAlt': 'Alternative text',
|
||||||
'attachmentLoadFailed': 'Load Attachment Failed',
|
'attachmentLoadFailed': 'Load Attachment Failed',
|
||||||
@@ -239,6 +267,8 @@ const i18nEnglish = {
|
|||||||
'Are your sure to delete message @id? This action cannot be undone!',
|
'Are your sure to delete message @id? This action cannot be undone!',
|
||||||
'call': 'Call',
|
'call': 'Call',
|
||||||
'callOngoing': 'A call is ongoing...',
|
'callOngoing': 'A call is ongoing...',
|
||||||
|
'callOngoingEmpty': 'A call is on hold...',
|
||||||
|
'callOngoingParticipants': '@count people are calling...',
|
||||||
'callJoin': 'Join',
|
'callJoin': 'Join',
|
||||||
'callResume': 'Resume',
|
'callResume': 'Resume',
|
||||||
'callMicrophone': 'Microphone',
|
'callMicrophone': 'Microphone',
|
||||||
@@ -293,6 +323,14 @@ const i18nEnglish = {
|
|||||||
'accountStatusNegative': 'Negative',
|
'accountStatusNegative': 'Negative',
|
||||||
'accountStatusNeutral': 'Neutral',
|
'accountStatusNeutral': 'Neutral',
|
||||||
'accountStatusPositive': 'Positive',
|
'accountStatusPositive': 'Positive',
|
||||||
|
'bsLoadingTheme': 'Loading Theme',
|
||||||
|
'bsCheckForUpdate': 'Checking For Updates',
|
||||||
|
'bsCheckForUpdateFailed': 'Unable to Check Updates',
|
||||||
|
'bsCheckForUpdateNew': 'Found New Version',
|
||||||
|
'bsCheckForUpdateDescApple':
|
||||||
|
'Please head to TestFlight and update your app to latest version to prevent error happens and get latest functions.',
|
||||||
|
'bsCheckForUpdateDescCommon':
|
||||||
|
'Please head to our website download and install latest version of application to prevent error happens and get latest functions.',
|
||||||
'bsCheckingServer': 'Checking Server Status',
|
'bsCheckingServer': 'Checking Server Status',
|
||||||
'bsCheckingServerFail':
|
'bsCheckingServerFail':
|
||||||
'Unable connect to server, check your network connection',
|
'Unable connect to server, check your network connection',
|
||||||
@@ -301,7 +339,44 @@ const i18nEnglish = {
|
|||||||
'bsEstablishingConn': 'Establishing Connection',
|
'bsEstablishingConn': 'Establishing Connection',
|
||||||
'bsPreparingData': 'Preparing User Data',
|
'bsPreparingData': 'Preparing User Data',
|
||||||
'bsRegisteringPushNotify': 'Enabling Push Notifications',
|
'bsRegisteringPushNotify': 'Enabling Push Notifications',
|
||||||
|
'bsDismissibleErrorHint': 'Click anywhere to ignore this error',
|
||||||
'postShareContent':
|
'postShareContent':
|
||||||
'@content\n\n@username on the Solar Network\nCheck it out: @link',
|
'@content\n\n@username on the Solar Network\nCheck it out: @link',
|
||||||
'postShareSubject': '@username posted a post on the Solar Network',
|
'postShareSubject': '@username posted a post on the Solar Network',
|
||||||
|
'themeColor': 'Global Theme Color',
|
||||||
|
'themeColorRed': 'Modern Red',
|
||||||
|
'themeColorBlue': 'Classic Blue',
|
||||||
|
'themeColorMiku': 'Miku Blue',
|
||||||
|
'themeColorKagamine': 'Kagamine Yellow',
|
||||||
|
'themeColorLuka': 'Luka Pink',
|
||||||
|
'stickerDeletionConfirm': 'Confirm sticker delete',
|
||||||
|
'stickerDeletionConfirmCaption':
|
||||||
|
'Are you sure to delete sticker @name? This action cannot be undo.',
|
||||||
|
'themeColorApplied': 'Global theme color has been applied.',
|
||||||
|
'attachmentSaved': 'Attachment saved to your system album.',
|
||||||
|
'cropImage': 'Crop Image',
|
||||||
|
'stickerUploader': 'Upload sticker',
|
||||||
|
'stickerUploaderAttachmentNew': 'Upload sticker',
|
||||||
|
'stickerUploaderAttachment': 'Attachment serial number',
|
||||||
|
'stickerUploaderPack': 'Sticker pack serial number',
|
||||||
|
'stickerUploaderPackHint':
|
||||||
|
'Don\'t have pack id? Head to creator platform and create one!',
|
||||||
|
'stickerUploaderAlias': 'Alias',
|
||||||
|
'stickerUploaderAliasHint':
|
||||||
|
'Will be used as a placeholder with the sticker pack prefix when entered.',
|
||||||
|
'stickerUploaderName': 'Name',
|
||||||
|
'stickerUploaderNameHint':
|
||||||
|
'A human-friendly name given to the user in the sticker selection interface.',
|
||||||
|
'readMore': 'Read more',
|
||||||
|
'attachmentUnload': 'Not Loaded',
|
||||||
|
'attachmentUnloadCaption':
|
||||||
|
'In order to save traffic, this attachment is not loaded automatically. Click it to start loading.',
|
||||||
|
'callStatusConnected': 'Connected',
|
||||||
|
'callStatusDisconnected': 'Disconnected',
|
||||||
|
'callStatusConnecting': 'Connecting',
|
||||||
|
'callStatusReconnected': 'Reconnecting',
|
||||||
|
'messageOutOfSync': 'May Out of Sync with Server',
|
||||||
|
'messageOutOfSyncCaption':
|
||||||
|
'Since the App has entered the background, there may be a time difference between the message list and the server. Click to Refresh.',
|
||||||
|
'messageHistoryWipe': 'Wipe local message history',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,12 +13,17 @@ const i18nSimplifiedChinese = {
|
|||||||
'about': '关于',
|
'about': '关于',
|
||||||
'edit': '编辑',
|
'edit': '编辑',
|
||||||
'delete': '删除',
|
'delete': '删除',
|
||||||
|
'settings': '设置',
|
||||||
'page': '页面',
|
'page': '页面',
|
||||||
'draft': '草稿',
|
'draft': '草稿',
|
||||||
'draftSave': '存为草稿',
|
'draftSave': '存为草稿',
|
||||||
'draftBox': '草稿箱',
|
'draftBox': '草稿箱',
|
||||||
|
'more': '更多',
|
||||||
'share': '分享',
|
'share': '分享',
|
||||||
|
'shareNoUri': '分享文字内容',
|
||||||
|
'alias': '别名',
|
||||||
'feed': '资讯',
|
'feed': '资讯',
|
||||||
|
'unlink': '移除链接',
|
||||||
'feedSearch': '搜索资讯',
|
'feedSearch': '搜索资讯',
|
||||||
'feedSearchWithTag': '检索带有 #@key 标签的资讯',
|
'feedSearchWithTag': '检索带有 #@key 标签的资讯',
|
||||||
'feedSearchWithCategory': '检索位于分类 @category 的资讯',
|
'feedSearchWithCategory': '检索位于分类 @category 的资讯',
|
||||||
@@ -32,6 +37,7 @@ const i18nSimplifiedChinese = {
|
|||||||
'article': '文章',
|
'article': '文章',
|
||||||
'reply': '回复',
|
'reply': '回复',
|
||||||
'repost': '转帖',
|
'repost': '转帖',
|
||||||
|
'openInAlbum': '在相簿中打开',
|
||||||
'openInBrowser': '在浏览器中打开',
|
'openInBrowser': '在浏览器中打开',
|
||||||
'notification': '通知',
|
'notification': '通知',
|
||||||
'errorHappened': '发生错误了',
|
'errorHappened': '发生错误了',
|
||||||
@@ -48,6 +54,7 @@ const i18nSimplifiedChinese = {
|
|||||||
'account': '账号',
|
'account': '账号',
|
||||||
'accountPersonalize': '个性化',
|
'accountPersonalize': '个性化',
|
||||||
'accountPersonalizeApplied': '账户的个性化设置已保存。',
|
'accountPersonalizeApplied': '账户的个性化设置已保存。',
|
||||||
|
'accountStickers': '贴图',
|
||||||
'accountFriend': '好友',
|
'accountFriend': '好友',
|
||||||
'accountFriendNew': '添加好友',
|
'accountFriendNew': '添加好友',
|
||||||
'accountFriendNewHint': '使用他人的用户名来发送一个好友请求吧!',
|
'accountFriendNewHint': '使用他人的用户名来发送一个好友请求吧!',
|
||||||
@@ -93,6 +100,11 @@ const i18nSimplifiedChinese = {
|
|||||||
'postRestoreFromLocal': '内容从本地暂存回复',
|
'postRestoreFromLocal': '内容从本地暂存回复',
|
||||||
'postAutoSaveAt': '已自动保存于 @date',
|
'postAutoSaveAt': '已自动保存于 @date',
|
||||||
'postCategoriesAndTags': '分类与标签',
|
'postCategoriesAndTags': '分类与标签',
|
||||||
|
'postPublishDate': '发布时间',
|
||||||
|
'postPublishAt': '发布帖子于',
|
||||||
|
'postPublishedUntil': '取消发布于',
|
||||||
|
'postPublishZone': '帖子发布区',
|
||||||
|
'postPublishZoneNone': '无所属领域',
|
||||||
'postVisibility': '帖子可见性',
|
'postVisibility': '帖子可见性',
|
||||||
'postVisibilityAll': '所有人可见',
|
'postVisibilityAll': '所有人可见',
|
||||||
'postVisibilityFriends': '仅好友可见',
|
'postVisibilityFriends': '仅好友可见',
|
||||||
@@ -102,6 +114,9 @@ const i18nSimplifiedChinese = {
|
|||||||
'postVisibleUsers': '可见帖子者',
|
'postVisibleUsers': '可见帖子者',
|
||||||
'postInvisibleUsers': '隐藏帖子者',
|
'postInvisibleUsers': '隐藏帖子者',
|
||||||
'postOverview': '帖子概览',
|
'postOverview': '帖子概览',
|
||||||
|
'postThumbnail': '帖子缩略图',
|
||||||
|
'postThumbnailAttachmentNew': '上传附件作为缩略图',
|
||||||
|
'postThumbnailAttachment': '附件序列号',
|
||||||
'postPinned': '已置顶',
|
'postPinned': '已置顶',
|
||||||
'postEditorModeStory': '发个帖子',
|
'postEditorModeStory': '发个帖子',
|
||||||
'postEditorModeArticle': '撰写文章',
|
'postEditorModeArticle': '撰写文章',
|
||||||
@@ -110,6 +125,7 @@ const i18nSimplifiedChinese = {
|
|||||||
'articleDetail': '文章详情',
|
'articleDetail': '文章详情',
|
||||||
'draftBoxOpen': '打开草稿箱',
|
'draftBoxOpen': '打开草稿箱',
|
||||||
'postListNews': '新鲜事',
|
'postListNews': '新鲜事',
|
||||||
|
'postListFriends': '好友圈',
|
||||||
'postListShuffle': '打乱看',
|
'postListShuffle': '打乱看',
|
||||||
'postNew': '创建新帖子',
|
'postNew': '创建新帖子',
|
||||||
'postNewInRealmHint': '在领域 @realm 里发表新帖子',
|
'postNewInRealmHint': '在领域 @realm 里发表新帖子',
|
||||||
@@ -117,7 +133,7 @@ const i18nSimplifiedChinese = {
|
|||||||
'postEdited': '编辑于 @date',
|
'postEdited': '编辑于 @date',
|
||||||
'postNewCreated': '创建于 @date',
|
'postNewCreated': '创建于 @date',
|
||||||
'postInRealm': '发表于 @realm',
|
'postInRealm': '发表于 @realm',
|
||||||
'postAttachmentTip': '@count 个附件',
|
'attachmentHint': '@count 个附件',
|
||||||
'postDetail': '帖子详情',
|
'postDetail': '帖子详情',
|
||||||
'postReplies': '帖子回复',
|
'postReplies': '帖子回复',
|
||||||
'postPublish': '编辑帖子',
|
'postPublish': '编辑帖子',
|
||||||
@@ -139,6 +155,12 @@ const i18nSimplifiedChinese = {
|
|||||||
'reactCompleted': '你的反应已被添加',
|
'reactCompleted': '你的反应已被添加',
|
||||||
'reactUncompleted': '你的反应已被移除',
|
'reactUncompleted': '你的反应已被移除',
|
||||||
'attachmentUploadBy': '由上传',
|
'attachmentUploadBy': '由上传',
|
||||||
|
'attachmentAutoUpload': '自动上传',
|
||||||
|
'attachmentUploadQueue': '上传队列',
|
||||||
|
'attachmentUploadQueueStart': '整队上传',
|
||||||
|
'attachmentUploadInProgress': '有附件正在上传,请等待所有附件上传完毕后再进行操作……',
|
||||||
|
'attachmentAttached': '已附附件',
|
||||||
|
'attachmentUploadBlocked': '上传受阻,当前已有任务进行中……',
|
||||||
'attachmentAdd': '附加附件',
|
'attachmentAdd': '附加附件',
|
||||||
'attachmentAddGalleryPhoto': '相册照片',
|
'attachmentAddGalleryPhoto': '相册照片',
|
||||||
'attachmentAddGalleryVideo': '相册视频',
|
'attachmentAddGalleryVideo': '相册视频',
|
||||||
@@ -146,6 +168,9 @@ const i18nSimplifiedChinese = {
|
|||||||
'attachmentAddCameraVideo': '拍摄视频',
|
'attachmentAddCameraVideo': '拍摄视频',
|
||||||
'attachmentAddClipboard': '粘贴文件',
|
'attachmentAddClipboard': '粘贴文件',
|
||||||
'attachmentAddFile': '附加文件',
|
'attachmentAddFile': '附加文件',
|
||||||
|
'attachmentAddLink': '链接附件',
|
||||||
|
'attachmentAddLinkHint': '输入附件的神秘代号来链接对应附件',
|
||||||
|
'attachmentAddLinkInput': '神秘代号',
|
||||||
'attachmentSetting': '调整附件',
|
'attachmentSetting': '调整附件',
|
||||||
'attachmentAlt': '替代文字',
|
'attachmentAlt': '替代文字',
|
||||||
'attachmentLoadFailed': '加载失败',
|
'attachmentLoadFailed': '加载失败',
|
||||||
@@ -220,6 +245,8 @@ const i18nSimplifiedChinese = {
|
|||||||
'messageDeletionConfirmCaption': '你确定要删除消息 @id 吗?该操作不可撤销。',
|
'messageDeletionConfirmCaption': '你确定要删除消息 @id 吗?该操作不可撤销。',
|
||||||
'call': '通话',
|
'call': '通话',
|
||||||
'callOngoing': '一则通话正在进行中…',
|
'callOngoing': '一则通话正在进行中…',
|
||||||
|
'callOngoingEmpty': '一则通话待机中…',
|
||||||
|
'callOngoingParticipants': '@count 人正在进行通话…',
|
||||||
'callJoin': '加入',
|
'callJoin': '加入',
|
||||||
'callResume': '恢复',
|
'callResume': '恢复',
|
||||||
'callMicrophone': '麦克风',
|
'callMicrophone': '麦克风',
|
||||||
@@ -272,6 +299,12 @@ const i18nSimplifiedChinese = {
|
|||||||
'accountStatusNegative': '负面',
|
'accountStatusNegative': '负面',
|
||||||
'accountStatusNeutral': '中性',
|
'accountStatusNeutral': '中性',
|
||||||
'accountStatusPositive': '积极',
|
'accountStatusPositive': '积极',
|
||||||
|
'bsLoadingTheme': '正在装载主题',
|
||||||
|
'bsCheckForUpdate': '正在检查更新',
|
||||||
|
'bsCheckForUpdateFailed': '无法检查更新',
|
||||||
|
'bsCheckForUpdateNew': '发现新版本',
|
||||||
|
'bsCheckForUpdateDescApple': '请前往 TestFlight 并将您的应用程序更新到最新版本,以防止出现错误并获取最新功能。',
|
||||||
|
'bsCheckForUpdateDescCommon': '请前往我们的网站下载并安装最新版本的应用程序,以防止出现错误并获取最新功能。',
|
||||||
'bsCheckingServer': '检查服务器状态中',
|
'bsCheckingServer': '检查服务器状态中',
|
||||||
'bsCheckingServerFail': '无法连接至服务器,请检查你的网络连接状态',
|
'bsCheckingServerFail': '无法连接至服务器,请检查你的网络连接状态',
|
||||||
'bsCheckingServerDown': '当前服务器不可用,请稍后重试',
|
'bsCheckingServerDown': '当前服务器不可用,请稍后重试',
|
||||||
@@ -279,6 +312,37 @@ const i18nSimplifiedChinese = {
|
|||||||
'bsEstablishingConn': '部署连接中',
|
'bsEstablishingConn': '部署连接中',
|
||||||
'bsPreparingData': '正在准备用户资料',
|
'bsPreparingData': '正在准备用户资料',
|
||||||
'bsRegisteringPushNotify': '正在启用推送通知',
|
'bsRegisteringPushNotify': '正在启用推送通知',
|
||||||
|
'bsDismissibleErrorHint': '点击任意地方忽略此错误',
|
||||||
'postShareContent': '@content\n\n@username 在 Solar Network\n原帖地址:@link',
|
'postShareContent': '@content\n\n@username 在 Solar Network\n原帖地址:@link',
|
||||||
'postShareSubject': '@username 在 Solar Network 上发布了一篇帖子',
|
'postShareSubject': '@username 在 Solar Network 上发布了一篇帖子',
|
||||||
|
'themeColor': '全局主题色',
|
||||||
|
'themeColorRed': '现代红',
|
||||||
|
'themeColorBlue': '经典蓝',
|
||||||
|
'themeColorMiku': '未来蓝',
|
||||||
|
'themeColorKagamine': '镜音黄',
|
||||||
|
'themeColorLuka': '流音粉',
|
||||||
|
'themeColorApplied': '全局主题颜色已应用',
|
||||||
|
'stickerDeletionConfirm': '确认删除贴图',
|
||||||
|
'stickerDeletionConfirmCaption': '你确认要删除贴图 @name 吗?该操作不可撤销。',
|
||||||
|
'attachmentSaved': '附件已保存到系统相册',
|
||||||
|
'cropImage': '裁剪图片',
|
||||||
|
'stickerUploader': '上传贴图',
|
||||||
|
'stickerUploaderAttachmentNew': '上传附件作为贴图',
|
||||||
|
'stickerUploaderAttachment': '附件序列号',
|
||||||
|
'stickerUploaderPack': '贴图包序号',
|
||||||
|
'stickerUploaderPackHint': '没有该序号?请转到我们的创作者平台创建一个贴图包。',
|
||||||
|
'stickerUploaderAlias': '贴图别名',
|
||||||
|
'stickerUploaderAliasHint': '将会在输入时使用和贴图包前缀组成占位符。',
|
||||||
|
'stickerUploaderName': '贴图名称',
|
||||||
|
'stickerUploaderNameHint': '在贴图选择界面提供给用户的人类友好名称。',
|
||||||
|
'readMore': '阅读更多',
|
||||||
|
'attachmentUnload': '附件未加载',
|
||||||
|
'attachmentUnloadCaption': '为了节省流量,本附件未自动加载,点一下来开始加载。',
|
||||||
|
'callStatusConnected': '已连接',
|
||||||
|
'callStatusDisconnected': '已断开',
|
||||||
|
'callStatusConnecting': '连接中',
|
||||||
|
'callStatusReconnected': '重连中',
|
||||||
|
'messageOutOfSync': '消息可能与服务器脱节',
|
||||||
|
'messageOutOfSyncCaption': '由于 App 进入后台,消息列表可能与服务器存在时差,点击刷新。',
|
||||||
|
'messageHistoryWipe': '清除消息记录',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ class AccountAvatar extends StatelessWidget {
|
|||||||
if (content is String) {
|
if (content is String) {
|
||||||
direct = content.startsWith('http');
|
direct = content.startsWith('http');
|
||||||
if (!isEmpty) isEmpty = content.isEmpty;
|
if (!isEmpty) isEmpty = content.isEmpty;
|
||||||
if (!isEmpty) isEmpty = content.endsWith('/attachments/0');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final url = direct
|
final url = direct
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:solian/exts.dart';
|
|
||||||
import 'package:solian/models/account.dart';
|
import 'package:solian/models/account.dart';
|
||||||
import 'package:solian/providers/account_status.dart';
|
import 'package:solian/providers/account_status.dart';
|
||||||
import 'package:solian/router.dart';
|
import 'package:solian/router.dart';
|
||||||
@@ -8,9 +7,9 @@ import 'package:solian/services.dart';
|
|||||||
import 'package:solian/widgets/account/account_heading.dart';
|
import 'package:solian/widgets/account/account_heading.dart';
|
||||||
|
|
||||||
class AccountProfilePopup extends StatefulWidget {
|
class AccountProfilePopup extends StatefulWidget {
|
||||||
final Account account;
|
final String name;
|
||||||
|
|
||||||
const AccountProfilePopup({super.key, required this.account});
|
const AccountProfilePopup({super.key, required this.name});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<AccountProfilePopup> createState() => _AccountProfilePopupState();
|
State<AccountProfilePopup> createState() => _AccountProfilePopupState();
|
||||||
@@ -18,38 +17,75 @@ class AccountProfilePopup extends StatefulWidget {
|
|||||||
|
|
||||||
class _AccountProfilePopupState extends State<AccountProfilePopup> {
|
class _AccountProfilePopupState extends State<AccountProfilePopup> {
|
||||||
bool _isBusy = true;
|
bool _isBusy = true;
|
||||||
|
dynamic _hasError;
|
||||||
|
|
||||||
Account? _userinfo;
|
Account? _userinfo;
|
||||||
|
|
||||||
void getUserinfo() async {
|
void _getUserinfo() async {
|
||||||
setState(() => _isBusy = true);
|
setState(() => _isBusy = true);
|
||||||
|
|
||||||
final client = ServiceFinder.configureClient('auth');
|
try {
|
||||||
final resp = await client.get('/users/${widget.account.name}');
|
final client = ServiceFinder.configureClient('auth');
|
||||||
if (resp.statusCode == 200) {
|
final resp = await client.get('/users/${widget.name}');
|
||||||
_userinfo = Account.fromJson(resp.body);
|
if (resp.statusCode == 200) {
|
||||||
setState(() => _isBusy = false);
|
setState(() {
|
||||||
} else {
|
_userinfo = Account.fromJson(resp.body);
|
||||||
context.showErrorDialog(resp.bodyString);
|
_isBusy = false;
|
||||||
Navigator.pop(context);
|
});
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
_hasError = resp.bodyString;
|
||||||
|
_isBusy = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
setState(() {
|
||||||
|
_hasError = e;
|
||||||
|
_isBusy = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color get _unFocusColor =>
|
||||||
|
Theme.of(context).colorScheme.onSurface.withOpacity(0.75);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
getUserinfo();
|
_getUserinfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (_isBusy || _userinfo == null) {
|
if (_isBusy) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: MediaQuery.of(context).size.height * 0.75,
|
height: MediaQuery.of(context).size.height * 0.75,
|
||||||
child: const Center(child: CircularProgressIndicator()),
|
child: const Center(child: CircularProgressIndicator()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_hasError != null) {
|
||||||
|
return SizedBox(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.75,
|
||||||
|
width: double.infinity,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.cancel, size: 24),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Text(
|
||||||
|
_hasError.toString(),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: _unFocusColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: MediaQuery.of(context).size.height * 0.75,
|
height: MediaQuery.of(context).size.height * 0.75,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ class _AccountStatusEditorDialogState extends State<AccountStatusEditorDialog> {
|
|||||||
onTapOutside: (_) =>
|
onTapOutside: (_) =>
|
||||||
FocusManager.instance.primaryFocus?.unfocus(),
|
FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 8),
|
||||||
TextField(
|
TextField(
|
||||||
controller: _clearAtController,
|
controller: _clearAtController,
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
@@ -238,7 +238,7 @@ class _AccountStatusEditorDialogState extends State<AccountStatusEditorDialog> {
|
|||||||
),
|
),
|
||||||
onTap: () => selectClearAt(),
|
onTap: () => selectClearAt(),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 8),
|
||||||
SingleChildScrollView(
|
SingleChildScrollView(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
@@ -281,7 +281,7 @@ class _AccountStatusEditorDialogState extends State<AccountStatusEditorDialog> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 8),
|
||||||
SingleChildScrollView(
|
SingleChildScrollView(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class SilverRelativeList extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (context) =>
|
builder: (context) =>
|
||||||
AccountProfilePopup(
|
AccountProfilePopup(
|
||||||
account: element.related,
|
name: element.related.name,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
133
lib/widgets/attachments/attachment_attr_editor.dart
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_animate/flutter_animate.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:solian/exts.dart';
|
||||||
|
import 'package:solian/models/attachment.dart';
|
||||||
|
import 'package:solian/providers/content/attachment.dart';
|
||||||
|
|
||||||
|
class AttachmentAttrEditorDialog extends StatefulWidget {
|
||||||
|
final Attachment item;
|
||||||
|
final Function(Attachment item) onUpdate;
|
||||||
|
|
||||||
|
const AttachmentAttrEditorDialog({
|
||||||
|
super.key,
|
||||||
|
required this.item,
|
||||||
|
required this.onUpdate,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AttachmentAttrEditorDialog> createState() =>
|
||||||
|
_AttachmentAttrEditorDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AttachmentAttrEditorDialogState
|
||||||
|
extends State<AttachmentAttrEditorDialog> {
|
||||||
|
final _altController = TextEditingController();
|
||||||
|
|
||||||
|
bool _isBusy = false;
|
||||||
|
bool _isMature = false;
|
||||||
|
|
||||||
|
Future<Attachment?> _updateAttachment() async {
|
||||||
|
final AttachmentProvider provider = Get.find();
|
||||||
|
|
||||||
|
setState(() => _isBusy = true);
|
||||||
|
try {
|
||||||
|
final resp = await provider.updateAttachment(
|
||||||
|
widget.item.id,
|
||||||
|
_altController.value.text,
|
||||||
|
isMature: _isMature,
|
||||||
|
);
|
||||||
|
|
||||||
|
Get.find<AttachmentProvider>().clearCache(id: widget.item.rid);
|
||||||
|
|
||||||
|
setState(() => _isBusy = false);
|
||||||
|
return Attachment.fromJson(resp.body);
|
||||||
|
} catch (e) {
|
||||||
|
context.showErrorDialog(e);
|
||||||
|
setState(() => _isBusy = false);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void syncWidget() {
|
||||||
|
_isMature = widget.item.isMature;
|
||||||
|
_altController.text = widget.item.alt;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
syncWidget();
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: Text('attachmentSetting'.tr),
|
||||||
|
content: Container(
|
||||||
|
constraints: const BoxConstraints(minWidth: 400),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
if (_isBusy)
|
||||||
|
ClipRRect(
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
|
child: const LinearProgressIndicator().animate().scaleX(),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 18),
|
||||||
|
TextField(
|
||||||
|
controller: _altController,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
isDense: true,
|
||||||
|
prefixIcon: const Icon(Icons.image_not_supported),
|
||||||
|
border: const OutlineInputBorder(),
|
||||||
|
labelText: 'attachmentAlt'.tr,
|
||||||
|
),
|
||||||
|
onTapOutside: (_) =>
|
||||||
|
FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
CheckboxListTile(
|
||||||
|
contentPadding: const EdgeInsets.only(left: 4, right: 18),
|
||||||
|
shape: const RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10))),
|
||||||
|
title: Text('matureContent'.tr),
|
||||||
|
secondary: const Icon(Icons.visibility_off),
|
||||||
|
value: _isMature,
|
||||||
|
onChanged: (newValue) {
|
||||||
|
setState(() => _isMature = newValue ?? false);
|
||||||
|
},
|
||||||
|
controlAffinity: ListTileControlAffinity.leading,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actionsAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
actions: <Widget>[
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
TextButton(
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
foregroundColor:
|
||||||
|
Theme.of(context).colorScheme.onSurfaceVariant),
|
||||||
|
onPressed: () => Navigator.pop(context),
|
||||||
|
child: Text('cancel'.tr),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
child: Text('apply'.tr),
|
||||||
|
onPressed: () {
|
||||||
|
_updateAttachment().then((value) {
|
||||||
|
if (value != null) {
|
||||||
|
widget.onUpdate(value);
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||