Compare commits

...

3 Commits

Author SHA1 Message Date
3fbf5d4eea improve shortcut button. (#284) 2023-10-22 20:34:09 -07:00
332ffbb773 bump version. (#282) 2023-10-22 00:14:12 -07:00
346a6c709e fix inconsistent font size. (#281) 2023-10-21 23:50:06 -07:00
6 changed files with 37 additions and 27 deletions

View File

@ -359,7 +359,7 @@ class CommentsCubit extends Cubit<CommentsState> {
.itemPositions.value
// The header is also a part of the list view,
// thus ignoring it here.
.where((ItemPosition e) => e.index >= 1 && e.itemLeadingEdge < 0.7)
.where((ItemPosition e) => e.index >= 1 && e.itemLeadingEdge > 0.1)
.sorted((ItemPosition a, ItemPosition b) => a.index.compareTo(b.index))
.map(
(ItemPosition e) => e.index <= state.comments.length
@ -369,9 +369,19 @@ class CommentsCubit extends Cubit<CommentsState> {
.whereNotNull()
.toList();
/// The index of last comment visible on screen.
final int lastVisibleIndex = state.comments.indexOf(onScreenComments.last);
final int startIndex = min(lastVisibleIndex + 1, totalComments);
if (onScreenComments.isEmpty && state.comments.isNotEmpty) {
itemScrollController.scrollTo(
index: 1,
alignment: 0.15,
duration: Durations.ms400,
);
return;
}
/// The index of first root level comment visible on screen.
final int firstVisibleRootIndex = state.comments
.indexOf(onScreenComments.firstWhere((Comment e) => e.isRoot));
final int startIndex = min(firstVisibleRootIndex + 1, totalComments);
for (int i = startIndex; i < totalComments; i++) {
final Comment cmt = state.comments.elementAt(i);

View File

@ -102,15 +102,12 @@ class InboxView extends StatelessWidget {
),
Linkify(
text: e.text,
style: Theme.of(context)
.textTheme
.bodyLarge
?.copyWith(
color: unreadCommentsIds.contains(e.id)
? textColor
: Palette.grey,
fontSize: TextDimens.pt16,
),
style: TextStyle(
color: unreadCommentsIds.contains(e.id)
? textColor
: Palette.grey,
fontSize: TextDimens.pt16,
),
linkStyle: TextStyle(
color: Theme.of(context)
.primaryColor

View File

@ -51,7 +51,10 @@ class _SubmitScreenState extends State<SubmitScreen> with ItemActionMixin {
backgroundColor: Theme.of(context).canvasColor,
elevation: Dimens.zero,
leading: IconButton(
icon: const Icon(Icons.close),
icon: Icon(
Icons.close,
color: Theme.of(context).colorScheme.onSurface,
),
onPressed: () {
showDialog<bool>(
context: context,
@ -83,8 +86,11 @@ class _SubmitScreenState extends State<SubmitScreen> with ItemActionMixin {
});
},
),
title: const Text(
title: Text(
'Submit',
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
),
),
actions: <Widget>[
if (state.status == Status.inProgress)

View File

@ -105,10 +105,9 @@ class ItemsListView<T extends Item> extends StatelessWidget {
Linkify(
text: e.title,
maxLines: 4,
style:
Theme.of(context).textTheme.bodyLarge?.copyWith(
fontSize: TextDimens.pt16,
),
style: const TextStyle(
fontSize: TextDimens.pt16,
),
linkStyle: TextStyle(
color: Theme.of(context).primaryColor,
),
@ -141,7 +140,7 @@ class ItemsListView<T extends Item> extends StatelessWidget {
),
),
),
if (!showWebPreviewOnStoryTile)
if (useSimpleTileForStory || !showWebPreviewOnStoryTile)
const Divider(
height: Dimens.zero,
),
@ -195,12 +194,9 @@ class ItemsListView<T extends Item> extends StatelessWidget {
Linkify(
text: e.text,
maxLines: 4,
style: Theme.of(context)
.textTheme
.bodyLarge
?.copyWith(
fontSize: TextDimens.pt16,
),
style: const TextStyle(
fontSize: TextDimens.pt16,
),
linkStyle: TextStyle(
color: Theme.of(context).primaryColor,
),

View File

@ -96,6 +96,7 @@ class StoryTile extends StatelessWidget {
.textTheme
.bodyLarge
?.color,
fontWeight: hasRead ? null : FontWeight.w500,
fontSize: simpleTileFontSize,
),
),

View File

@ -1,6 +1,6 @@
name: hacki
description: A Hacker News reader.
version: 2.0.0+125
version: 2.0.1+126
publish_to: none
environment: