mirror of
https://github.com/Livinglist/Hacki.git
synced 2025-08-06 18:24:42 +08:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
3fbf5d4eea | |||
332ffbb773 | |||
346a6c709e |
@ -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);
|
||||
|
@ -102,10 +102,7 @@ class InboxView extends StatelessWidget {
|
||||
),
|
||||
Linkify(
|
||||
text: e.text,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyLarge
|
||||
?.copyWith(
|
||||
style: TextStyle(
|
||||
color: unreadCommentsIds.contains(e.id)
|
||||
? textColor
|
||||
: Palette.grey,
|
||||
|
@ -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)
|
||||
|
@ -105,8 +105,7 @@ class ItemsListView<T extends Item> extends StatelessWidget {
|
||||
Linkify(
|
||||
text: e.title,
|
||||
maxLines: 4,
|
||||
style:
|
||||
Theme.of(context).textTheme.bodyLarge?.copyWith(
|
||||
style: const TextStyle(
|
||||
fontSize: TextDimens.pt16,
|
||||
),
|
||||
linkStyle: TextStyle(
|
||||
@ -141,7 +140,7 @@ class ItemsListView<T extends Item> extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (!showWebPreviewOnStoryTile)
|
||||
if (useSimpleTileForStory || !showWebPreviewOnStoryTile)
|
||||
const Divider(
|
||||
height: Dimens.zero,
|
||||
),
|
||||
@ -195,10 +194,7 @@ class ItemsListView<T extends Item> extends StatelessWidget {
|
||||
Linkify(
|
||||
text: e.text,
|
||||
maxLines: 4,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyLarge
|
||||
?.copyWith(
|
||||
style: const TextStyle(
|
||||
fontSize: TextDimens.pt16,
|
||||
),
|
||||
linkStyle: TextStyle(
|
||||
|
@ -96,6 +96,7 @@ class StoryTile extends StatelessWidget {
|
||||
.textTheme
|
||||
.bodyLarge
|
||||
?.color,
|
||||
fontWeight: hasRead ? null : FontWeight.w500,
|
||||
fontSize: simpleTileFontSize,
|
||||
),
|
||||
),
|
||||
|
@ -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:
|
||||
|
Reference in New Issue
Block a user