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