Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Use file count method

AmanRajSinghMourya866a40a4cda7
diff --git a/mobile/apps/locker/lib/ui/collections/collection_flex_grid_view.dart b/mobile/apps/locker/lib/ui/collections/collection_flex_grid_view.dart
index 823f502ef1..99c31aa99b 100644
--- a/mobile/apps/locker/lib/ui/collections/collection_flex_grid_view.dart
+++ b/mobile/apps/locker/lib/ui/collections/collection_flex_grid_view.dart
@@ -3,6 +3,7 @@ import "dart:math";
import "package:ente_ui/theme/ente_theme.dart";
import "package:flutter/material.dart";
import "package:locker/l10n/l10n.dart";
+import "package:locker/services/collections/collections_service.dart";
import "package:locker/services/collections/models/collection.dart";
import "package:locker/ui/pages/collection_page.dart";
@@ -76,13 +77,19 @@ class _CollectionFlexGridViewWidgetState
maxLines: 1,
),
const SizedBox(height: 4),
- Text(
- context.l10n
- .items(_collectionFileCounts[collection.id] ?? 0),
- style: getEnteTextTheme(context).small.copyWith(
- color: Colors.grey[600],
- ),
- textAlign: TextAlign.left,
+ FutureBuilder<int>(
+ future:
+ CollectionService.instance.getFileCount(collection),
+ builder: (context, snapshot) {
+ final fileCount = snapshot.data ?? 0;
+ return Text(
+ context.l10n.items(fileCount),
+ style: getEnteTextTheme(context).small.copyWith(
+ color: Colors.grey[600],
+ ),
+ textAlign: TextAlign.left,
+ );
+ },
),
],
),