Skip to content

Commit 2e72feb

Browse files
author
tensor-programming
committed
remove share and add url_laucher
1 parent db0c1d1 commit 2e72feb

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## 0.0.1

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
FlutterApplication and put your custom class here. -->
1515
<application
1616
android:name="io.flutter.app.FlutterApplication"
17-
android:label="utopian_rocks"
17+
android:label="Utopian Rocks Mobile"
1818
android:icon="@mipmap/ic_launcher">
1919
<activity
2020
android:name=".MainActivity"

lib/list_page.dart

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
22
import 'package:utopian_rocks/provider.dart';
33
import 'package:utopian_rocks/utils.dart';
44
import 'package:timeago/timeago.dart' as timeago;
5-
import 'package:share/share.dart';
5+
import 'package:url_launcher/url_launcher.dart';
66

77
class ListPage extends StatelessWidget {
88
final String tabname;
@@ -81,8 +81,8 @@ class ListPage extends StatelessWidget {
8181
),
8282
),
8383
// Using the share library to deploy a share intent on both android and iOS with the contribution url.
84-
onDoubleTap: () {
85-
Share.share('${snapshot.data[index].url}');
84+
onDoubleTap: () async {
85+
await _launchUrl(snapshot.data[index].url);
8686
},
8787
);
8888
});
@@ -108,4 +108,13 @@ class ListPage extends StatelessWidget {
108108
return "Reviewed: ${timeago.format(DateTime.fromMillisecondsSinceEpoch(snapshot.data[index].reviewDate))}";
109109
}
110110
}
111+
112+
// Laucn the steemit/utopian url using the url_launcher package.
113+
_launchUrl(String url) async {
114+
if (await canLaunch(url)) {
115+
await launch(url);
116+
} else {
117+
throw 'Could not launch $url';
118+
}
119+
}
111120
}

pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ dependencies:
2121
cupertino_icons: ^0.1.2
2222
rxdart: ^0.18.1
2323
timeago: ^2.0.7
24-
share: ^0.5.3
24+
url_launcher: ^3.0.3
25+
# share: ^0.5.3
2526

2627
dev_dependencies:
2728
flutter_test:

0 commit comments

Comments
 (0)