Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Use an app bar that occupies less space on UI in 'all' section of people section compared to the app bar used in 'all' screen of other sections

ashilkn9de634ab8b8b
diff --git a/mobile/lib/ui/viewer/search/result/people_section_all_page.dart b/mobile/lib/ui/viewer/search/result/people_section_all_page.dart
index 26af6d0382..5c0d677989 100644
--- a/mobile/lib/ui/viewer/search/result/people_section_all_page.dart
+++ b/mobile/lib/ui/viewer/search/result/people_section_all_page.dart
@@ -6,7 +6,6 @@ import "package:photos/events/event.dart";
import "package:photos/models/search/search_result.dart";
import "package:photos/models/search/search_types.dart";
import "package:photos/theme/ente_theme.dart";
-import "package:photos/ui/components/title_bar_title_widget.dart";
import "package:photos/ui/viewer/search_tab/people_section.dart";
class PeopleSectionAllPage extends StatefulWidget {
@@ -55,111 +54,65 @@ class _PeopleSectionAllPageState extends State<PeopleSectionAllPage> {
const horizontalEdgePadding = 20.0;
const gridPadding = 16.0;
return Scaffold(
- // appBar: AppBar(
- // title: Text(S.of(context).people),
- // centerTitle: false,
- // ),
appBar: AppBar(
- toolbarHeight: 48,
- leadingWidth: 48,
- leading: GestureDetector(
- onTap: () {
- Navigator.pop(context);
- },
- child: const Icon(
- Icons.arrow_back_outlined,
- ),
- ),
+ title: Text(SectionType.face.sectionTitle(context)),
+ centerTitle: false,
),
- body: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Padding(
- padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- TitleBarTitleWidget(
- title: SectionType.face.sectionTitle(context),
- ),
- FutureBuilder(
- future: sectionData,
- builder: (context, snapshot) {
- if (snapshot.hasData) {
- final sectionResults = snapshot.data!;
- return Text(sectionResults.length.toString())
- .animate()
- .fadeIn(
- duration: const Duration(milliseconds: 150),
- curve: Curves.easeIn,
- );
- } else {
- return const SizedBox.shrink();
- }
- },
- ),
- ],
- ),
- ),
- Expanded(
- child: FutureBuilder<List<SearchResult>>(
- future: sectionData,
- builder: (context, snapshot) {
- if (snapshot.connectionState == ConnectionState.waiting) {
- return const Center(child: CircularProgressIndicator());
- } else if (snapshot.hasError) {
- return Center(child: Text('Error: ${snapshot.error}'));
- } else if (!snapshot.hasData || snapshot.data!.isEmpty) {
- return const Center(child: Text('No results found.'));
- } else {
- final results = snapshot.data!;
- final screenWidth = MediaQuery.of(context).size.width;
- final crossAxisCount = (screenWidth / 100).floor();
+ body: FutureBuilder<List<SearchResult>>(
+ future: sectionData,
+ builder: (context, snapshot) {
+ if (snapshot.connectionState == ConnectionState.waiting) {
+ return const Center(child: CircularProgressIndicator());
+ } else if (snapshot.hasError) {
+ return Center(child: Text('Error: ${snapshot.error}'));
+ } else if (!snapshot.hasData || snapshot.data!.isEmpty) {
+ return const Center(child: Text('No results found.'));
+ } else {
+ final results = snapshot.data!;
+ final screenWidth = MediaQuery.of(context).size.width;
+ final crossAxisCount = (screenWidth / 100).floor();
- final itemSize = (screenWidth -
- ((horizontalEdgePadding * 2) +
- ((crossAxisCount - 1) * gridPadding))) /
- crossAxisCount;
+ final itemSize = (screenWidth -
+ ((horizontalEdgePadding * 2) +
+ ((crossAxisCount - 1) * gridPadding))) /
+ crossAxisCount;
- return GridView.builder(
- padding: const EdgeInsets.fromLTRB(
- horizontalEdgePadding,
- 16,
- horizontalEdgePadding,
- 96,
- ),
- gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
- mainAxisSpacing: gridPadding,
- crossAxisSpacing: gridPadding,
- crossAxisCount: crossAxisCount,
- childAspectRatio:
- itemSize / (itemSize + (24 * textScaleFactor)),
- ),
- itemCount: results.length,
- itemBuilder: (context, index) {
- return PersonSearchExample(
- searchResult: results[index],
- size: itemSize,
- )
- .animate(delay: Duration(milliseconds: index * 12))
- .fadeIn(
- duration: const Duration(milliseconds: 225),
- curve: Curves.easeIn,
- )
- .slide(
- begin: const Offset(0, -0.05),
- curve: Curves.easeInOut,
- duration: const Duration(
- milliseconds: 225,
- ),
- );
- },
- );
- }
+ return GridView.builder(
+ padding: const EdgeInsets.fromLTRB(
+ horizontalEdgePadding,
+ 16,
+ horizontalEdgePadding,
+ 96,
+ ),
+ gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+ mainAxisSpacing: gridPadding,
+ crossAxisSpacing: gridPadding,
+ crossAxisCount: crossAxisCount,
+ childAspectRatio:
+ itemSize / (itemSize + (24 * textScaleFactor)),
+ ),
+ itemCount: results.length,
+ itemBuilder: (context, index) {
+ return PersonSearchExample(
+ searchResult: results[index],
+ size: itemSize,
+ )
+ .animate(delay: Duration(milliseconds: index * 12))
+ .fadeIn(
+ duration: const Duration(milliseconds: 225),
+ curve: Curves.easeIn,
+ )
+ .slide(
+ begin: const Offset(0, -0.05),
+ curve: Curves.easeInOut,
+ duration: const Duration(
+ milliseconds: 225,
+ ),
+ );
},
- ),
- ),
- ],
+ );
+ }
+ },
),
);
}