Compare commits

...

3 Commits

Author SHA1 Message Date
764ff09345 v0.2.29-hotfix (#67)
* fixed datetime extension.

* updated README.md
2022-07-06 20:37:18 -07:00
ab449adce2 v0.2.29 (#66)
* fixed stuff.

* fixed UI.

* bumped version.
2022-07-06 17:04:14 -07:00
2ec41b26f2 updated README.md 2022-07-06 16:23:05 -07:00
13 changed files with 33 additions and 29 deletions

View File

@ -1,14 +1,13 @@
# <img width="64" src="https://user-images.githubusercontent.com/7277662/167775086-0b234f28-dee4-44f6-aae4-14a28ed4bbb6.png"> Hacki for Hacker News # <img width="64" src="https://user-images.githubusercontent.com/7277662/167775086-0b234f28-dee4-44f6-aae4-14a28ed4bbb6.png"> Hacki for Hacker News
A simple noiseless [Hacker News](https://news.ycombinator.com/) client made with Flutter that is just enough. A [Hacker News](https://news.ycombinator.com/) client made with Flutter that is just enough.
[![App Store](https://img.shields.io/itunes/v/1602043763?label=App%20Store)](https://apps.apple.com/us/app/hacki/id1602043763?platform=iphone) [![App Store](https://img.shields.io/itunes/v/1602043763?label=App%20Store)](https://apps.apple.com/us/app/hacki/id1602043763?platform=iphone)
[![Fdroid version](https://img.shields.io/f-droid/v/com.jiaqifeng.hacki)](https://f-droid.org/en/packages/com.jiaqifeng.hacki/) [![Fdroid version](https://img.shields.io/f-droid/v/com.jiaqifeng.hacki)](https://f-droid.org/en/packages/com.jiaqifeng.hacki/)
[![GH version](https://img.shields.io/github/release/livinglist/hacki.svg?logo=github)](https://github.com/Livinglist/Hacki/releases/latest) [![GH version](https://img.shields.io/github/release/livinglist/hacki.svg?logo=github)](https://github.com/Livinglist/Hacki/releases/latest)
[![Visits Badge](https://badges.pufler.dev/visits/livinglist/Hacki)](https://badges.pufler.dev)
[![GitHub](https://img.shields.io/github/stars/livinglist/Hacki?style=social)](https://img.shields.io/github/stars/livinglist/Hacki?style=social)
[![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://pub.dev/packages/effective_dart) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://pub.dev/packages/effective_dart)
[![GitHub](https://img.shields.io/github/stars/livinglist/Hacki?style=social)](https://img.shields.io/github/stars/livinglist/Hacki?style=social)
[<img src="assets/images/app_store_badge.png" height="50">](https://apps.apple.com/us/app/hacki/id1602043763?platform=iphone) [<img src="assets/images/google_play_badge.png" height="50">](https://play.google.com/store/apps/details?id=com.jiaqifeng.hacki&hl=en_US&gl=US) [<img src="assets/images/f_droid_badge.png" height="50">](https://f-droid.org/en/packages/com.jiaqifeng.hacki/) [<img src="assets/images/app_store_badge.png" height="50">](https://apps.apple.com/us/app/hacki/id1602043763?platform=iphone) [<img src="assets/images/google_play_badge.png" height="50">](https://play.google.com/store/apps/details?id=com.jiaqifeng.hacki&hl=en_US&gl=US) [<img src="assets/images/f_droid_badge.png" height="50">](https://f-droid.org/en/packages/com.jiaqifeng.hacki/)

View File

@ -0,0 +1,3 @@
- Lazy loading.
- Offline mode now includes web pages.
- You can now sort comments in story screen.

View File

@ -0,0 +1,3 @@
- Lazy loading.
- Offline mode now includes web pages.
- You can now sort comments in story screen.

View File

@ -568,7 +568,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = QMWX3X2NF7; DEVELOPMENT_TEAM = QMWX3X2NF7;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -577,7 +577,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.2.28; MARKETING_VERSION = 0.2.29;
PRODUCT_BUNDLE_IDENTIFIER = com.jiaqi.hacki; PRODUCT_BUNDLE_IDENTIFIER = com.jiaqi.hacki;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -705,7 +705,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = QMWX3X2NF7; DEVELOPMENT_TEAM = QMWX3X2NF7;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -714,7 +714,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.2.28; MARKETING_VERSION = 0.2.29;
PRODUCT_BUNDLE_IDENTIFIER = com.jiaqi.hacki; PRODUCT_BUNDLE_IDENTIFIER = com.jiaqi.hacki;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -736,7 +736,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = QMWX3X2NF7; DEVELOPMENT_TEAM = QMWX3X2NF7;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -745,7 +745,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.2.28; MARKETING_VERSION = 0.2.29;
PRODUCT_BUNDLE_IDENTIFIER = com.jiaqi.hacki; PRODUCT_BUNDLE_IDENTIFIER = com.jiaqi.hacki;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

View File

@ -33,7 +33,8 @@ class NotificationCubit extends Cubit<NotificationState> {
_preferenceRepository.shouldShowNotification _preferenceRepository.shouldShowNotification
.then((bool showNotification) { .then((bool showNotification) {
if (showNotification) { if (showNotification) {
init(); // Delaying the initialization to prevent janks in home screen.
Future<void>.delayed(const Duration(seconds: 2), init);
} }
}); });

View File

@ -1,5 +1,6 @@
import 'package:bloc/bloc.dart'; import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:flutter/services.dart';
import 'package:hacki/config/locator.dart'; import 'package:hacki/config/locator.dart';
import 'package:hacki/cubits/comments/comments_cubit.dart'; import 'package:hacki/cubits/comments/comments_cubit.dart';
import 'package:hacki/repositories/repositories.dart'; import 'package:hacki/repositories/repositories.dart';
@ -82,12 +83,14 @@ class PreferenceCubit extends Cubit<PreferenceState> {
void selectFetchMode(FetchMode? fetchMode) { void selectFetchMode(FetchMode? fetchMode) {
if (fetchMode == null || state.fetchMode == fetchMode) return; if (fetchMode == null || state.fetchMode == fetchMode) return;
HapticFeedback.lightImpact();
emit(state.copyWith(fetchMode: fetchMode)); emit(state.copyWith(fetchMode: fetchMode));
_preferenceRepository.selectFetchMode(fetchMode); _preferenceRepository.selectFetchMode(fetchMode);
} }
void selectCommentsOrder(CommentsOrder? order) { void selectCommentsOrder(CommentsOrder? order) {
if (order == null || state.order == order) return; if (order == null || state.order == order) return;
HapticFeedback.lightImpact();
emit(state.copyWith(order: order)); emit(state.copyWith(order: order));
_preferenceRepository.selectCommentsOrder(order); _preferenceRepository.selectCommentsOrder(order);
} }

View File

@ -3,7 +3,7 @@ import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
extension TryReadContext on BuildContext { extension ContextExtension on BuildContext {
T? tryRead<T>() { T? tryRead<T>() {
try { try {
return read<T>(); return read<T>();

View File

@ -7,10 +7,8 @@ extension DateTimeExtension on DateTime {
return '$gap year${gap == 1 ? '' : 's'} ago'; return '$gap year${gap == 1 ? '' : 's'} ago';
} else if (diff.inDays > 30) { } else if (diff.inDays > 30) {
int gap = now.month - month; int gap = now.month - month;
if (gap == 0) { if (gap <= 0) {
gap = 1; gap = now.month + 12 - month;
} else if (gap < 0) {
gap = now.month + (12 - month);
} }
return '$gap month${gap == 1 ? '' : 's'} ago'; return '$gap month${gap == 1 ? '' : 's'} ago';
} else if (diff.inDays >= 1) { } else if (diff.inDays >= 1) {

View File

@ -1,5 +1,3 @@
import 'dart:convert';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
class User { class User {
@ -39,8 +37,6 @@ class User {
@override @override
String toString() { String toString() {
final String prettyString = return 'User $about, $created, $delay, $id, $karma';
const JsonEncoder.withIndent(' ').convert(this);
return 'User $prettyString';
} }
} }

View File

@ -502,7 +502,7 @@ class _ItemScreenState extends State<ItemScreen> {
Text( Text(
'''${state.item.score} karma, ${state.item.descendants} comment${state.item.descendants > 1 ? 's' : ''}''', '''${state.item.score} karma, ${state.item.descendants} comment${state.item.descendants > 1 ? 's' : ''}''',
style: const TextStyle( style: const TextStyle(
fontSize: TextDimens.pt12, fontSize: TextDimens.pt13,
), ),
), ),
] else ...<Widget>[ ] else ...<Widget>[
@ -526,7 +526,7 @@ class _ItemScreenState extends State<ItemScreen> {
: const Text( : const Text(
'View parent thread', 'View parent thread',
style: TextStyle( style: TextStyle(
fontSize: TextDimens.pt12, fontSize: TextDimens.pt13,
), ),
), ),
), ),
@ -542,7 +542,7 @@ class _ItemScreenState extends State<ItemScreen> {
child: Text( child: Text(
'Lazy', 'Lazy',
style: TextStyle( style: TextStyle(
fontSize: TextDimens.pt12, fontSize: TextDimens.pt13,
), ),
), ),
), ),
@ -551,7 +551,7 @@ class _ItemScreenState extends State<ItemScreen> {
child: Text( child: Text(
'Eager', 'Eager',
style: TextStyle( style: TextStyle(
fontSize: TextDimens.pt12, fontSize: TextDimens.pt13,
), ),
), ),
), ),
@ -573,7 +573,7 @@ class _ItemScreenState extends State<ItemScreen> {
child: Text( child: Text(
'Natural', 'Natural',
style: TextStyle( style: TextStyle(
fontSize: TextDimens.pt12, fontSize: TextDimens.pt13,
), ),
), ),
), ),
@ -582,7 +582,7 @@ class _ItemScreenState extends State<ItemScreen> {
child: Text( child: Text(
'Newest first', 'Newest first',
style: TextStyle( style: TextStyle(
fontSize: TextDimens.pt12, fontSize: TextDimens.pt13,
), ),
), ),
), ),
@ -591,7 +591,7 @@ class _ItemScreenState extends State<ItemScreen> {
child: Text( child: Text(
'Oldest first', 'Oldest first',
style: TextStyle( style: TextStyle(
fontSize: TextDimens.pt12, fontSize: TextDimens.pt13,
), ),
), ),
), ),

View File

@ -526,7 +526,7 @@ class _ProfileScreenState extends State<ProfileScreen>
showAboutDialog( showAboutDialog(
context: context, context: context,
applicationName: 'Hacki', applicationName: 'Hacki',
applicationVersion: 'v0.2.28', applicationVersion: 'v0.2.29',
applicationIcon: ClipRRect( applicationIcon: ClipRRect(
borderRadius: const BorderRadius.all( borderRadius: const BorderRadius.all(
Radius.circular( Radius.circular(

View File

@ -27,6 +27,7 @@ abstract class TextDimens {
static const double pt8 = 8; static const double pt8 = 8;
static const double pt10 = 10; static const double pt10 = 10;
static const double pt12 = 12; static const double pt12 = 12;
static const double pt13 = 13;
static const double pt14 = 14; static const double pt14 = 14;
static const double pt15 = 15; static const double pt15 = 15;
static const double pt16 = 16; static const double pt16 = 16;

View File

@ -1,6 +1,6 @@
name: hacki name: hacki
description: A Hacker News reader. description: A Hacker News reader.
version: 0.2.28+70 version: 0.2.29+72
publish_to: none publish_to: none
environment: environment: