Skip to content

Commit

Permalink
Merge pull request #104 from gennadyterekhov/issue-103
Browse files Browse the repository at this point in the history
issue-103
  • Loading branch information
gennadyterekhov authored Feb 5, 2023
2 parents a561d59 + c0911bb commit eb6411d
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 5 deletions.
22 changes: 22 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,26 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Provide required visibility configuration for API level 30 and above -->
<queries>
<!-- If your app checks for SMS support -->
<!-- <intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="sms" />
</intent> -->
<!-- If your app checks for call support -->
<!-- <intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="tel" />
</intent> -->

<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="file" />
</intent>
</queries>
</manifest>
7 changes: 7 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>sms</string>
<string>tel</string>
<string>https</string>
<string>file</string>
</array>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
Expand Down
9 changes: 9 additions & 0 deletions lib/helpers/link_launcher.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import 'package:url_launcher/url_launcher.dart';

class LinkLauncher {
static Future<void> launch({required String url}) async {
if (!await launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication)) {
throw Exception('Could not launch $url');
}
}
}
4 changes: 2 additions & 2 deletions lib/widgets/components/links/image_link.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:the_elder_scrolls_alchemy_client/helpers/link_launcher.dart';

class ImageWebLink extends StatelessWidget {
const ImageWebLink({Key? key, required this.image, required this.url}) : super(key: key);
Expand All @@ -10,7 +10,7 @@ class ImageWebLink extends StatelessWidget {
Widget build(BuildContext context) {
final link = InkWell(
onTap: () {
launchUrl(Uri.parse(url));
LinkLauncher.launch(url: url);
},
child: image,
);
Expand Down
4 changes: 2 additions & 2 deletions lib/widgets/components/links/web_link.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:the_elder_scrolls_alchemy_client/helpers/link_launcher.dart';

class WebLink extends StatelessWidget {
const WebLink({Key? key, required this.text, required this.url}) : super(key: key);
Expand All @@ -10,7 +10,7 @@ class WebLink extends StatelessWidget {
Widget build(BuildContext context) {
final link = InkWell(
onTap: () {
launchUrl(Uri.parse(url));
LinkLauncher.launch(url: url);
},
child: Text(
text,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ flutter:
- assets/img/oblivion/ingredients/
- assets/img/morrowind/effects/
- assets/img/morrowind/ingredients/
- assets/img/logo.png
- assets/img/play_stores/logo.png

# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
Expand Down

0 comments on commit eb6411d

Please sign in to comment.