mirror of
https://github.com/Livinglist/Hacki.git
synced 2025-08-06 18:24:42 +08:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
32ae2087bc | |||
0b5329d050 |
@ -33,8 +33,10 @@ class LinkIconButton extends StatelessWidget {
|
||||
Icons.stream,
|
||||
),
|
||||
),
|
||||
onPressed: () =>
|
||||
LinkUtil.launch('https://news.ycombinator.com/item?id=$storyId'),
|
||||
onPressed: () => LinkUtil.launch(
|
||||
'https://news.ycombinator.com/item?id=$storyId',
|
||||
useHackiForHnLink: false,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ class MorePopupMenu extends StatelessWidget {
|
||||
color: Palette.orange,
|
||||
),
|
||||
onOpen: (LinkableElement link) =>
|
||||
LinkUtil.launch,
|
||||
LinkUtil.launch(link.url),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
|
@ -62,29 +62,29 @@ class _PollViewState extends State<PollView> {
|
||||
listener: (BuildContext context, VoteState voteState) {
|
||||
ScaffoldMessenger.of(context).clearSnackBars();
|
||||
if (voteState.status == VoteStatus.submitted) {
|
||||
context.showSnackBar(
|
||||
showSnackBar(
|
||||
content: 'Vote submitted successfully.',
|
||||
);
|
||||
} else if (voteState.status == VoteStatus.canceled) {
|
||||
context.showSnackBar(content: 'Vote canceled.');
|
||||
showSnackBar(content: 'Vote canceled.');
|
||||
} else if (voteState.status == VoteStatus.failure) {
|
||||
context.showErrorSnackBar();
|
||||
showErrorSnackBar();
|
||||
} else if (voteState.status ==
|
||||
VoteStatus.failureKarmaBelowThreshold) {
|
||||
context.showSnackBar(
|
||||
showSnackBar(
|
||||
content: "You can't downvote because"
|
||||
' you are karmaly broke.',
|
||||
);
|
||||
} else if (voteState.status ==
|
||||
VoteStatus.failureNotLoggedIn) {
|
||||
context.showSnackBar(
|
||||
showSnackBar(
|
||||
content: 'Not logged in, no voting! (;`O´)o',
|
||||
action: onLoginTapped,
|
||||
label: 'Log in',
|
||||
);
|
||||
} else if (voteState.status ==
|
||||
VoteStatus.failureBeHumble) {
|
||||
context.showSnackBar(
|
||||
showSnackBar(
|
||||
content: 'No voting on your own post! (;`O´)o',
|
||||
);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import 'package:flutter_fadein/flutter_fadein.dart';
|
||||
import 'package:hacki/config/locator.dart';
|
||||
import 'package:hacki/cubits/cubits.dart' show ReminderCubit, ReminderState;
|
||||
import 'package:hacki/extensions/extensions.dart';
|
||||
import 'package:hacki/models/item/story.dart';
|
||||
import 'package:hacki/models/models.dart';
|
||||
import 'package:hacki/repositories/repositories.dart';
|
||||
import 'package:hacki/screens/screens.dart';
|
||||
import 'package:hacki/styles/styles.dart';
|
||||
|
@ -30,6 +30,7 @@ abstract class LinkUtil {
|
||||
String link, {
|
||||
bool useReader = false,
|
||||
bool offlineReading = false,
|
||||
bool useHackiForHnLink = true,
|
||||
}) {
|
||||
if (offlineReading) {
|
||||
locator
|
||||
@ -48,7 +49,7 @@ abstract class LinkUtil {
|
||||
return;
|
||||
}
|
||||
|
||||
if (link.isStoryLink) {
|
||||
if (useHackiForHnLink && link.isStoryLink) {
|
||||
_onStoryLinkTapped(link);
|
||||
return;
|
||||
}
|
||||
@ -104,7 +105,7 @@ abstract class LinkUtil {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
launch(link);
|
||||
launch(link, useHackiForHnLink: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: hacki
|
||||
description: A Hacker News reader.
|
||||
version: 1.2.1+94
|
||||
version: 1.2.3+96
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
|
Reference in New Issue
Block a user