Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
133 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
lib/app/modules/item/widgets/comment_view/item_content.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:flutter_modular/flutter_modular.dart'; | ||
import 'package:share/share.dart'; | ||
|
||
import '../shared/util/url_util.dart'; | ||
|
||
part 'share_service.g.dart'; | ||
|
||
@Injectable() | ||
class ShareService extends Disposable { | ||
void share({String title, String url}) { | ||
var parsedUrl = UrlUtil.parseUrl(url); | ||
Share.share('$title\n$parsedUrl'); | ||
} | ||
|
||
//dispose will be called automatically | ||
@override | ||
void dispose() {} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:flutter_modular/flutter_modular.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
import '../shared/util/url_util.dart'; | ||
|
||
part 'url_launch_service.g.dart'; | ||
|
||
@Injectable() | ||
class UrlLaunchService extends Disposable { | ||
Future<void> launchUrl(String url) async { | ||
var parseUrl = UrlUtil.parseUrl(url); | ||
await launch(parseUrl); | ||
} | ||
|
||
//dispose will be called automatically | ||
@override | ||
void dispose() {} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class UrlUtil { | ||
static String parseUrl(String url) { | ||
return Uri.parse(url).isAbsolute ? url : 'https://news.ycombinator.com/$url'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import 'package:zone/app/service/share_service.dart'; | ||
|
||
void main() { | ||
ShareService service; | ||
|
||
setUp(() { | ||
// service = ShareService(); | ||
}); | ||
// | ||
group('ShareService Test', () { | ||
// test("First Test", () { | ||
// expect(service, isInstanceOf<ShareService>()); | ||
// }); | ||
// | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import 'package:zone/app/service/url_launch_service.dart'; | ||
|
||
void main() { | ||
UrlLaunchService service; | ||
|
||
setUp(() { | ||
// service = UrlLaunchService(); | ||
}); | ||
// | ||
group('UrlLaunchService Test', () { | ||
// test("First Test", () { | ||
// expect(service, isInstanceOf<UrlLaunchService>()); | ||
// }); | ||
// | ||
}); | ||
} |