Skip to content

armgit / ente

Public Imported from GitHub
0

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

Use shared app bar for search all pages

ashilkn5f7a12f9631a
diff --git a/mobile/apps/photos/lib/ui/rituals/all_rituals_screen.dart b/mobile/apps/photos/lib/ui/rituals/all_rituals_screen.dart
index 5fae688f0b..bb8dfba153 100644
--- a/mobile/apps/photos/lib/ui/rituals/all_rituals_screen.dart
+++ b/mobile/apps/photos/lib/ui/rituals/all_rituals_screen.dart
@@ -1,5 +1,6 @@
import "dart:async";
+import "package:ente_components/ente_components.dart";
import "package:ente_icons/ente_icons.dart";
import "package:ente_pure_utils/ente_pure_utils.dart";
import "package:flutter/material.dart";
@@ -29,79 +30,84 @@ class AllRitualsScreen extends StatelessWidget {
final ritualsEnabled = flagService.ritualsFlag;
if (!ritualsEnabled) {
return Scaffold(
- appBar: AppBar(title: Text(l10n.ritualsTitle), centerTitle: false),
- body: Center(
- child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 24),
- child: Text(
- "Rituals are currently limited to internal users.",
- style: Theme.of(context).textTheme.bodyMedium,
- textAlign: TextAlign.center,
+ body: AppBarComponent(
+ title: l10n.ritualsTitle,
+ slivers: [
+ SliverFillRemaining(
+ hasScrollBody: false,
+ child: Center(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 24),
+ child: Text(
+ "Rituals are currently limited to internal users.",
+ style: Theme.of(context).textTheme.bodyMedium,
+ textAlign: TextAlign.center,
+ ),
+ ),
+ ),
),
- ),
+ ],
),
);
}
return Scaffold(
- appBar: AppBar(
- title: Text(l10n.ritualsTitle),
- centerTitle: false,
- actions: [
- Padding(
- padding: const EdgeInsets.only(right: 16),
- child: IconButton(
- style: IconButton.styleFrom(
- backgroundColor: const Color(0xFF1DB954),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10),
+ body: ValueListenableBuilder<RitualsState>(
+ valueListenable: ritualsService.stateNotifier,
+ builder: (context, state, _) {
+ final rituals = state.rituals;
+ final summary = state.summary;
+ return AppBarComponent(
+ title: l10n.ritualsTitle,
+ physics: const BouncingScrollPhysics(),
+ actions: [
+ IconButtonComponent(
+ variant: IconButtonComponentVariant.green,
+ shouldSurfaceExecutionStates: false,
+ icon: const HugeIcon(
+ icon: HugeIcons.strokeRoundedPlusSign,
+ size: 24,
+ color: Colors.white,
),
- padding: const EdgeInsets.all(8),
- minimumSize: const Size(40, 40),
+ onTap: () async {
+ await showRitualEditor(context, ritual: null);
+ },
+ tooltip: l10n.ritualAddTooltip,
),
- icon: const HugeIcon(
- icon: HugeIcons.strokeRoundedPlusSign,
- size: 24,
- color: Colors.white,
+ ],
+ slivers: [
+ SliverSafeArea(
+ top: false,
+ sliver: SliverPadding(
+ padding: const EdgeInsets.fromLTRB(16, 8, 16, 48),
+ sliver: rituals.isEmpty
+ ? SliverToBoxAdapter(
+ child: StartNewRitualCard(
+ variant: StartNewRitualCardVariant.wide,
+ onTap: () async {
+ await showRitualEditor(context, ritual: null);
+ },
+ ),
+ )
+ : SliverList(
+ delegate: SliverChildBuilderDelegate((
+ context,
+ index,
+ ) {
+ final ritual = rituals[index];
+ return Padding(
+ padding: const EdgeInsets.only(bottom: 12),
+ child: _RitualOverviewCard(
+ ritual: ritual,
+ progress: summary?.ritualProgress[ritual.id],
+ ),
+ );
+ }, childCount: rituals.length),
+ ),
+ ),
),
- onPressed: () async {
- await showRitualEditor(context, ritual: null);
- },
- tooltip: l10n.ritualAddTooltip,
- ),
- ),
- ],
- ),
- body: SafeArea(
- child: ValueListenableBuilder<RitualsState>(
- valueListenable: ritualsService.stateNotifier,
- builder: (context, state, _) {
- final rituals = state.rituals;
- final summary = state.summary;
- return ListView(
- physics: const BouncingScrollPhysics(),
- padding: const EdgeInsets.fromLTRB(16, 8, 16, 48),
- children: [
- if (rituals.isEmpty)
- StartNewRitualCard(
- variant: StartNewRitualCardVariant.wide,
- onTap: () async {
- await showRitualEditor(context, ritual: null);
- },
- )
- else
- ...rituals.map(
- (ritual) => Padding(
- padding: const EdgeInsets.only(bottom: 12),
- child: _RitualOverviewCard(
- ritual: ritual,
- progress: summary?.ritualProgress[ritual.id],
- ),
- ),
- ),
- ],
- );
- },
- ),
+ ],
+ );
+ },
),
);
}
diff --git a/mobile/apps/photos/lib/ui/viewer/search/result/people_section_all_page.dart b/mobile/apps/photos/lib/ui/viewer/search/result/people_section_all_page.dart
index 0903441943..380b943f3e 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/result/people_section_all_page.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/result/people_section_all_page.dart
@@ -1,8 +1,10 @@
import "dart:async";
+import "package:ente_components/ente_components.dart";
import "package:ente_pure_utils/ente_pure_utils.dart";
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+import "package:hugeicons/hugeicons.dart";
import "package:photos/core/configuration.dart";
import "package:photos/core/event_bus.dart";
import "package:photos/events/event.dart";
@@ -24,8 +26,6 @@ import "package:photos/theme/text_style.dart";
import "package:photos/ui/common/loading_widget.dart";
import "package:photos/ui/components/banners/save_faces_banner.dart";
import "package:photos/ui/components/bottom_action_bar/people_bottom_action_bar_widget.dart";
-import "package:photos/ui/components/buttons/icon_button_widget.dart";
-import "package:photos/ui/components/searchable_appbar.dart";
import "package:photos/ui/viewer/actions/select_all_status_icon.dart";
import "package:photos/ui/viewer/file/no_thumbnail_widget.dart";
import "package:photos/ui/viewer/file/thumbnail_widget.dart";
@@ -341,6 +341,9 @@ class _PeopleSectionAllWidgetState extends State<PeopleSectionAllWidget> {
bool _isInitialLoad = true;
bool userDismissedPersonGallerySuggestion = false;
String _searchQuery = "";
+ late bool _isSearchBarVisible;
+ final _searchController = TextEditingController();
+ final _searchFocusNode = FocusNode();
int _suggestionReloadToken = 0;
final Debouncer _peopleReloadDebouncer = Debouncer(
const Duration(milliseconds: 400),
@@ -384,14 +387,6 @@ class _PeopleSectionAllWidgetState extends State<PeopleSectionAllWidget> {
});
}
- void _clearSearchQuery() {
- if (_searchQuery.isNotEmpty) {
- setState(() {
- _searchQuery = "";
- });
- }
- }
-
void _toggleIgnoredPeopleView() {
setState(() {
_showingIgnoredPeople = !_showingIgnoredPeople;
@@ -403,6 +398,10 @@ class _PeopleSectionAllWidgetState extends State<PeopleSectionAllWidget> {
@override
void initState() {
super.initState();
+ _isSearchBarVisible = widget.showSearchBar && widget.startInSearchMode;
+ if (_isSearchBarVisible) {
+ _focusSearchField();
+ }
final settings = localSettings;
_sortKey = settings.peopleSortKey();
_nameSortAscending = settings.peopleNameSortAscending;
@@ -457,6 +456,30 @@ class _PeopleSectionAllWidgetState extends State<PeopleSectionAllWidget> {
}
}
+ void _focusSearchField() {
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (mounted) {
+ _searchFocusNode.requestFocus();
+ }
+ });
+ }
+
+ void _activateSearch() {
+ setState(() {
+ _isSearchBarVisible = true;
+ });
+ _focusSearchField();
+ }
+
+ void _closeSearch() {
+ _searchFocusNode.unfocus();
+ _searchController.clear();
+ setState(() {
+ _isSearchBarVisible = false;
+ _searchQuery = "";
+ });
+ }
+
Future<List<GenericSearchResult>> getResults({bool init = false}) async {
final allFaces = await SearchService.instance.getAllFace(
null,
@@ -609,6 +632,8 @@ class _PeopleSectionAllWidgetState extends State<PeopleSectionAllWidget> {
for (var subscriptions in streamSubscriptions) {
subscriptions.cancel();
}
+ _searchController.dispose();
+ _searchFocusNode.dispose();
super.dispose();
}
@@ -625,28 +650,10 @@ class _PeopleSectionAllWidgetState extends State<PeopleSectionAllWidget> {
return FutureBuilder<List<GenericSearchResult>>(
future: sectionData,
builder: (context, snapshot) {
- final slivers = <Widget>[
- if (widget.showSearchBar)
- SearchableAppBar(
- title: Text(SectionType.face.sectionTitle(context)),
- autoActivateSearch: widget.startInSearchMode,
- onSearch: _updateSearchQuery,
- onSearchClosed: _clearSearchQuery,
- centerTitle: false,
- searchIconPadding: const EdgeInsets.fromLTRB(
- 12,
- 12,
- horizontalEdgePadding,
- 12,
- ),
- actions: [
- Padding(
- padding: const EdgeInsets.only(right: horizontalEdgePadding),
- child: _buildSortMenu(context, textTheme, colorScheme),
- ),
- ],
- ),
- ];
+ final slivers = <Widget>[];
+ if (widget.showSearchBar && _isSearchBarVisible) {
+ slivers.add(_buildSearchFieldSliver(context, horizontalEdgePadding));
+ }
if (!_isLoaded &&
snapshot.connectionState == ConnectionState.waiting &&
_isInitialLoad) {
@@ -655,14 +662,14 @@ class _PeopleSectionAllWidgetState extends State<PeopleSectionAllWidget> {
child: Center(child: EnteLoadingWidget()),
),
);
- return CustomScrollView(slivers: slivers);
+ return _buildScrollBody(slivers, textTheme, colorScheme);
} else if (snapshot.hasError) {
slivers.add(
const SliverFillRemaining(
child: Center(child: Icon(Icons.error_outline_rounded)),
),
);
- return CustomScrollView(slivers: slivers);
+ return _buildScrollBody(slivers, textTheme, colorScheme);
} else {
final filteredNormalFaces = _filterFaces(normalFaces);
final filteredExtraFaces = _filterFaces(extraFaces);
@@ -680,7 +687,7 @@ class _PeopleSectionAllWidgetState extends State<PeopleSectionAllWidget> {
),
),
);
- return CustomScrollView(slivers: slivers);
+ return _buildScrollBody(slivers, textTheme, colorScheme);
}
final screenWidth = MediaQuery.of(context).size.width;
final crossAxisCount = (screenWidth / 100).floor();
@@ -845,86 +852,145 @@ class _PeopleSectionAllWidgetState extends State<PeopleSectionAllWidget> {
const SliverToBoxAdapter(child: SizedBox(height: 16)),
]);
}
- return CustomScrollView(slivers: slivers);
+ return _buildScrollBody(slivers, textTheme, colorScheme);
}
},
);
}
- Widget _buildSortMenu(
- BuildContext context,
+ Widget _buildScrollBody(
+ List<Widget> slivers,
EnteTextTheme textTheme,
EnteColorScheme colorScheme,
) {
- return Theme(
- data: Theme.of(context).copyWith(
- highlightColor: Colors.transparent,
- splashColor: Colors.transparent,
+ if (!widget.showSearchBar) {
+ return CustomScrollView(slivers: slivers);
+ }
+
+ return AppBarComponent(
+ title: SectionType.face.sectionTitle(context),
+ physics: const BouncingScrollPhysics(),
+ actions: _isSearchBarVisible
+ ? const []
+ : [
+ _buildSearchAction(),
+ _buildSortMenu(context, textTheme, colorScheme),
+ ],
+ slivers: slivers,
+ );
+ }
+
+ Widget _buildSearchAction() {
+ return IconButtonComponent(
+ variant: IconButtonComponentVariant.primary,
+ shouldSurfaceExecutionStates: false,
+ icon: const HugeIcon(icon: HugeIcons.strokeRoundedSearch01),
+ onTap: _activateSearch,
+ );
+ }
+
+ Widget _buildSearchFieldSliver(
+ BuildContext context,
+ double horizontalEdgePadding,
+ ) {
+ final colors = context.componentColors;
+ return SliverPadding(
+ padding: EdgeInsets.fromLTRB(
+ horizontalEdgePadding,
+ 0,
+ horizontalEdgePadding,
+ 4,
),
- child: GestureDetector(
- onTapDown: (TapDownDetails details) async {
- final l10n = AppLocalizations.of(context);
- const sortKeys = PeopleSortKey.values;
- final PeopleSortKey? selectedKey = await showMenu<PeopleSortKey>(
- color: colorScheme.backgroundElevated,
- context: context,
- elevation: 0,
- shape: RoundedRectangleBorder(
- side: BorderSide(width: 0.5, color: colorScheme.strokeFaint),
- borderRadius: BorderRadius.circular(_sortMenuCornerRadius),
- ),
- position: RelativeRect.fromLTRB(
- details.globalPosition.dx,
- details.globalPosition.dy,
- details.globalPosition.dx,
- details.globalPosition.dy + 50,
+ sliver: SliverToBoxAdapter(
+ child: TextInputComponent(
+ controller: _searchController,
+ focusNode: _searchFocusNode,
+ hintText: AppLocalizations.of(context).search,
+ onChanged: _updateSearchQuery,
+ prefix: HugeIcon(
+ icon: HugeIcons.strokeRoundedSearch01,
+ size: 20,
+ color: colors.textLight,
+ strokeWidth: 1.6,
+ ),
+ suffix: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: _closeSearch,
+ child: SizedBox.square(
+ dimension: IconSizes.medium,
+ child: HugeIcon(
+ icon: HugeIcons.strokeRoundedCancel01,
+ size: 18,
+ color: colors.textLight,
+ strokeWidth: 1.6,
+ ),
),
- items: [
- ...List.generate(sortKeys.length, (index) {
- final key = sortKeys[index];
- return _buildSortMenuItem(
- key,
- index == sortKeys.length - 1,
- textTheme,
- colorScheme,
- l10n,
- );
- }),
- _buildIgnoredPeopleMenuItem(
- context,
+ ),
+ ),
+ ),
+ );
+ }
+
+ Widget _buildSortMenu(
+ BuildContext context,
+ EnteTextTheme textTheme,
+ EnteColorScheme colorScheme,
+ ) {
+ return IconButtonComponent(
+ variant: IconButtonComponentVariant.primary,
+ shouldSurfaceExecutionStates: false,
+ icon: Icon(Icons.sort_rounded, color: colorScheme.textMuted),
+ onTapDown: (details) async {
+ final l10n = AppLocalizations.of(context);
+ const sortKeys = PeopleSortKey.values;
+ final PeopleSortKey? selectedKey = await showMenu<PeopleSortKey>(
+ color: colorScheme.backgroundElevated,
+ context: context,
+ elevation: 0,
+ shape: RoundedRectangleBorder(
+ side: BorderSide(width: 0.5, color: colorScheme.strokeFaint),
+ borderRadius: BorderRadius.circular(_sortMenuCornerRadius),
+ ),
+ position: RelativeRect.fromLTRB(
+ details.globalPosition.dx,
+ details.globalPosition.dy,
+ details.globalPosition.dx,
+ details.globalPosition.dy + 50,
+ ),
+ items: [
+ ...List.generate(sortKeys.length, (index) {
+ final key = sortKeys[index];
+ return _buildSortMenuItem(
+ key,
+ index == sortKeys.length - 1,
textTheme,
colorScheme,
l10n,
- ),
- ],
- );
- if (!mounted || selectedKey == null) {
- return;
+ );
+ }),
+ _buildIgnoredPeopleMenuItem(context, textTheme, colorScheme, l10n),
+ ],
+ );
+ if (!mounted || selectedKey == null) {
+ return;
+ }
+ if (selectedKey == _sortKey && !_canToggleSortDirection(selectedKey)) {
+ return;
+ }
+ setState(() {
+ if (selectedKey == _sortKey) {
+ _toggleSortDirection(selectedKey);
+ } else {
+ _sortKey = selectedKey;
}
- if (selectedKey == _sortKey &&
- !_canToggleSortDirection(selectedKey)) {
- return;
+ _sortFaces(normalFaces);
+ _sortFaces(extraFaces);
+ if (_showingIgnoredPeople) {
+ _prioritizeNamedIgnoredPeople(normalFaces);
}
- setState(() {
- if (selectedKey == _sortKey) {
- _toggleSortDirection(selectedKey);
- } else {
- _sortKey = selectedKey;
- }
- _sortFaces(normalFaces);
- _sortFaces(extraFaces);
- if (_showingIgnoredPeople) {
- _prioritizeNamedIgnoredPeople(normalFaces);
- }
- });
- unawaited(_persistSortPreferences());
- },
- child: IconButtonWidget(
- icon: Icons.sort_rounded,
- iconButtonType: IconButtonType.secondary,
- iconColor: colorScheme.textMuted,
- ),
- ),
+ });
+ unawaited(_persistSortPreferences());
+ },
);
}
diff --git a/mobile/apps/photos/lib/ui/viewer/search/result/search_section_all_page.dart b/mobile/apps/photos/lib/ui/viewer/search/result/search_section_all_page.dart
index d369e81778..16cf0af85d 100644
--- a/mobile/apps/photos/lib/ui/viewer/search/result/search_section_all_page.dart
+++ b/mobile/apps/photos/lib/ui/viewer/search/result/search_section_all_page.dart
@@ -1,8 +1,10 @@
import "dart:async";
import "package:collection/collection.dart";
+import "package:ente_components/ente_components.dart";
import "package:ente_pure_utils/ente_pure_utils.dart";
import "package:flutter/material.dart";
+import "package:hugeicons/hugeicons.dart";
import "package:photos/events/event.dart";
import "package:photos/generated/l10n.dart";
import "package:photos/models/search/album_search_result.dart";
@@ -13,7 +15,6 @@ 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/ui/common/loading_widget.dart";
-import "package:photos/ui/components/searchable_appbar.dart";
import "package:photos/ui/components/thumbnail_list_item.dart";
import "package:photos/ui/viewer/gallery/collection_page.dart";
import "package:photos/ui/viewer/search/result/magic_result_screen.dart";
@@ -35,14 +36,21 @@ class SearchSectionAllPage extends StatefulWidget {
class _SearchSectionAllPageState extends State<SearchSectionAllPage> {
late Future<List<SearchResult>> sectionData;
final streamSubscriptions = <StreamSubscription>[];
+ final _searchController = TextEditingController();
+ final _searchFocusNode = FocusNode();
String _searchQuery = "";
+ late bool _isSearchBarVisible;
bool get _isSearching => _searchQuery.trim().isNotEmpty;
@override
void initState() {
super.initState();
+ _isSearchBarVisible = widget.startInSearchMode;
sectionData = widget.sectionType.getData(context);
+ if (_isSearchBarVisible) {
+ _focusSearchField();
+ }
final streamsToListenTo = widget.sectionType.viewAllUpdateEvents();
for (Stream<Event> stream in streamsToListenTo) {
@@ -56,18 +64,34 @@ class _SearchSectionAllPageState extends State<SearchSectionAllPage> {
}
}
+ void _focusSearchField() {
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (mounted) {
+ _searchFocusNode.requestFocus();
+ }
+ });
+ }
+
+ void _activateSearch() {
+ setState(() {
+ _isSearchBarVisible = true;
+ });
+ _focusSearchField();
+ }
+
void _updateSearchQuery(String value) {
setState(() {
_searchQuery = value;
});
}
- void _clearSearchQuery() {
- if (_searchQuery.isNotEmpty) {
- setState(() {
- _searchQuery = "";
- });
- }
+ void _closeSearch() {
+ _searchFocusNode.unfocus();
+ _searchController.clear();
+ setState(() {
+ _isSearchBarVisible = false;
+ _searchQuery = "";
+ });
}
List<SearchResult> _filterResults(List<SearchResult> sectionResults) {
@@ -88,6 +112,8 @@ class _SearchSectionAllPageState extends State<SearchSectionAllPage> {
for (var subscriptions in streamSubscriptions) {
subscriptions.cancel();
}
+ _searchController.dispose();
+ _searchFocusNode.dispose();
super.dispose();
}
@@ -99,21 +125,10 @@ class _SearchSectionAllPageState extends State<SearchSectionAllPage> {
body: FutureBuilder<List<SearchResult>>(
future: sectionData,
builder: (context, snapshot) {
- final slivers = <Widget>[
- SearchableAppBar(
- title: Text(widget.sectionType.sectionTitle(context)),
- autoActivateSearch: widget.startInSearchMode,
- onSearch: _updateSearchQuery,
- onSearchClosed: _clearSearchQuery,
- centerTitle: false,
- searchIconPadding: const EdgeInsets.fromLTRB(
- 12,
- 12,
- horizontalEdgePadding,
- 12,
- ),
- ),
- ];
+ final slivers = <Widget>[];
+ if (_isSearchBarVisible) {
+ slivers.add(_buildSearchFieldSliver(context));
+ }
if (!snapshot.hasData) {
slivers.add(
@@ -121,11 +136,7 @@ class _SearchSectionAllPageState extends State<SearchSectionAllPage> {
child: Center(child: EnteLoadingWidget()),
),
);
- return CustomScrollView(
- physics: const BouncingScrollPhysics(),
- cacheExtent: cacheExtent,
- slivers: slivers,
- );
+ return _buildScaffoldBody(slivers, cacheExtent);
}
List<SearchResult> sectionResults = snapshot.data!;
@@ -155,11 +166,7 @@ class _SearchSectionAllPageState extends State<SearchSectionAllPage> {
),
),
);
- return CustomScrollView(
- physics: const BouncingScrollPhysics(),
- cacheExtent: cacheExtent,
- slivers: slivers,
- );
+ return _buildScaffoldBody(slivers, cacheExtent);
}
final showCTA = widget.sectionType.isCTAVisible && !_isSearching;
@@ -241,13 +248,62 @@ class _SearchSectionAllPageState extends State<SearchSectionAllPage> {
),
);
}
- return CustomScrollView(
- physics: const BouncingScrollPhysics(),
- cacheExtent: cacheExtent,
- slivers: slivers,
- );
+ return _buildScaffoldBody(slivers, cacheExtent);
},
),
);
}
+
+ Widget _buildScaffoldBody(List<Widget> slivers, double? cacheExtent) {
+ return AppBarComponent(
+ title: widget.sectionType.sectionTitle(context),
+ physics: const BouncingScrollPhysics(),
+ cacheExtent: cacheExtent,
+ actions: _isSearchBarVisible ? const [] : [_buildSearchAction()],
+ slivers: slivers,
+ );
+ }
+
+ Widget _buildSearchAction() {
+ return IconButtonComponent(
+ variant: IconButtonComponentVariant.primary,
+ shouldSurfaceExecutionStates: false,
+ icon: const HugeIcon(icon: HugeIcons.strokeRoundedSearch01),
+ onTap: _activateSearch,
+ );
+ }
+
+ Widget _buildSearchFieldSliver(BuildContext context) {
+ final colors = context.componentColors;
+ return SliverPadding(
+ padding: const EdgeInsets.fromLTRB(16, 0, 16, 4),
+ sliver: SliverToBoxAdapter(
+ child: TextInputComponent(
+ controller: _searchController,
+ focusNode: _searchFocusNode,
+ hintText: AppLocalizations.of(context).search,
+ onChanged: _updateSearchQuery,
+ prefix: HugeIcon(
+ icon: HugeIcons.strokeRoundedSearch01,
+ size: 20,
+ color: colors.textLight,
+ strokeWidth: 1.6,
+ ),
+ suffix: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: _closeSearch,
+ child: SizedBox.square(
+ dimension: IconSizes.medium,
+ child: HugeIcon(
+ icon: HugeIcons.strokeRoundedCancel01,
+ size: 18,
+ color: colors.textLight,
+ strokeWidth: 1.6,
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ }
}
diff --git a/mobile/packages/ente_components/lib/components/app_bar_component.dart b/mobile/packages/ente_components/lib/components/app_bar_component.dart
index 443ee64933..32f4c1bcc0 100644
--- a/mobile/packages/ente_components/lib/components/app_bar_component.dart
+++ b/mobile/packages/ente_components/lib/components/app_bar_component.dart
@@ -35,6 +35,7 @@ class AppBarComponent extends StatefulWidget {
this.showExpandedBackButton = true,
this.controller,
this.physics,
+ this.cacheExtent,
});
final String title;
@@ -54,6 +55,7 @@ class AppBarComponent extends StatefulWidget {
final List<Widget> slivers;
final ScrollController? controller;
final ScrollPhysics? physics;
+ final double? cacheExtent;
@override
State<AppBarComponent> createState() => _AppBarComponentState();
@@ -200,6 +202,7 @@ class _AppBarComponentState extends State<AppBarComponent> {
child: CustomScrollView(
controller: _controller,
physics: widget.physics,
+ cacheExtent: widget.cacheExtent,
slivers: [
SliverAppBarComponent(
title: widget.title,