mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-06-25 08:44:08 +00:00
open links on external provider
This commit is contained in:
parent
bff567ee3d
commit
5dc071a737
7 changed files with 36 additions and 14 deletions
|
|
@ -41,7 +41,7 @@ class BetterText extends StatelessWidget {
|
|||
url!.startsWith('http') ? url : 'http://$url',
|
||||
);
|
||||
try {
|
||||
await launchUrl(lUrl);
|
||||
await launchUrl(lUrl, mode: LaunchMode.externalApplication);
|
||||
} catch (e) {
|
||||
Log.error('Could not launch $e');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|||
import 'package:twonly/src/database/daos/contacts.dao.dart';
|
||||
import 'package:twonly/src/utils/misc.dart';
|
||||
import 'package:twonly/src/visual/views/camera/camera_preview_components/main_camera_controller.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class CameraScannedOverlay extends StatelessWidget {
|
||||
const CameraScannedOverlay({
|
||||
|
|
@ -34,7 +34,10 @@ class CameraScannedOverlay extends StatelessWidget {
|
|||
Widget _buildScannedUrlTile(BuildContext context, String url) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
launchUrlString(url);
|
||||
launchUrl(
|
||||
Uri.parse(url),
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ class _MessageInputState extends State<MessageInput> {
|
|||
UserDiscoveryManualApprovalComp(group: widget.group),
|
||||
if (_contactId != null)
|
||||
Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: context.color.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|||
import 'package:twonly/src/database/daos/contacts.dao.dart';
|
||||
import 'package:twonly/src/database/twonly.db.dart';
|
||||
import 'package:twonly/src/model/protobuf/client/generated/data.pb.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class AdditionalMessageContent extends StatelessWidget {
|
||||
const AdditionalMessageContent(this.message, {super.key});
|
||||
|
|
@ -33,7 +33,10 @@ class AdditionalMessageContent extends StatelessWidget {
|
|||
children: [
|
||||
FilledButton.icon(
|
||||
icon: const FaIcon(FontAwesomeIcons.shareFromSquare),
|
||||
onPressed: () => launchUrlString(data.link),
|
||||
onPressed: () => launchUrl(
|
||||
Uri.parse(data.link),
|
||||
mode: LaunchMode.externalApplication,
|
||||
),
|
||||
label: Text(
|
||||
substringBy(
|
||||
data.link
|
||||
|
|
|
|||
|
|
@ -27,7 +27,10 @@ class UrlListTitle extends StatelessWidget {
|
|||
title: (title != null) ? Text(title!) : null,
|
||||
subtitle: subtitle == null ? null : Text(subtitle!),
|
||||
onTap: () async {
|
||||
await launchUrl(Uri.parse(url));
|
||||
await launchUrl(
|
||||
Uri.parse(url),
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
},
|
||||
trailing: const FaIcon(FontAwesomeIcons.arrowUpRightFromSquare, size: 15),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ class _HelpViewState extends State<HelpView> {
|
|||
title: const Text('Open Source'),
|
||||
onTap: () => launchUrl(
|
||||
Uri.parse('https://github.com/twonlyapp/twonly-app'),
|
||||
mode: LaunchMode.externalApplication,
|
||||
),
|
||||
trailing: const FaIcon(
|
||||
FontAwesomeIcons.arrowUpRightFromSquare,
|
||||
|
|
@ -104,8 +105,10 @@ class _HelpViewState extends State<HelpView> {
|
|||
),
|
||||
ListTile(
|
||||
title: Text(context.lang.settingsHelpImprint),
|
||||
onTap: () =>
|
||||
launchUrl(Uri.parse('https://twonly.eu/de/legal/')),
|
||||
onTap: () => launchUrl(
|
||||
Uri.parse('https://twonly.eu/de/legal/'),
|
||||
mode: LaunchMode.externalApplication,
|
||||
),
|
||||
trailing: const FaIcon(
|
||||
FontAwesomeIcons.arrowUpRightFromSquare,
|
||||
size: 15,
|
||||
|
|
@ -113,8 +116,10 @@ class _HelpViewState extends State<HelpView> {
|
|||
),
|
||||
ListTile(
|
||||
title: Text(context.lang.settingsHelpTerms),
|
||||
onTap: () =>
|
||||
launchUrl(Uri.parse('https://twonly.eu/de/legal/agb.html')),
|
||||
onTap: () => launchUrl(
|
||||
Uri.parse('https://twonly.eu/de/legal/agb.html'),
|
||||
mode: LaunchMode.externalApplication,
|
||||
),
|
||||
trailing: const FaIcon(
|
||||
FontAwesomeIcons.arrowUpRightFromSquare,
|
||||
size: 15,
|
||||
|
|
|
|||
|
|
@ -148,7 +148,10 @@ class _SubscriptionViewState extends State<SubscriptionView> {
|
|||
size: 15,
|
||||
),
|
||||
onTap: () async {
|
||||
await launchUrl(Uri.parse('https://twonly.eu/de/legal/agb.html'));
|
||||
await launchUrl(
|
||||
Uri.parse('https://twonly.eu/de/legal/agb.html'),
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
},
|
||||
),
|
||||
BetterListTile(
|
||||
|
|
@ -164,6 +167,7 @@ class _SubscriptionViewState extends State<SubscriptionView> {
|
|||
onTap: () async {
|
||||
await launchUrl(
|
||||
Uri.parse('https://twonly.eu/de/legal/privacy.html'),
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
},
|
||||
),
|
||||
|
|
@ -330,7 +334,9 @@ class _PlanCardState extends State<PlanCard> {
|
|||
? const SizedBox(
|
||||
width: 10,
|
||||
height: 10,
|
||||
child: CircularProgressIndicator.adaptive(strokeWidth: 1),
|
||||
child: CircularProgressIndicator.adaptive(
|
||||
strokeWidth: 1,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
label: Text(
|
||||
|
|
@ -350,7 +356,9 @@ class _PlanCardState extends State<PlanCard> {
|
|||
? const SizedBox(
|
||||
width: 10,
|
||||
height: 10,
|
||||
child: CircularProgressIndicator.adaptive(strokeWidth: 1),
|
||||
child: CircularProgressIndicator.adaptive(
|
||||
strokeWidth: 1,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
label: Text(
|
||||
|
|
|
|||
Loading…
Reference in a new issue