chore: Minor code clean up

This commit is contained in:
Krille 2023-05-15 18:55:27 +02:00
parent 54a6ce8391
commit 1a8038e51d
No known key found for this signature in database
7 changed files with 24 additions and 12 deletions

View File

@ -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;
},
);
},
);

View File

@ -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;
},
);
},
),

View File

@ -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),

View File

@ -278,7 +278,10 @@ class StoryView extends StatelessWidget {
? L10n.of(context)!.loadingPleaseWait
: event.content.tryGet<String>('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,

View File

@ -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;
},
),
),
],

View File

@ -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"

View File

@ -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: