π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
use global const variable for limit of examples in search section
ashilknf4e05de2314d
diff --git a/lib/core/constants.dart b/lib/core/constants.dartindex b310a445b3..e0fe083cde 100644--- a/lib/core/constants.dart+++ b/lib/core/constants.dart@@ -62,3 +62,5 @@ const defaultRadiusValues = <double>[1, 2, 10, 20, 40, 80, 200, 400, 1200];const defaultRadiusValue = 40.0;const galleryGridSpacing = 2.0;++const searchSectionLimit = 7;diff --git a/lib/ui/search_tab.dart b/lib/ui/search_tab.dartindex 0d96691a15..b40e4404b5 100644--- a/lib/ui/search_tab.dart+++ b/lib/ui/search_tab.dart@@ -1,4 +1,5 @@import "package:flutter/material.dart";+import "package:photos/core/constants.dart";import "package:photos/models/search/search_result.dart";import "package:photos/models/search/search_types.dart";import "package:photos/states/search_results_state.dart";@@ -62,7 +63,6 @@ class AllSearchSections extends StatefulWidget {class _AllSearchSectionsState extends State<AllSearchSections> {late List<Future<List<SearchResult>>> allSectionsExamples;- static const _limit = 7;@overridevoid initState() {@@ -78,8 +78,9 @@ class _AllSearchSectionsState extends State<AllSearchSections> {sectionType == SectionType.content) {continue;}- allSectionsExamples- .add(sectionType.getData(limit: _limit, context: context));+ allSectionsExamples.add(+ sectionType.getData(limit: searchSectionLimit, context: context),+ );}allSectionsExamplesFuture =Future.wait<List<SearchResult>>(allSectionsExamples);@@ -116,7 +117,7 @@ class _AllSearchSectionsState extends State<AllSearchSections> {: SearchSection(sectionType: searchTypes[index],examples: snapshot.data!.elementAt(index),- limit: _limit,+ limit: searchSectionLimit,);},);