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