mirror of
https://github.com/Livinglist/Hacki.git
synced 2025-08-06 18:24:42 +08:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
c2b66d29c3 |
@ -119,11 +119,45 @@ extension StateExtension on State {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onShareTapped(Item item, Rect? rect) {
|
Future<void> onShareTapped(Item item, Rect? rect) async {
|
||||||
Share.share(
|
late final String? linkToShare;
|
||||||
'https://news.ycombinator.com/item?id=${item.id}',
|
if (item.url.isNotEmpty) {
|
||||||
sharePositionOrigin: rect,
|
linkToShare = await showModalBottomSheet<String>(
|
||||||
);
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
height: 140,
|
||||||
|
color: Theme.of(context).canvasColor,
|
||||||
|
child: Material(
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
ListTile(
|
||||||
|
onTap: () => Navigator.pop(context, item.url),
|
||||||
|
title: const Text('Link to article'),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
onTap: () => Navigator.pop(
|
||||||
|
context,
|
||||||
|
'https://news.ycombinator.com/item?id=${item.id}',
|
||||||
|
),
|
||||||
|
title: const Text('Link to HN'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
linkToShare = 'https://news.ycombinator.com/item?id=${item.id}';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (linkToShare != null) {
|
||||||
|
await Share.share(
|
||||||
|
linkToShare,
|
||||||
|
sharePositionOrigin: rect,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onFlagTapped(Item item) {
|
void onFlagTapped(Item item) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: hacki
|
name: hacki
|
||||||
description: A Hacker News reader.
|
description: A Hacker News reader.
|
||||||
version: 1.0.6+84
|
version: 1.0.7+85
|
||||||
publish_to: none
|
publish_to: none
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
Reference in New Issue
Block a user