Skip to content

armgit / ente

Public Imported from GitHub
0

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

Search results screen redesign

laurenspriem0f92a48fe429
diff --git a/mobile/apps/photos/lib/l10n/intl_en.arb b/mobile/apps/photos/lib/l10n/intl_en.arb
index 59bc476c9f..034abef950 100644
--- a/mobile/apps/photos/lib/l10n/intl_en.arb
+++ b/mobile/apps/photos/lib/l10n/intl_en.arb
@@ -471,6 +471,10 @@
"mlConsentPrivacy": "Please click here for more details about this feature in our privacy policy",
"mlConsentConfirmation": "I understand, and wish to enable machine learning",
"magicSearch": "Magic search",
+ "magic": "Magic",
+ "@magic": {
+ "description": "Section header for magic search results"
+ },
"discover": "Discover",
"@discover": {
"description": "The text to display for the discover section under which we show receipts, screenshots, sunsets, greenery, etc."
@@ -1111,6 +1115,46 @@
"loadMessage8": "web.ente.io has a slick uploader",
"loadMessage9": "We use Xchacha20Poly1305 to safely encrypt your data",
"photoDescriptions": "Photo descriptions",
+ "searchResultFileName": "File name",
+ "@searchResultFileName": {
+ "description": "Search result subtitle label for file name matches"
+ },
+ "searchResultDescription": "Description",
+ "@searchResultDescription": {
+ "description": "Search result subtitle label for description matches"
+ },
+ "searchResultType": "Type",
+ "@searchResultType": {
+ "description": "Search result subtitle label for file type matches"
+ },
+ "searchResultFileExtension": "File extension",
+ "@searchResultFileExtension": {
+ "description": "Search result subtitle label for file extension matches"
+ },
+ "searchResultPerson": "Person",
+ "@searchResultPerson": {
+ "description": "Search result subtitle label for person results"
+ },
+ "searchResultShared": "Shared",
+ "@searchResultShared": {
+ "description": "Search result subtitle label for shared-with-you results"
+ },
+ "searchResultUploadedBy": "Uploaded by",
+ "@searchResultUploadedBy": {
+ "description": "Search result subtitle label for uploader results"
+ },
+ "searchResultCameraMake": "Camera make",
+ "@searchResultCameraMake": {
+ "description": "Search result subtitle label for camera make matches"
+ },
+ "searchResultCameraModel": "Camera model",
+ "@searchResultCameraModel": {
+ "description": "Search result subtitle label for camera model matches"
+ },
+ "files": "Files",
+ "@files": {
+ "description": "Section header for file-related search results"
+ },
"fileTypesAndNames": "File types and names",
"location": "Location",
"moments": "Moments",
diff --git a/mobile/apps/photos/lib/ui/viewer/search/result/search_result_widget.dart b/mobile/apps/photos/lib/ui/viewer/search/result/search_result_widget.dart
index d5c1b7b0e8..f3d37546e2 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/result/search_result_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/result/search_result_widget.dart
@@ -1,7 +1,7 @@
import 'package:ente_pure_utils/ente_pure_utils.dart';
import 'package:flutter/material.dart';
import "package:intl/intl.dart";
-import 'package:photos/ente_theme_data.dart';
+import "package:photos/generated/l10n.dart";
import "package:photos/models/search/generic_search_result.dart";
import "package:photos/models/search/recent_searches.dart";
import 'package:photos/models/search/search_result.dart';
@@ -15,161 +15,156 @@ class SearchResultWidget extends StatelessWidget {
final SearchResult searchResult;
final Future<int>? resultCount;
final Function? onResultTap;
+ final BorderRadius borderRadius;
+ final EdgeInsetsGeometry padding;
+ final bool showTypeLabel;
const SearchResultWidget(
this.searchResult, {
super.key,
this.resultCount,
this.onResultTap,
+ this.borderRadius = BorderRadius.zero,
+ this.padding = const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
+ this.showTypeLabel = true,
});
@override
Widget build(BuildContext context) {
final heroTagPrefix = searchResult.heroTag();
final textTheme = getEnteTextTheme(context);
+ final colorScheme = getEnteColorScheme(context);
return SizedBox(
key: ValueKey(searchResult.hashCode),
- child: GestureDetector(
- behavior: HitTestBehavior.opaque,
- child: Container(
- decoration: BoxDecoration(
- borderRadius: const BorderRadius.all(Radius.circular(4)),
- border: Border.all(
- color: getEnteColorScheme(context).strokeFainter,
- ),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- searchResult.type() == ResultType.shared
- ? ContactSearchThumbnailWidget(
- heroTagPrefix,
- searchResult: searchResult as GenericSearchResult,
- )
- : SearchThumbnailWidget(
- searchResult.previewThumbnail(),
- heroTagPrefix,
- searchResult: searchResult,
- ),
- const SizedBox(width: 12),
- Padding(
- padding: const EdgeInsets.symmetric(vertical: 2),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- SizedBox(
- width: 220,
- child: Text(
+ child: Material(
+ color: Colors.transparent,
+ child: InkWell(
+ borderRadius: borderRadius,
+ onTap: () {
+ RecentSearches().add(searchResult.name());
+
+ if (onResultTap != null) {
+ onResultTap!();
+ } else {
+ if (searchResult.type() == ResultType.shared) {
+ routeToPage(
+ context,
+ ContactResultPage(
+ searchResult,
+ ),
+ );
+ } else {
+ routeToPage(
+ context,
+ SearchResultPage(
+ searchResult,
+ ),
+ );
+ }
+ }
+ },
+ child: Padding(
+ padding: padding,
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ searchResult.type() == ResultType.shared
+ ? ContactSearchThumbnailWidget(
+ heroTagPrefix,
+ searchResult: searchResult as GenericSearchResult,
+ )
+ : SearchThumbnailWidget(
+ searchResult.previewThumbnail(),
+ heroTagPrefix,
+ searchResult: searchResult,
+ ),
+ const SizedBox(width: 12),
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
searchResult.name(),
- style: textTheme.body,
+ style: textTheme.bodyBold,
overflow: TextOverflow.ellipsis,
),
- ),
- const SizedBox(height: 4),
- Row(
- children: [
- Text(
- _resultTypeName(searchResult.type()),
- style: textTheme.smallMuted,
- ),
- FutureBuilder<int>(
- future: resultCount ??
- Future.value(searchResult.resultFiles().length),
- builder: (context, snapshot) {
- if (snapshot.hasData && snapshot.data! > 0) {
- final noOfMemories = snapshot.data;
-
- return Text(
- " \u2022 " +
- (noOfMemories! > 9999
- ? NumberFormat().format(noOfMemories)
- : noOfMemories.toString()),
- style: textTheme.smallMuted,
- );
- } else {
- return const SizedBox.shrink();
- }
- },
- ),
- ],
- ),
- ],
+ const SizedBox(height: 4),
+ FutureBuilder<int>(
+ future: resultCount ??
+ Future.value(searchResult.resultFiles().length),
+ builder: (context, snapshot) {
+ final label = showTypeLabel
+ ? _resultTypeLabel(context, searchResult.type())
+ : null;
+ if (snapshot.hasData && (snapshot.data ?? 0) > 0) {
+ final count = snapshot.data!;
+ final countText = count > 9999
+ ? NumberFormat().format(count)
+ : count.toString();
+ return Text(
+ label != null
+ ? "$label \u2022 $countText"
+ : countText,
+ style: textTheme.smallMuted,
+ overflow: TextOverflow.ellipsis,
+ );
+ }
+ if (label != null) {
+ return Text(
+ label,
+ style: textTheme.smallMuted,
+ overflow: TextOverflow.ellipsis,
+ );
+ }
+ return const SizedBox.shrink();
+ },
+ ),
+ ],
+ ),
),
- ),
- const Spacer(),
- Padding(
- padding: const EdgeInsets.all(16.0),
- child: Icon(
+ const SizedBox(width: 12),
+ Icon(
Icons.chevron_right,
- color: Theme.of(context).colorScheme.subTextColor,
+ color: colorScheme.strokeMuted,
),
- ),
- ],
+ ],
+ ),
),
),
- onTap: () {
- RecentSearches().add(searchResult.name());
-
- if (onResultTap != null) {
- onResultTap!();
- } else {
- if (searchResult.type() == ResultType.shared) {
- routeToPage(
- context,
- ContactResultPage(
- searchResult,
- ),
- );
- } else {
- routeToPage(
- context,
- SearchResultPage(
- searchResult,
- ),
- );
- }
- }
- },
),
);
}
- String _resultTypeName(ResultType type) {
+ String? _resultTypeLabel(BuildContext context, ResultType type) {
+ final localizations = AppLocalizations.of(context);
switch (type) {
- case ResultType.collection:
- return "Album";
- case ResultType.year:
- return "Year";
- case ResultType.month:
- return "Month";
case ResultType.file:
- return "File name";
- case ResultType.event:
- return "Day";
- case ResultType.location:
- return "Location";
- case ResultType.locationSuggestion:
- return "Add Location";
+ return localizations.searchResultFileName;
+ case ResultType.fileCaption:
+ return localizations.searchResultDescription;
case ResultType.fileType:
- return "Type";
+ return localizations.searchResultType;
case ResultType.fileExtension:
- return "File extension";
- case ResultType.fileCaption:
- return "Description";
- case ResultType.magic:
- return "Magic";
- case ResultType.shared:
- return "Shared";
+ return localizations.searchResultFileExtension;
case ResultType.faces:
- return "Person";
+ return localizations.searchResultPerson;
+ case ResultType.shared:
+ return localizations.searchResultShared;
case ResultType.uploader:
- return "Uploaded by";
+ return localizations.searchResultUploadedBy;
case ResultType.cameraMake:
- return "Camera Make";
+ return localizations.searchResultCameraMake;
case ResultType.cameraModel:
- return "Camera Model";
+ return localizations.searchResultCameraModel;
+ case ResultType.collection:
+ case ResultType.year:
+ case ResultType.month:
+ case ResultType.event:
+ case ResultType.location:
+ case ResultType.locationSuggestion:
+ case ResultType.magic:
+ return null;
}
}
}
diff --git a/mobile/apps/photos/lib/ui/viewer/search/result/search_thumbnail_widget.dart b/mobile/apps/photos/lib/ui/viewer/search/result/search_thumbnail_widget.dart
index 28b9fac88f..2a0cc624eb 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/result/search_thumbnail_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/result/search_thumbnail_widget.dart
@@ -29,10 +29,10 @@ class SearchThumbnailWidget extends StatelessWidget {
return Hero(
tag: tagPrefix + (file?.tag ?? ""),
child: SizedBox(
- height: 60,
- width: 60,
+ height: 56,
+ width: 56,
child: ClipRRect(
- borderRadius: BorderRadius.circular(4),
+ borderRadius: BorderRadius.circular(12),
child: file != null
? (searchResult != null &&
searchResult!.type() == ResultType.faces)
@@ -100,10 +100,10 @@ class _ContactSearchThumbnailWidgetState
@override
Widget build(BuildContext context) {
return SizedBox(
- height: 60,
- width: 60,
+ height: 56,
+ width: 56,
child: ClipRRect(
- borderRadius: const BorderRadius.horizontal(left: Radius.circular(4)),
+ borderRadius: BorderRadius.circular(12),
child: _canUsePersonFaceWidget
? PersonFaceWidget(
personId: _personID,
@@ -140,9 +140,7 @@ class NoFaceForContactWidget extends StatelessWidget {
final enteColorScheme = getEnteColorScheme(context);
return Container(
decoration: BoxDecoration(
- borderRadius: const BorderRadius.horizontal(
- left: Radius.circular(4),
- ),
+ borderRadius: BorderRadius.circular(12),
border: addBorder
? Border.all(
color: enteColorScheme.strokeFaint,
diff --git a/mobile/apps/photos/lib/ui/viewer/search/search_suggestions.dart b/mobile/apps/photos/lib/ui/viewer/search/search_suggestions.dart
index 3932da1ef4..f39a17f015 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/search_suggestions.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/search_suggestions.dart
@@ -3,6 +3,7 @@ import "dart:async";
import "package:ente_pure_utils/ente_pure_utils.dart";
import 'package:flutter/material.dart';
import "package:flutter_animate/flutter_animate.dart";
+import "package:hugeicons/hugeicons.dart";
import "package:logging/logging.dart";
import "package:photos/core/event_bus.dart";
import "package:photos/events/clear_and_unfocus_search_bar_event.dart";
@@ -11,9 +12,9 @@ import "package:photos/models/search/album_search_result.dart";
import "package:photos/models/search/generic_search_result.dart";
import "package:photos/models/search/index_of_indexed_stack.dart";
import 'package:photos/models/search/search_result.dart';
+import "package:photos/models/search/search_types.dart";
import "package:photos/services/collections_service.dart";
import "package:photos/theme/ente_theme.dart";
-import "package:photos/ui/common/loading_widget.dart";
import "package:photos/ui/viewer/gallery/collection_page.dart";
import "package:photos/ui/viewer/search/result/search_result_widget.dart";
import "package:photos/ui/viewer/search/search_widget.dart";
@@ -35,7 +36,7 @@ class SearchSuggestionsWidget extends StatefulWidget {
class _SearchSuggestionsWidgetState extends State<SearchSuggestionsWidget> {
Stream<List<SearchResult>>? resultsStream;
final queueOfSearchResults = <List<SearchResult>>[];
- var searchResultWidgets = <Widget>[];
+ final Map<_SearchResultsSection, List<SearchResult>> _sectionedResults = {};
StreamSubscription<List<SearchResult>>? subscription;
Timer? timer;
@@ -50,7 +51,7 @@ class _SearchSuggestionsWidgetState extends State<SearchSuggestionsWidget> {
IndexOfStackNotifier().searchState = SearchState.searching;
final resultsStream = SearchWidgetState.searchResultsStreamNotifier.value;
- searchResultWidgets.clear();
+ _sectionedResults.clear();
releaseResources();
subscription = resultsStream!.listen(
@@ -70,7 +71,7 @@ class _SearchSuggestionsWidgetState extends State<SearchSuggestionsWidget> {
Future.delayed(
const Duration(milliseconds: _surfaceNewResultsInterval + 20),
() {
- if (searchResultWidgets.isEmpty) {
+ if (_resultsCount == 0) {
IndexOfStackNotifier().searchState = SearchState.empty;
}
});
@@ -96,14 +97,7 @@ class _SearchSuggestionsWidgetState extends State<SearchSuggestionsWidget> {
const Duration(milliseconds: _surfaceNewResultsInterval), (timer) {
if (queueOfSearchResults.isNotEmpty) {
for (List<SearchResult> event in queueOfSearchResults) {
- for (SearchResult result in event) {
- searchResultWidgets.add(
- SearchResultsWidgetGenerator(result).animate().fadeIn(
- duration: const Duration(milliseconds: 80),
- curve: Curves.easeIn,
- ),
- );
- }
+ _addResultsToSections(event);
}
queueOfSearchResults.clear();
setState(() {});
@@ -119,11 +113,11 @@ class _SearchSuggestionsWidgetState extends State<SearchSuggestionsWidget> {
@override
Widget build(BuildContext context) {
- String title;
- final resultsCount = searchResultWidgets.length;
- title = AppLocalizations.of(context).searchResultCount(count: resultsCount);
+ final colorScheme = getEnteColorScheme(context);
return Scaffold(
+ backgroundColor: colorScheme.backgroundBase,
appBar: AppBar(
+ backgroundColor: colorScheme.backgroundBase,
leading: BackButton(
onPressed: () {
Bus.instance.fire(ClearAndUnfocusSearchBar());
@@ -131,43 +125,17 @@ class _SearchSuggestionsWidgetState extends State<SearchSuggestionsWidget> {
),
),
body: Padding(
- padding: const EdgeInsets.fromLTRB(12, 0, 12, 0),
+ padding: const EdgeInsets.fromLTRB(16, 0, 16, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- SizedBox(
- height: 44,
- child: SearchWidgetState.isLoading.value
- ? EnteLoadingWidget(
- size: 14,
- padding: 4,
- color: getEnteColorScheme(context).strokeMuted,
- alignment: Alignment.topLeft,
- )
- : Text(
- title,
- style: getEnteTextTheme(context).largeBold,
- ).animate().fadeIn(
- duration: const Duration(milliseconds: 60),
- curve: Curves.easeIn,
- ),
- ),
Expanded(
- child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 4),
- child: ListView.separated(
- itemBuilder: (context, index) {
- return searchResultWidgets[index];
- },
- separatorBuilder: (context, index) {
- return const SizedBox(height: 12);
- },
- itemCount: searchResultWidgets.length,
- physics: const BouncingScrollPhysics(),
- padding: EdgeInsets.only(
- bottom: (MediaQuery.sizeOf(context).height / 2) + 50,
- ),
+ child: ListView(
+ physics: const BouncingScrollPhysics(),
+ padding: EdgeInsets.only(
+ bottom: (MediaQuery.sizeOf(context).height / 2) + 50,
),
+ children: _buildSectionWidgets(context),
),
),
],
@@ -175,11 +143,77 @@ class _SearchSuggestionsWidgetState extends State<SearchSuggestionsWidget> {
),
);
}
+
+ int get _resultsCount {
+ int count = 0;
+ for (final results in _sectionedResults.values) {
+ count += results.length;
+ }
+ return count;
+ }
+
+ void _addResultsToSections(List<SearchResult> results) {
+ for (final result in results) {
+ final section = _sectionForResult(result);
+ _sectionedResults.putIfAbsent(section, () => <SearchResult>[]);
+ _sectionedResults[section]!.add(result);
+ }
+ }
+
+ List<Widget> _buildSectionWidgets(BuildContext context) {
+ final widgets = <Widget>[];
+ for (final section in _sectionOrder) {
+ final results = _sectionedResults[section] ?? [];
+ if (results.isEmpty) {
+ continue;
+ }
+ if (widgets.isNotEmpty) {
+ widgets.add(const SizedBox(height: 18));
+ }
+ final orderedResults = _orderedResultsForSection(section, results);
+ widgets.add(
+ _SearchResultsSectionWidget(
+ title: _sectionTitle(context, section),
+ icon: _sectionIcon(section),
+ results: orderedResults,
+ ),
+ );
+ }
+ return widgets;
+ }
+
+ List<SearchResult> _orderedResultsForSection(
+ _SearchResultsSection section,
+ List<SearchResult> results,
+ ) {
+ if (section != _SearchResultsSection.people) {
+ return results;
+ }
+ final people = <SearchResult>[];
+ final shared = <SearchResult>[];
+ for (final result in results) {
+ if (result.type() == ResultType.faces) {
+ people.add(result);
+ } else if (result.type() == ResultType.shared) {
+ shared.add(result);
+ } else {
+ shared.add(result);
+ }
+ }
+ return [...people, ...shared];
+ }
}
class SearchResultsWidgetGenerator extends StatelessWidget {
final SearchResult result;
- const SearchResultsWidgetGenerator(this.result, {super.key});
+ final BorderRadius borderRadius;
+ final bool showTypeLabel;
+ const SearchResultsWidgetGenerator(
+ this.result, {
+ this.borderRadius = BorderRadius.zero,
+ this.showTypeLabel = true,
+ super.key,
+ });
@override
Widget build(BuildContext context) {
@@ -190,6 +224,8 @@ class SearchResultsWidgetGenerator extends StatelessWidget {
resultCount: CollectionsService.instance.getFileCount(
albumSearchResult.collectionWithThumbnail.collection,
),
+ borderRadius: borderRadius,
+ showTypeLabel: showTypeLabel,
onResultTap: () => routeToPage(
context,
CollectionPage(
@@ -201,6 +237,8 @@ class SearchResultsWidgetGenerator extends StatelessWidget {
} else if (result is GenericSearchResult) {
return SearchResultWidget(
result,
+ borderRadius: borderRadius,
+ showTypeLabel: showTypeLabel,
onResultTap: (result as GenericSearchResult).onResultTap != null
? () => (result as GenericSearchResult).onResultTap!(context)
: null,
@@ -211,3 +249,169 @@ class SearchResultsWidgetGenerator extends StatelessWidget {
}
}
}
+
+enum _SearchResultsSection {
+ people,
+ albums,
+ magic,
+ files,
+ locations,
+ moments,
+}
+
+const List<_SearchResultsSection> _sectionOrder = [
+ _SearchResultsSection.files,
+ _SearchResultsSection.moments,
+ _SearchResultsSection.albums,
+ _SearchResultsSection.locations,
+ _SearchResultsSection.people,
+ _SearchResultsSection.magic,
+];
+
+_SearchResultsSection _sectionForResult(SearchResult result) {
+ switch (result.type()) {
+ case ResultType.faces:
+ case ResultType.shared:
+ return _SearchResultsSection.people;
+ case ResultType.collection:
+ return _SearchResultsSection.albums;
+ case ResultType.magic:
+ return _SearchResultsSection.magic;
+ case ResultType.location:
+ case ResultType.locationSuggestion:
+ return _SearchResultsSection.locations;
+ case ResultType.year:
+ case ResultType.month:
+ case ResultType.event:
+ return _SearchResultsSection.moments;
+ case ResultType.file:
+ case ResultType.fileType:
+ case ResultType.fileExtension:
+ case ResultType.fileCaption:
+ case ResultType.uploader:
+ case ResultType.cameraMake:
+ case ResultType.cameraModel:
+ return _SearchResultsSection.files;
+ }
+}
+
+String _sectionTitle(BuildContext context, _SearchResultsSection section) {
+ switch (section) {
+ case _SearchResultsSection.people:
+ return AppLocalizations.of(context).people;
+ case _SearchResultsSection.albums:
+ return AppLocalizations.of(context).albums;
+ case _SearchResultsSection.magic:
+ return AppLocalizations.of(context).magic;
+ case _SearchResultsSection.files:
+ return AppLocalizations.of(context).files;
+ case _SearchResultsSection.locations:
+ return AppLocalizations.of(context).locations;
+ case _SearchResultsSection.moments:
+ return AppLocalizations.of(context).moments;
+ }
+}
+
+List<List<dynamic>> _sectionIcon(_SearchResultsSection section) {
+ switch (section) {
+ case _SearchResultsSection.people:
+ return HugeIcons.strokeRoundedUserMultiple;
+ case _SearchResultsSection.albums:
+ return HugeIcons.strokeRoundedImage01;
+ case _SearchResultsSection.magic:
+ return HugeIcons.strokeRoundedSparkles;
+ case _SearchResultsSection.files:
+ return HugeIcons.strokeRoundedFile01;
+ case _SearchResultsSection.locations:
+ return HugeIcons.strokeRoundedMaping;
+ case _SearchResultsSection.moments:
+ return HugeIcons.strokeRoundedStar;
+ }
+}
+
+class _SearchResultsSectionWidget extends StatelessWidget {
+ final String title;
+ final List<List<dynamic>> icon;
+ final List<SearchResult> results;
+
+ const _SearchResultsSectionWidget({
+ required this.title,
+ required this.icon,
+ required this.results,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final colorScheme = getEnteColorScheme(context);
+ final textTheme = getEnteTextTheme(context);
+ final showTypeLabel = results.length > 1;
+ final children = <Widget>[];
+ for (int i = 0; i < results.length; i++) {
+ final radius = BorderRadius.vertical(
+ top: i == 0 ? const Radius.circular(20) : Radius.zero,
+ bottom:
+ i == results.length - 1 ? const Radius.circular(20) : Radius.zero,
+ );
+ children.add(
+ ClipRRect(
+ borderRadius: radius,
+ child: SearchResultsWidgetGenerator(
+ results[i],
+ borderRadius: radius,
+ showTypeLabel: showTypeLabel,
+ ).animate().fadeIn(
+ duration: const Duration(milliseconds: 80),
+ curve: Curves.easeIn,
+ ),
+ ),
+ );
+ if (i != results.length - 1) {
+ children.add(
+ Divider(
+ height: 1,
+ thickness: 1,
+ color: colorScheme.strokeFainter,
+ ),
+ );
+ }
+ }
+
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(4, 8, 4, 10),
+ child: Row(
+ children: [
+ Container(
+ decoration: BoxDecoration(
+ color: colorScheme.fillFaint,
+ borderRadius: BorderRadius.circular(12),
+ ),
+ padding: const EdgeInsets.all(6),
+ child: HugeIcon(
+ icon: icon,
+ color: colorScheme.strokeBase,
+ size: 18,
+ ),
+ ),
+ const SizedBox(width: 10),
+ Text(
+ title,
+ style: textTheme.bodyBold,
+ ),
+ ],
+ ),
+ ),
+ Container(
+ decoration: BoxDecoration(
+ color: colorScheme.backgroundElevated,
+ borderRadius: BorderRadius.circular(20),
+ border: Border.all(color: colorScheme.strokeFainter),
+ ),
+ child: Column(children: children),
+ ),
+ ],
+ );
+ }
+}