remove redundant const variable

This commit is contained in:
ashilkn 2024-02-15 16:16:02 +05:30
parent c9a48107a1
commit 7d6a2efd06
6 changed files with 6 additions and 9 deletions

View file

@ -65,6 +65,6 @@ const defaultCityRadius = 10.0;
const galleryGridSpacing = 2.0;
const searchSectionLimit = 7;
const kSearchSectionLimit = 7;
bool isInternalUser = false;

View file

@ -12,7 +12,7 @@ class RecentSearches with ChangeNotifier {
void add(String query) {
searches.add(query);
while (searches.length > searchSectionLimit) {
while (searches.length > kSearchSectionLimit) {
searches.remove(searches.first);
}
//buffer for not surfacing a new recent search before going to the next

View file

@ -84,7 +84,7 @@ class _AllSectionsExamplesProviderState
continue;
}
allSectionsExamples.add(
sectionType.getData(context, limit: searchSectionLimit),
sectionType.getData(context, limit: kSearchSectionLimit),
);
}
allSectionsExamplesFuture =

View file

@ -50,7 +50,7 @@ class _SearchSectionState extends State<SearchSection> {
stream.listen((event) async {
_examples = await widget.sectionType.getData(
context,
limit: searchSectionLimit,
limit: kSearchSectionLimit,
);
setState(() {});
}),

View file

@ -15,7 +15,6 @@ import "package:photos/ui/viewer/file/no_thumbnail_widget.dart";
import "package:photos/ui/viewer/file/thumbnail_widget.dart";
import "package:photos/ui/viewer/gallery/collection_page.dart";
import "package:photos/ui/viewer/search/search_section_cta.dart";
import "package:photos/ui/viewer/search_tab/search_tab.dart";
import "package:photos/ui/viewer/search_tab/section_header.dart";
import "package:photos/utils/navigation_util.dart";
@ -110,8 +109,7 @@ class _AlbumsSectionState extends State<AlbumsSection> {
children: [
SectionHeader(
SectionType.album,
hasMore:
(_albumSearchResults.length >= SearchTab.hasMoreThreshold),
hasMore: (_albumSearchResults.length >= kSearchSectionLimit - 1),
),
const SizedBox(height: 2),
SizedBox(

View file

@ -14,7 +14,6 @@ import "package:photos/ui/viewer/search/tab_empty_state.dart";
import 'package:photos/ui/viewer/search_tab/albums_section.dart';
class SearchTab extends StatefulWidget {
static const hasMoreThreshold = 6;
const SearchTab({Key? key}) : super(key: key);
@override
@ -106,7 +105,7 @@ class _AllSearchSectionsState extends State<AllSearchSections> {
return SearchSection(
sectionType: searchTypes[index],
examples: snapshot.data!.elementAt(index),
limit: searchSectionLimit,
limit: kSearchSectionLimit,
);
}
},