Skip to content

Commit c869ac9

Browse files
committed
confirm functionality on android
1 parent 1c5b39a commit c869ac9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
23
<uses-permission android:name="android.permission.INTERNET" />
4+
35
<application
46
android:label="ka_client"
57
android:name="${applicationName}"

lib/api_connection.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:ka_client/product.dart';
44
import 'package:http/http.dart' as http;
55

66
class APIConnection {
7+
// Replace localhost with 10.0.2.2 for Android Emulator
78
String url = 'http://127.0.0.1:8000/products';
89
late Future<List<Product>> products;
910

lib/style_components/product_info_dialog.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import '../product.dart';
66
class ProductInfoDialog extends StatelessWidget {
77
final Product product;
88

9-
Future<void> _launchUrl(url) async {
10-
if (!await launchUrl(url)) {
9+
Future<void> _launchUrl(String url) async {
10+
if (!await launchUrl(Uri.parse(url))) {
1111
throw Exception('Could not launch $url');
1212
}
1313
}
@@ -42,7 +42,8 @@ class ProductInfoDialog extends StatelessWidget {
4242
title: const Text('Open in browser'),
4343
onTap: () {
4444
// Open the product in the browser
45-
_launchUrl(Uri.parse("https://www.kleinanzeigen.de/s-anzeige/${product.id.toString()}"));
45+
_launchUrl(
46+
"https://www.kleinanzeigen.de/s-anzeige/${product.id.toString()}");
4647
},
4748
)
4849
],

0 commit comments

Comments
 (0)