feat(mobile): drift search page (#19811)

* feat(mobile): drift search page

* migrate to drift page

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Daimolean
2025-07-18 04:25:25 +08:00
committed by GitHub
parent 2046dcc5b4
commit 8491fe459d
17 changed files with 1305 additions and 109 deletions

View File

@@ -15,6 +15,7 @@ class TimelineArgs {
final double spacing;
final int columnCount;
final bool showStorageIndicator;
final GroupAssetsBy? groupBy;
const TimelineArgs({
required this.maxWidth,
@@ -22,6 +23,7 @@ class TimelineArgs {
this.spacing = kTimelineSpacing,
this.columnCount = kTimelineColumnCount,
this.showStorageIndicator = false,
this.groupBy,
});
@override
@@ -30,7 +32,8 @@ class TimelineArgs {
maxWidth == other.maxWidth &&
maxHeight == other.maxHeight &&
columnCount == other.columnCount &&
showStorageIndicator == other.showStorageIndicator;
showStorageIndicator == other.showStorageIndicator &&
groupBy == other.groupBy;
}
@override
@@ -39,7 +42,8 @@ class TimelineArgs {
maxHeight.hashCode ^
spacing.hashCode ^
columnCount.hashCode ^
showStorageIndicator.hashCode;
showStorageIndicator.hashCode ^
groupBy.hashCode;
}
class TimelineState {
@@ -97,8 +101,9 @@ final timelineSegmentProvider = StreamProvider.autoDispose<List<Segment>>(
final availableTileWidth = args.maxWidth - (spacing * (columnCount - 1));
final tileExtent = math.max(0, availableTileWidth) / columnCount;
final groupBy = GroupAssetsBy
.values[ref.watch(settingsProvider).get(Setting.groupAssetsBy)];
final groupBy = args.groupBy ??
GroupAssetsBy
.values[ref.watch(settingsProvider).get(Setting.groupAssetsBy)];
final timelineService = ref.watch(timelineServiceProvider);
yield* timelineService.watchBuckets().map((buckets) {