Skip to content

Commit 4ddd376

Browse files
Daimoleanalextran1502
andauthored
feat(mobile): hide storage indicator outside main timeline (#19835)
* feat(mobile): hide storage indicator outside main timeline * fix: lint * set default as false --------- Co-authored-by: Alex <[email protected]>
1 parent 68db170 commit 4ddd376

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

mobile/lib/presentation/pages/dev/main_timeline.page.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ class MainTimelinePage extends ConsumerWidget {
1616
return memoryLaneProvider.when(
1717
data: (memories) {
1818
return memories.isEmpty
19-
? const Timeline()
19+
? const Timeline(showStorageIndicator: true)
2020
: Timeline(
2121
topSliverWidget: SliverToBoxAdapter(
2222
key: Key('memory-lane-${memories.first.assets.first.id}'),
2323
child: DriftMemoryLane(memories: memories),
2424
),
2525
topSliverWidgetHeight: 200,
26+
showStorageIndicator: true,
2627
);
2728
},
28-
loading: () => const Timeline(),
29-
error: (error, stackTrace) => const Timeline(),
29+
loading: () => const Timeline(showStorageIndicator: true),
30+
error: (error, stackTrace) => const Timeline(showStorageIndicator: true),
3031
);
3132
}
3233
}

mobile/lib/presentation/pages/drift_asset_selection_timeline.page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class DriftAssetSelectionTimelinePage extends ConsumerWidget {
3333
final user = ref.watch(currentUserProvider);
3434
if (user == null) {
3535
throw Exception(
36-
'User must be logged in to access recently taken',
36+
'User must be logged in to access asset selection timeline',
3737
);
3838
}
3939

mobile/lib/presentation/widgets/timeline/fixed/segment.model.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ class _AssetTileWidget extends ConsumerWidget {
206206
@override
207207
Widget build(BuildContext context, WidgetRef ref) {
208208
final lockSelection = _getLockSelectionStatus(ref);
209+
final showStorageIndicator = ref.watch(
210+
timelineArgsProvider.select((args) => args.showStorageIndicator),
211+
);
209212

210213
return RepaintBoundary(
211214
child: GestureDetector(
@@ -217,6 +220,7 @@ class _AssetTileWidget extends ConsumerWidget {
217220
child: ThumbnailTile(
218221
asset,
219222
lockSelection: lockSelection,
223+
showStorageIndicator: showStorageIndicator,
220224
),
221225
),
222226
);

mobile/lib/presentation/widgets/timeline/timeline.state.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,32 @@ class TimelineArgs {
1414
final double maxHeight;
1515
final double spacing;
1616
final int columnCount;
17+
final bool showStorageIndicator;
1718

1819
const TimelineArgs({
1920
required this.maxWidth,
2021
required this.maxHeight,
2122
this.spacing = kTimelineSpacing,
2223
this.columnCount = kTimelineColumnCount,
24+
this.showStorageIndicator = false,
2325
});
2426

2527
@override
2628
bool operator ==(covariant TimelineArgs other) {
2729
return spacing == other.spacing &&
2830
maxWidth == other.maxWidth &&
2931
maxHeight == other.maxHeight &&
30-
columnCount == other.columnCount;
32+
columnCount == other.columnCount &&
33+
showStorageIndicator == other.showStorageIndicator;
3134
}
3235

3336
@override
3437
int get hashCode =>
3538
maxWidth.hashCode ^
3639
maxHeight.hashCode ^
3740
spacing.hashCode ^
38-
columnCount.hashCode;
41+
columnCount.hashCode ^
42+
showStorageIndicator.hashCode;
3943
}
4044

4145
class TimelineState {

mobile/lib/presentation/widgets/timeline/timeline.widget.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ class Timeline extends StatelessWidget {
2626
super.key,
2727
this.topSliverWidget,
2828
this.topSliverWidgetHeight,
29+
this.showStorageIndicator = false,
2930
this.appBar,
3031
});
3132

3233
final Widget? topSliverWidget;
3334
final double? topSliverWidgetHeight;
35+
final bool showStorageIndicator;
3436
final Widget? appBar;
3537

3638
@override
@@ -46,6 +48,7 @@ class Timeline extends StatelessWidget {
4648
columnCount: ref.watch(
4749
settingsProvider.select((s) => s.get(Setting.tilesPerRow)),
4850
),
51+
showStorageIndicator: showStorageIndicator,
4952
),
5053
),
5154
],

0 commit comments

Comments
 (0)