diff --git a/CHANGELOG.md b/CHANGELOG.md index e441039eb..827fa778a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed: +- Smoother scrolling infinite journal page + +## [0.8.388] - 2023-06-23 +### Changed: - Upgraded dependencies ### Fixed: diff --git a/lib/widgets/journal/entry_detail_linked_from.dart b/lib/widgets/journal/entry_detail_linked_from.dart index e1db4bb2a..fc29e2490 100644 --- a/lib/widgets/journal/entry_detail_linked_from.dart +++ b/lib/widgets/journal/entry_detail_linked_from.dart @@ -50,6 +50,7 @@ class LinkedFromEntriesWidget extends StatelessWidget { return JournalCard( item: item, key: Key('${item.meta.id}-${item.meta.id}'), + showLinkedDuration: true, ); }, ); diff --git a/lib/widgets/journal/entry_details_widget.dart b/lib/widgets/journal/entry_details_widget.dart index 1007e95bf..4d2d81bd2 100644 --- a/lib/widgets/journal/entry_details_widget.dart +++ b/lib/widgets/journal/entry_details_widget.dart @@ -51,7 +51,10 @@ class EntryDetailWidget extends StatelessWidget { final isAudio = item is JournalAudio; if (isTask && !showTaskDetails) { - return JournalCard(item: item); + return JournalCard( + item: item, + showLinkedDuration: true, + ); } return BlocProvider( diff --git a/lib/widgets/journal/journal_card.dart b/lib/widgets/journal/journal_card.dart index 191b1197f..9ac6374f3 100644 --- a/lib/widgets/journal/journal_card.dart +++ b/lib/widgets/journal/journal_card.dart @@ -148,27 +148,32 @@ class JournalCardTitle extends StatelessWidget { } } -class JournalCard extends StatelessWidget { +class JournalCard extends StatefulWidget { const JournalCard({ required this.item, super.key, this.maxHeight = 120, - this.showLinkedDuration = true, + this.showLinkedDuration = false, }); final JournalEntity item; final double maxHeight; final bool showLinkedDuration; + @override + State createState() => _JournalCardState(); +} + +class _JournalCardState extends State { @override Widget build(BuildContext context) { return StreamBuilder( - stream: getIt().watchEntityById(item.meta.id), + stream: getIt().watchEntityById(widget.item.meta.id), builder: ( BuildContext context, AsyncSnapshot snapshot, ) { - final updatedItem = snapshot.data ?? item; + final updatedItem = snapshot.data ?? widget.item; if (updatedItem.meta.deletedAt != null) { return const SizedBox.shrink(); } @@ -211,8 +216,8 @@ class JournalCard extends StatelessWidget { ), title: JournalCardTitle( item: updatedItem, - maxHeight: maxHeight, - showLinkedDuration: showLinkedDuration, + maxHeight: widget.maxHeight, + showLinkedDuration: widget.showLinkedDuration, ), onTap: onTap, ), diff --git a/lib/widgets/journal/tags/tags_view_widget.dart b/lib/widgets/journal/tags/tags_view_widget.dart index 52f6d98e1..09a660b19 100644 --- a/lib/widgets/journal/tags/tags_view_widget.dart +++ b/lib/widgets/journal/tags/tags_view_widget.dart @@ -6,15 +6,21 @@ import 'package:lotti/services/tags_service.dart'; import 'package:lotti/themes/theme.dart'; import 'package:lotti/themes/utils.dart'; -class TagsViewWidget extends StatelessWidget { - TagsViewWidget({ +class TagsViewWidget extends StatefulWidget { + const TagsViewWidget({ required this.item, super.key, }); - final TagsService tagsService = getIt(); final JournalEntity item; + @override + State createState() => _TagsViewWidgetState(); +} + +class _TagsViewWidgetState extends State { + final TagsService tagsService = getIt(); + @override Widget build(BuildContext context) { return StreamBuilder>( @@ -26,7 +32,7 @@ class TagsViewWidget extends StatelessWidget { // data in the tags service will already have been updated. AsyncSnapshot> _, ) { - final tagIds = item.meta.tagIds ?? []; + final tagIds = widget.item.meta.tagIds ?? []; final tagsFromTagIds = []; for (final tagId in tagIds) { diff --git a/pubspec.yaml b/pubspec.yaml index 1a55c7a72..346ad2560 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: lotti description: Achieve your goals and keep your data private with Lotti. publish_to: 'none' -version: 0.9.388+2276 +version: 0.9.389+2277 msix_config: display_name: LottiApp