File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
<manifest xmlns : android =" http://schemas.android.com/apk/res/android" >
2
+
2
3
<uses-permission android : name =" android.permission.INTERNET" />
4
+
3
5
<application
4
6
android : label =" ka_client"
5
7
android : name =" ${applicationName}"
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import 'package:ka_client/product.dart';
4
4
import 'package:http/http.dart' as http;
5
5
6
6
class APIConnection {
7
+ // Replace localhost with 10.0.2.2 for Android Emulator
7
8
String url = 'http://127.0.0.1:8000/products' ;
8
9
late Future <List <Product >> products;
9
10
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ import '../product.dart';
6
6
class ProductInfoDialog extends StatelessWidget {
7
7
final Product product;
8
8
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) )) {
11
11
throw Exception ('Could not launch $url ' );
12
12
}
13
13
}
@@ -42,7 +42,8 @@ class ProductInfoDialog extends StatelessWidget {
42
42
title: const Text ('Open in browser' ),
43
43
onTap: () {
44
44
// 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 ()}" );
46
47
},
47
48
)
48
49
],
You can’t perform that action at this time.
0 commit comments