diff --git a/lib/pages/chat/events/message_content.dart b/lib/pages/chat/events/message_content.dart index de5722eb..843a7355 100644 --- a/lib/pages/chat/events/message_content.dart +++ b/lib/pages/chat/events/message_content.dart @@ -260,7 +260,10 @@ class MessageContent extends StatelessWidget { decoration: TextDecoration.underline, decorationColor: textColor.withAlpha(150), ), - onLinkTap: (url) => UrlLauncher(context, url).launchUrl(), + beforeLaunch: (url) { + UrlLauncher(context, url.toString()).launchUrl(); + return false; + }, ); }, ); diff --git a/lib/pages/chat/pinned_events.dart b/lib/pages/chat/pinned_events.dart index 35ec5d2d..a38d950e 100644 --- a/lib/pages/chat/pinned_events.dart +++ b/lib/pages/chat/pinned_events.dart @@ -126,8 +126,10 @@ class PinnedEvents extends StatelessWidget { decorationColor: Theme.of(context).colorScheme.onSurfaceVariant, ), - onLinkTap: (url) => - UrlLauncher(context, url).launchUrl(), + beforeLaunch: (url) { + UrlLauncher(context, url.toString()).launchUrl(); + return false; + }, ); }, ), diff --git a/lib/pages/chat_details/chat_details_view.dart b/lib/pages/chat_details/chat_details_view.dart index 68f25825..2f33e84a 100644 --- a/lib/pages/chat_details/chat_details_view.dart +++ b/lib/pages/chat_details/chat_details_view.dart @@ -142,8 +142,11 @@ class ChatDetailsView extends StatelessWidget { .bodyMedium! .color, ), - onLinkTap: (url) => - UrlLauncher(context, url).launchUrl(), + beforeLaunch: (url) { + UrlLauncher(context, url.toString()) + .launchUrl(); + return false; + }, ), ), const SizedBox(height: 8), diff --git a/lib/pages/story/story_view.dart b/lib/pages/story/story_view.dart index 3dc1e431..40aae425 100644 --- a/lib/pages/story/story_view.dart +++ b/lib/pages/story/story_view.dart @@ -278,7 +278,10 @@ class StoryView extends StatelessWidget { ? L10n.of(context)!.loadingPleaseWait : event.content.tryGet('body') ?? '', textAlign: TextAlign.center, - onLinkTap: (url) => UrlLauncher(context, url).launchUrl(), + beforeLaunch: (url) { + UrlLauncher(context, url.toString()).launchUrl(); + return false; + }, linkStyle: TextStyle( fontSize: 24, color: Colors.blue.shade50, diff --git a/lib/widgets/public_room_bottom_sheet.dart b/lib/widgets/public_room_bottom_sheet.dart index af182c7d..832f33bf 100644 --- a/lib/widgets/public_room_bottom_sheet.dart +++ b/lib/widgets/public_room_bottom_sheet.dart @@ -160,7 +160,10 @@ class PublicRoomBottomSheet extends StatelessWidget { fontSize: 14, color: Theme.of(context).textTheme.bodyMedium!.color, ), - onLinkTap: (url) => UrlLauncher(context, url).launchUrl(), + beforeLaunch: (url) { + UrlLauncher(context, url.toString()).launchUrl(); + return false; + }, ), ), ], diff --git a/pubspec.lock b/pubspec.lock index dcbad192..d6520bd4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -580,8 +580,8 @@ packages: dependency: "direct main" description: path: "." - ref: "krille/update-dependencies" - resolved-ref: "167fdbb8fa7d61f8edadbbfcdd3b0d26d0e46c67" + ref: HEAD + resolved-ref: "81d8988584506d1eff0e28abd2a13af96fecb638" url: "https://github.com/Sorunome/flutter_matrix_html.git" source: git version: "1.1.0" diff --git a/pubspec.yaml b/pubspec.yaml index d61596a5..c06fc210 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -146,9 +146,7 @@ dependency_overrides: # null safety flutter_math_fork: ">=0.7.0" flutter_matrix_html: - git: - url: https://github.com/Sorunome/flutter_matrix_html.git - ref: krille/update-dependencies + git: https://github.com/Sorunome/flutter_matrix_html.git # fake secure storage plugin for Windows # See: https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/15161 flutter_secure_storage_windows: