diff --git a/lib/config/go_routes/go_router.dart b/lib/config/go_routes/go_router.dart index d585d5dd32..c030f8f853 100644 --- a/lib/config/go_routes/go_router.dart +++ b/lib/config/go_routes/go_router.dart @@ -78,7 +78,7 @@ abstract class AppRoutes { path: '/home', pageBuilder: (context, state) => defaultPageBuilder( context, - PlatformInfos.isMobile + PlatformInfos.isMobile || PlatformInfos.isLinux ? const TwakeWelcome() : AutoHomeserverPicker( loggedOut: state.extra is bool ? state.extra as bool? : null, diff --git a/lib/pages/bootstrap/bootstrap_dialog.dart b/lib/pages/bootstrap/bootstrap_dialog.dart index bca0fa0442..b948ae7a16 100644 --- a/lib/pages/bootstrap/bootstrap_dialog.dart +++ b/lib/pages/bootstrap/bootstrap_dialog.dart @@ -67,7 +67,7 @@ class BootstrapDialogState extends State { if (PlatformInfos.isAndroid) { return L10n.of(context)!.storeInAndroidKeystore; } - if (PlatformInfos.isIOS || PlatformInfos.isMacOS) { + if (PlatformInfos.isIOS || PlatformInfos.isMacOS || PlatformInfos.isLinux) { return L10n.of(context)!.storeInAppleKeyChain; } return L10n.of(context)!.storeSecurlyOnThisDevice; diff --git a/lib/pages/chat/events/message_content.dart b/lib/pages/chat/events/message_content.dart index 806b29189c..2163ba28eb 100644 --- a/lib/pages/chat/events/message_content.dart +++ b/lib/pages/chat/events/message_content.dart @@ -75,6 +75,7 @@ class MessageContent extends StatelessWidget if (PlatformInfos.isMobile || PlatformInfos.isMacOS || PlatformInfos.isWeb + // TODO: test this // Disabled until https://github.com/bleonard252/just_audio_mpv/issues/3 // is fixed // || PlatformInfos.isLinux diff --git a/lib/pages/dialer/dialer.dart b/lib/pages/dialer/dialer.dart index c1a5cfd739..a306bbda79 100644 --- a/lib/pages/dialer/dialer.dart +++ b/lib/pages/dialer/dialer.dart @@ -186,7 +186,10 @@ class MyCallingPage extends State { void _playCallSound() async { const path = 'assets/sounds/call.ogg'; - if (kIsWeb || PlatformInfos.isMobile || PlatformInfos.isMacOS) { + if (kIsWeb || + PlatformInfos.isMobile || + PlatformInfos.isMacOS || + PlatformInfos.isLinux) { final player = AudioPlayer(); await player.setAsset(path); player.play(); diff --git a/lib/presentation/mixins/connect_page_mixin.dart b/lib/presentation/mixins/connect_page_mixin.dart index 25bbd74b7a..da5f06b013 100644 --- a/lib/presentation/mixins/connect_page_mixin.dart +++ b/lib/presentation/mixins/connect_page_mixin.dart @@ -37,13 +37,19 @@ mixin ConnectPageMixin { bool supportsSso(BuildContext context) => (PlatformInfos.isMobile || PlatformInfos.isWeb || - PlatformInfos.isMacOS) && + PlatformInfos.isMacOS || + PlatformInfos.isLinux) && supportsFlow(context: context, flowType: 'm.login.sso'); bool supportsLogin(BuildContext context) => supportsFlow(context: context, flowType: 'm.login.password'); String _getRedirectUrlScheme(String redirectUrl) { + // Remove when package limitation will be fixed + // https://pub.dev/packages/flutter_web_auth_2#windows-and-linux + if (PlatformInfos.isLinux || PlatformInfos.isWindows) { + return "http://localhost:60665"; + } return Uri.parse(redirectUrl).scheme; } @@ -92,6 +98,7 @@ mixin ConnectPageMixin { redirectUrl: redirectUrl, ); final urlScheme = _getRedirectUrlScheme(redirectUrl); + print("tez: urlScheme = $urlScheme"); return await FlutterWebAuth2.authenticate( url: url, callbackUrlScheme: urlScheme, diff --git a/lib/utils/client_manager.dart b/lib/utils/client_manager.dart index 7b9cf5418c..17cfa360e4 100644 --- a/lib/utils/client_manager.dart +++ b/lib/utils/client_manager.dart @@ -107,7 +107,8 @@ abstract class ClientManager { AuthenticationTypes.password, if (PlatformInfos.isMobile || PlatformInfos.isWeb || - PlatformInfos.isMacOS) + PlatformInfos.isMacOS || + PlatformInfos.isLinux) AuthenticationTypes.sso, }, nativeImplementations: nativeImplementations, diff --git a/lib/utils/voip/user_media_manager.dart b/lib/utils/voip/user_media_manager.dart index 874da93ee1..f6b747efe5 100644 --- a/lib/utils/voip/user_media_manager.dart +++ b/lib/utils/voip/user_media_manager.dart @@ -19,7 +19,7 @@ class UserMediaManager { Future startRingingTone() async { if (PlatformInfos.isMobile) { await FlutterRingtonePlayer.playRingtone(volume: 80); - } else if ((kIsWeb || PlatformInfos.isMacOS) && + } else if ((kIsWeb || PlatformInfos.isMacOS || PlatformInfos.isLinux) && _assetsAudioPlayer != null) { const path = 'assets/sounds/phone.ogg'; final player = _assetsAudioPlayer = AudioPlayer(); diff --git a/pubspec.lock b/pubspec.lock index 6d22a13ddc..f8977ed4cc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1022,26 +1022,27 @@ packages: dependency: "direct main" description: name: flutter_secure_storage - sha256: f2afec1f1762c040a349ea2a588e32f442da5d0db3494a52a929a97c9e550bc5 + sha256: ffdbb60130e4665d2af814a0267c481bcf522c41ae2e43caf69fa0146876d685 url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "9.0.0" flutter_secure_storage_linux: - dependency: transitive + dependency: "direct overridden" description: - name: flutter_secure_storage_linux - sha256: "3d5032e314774ee0e1a7d0a9f5e2793486f0dff2dd9ef5a23f4e3fb2a0ae6a9e" - url: "https://pub.dev" - source: hosted + path: flutter_secure_storage_linux + ref: develop + resolved-ref: "27d3e2e69123f0c712919ad392e15830741e4383" + url: "https://github.com/tomekit/flutter_secure_storage.git" + source: git version: "1.2.0" flutter_secure_storage_macos: dependency: transitive description: name: flutter_secure_storage_macos - sha256: ff0768a6700ea1d9620e03518e2e25eac86a8bd07ca3556e9617bfa5ace4bd00 + sha256: bd33935b4b628abd0b86c8ca20655c5b36275c3a3f5194769a7b3f37c905369c url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" flutter_secure_storage_platform_interface: dependency: transitive description: @@ -3064,13 +3065,13 @@ packages: source: hosted version: "1.1.0" web: - dependency: transitive + dependency: "direct overridden" description: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.5.1" web_socket_channel: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 32970c7ffe..c97c0c6b30 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -89,7 +89,7 @@ dependencies: flutter_olm: ^1.2.0 flutter_openssl_crypto: ^0.1.0 flutter_ringtone_player: ^3.1.1 - flutter_secure_storage: ^7.0.1 + flutter_secure_storage: ^9.0.0 flutter_svg: ^0.22.0 flutter_typeahead: ^5.1.0 flutter_web_auth_2: ^3.1.1 @@ -245,6 +245,12 @@ dependency_overrides: git: url: https://gitlab.com/TheOneWithTheBraid/flutter_secure_storage_windows.git ref: main + # https://github.com/mogol/flutter_secure_storage/issues/616 + flutter_secure_storage_linux: + git: + url: https://github.com/tomekit/flutter_secure_storage.git + ref: develop + path: flutter_secure_storage_linux geolocator_android: hosted: name: geolocator_android @@ -269,6 +275,7 @@ dependency_overrides: git: url: https://github.com/linagora/matrix_link_text.git ref: twake-supported + web: ^0.5.0 cider: link_template: