Compare commits

..

33 Commits

Author SHA1 Message Date
0622498f4e Fake call audio level 2025-10-19 19:34:22 +08:00
844efcda1a 👔 Disable the video by default 2025-10-19 19:23:17 +08:00
98e39cce6a 🐛 Fix the duplicate local participant 2025-10-19 19:23:01 +08:00
0c459bf7e3 ♻️ Proper singaling 2025-10-19 19:16:40 +08:00
a2576abee0 ♻️ Proper local participant 2025-10-19 19:06:14 +08:00
f4b28c3fa2 WebRTC signaling heartbeat 2025-10-19 18:58:54 +08:00
43d767bc03 🐛 Trying to fix something 2025-10-19 18:31:05 +08:00
0910be88ef 🐛 Bug fixes of webrtc 2025-10-19 18:22:03 +08:00
e96b1fd9d4 Impl todos for the webrtc 2025-10-19 17:59:25 +08:00
3f83bbc1d8 ♻️ Trying out the new built-in webrtc 2025-10-19 17:30:06 +08:00
001549b190 💄 Fix notification bottom sheet covered with sheet 2025-10-15 22:55:37 +08:00
4595865ad3 🐛 Bug fixes on windows 2025-10-15 22:49:43 +08:00
LittleSheep
1834643167 🔀 Merge pull request #184 from Texas0295/v3
[FIX] linux: restrict setAsFrameless to Wayland only
2025-10-15 20:05:40 +08:00
Texas0295
0e816eaa3e [FIX] wayland: restrict setAsFrameless to Wayland only
Prevent unconditional frameless calls on non-Wayland platforms.

Signed-off-by: Texas0295 <kimura@texas0295.top>
2025-10-15 02:24:40 +08:00
LittleSheep
7c1f24b824 🔀 Merge pull request #183 from Texas0295/v3
[FIX] linux: correct Wayland window buffer mismatch by setAsFreameless()
2025-10-15 00:47:58 +08:00
c6594ea2ce 🚀 Launch 3.3.0+136 2025-10-15 00:46:34 +08:00
3bec6e683e 🐛 Fix chat input not enter to send 2025-10-15 00:42:26 +08:00
83e92e2eed Show heatmap on pub profile 2025-10-15 00:27:32 +08:00
Texas0295
b7d44d96ba [FIX] linux: correct Wayland window buffer mismatch by setAsFreameless()
Wayland (Hyprland, Sway, etc.) compositors misreport window buffer geometry
when using transparent + hidden titlebar settings.

This causes Flutter to render outside the actual visible region
and the debug banner to be cropped offscreen.

Calling windowManager.setAsFrameless() once after window creation
forces compositor to reconfigure the surface and align buffer size
with the visible client area.

No effect on X11, Windows, or macOS.

Signed-off-by: Texas0295 <kimura@texas0295.top>
2025-10-15 00:06:03 +08:00
a83b929d42 ♻️ Convert the notification to sheet 2025-10-14 23:44:07 +08:00
9423affa75 🐛 Fix bugs 2025-10-14 23:01:40 +08:00
cda23db609 🐛 Make the background image not responsive for virtual keyboard to provide better visual experience on iOS 26 2025-10-14 22:53:59 +08:00
61074bc5a3 🐛 Fix compose dialog 2025-10-14 22:53:38 +08:00
5feafa9255 💄 Optimize quick reply input again... 2025-10-14 22:48:34 +08:00
e604577c1f 💄 Optimize quick reply input 2025-10-14 22:27:51 +08:00
af0ddd1273 💄 Optimize and bug fixes in auto complete 2025-10-14 22:26:06 +08:00
8a6bb34808 🔨 Fix android build 2025-10-14 01:39:59 +08:00
4ef8445c77 ⬆️ Upgrade the dependcenies 2025-10-14 01:38:16 +08:00
ec39ad6ca3 💄 Optimizations 2025-10-14 01:37:54 +08:00
eabb3154f1 💄 Optimize card colors 2025-10-14 01:16:02 +08:00
910bf20eef 🐛 Fix mobile haven't enter to submit 2025-10-13 01:48:30 +08:00
5efa9b2ae8 🚀 Launch 3.3.0+135 2025-10-13 01:25:37 +08:00
dd3e39e891 💄 Smart retry GET requests 2025-10-13 00:58:51 +08:00
57 changed files with 2371 additions and 981 deletions

View File

@@ -75,3 +75,4 @@ dependencies {
flutter {
source = "../.."
}

View File

@@ -2,8 +2,6 @@ PODS:
- Alamofire (5.10.2)
- app_links (6.4.1):
- Flutter
- connectivity_plus (0.0.1):
- Flutter
- croppy (0.0.1):
- Flutter
- device_info_plus (0.0.1):
@@ -44,83 +42,83 @@ PODS:
- Flutter
- file_saver (0.0.1):
- Flutter
- Firebase/CoreOnly (12.2.0):
- FirebaseCore (~> 12.2.0)
- Firebase/Crashlytics (12.2.0):
- Firebase/CoreOnly (12.4.0):
- FirebaseCore (~> 12.4.0)
- Firebase/Crashlytics (12.4.0):
- Firebase/CoreOnly
- FirebaseCrashlytics (~> 12.2.0)
- Firebase/Messaging (12.2.0):
- FirebaseCrashlytics (~> 12.4.0)
- Firebase/Messaging (12.4.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 12.2.0)
- firebase_analytics (12.0.2):
- FirebaseMessaging (~> 12.4.0)
- firebase_analytics (12.0.3):
- firebase_core
- FirebaseAnalytics (= 12.2.0)
- FirebaseAnalytics (= 12.4.0)
- Flutter
- firebase_core (4.1.1):
- Firebase/CoreOnly (= 12.2.0)
- firebase_core (4.2.0):
- Firebase/CoreOnly (= 12.4.0)
- Flutter
- firebase_crashlytics (5.0.2):
- Firebase/Crashlytics (= 12.2.0)
- firebase_crashlytics (5.0.3):
- Firebase/Crashlytics (= 12.4.0)
- firebase_core
- Flutter
- firebase_messaging (16.0.2):
- Firebase/Messaging (= 12.2.0)
- firebase_messaging (16.0.3):
- Firebase/Messaging (= 12.4.0)
- firebase_core
- Flutter
- FirebaseAnalytics (12.2.0):
- FirebaseAnalytics/Default (= 12.2.0)
- FirebaseCore (~> 12.2.0)
- FirebaseInstallations (~> 12.2.0)
- FirebaseAnalytics (12.4.0):
- FirebaseAnalytics/Default (= 12.4.0)
- FirebaseCore (~> 12.4.0)
- FirebaseInstallations (~> 12.4.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- FirebaseAnalytics/Default (12.2.0):
- FirebaseCore (~> 12.2.0)
- FirebaseInstallations (~> 12.2.0)
- GoogleAppMeasurement/Default (= 12.2.0)
- FirebaseAnalytics/Default (12.4.0):
- FirebaseCore (~> 12.4.0)
- FirebaseInstallations (~> 12.4.0)
- GoogleAppMeasurement/Default (= 12.4.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- FirebaseCore (12.2.0):
- FirebaseCoreInternal (~> 12.2.0)
- FirebaseCore (12.4.0):
- FirebaseCoreInternal (~> 12.4.0)
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/Logger (~> 8.1)
- FirebaseCoreExtension (12.2.0):
- FirebaseCore (~> 12.2.0)
- FirebaseCoreInternal (12.2.0):
- FirebaseCoreExtension (12.4.0):
- FirebaseCore (~> 12.4.0)
- FirebaseCoreInternal (12.4.0):
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- FirebaseCrashlytics (12.2.0):
- FirebaseCore (~> 12.2.0)
- FirebaseInstallations (~> 12.2.0)
- FirebaseRemoteConfigInterop (~> 12.2.0)
- FirebaseSessions (~> 12.2.0)
- FirebaseCrashlytics (12.4.0):
- FirebaseCore (~> 12.4.0)
- FirebaseInstallations (~> 12.4.0)
- FirebaseRemoteConfigInterop (~> 12.4.0)
- FirebaseSessions (~> 12.4.0)
- GoogleDataTransport (~> 10.1)
- GoogleUtilities/Environment (~> 8.1)
- nanopb (~> 3.30910.0)
- PromisesObjC (~> 2.4)
- FirebaseInstallations (12.2.0):
- FirebaseCore (~> 12.2.0)
- FirebaseInstallations (12.4.0):
- FirebaseCore (~> 12.4.0)
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/UserDefaults (~> 8.1)
- PromisesObjC (~> 2.4)
- FirebaseMessaging (12.2.0):
- FirebaseCore (~> 12.2.0)
- FirebaseInstallations (~> 12.2.0)
- FirebaseMessaging (12.4.0):
- FirebaseCore (~> 12.4.0)
- FirebaseInstallations (~> 12.4.0)
- GoogleDataTransport (~> 10.1)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/Reachability (~> 8.1)
- GoogleUtilities/UserDefaults (~> 8.1)
- nanopb (~> 3.30910.0)
- FirebaseRemoteConfigInterop (12.2.0)
- FirebaseSessions (12.2.0):
- FirebaseCore (~> 12.2.0)
- FirebaseCoreExtension (~> 12.2.0)
- FirebaseInstallations (~> 12.2.0)
- FirebaseRemoteConfigInterop (12.4.0)
- FirebaseSessions (12.4.0):
- FirebaseCore (~> 12.4.0)
- FirebaseCoreExtension (~> 12.4.0)
- FirebaseInstallations (~> 12.4.0)
- GoogleDataTransport (~> 10.1)
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/UserDefaults (~> 8.1)
@@ -157,27 +155,28 @@ PODS:
- gal (1.0.0):
- Flutter
- FlutterMacOS
- GoogleAdsOnDeviceConversion (2.3.0):
- GoogleAdsOnDeviceConversion (3.1.0):
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/Logger (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- nanopb (~> 3.30910.0)
- GoogleAppMeasurement/Core (12.2.0):
- GoogleAppMeasurement/Core (12.4.0):
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- GoogleAppMeasurement/Default (12.2.0):
- GoogleAdsOnDeviceConversion (= 2.3.0)
- GoogleAppMeasurement/Core (= 12.2.0)
- GoogleAppMeasurement/IdentitySupport (= 12.2.0)
- GoogleAppMeasurement/Default (12.4.0):
- GoogleAdsOnDeviceConversion (~> 3.1.0)
- GoogleAppMeasurement/Core (= 12.4.0)
- GoogleAppMeasurement/IdentitySupport (= 12.4.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- GoogleAppMeasurement/IdentitySupport (12.2.0):
- GoogleAppMeasurement/Core (= 12.2.0)
- GoogleAppMeasurement/IdentitySupport (12.4.0):
- GoogleAppMeasurement/Core (= 12.4.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
@@ -218,10 +217,6 @@ PODS:
- irondash_engine_context (0.0.1):
- Flutter
- Kingfisher (8.6.0)
- livekit_client (2.5.0):
- Flutter
- flutter_webrtc
- WebRTC-SDK (= 137.7151.04)
- local_auth_darwin (0.0.1):
- Flutter
- FlutterMacOS
@@ -308,7 +303,6 @@ PODS:
DEPENDENCIES:
- Alamofire
- app_links (from `.symlinks/plugins/app_links/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- croppy (from `.symlinks/plugins/croppy/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
@@ -332,7 +326,6 @@ DEPENDENCIES:
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- irondash_engine_context (from `.symlinks/plugins/irondash_engine_context/ios`)
- Kingfisher (~> 8.0)
- livekit_client (from `.symlinks/plugins/livekit_client/ios`)
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
- media_kit_libs_ios_video (from `.symlinks/plugins/media_kit_libs_ios_video/ios`)
- media_kit_video (from `.symlinks/plugins/media_kit_video/ios`)
@@ -387,8 +380,6 @@ SPEC REPOS:
EXTERNAL SOURCES:
app_links:
:path: ".symlinks/plugins/app_links/ios"
connectivity_plus:
:path: ".symlinks/plugins/connectivity_plus/ios"
croppy:
:path: ".symlinks/plugins/croppy/ios"
device_info_plus:
@@ -433,8 +424,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_picker_ios/ios"
irondash_engine_context:
:path: ".symlinks/plugins/irondash_engine_context/ios"
livekit_client:
:path: ".symlinks/plugins/livekit_client/ios"
local_auth_darwin:
:path: ".symlinks/plugins/local_auth_darwin/darwin"
media_kit_libs_ios_video:
@@ -479,27 +468,26 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Alamofire: 7193b3b92c74a07f85569e1a6c4f4237291e7496
app_links: 3dbc685f76b1693c66a6d9dd1e9ab6f73d97dc0a
connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
croppy: 979e8ddc254f4642bffe7d52dc7193354b27ba30
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be
file_saver: 6cdbcddd690cb02b0c1a0c225b37cd805c2bf8b6
Firebase: 26f6f8d460603af3df970ad505b16b15f5e2e9a1
firebase_analytics: 8c78ce6224e0623152379d6cc7ef3d9098477b7e
firebase_core: dfc4bd142bee4bc53a5d482397ca322c2dd3165d
firebase_crashlytics: e55dcf895eed0dd87c447dd5aff8db7f1bb8bbdb
firebase_messaging: 38c66c1184695b0c87abe51d40fc590718abed1a
FirebaseAnalytics: e04e23bc070e3014aa5cf4980f9df7ce5cd79ec8
FirebaseCore: 311c48a147ad4a0ab7febbaed89e8025c67510cd
FirebaseCoreExtension: 73af080c22a2f7b44cefa391dc08f7e4ee162cb5
FirebaseCoreInternal: 56ea29f3dad2894f81b060f706f9d53509b6ed3b
FirebaseCrashlytics: f83cbf176d5c637ade108c0aacf1ccbd5ec499bf
FirebaseInstallations: 3e884b01feabdf67582a80f3250425a00979b4ed
FirebaseMessaging: 43ec73bbfedd0c385a849bb91593ab4ad4b9e48e
FirebaseRemoteConfigInterop: 0896fd52ab72586a355c8f389ff85aaa9e5375e1
FirebaseSessions: f4692789e770bec66ce17d772c0e9561c4f11737
Firebase: f07b15ae5a6ec0f93713e30b923d9970d144af3e
firebase_analytics: 1d024068b1d4707d5ba7a42a12976ddf3316d835
firebase_core: 744984dbbed8b3036abf34f0b98d80f130a7e464
firebase_crashlytics: f3a9a4338ab99b67042f64e9e22e1bf349cb44ed
firebase_messaging: 82c70650c426a0a14873e1acdb9ec2b443c4e8b4
FirebaseAnalytics: 0fc2b20091f0ddd21bf73397cf8f0eb5346dc24f
FirebaseCore: bb595f3114953664e3c1dc032f008a244147cfd3
FirebaseCoreExtension: 7e1f7118ee970e001a8013719fb90950ee5e0018
FirebaseCoreInternal: d7f5a043c2cd01a08103ab586587c1468047bca6
FirebaseCrashlytics: a6ece278a837c7e88de2d9b5da0a3542f2342395
FirebaseInstallations: ae9f4902cb5bf1d0c5eaa31ec1f4e5495a0714e2
FirebaseMessaging: d33971b7bb252745ea6cd31ab190d1a1df4b8ed5
FirebaseRemoteConfigInterop: 1e31ec72b89c9924367c59bfb5ec9ab60d1d6766
FirebaseSessions: ba7c7a7ca8696a8d540eb3fe3800fbe98c79786d
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
flutter_app_update: 816fdb2e30e4832a7c45e3f108d391c42ef040a9
flutter_inappwebview_ios: b89ba3482b96fb25e00c967aae065701b66e9b99
@@ -512,14 +500,13 @@ SPEC CHECKSUMS:
flutter_udid: f7c3884e6ec2951efe4f9de082257fc77c4d15e9
flutter_webrtc: c3e21fc0dcd9d8eb246ae4d5256fcbeb2f5ecd22
gal: baecd024ebfd13c441269ca7404792a7152fde89
GoogleAdsOnDeviceConversion: 9090c435cde08903e8dd1ba2c77fbec9e46d9afe
GoogleAppMeasurement: 09f341dfa8527d1612a09cbfe809a242c0b737af
GoogleAdsOnDeviceConversion: e03a386840803ea7eef3fd22a061930142c039c1
GoogleAppMeasurement: 1e718274b7e015cefd846ac1fcf7820c70dc017d
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a
irondash_engine_context: 8e58ca8e0212ee9d1c7dc6a42121849986c88486
Kingfisher: 64278f126a815d0e2d391cdf71311b85882c4de0
livekit_client: a6f5fa86ac28ccd7ded53626a5379961db311ab4
local_auth_darwin: c3ee6cce0a8d56be34c8ccb66ba31f7f180aaebb
media_kit_libs_ios_video: 5a18affdb97d1f5d466dc79988b13eff6c5e2854
media_kit_video: 1746e198cb697d1ffb734b1d05ec429d1fcd1474

View File

@@ -120,13 +120,24 @@ void main() async {
windowButtonVisibility: true,
);
windowManager.waitUntilReadyToShow(windowOptions, () async {
final env = Platform.environment;
final isWayland = env.containsKey('WAYLAND_DISPLAY');
if (isWayland) {
try {
await windowManager.setAsFrameless();
} catch (e) {
debugPrint('[Wayland] setAsFrameless failed: $e');
}
}
await windowManager.setMinimumSize(defaultSize);
await windowManager.show();
await windowManager.focus();
final opacity = prefs.getDouble(kAppWindowOpacity) ?? 1.0;
await windowManager.setOpacity(opacity);
talker.info(
"[SplashScreen] Desktop window is ready with size: ${initialSize.width}x${initialSize.height}",
"[SplashScreen] Desktop window is ready with size: ${initialSize.width}x${initialSize.height}"
"${isWayland ? " (Wayland frameless fix applied)" : ""}",
);
});
}

View File

@@ -149,6 +149,8 @@ sealed class CallParticipant with _$CallParticipant {
const factory CallParticipant({
required String identity,
required String name,
required String accountId,
@Default(null) SnAccount? account,
required DateTime joinedAt,
}) = _CallParticipant;

View File

@@ -2241,7 +2241,7 @@ as List<CallParticipant>,
/// @nodoc
mixin _$CallParticipant {
String get identity; String get name; DateTime get joinedAt;
String get identity; String get name; String get accountId; SnAccount? get account; DateTime get joinedAt;
/// Create a copy of CallParticipant
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -2254,16 +2254,16 @@ $CallParticipantCopyWith<CallParticipant> get copyWith => _$CallParticipantCopyW
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is CallParticipant&&(identical(other.identity, identity) || other.identity == identity)&&(identical(other.name, name) || other.name == name)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt));
return identical(this, other) || (other.runtimeType == runtimeType&&other is CallParticipant&&(identical(other.identity, identity) || other.identity == identity)&&(identical(other.name, name) || other.name == name)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,identity,name,joinedAt);
int get hashCode => Object.hash(runtimeType,identity,name,accountId,account,joinedAt);
@override
String toString() {
return 'CallParticipant(identity: $identity, name: $name, joinedAt: $joinedAt)';
return 'CallParticipant(identity: $identity, name: $name, accountId: $accountId, account: $account, joinedAt: $joinedAt)';
}
@@ -2274,11 +2274,11 @@ abstract mixin class $CallParticipantCopyWith<$Res> {
factory $CallParticipantCopyWith(CallParticipant value, $Res Function(CallParticipant) _then) = _$CallParticipantCopyWithImpl;
@useResult
$Res call({
String identity, String name, DateTime joinedAt
String identity, String name, String accountId, SnAccount? account, DateTime joinedAt
});
$SnAccountCopyWith<$Res>? get account;
}
/// @nodoc
@@ -2291,15 +2291,29 @@ class _$CallParticipantCopyWithImpl<$Res>
/// Create a copy of CallParticipant
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? identity = null,Object? name = null,Object? joinedAt = null,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? identity = null,Object? name = null,Object? accountId = null,Object? account = freezed,Object? joinedAt = null,}) {
return _then(_self.copyWith(
identity: null == identity ? _self.identity : identity // ignore: cast_nullable_to_non_nullable
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,joinedAt: null == joinedAt ? _self.joinedAt : joinedAt // ignore: cast_nullable_to_non_nullable
as String,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
as String,account: freezed == account ? _self.account : account // ignore: cast_nullable_to_non_nullable
as SnAccount?,joinedAt: null == joinedAt ? _self.joinedAt : joinedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
));
}
/// Create a copy of CallParticipant
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SnAccountCopyWith<$Res>? get account {
if (_self.account == null) {
return null;
}
return $SnAccountCopyWith<$Res>(_self.account!, (value) {
return _then(_self.copyWith(account: value));
});
}
}
@@ -2378,10 +2392,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String identity, String name, DateTime joinedAt)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String identity, String name, String accountId, SnAccount? account, DateTime joinedAt)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _CallParticipant() when $default != null:
return $default(_that.identity,_that.name,_that.joinedAt);case _:
return $default(_that.identity,_that.name,_that.accountId,_that.account,_that.joinedAt);case _:
return orElse();
}
@@ -2399,10 +2413,10 @@ return $default(_that.identity,_that.name,_that.joinedAt);case _:
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String identity, String name, DateTime joinedAt) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String identity, String name, String accountId, SnAccount? account, DateTime joinedAt) $default,) {final _that = this;
switch (_that) {
case _CallParticipant():
return $default(_that.identity,_that.name,_that.joinedAt);}
return $default(_that.identity,_that.name,_that.accountId,_that.account,_that.joinedAt);}
}
/// A variant of `when` that fallback to returning `null`
///
@@ -2416,10 +2430,10 @@ return $default(_that.identity,_that.name,_that.joinedAt);}
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String identity, String name, DateTime joinedAt)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String identity, String name, String accountId, SnAccount? account, DateTime joinedAt)? $default,) {final _that = this;
switch (_that) {
case _CallParticipant() when $default != null:
return $default(_that.identity,_that.name,_that.joinedAt);case _:
return $default(_that.identity,_that.name,_that.accountId,_that.account,_that.joinedAt);case _:
return null;
}
@@ -2431,11 +2445,13 @@ return $default(_that.identity,_that.name,_that.joinedAt);case _:
@JsonSerializable()
class _CallParticipant implements CallParticipant {
const _CallParticipant({required this.identity, required this.name, required this.joinedAt});
const _CallParticipant({required this.identity, required this.name, required this.accountId, this.account = null, required this.joinedAt});
factory _CallParticipant.fromJson(Map<String, dynamic> json) => _$CallParticipantFromJson(json);
@override final String identity;
@override final String name;
@override final String accountId;
@override@JsonKey() final SnAccount? account;
@override final DateTime joinedAt;
/// Create a copy of CallParticipant
@@ -2451,16 +2467,16 @@ Map<String, dynamic> toJson() {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _CallParticipant&&(identical(other.identity, identity) || other.identity == identity)&&(identical(other.name, name) || other.name == name)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _CallParticipant&&(identical(other.identity, identity) || other.identity == identity)&&(identical(other.name, name) || other.name == name)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&(identical(other.joinedAt, joinedAt) || other.joinedAt == joinedAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,identity,name,joinedAt);
int get hashCode => Object.hash(runtimeType,identity,name,accountId,account,joinedAt);
@override
String toString() {
return 'CallParticipant(identity: $identity, name: $name, joinedAt: $joinedAt)';
return 'CallParticipant(identity: $identity, name: $name, accountId: $accountId, account: $account, joinedAt: $joinedAt)';
}
@@ -2471,11 +2487,11 @@ abstract mixin class _$CallParticipantCopyWith<$Res> implements $CallParticipant
factory _$CallParticipantCopyWith(_CallParticipant value, $Res Function(_CallParticipant) _then) = __$CallParticipantCopyWithImpl;
@override @useResult
$Res call({
String identity, String name, DateTime joinedAt
String identity, String name, String accountId, SnAccount? account, DateTime joinedAt
});
@override $SnAccountCopyWith<$Res>? get account;
}
/// @nodoc
@@ -2488,16 +2504,30 @@ class __$CallParticipantCopyWithImpl<$Res>
/// Create a copy of CallParticipant
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? identity = null,Object? name = null,Object? joinedAt = null,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? identity = null,Object? name = null,Object? accountId = null,Object? account = freezed,Object? joinedAt = null,}) {
return _then(_CallParticipant(
identity: null == identity ? _self.identity : identity // ignore: cast_nullable_to_non_nullable
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,joinedAt: null == joinedAt ? _self.joinedAt : joinedAt // ignore: cast_nullable_to_non_nullable
as String,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
as String,account: freezed == account ? _self.account : account // ignore: cast_nullable_to_non_nullable
as SnAccount?,joinedAt: null == joinedAt ? _self.joinedAt : joinedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
));
}
/// Create a copy of CallParticipant
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SnAccountCopyWith<$Res>? get account {
if (_self.account == null) {
return null;
}
return $SnAccountCopyWith<$Res>(_self.account!, (value) {
return _then(_self.copyWith(account: value));
});
}
}

View File

@@ -275,6 +275,11 @@ _CallParticipant _$CallParticipantFromJson(Map<String, dynamic> json) =>
_CallParticipant(
identity: json['identity'] as String,
name: json['name'] as String,
accountId: json['account_id'] as String,
account:
json['account'] == null
? null
: SnAccount.fromJson(json['account'] as Map<String, dynamic>),
joinedAt: DateTime.parse(json['joined_at'] as String),
);
@@ -282,6 +287,8 @@ Map<String, dynamic> _$CallParticipantToJson(_CallParticipant instance) =>
<String, dynamic>{
'identity': instance.identity,
'name': instance.name,
'account_id': instance.accountId,
'account': instance.account?.toJson(),
'joined_at': instance.joinedAt.toIso8601String(),
};

View File

@@ -3,13 +3,15 @@ import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:island/widgets/alert.dart';
import 'package:island/pods/config.dart';
import 'package:island/pods/userinfo.dart';
import 'package:island/widgets/chat/call_button.dart';
import 'package:livekit_client/livekit_client.dart' as lk;
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:island/pods/network.dart';
import 'package:island/models/chat.dart';
import 'package:island/models/account.dart';
import 'package:island/pods/chat/webrtc_manager.dart';
import 'package:wakelock_plus/wakelock_plus.dart';
import 'package:island/talker.dart';
@@ -43,193 +45,212 @@ sealed class CallParticipantLive with _$CallParticipantLive {
const factory CallParticipantLive({
required CallParticipant participant,
required lk.Participant remoteParticipant,
required WebRTCParticipant remoteParticipant,
}) = _CallParticipantLive;
bool get isSpeaking => remoteParticipant.isSpeaking;
bool get isMuted =>
remoteParticipant.isMuted || !remoteParticipant.isMicrophoneEnabled();
bool get isScreenSharing => remoteParticipant.isScreenShareEnabled();
bool get isScreenSharingWithAudio =>
remoteParticipant.isScreenShareAudioEnabled();
bool get isSpeaking {
// Use the actual audio level from WebRTC monitoring
return remoteParticipant.audioLevel > 0.1; // Threshold for speaking
}
bool get hasVideo => remoteParticipant.hasVideo;
bool get hasAudio => remoteParticipant.hasAudio;
double get audioLevel => remoteParticipant.audioLevel;
bool get isMuted => !remoteParticipant.isAudioEnabled;
bool get isScreenSharing => remoteParticipant.isVideoEnabled; // Simplified
bool get isScreenSharingWithAudio => false; // TODO: Implement screen sharing
bool get hasVideo => remoteParticipant.isVideoEnabled;
bool get hasAudio => remoteParticipant.isAudioEnabled;
}
@Riverpod(keepAlive: true)
class CallNotifier extends _$CallNotifier {
lk.Room? _room;
lk.LocalParticipant? _localParticipant;
WebRTCManager? _webrtcManager;
List<CallParticipantLive> _participants = [];
final Map<String, CallParticipant> _participantInfoByIdentity = {};
lk.EventsListener? _roomListener;
StreamSubscription<WebRTCParticipant>? _participantJoinedSubscription;
StreamSubscription<String>? _participantLeftSubscription;
List<CallParticipantLive> get participants =>
List.unmodifiable(_participants);
lk.LocalParticipant? get localParticipant => _localParticipant;
Map<String, double> participantsVolumes = {};
Timer? _durationTimer;
lk.Room? get room => _room;
String? _roomId;
String? get roomId => _roomId;
WebRTCManager? get webrtcManager => _webrtcManager;
@override
CallState build() {
// Subscribe to websocket updates
return const CallState(
isConnected: false,
isMicrophoneEnabled: true,
isCameraEnabled: false,
isMicrophoneEnabled:
true, // Audio enabled by default (matches WebRTC init)
isCameraEnabled: true, // Video enabled by default (matches WebRTC init)
isScreenSharing: false,
isSpeakerphone: true,
);
}
void _initRoomListeners() {
if (_room == null) return;
_roomListener?.dispose();
_roomListener = _room!.createListener();
_room!.addListener(_onRoomChange);
_roomListener!
..on<lk.ParticipantConnectedEvent>((e) {
_refreshLiveParticipants();
})
..on<lk.RoomDisconnectedEvent>((e) {
_participants = [];
state = state.copyWith();
});
}
void _initWebRTCListeners() {
_participantJoinedSubscription?.cancel();
_participantLeftSubscription?.cancel();
void _onRoomChange() {
_refreshLiveParticipants();
}
void _refreshLiveParticipants() {
if (_room == null) return;
final remoteParticipants = _room!.remoteParticipants;
_participants = [];
// Add local participant first if available
if (_localParticipant != null) {
final localInfo = _buildParticipant();
_participants.add(
CallParticipantLive(
participant: localInfo,
remoteParticipant: _localParticipant!,
),
);
}
// Add remote participants
_participants.addAll(
remoteParticipants.values.map((remote) {
final match =
_participantInfoByIdentity[remote.identity] ??
CallParticipant(
identity: remote.identity,
name: remote.identity,
joinedAt: DateTime.now(),
);
return CallParticipantLive(
participant: match,
remoteParticipant: remote,
);
}),
_participantJoinedSubscription = _webrtcManager?.onParticipantJoined.listen(
(participant) {
_updateLiveParticipantsFromWebRTC();
},
);
_participantLeftSubscription = _webrtcManager?.onParticipantLeft.listen((
participantId,
) {
_participants.removeWhere((p) => p.remoteParticipant.id == participantId);
state = state.copyWith();
});
// Add local participant immediately when WebRTC is initialized
final userinfo = ref.watch(userInfoProvider);
if (userinfo.value != null) {
_addLocalParticipant(userinfo.value!);
}
}
void _addLocalParticipant(SnAccount userinfo) {
if (_webrtcManager == null) return;
// Remove any existing local participant first
_participants.removeWhere((p) => p.participant.identity == userinfo.id);
// Add local participant (current user)
final localParticipant = CallParticipantLive(
participant: CallParticipant(
identity: userinfo.id, // Use roomId as local identity
name: userinfo.name,
accountId: userinfo.id,
account: userinfo,
joinedAt: DateTime.now(),
),
remoteParticipant: WebRTCParticipant(
id: _webrtcManager!.roomId,
name: userinfo.nick,
userinfo: userinfo,
isLocal: true,
)..remoteStream = _webrtcManager!.localStream, // Access local stream
);
_participants.insert(0, localParticipant); // Add at the beginning
state = state.copyWith();
}
/// Builds the CallParticipant object for the local participant.
/// Optionally, pass [participants] if you want to prioritize info from the latest list.
CallParticipant _buildParticipant({List<CallParticipant>? participants}) {
if (_localParticipant == null) {
throw StateError('No local participant available');
}
// Prefer info from the latest participants list if available
if (participants != null) {
final idx = participants.indexWhere(
(p) => p.identity == _localParticipant!.identity,
);
if (idx != -1) return participants[idx];
}
void _updateLiveParticipantsFromWebRTC() {
if (_webrtcManager == null) return;
// Otherwise, use info from the identity map or fallback to minimal
return _participantInfoByIdentity[_localParticipant!.identity] ??
CallParticipant(
identity: _localParticipant!.identity,
name: _localParticipant!.identity,
joinedAt: DateTime.now(),
);
}
final webrtcParticipants = _webrtcManager!.participants;
void _updateLiveParticipants(List<CallParticipant> participants) {
// Update the info map for lookup
for (final p in participants) {
_participantInfoByIdentity[p.identity] = p;
}
if (_room == null) {
// Can't build live objects, just store empty
_participants = [];
state = state.copyWith();
return;
}
final remoteParticipants = _room!.remoteParticipants;
final remotes = remoteParticipants.values.toList();
_participants = [];
// Add local participant if present in the list
if (_localParticipant != null) {
final localInfo = _buildParticipant(participants: participants);
_participants.add(
CallParticipantLive(
participant: localInfo,
remoteParticipant: _localParticipant!,
),
);
state = state.copyWith();
}
// Add remote participants
_participants.addAll(
participants.map((p) {
lk.RemoteParticipant? remote;
for (final r in remotes) {
if (r.identity == p.identity) {
remote = r;
break;
}
}
if (_localParticipant != null &&
p.identity == _localParticipant!.identity) {
return null; // Already added local
}
return remote != null
? CallParticipantLive(participant: p, remoteParticipant: remote)
// Always ensure local participant exists
final existingLocalParticipant =
_participants.isNotEmpty &&
_participants[0].remoteParticipant.id == _webrtcManager!.roomId
? _participants[0]
: null;
}).whereType<CallParticipantLive>(),
);
final localParticipant =
existingLocalParticipant ?? _createLocalParticipant();
// Add remote participants
final remoteParticipants =
webrtcParticipants.map((p) {
final participantInfo =
_participantInfoByIdentity[p.id] ??
CallParticipant(
identity: p.id,
name: p.name,
accountId: p.userinfo.id,
account: p.userinfo,
joinedAt: DateTime.now(),
);
return CallParticipantLive(
participant: participantInfo,
remoteParticipant: p,
);
}).toList();
// Combine local participant with remote participants
_participants = [localParticipant, ...remoteParticipants];
state = state.copyWith();
}
String? _roomId;
String? get roomId => _roomId;
CallParticipantLive _createLocalParticipant() {
return CallParticipantLive(
participant: CallParticipant(
identity: _webrtcManager!.roomId, // Use roomId as local identity
name: 'You',
accountId: '',
account: null,
joinedAt: DateTime.now(),
),
remoteParticipant: WebRTCParticipant(
id: _webrtcManager!.roomId,
name: 'You',
userinfo: SnAccount(
id: '',
name: '',
nick: '',
language: '',
isSuperuser: false,
automatedId: null,
profile: SnAccountProfile(
id: '',
firstName: '',
middleName: '',
lastName: '',
bio: '',
gender: '',
pronouns: '',
location: '',
timeZone: '',
links: [],
experience: 0,
level: 0,
socialCredits: 0,
socialCreditsLevel: 0,
levelingProgress: 0,
picture: null,
background: null,
verification: null,
usernameColor: null,
createdAt: DateTime.now(),
updatedAt: DateTime.now(),
deletedAt: null,
),
perkSubscription: null,
createdAt: DateTime.now(),
updatedAt: DateTime.now(),
deletedAt: null,
),
)..remoteStream = _webrtcManager!.localStream, // Access local stream
);
}
Future<void> joinRoom(String roomId) async {
if (_roomId == roomId && _room != null) {
talker.info('[Call] Call skipped. Already has data');
return;
} else if (_room != null) {
if (!_room!.isDisposed &&
_room!.connectionState != lk.ConnectionState.disconnected) {
throw Exception('Call already connected');
if (_roomId == roomId && _webrtcManager != null) {
talker.info('[Call] Call skipped. Already connected to this room');
// Ensure state is connected even if we skip the join process
if (!state.isConnected) {
state = state.copyWith(isConnected: true);
}
return;
}
_roomId = roomId;
if (_room != null) {
await _room!.disconnect();
await _room!.dispose();
_room = null;
_localParticipant = null;
_participants = [];
}
// Clean up existing connection
await disconnect();
try {
final apiClient = ref.read(apiClientProvider);
final ongoingCall = await ref.read(ongoingCallProvider(roomId).future);
@@ -241,8 +262,11 @@ class CallNotifier extends _$CallNotifier {
// Parse join response
final joinResponse = ChatRealtimeJoinResponse.fromJson(data);
final participants = joinResponse.participants;
final String endpoint = joinResponse.endpoint;
final String token = joinResponse.token;
// Update participant info map
for (final p in participants) {
_participantInfoByIdentity[p.identity] = p;
}
// Setup duration timer
_durationTimer?.cancel();
@@ -257,47 +281,18 @@ class CallNotifier extends _$CallNotifier {
);
});
// Connect to LiveKit
_room = lk.Room();
// Initialize WebRTC manager
final serverUrl = ref.watch(serverUrlProvider);
await _room!.connect(
endpoint,
token,
connectOptions: lk.ConnectOptions(autoSubscribe: true),
roomOptions: lk.RoomOptions(adaptiveStream: true, dynacast: true),
fastConnectOptions: lk.FastConnectOptions(
microphone: lk.TrackOption(enabled: true),
),
);
_localParticipant = _room!.localParticipant;
_webrtcManager = WebRTCManager(roomId: roomId, serverUrl: serverUrl);
_initRoomListeners();
_updateLiveParticipants(participants);
await _webrtcManager!.initialize(ref);
_initWebRTCListeners();
if (!kIsWeb && (Platform.isIOS || Platform.isAndroid)) {
lk.Hardware.instance.setSpeakerphoneOn(true);
// TODO: Implement speakerphone control for WebRTC
}
// Listen for connection updates
_room!.addListener(() {
final wasConnected = state.isConnected;
final isNowConnected =
_room!.connectionState == lk.ConnectionState.connected;
state = state.copyWith(
isConnected: isNowConnected,
isMicrophoneEnabled: _localParticipant!.isMicrophoneEnabled(),
isCameraEnabled: _localParticipant!.isCameraEnabled(),
isScreenSharing: _localParticipant!.isScreenShareEnabled(),
);
// Enable wakelock when call connects
if (!wasConnected && isNowConnected) {
WakelockPlus.enable();
}
// Disable wakelock when call disconnects
else if (wasConnected && !isNowConnected) {
WakelockPlus.disable();
}
});
state = state.copyWith(isConnected: true);
// Enable wakelock when call connects
WakelockPlus.enable();
@@ -310,104 +305,114 @@ class CallNotifier extends _$CallNotifier {
}
Future<void> toggleMicrophone() async {
if (_localParticipant != null) {
const autostop = true;
final target = !_localParticipant!.isMicrophoneEnabled();
state = state.copyWith(isMicrophoneEnabled: target);
if (target) {
await _localParticipant!.audioTrackPublications.firstOrNull?.unmute(
stopOnMute: autostop,
);
} else {
await _localParticipant!.audioTrackPublications.firstOrNull?.mute(
stopOnMute: autostop,
);
}
state = state.copyWith();
final target = !state.isMicrophoneEnabled;
state = state.copyWith(isMicrophoneEnabled: target);
await _webrtcManager?.toggleMicrophone(target);
// Update local participant's audio state
if (_participants.isNotEmpty) {
_participants[0].remoteParticipant.isAudioEnabled = target;
state = state.copyWith(); // Trigger UI update
}
}
Future<void> toggleCamera() async {
if (_localParticipant != null) {
final target = !_localParticipant!.isCameraEnabled();
state = state.copyWith(isCameraEnabled: target);
await _localParticipant!.setCameraEnabled(target);
state = state.copyWith();
final target = !state.isCameraEnabled;
state = state.copyWith(isCameraEnabled: target);
await _webrtcManager?.toggleCamera(target);
// Update local participant's video state
if (_participants.isNotEmpty) {
_participants[0].remoteParticipant.isVideoEnabled = target;
state = state.copyWith(); // Trigger UI update
}
}
Future<void> toggleScreenShare(BuildContext context) async {
if (_localParticipant != null) {
final target = !_localParticipant!.isScreenShareEnabled();
state = state.copyWith(isScreenSharing: target);
if (_webrtcManager == null) return;
if (target && lk.lkPlatformIsDesktop()) {
try {
final source = await showDialog<DesktopCapturerSource>(
context: context,
builder: (context) => lk.ScreenSelectDialog(),
);
if (source == null) {
return;
}
var track = await lk.LocalVideoTrack.createScreenShareTrack(
lk.ScreenShareCaptureOptions(
sourceId: source.id,
maxFrameRate: 30.0,
captureScreenAudio: true,
),
);
await _localParticipant!.publishVideoTrack(track);
} catch (err) {
showErrorAlert(err);
}
return;
try {
if (state.isScreenSharing) {
// Stop screen sharing - switch back to camera
await _webrtcManager!.toggleCamera(state.isCameraEnabled);
state = state.copyWith(isScreenSharing: false);
} else {
await _localParticipant!.setScreenShareEnabled(target);
}
// Start screen sharing
if (WebRTC.platformIsDesktop) {
// For desktop, we need to get screen capture source
// This would require implementing a screen selection dialog
// For now, just toggle the state
state = state.copyWith(isScreenSharing: true);
} else if (WebRTC.platformIsWeb) {
// For web, get display media directly
await navigator.mediaDevices.getDisplayMedia({
'video': true,
'audio':
false, // Screen sharing typically doesn't include system audio
});
state = state.copyWith();
// Replace video track with screen sharing track
// This is a simplified implementation
state = state.copyWith(isScreenSharing: true);
}
}
} catch (e) {
talker.error('[Call] Screen sharing error: $e');
state = state.copyWith(error: 'Failed to toggle screen sharing: $e');
}
}
Future<void> toggleSpeakerphone() async {
state = state.copyWith(isSpeakerphone: !state.isSpeakerphone);
await lk.Hardware.instance.setSpeakerphoneOn(state.isSpeakerphone);
state = state.copyWith();
if (!kIsWeb && (Platform.isIOS || Platform.isAndroid)) {
try {
// For mobile platforms, we can control audio routing
// This is a simplified implementation
final newSpeakerphoneState = !state.isSpeakerphone;
state = state.copyWith(isSpeakerphone: newSpeakerphoneState);
// Note: Actual speakerphone control would require platform-specific code
// For a full implementation, you'd need to use platform channels
// to control audio routing on iOS/Android
talker.info('[Call] Speakerphone toggled to: $newSpeakerphoneState');
} catch (e) {
talker.error('[Call] Speakerphone control error: $e');
state = state.copyWith(error: 'Failed to toggle speakerphone: $e');
}
} else {
// For web/desktop, speakerphone control is handled by the browser/OS
state = state.copyWith(isSpeakerphone: !state.isSpeakerphone);
}
}
Future<void> disconnect() async {
if (_room != null) {
await _room!.disconnect();
state = state.copyWith(
isConnected: false,
isMicrophoneEnabled: false,
isCameraEnabled: false,
isScreenSharing: false,
);
// Disable wakelock when call disconnects
WakelockPlus.disable();
}
_webrtcManager?.dispose();
_webrtcManager = null;
_participantJoinedSubscription?.cancel();
_participantLeftSubscription?.cancel();
_participants.clear();
state = state.copyWith(
isConnected: false,
isMicrophoneEnabled: false,
isCameraEnabled: false,
isScreenSharing: false,
);
// Disable wakelock when call disconnects
WakelockPlus.disable();
}
void setParticipantVolume(CallParticipantLive live, double volume) {
if (participantsVolumes[live.remoteParticipant.sid] == null) {
participantsVolumes[live.remoteParticipant.sid] = 1;
}
Helper.setVolume(
volume,
live
.remoteParticipant
.audioTrackPublications
.first
.track!
.mediaStreamTrack,
// Store volume setting for this participant
// Note: WebRTC doesn't have built-in per-participant volume control
// This is just storing the preference for UI purposes
// Actual volume control would need to be implemented at the audio rendering level
participantsVolumes[live.remoteParticipant.id] = volume.clamp(0.0, 1.0);
talker.info(
'[Call] Volume set to $volume for participant ${live.remoteParticipant.id}',
);
participantsVolumes[live.remoteParticipant.sid] = volume;
}
double getParticipantVolume(CallParticipantLive live) {
return participantsVolumes[live.remoteParticipant.sid] ?? 1;
return participantsVolumes[live.remoteParticipant.id] ?? 1.0;
}
void dispose() {
@@ -418,9 +423,10 @@ class CallNotifier extends _$CallNotifier {
isCameraEnabled: false,
isScreenSharing: false,
);
_roomListener?.dispose();
_room?.removeListener(_onRoomChange);
_room?.dispose();
_participantJoinedSubscription?.cancel();
_participantLeftSubscription?.cancel();
_webrtcManager?.dispose();
_webrtcManager = null;
_durationTimer?.cancel();
_roomId = null;
participantsVolumes = {};

View File

@@ -295,7 +295,7 @@ as String?,
/// @nodoc
mixin _$CallParticipantLive implements DiagnosticableTreeMixin {
CallParticipant get participant; lk.Participant get remoteParticipant;
CallParticipant get participant; WebRTCParticipant get remoteParticipant;
/// Create a copy of CallParticipantLive
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -332,7 +332,7 @@ abstract mixin class $CallParticipantLiveCopyWith<$Res> {
factory $CallParticipantLiveCopyWith(CallParticipantLive value, $Res Function(CallParticipantLive) _then) = _$CallParticipantLiveCopyWithImpl;
@useResult
$Res call({
CallParticipant participant, lk.Participant remoteParticipant
CallParticipant participant, WebRTCParticipant remoteParticipant
});
@@ -353,7 +353,7 @@ class _$CallParticipantLiveCopyWithImpl<$Res>
return _then(_self.copyWith(
participant: null == participant ? _self.participant : participant // ignore: cast_nullable_to_non_nullable
as CallParticipant,remoteParticipant: null == remoteParticipant ? _self.remoteParticipant : remoteParticipant // ignore: cast_nullable_to_non_nullable
as lk.Participant,
as WebRTCParticipant,
));
}
/// Create a copy of CallParticipantLive
@@ -444,7 +444,7 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( CallParticipant participant, lk.Participant remoteParticipant)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( CallParticipant participant, WebRTCParticipant remoteParticipant)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _CallParticipantLive() when $default != null:
return $default(_that.participant,_that.remoteParticipant);case _:
@@ -465,7 +465,7 @@ return $default(_that.participant,_that.remoteParticipant);case _:
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( CallParticipant participant, lk.Participant remoteParticipant) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( CallParticipant participant, WebRTCParticipant remoteParticipant) $default,) {final _that = this;
switch (_that) {
case _CallParticipantLive():
return $default(_that.participant,_that.remoteParticipant);}
@@ -482,7 +482,7 @@ return $default(_that.participant,_that.remoteParticipant);}
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( CallParticipant participant, lk.Participant remoteParticipant)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( CallParticipant participant, WebRTCParticipant remoteParticipant)? $default,) {final _that = this;
switch (_that) {
case _CallParticipantLive() when $default != null:
return $default(_that.participant,_that.remoteParticipant);case _:
@@ -501,7 +501,7 @@ class _CallParticipantLive extends CallParticipantLive with DiagnosticableTreeMi
@override final CallParticipant participant;
@override final lk.Participant remoteParticipant;
@override final WebRTCParticipant remoteParticipant;
/// Create a copy of CallParticipantLive
/// with the given fields replaced by the non-null parameter values.
@@ -539,7 +539,7 @@ abstract mixin class _$CallParticipantLiveCopyWith<$Res> implements $CallPartici
factory _$CallParticipantLiveCopyWith(_CallParticipantLive value, $Res Function(_CallParticipantLive) _then) = __$CallParticipantLiveCopyWithImpl;
@override @useResult
$Res call({
CallParticipant participant, lk.Participant remoteParticipant
CallParticipant participant, WebRTCParticipant remoteParticipant
});
@@ -560,7 +560,7 @@ class __$CallParticipantLiveCopyWithImpl<$Res>
return _then(_CallParticipantLive(
participant: null == participant ? _self.participant : participant // ignore: cast_nullable_to_non_nullable
as CallParticipant,remoteParticipant: null == remoteParticipant ? _self.remoteParticipant : remoteParticipant // ignore: cast_nullable_to_non_nullable
as lk.Participant,
as WebRTCParticipant,
));
}

View File

@@ -6,7 +6,7 @@ part of 'call.dart';
// RiverpodGenerator
// **************************************************************************
String _$callNotifierHash() => r'a8ca3f625c0db3ad9992033ae70864ce15efc281';
String _$callNotifierHash() => r'4015d326388553c46859fe537e84d2c9da4236c9';
/// See also [CallNotifier].
@ProviderFor(CallNotifier)

View File

@@ -0,0 +1,476 @@
import 'dart:async';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:island/models/account.dart';
import 'package:island/pods/chat/webrtc_signaling.dart';
import 'package:island/pods/userinfo.dart';
import 'package:island/talker.dart';
class WebRTCParticipant {
final String id;
final String name;
final SnAccount userinfo;
RTCPeerConnection? peerConnection;
MediaStream? remoteStream;
List<RTCIceCandidate> remoteCandidates = [];
bool isAudioEnabled = true;
bool isVideoEnabled = false;
bool isConnected = false;
bool isLocal = false;
double audioLevel = 0.0;
WebRTCParticipant({
required this.id,
required this.name,
required this.userinfo,
this.isAudioEnabled = true,
this.isVideoEnabled = false,
this.isLocal = false,
});
}
class WebRTCManager {
final String roomId;
final String serverUrl;
late WebRTCSignaling _signaling;
final Map<String, WebRTCParticipant> _participants = {};
final Map<String, RTCPeerConnection> _peerConnections = {};
MediaStream? _localStream;
Timer? _audioLevelTimer;
MediaStream? get localStream => _localStream;
final StreamController<WebRTCParticipant> _participantController =
StreamController<WebRTCParticipant>.broadcast();
final StreamController<String> _participantLeftController =
StreamController<String>.broadcast();
Stream<WebRTCParticipant> get onParticipantJoined =>
_participantController.stream;
Stream<String> get onParticipantLeft => _participantLeftController.stream;
WebRTCManager({required this.roomId, required this.serverUrl}) {
_signaling = WebRTCSignaling(roomId: roomId);
}
Future<void> initialize(Ref ref) async {
final user = ref.watch(userInfoProvider).value!;
_signaling.userId = user.id;
_signaling.userName = user.name;
_signaling.user = user;
await _initializeLocalStream();
_setupSignalingListeners();
await _signaling.connect(ref);
_startAudioLevelMonitoring();
}
Future<void> _initializeLocalStream() async {
try {
_localStream = await navigator.mediaDevices.getUserMedia({
'audio': true,
'video': true,
});
talker.info('[WebRTC] Local stream initialized');
} catch (e) {
talker.error('[WebRTC] Failed to initialize local stream: $e');
rethrow;
}
}
void _setupSignalingListeners() {
_signaling.messages.listen((message) async {
switch (message.type) {
case 'offer':
await _handleOffer(message.accountId, message.account, message.data);
break;
case 'answer':
await _handleAnswer(message.accountId, message.data);
break;
case 'ice-candidate':
await _handleIceCandidate(message.accountId, message.data);
break;
// CHANGED: Listen for new users joining the room.
case 'user-joined':
await _handleUserJoined(message.accountId, message.account);
break;
default:
talker.warning(
'[WebRTC Manager] Receieved an unknown type singaling message: ${message.type} with ${message.data}',
);
}
});
// CHANGED: The welcome message now drives connection initiation.
_signaling.welcomeMessages.listen((welcome) {
talker.info('[WebRTC Manager] Connected to room: ${welcome.roomId}');
final existingParticipants =
welcome.participants; // Assuming the server sends this.
talker.info(
'[WebRTC Manager] Existing participants: $existingParticipants',
);
// The newcomer is responsible for initiating the connection to everyone else.
for (final participant in existingParticipants) {
if (participant.identity != _signaling.userId) {
if (!_participants.containsKey(participant.identity)) {
final webrtcParticipant = WebRTCParticipant(
id: participant.identity,
name: participant.name,
userinfo: participant.account!,
);
_participants[participant.identity] = webrtcParticipant;
_participantController.add(webrtcParticipant);
}
_createPeerConnection(participant.identity, isInitiator: true);
}
}
});
}
// CHANGED: New handler for when an existing user is notified of a new peer.
Future<void> _handleUserJoined(
String participantId,
SnAccount account,
) async {
talker.info(
'[WebRTC Manager] User joined: $participantId. Waiting for their offer.',
);
// We don't need to be the initiator here. The newcomer will send us an offer.
// We just create the peer connection to be ready for it.
if (!_peerConnections.containsKey(participantId)) {
// Create a participant object to represent the new user
if (!_participants.containsKey(participantId)) {
final participant = WebRTCParticipant(
id: participantId,
name: participantId,
userinfo: account,
); // Placeholder name
_participants[participantId] = participant;
_participantController.add(participant);
}
await _createPeerConnection(participantId, isInitiator: false);
}
}
Future<void> _createPeerConnection(
String participantId, {
bool isInitiator = false,
}) async {
talker.info(
'[WebRTC] Creating peer connection to $participantId (initiator: $isInitiator)',
);
final configuration = {
'iceServers': [
{'urls': 'stun:stun.l.google.com:19302'},
],
};
final peerConnection = await createPeerConnection(configuration);
_peerConnections[participantId] = peerConnection;
_participants[participantId]!.peerConnection = peerConnection;
if (_localStream != null) {
for (final track in _localStream!.getTracks()) {
await peerConnection.addTrack(track, _localStream!);
}
}
peerConnection.onTrack = (event) {
if (event.streams.isNotEmpty) {
final participant = _participants[participantId];
if (participant != null) {
participant.remoteStream = event.streams[0];
participant.isConnected = true;
// Detect video tracks and update video enabled state
final videoTracks = event.streams[0].getVideoTracks();
if (videoTracks.isNotEmpty) {
participant.isVideoEnabled = true;
}
_participantController.add(participant);
}
}
};
peerConnection.onIceCandidate = (candidate) {
// CHANGED: Send candidate to the specific participant
_signaling.sendIceCandidate(participantId, candidate);
};
peerConnection.onConnectionState = (state) {
talker.info('[WebRTC] Connection state for $participantId: $state');
final participant = _participants[participantId];
if (participant != null) {
participant.isConnected =
state == RTCPeerConnectionState.RTCPeerConnectionStateConnected;
_participantController.add(participant);
}
};
if (isInitiator) {
final offer = await peerConnection.createOffer();
await peerConnection.setLocalDescription(offer);
// CHANGED: Send offer to the specific participant
_signaling.sendOffer(participantId, offer);
}
}
Future<void> _handleOffer(
String from,
SnAccount account,
Map<String, dynamic> data,
) async {
final participantId = from;
talker.info('[WebRTC Manager] Handling offer from $participantId');
final offer = RTCSessionDescription(data['sdp'], data['type']);
if (!_peerConnections.containsKey(participantId)) {
if (!_participants.containsKey(participantId)) {
final participant = WebRTCParticipant(
id: participantId,
name: participantId,
userinfo: account,
);
_participants[participantId] = participant;
_participantController.add(participant);
}
await _createPeerConnection(participantId, isInitiator: false);
}
final peerConnection = _peerConnections[participantId]!;
await peerConnection.setRemoteDescription(offer);
final answer = await peerConnection.createAnswer();
await peerConnection.setLocalDescription(answer);
// CHANGED: Send answer to the specific participant
_signaling.sendAnswer(participantId, answer);
// Process any queued ICE candidates
final participant = _participants[participantId];
if (participant != null) {
for (final candidate in participant.remoteCandidates) {
await peerConnection.addCandidate(candidate);
}
participant.remoteCandidates.clear();
}
}
Future<void> _handleAnswer(String from, Map<String, dynamic> data) async {
final participantId = from;
talker.info('[WebRTC Manager] Handling answer from $participantId');
final answer = RTCSessionDescription(data['sdp'], data['type']);
final peerConnection = _peerConnections[participantId];
if (peerConnection != null) {
await peerConnection.setRemoteDescription(answer);
// Process any queued ICE candidates
final participant = _participants[participantId];
if (participant != null) {
for (final candidate in participant.remoteCandidates) {
await peerConnection.addCandidate(candidate);
}
participant.remoteCandidates.clear();
}
}
}
Future<void> _handleIceCandidate(
String from,
Map<String, dynamic> data,
) async {
final participantId = from;
final candidate = RTCIceCandidate(
data['candidate'],
data['sdpMid'],
data['sdpMLineIndex'],
);
final participant = _participants[participantId];
if (participant != null) {
final pc = participant.peerConnection;
if (pc != null) {
await pc.addCandidate(candidate);
} else {
participant.remoteCandidates.add(candidate);
}
}
}
Future<void> replaceMediaStream(Map<String, dynamic> constraints) async {
try {
final newStream = await navigator.mediaDevices.getUserMedia(constraints);
final newVideoTrack = newStream.getVideoTracks().firstOrNull;
final newAudioTrack = newStream.getAudioTracks().firstOrNull;
if (_localStream != null) {
final oldVideoTrack = _localStream!.getVideoTracks().firstOrNull;
final oldAudioTrack = _localStream!.getAudioTracks().firstOrNull;
// Replace tracks in all existing peer connections
for (final pc in _peerConnections.values) {
final senders = await pc.getSenders();
for (final sender in senders) {
if (newVideoTrack != null && sender.track == oldVideoTrack) {
await sender.replaceTrack(newVideoTrack);
} else if (newAudioTrack != null && sender.track == oldAudioTrack) {
await sender.replaceTrack(newAudioTrack);
}
}
}
// Stop old tracks and update local stream
for (final track in _localStream!.getTracks()) {
track.stop();
}
}
_localStream = newStream;
talker.info('[WebRTC] Media stream replaced with new constraints');
} catch (e) {
talker.error('[WebRTC] Failed to replace media stream: $e');
rethrow;
}
}
Future<void> toggleMicrophone(bool enabled) async {
if (_localStream != null) {
final audioTracks = _localStream!.getAudioTracks();
for (final track in audioTracks) {
track.enabled = enabled;
}
}
}
Future<void> toggleCamera(bool enabled) async {
if (_localStream != null) {
_localStream!.getVideoTracks().forEach((track) {
track.enabled = enabled;
});
}
}
Future<void> switchCamera(String deviceId) async {
await replaceMediaStream({
'audio': _localStream?.getAudioTracks().isNotEmpty ?? true,
'video': {'deviceId': deviceId},
});
talker.info('[WebRTC] Switched to camera device: $deviceId');
}
Future<void> switchMicrophone(String deviceId) async {
await replaceMediaStream({
'audio': {'deviceId': deviceId},
'video': _localStream?.getVideoTracks().isNotEmpty ?? true,
});
talker.info('[WebRTC] Switched to microphone device: $deviceId');
}
Future<List<MediaDeviceInfo>> getVideoDevices() async {
try {
final devices = await navigator.mediaDevices.enumerateDevices();
return devices.where((device) => device.kind == 'videoinput').toList();
} catch (e) {
talker.error('[WebRTC] Failed to enumerate video devices: $e');
return [];
}
}
Future<List<MediaDeviceInfo>> getAudioDevices() async {
try {
final devices = await navigator.mediaDevices.enumerateDevices();
return devices.where((device) => device.kind == 'audioinput').toList();
} catch (e) {
talker.error('[WebRTC] Failed to enumerate audio devices: $e');
return [];
}
}
void _startAudioLevelMonitoring() {
_audioLevelTimer?.cancel();
_audioLevelTimer = Timer.periodic(const Duration(milliseconds: 100), (_) {
_updateAudioLevels();
});
}
void _stopAudioLevelMonitoring() {
_audioLevelTimer?.cancel();
_audioLevelTimer = null;
}
Future<void> _updateAudioLevels() async {
bool hasUpdates = false;
for (final participant in _participants.values) {
if (participant.remoteStream != null && participant.isAudioEnabled) {
final audioTracks = participant.remoteStream!.getAudioTracks();
if (audioTracks.isNotEmpty) {
try {
// Try to get stats for more accurate audio level detection
final pc = participant.peerConnection;
if (pc != null) {
final stats = await pc.getStats();
double maxAudioLevel = 0.0;
// Look for audio receiver stats
for (var report in stats) {
if (report.type == 'inbound-rtp' &&
report.values['mediaType'] == 'audio') {
final audioLevel = report.values['audioLevel'] as double?;
if (audioLevel != null && audioLevel > maxAudioLevel) {
maxAudioLevel = audioLevel;
}
}
}
// If we got stats, use them; otherwise use a simple heuristic
if (maxAudioLevel > 0) {
participant.audioLevel = maxAudioLevel.clamp(0.0, 1.0);
} else {
// Simple heuristic: if audio track is enabled, assume some level
// In a real app, you'd analyze the actual audio data
participant.audioLevel = audioTracks[0].enabled ? 0.5 : 0.0;
}
} else {
// Fallback for local participant or when no PC available
participant.audioLevel = participant.isLocal ? 0.0 : 0.3;
}
hasUpdates = true;
} catch (e) {
talker.warning('[WebRTC] Failed to update audio level for ${participant.id}: $e');
participant.audioLevel = 0.0;
}
} else {
participant.audioLevel = 0.0;
}
} else {
participant.audioLevel = 0.0;
}
}
// Notify listeners if there were updates (throttled to avoid excessive updates)
if (hasUpdates) {
// This will trigger UI updates for speaking indicators
}
}
List<WebRTCParticipant> get participants => _participants.values.toList();
void dispose() {
_stopAudioLevelMonitoring();
_signaling.disconnect();
for (final pc in _peerConnections.values) {
pc.close();
}
_peerConnections.clear();
for (var p in _participants.values) {
p.remoteCandidates.clear();
}
_participants.clear();
_localStream?.dispose();
_participantController.close();
_participantLeftController.close();
}
}

View File

@@ -0,0 +1,211 @@
import 'dart:async';
import 'dart:convert';
import 'package:flutter/foundation.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:island/models/account.dart';
import 'package:island/models/chat.dart';
import 'package:island/pods/config.dart';
import 'package:island/pods/network.dart';
import 'package:island/pods/websocket.dart';
import 'package:web_socket_channel/io.dart';
import 'package:web_socket_channel/web_socket_channel.dart';
import 'package:island/talker.dart';
part 'webrtc_signaling.freezed.dart';
part 'webrtc_signaling.g.dart';
@freezed
sealed class SignalingMessage with _$SignalingMessage {
const factory SignalingMessage({
required String type,
// CHANGED: Added 'to' field for directed messaging
String? to,
required String accountId,
required SnAccount account,
required Map<String, dynamic> data,
}) = _SignalingMessage;
factory SignalingMessage.fromJson(Map<String, dynamic> json) =>
_$SignalingMessageFromJson(json);
}
@freezed
sealed class WebRTCWelcomeMessage with _$WebRTCWelcomeMessage {
const factory WebRTCWelcomeMessage({
required String userId,
required String roomId,
required String message,
required String timestamp,
// CHANGED: Added participants list
@Default([]) List<CallParticipant> participants,
}) = _WebRTCWelcomeMessage;
factory WebRTCWelcomeMessage.fromJson(Map<String, dynamic> json) =>
_$WebRTCWelcomeMessageFromJson(json);
}
class WebRTCSignaling {
final String roomId;
late final String userId;
late final String userName;
late SnAccount user;
final StreamController<SignalingMessage> _messageController =
StreamController<SignalingMessage>.broadcast();
final StreamController<WebRTCWelcomeMessage> _welcomeController =
StreamController<WebRTCWelcomeMessage>.broadcast();
WebSocketChannel? _channel;
Timer? _heartbeatTimer;
Stream<SignalingMessage> get messages => _messageController.stream;
Stream<WebRTCWelcomeMessage> get welcomeMessages => _welcomeController.stream;
WebRTCSignaling({required this.roomId});
Future<void> connect(Ref ref) async {
final baseUrl = ref.watch(serverUrlProvider);
final token = await getToken(ref.watch(tokenProvider));
final url = '$baseUrl/sphere/chat/realtime/$roomId'.replaceFirst(
'http',
'ws',
);
talker.info('[WebRTC Signaling] Trying connecting to $url');
try {
if (kIsWeb) {
_channel = WebSocketChannel.connect(Uri.parse('$url?tk=$token'));
} else {
_channel = IOWebSocketChannel.connect(
Uri.parse(url),
headers: {'Authorization': 'AtField $token'},
);
}
await _channel!.ready;
// Start heartbeat timer
_heartbeatTimer = Timer.periodic(const Duration(seconds: 30), (timer) => _sendHeartbeat());
_channel!.stream.listen(
(data) {
final dataStr =
data is Uint8List ? utf8.decode(data) : data.toString();
final packet = WebSocketPacket.fromJson(jsonDecode(dataStr));
talker.info(
'[WebRTC Signaling] Recieved a singal message with packet type: ${packet.type}',
);
if (packet.type == 'webrtc') {
try {
final welcomeMessage = WebRTCWelcomeMessage.fromJson(
packet.data!,
);
_welcomeController.add(welcomeMessage);
talker.info(
'[WebRTC Signaling] Welcome message received: ${welcomeMessage.message}',
);
} catch (e) {
talker.error(
'[WebRTC Signaling] Failed to parse welcome message: $e',
);
}
} else if (packet.type == 'webrtc.signal') {
try {
final signalingMessage = SignalingMessage.fromJson(packet.data!);
// CHANGED: Ensure we only process messages intended for us if the 'to' field is present
if (signalingMessage.to == null ||
signalingMessage.to == userId) {
_messageController.add(signalingMessage);
}
} catch (e) {
talker.error(
'[WebRTC Signaling] Failed to parse signaling message: $e',
);
}
}
},
onError: (error) {
talker.error('[WebRTC Signaling] WebSocket error: $error');
_messageController.addError(error);
_welcomeController.addError(error);
},
onDone: () {
talker.info('[WebRTC Signaling] WebSocket connection closed');
_messageController.close();
_welcomeController.close();
},
);
} catch (err) {
talker.error('[WebRTC Signaling] Failed to connect: $err');
_messageController.addError(err);
_welcomeController.addError(err);
}
}
void sendMessage(SignalingMessage message) {
if (_channel == null) return;
talker.info(
'[WebRTC Signaling] Sending a message with message type: ${message.type} to ${message.to}',
);
final packet = WebSocketPacket(
type: 'webrtc.signal',
data: message.toJson(),
);
_channel!.sink.add(jsonEncode(packet.toJson()));
}
// CHANGED: All send methods now correctly use the `to` parameter
void sendOffer(String to, RTCSessionDescription offer) {
sendMessage(
SignalingMessage(
type: 'offer',
to: to,
accountId: userId,
account: user,
data: {'sdp': offer.sdp, 'type': offer.type},
),
);
}
void sendAnswer(String to, RTCSessionDescription answer) {
sendMessage(
SignalingMessage(
type: 'answer',
to: to,
accountId: userId,
account: user,
data: {'sdp': answer.sdp, 'type': answer.type},
),
);
}
void sendIceCandidate(String to, RTCIceCandidate candidate) {
sendMessage(
SignalingMessage(
type: 'ice-candidate',
to: to,
accountId: userId,
account: user,
data: {
'candidate': candidate.candidate,
'sdpMid': candidate.sdpMid,
'sdpMLineIndex': candidate.sdpMLineIndex,
},
),
);
}
void _sendHeartbeat() {
if (_channel == null) return;
talker.info('[WebRTC Signaling] Sending heartbeat');
final packet = WebSocketPacket(type: 'heartbeat', data: null);
_channel!.sink.add(jsonEncode(packet.toJson()));
}
void disconnect() {
_heartbeatTimer?.cancel();
_channel?.sink.close();
_messageController.close();
_welcomeController.close();
}
}

View File

@@ -0,0 +1,611 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'webrtc_signaling.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$SignalingMessage implements DiagnosticableTreeMixin {
String get type;// CHANGED: Added 'to' field for directed messaging
String? get to; String get accountId; SnAccount get account; Map<String, dynamic> get data;
/// Create a copy of SignalingMessage
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$SignalingMessageCopyWith<SignalingMessage> get copyWith => _$SignalingMessageCopyWithImpl<SignalingMessage>(this as SignalingMessage, _$identity);
/// Serializes this SignalingMessage to a JSON map.
Map<String, dynamic> toJson();
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
properties
..add(DiagnosticsProperty('type', 'SignalingMessage'))
..add(DiagnosticsProperty('type', type))..add(DiagnosticsProperty('to', to))..add(DiagnosticsProperty('accountId', accountId))..add(DiagnosticsProperty('account', account))..add(DiagnosticsProperty('data', data));
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is SignalingMessage&&(identical(other.type, type) || other.type == type)&&(identical(other.to, to) || other.to == to)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&const DeepCollectionEquality().equals(other.data, data));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,type,to,accountId,account,const DeepCollectionEquality().hash(data));
@override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
return 'SignalingMessage(type: $type, to: $to, accountId: $accountId, account: $account, data: $data)';
}
}
/// @nodoc
abstract mixin class $SignalingMessageCopyWith<$Res> {
factory $SignalingMessageCopyWith(SignalingMessage value, $Res Function(SignalingMessage) _then) = _$SignalingMessageCopyWithImpl;
@useResult
$Res call({
String type, String? to, String accountId, SnAccount account, Map<String, dynamic> data
});
$SnAccountCopyWith<$Res> get account;
}
/// @nodoc
class _$SignalingMessageCopyWithImpl<$Res>
implements $SignalingMessageCopyWith<$Res> {
_$SignalingMessageCopyWithImpl(this._self, this._then);
final SignalingMessage _self;
final $Res Function(SignalingMessage) _then;
/// Create a copy of SignalingMessage
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? type = null,Object? to = freezed,Object? accountId = null,Object? account = null,Object? data = null,}) {
return _then(_self.copyWith(
type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String,to: freezed == to ? _self.to : to // ignore: cast_nullable_to_non_nullable
as String?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
as String,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable
as SnAccount,data: null == data ? _self.data : data // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>,
));
}
/// Create a copy of SignalingMessage
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SnAccountCopyWith<$Res> get account {
return $SnAccountCopyWith<$Res>(_self.account, (value) {
return _then(_self.copyWith(account: value));
});
}
}
/// Adds pattern-matching-related methods to [SignalingMessage].
extension SignalingMessagePatterns on SignalingMessage {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _SignalingMessage value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _SignalingMessage() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _SignalingMessage value) $default,){
final _that = this;
switch (_that) {
case _SignalingMessage():
return $default(_that);}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _SignalingMessage value)? $default,){
final _that = this;
switch (_that) {
case _SignalingMessage() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String type, String? to, String accountId, SnAccount account, Map<String, dynamic> data)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _SignalingMessage() when $default != null:
return $default(_that.type,_that.to,_that.accountId,_that.account,_that.data);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String type, String? to, String accountId, SnAccount account, Map<String, dynamic> data) $default,) {final _that = this;
switch (_that) {
case _SignalingMessage():
return $default(_that.type,_that.to,_that.accountId,_that.account,_that.data);}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String type, String? to, String accountId, SnAccount account, Map<String, dynamic> data)? $default,) {final _that = this;
switch (_that) {
case _SignalingMessage() when $default != null:
return $default(_that.type,_that.to,_that.accountId,_that.account,_that.data);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _SignalingMessage with DiagnosticableTreeMixin implements SignalingMessage {
const _SignalingMessage({required this.type, this.to, required this.accountId, required this.account, required final Map<String, dynamic> data}): _data = data;
factory _SignalingMessage.fromJson(Map<String, dynamic> json) => _$SignalingMessageFromJson(json);
@override final String type;
// CHANGED: Added 'to' field for directed messaging
@override final String? to;
@override final String accountId;
@override final SnAccount account;
final Map<String, dynamic> _data;
@override Map<String, dynamic> get data {
if (_data is EqualUnmodifiableMapView) return _data;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(_data);
}
/// Create a copy of SignalingMessage
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$SignalingMessageCopyWith<_SignalingMessage> get copyWith => __$SignalingMessageCopyWithImpl<_SignalingMessage>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$SignalingMessageToJson(this, );
}
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
properties
..add(DiagnosticsProperty('type', 'SignalingMessage'))
..add(DiagnosticsProperty('type', type))..add(DiagnosticsProperty('to', to))..add(DiagnosticsProperty('accountId', accountId))..add(DiagnosticsProperty('account', account))..add(DiagnosticsProperty('data', data));
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SignalingMessage&&(identical(other.type, type) || other.type == type)&&(identical(other.to, to) || other.to == to)&&(identical(other.accountId, accountId) || other.accountId == accountId)&&(identical(other.account, account) || other.account == account)&&const DeepCollectionEquality().equals(other._data, _data));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,type,to,accountId,account,const DeepCollectionEquality().hash(_data));
@override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
return 'SignalingMessage(type: $type, to: $to, accountId: $accountId, account: $account, data: $data)';
}
}
/// @nodoc
abstract mixin class _$SignalingMessageCopyWith<$Res> implements $SignalingMessageCopyWith<$Res> {
factory _$SignalingMessageCopyWith(_SignalingMessage value, $Res Function(_SignalingMessage) _then) = __$SignalingMessageCopyWithImpl;
@override @useResult
$Res call({
String type, String? to, String accountId, SnAccount account, Map<String, dynamic> data
});
@override $SnAccountCopyWith<$Res> get account;
}
/// @nodoc
class __$SignalingMessageCopyWithImpl<$Res>
implements _$SignalingMessageCopyWith<$Res> {
__$SignalingMessageCopyWithImpl(this._self, this._then);
final _SignalingMessage _self;
final $Res Function(_SignalingMessage) _then;
/// Create a copy of SignalingMessage
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? type = null,Object? to = freezed,Object? accountId = null,Object? account = null,Object? data = null,}) {
return _then(_SignalingMessage(
type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
as String,to: freezed == to ? _self.to : to // ignore: cast_nullable_to_non_nullable
as String?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable
as String,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable
as SnAccount,data: null == data ? _self._data : data // ignore: cast_nullable_to_non_nullable
as Map<String, dynamic>,
));
}
/// Create a copy of SignalingMessage
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$SnAccountCopyWith<$Res> get account {
return $SnAccountCopyWith<$Res>(_self.account, (value) {
return _then(_self.copyWith(account: value));
});
}
}
/// @nodoc
mixin _$WebRTCWelcomeMessage implements DiagnosticableTreeMixin {
String get userId; String get roomId; String get message; String get timestamp;// CHANGED: Added participants list
List<CallParticipant> get participants;
/// Create a copy of WebRTCWelcomeMessage
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$WebRTCWelcomeMessageCopyWith<WebRTCWelcomeMessage> get copyWith => _$WebRTCWelcomeMessageCopyWithImpl<WebRTCWelcomeMessage>(this as WebRTCWelcomeMessage, _$identity);
/// Serializes this WebRTCWelcomeMessage to a JSON map.
Map<String, dynamic> toJson();
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
properties
..add(DiagnosticsProperty('type', 'WebRTCWelcomeMessage'))
..add(DiagnosticsProperty('userId', userId))..add(DiagnosticsProperty('roomId', roomId))..add(DiagnosticsProperty('message', message))..add(DiagnosticsProperty('timestamp', timestamp))..add(DiagnosticsProperty('participants', participants));
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is WebRTCWelcomeMessage&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.roomId, roomId) || other.roomId == roomId)&&(identical(other.message, message) || other.message == message)&&(identical(other.timestamp, timestamp) || other.timestamp == timestamp)&&const DeepCollectionEquality().equals(other.participants, participants));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,userId,roomId,message,timestamp,const DeepCollectionEquality().hash(participants));
@override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
return 'WebRTCWelcomeMessage(userId: $userId, roomId: $roomId, message: $message, timestamp: $timestamp, participants: $participants)';
}
}
/// @nodoc
abstract mixin class $WebRTCWelcomeMessageCopyWith<$Res> {
factory $WebRTCWelcomeMessageCopyWith(WebRTCWelcomeMessage value, $Res Function(WebRTCWelcomeMessage) _then) = _$WebRTCWelcomeMessageCopyWithImpl;
@useResult
$Res call({
String userId, String roomId, String message, String timestamp, List<CallParticipant> participants
});
}
/// @nodoc
class _$WebRTCWelcomeMessageCopyWithImpl<$Res>
implements $WebRTCWelcomeMessageCopyWith<$Res> {
_$WebRTCWelcomeMessageCopyWithImpl(this._self, this._then);
final WebRTCWelcomeMessage _self;
final $Res Function(WebRTCWelcomeMessage) _then;
/// Create a copy of WebRTCWelcomeMessage
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? userId = null,Object? roomId = null,Object? message = null,Object? timestamp = null,Object? participants = null,}) {
return _then(_self.copyWith(
userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as String,roomId: null == roomId ? _self.roomId : roomId // ignore: cast_nullable_to_non_nullable
as String,message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
as String,timestamp: null == timestamp ? _self.timestamp : timestamp // ignore: cast_nullable_to_non_nullable
as String,participants: null == participants ? _self.participants : participants // ignore: cast_nullable_to_non_nullable
as List<CallParticipant>,
));
}
}
/// Adds pattern-matching-related methods to [WebRTCWelcomeMessage].
extension WebRTCWelcomeMessagePatterns on WebRTCWelcomeMessage {
/// A variant of `map` that fallback to returning `orElse`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _WebRTCWelcomeMessage value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _WebRTCWelcomeMessage() when $default != null:
return $default(_that);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// Callbacks receives the raw object, upcasted.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case final Subclass2 value:
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _WebRTCWelcomeMessage value) $default,){
final _that = this;
switch (_that) {
case _WebRTCWelcomeMessage():
return $default(_that);}
}
/// A variant of `map` that fallback to returning `null`.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case final Subclass value:
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _WebRTCWelcomeMessage value)? $default,){
final _that = this;
switch (_that) {
case _WebRTCWelcomeMessage() when $default != null:
return $default(_that);case _:
return null;
}
}
/// A variant of `when` that fallback to an `orElse` callback.
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return orElse();
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String userId, String roomId, String message, String timestamp, List<CallParticipant> participants)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _WebRTCWelcomeMessage() when $default != null:
return $default(_that.userId,_that.roomId,_that.message,_that.timestamp,_that.participants);case _:
return orElse();
}
}
/// A `switch`-like method, using callbacks.
///
/// As opposed to `map`, this offers destructuring.
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case Subclass2(:final field2):
/// return ...;
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String userId, String roomId, String message, String timestamp, List<CallParticipant> participants) $default,) {final _that = this;
switch (_that) {
case _WebRTCWelcomeMessage():
return $default(_that.userId,_that.roomId,_that.message,_that.timestamp,_that.participants);}
}
/// A variant of `when` that fallback to returning `null`
///
/// It is equivalent to doing:
/// ```dart
/// switch (sealedClass) {
/// case Subclass(:final field):
/// return ...;
/// case _:
/// return null;
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String userId, String roomId, String message, String timestamp, List<CallParticipant> participants)? $default,) {final _that = this;
switch (_that) {
case _WebRTCWelcomeMessage() when $default != null:
return $default(_that.userId,_that.roomId,_that.message,_that.timestamp,_that.participants);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _WebRTCWelcomeMessage with DiagnosticableTreeMixin implements WebRTCWelcomeMessage {
const _WebRTCWelcomeMessage({required this.userId, required this.roomId, required this.message, required this.timestamp, final List<CallParticipant> participants = const []}): _participants = participants;
factory _WebRTCWelcomeMessage.fromJson(Map<String, dynamic> json) => _$WebRTCWelcomeMessageFromJson(json);
@override final String userId;
@override final String roomId;
@override final String message;
@override final String timestamp;
// CHANGED: Added participants list
final List<CallParticipant> _participants;
// CHANGED: Added participants list
@override@JsonKey() List<CallParticipant> get participants {
if (_participants is EqualUnmodifiableListView) return _participants;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_participants);
}
/// Create a copy of WebRTCWelcomeMessage
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$WebRTCWelcomeMessageCopyWith<_WebRTCWelcomeMessage> get copyWith => __$WebRTCWelcomeMessageCopyWithImpl<_WebRTCWelcomeMessage>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$WebRTCWelcomeMessageToJson(this, );
}
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
properties
..add(DiagnosticsProperty('type', 'WebRTCWelcomeMessage'))
..add(DiagnosticsProperty('userId', userId))..add(DiagnosticsProperty('roomId', roomId))..add(DiagnosticsProperty('message', message))..add(DiagnosticsProperty('timestamp', timestamp))..add(DiagnosticsProperty('participants', participants));
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _WebRTCWelcomeMessage&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.roomId, roomId) || other.roomId == roomId)&&(identical(other.message, message) || other.message == message)&&(identical(other.timestamp, timestamp) || other.timestamp == timestamp)&&const DeepCollectionEquality().equals(other._participants, _participants));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,userId,roomId,message,timestamp,const DeepCollectionEquality().hash(_participants));
@override
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
return 'WebRTCWelcomeMessage(userId: $userId, roomId: $roomId, message: $message, timestamp: $timestamp, participants: $participants)';
}
}
/// @nodoc
abstract mixin class _$WebRTCWelcomeMessageCopyWith<$Res> implements $WebRTCWelcomeMessageCopyWith<$Res> {
factory _$WebRTCWelcomeMessageCopyWith(_WebRTCWelcomeMessage value, $Res Function(_WebRTCWelcomeMessage) _then) = __$WebRTCWelcomeMessageCopyWithImpl;
@override @useResult
$Res call({
String userId, String roomId, String message, String timestamp, List<CallParticipant> participants
});
}
/// @nodoc
class __$WebRTCWelcomeMessageCopyWithImpl<$Res>
implements _$WebRTCWelcomeMessageCopyWith<$Res> {
__$WebRTCWelcomeMessageCopyWithImpl(this._self, this._then);
final _WebRTCWelcomeMessage _self;
final $Res Function(_WebRTCWelcomeMessage) _then;
/// Create a copy of WebRTCWelcomeMessage
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? userId = null,Object? roomId = null,Object? message = null,Object? timestamp = null,Object? participants = null,}) {
return _then(_WebRTCWelcomeMessage(
userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as String,roomId: null == roomId ? _self.roomId : roomId // ignore: cast_nullable_to_non_nullable
as String,message: null == message ? _self.message : message // ignore: cast_nullable_to_non_nullable
as String,timestamp: null == timestamp ? _self.timestamp : timestamp // ignore: cast_nullable_to_non_nullable
as String,participants: null == participants ? _self._participants : participants // ignore: cast_nullable_to_non_nullable
as List<CallParticipant>,
));
}
}
// dart format on

View File

@@ -0,0 +1,49 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'webrtc_signaling.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_SignalingMessage _$SignalingMessageFromJson(Map<String, dynamic> json) =>
_SignalingMessage(
type: json['type'] as String,
to: json['to'] as String?,
accountId: json['account_id'] as String,
account: SnAccount.fromJson(json['account'] as Map<String, dynamic>),
data: json['data'] as Map<String, dynamic>,
);
Map<String, dynamic> _$SignalingMessageToJson(_SignalingMessage instance) =>
<String, dynamic>{
'type': instance.type,
'to': instance.to,
'account_id': instance.accountId,
'account': instance.account.toJson(),
'data': instance.data,
};
_WebRTCWelcomeMessage _$WebRTCWelcomeMessageFromJson(
Map<String, dynamic> json,
) => _WebRTCWelcomeMessage(
userId: json['user_id'] as String,
roomId: json['room_id'] as String,
message: json['message'] as String,
timestamp: json['timestamp'] as String,
participants:
(json['participants'] as List<dynamic>?)
?.map((e) => CallParticipant.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
);
Map<String, dynamic> _$WebRTCWelcomeMessageToJson(
_WebRTCWelcomeMessage instance,
) => <String, dynamic>{
'user_id': instance.userId,
'room_id': instance.roomId,
'message': instance.message,
'timestamp': instance.timestamp,
'participants': instance.participants.map((e) => e.toJson()).toList(),
};

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:dio_smart_retry/dio_smart_retry.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:dio/dio.dart';
@@ -109,6 +110,16 @@ final apiClientProvider = Provider<Dio>((ref) {
printResponseData: false,
),
),
RetryInterceptor(
dio: dio,
retries: 3,
retryDelays: const [
Duration(milliseconds: 300),
Duration(milliseconds: 500),
Duration(milliseconds: 1000),
],
retryEvaluator: (err, _) => err.requestOptions.method == 'GET',
),
]);
return dio;

View File

@@ -88,6 +88,7 @@ ThemeData createAppTheme(Brightness brightness, AppSettings settings) {
color: colorScheme.surfaceContainer.withOpacity(
settings.cardTransparency,
),
elevation: settings.cardTransparency <= 1 ? 0 : null,
),
pageTransitionsTheme: PageTransitionsTheme(
builders: {

View File

@@ -100,12 +100,16 @@ class WebSocketService {
}
},
onDone: () {
talker.info('[WebSocket] Connection closed, attempting to reconnect...');
talker.info(
'[WebSocket] Connection closed, attempting to reconnect...',
);
_scheduleReconnect();
_statusStreamController.sink.add(WebSocketState.disconnected());
},
onError: (error) {
talker.error('[WebSocket] Error occurred: $error, attempting to reconnect...');
talker.error(
'[WebSocket] Error occurred: $error, attempting to reconnect...',
);
_scheduleReconnect();
_statusStreamController.sink.add(
WebSocketState.error(error.toString()),

View File

@@ -25,7 +25,6 @@ import 'package:island/screens/tabs.dart';
import 'package:island/screens/explore.dart';
import 'package:island/screens/discovery/article_detail.dart';
import 'package:island/screens/account.dart';
import 'package:island/screens/notification.dart';
import 'package:island/screens/wallet.dart';
import 'package:island/screens/account/relationship.dart';
import 'package:island/screens/account/profile.dart';
@@ -392,11 +391,6 @@ final routerProvider = Provider<GoRouter>((ref) {
),
],
),
GoRoute(
name: 'notifications',
path: '/account/notifications',
builder: (context, state) => const NotificationScreen(),
),
GoRoute(
name: 'wallet',
path: '/account/wallet',

View File

@@ -282,7 +282,12 @@ class AccountScreen extends HookConsumerWidget {
],
),
onTap: () {
context.pushNamed('notifications');
showModalBottomSheet(
context: context,
isScrollControlled: true,
useRootNavigator: true,
builder: (context) => const NotificationSheet(),
);
},
),
ListTile(

View File

@@ -1,5 +1,5 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart' hide ConnectionState;
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:gap/gap.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
@@ -9,8 +9,6 @@ import 'package:island/widgets/app_scaffold.dart';
import 'package:island/widgets/chat/call_button.dart';
import 'package:island/widgets/chat/call_overlay.dart';
import 'package:island/widgets/chat/call_participant_tile.dart';
import 'package:island/widgets/alert.dart';
import 'package:livekit_client/livekit_client.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:styled_widget/styled_widget.dart';
@@ -26,32 +24,13 @@ class CallScreen extends HookConsumerWidget {
useEffect(() {
talker.info('[Call] Joining the call...');
callNotifier.joinRoom(roomId).catchError((_) {
showConfirmAlert(
'Seems there already has a call connected, do you want override it?',
'Call already connected',
).then((value) {
if (value != true) return;
talker.info('[Call] Joining the call... with overrides');
callNotifier.disconnect();
callNotifier.dispose();
callNotifier.joinRoom(roomId);
});
Future(() {
callNotifier.joinRoom(roomId);
});
return null;
}, []);
final allAudioOnly = callNotifier.participants.every(
(p) =>
!(p.hasVideo &&
p.remoteParticipant.trackPublications.values.any(
(pub) =>
pub.track != null &&
pub.kind == TrackType.VIDEO &&
!pub.muted &&
!pub.isDisposed,
)),
);
final allAudioOnly = callNotifier.participants.every((p) => !p.hasVideo);
return AppScaffold(
isNoBackground: false,
@@ -67,12 +46,7 @@ class CallScreen extends HookConsumerWidget {
Text(
callState.isConnected
? formatDuration(callState.duration)
: (switch (callNotifier.room?.connectionState) {
ConnectionState.connected => 'connected',
ConnectionState.connecting => 'connecting',
ConnectionState.reconnecting => 'reconnecting',
_ => 'disconnected',
}).tr(),
: 'connecting'.tr(),
style: const TextStyle(fontSize: 14),
),
],
@@ -159,19 +133,7 @@ class CallScreen extends HookConsumerWidget {
// Stage view: show main speaker(s) large, others in row
final mainSpeakers =
participants
.where(
(p) => p
.remoteParticipant
.trackPublications
.values
.any(
(pub) =>
pub.track != null &&
pub.kind == TrackType.VIDEO,
),
)
.toList();
participants.where((p) => p.hasVideo).toList();
if (mainSpeakers.isEmpty && participants.isNotEmpty) {
mainSpeakers.add(participants.first);
}

View File

@@ -20,6 +20,7 @@ class ArticleDetailScreen extends ConsumerWidget {
final articleAsync = ref.watch(articleDetailProvider(articleId));
return AppScaffold(
isNoBackground: false,
body: articleAsync.when(
data:
(article) => AppScaffold(

View File

@@ -54,7 +54,12 @@ Widget notificationIndicatorWidget(
trailing: const Icon(Symbols.chevron_right),
contentPadding: EdgeInsets.only(left: 16, right: 15),
onTap: () {
GoRouter.of(context).pushNamed('notifications');
showModalBottomSheet(
context: context,
isScrollControlled: true,
useRootNavigator: true,
builder: (context) => const NotificationSheet(),
);
},
),
);
@@ -330,7 +335,7 @@ class ExploreScreen extends HookConsumerWidget {
),
PostFeaturedList(),
PostComposeCard(
onSubmit: (post) {
onSubmit: () {
activitiesNotifier.forceRefresh();
},
),

View File

@@ -3,7 +3,6 @@ import 'dart:math' as math;
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:island/models/account.dart';
@@ -11,8 +10,8 @@ import 'package:island/pods/network.dart';
import 'package:island/pods/websocket.dart';
import 'package:island/route.dart';
import 'package:island/widgets/alert.dart';
import 'package:island/widgets/app_scaffold.dart';
import 'package:island/widgets/content/markdown.dart';
import 'package:island/widgets/content/sheet.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import 'package:relative_time/relative_time.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
@@ -113,8 +112,8 @@ class NotificationListNotifier extends _$NotificationListNotifier
}
}
class NotificationScreen extends HookConsumerWidget {
const NotificationScreen({super.key});
class NotificationSheet extends HookConsumerWidget {
const NotificationSheet({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
@@ -128,19 +127,15 @@ class NotificationScreen extends HookConsumerWidget {
ref.watch(notificationUnreadCountNotifierProvider.notifier).clear();
}
return AppScaffold(
appBar: AppBar(
leading: const PageBackButton(),
title: const Text('notifications').tr(),
actions: [
IconButton(
onPressed: markAllRead,
icon: const Icon(Symbols.mark_as_unread),
),
const Gap(8),
],
),
body: PagingHelperView(
return SheetScaffold(
titleText: 'notifications'.tr(),
actions: [
IconButton(
onPressed: markAllRead,
icon: const Icon(Symbols.mark_as_unread),
),
],
child: PagingHelperView(
provider: notificationListNotifierProvider,
futureRefreshable: notificationListNotifierProvider.future,
notifierRefreshable: notificationListNotifierProvider.notifier,

View File

@@ -8,6 +8,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:island/models/post.dart';
import 'package:island/models/publisher.dart';
import 'package:island/models/account.dart';
import 'package:island/models/heatmap.dart';
import 'package:island/pods/config.dart';
import 'package:island/pods/network.dart';
import 'package:island/services/color.dart';
@@ -20,6 +21,7 @@ import 'package:island/widgets/app_scaffold.dart';
import 'package:island/widgets/content/cloud_files.dart';
import 'package:island/widgets/content/markdown.dart';
import 'package:island/widgets/post/post_list.dart';
import 'package:island/widgets/activity_heatmap.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:island/services/color_extraction.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
@@ -222,6 +224,32 @@ class _PublisherBioWidget extends StatelessWidget {
}
}
class _PublisherHeatmapWidget extends StatelessWidget {
final AsyncValue<SnHeatmap?> heatmap;
final bool forceDense;
const _PublisherHeatmapWidget({
required this.heatmap,
this.forceDense = false,
});
@override
Widget build(BuildContext context) {
return heatmap.when(
data:
(data) =>
data != null
? ActivityHeatmapWidget(
heatmap: data,
forceDense: forceDense,
).padding(horizontal: 8)
: const SizedBox.shrink(),
loading: () => const SizedBox.shrink(),
error: (_, _) => const SizedBox.shrink(),
);
}
}
class _PublisherCategoryTabWidget extends StatelessWidget {
final TabController categoryTabController;
@@ -292,6 +320,13 @@ Future<Color?> publisherAppbarForcegroundColor(Ref ref, String pubName) async {
}
}
@riverpod
Future<SnHeatmap?> publisherHeatmap(Ref ref, String uname) async {
final apiClient = ref.watch(apiClientProvider);
final resp = await apiClient.get('/sphere/publishers/$uname/heatmap');
return SnHeatmap.fromJson(resp.data);
}
class PublisherProfileScreen extends HookConsumerWidget {
final String name;
const PublisherProfileScreen({super.key, required this.name});
@@ -301,6 +336,7 @@ class PublisherProfileScreen extends HookConsumerWidget {
final publisher = ref.watch(publisherProvider(name));
final badges = ref.watch(publisherBadgesProvider(name));
final subStatus = ref.watch(publisherSubscriptionStatusProvider(name));
final heatmap = ref.watch(publisherHeatmapProvider(name));
final appbarColor = ref.watch(
publisherAppbarForcegroundColorProvider(name),
);
@@ -446,6 +482,10 @@ class PublisherProfileScreen extends HookConsumerWidget {
),
_PublisherVerificationWidget(data: data),
_PublisherBioWidget(data: data),
_PublisherHeatmapWidget(
heatmap: heatmap,
forceDense: true,
),
],
),
),
@@ -517,6 +557,9 @@ class PublisherProfileScreen extends HookConsumerWidget {
SliverToBoxAdapter(
child: _PublisherBioWidget(data: data),
),
SliverToBoxAdapter(
child: _PublisherHeatmapWidget(heatmap: heatmap),
),
SliverPostList(pubName: name, pinned: true),
SliverToBoxAdapter(
child: _PublisherCategoryTabWidget(

View File

@@ -530,5 +530,126 @@ class _PublisherAppbarForcegroundColorProviderElement
(origin as PublisherAppbarForcegroundColorProvider).pubName;
}
String _$publisherHeatmapHash() => r'86db275ce3861a2855b5ec35fbfef85fc47b23a6';
/// See also [publisherHeatmap].
@ProviderFor(publisherHeatmap)
const publisherHeatmapProvider = PublisherHeatmapFamily();
/// See also [publisherHeatmap].
class PublisherHeatmapFamily extends Family<AsyncValue<SnHeatmap?>> {
/// See also [publisherHeatmap].
const PublisherHeatmapFamily();
/// See also [publisherHeatmap].
PublisherHeatmapProvider call(String uname) {
return PublisherHeatmapProvider(uname);
}
@override
PublisherHeatmapProvider getProviderOverride(
covariant PublisherHeatmapProvider provider,
) {
return call(provider.uname);
}
static const Iterable<ProviderOrFamily>? _dependencies = null;
@override
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
@override
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
_allTransitiveDependencies;
@override
String? get name => r'publisherHeatmapProvider';
}
/// See also [publisherHeatmap].
class PublisherHeatmapProvider extends AutoDisposeFutureProvider<SnHeatmap?> {
/// See also [publisherHeatmap].
PublisherHeatmapProvider(String uname)
: this._internal(
(ref) => publisherHeatmap(ref as PublisherHeatmapRef, uname),
from: publisherHeatmapProvider,
name: r'publisherHeatmapProvider',
debugGetCreateSourceHash:
const bool.fromEnvironment('dart.vm.product')
? null
: _$publisherHeatmapHash,
dependencies: PublisherHeatmapFamily._dependencies,
allTransitiveDependencies:
PublisherHeatmapFamily._allTransitiveDependencies,
uname: uname,
);
PublisherHeatmapProvider._internal(
super._createNotifier, {
required super.name,
required super.dependencies,
required super.allTransitiveDependencies,
required super.debugGetCreateSourceHash,
required super.from,
required this.uname,
}) : super.internal();
final String uname;
@override
Override overrideWith(
FutureOr<SnHeatmap?> Function(PublisherHeatmapRef provider) create,
) {
return ProviderOverride(
origin: this,
override: PublisherHeatmapProvider._internal(
(ref) => create(ref as PublisherHeatmapRef),
from: from,
name: null,
dependencies: null,
allTransitiveDependencies: null,
debugGetCreateSourceHash: null,
uname: uname,
),
);
}
@override
AutoDisposeFutureProviderElement<SnHeatmap?> createElement() {
return _PublisherHeatmapProviderElement(this);
}
@override
bool operator ==(Object other) {
return other is PublisherHeatmapProvider && other.uname == uname;
}
@override
int get hashCode {
var hash = _SystemHash.combine(0, runtimeType.hashCode);
hash = _SystemHash.combine(hash, uname.hashCode);
return _SystemHash.finish(hash);
}
}
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
mixin PublisherHeatmapRef on AutoDisposeFutureProviderRef<SnHeatmap?> {
/// The parameter `uname` of this provider.
String get uname;
}
class _PublisherHeatmapProviderElement
extends AutoDisposeFutureProviderElement<SnHeatmap?>
with PublisherHeatmapRef {
_PublisherHeatmapProviderElement(super.provider);
@override
String get uname => (origin as PublisherHeatmapProvider).uname;
}
// ignore_for_file: type=lint
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

View File

@@ -66,12 +66,12 @@ class TabsScreen extends HookConsumerWidget {
if (wideScreen)
NavigationDestination(
label: 'creatorHub'.tr(),
icon: const Icon(Symbols.draw),
icon: const Icon(Symbols.ink_pen),
),
if (wideScreen)
NavigationDestination(
label: 'developerHub'.tr(),
icon: const Icon(Symbols.code),
icon: const Icon(Symbols.data_object),
),
];
@@ -126,6 +126,7 @@ class TabsScreen extends HookConsumerWidget {
return Scaffold(
backgroundColor: Colors.transparent,
extendBody: true,
resizeToAvoidBottomInset: false,
body: ClipRRect(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(16),

View File

@@ -99,7 +99,7 @@ class EventDetailsWidget extends StatelessWidget {
],
),
if (event?.checkInResult == null && (event?.statuses.isEmpty ?? true))
Text('eventCalandarEmpty').tr(),
Text('eventCalendarEmpty').tr(),
],
).padding(vertical: 24, horizontal: 24);
}

View File

@@ -11,8 +11,13 @@ import '../services/responsive.dart';
/// Shows exactly 365 days (wide screen) or 90 days (non-wide screen) of data ending at the current date.
class ActivityHeatmapWidget extends HookConsumerWidget {
final SnHeatmap heatmap;
final bool forceDense;
const ActivityHeatmapWidget({super.key, required this.heatmap});
const ActivityHeatmapWidget({
super.key,
required this.heatmap,
this.forceDense = false,
});
@override
Widget build(BuildContext context, WidgetRef ref) {
@@ -21,7 +26,7 @@ class ActivityHeatmapWidget extends HookConsumerWidget {
final now = DateTime.now();
final isWide = isWideScreen(context);
final days = isWide ? 365 : 90;
final days = (isWide && !forceDense) ? 365 : 90;
// Start from exactly the selected days ago
final startDate = now.subtract(Duration(days: days));

View File

@@ -314,28 +314,22 @@ class AppScaffold extends HookConsumerWidget {
final noBackground = isNoBackground ?? isWideScreen(context);
final content = Column(
children: [
IgnorePointer(
child: SizedBox(height: appBar != null ? appBarHeight + safeTop : 0),
),
if (body != null) Expanded(child: body!),
],
);
return Focus(
final builtWidget = Focus(
focusNode: focusNode,
child: Scaffold(
extendBody: extendBody ?? true,
extendBodyBehindAppBar: true,
backgroundColor:
noBackground
? Colors.transparent
: Theme.of(context).scaffoldBackgroundColor,
body:
noBackground
? content
: AppBackground(isRoot: true, child: content),
backgroundColor: Colors.transparent,
body: Column(
children: [
IgnorePointer(
child: SizedBox(
height: appBar != null ? appBarHeight + safeTop : 0,
),
),
if (body != null) Expanded(child: body!),
],
),
appBar: appBar,
bottomNavigationBar: bottomNavigationBar,
bottomSheet: bottomSheet,
@@ -348,6 +342,10 @@ class AppScaffold extends HookConsumerWidget {
onEndDrawerChanged: onEndDrawerChanged,
),
);
return noBackground
? builtWidget
: AppBackground(isRoot: true, child: builtWidget);
}
}
@@ -376,10 +374,10 @@ class PageBackButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
final isDesktop =
!kIsWeb && (Platform.isMacOS || Platform.isLinux || Platform.isWindows);
final hasPageAction =
!kIsWeb && Platform.isMacOS;
if (isDesktop && isWideScreen(context)) return const SizedBox.shrink();
if (hasPageAction && isWideScreen(context)) return const SizedBox.shrink();
return IconButton(
onPressed: () {

View File

@@ -16,7 +16,7 @@ Future<SnRealtimeCall?> ongoingCall(Ref ref, String roomId) async {
if (roomId.isEmpty) return null;
try {
final apiClient = ref.watch(apiClientProvider);
final resp = await apiClient.get('/sphere/chat/realtime/$roomId');
final resp = await apiClient.get('/sphere/chat/realtime/$roomId/status');
return SnRealtimeCall.fromJson(resp.data);
} catch (e) {
if (e is DioException && e.response?.statusCode == 404) {

View File

@@ -6,7 +6,7 @@ part of 'call_button.dart';
// RiverpodGenerator
// **************************************************************************
String _$ongoingCallHash() => r'48031badb79efa07aefb3a4fc51635be457bd3f9';
String _$ongoingCallHash() => r'0f14b36393276720a06190cab3dc8d5e4c88cd57';
/// Copied from Dart SDK
class _SystemHash {

View File

@@ -10,7 +10,7 @@ import 'package:island/widgets/chat/call_participant_tile.dart';
import 'package:island/widgets/content/sheet.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:styled_widget/styled_widget.dart';
import 'package:livekit_client/livekit_client.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
class CallControlsBar extends HookConsumerWidget {
const CallControlsBar({super.key});
@@ -194,9 +194,16 @@ class CallControlsBar extends HookConsumerWidget {
String deviceType,
) async {
try {
final devices = await Hardware.instance.enumerateDevices(
type: deviceType,
);
final devices = await navigator.mediaDevices.enumerateDevices();
final filteredDevices =
devices.where((device) {
if (deviceType == 'videoinput') {
return device.kind == 'videoinput';
} else if (deviceType == 'audioinput') {
return device.kind == 'audioinput';
}
return false;
}).toList();
if (!context.mounted) return;
@@ -209,9 +216,9 @@ class CallControlsBar extends HookConsumerWidget {
? 'selectCamera'.tr()
: 'selectMicrophone'.tr(),
child: ListView.builder(
itemCount: devices.length,
itemCount: filteredDevices.length,
itemBuilder: (context, index) {
final device = devices[index];
final device = filteredDevices[index];
return ListTile(
title: Text(
device.label.isNotEmpty
@@ -236,33 +243,17 @@ class CallControlsBar extends HookConsumerWidget {
Future<void> _switchDevice(
BuildContext context,
WidgetRef ref,
MediaDevice device,
MediaDeviceInfo device,
String deviceType,
) async {
try {
final callNotifier = ref.read(callNotifierProvider.notifier);
if (callNotifier.webrtcManager == null) return;
if (deviceType == 'videoinput') {
// Switch camera device
final localParticipant = callNotifier.room?.localParticipant;
final videoTrack =
localParticipant?.videoTrackPublications.firstOrNull?.track;
if (videoTrack is LocalVideoTrack) {
await videoTrack.switchCamera(device.deviceId);
}
await callNotifier.webrtcManager!.switchCamera(device.deviceId);
} else if (deviceType == 'audioinput') {
// Switch microphone device
final localParticipant = callNotifier.room?.localParticipant;
final audioTrack =
localParticipant?.audioTrackPublications.firstOrNull?.track;
if (audioTrack is LocalAudioTrack) {
// For audio devices, we need to restart the track with new device
await audioTrack.restartTrack(
AudioCaptureOptions(deviceId: device.deviceId),
);
}
await callNotifier.webrtcManager!.switchMicrophone(device.deviceId);
}
if (context.mounted) {
@@ -289,31 +280,9 @@ class CallOverlayBar extends HookConsumerWidget {
if (!callState.isConnected) return const SizedBox.shrink();
final lastSpeaker =
callNotifier.participants
.where(
(element) => element.remoteParticipant.lastSpokeAt != null,
)
.isEmpty
callNotifier.participants.isNotEmpty
? callNotifier.participants.first
: callNotifier.participants
.where(
(element) => element.remoteParticipant.lastSpokeAt != null,
)
.fold(
callNotifier.participants.first,
(value, element) =>
element.remoteParticipant.lastSpokeAt != null &&
(value.remoteParticipant.lastSpokeAt == null ||
element.remoteParticipant.lastSpokeAt!
.compareTo(
value
.remoteParticipant
.lastSpokeAt!,
) >
0)
? element
: value,
);
: null;
final actionButtonStyle = ButtonStyle(
minimumSize: const MaterialStatePropertyAll(Size(24, 24)),
@@ -330,17 +299,16 @@ class CallOverlayBar extends HookConsumerWidget {
children: [
Builder(
builder: (context) {
if (callNotifier.localParticipant == null) {
return CircularProgressIndicator().center();
if (lastSpeaker == null) {
return const CircularProgressIndicator();
}
return SizedBox(
width: 40,
height: 40,
child:
SpeakingRippleAvatar(
live: lastSpeaker,
size: 36,
).center(),
child: SpeakingRippleAvatar(
live: lastSpeaker,
size: 36,
),
);
},
),
@@ -348,7 +316,9 @@ class CallOverlayBar extends HookConsumerWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('@${lastSpeaker.participant.identity}').bold(),
Text(
'@${lastSpeaker?.participant.identity ?? 'Unknown'}',
),
Text(
formatDuration(callState.duration),
style: Theme.of(context).textTheme.bodySmall,

View File

@@ -7,7 +7,6 @@ import 'package:gap/gap.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:island/pods/chat/call.dart';
import 'package:island/widgets/account/account_nameplate.dart';
import 'package:livekit_client/livekit_client.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
import 'package:styled_widget/styled_widget.dart';
@@ -66,19 +65,17 @@ class CallParticipantCard extends HookConsumerWidget {
children: [
const Icon(Symbols.wifi, size: 16),
const Gap(8),
Text(switch (live.remoteParticipant.connectionQuality) {
ConnectionQuality.excellent => 'Excellent',
ConnectionQuality.good => 'Good',
ConnectionQuality.poor => 'Bad',
ConnectionQuality.lost => 'Lost',
_ => 'Connecting',
}),
Text(
live.remoteParticipant.isConnected
? 'Connected'
: 'Connecting',
),
],
),
],
).padding(horizontal: 20, top: 16),
AccountNameplate(
name: live.participant.identity,
name: live.remoteParticipant.userinfo.name,
isOutlined: false,
),
],

View File

@@ -1,10 +1,9 @@
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:island/pods/chat/call.dart';
import 'package:island/screens/account/profile.dart';
import 'package:island/widgets/chat/call_participant_card.dart';
import 'package:island/widgets/content/cloud_files.dart';
import 'package:livekit_client/livekit_client.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:styled_widget/styled_widget.dart';
@@ -16,10 +15,8 @@ class SpeakingRippleAvatar extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final account = ref.watch(accountProvider(live.participant.identity));
final avatarRadius = size / 2;
final clampedLevel = live.remoteParticipant.audioLevel.clamp(0.0, 1.0);
final clampedLevel = live.audioLevel.clamp(0.0, 1.0);
final rippleRadius = avatarRadius + clampedLevel * (size * 0.333);
return SizedBox(
width: size + 8,
@@ -27,7 +24,7 @@ class SpeakingRippleAvatar extends HookConsumerWidget {
child: TweenAnimationBuilder<double>(
tween: Tween<double>(
begin: avatarRadius,
end: live.remoteParticipant.isSpeaking ? rippleRadius : avatarRadius,
end: live.isSpeaking ? rippleRadius : avatarRadius,
),
duration: const Duration(milliseconds: 250),
curve: Curves.easeOut,
@@ -35,7 +32,7 @@ class SpeakingRippleAvatar extends HookConsumerWidget {
return Stack(
alignment: Alignment.center,
children: [
if (live.remoteParticipant.isSpeaking)
if (live.isSpeaking)
Container(
width: animatedRadius * 2,
height: animatedRadius * 2,
@@ -49,28 +46,15 @@ class SpeakingRippleAvatar extends HookConsumerWidget {
height: size,
alignment: Alignment.center,
decoration: BoxDecoration(shape: BoxShape.circle),
child: account.when(
data:
(value) => CallParticipantGestureDetector(
participant: live,
child: ProfilePictureWidget(
file: value.profile.picture,
radius: size / 2,
),
),
error:
(_, _) => CircleAvatar(
radius: size / 2,
child: const Icon(Symbols.person_remove),
),
loading:
() => CircleAvatar(
radius: size / 2,
child: CircularProgressIndicator(),
),
child: CallParticipantGestureDetector(
participant: live,
child: ProfilePictureWidget(
file: live.remoteParticipant.userinfo.profile.picture,
radius: size / 2,
),
),
),
if (live.remoteParticipant.isMuted)
if (live.isMuted)
Positioned(
bottom: 4,
right: 4,
@@ -96,40 +80,65 @@ class SpeakingRippleAvatar extends HookConsumerWidget {
}
}
class CallParticipantTile extends HookConsumerWidget {
class CallParticipantTile extends StatefulWidget {
final CallParticipantLive live;
const CallParticipantTile({super.key, required this.live});
@override
Widget build(BuildContext context, WidgetRef ref) {
final hasVideo =
live.hasVideo &&
live.remoteParticipant.trackPublications.values
.where((pub) => pub.track != null && pub.kind == TrackType.VIDEO)
.isNotEmpty;
State<CallParticipantTile> createState() => _CallParticipantTileState();
}
if (hasVideo) {
class _CallParticipantTileState extends State<CallParticipantTile> {
RTCVideoRenderer? _renderer;
@override
void initState() {
super.initState();
_initRenderer();
}
@override
void didUpdateWidget(CallParticipantTile oldWidget) {
super.didUpdateWidget(oldWidget);
// Update renderer source when the stream changes
if (_renderer != null &&
widget.live.remoteParticipant.remoteStream !=
oldWidget.live.remoteParticipant.remoteStream) {
_renderer!.srcObject = widget.live.remoteParticipant.remoteStream;
}
}
Future<void> _initRenderer() async {
_renderer = RTCVideoRenderer();
await _renderer!.initialize();
_renderer!.srcObject = widget.live.remoteParticipant.remoteStream;
if (mounted) {
setState(() {});
}
}
@override
void dispose() {
_renderer?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
if (widget.live.hasVideo &&
widget.live.remoteParticipant.remoteStream != null &&
_renderer != null) {
return Stack(
fit: StackFit.loose,
children: [
AspectRatio(
aspectRatio: 16 / 9,
child: VideoTrackRenderer(
live.remoteParticipant.trackPublications.values
.where((track) => track.kind == TrackType.VIDEO)
.first
.track
as VideoTrack,
renderMode: VideoRenderMode.platformView,
),
),
AspectRatio(aspectRatio: 16 / 9, child: RTCVideoView(_renderer!)),
Positioned(
left: 8,
right: 8,
bottom: 8,
child: Text(
'@${live.participant.name}',
'@${widget.live.participant.name}',
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 14,
@@ -148,7 +157,7 @@ class CallParticipantTile extends HookConsumerWidget {
],
);
} else {
return SpeakingRippleAvatar(size: 84, live: live);
return SpeakingRippleAvatar(size: 84, live: widget.live);
}
}
}

View File

@@ -73,10 +73,8 @@ class ChatInput extends HookConsumerWidget {
final chatSubscribe = ref.watch(chatSubscribeNotifierProvider(chatRoom.id));
void send() {
inputFocusNode.requestFocus();
onSend.call();
WidgetsBinding.instance.addPostFrameCallback((_) {
inputFocusNode.requestFocus();
});
}
void insertNewLine() {
@@ -120,6 +118,8 @@ class ChatInput extends HookConsumerWidget {
}
}
final settings = ref.watch(appSettingsNotifierProvider);
inputFocusNode.onKeyEvent = (node, event) {
if (event is! KeyDownEvent) return KeyEventResult.ignored;
@@ -133,7 +133,7 @@ class ChatInput extends HookConsumerWidget {
return KeyEventResult.handled;
}
final enterToSend = ref.read(appSettingsNotifierProvider).enterToSend;
final enterToSend = settings.enterToSend;
final isEnter = event.logicalKey == LogicalKeyboardKey.enter;
if (isEnter) {
@@ -467,24 +467,28 @@ class ChatInput extends HookConsumerWidget {
),
UploadMenu(
items: [
MenuItemData(
UploadMenuItemData(
Symbols.add_a_photo,
'addPhoto',
() => onPickFile(true),
),
MenuItemData(
UploadMenuItemData(
Symbols.videocam,
'addVideo',
() => onPickFile(false),
),
MenuItemData(Symbols.mic, 'addAudio', onPickAudio),
MenuItemData(
UploadMenuItemData(
Symbols.mic,
'addAudio',
onPickAudio,
),
UploadMenuItemData(
Symbols.file_upload,
'uploadFile',
onPickGeneralFile,
),
if (onLinkAttachment != null)
MenuItemData(
UploadMenuItemData(
Symbols.attach_file,
'linkAttachment',
onLinkAttachment!,
@@ -528,11 +532,17 @@ class ChatInput extends HookConsumerWidget {
? '${messageController.text.length}/4096'
: null,
),
maxLines: 3,
maxLines: 5,
minLines: 1,
onTapOutside:
(_) =>
FocusManager.instance.primaryFocus?.unfocus(),
textInputAction:
settings.enterToSend
? TextInputAction.send
: null,
onSubmitted:
settings.enterToSend ? (_) => send() : null,
);
},
suggestionsCallback: (pattern) async {
@@ -542,11 +552,13 @@ class ChatInput extends HookConsumerWidget {
final triggerIndex =
atIndex > colonIndex ? atIndex : colonIndex;
if (triggerIndex == -1) return [];
final chopped = pattern.substring(triggerIndex);
if (chopped.contains(' ')) return [];
final service = ref.read(autocompleteServiceProvider);
try {
return await service.getSuggestions(
chatRoom.id,
pattern,
chopped,
);
} catch (e) {
return [];
@@ -637,7 +649,7 @@ class ChatInput extends HookConsumerWidget {
direction: VerticalDirection.up,
hideOnEmpty: true,
hideOnLoading: true,
debounceDuration: const Duration(milliseconds: 500),
debounceDuration: const Duration(milliseconds: 1000),
),
),
IconButton(

View File

@@ -14,7 +14,6 @@ import 'package:island/pods/chat/messages_notifier.dart';
import 'package:island/pods/translate.dart';
import 'package:island/pods/config.dart';
import 'package:island/widgets/account/account_pfc.dart';
import 'package:island/widgets/app_scaffold.dart';
import 'package:island/widgets/chat/message_content.dart';
import 'package:island/widgets/chat/message_indicators.dart';
import 'package:island/widgets/chat/message_sender_info.dart';
@@ -161,6 +160,7 @@ class MessageItem extends HookConsumerWidget {
clipBehavior: Clip.none,
children: [
SwipeTo(
swipeSensitivity: 15,
rightSwipeWidget: Transform.flip(
flipX: true,
child: Icon(Symbols.menu_open),
@@ -477,6 +477,8 @@ class _MessageActionSheetState extends State<MessageActionSheet> {
Navigator.pop(context);
},
),
Gap(MediaQuery.of(context).padding.bottom),
],
),
),
@@ -663,17 +665,11 @@ class MessageItemDisplayBubble extends HookConsumerWidget {
? Theme.of(context).colorScheme.primaryContainer.withOpacity(0.5)
: Theme.of(context).colorScheme.surfaceContainer;
final hasBackground =
ref.watch(backgroundImageFileProvider).valueOrNull != null;
final remoteMessage = message.toRemoteMessage();
final sender = remoteMessage.sender;
return Material(
color:
hasBackground
? Colors.transparent
: Theme.of(context).colorScheme.surface,
color: Colors.transparent,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
child: Column(

View File

@@ -44,10 +44,12 @@ void showInfoAlert(String message, String title) async {
Future<bool> showConfirmAlert(String message, String title) async {
final result = await js.context.callMethod('swal', [
title,
message,
'question',
{'buttons': true},
js.JsObject.jsify({
'title': title,
'text': message,
'icon': 'info',
'buttons': {'cancel': true, 'confirm': true},
}),
]);
return result == true;
}

View File

@@ -193,10 +193,10 @@ class _PaymentContentState extends ConsumerState<_PaymentContent> {
// Perform biometric authentication
final bool didAuthenticate = await _localAuth.authenticate(
localizedReason: 'biometricPrompt'.tr(),
options: const AuthenticationOptions(
biometricOnly: true,
stickyAuth: true,
),
// options: const AuthenticationOptions(
// biometricOnly: true,
// stickyAuth: true,
// ),
);
if (didAuthenticate) {

View File

@@ -34,9 +34,9 @@ class PostComposeCard extends HookConsumerWidget {
final SnPost? originalPost;
final PostComposeInitialState? initialState;
final VoidCallback? onCancel;
final Function(SnPost)? onSubmit;
final Function()? onSubmit;
final Function(ComposeState)? onStateChanged;
final bool isInDialog;
final bool isDialog;
const PostComposeCard({
super.key,
@@ -45,7 +45,7 @@ class PostComposeCard extends HookConsumerWidget {
this.onCancel,
this.onSubmit,
this.onStateChanged,
this.isInDialog = false,
this.isDialog = false,
});
@override
@@ -164,20 +164,19 @@ class PostComposeCard extends HookConsumerWidget {
// Reset the form for new composition
ComposeStateUtils.resetForm(state);
// Call the widget's onSubmit callback to trigger activity list refresh
// Note: onSubmit still receives the post from the return value
onSubmit?.call();
},
);
}
final maxHeight = math.min(
640.0,
MediaQuery.of(context).size.height * (isInDialog ? 0.8 : 0.72),
MediaQuery.of(context).size.height * (isDialog ? 0.8 : 0.72),
);
return Card(
margin: EdgeInsets.zero,
color: Theme.of(context).colorScheme.surfaceContainer,
color: isDialog ? Theme.of(context).colorScheme.surfaceContainer : null,
child: Container(
constraints: BoxConstraints(maxHeight: maxHeight),
child: Column(
@@ -311,7 +310,7 @@ class PostComposeCard extends HookConsumerWidget {
onTap: () {
if (state.currentPublisher.value == null) {
// No publisher loaded, guide user to create one
if (isInDialog) {
if (isDialog) {
Navigator.of(context).pop();
}
context.pushNamed('creatorNew').then((value) {
@@ -348,7 +347,7 @@ class PostComposeCard extends HookConsumerWidget {
onPublisherTap: () {
if (state.currentPublisher.value == null) {
// No publisher loaded, guide user to create one
if (isInDialog) {
if (isDialog) {
Navigator.of(context).pop();
}
context.pushNamed('creatorNew').then((

View File

@@ -23,12 +23,12 @@ class PostComposeDialog extends HookConsumerWidget {
this.isBottomSheet = false,
});
static Future<SnPost?> show(
static Future<bool?> show(
BuildContext context, {
SnPost? originalPost,
PostComposeInitialState? initialState,
}) {
return showDialog<SnPost>(
return showDialog<bool>(
context: context,
useRootNavigator: true,
builder:
@@ -74,8 +74,8 @@ class PostComposeDialog extends HookConsumerWidget {
originalPost: originalPost,
initialState: restoredInitialState.value ?? initialState,
onCancel: () => Navigator.of(context).pop(),
onSubmit: (post) => Navigator.of(context).pop(post),
isInDialog: true,
onSubmit: () => Navigator.of(context).pop(true),
isDialog: true,
),
),
);

View File

@@ -149,9 +149,11 @@ class ComposeFormFields extends HookConsumerWidget {
final triggerIndex =
atIndex > colonIndex ? atIndex : colonIndex;
if (triggerIndex == -1) return [];
final chopped = pattern.substring(triggerIndex);
if (chopped.contains(' ')) return [];
final service = ref.read(autocompleteServiceProvider);
try {
return await service.getGeneralSuggestions(pattern);
return await service.getGeneralSuggestions(chopped);
} catch (e) {
return [];
}
@@ -235,7 +237,7 @@ class ComposeFormFields extends HookConsumerWidget {
direction: VerticalDirection.down,
hideOnEmpty: true,
hideOnLoading: true,
debounceDuration: const Duration(milliseconds: 500),
debounceDuration: const Duration(milliseconds: 1000),
),
],
),

View File

@@ -16,7 +16,6 @@ import 'package:island/widgets/post/compose_shared.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:styled_widget/styled_widget.dart';
import 'package:textfield_tags/textfield_tags.dart';
part 'compose_settings_sheet.g.dart';
@@ -37,98 +36,6 @@ Future<List<SnPostCategory>> postCategories(Ref ref) async {
return uniqueCategories.values.toList();
}
/// A reusable widget for tag input fields with chip display
class ChipTagInputField extends StatelessWidget {
final InputFieldValues inputFieldValues;
final String labelText;
final String hintText;
const ChipTagInputField({
super.key,
required this.inputFieldValues,
required this.labelText,
required this.hintText,
});
@override
Widget build(BuildContext context) {
return TextField(
controller: inputFieldValues.textEditingController,
focusNode: inputFieldValues.focusNode,
decoration: InputDecoration(
label: Text(labelText).tr(),
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
contentPadding: const EdgeInsets.all(16),
hintText: inputFieldValues.tags.isNotEmpty ? '' : hintText.tr(),
errorText: inputFieldValues.error,
prefixIconConstraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width * 0.8,
),
prefixIcon:
inputFieldValues.tags.isNotEmpty
? SingleChildScrollView(
controller: inputFieldValues.tagScrollController,
scrollDirection: Axis.vertical,
child: Padding(
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 8),
child: Wrap(
runSpacing: 4.0,
spacing: 4.0,
children:
inputFieldValues.tags.map<Widget>((dynamic tag) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(20.0),
),
color: Theme.of(context).colorScheme.primary,
),
margin: const EdgeInsets.only(left: 5),
padding: const EdgeInsets.symmetric(
horizontal: 10.0,
vertical: 5.0,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
child: Text(
'#$tag',
style: TextStyle(
color:
Theme.of(
context,
).colorScheme.onPrimary,
),
),
),
const Gap(4),
InkWell(
child: const Icon(
Icons.cancel,
size: 14.0,
color: Color.fromARGB(255, 233, 233, 233),
),
onTap: () {
inputFieldValues.onTagRemoved(tag);
},
),
],
),
);
}).toList(),
),
),
)
: null,
),
onChanged: inputFieldValues.onTagChanged,
onSubmitted: inputFieldValues.onTagSubmitted,
);
}
}
class ComposeSettingsSheet extends HookConsumerWidget {
final ComposeState state;

View File

@@ -82,10 +82,10 @@ class ComposeToolbar extends HookConsumerWidget {
}
final uploadMenuItems = [
MenuItemData(Symbols.add_a_photo, 'addPhoto', pickPhotoMedia),
MenuItemData(Symbols.videocam, 'addVideo', pickVideoMedia),
MenuItemData(Symbols.mic, 'addAudio', addAudio),
MenuItemData(Symbols.file_upload, 'uploadFile', pickGeneralFile),
UploadMenuItemData(Symbols.add_a_photo, 'addPhoto', pickPhotoMedia),
UploadMenuItemData(Symbols.videocam, 'addVideo', pickVideoMedia),
UploadMenuItemData(Symbols.mic, 'addAudio', addAudio),
UploadMenuItemData(Symbols.file_upload, 'uploadFile', pickGeneralFile),
];
final colorScheme = Theme.of(context).colorScheme;

View File

@@ -334,7 +334,7 @@ class PostActionableItem extends HookConsumerWidget {
);
},
child: Material(
color: Theme.of(context).colorScheme.surfaceContainerLow,
color: Theme.of(context).cardTheme.color,
borderRadius:
borderRadius != null
? BorderRadius.all(Radius.circular(borderRadius!))

View File

@@ -23,6 +23,7 @@ class PostListNotifier extends _$PostListNotifier
List<String>? tags,
bool? pinned,
bool shuffle = false,
bool? includeReplies,
}) {
return fetch(cursor: null);
}
@@ -42,6 +43,7 @@ class PostListNotifier extends _$PostListNotifier
if (categories != null) 'categories': categories,
if (shuffle) 'shuffle': true,
if (pinned != null) 'pinned': pinned,
if (includeReplies != null) 'includeReplies': includeReplies,
};
final response = await client.get(

View File

@@ -6,7 +6,7 @@ part of 'post_list.dart';
// RiverpodGenerator
// **************************************************************************
String _$postListNotifierHash() => r'3c0a8154ded4bcd8f5456f7a4ea2e542f57efa85';
String _$postListNotifierHash() => r'fc139ad4df0deb67bcbb949560319f2f7fbfb503';
/// Copied from Dart SDK
class _SystemHash {
@@ -38,6 +38,7 @@ abstract class _$PostListNotifier
late final List<String>? tags;
late final bool? pinned;
late final bool shuffle;
late final bool? includeReplies;
FutureOr<CursorPagingData<SnPost>> build({
String? pubName,
@@ -47,6 +48,7 @@ abstract class _$PostListNotifier
List<String>? tags,
bool? pinned,
bool shuffle = false,
bool? includeReplies,
});
}
@@ -69,6 +71,7 @@ class PostListNotifierFamily
List<String>? tags,
bool? pinned,
bool shuffle = false,
bool? includeReplies,
}) {
return PostListNotifierProvider(
pubName: pubName,
@@ -78,6 +81,7 @@ class PostListNotifierFamily
tags: tags,
pinned: pinned,
shuffle: shuffle,
includeReplies: includeReplies,
);
}
@@ -93,6 +97,7 @@ class PostListNotifierFamily
tags: provider.tags,
pinned: provider.pinned,
shuffle: provider.shuffle,
includeReplies: provider.includeReplies,
);
}
@@ -127,6 +132,7 @@ class PostListNotifierProvider
List<String>? tags,
bool? pinned,
bool shuffle = false,
bool? includeReplies,
}) : this._internal(
() =>
PostListNotifier()
@@ -136,7 +142,8 @@ class PostListNotifierProvider
..categories = categories
..tags = tags
..pinned = pinned
..shuffle = shuffle,
..shuffle = shuffle
..includeReplies = includeReplies,
from: postListNotifierProvider,
name: r'postListNotifierProvider',
debugGetCreateSourceHash:
@@ -153,6 +160,7 @@ class PostListNotifierProvider
tags: tags,
pinned: pinned,
shuffle: shuffle,
includeReplies: includeReplies,
);
PostListNotifierProvider._internal(
@@ -169,6 +177,7 @@ class PostListNotifierProvider
required this.tags,
required this.pinned,
required this.shuffle,
required this.includeReplies,
}) : super.internal();
final String? pubName;
@@ -178,6 +187,7 @@ class PostListNotifierProvider
final List<String>? tags;
final bool? pinned;
final bool shuffle;
final bool? includeReplies;
@override
FutureOr<CursorPagingData<SnPost>> runNotifierBuild(
@@ -191,6 +201,7 @@ class PostListNotifierProvider
tags: tags,
pinned: pinned,
shuffle: shuffle,
includeReplies: includeReplies,
);
}
@@ -207,7 +218,8 @@ class PostListNotifierProvider
..categories = categories
..tags = tags
..pinned = pinned
..shuffle = shuffle,
..shuffle = shuffle
..includeReplies = includeReplies,
from: from,
name: null,
dependencies: null,
@@ -220,6 +232,7 @@ class PostListNotifierProvider
tags: tags,
pinned: pinned,
shuffle: shuffle,
includeReplies: includeReplies,
),
);
}
@@ -242,7 +255,8 @@ class PostListNotifierProvider
other.categories == categories &&
other.tags == tags &&
other.pinned == pinned &&
other.shuffle == shuffle;
other.shuffle == shuffle &&
other.includeReplies == includeReplies;
}
@override
@@ -255,6 +269,7 @@ class PostListNotifierProvider
hash = _SystemHash.combine(hash, tags.hashCode);
hash = _SystemHash.combine(hash, pinned.hashCode);
hash = _SystemHash.combine(hash, shuffle.hashCode);
hash = _SystemHash.combine(hash, includeReplies.hashCode);
return _SystemHash.finish(hash);
}
@@ -284,6 +299,9 @@ mixin PostListNotifierRef
/// The parameter `shuffle` of this provider.
bool get shuffle;
/// The parameter `includeReplies` of this provider.
bool? get includeReplies;
}
class _PostListNotifierProviderElement
@@ -310,6 +328,9 @@ class _PostListNotifierProviderElement
bool? get pinned => (origin as PostListNotifierProvider).pinned;
@override
bool get shuffle => (origin as PostListNotifierProvider).shuffle;
@override
bool? get includeReplies =>
(origin as PostListNotifierProvider).includeReplies;
}
// ignore_for_file: type=lint

View File

@@ -68,21 +68,24 @@ class PostQuickReply extends HookConsumerWidget {
}
}
const kInputChipHeight = 54.0;
return publishers.when(
data:
(data) => Material(
elevation: 2,
color: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(20),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 8),
borderRadius: BorderRadius.circular(28),
child: Container(
constraints: BoxConstraints(minHeight: kInputChipHeight),
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
child: ProfilePictureWidget(
fileId: currentPublisher.value?.picture?.id,
radius: 16,
radius: (kInputChipHeight * 0.5) - 6,
),
onTap: () {
showModalBottomSheet(
@@ -106,11 +109,13 @@ class PostQuickReply extends HookConsumerWidget {
isCollapsed: true,
contentPadding: EdgeInsets.symmetric(
horizontal: 12,
vertical: 9,
vertical: 14,
),
visualDensity: VisualDensity.compact,
),
style: TextStyle(fontSize: 14),
maxLines: null,
minLines: 1,
maxLines: 5,
onTapOutside:
(_) => FocusManager.instance.primaryFocus?.unfocus(),
),
@@ -130,6 +135,10 @@ class PostQuickReply extends HookConsumerWidget {
},
icon: const Icon(Symbols.launch, size: 20),
visualDensity: VisualDensity.compact,
constraints: BoxConstraints(
maxHeight: kInputChipHeight - 6,
minHeight: kInputChipHeight - 6,
),
),
IconButton(
icon:
@@ -143,6 +152,10 @@ class PostQuickReply extends HookConsumerWidget {
color: Theme.of(context).colorScheme.primary,
onPressed: submitting.value ? null : performAction,
visualDensity: VisualDensity.compact,
constraints: BoxConstraints(
maxHeight: kInputChipHeight - 6,
minHeight: kInputChipHeight - 6,
),
),
],
),

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:island/models/post.dart';
import 'package:island/pods/userinfo.dart';
@@ -19,35 +20,37 @@ class PostRepliesSheet extends HookConsumerWidget {
return SheetScaffold(
titleText: 'repliesCount'.plural(post.repliesCount),
child: Column(
child: Stack(
children: [
// Replies list
Expanded(
child: CustomScrollView(
slivers: [
PostRepliesList(
postId: post.id.toString(),
onOpen: () {
Navigator.pop(context);
},
),
],
),
CustomScrollView(
slivers: [
PostRepliesList(
postId: post.id.toString(),
onOpen: () {
Navigator.pop(context);
},
),
SliverGap(80),
],
),
// Quick reply section
if (user.value != null)
PostQuickReply(
parent: post,
onPosted: () {
ref.invalidate(postRepliesNotifierProvider(post.id));
},
onLaunch: () {
Navigator.of(context).pop();
},
).padding(
bottom: MediaQuery.of(context).padding.bottom + 16,
top: 8,
horizontal: 16,
Positioned(
bottom: 0,
left: 0,
right: 0,
child: PostQuickReply(
parent: post,
onPosted: () {
ref.invalidate(postRepliesNotifierProvider(post.id));
},
onLaunch: () {
Navigator.of(context).pop();
},
).padding(
bottom: MediaQuery.of(context).padding.bottom + 16,
top: 8,
horizontal: 16,
),
),
],
),

View File

@@ -2,16 +2,16 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:material_symbols_icons/symbols.dart';
class MenuItemData {
class UploadMenuItemData {
final IconData icon;
final String textKey;
final VoidCallback onPressed;
const MenuItemData(this.icon, this.textKey, this.onPressed);
const UploadMenuItemData(this.icon, this.textKey, this.onPressed);
}
class UploadMenu extends StatelessWidget {
final List<MenuItemData> items;
final List<UploadMenuItemData> items;
final bool isCompact;
final Color? iconColor;
@@ -51,6 +51,7 @@ class UploadMenu extends StatelessWidget {
onPressed: item.onPressed,
leadingIcon: Icon(item.icon),
style: ButtonStyle(
visualDensity: VisualDensity.compact,
padding: WidgetStatePropertyAll(
EdgeInsets.only(left: 12, right: 16, top: 20, bottom: 20),
),

View File

@@ -15,7 +15,6 @@
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
#include <gtk/gtk_plugin.h>
#include <irondash_engine_context/irondash_engine_context_plugin.h>
#include <livekit_client/live_kit_plugin.h>
#include <media_kit_libs_linux/media_kit_libs_linux_plugin.h>
#include <media_kit_video/media_kit_video_plugin.h>
#include <pasteboard/pasteboard_plugin.h>
@@ -57,9 +56,6 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) irondash_engine_context_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "IrondashEngineContextPlugin");
irondash_engine_context_plugin_register_with_registrar(irondash_engine_context_registrar);
g_autoptr(FlPluginRegistrar) livekit_client_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "LiveKitPlugin");
live_kit_plugin_register_with_registrar(livekit_client_registrar);
g_autoptr(FlPluginRegistrar) media_kit_libs_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitLibsLinuxPlugin");
media_kit_libs_linux_plugin_register_with_registrar(media_kit_libs_linux_registrar);

View File

@@ -12,7 +12,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
flutter_webrtc
gtk
irondash_engine_context
livekit_client
media_kit_libs_linux
media_kit_video
pasteboard

View File

@@ -6,7 +6,6 @@ import FlutterMacOS
import Foundation
import app_links
import connectivity_plus
import device_info_plus
import file_picker
import file_saver
@@ -24,7 +23,6 @@ import flutter_udid
import flutter_webrtc
import gal
import irondash_engine_context
import livekit_client
import local_auth_darwin
import media_kit_libs_macos_video
import media_kit_video
@@ -48,7 +46,6 @@ import window_manager
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin"))
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
FileSaverPlugin.register(with: registry.registrar(forPlugin: "FileSaverPlugin"))
@@ -66,7 +63,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FlutterWebRTCPlugin.register(with: registry.registrar(forPlugin: "FlutterWebRTCPlugin"))
GalPlugin.register(with: registry.registrar(forPlugin: "GalPlugin"))
IrondashEngineContextPlugin.register(with: registry.registrar(forPlugin: "IrondashEngineContextPlugin"))
LiveKitPlugin.register(with: registry.registrar(forPlugin: "LiveKitPlugin"))
LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin"))
MediaKitLibsMacosVideoPlugin.register(with: registry.registrar(forPlugin: "MediaKitLibsMacosVideoPlugin"))
MediaKitVideoPlugin.register(with: registry.registrar(forPlugin: "MediaKitVideoPlugin"))

View File

@@ -13,85 +13,85 @@ PODS:
- FlutterMacOS
- file_selector_macos (0.0.1):
- FlutterMacOS
- Firebase/CoreOnly (12.2.0):
- FirebaseCore (~> 12.2.0)
- Firebase/Crashlytics (12.2.0):
- Firebase/CoreOnly (12.4.0):
- FirebaseCore (~> 12.4.0)
- Firebase/Crashlytics (12.4.0):
- Firebase/CoreOnly
- FirebaseCrashlytics (~> 12.2.0)
- Firebase/Messaging (12.2.0):
- FirebaseCrashlytics (~> 12.4.0)
- Firebase/Messaging (12.4.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 12.2.0)
- firebase_analytics (12.0.2):
- FirebaseMessaging (~> 12.4.0)
- firebase_analytics (12.0.3):
- firebase_core
- FirebaseAnalytics (= 12.2.0)
- FirebaseAnalytics (= 12.4.0)
- FlutterMacOS
- firebase_core (4.1.1):
- Firebase/CoreOnly (~> 12.2.0)
- firebase_core (4.2.0):
- Firebase/CoreOnly (~> 12.4.0)
- FlutterMacOS
- firebase_crashlytics (5.0.2):
- Firebase/CoreOnly (~> 12.2.0)
- Firebase/Crashlytics (~> 12.2.0)
- firebase_crashlytics (5.0.3):
- Firebase/CoreOnly (~> 12.4.0)
- Firebase/Crashlytics (~> 12.4.0)
- firebase_core
- FlutterMacOS
- firebase_messaging (16.0.2):
- Firebase/CoreOnly (~> 12.2.0)
- Firebase/Messaging (~> 12.2.0)
- firebase_messaging (16.0.3):
- Firebase/CoreOnly (~> 12.4.0)
- Firebase/Messaging (~> 12.4.0)
- firebase_core
- FlutterMacOS
- FirebaseAnalytics (12.2.0):
- FirebaseAnalytics/Default (= 12.2.0)
- FirebaseCore (~> 12.2.0)
- FirebaseInstallations (~> 12.2.0)
- FirebaseAnalytics (12.4.0):
- FirebaseAnalytics/Default (= 12.4.0)
- FirebaseCore (~> 12.4.0)
- FirebaseInstallations (~> 12.4.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- FirebaseAnalytics/Default (12.2.0):
- FirebaseCore (~> 12.2.0)
- FirebaseInstallations (~> 12.2.0)
- GoogleAppMeasurement/Default (= 12.2.0)
- FirebaseAnalytics/Default (12.4.0):
- FirebaseCore (~> 12.4.0)
- FirebaseInstallations (~> 12.4.0)
- GoogleAppMeasurement/Default (= 12.4.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- FirebaseCore (12.2.0):
- FirebaseCoreInternal (~> 12.2.0)
- FirebaseCore (12.4.0):
- FirebaseCoreInternal (~> 12.4.0)
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/Logger (~> 8.1)
- FirebaseCoreExtension (12.2.0):
- FirebaseCore (~> 12.2.0)
- FirebaseCoreInternal (12.2.0):
- FirebaseCoreExtension (12.4.0):
- FirebaseCore (~> 12.4.0)
- FirebaseCoreInternal (12.4.0):
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- FirebaseCrashlytics (12.2.0):
- FirebaseCore (~> 12.2.0)
- FirebaseInstallations (~> 12.2.0)
- FirebaseRemoteConfigInterop (~> 12.2.0)
- FirebaseSessions (~> 12.2.0)
- FirebaseCrashlytics (12.4.0):
- FirebaseCore (~> 12.4.0)
- FirebaseInstallations (~> 12.4.0)
- FirebaseRemoteConfigInterop (~> 12.4.0)
- FirebaseSessions (~> 12.4.0)
- GoogleDataTransport (~> 10.1)
- GoogleUtilities/Environment (~> 8.1)
- nanopb (~> 3.30910.0)
- PromisesObjC (~> 2.4)
- FirebaseInstallations (12.2.0):
- FirebaseCore (~> 12.2.0)
- FirebaseInstallations (12.4.0):
- FirebaseCore (~> 12.4.0)
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/UserDefaults (~> 8.1)
- PromisesObjC (~> 2.4)
- FirebaseMessaging (12.2.0):
- FirebaseCore (~> 12.2.0)
- FirebaseInstallations (~> 12.2.0)
- FirebaseMessaging (12.4.0):
- FirebaseCore (~> 12.4.0)
- FirebaseInstallations (~> 12.4.0)
- GoogleDataTransport (~> 10.1)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/Reachability (~> 8.1)
- GoogleUtilities/UserDefaults (~> 8.1)
- nanopb (~> 3.30910.0)
- FirebaseRemoteConfigInterop (12.2.0)
- FirebaseSessions (12.2.0):
- FirebaseCore (~> 12.2.0)
- FirebaseCoreExtension (~> 12.2.0)
- FirebaseInstallations (~> 12.2.0)
- FirebaseRemoteConfigInterop (12.4.0)
- FirebaseSessions (12.4.0):
- FirebaseCore (~> 12.4.0)
- FirebaseCoreExtension (~> 12.4.0)
- FirebaseInstallations (~> 12.4.0)
- GoogleDataTransport (~> 10.1)
- GoogleUtilities/Environment (~> 8.1)
- GoogleUtilities/UserDefaults (~> 8.1)
@@ -118,23 +118,23 @@ PODS:
- gal (1.0.0):
- Flutter
- FlutterMacOS
- GoogleAppMeasurement/Core (12.2.0):
- GoogleAppMeasurement/Core (12.4.0):
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- GoogleAppMeasurement/Default (12.2.0):
- GoogleAdsOnDeviceConversion (= 2.3.0)
- GoogleAppMeasurement/Core (= 12.2.0)
- GoogleAppMeasurement/IdentitySupport (= 12.2.0)
- GoogleAppMeasurement/Default (12.4.0):
- GoogleAdsOnDeviceConversion (~> 3.1.0)
- GoogleAppMeasurement/Core (= 12.4.0)
- GoogleAppMeasurement/IdentitySupport (= 12.4.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
- "GoogleUtilities/NSData+zlib (~> 8.1)"
- nanopb (~> 3.30910.0)
- GoogleAppMeasurement/IdentitySupport (12.2.0):
- GoogleAppMeasurement/Core (= 12.2.0)
- GoogleAppMeasurement/IdentitySupport (12.4.0):
- GoogleAppMeasurement/Core (= 12.4.0)
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
- GoogleUtilities/MethodSwizzler (~> 8.1)
- GoogleUtilities/Network (~> 8.1)
@@ -416,20 +416,20 @@ SPEC CHECKSUMS:
file_picker: 7584aae6fa07a041af2b36a2655122d42f578c1a
file_saver: e35bd97de451dde55ff8c38862ed7ad0f3418d0f
file_selector_macos: 6280b52b459ae6c590af5d78fc35c7267a3c4b31
Firebase: 26f6f8d460603af3df970ad505b16b15f5e2e9a1
firebase_analytics: 26346c2ccb9ba410c2f33d5d34c62e6369cbbf29
firebase_core: 54fd706197e1779d510b297548eee74d3b39577c
firebase_crashlytics: 3694b4aca0849f6919244d7bbbb40615f989f46b
firebase_messaging: 658f1a6906d80faec2fb20e3aadb81af6b09e441
FirebaseAnalytics: e04e23bc070e3014aa5cf4980f9df7ce5cd79ec8
FirebaseCore: 311c48a147ad4a0ab7febbaed89e8025c67510cd
FirebaseCoreExtension: 73af080c22a2f7b44cefa391dc08f7e4ee162cb5
FirebaseCoreInternal: 56ea29f3dad2894f81b060f706f9d53509b6ed3b
FirebaseCrashlytics: f83cbf176d5c637ade108c0aacf1ccbd5ec499bf
FirebaseInstallations: 3e884b01feabdf67582a80f3250425a00979b4ed
FirebaseMessaging: 43ec73bbfedd0c385a849bb91593ab4ad4b9e48e
FirebaseRemoteConfigInterop: 0896fd52ab72586a355c8f389ff85aaa9e5375e1
FirebaseSessions: f4692789e770bec66ce17d772c0e9561c4f11737
Firebase: f07b15ae5a6ec0f93713e30b923d9970d144af3e
firebase_analytics: d876586269c1d8d2b3dcac085bc2d97c62abc9df
firebase_core: d81d1a44df95699ce074ae63d8cb43e9df21e142
firebase_crashlytics: 723622cc39a9fa7320585424f5864c5699893ce1
firebase_messaging: 31f412ae5a54e02d1c46d467969f7ad92c4b81ec
FirebaseAnalytics: 0fc2b20091f0ddd21bf73397cf8f0eb5346dc24f
FirebaseCore: bb595f3114953664e3c1dc032f008a244147cfd3
FirebaseCoreExtension: 7e1f7118ee970e001a8013719fb90950ee5e0018
FirebaseCoreInternal: d7f5a043c2cd01a08103ab586587c1468047bca6
FirebaseCrashlytics: a6ece278a837c7e88de2d9b5da0a3542f2342395
FirebaseInstallations: ae9f4902cb5bf1d0c5eaa31ec1f4e5495a0714e2
FirebaseMessaging: d33971b7bb252745ea6cd31ab190d1a1df4b8ed5
FirebaseRemoteConfigInterop: 1e31ec72b89c9924367c59bfb5ec9ab60d1d6766
FirebaseSessions: ba7c7a7ca8696a8d540eb3fe3800fbe98c79786d
flutter_inappwebview_macos: c2d68649f9f8f1831bfcd98d73fd6256366d9d1d
flutter_local_notifications: 4bf37a31afde695b56091b4ae3e4d9c7a7e6cda0
flutter_platform_alert: 8fa7a7c21f95b26d08b4a3891936ca27e375f284
@@ -439,7 +439,7 @@ SPEC CHECKSUMS:
flutter_webrtc: 718eae22a371cd94e5d56aa4f301443ebc5bb737
FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1
gal: baecd024ebfd13c441269ca7404792a7152fde89
GoogleAppMeasurement: 09f341dfa8527d1612a09cbfe809a242c0b737af
GoogleAppMeasurement: 1e718274b7e015cefd846ac1fcf7820c70dc017d
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
irondash_engine_context: 893c7d96d20ce361d7e996f39d360c4c2f9869ba

View File

@@ -13,10 +13,10 @@ packages:
dependency: transitive
description:
name: _flutterfire_internals
sha256: "23d16f00a2da8ffa997c782453c73867b0609bd90435195671a54de38a3566df"
sha256: f871a7d1b686bea1f13722aa51ab31554d05c81f47054d6de48cc8c45153508b
url: "https://pub.dev"
source: hosted
version: "1.3.62"
version: "1.3.63"
analyzer:
dependency: transitive
description:
@@ -289,22 +289,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.19.1"
connectivity_plus:
dependency: transitive
description:
name: connectivity_plus
sha256: b5e72753cf63becce2c61fd04dfe0f1c430cc5278b53a1342dc5ad839eab29ec
url: "https://pub.dev"
source: hosted
version: "6.1.5"
connectivity_plus_platform_interface:
dependency: transitive
description:
name: connectivity_plus_platform_interface
sha256: "42657c1715d48b167930d5f34d00222ac100475f73d10162ddf43e714932f204"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
console:
dependency: transitive
description:
@@ -629,90 +613,90 @@ packages:
dependency: "direct main"
description:
name: firebase_analytics
sha256: fce78440ab7b95563054039aac5e342088efed9dc009ac6f81d5cac07155d509
sha256: "3cfc4089e61e810ffb531af63cfde2c8cfd36f12dc14fdba359e623992311015"
url: "https://pub.dev"
source: hosted
version: "12.0.2"
version: "12.0.3"
firebase_analytics_platform_interface:
dependency: transitive
description:
name: firebase_analytics_platform_interface
sha256: "75bdcd2d2635c4cdcd7ec13727527751ddf2f9933e5bf1264a2387920246f3c5"
sha256: "775fc18d9b00a014362510a33f76f1f34deb30f69a64edcb41a7dfd0ebd9cf98"
url: "https://pub.dev"
source: hosted
version: "5.0.2"
version: "5.0.3"
firebase_analytics_web:
dependency: transitive
description:
name: firebase_analytics_web
sha256: ed5767695b131cdd425ee6d49934dca80689d9df40609c0d0aa8907ee6f0f785
sha256: "6eafa8fef5fdca6c922ac3e353c9a093c12344a3ba996e65fd40f8db0a00d26f"
url: "https://pub.dev"
source: hosted
version: "0.6.0+2"
version: "0.6.0+3"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
sha256: "4dd96f05015c0dcceaa47711394c32971aee70169625d5e2477e7676c01ce0ee"
sha256: "132e1c311bc41e7d387b575df0aacdf24efbf4930365eb61042be5bde3978f03"
url: "https://pub.dev"
source: hosted
version: "4.1.1"
version: "4.2.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
sha256: "5873a370f0d232918e23a5a6137dbe4c2c47cf017301f4ea02d9d636e52f60f0"
sha256: cccb4f572325dc14904c02fcc7db6323ad62ba02536833dddb5c02cac7341c64
url: "https://pub.dev"
source: hosted
version: "6.0.1"
version: "6.0.2"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
sha256: "61a51037312dac781f713308903bb7a1762a7f92f7bc286a3a0947fb2a713b82"
sha256: ecde2def458292404a4fcd3731ee4992fd631a0ec359d2d67c33baa8da5ec8ae
url: "https://pub.dev"
source: hosted
version: "3.1.1"
version: "3.2.0"
firebase_crashlytics:
dependency: "direct main"
description:
name: firebase_crashlytics
sha256: a636096df0d2a4bc72397bfc669a4fffc8896016a58de1a6f45a49d9ba064f94
sha256: "2f53d0d3c0875105b166f09bdf026026bb74f26930c6ffcd5d65b311ca5a9f58"
url: "https://pub.dev"
source: hosted
version: "5.0.2"
version: "5.0.3"
firebase_crashlytics_platform_interface:
dependency: transitive
description:
name: firebase_crashlytics_platform_interface
sha256: "1ccad077a6fc7bace97d8eace263f42e66dc23a23a839de864a4f10ac4a7c264"
sha256: de5c857525fc9576cd3fc30fc72422bc2371179ecae110246c0135ae896c6de3
url: "https://pub.dev"
source: hosted
version: "3.8.13"
version: "3.8.14"
firebase_messaging:
dependency: "direct main"
description:
name: firebase_messaging
sha256: ba12ad0b600e0c939fbb9391e1cd3320a5b5dad5284276b9182fc21eb1e72c2b
sha256: "5021279acd1cb5ccaceaa388e616e82cc4a2e4d862f02637df0e8ab766e6900a"
url: "https://pub.dev"
source: hosted
version: "16.0.2"
version: "16.0.3"
firebase_messaging_platform_interface:
dependency: transitive
description:
name: firebase_messaging_platform_interface
sha256: b4bade67bfc09fcc56eb012b3fc72b59ca9e2259a34cdfb81b368169770ff536
sha256: f3a16c51f02055ace2a7c16ccb341c1f1b36b67c13270a48bcef68c1d970bbe8
url: "https://pub.dev"
source: hosted
version: "4.7.2"
version: "4.7.3"
firebase_messaging_web:
dependency: transitive
description:
name: firebase_messaging_web
sha256: "8ae4a00d178993feb79603cad324b53696375cbb78805e8eb603fe331866629d"
sha256: "3eb9a1382caeb95b370f21e36d4a460496af777c9c2ef5df9b90d4803982c069"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.0.3"
fixnum:
dependency: transitive
description:
@@ -770,10 +754,10 @@ packages:
dependency: "direct main"
description:
name: flutter_card_swiper
sha256: "1eacbfab31b572223042e03409726553aec431abe48af48c8d591d376d070d3d"
sha256: "9fbe75c913c0a01f34f9f98068ad198e396695fcf8abfa433cc53652fceb5617"
url: "https://pub.dev"
source: hosted
version: "7.0.2"
version: "7.1.0"
flutter_colorpicker:
dependency: "direct main"
description:
@@ -930,10 +914,10 @@ packages:
dependency: "direct main"
description:
name: flutter_local_notifications
sha256: "7ed76be64e8a7d01dfdf250b8434618e2a028c9dfa2a3c41dc9b531d4b3fc8a5"
sha256: "19ffb0a8bb7407875555e5e98d7343a633bb73707bae6c6a5f37c90014077875"
url: "https://pub.dev"
source: hosted
version: "19.4.2"
version: "19.5.0"
flutter_local_notifications_linux:
dependency: transitive
description:
@@ -991,10 +975,10 @@ packages:
dependency: "direct main"
description:
name: flutter_native_splash
sha256: "8321a6d11a8d13977fa780c89de8d257cce3d841eecfb7a4cadffcc4f12d82dc"
sha256: "4fb9f4113350d3a80841ce05ebf1976a36de622af7d19aca0ca9a9911c7ff002"
url: "https://pub.dev"
source: hosted
version: "2.4.6"
version: "2.4.7"
flutter_otp_text_field:
dependency: "direct main"
description:
@@ -1201,10 +1185,10 @@ packages:
dependency: "direct main"
description:
name: go_router
sha256: c752e2d08d088bf83742cb05bf83003f3e9d276ff1519b5c92f9d5e60e5ddd23
sha256: e1d7ffb0db475e6e845eb58b44768f50b830e23960e3df6908924acd8f7f70ea
url: "https://pub.dev"
source: hosted
version: "16.2.4"
version: "16.2.5"
google_fonts:
dependency: "direct main"
description:
@@ -1321,10 +1305,10 @@ packages:
dependency: "direct main"
description:
name: image_picker_android
sha256: dd7a61daaa5896cc34b7bc95f66c60225ae6bee0d167dde0e21a9d9016cac0dc
sha256: "58a85e6f09fe9c4484d53d18a0bd6271b72c53fce1d05e6f745ae36d8c18efca"
url: "https://pub.dev"
source: hosted
version: "0.8.13+4"
version: "0.8.13+5"
image_picker_for_web:
dependency: transitive
description:
@@ -1469,38 +1453,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.0.0"
livekit_client:
dependency: "direct main"
description:
name: livekit_client
sha256: "4c1663c1e6ac20a743d9a46c7bc71f17e1949db99d245750c68661d554e30cd2"
url: "https://pub.dev"
source: hosted
version: "2.5.1"
local_auth:
dependency: "direct main"
description:
name: local_auth
sha256: "434d854cf478f17f12ab29a76a02b3067f86a63a6d6c4eb8fbfdcfe4879c1b7b"
sha256: a4f1bf57f0236a4aeb5e8f0ec180e197f4b112a3456baa6c1e73b546630b0422
url: "https://pub.dev"
source: hosted
version: "2.3.0"
version: "3.0.0"
local_auth_android:
dependency: transitive
description:
name: local_auth_android
sha256: b2446c74fab1db37f828d4c54adaa3f003df80a29f5cbd710bbb8883d302e991
sha256: d836715ed95b16b2de3a8c47a88ba5e607976bb1e27c9446d193152ea1429fae
url: "https://pub.dev"
source: hosted
version: "1.0.55"
version: "2.0.0"
local_auth_darwin:
dependency: transitive
description:
name: local_auth_darwin
sha256: "699873970067a40ef2f2c09b4c72eb1cfef64224ef041b3df9fdc5c4c1f91f49"
sha256: "15d9db4ad4d58a11d7269e55d46ff8d49ed5e856226c8a5a91280f0d7c37b3a6"
url: "https://pub.dev"
source: hosted
version: "1.6.1"
version: "2.0.0"
local_auth_platform_interface:
dependency: transitive
description:
@@ -1513,10 +1489,10 @@ packages:
dependency: transitive
description:
name: local_auth_windows
sha256: bc4e66a29b0fdf751aafbec923b5bed7ad6ed3614875d8151afe2578520b2ab5
sha256: d95535a73eddf57ce5930d5e78a0fa4f294c31981fdeeee83325b797302be454
url: "https://pub.dev"
source: hosted
version: "1.0.11"
version: "2.0.0"
logger:
dependency: transitive
description:
@@ -1669,14 +1645,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.0"
mime_type:
dependency: transitive
description:
name: mime_type
sha256: d652b613e84dac1af28030a9fba82c0999be05b98163f9e18a0849c6e63838bb
url: "https://pub.dev"
source: hosted
version: "1.0.1"
modal_bottom_sheet:
dependency: "direct main"
description:
@@ -1709,14 +1677,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0"
nm:
dependency: transitive
description:
name: nm
sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
octo_image:
dependency: transitive
description:
@@ -1933,14 +1893,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.4"
protobuf:
dependency: transitive
description:
name: protobuf
sha256: de9c9eb2c33f8e933a42932fe1dc504800ca45ebc3d673e6ed7f39754ee4053e
url: "https://pub.dev"
source: hosted
version: "4.2.0"
provider:
dependency: transitive
description:
@@ -1992,10 +1944,11 @@ packages:
receive_sharing_intent:
dependency: "direct main"
description:
name: receive_sharing_intent
sha256: ec76056e4d258ad708e76d85591d933678625318e411564dcb9059048ca3a593
url: "https://pub.dev"
source: hosted
path: "."
ref: master
resolved-ref: "2cea396843cd3ab1b5ec4334be4233864637874e"
url: "https://github.com/KasemJaffer/receive_sharing_intent"
source: git
version: "1.8.1"
record:
dependency: "direct main"
@@ -2205,14 +2158,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.1"
sdp_transform:
dependency: transitive
description:
name: sdp_transform
sha256: "73e412a5279a5c2de74001535208e20fff88f225c9a4571af0f7146202755e45"
url: "https://pub.dev"
source: hosted
version: "0.3.2"
share_plus:
dependency: "direct main"
description:
@@ -2430,10 +2375,10 @@ packages:
dependency: transitive
description:
name: sqlite3
sha256: "809bc27297bd0633ef360a7e27e056e93a2ef598079616db97b0c93e275f6d31"
sha256: f18fd9a72d7a1ad2920db61368f2a69368f1cc9b56b8233e9d83b47b0a8435aa
url: "https://pub.dev"
source: hosted
version: "2.9.2"
version: "2.9.3"
sqlite3_flutter_libs:
dependency: transitive
description:
@@ -2674,15 +2619,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.6"
textfield_tags:
dependency: "direct main"
description:
path: "."
ref: "fixes/allow-controller-re-registration"
resolved-ref: "7574e79649e34df1c3cc0c49b2f0cc2b92de6a7b"
url: "https://github.com/lionelmennig/textfield_tags.git"
source: git
version: "3.0.1"
timezone:
dependency: "direct main"
description:

View File

@@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 3.2.0+134
version: 3.3.0+136
environment:
sdk: ^3.7.2
@@ -38,7 +38,7 @@ dependencies:
cupertino_icons: ^1.0.8
flutter_hooks: ^0.21.3+1
hooks_riverpod: ^2.6.1
go_router: ^16.2.4
go_router: ^16.2.5
styled_widget: ^0.4.1
shared_preferences: ^2.5.3
flutter_riverpod: ^2.6.1
@@ -75,12 +75,12 @@ dependencies:
file_picker: ^10.3.3
riverpod_annotation: ^2.6.1
image_picker_platform_interface: ^2.11.0
image_picker_android: ^0.8.13+4
image_picker_android: ^0.8.13+5
super_context_menu: ^0.9.1
modal_bottom_sheet: ^3.0.0
firebase_messaging: ^16.0.2
firebase_messaging: ^16.0.3
flutter_udid: ^4.0.0
firebase_core: ^4.1.1
firebase_core: ^4.2.0
web_socket_channel: ^3.0.3
material_symbols_icons: ^4.2874.0
drift: ^2.28.2
@@ -97,12 +97,12 @@ dependencies:
avatar_stack: ^3.0.0
markdown_widget: ^2.3.2+8
visibility_detector: ^0.4.0+2
flutter_native_splash: ^2.4.6
flutter_native_splash: ^2.4.7
photo_view: ^0.15.0
gal: ^2.3.2
dismissible_page: ^1.0.2
super_sliver_list: ^0.4.1
livekit_client: ^2.5.1
pasteboard: ^0.4.0
flutter_colorpicker: ^1.1.0
image: ^4.5.4
@@ -117,16 +117,16 @@ dependencies:
sign_in_with_apple: ^7.0.1
flutter_svg: ^2.2.1
native_exif: ^0.6.2
local_auth: ^2.3.0
local_auth: ^3.0.0
flutter_secure_storage: ^9.2.4
flutter_math_fork: ^0.7.4
share_plus: ^12.0.0
receive_sharing_intent: ^1.8.1
top_snackbar_flutter: ^3.3.0
textfield_tags:
# https://github.com/KasemJaffer/receive_sharing_intent/pull/333
receive_sharing_intent:
git:
url: https://github.com/lionelmennig/textfield_tags.git
ref: fixes/allow-controller-re-registration
url: https://github.com/KasemJaffer/receive_sharing_intent
ref: master
top_snackbar_flutter: ^3.3.0
mime: ^2.0.0
html2md: ^1.3.2
flutter_typeahead: ^5.2.0
@@ -134,15 +134,15 @@ dependencies:
flutter_app_update: ^3.2.2
archive: ^4.0.7
process_run: ^1.2.4
firebase_crashlytics: ^5.0.2
firebase_analytics: ^12.0.2
firebase_crashlytics: ^5.0.3
firebase_analytics: ^12.0.3
material_color_utilities: ^0.11.1
screenshot: ^3.0.0
flutter_card_swiper: ^7.0.2
flutter_card_swiper: ^7.1.0
file_saver: ^0.3.1
tray_manager: ^0.5.1
flutter_webrtc: ^1.2.0
flutter_local_notifications: ^19.4.2
flutter_local_notifications: ^19.5.0
wakelock_plus: ^1.4.0
slide_countdown: ^2.0.2
shelf: ^1.4.2

View File

@@ -1,6 +1,6 @@
; ==================================================
#define AppVersion "3.2.0"
#define BuildNumber "134"
#define AppVersion "3.3.0"
#define BuildNumber "136"
; ==================================================
#define FullVersion AppVersion + "." + BuildNumber

View File

@@ -7,7 +7,6 @@
#include "generated_plugin_registrant.h"
#include <app_links/app_links_plugin_c_api.h>
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
#include <dart_ipc/dart_ipc_plugin_c_api.h>
#include <file_saver/file_saver_plugin.h>
#include <file_selector_windows/file_selector_windows.h>
@@ -20,7 +19,6 @@
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
#include <gal/gal_plugin_c_api.h>
#include <irondash_engine_context/irondash_engine_context_plugin_c_api.h>
#include <livekit_client/live_kit_plugin.h>
#include <local_auth_windows/local_auth_plugin.h>
#include <media_kit_libs_windows_video/media_kit_libs_windows_video_plugin_c_api.h>
#include <media_kit_video/media_kit_video_plugin_c_api.h>
@@ -40,8 +38,6 @@
void RegisterPlugins(flutter::PluginRegistry* registry) {
AppLinksPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("AppLinksPluginCApi"));
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin"));
DartIpcPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DartIpcPluginCApi"));
FileSaverPluginRegisterWithRegistrar(
@@ -66,8 +62,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("GalPluginCApi"));
IrondashEngineContextPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("IrondashEngineContextPluginCApi"));
LiveKitPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("LiveKitPlugin"));
LocalAuthPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("LocalAuthPlugin"));
MediaKitLibsWindowsVideoPluginCApiRegisterWithRegistrar(

View File

@@ -4,7 +4,6 @@
list(APPEND FLUTTER_PLUGIN_LIST
app_links
connectivity_plus
dart_ipc
file_saver
file_selector_windows
@@ -17,7 +16,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
flutter_webrtc
gal
irondash_engine_context
livekit_client
local_auth_windows
media_kit_libs_windows_video
media_kit_video