diff --git a/lib/config/routes.dart b/lib/config/routes.dart index 9c7eec9e..9e9f6f17 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -412,17 +412,19 @@ abstract class AppRoutes { ), ]; - static Page defaultPageBuilder(BuildContext context, Widget child) => - CustomTransitionPage( - child: child, - transitionsBuilder: (context, animation, secondaryAnimation, child) => - FluffyThemes.isColumnMode(context) - ? FadeTransition(opacity: animation, child: child) - : CupertinoPageTransition( - primaryRouteAnimation: animation, - secondaryRouteAnimation: secondaryAnimation, - linearTransition: false, - child: child, - ), - ); + static Page defaultPageBuilder(BuildContext context, Widget child) { + Matrix.of(context).navigatorContext = context; + return CustomTransitionPage( + child: child, + transitionsBuilder: (context, animation, secondaryAnimation, child) => + FluffyThemes.isColumnMode(context) + ? FadeTransition(opacity: animation, child: child) + : CupertinoPageTransition( + primaryRouteAnimation: animation, + secondaryRouteAnimation: secondaryAnimation, + linearTransition: false, + child: child, + ), + ); + } } diff --git a/lib/pages/bootstrap/bootstrap_dialog.dart b/lib/pages/bootstrap/bootstrap_dialog.dart index ca1ef0c8..c457d4c3 100644 --- a/lib/pages/bootstrap/bootstrap_dialog.dart +++ b/lib/pages/bootstrap/bootstrap_dialog.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:adaptive_dialog/adaptive_dialog.dart'; @@ -8,9 +7,9 @@ import 'package:future_loading_dialog/future_loading_dialog.dart'; import 'package:matrix/encryption.dart'; import 'package:matrix/encryption/utils/bootstrap.dart'; import 'package:matrix/matrix.dart'; -import 'package:share_plus/share_plus.dart'; import 'package:fluffychat/config/themes.dart'; +import 'package:fluffychat/utils/fluffy_share.dart'; import 'package:fluffychat/utils/platform_infos.dart'; import 'package:fluffychat/widgets/adaptive_flat_button.dart'; import '../../utils/adaptive_bottom_sheet.dart'; @@ -91,9 +90,7 @@ class BootstrapDialogState extends State { Widget build(BuildContext context) { _wipe ??= widget.wipe; final buttons = []; - Widget body = PlatformInfos.isCupertinoStyle - ? const CupertinoActivityIndicator() - : const LinearProgressIndicator(); + Widget body = const CircularProgressIndicator.adaptive(); titleText = L10n.of(context)!.loadingPleaseWait; if (bootstrap.newSsssKey?.recoveryKey != null && @@ -163,12 +160,7 @@ class BootstrapDialogState extends State { value: _recoveryKeyCopied, activeColor: Theme.of(context).colorScheme.primary, onChanged: (b) { - final box = context.findRenderObject() as RenderBox; - Share.share( - key!, - sharePositionOrigin: - box.localToGlobal(Offset.zero) & box.size, - ); + FluffyShare.share(key!, context); setState(() => _recoveryKeyCopied = true); }, title: Text(L10n.of(context)!.copyToClipboard), @@ -295,18 +287,31 @@ class BootstrapDialogState extends State { _recoveryKeyInputLoading = true; }); try { - final key = - _recoveryKeyTextEditingController.text; + final key = _recoveryKeyTextEditingController + .text + .trim(); await bootstrap.newSsssKey!.unlock( keyOrPassphrase: key, ); - Logs().d('SSSS unlocked'); - await bootstrap.client.encryption!.crossSigning - .selfSign( - keyOrPassphrase: key, - ); - Logs().d('Successful elfsigned'); await bootstrap.openExistingSsss(); + Logs().d('SSSS unlocked'); + if (bootstrap.encryption.crossSigning.enabled) { + Logs().v( + 'Cross signing is already enabled. Try to self-sign', + ); + try { + await bootstrap + .client.encryption!.crossSigning + .selfSign(recoveryKey: key); + Logs().d('Successful selfsigned'); + } catch (e, s) { + Logs().e( + 'Unable to self sign with recovery key after successfully open existing SSSS', + e, + s, + ); + } + } } catch (e, s) { Logs().w('Unable to unlock SSSS', e, s); setState( @@ -435,18 +440,12 @@ class BootstrapDialogState extends State { } } - final title = Text(titleText!); - if (PlatformInfos.isCupertinoStyle) { - return CupertinoAlertDialog( - title: title, - content: body, - actions: buttons, - ); - } - return AlertDialog( - title: title, - content: body, - actions: buttons, + return Scaffold( + appBar: AppBar( + title: Text(titleText ?? L10n.of(context)!.loadingPleaseWait), + ), + body: Center(child: body), + bottomNavigationBar: Row(children: buttons), ); } } diff --git a/lib/pages/homeserver_picker/homeserver_picker_view.dart b/lib/pages/homeserver_picker/homeserver_picker_view.dart index 4b0eaad0..fa958320 100644 --- a/lib/pages/homeserver_picker/homeserver_picker_view.dart +++ b/lib/pages/homeserver_picker/homeserver_picker_view.dart @@ -182,6 +182,10 @@ class _LoginButton extends StatelessWidget { width: 256, child: OutlinedButton( style: OutlinedButton.styleFrom( + side: BorderSide( + width: 1, + color: Theme.of(context).colorScheme.onBackground, + ), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(90), ), diff --git a/linux/my_application.cc b/linux/my_application.cc index def9ad0f..23ca962c 100644 --- a/linux/my_application.cc +++ b/linux/my_application.cc @@ -60,7 +60,7 @@ static void my_application_activate(GApplication* application) { gtk_window_set_title(window, "fluffychat"); } - gtk_window_set_default_size(window, 864, 600); + gtk_window_set_default_size(window, 864, 680); g_autoptr(FlDartProject) project = fl_dart_project_new(); fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);