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>
This commit is contained in:
Arno Wiest
2024-04-24 22:02:03 +02:00
committed by GitHub
parent 0dbe44cb78
commit dc9b51ad02
3 changed files with 120 additions and 24 deletions

View File

@@ -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();
}
}