Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Use correct naming + remove unnecessary field

ashilkn5dda37a19259
diff --git a/mobile/lib/ui/viewer/search/result/search_result_widget.dart b/mobile/lib/ui/viewer/search/result/search_result_widget.dart
index fbd77531a8..965e0fcc0e 100644
--- a/mobile/lib/ui/viewer/search/result/search_result_widget.dart
+++ b/mobile/lib/ui/viewer/search/result/search_result_widget.dart
@@ -13,14 +13,12 @@ class SearchResultWidget extends StatelessWidget {
final SearchResult searchResult;
final Future<int>? resultCount;
final Function? onResultTap;
- final Map<String, dynamic>? params;
const SearchResultWidget(
this.searchResult, {
Key? key,
this.resultCount,
this.onResultTap,
- this.params,
}) : super(key: key);
@override
diff --git a/mobile/lib/ui/viewer/search_tab/magic_section.dart b/mobile/lib/ui/viewer/search_tab/magic_section.dart
index 3b49413e06..882968a9a9 100644
--- a/mobile/lib/ui/viewer/search_tab/magic_section.dart
+++ b/mobile/lib/ui/viewer/search_tab/magic_section.dart
@@ -101,14 +101,14 @@ class _MagicSectionState extends State<MagicSection> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
- SectionType.moment.sectionTitle(context),
+ SectionType.content.sectionTitle(context),
style: textTheme.largeBold,
),
const SizedBox(height: 24),
Padding(
padding: const EdgeInsets.only(left: 4),
child: Text(
- SectionType.moment.getEmptyStateText(context),
+ SectionType.content.getEmptyStateText(context),
style: textTheme.smallMuted,
),
),
@@ -116,7 +116,7 @@ class _MagicSectionState extends State<MagicSection> {
),
),
const SizedBox(width: 8),
- const SearchSectionEmptyCTAIcon(SectionType.moment),
+ const SearchSectionEmptyCTAIcon(SectionType.content),
],
),
);
@@ -127,7 +127,7 @@ class _MagicSectionState extends State<MagicSection> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SectionHeader(
- SectionType.moment,
+ SectionType.content,
hasMore: (_magicSearchResults.length >= kSearchSectionLimit - 1),
),
const SizedBox(height: 2),
@@ -141,8 +141,8 @@ class _MagicSectionState extends State<MagicSection> {
crossAxisAlignment: CrossAxisAlignment.start,
children: _magicSearchResults
.map(
- (momentSearchResult) =>
- MomentRecommendation(momentSearchResult),
+ (magicSearchResult) =>
+ MagicRecommendation(magicSearchResult),
)
.toList(),
),
@@ -155,31 +155,34 @@ class _MagicSectionState extends State<MagicSection> {
}
}
-class MomentRecommendation extends StatelessWidget {
+class MagicRecommendation extends StatelessWidget {
static const _width = 100.0;
- static const _height = 145.0;
+ static const _height = 110.0;
static const _borderWidth = 1.0;
static const _cornerRadius = 5.0;
static const _cornerSmoothing = 1.0;
- final GenericSearchResult momentSearchResult;
- const MomentRecommendation(this.momentSearchResult, {super.key});
+ final GenericSearchResult magicSearchResult;
+ const MagicRecommendation(this.magicSearchResult, {super.key});
@override
Widget build(BuildContext context) {
- final heroTag = momentSearchResult.heroTag() +
- (momentSearchResult.previewThumbnail()?.tag ?? "");
+ final heroTag = magicSearchResult.heroTag() +
+ (magicSearchResult.previewThumbnail()?.tag ?? "");
final enteTextTheme = getEnteTextTheme(context);
return Padding(
padding: EdgeInsets.symmetric(horizontal: max(2.5 - _borderWidth, 0)),
child: GestureDetector(
onTap: () {
- RecentSearches().add(momentSearchResult.name());
- if (momentSearchResult.onResultTap != null) {
- momentSearchResult.onResultTap!(context);
+ RecentSearches().add(magicSearchResult.name());
+ if (magicSearchResult.onResultTap != null) {
+ magicSearchResult.onResultTap!(context);
} else {
routeToPage(
context,
- SearchResultPage(momentSearchResult),
+ SearchResultPage(
+ magicSearchResult,
+ enableGrouping: false,
+ ),
);
}
},
@@ -223,11 +226,11 @@ class MomentRecommendation extends StatelessWidget {
SizedBox(
width: _width,
height: _height,
- child: momentSearchResult.previewThumbnail() != null
+ child: magicSearchResult.previewThumbnail() != null
? Hero(
tag: heroTag,
child: ThumbnailWidget(
- momentSearchResult.previewThumbnail()!,
+ magicSearchResult.previewThumbnail()!,
shouldShowArchiveStatus: false,
shouldShowSyncStatus: false,
),
@@ -263,7 +266,7 @@ class MomentRecommendation extends StatelessWidget {
bottom: 8,
),
child: Text(
- momentSearchResult.name(),
+ magicSearchResult.name(),
style: enteTextTheme.small.copyWith(
color: Colors.white,
),