Compare commits

...

6 Commits

Author SHA1 Message Date
03c01a0b78 bump versions. (#97) 2022-12-27 13:56:21 -08:00
f823fdf241 use version from pubspec.yaml (#95) (#96) 2022-12-27 13:40:41 -08:00
fe87ddd8ff add (#95) 2022-12-27 13:36:14 -08:00
613ba12b05 fix time machine. (#94)
* bumped version.

* fix time machine.
2022-12-27 12:54:18 -08:00
8d7f66ecbc add timeout. (#93) 2022-12-27 01:17:16 -08:00
461aae253b update publish_ios.yml (#92) 2022-12-27 00:22:04 -08:00
11 changed files with 124 additions and 100 deletions

View File

@ -10,6 +10,7 @@ jobs:
releases: releases:
name: Check commit name: Check commit
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 30
env: env:
FLUTTER_VERSION: "3.3.10" FLUTTER_VERSION: "3.3.10"
steps: steps:

View File

@ -7,12 +7,11 @@ on:
push: push:
branches: branches:
- master - master
tags:
- "v*"
jobs: jobs:
build_and_publish: build_and_publish:
runs-on: macos-latest runs-on: macos-latest
timeout-minutes: 30
env: env:
# Point the `ruby/setup-ruby` action at this Gemfile, so it # Point the `ruby/setup-ruby` action at this Gemfile, so it

View File

@ -0,0 +1 @@
- Fixed time machine.

View File

@ -0,0 +1 @@
- Fixed time machine.

View File

@ -1,6 +1,3 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'

View File

@ -22,6 +22,8 @@ PODS:
- integration_test (0.0.1): - integration_test (0.0.1):
- Flutter - Flutter
- OrderedSet (5.0.0) - OrderedSet (5.0.0)
- package_info_plus (0.4.5):
- Flutter
- path_provider_ios (0.0.1): - path_provider_ios (0.0.1):
- Flutter - Flutter
- ReachabilitySwift (5.0.0) - ReachabilitySwift (5.0.0)
@ -53,6 +55,7 @@ DEPENDENCIES:
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- flutter_siri_suggestions (from `.symlinks/plugins/flutter_siri_suggestions/ios`) - flutter_siri_suggestions (from `.symlinks/plugins/flutter_siri_suggestions/ios`)
- integration_test (from `.symlinks/plugins/integration_test/ios`) - integration_test (from `.symlinks/plugins/integration_test/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- receive_sharing_intent (from `.symlinks/plugins/receive_sharing_intent/ios`) - receive_sharing_intent (from `.symlinks/plugins/receive_sharing_intent/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`) - share_plus (from `.symlinks/plugins/share_plus/ios`)
@ -85,6 +88,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_siri_suggestions/ios" :path: ".symlinks/plugins/flutter_siri_suggestions/ios"
integration_test: integration_test:
:path: ".symlinks/plugins/integration_test/ios" :path: ".symlinks/plugins/integration_test/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_ios: path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios" :path: ".symlinks/plugins/path_provider_ios/ios"
receive_sharing_intent: receive_sharing_intent:
@ -116,6 +121,7 @@ SPEC CHECKSUMS:
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5 integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
receive_sharing_intent: c0d87310754e74c0f9542947e7cbdf3a0335a3b1 receive_sharing_intent: c0d87310754e74c0f9542947e7cbdf3a0335a3b1

View File

@ -11,7 +11,7 @@ part 'collapse_state.dart';
class CollapseCubit extends Cubit<CollapseState> { class CollapseCubit extends Cubit<CollapseState> {
CollapseCubit({ CollapseCubit({
required int commentId, required int commentId,
required CommentsCubit commentsCubit, required CommentsCubit? commentsCubit,
CollapseCache? collapseCache, CollapseCache? collapseCache,
}) : _commentId = commentId, }) : _commentId = commentId,
_collapseCache = collapseCache ?? locator.get<CollapseCache>(), _collapseCache = collapseCache ?? locator.get<CollapseCache>(),
@ -20,7 +20,7 @@ class CollapseCubit extends Cubit<CollapseState> {
final int _commentId; final int _commentId;
final CollapseCache _collapseCache; final CollapseCache _collapseCache;
final CommentsCubit _commentsCubit; final CommentsCubit? _commentsCubit;
late final StreamSubscription<Map<int, Set<int>>> _streamSubscription; late final StreamSubscription<Map<int, Set<int>>> _streamSubscription;
void init() { void init() {
@ -47,13 +47,15 @@ class CollapseCubit extends Cubit<CollapseState> {
), ),
); );
} else { } else {
if (_commentsCubit == null) return;
final Set<int> collapsedCommentIds = _collapseCache.collapse(_commentId); final Set<int> collapsedCommentIds = _collapseCache.collapse(_commentId);
final int lastCommentId = _commentsCubit.state.comments.last.id; final int lastCommentId = _commentsCubit!.state.comments.last.id;
final bool shouldLoadMore = _commentId == lastCommentId || final bool shouldLoadMore = _commentId == lastCommentId ||
collapsedCommentIds.contains(lastCommentId); collapsedCommentIds.contains(lastCommentId);
if (shouldLoadMore) { if (shouldLoadMore) {
_commentsCubit.loadMore(); _commentsCubit!.loadMore();
} }
emit( emit(

View File

@ -20,6 +20,7 @@ import 'package:hacki/screens/screens.dart';
import 'package:hacki/screens/widgets/widgets.dart'; import 'package:hacki/screens/widgets/widgets.dart';
import 'package:hacki/styles/styles.dart'; import 'package:hacki/styles/styles.dart';
import 'package:hacki/utils/utils.dart'; import 'package:hacki/utils/utils.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:tuple/tuple.dart'; import 'package:tuple/tuple.dart';
@ -422,93 +423,7 @@ class _ProfileScreenState extends State<ProfileScreen>
title: const Text('About'), title: const Text('About'),
subtitle: subtitle:
const Text('nothing interesting here.'), const Text('nothing interesting here.'),
onTap: () { onTap: showAboutHackiDialog,
showAboutDialog(
context: context,
applicationName: 'Hacki',
applicationVersion: 'v1.0.0',
applicationIcon: ClipRRect(
borderRadius: const BorderRadius.all(
Radius.circular(
Dimens.pt12,
),
),
child: Image.asset(
Constants.hackiIconPath,
height: Dimens.pt50,
width: Dimens.pt50,
),
),
children: <Widget>[
ElevatedButton(
onPressed: () => LinkUtil.launch(
Constants.portfolioLink,
),
child: Row(
children: const <Widget>[
Icon(
FontAwesomeIcons.addressCard,
),
SizedBox(
width: Dimens.pt12,
),
Text('Developer'),
],
),
),
ElevatedButton(
onPressed: () => LinkUtil.launch(
Constants.githubLink,
),
child: Row(
children: const <Widget>[
Icon(
FontAwesomeIcons.github,
),
SizedBox(
width: Dimens.pt12,
),
Text('Source code'),
],
),
),
ElevatedButton(
onPressed: () => LinkUtil.launch(
Platform.isIOS
? Constants.appStoreLink
: Constants.googlePlayLink,
),
child: Row(
children: const <Widget>[
Icon(
Icons.thumb_up,
),
SizedBox(
width: Dimens.pt12,
),
Text('Like the app?'),
],
),
),
ElevatedButton(
onPressed: () => LinkUtil.launch(
Constants.sponsorLink,
),
child: Row(
children: const <Widget>[
Icon(
FeatherIcons.coffee,
),
SizedBox(
width: Dimens.pt12,
),
Text('Buy me a coffee'),
],
),
),
],
);
},
), ),
const SizedBox( const SizedBox(
height: Dimens.pt48, height: Dimens.pt48,
@ -718,6 +633,95 @@ class _ProfileScreenState extends State<ProfileScreen>
); );
} }
Future<void> showAboutHackiDialog() async {
final PackageInfo packageInfo = await PackageInfo.fromPlatform();
final String version = packageInfo.version;
showAboutDialog(
context: context,
applicationName: 'Hacki',
applicationVersion: 'v$version',
applicationIcon: ClipRRect(
borderRadius: const BorderRadius.all(
Radius.circular(
Dimens.pt12,
),
),
child: Image.asset(
Constants.hackiIconPath,
height: Dimens.pt50,
width: Dimens.pt50,
),
),
children: <Widget>[
ElevatedButton(
onPressed: () => LinkUtil.launch(
Constants.portfolioLink,
),
child: Row(
children: const <Widget>[
Icon(
FontAwesomeIcons.addressCard,
),
SizedBox(
width: Dimens.pt12,
),
Text('Developer'),
],
),
),
ElevatedButton(
onPressed: () => LinkUtil.launch(
Constants.githubLink,
),
child: Row(
children: const <Widget>[
Icon(
FontAwesomeIcons.github,
),
SizedBox(
width: Dimens.pt12,
),
Text('Source code'),
],
),
),
ElevatedButton(
onPressed: () => LinkUtil.launch(
Platform.isIOS ? Constants.appStoreLink : Constants.googlePlayLink,
),
child: Row(
children: const <Widget>[
Icon(
Icons.thumb_up,
),
SizedBox(
width: Dimens.pt12,
),
Text('Like the app?'),
],
),
),
ElevatedButton(
onPressed: () => LinkUtil.launch(
Constants.sponsorLink,
),
child: Row(
children: const <Widget>[
Icon(
FeatherIcons.coffee,
),
SizedBox(
width: Dimens.pt12,
),
Text('Buy me a coffee'),
],
),
),
],
);
}
void onCommentTapped(Comment comment, {VoidCallback? then}) { void onCommentTapped(Comment comment, {VoidCallback? then}) {
throttle.run(() { throttle.run(() {
locator locator

View File

@ -47,7 +47,7 @@ class CommentTile extends StatelessWidget {
lazy: false, lazy: false,
create: (_) => CollapseCubit( create: (_) => CollapseCubit(
commentId: comment.id, commentId: comment.id,
commentsCubit: context.read<CommentsCubit>(), commentsCubit: context.tryRead<CommentsCubit>(),
collapseCache: context.tryRead<CollapseCache>() ?? CollapseCache(), collapseCache: context.tryRead<CollapseCache>() ?? CollapseCache(),
)..init(), )..init(),
child: BlocBuilder3<CollapseCubit, CollapseState, PreferenceCubit, child: BlocBuilder3<CollapseCubit, CollapseState, PreferenceCubit,

View File

@ -607,6 +607,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
package_info_plus:
dependency: "direct main"
description:
name: package_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
path: path:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -1,6 +1,6 @@
name: hacki name: hacki
description: A Hacker News reader. description: A Hacker News reader.
version: 1.0.0+77 version: 1.0.1+79
publish_to: none publish_to: none
environment: environment:
@ -18,7 +18,6 @@ dependencies:
dio: ^4.0.4 dio: ^4.0.4
equatable: ^2.0.5 equatable: ^2.0.5
fast_gbk: ^1.0.0 fast_gbk: ^1.0.0
# feature_discovery: ^0.14.0
feature_discovery: feature_discovery:
git: git:
url: https://github.com/livinglist/feature_discovery url: https://github.com/livinglist/feature_discovery
@ -45,11 +44,11 @@ dependencies:
hydrated_bloc: ^9.0.0-dev.3 hydrated_bloc: ^9.0.0-dev.3
intl: ^0.17.0 intl: ^0.17.0
logger: ^1.1.0 logger: ^1.1.0
package_info_plus: ^3.0.2
path: ^1.8.0 path: ^1.8.0
path_provider: ^2.0.8 path_provider: ^2.0.8
path_provider_android: ^2.0.8 path_provider_android: ^2.0.8
path_provider_ios: ^2.0.8 path_provider_ios: ^2.0.8
# pull_to_refresh: ^2.0.0
pull_to_refresh: pull_to_refresh:
git: git:
url: https://github.com/livinglist/flutter_pulltorefresh url: https://github.com/livinglist/flutter_pulltorefresh