-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mobile): Added "jump to date" functionality to the memory view (#…
…7323) * implemented jump to date from memory * Changed implementation to a ValueNotifier & fixes * remove debug code * feat(mobile): - Added index bound checks - Handled edge cases when scrolling to the very bottom of the grid-view - removing the listener on dispose * feat(mobile): fixed debug index offset & added debug toast for scroll errors * feat(mobile): added more debug toasts... * feat(mobile): scroll to month, if timeline is not grouped by days --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
- Loading branch information
1 parent
0dbe44c
commit dc9b51a
Showing
3 changed files
with
120 additions
and
24 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
mobile/lib/modules/asset_viewer/providers/scroll_to_date_notifier.provider.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
final scrollToDateNotifierProvider = ScrollToDateNotifier(null); | ||
|
||
class ScrollToDateNotifier extends ValueNotifier<DateTime?> { | ||
ScrollToDateNotifier(super.value); | ||
|
||
void scrollToDate(DateTime date) { | ||
value = date; | ||
|
||
// Manually notify listeners to trigger the scroll, even if the value hasn't changed | ||
notifyListeners(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters