add on tap to 'view all' in section header

This commit is contained in:
ashilkn 2024-02-15 10:03:57 +05:30
parent b10edfacdd
commit 7b8967c527

View file

@ -1,6 +1,8 @@
import "package:flutter/material.dart";
import "package:photos/models/search/search_types.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/viewer/search/result/search_section_all_page.dart";
import "package:photos/utils/navigation_util.dart";
class SectionHeader extends StatelessWidget {
final SectionType sectionType;
@ -9,26 +11,41 @@ class SectionHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.all(12),
child: Text(
sectionType.sectionTitle(context),
style: getEnteTextTheme(context).largeBold,
return GestureDetector(
onTap: () {
if (hasMore) {
routeToPage(
context,
SearchSectionAllPage(
sectionType: sectionType,
),
);
}
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.all(12),
child: Text(
sectionType.sectionTitle(context),
style: getEnteTextTheme(context).largeBold,
),
),
),
hasMore
? Padding(
padding: const EdgeInsets.all(12),
child: Icon(
Icons.chevron_right_outlined,
color: getEnteColorScheme(context).strokeMuted,
),
)
: const SizedBox.shrink(),
],
hasMore
? Container(
color: Colors.transparent,
child: Padding(
padding: const EdgeInsets.fromLTRB(24, 12, 12, 12),
child: Icon(
Icons.chevron_right_outlined,
color: getEnteColorScheme(context).strokeMuted,
),
),
)
: const SizedBox.shrink(),
],
),
);
}
}