Wrap add person name banner inside safeArea (#1887)

## Description

## Tests
This commit is contained in:
Neeraj Gupta 2024-05-27 18:12:45 +05:30 committed by GitHub
commit ae61fc9c6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -161,43 +161,45 @@ class _ClusterPageState extends State<ClusterPage> {
),
),
showNamingBanner
? Dismissible(
key: const Key("namingBanner"),
direction: DismissDirection.horizontal,
onDismissed: (direction) {
setState(() {
userDismissedNamingBanner = true;
});
},
child: PeopleBanner(
type: PeopleBannerType.addName,
faceWidget: PersonFaceWidget(
files.first,
clusterID: widget.clusterID,
),
actionIcon: Icons.add_outlined,
text: S.of(context).addAName,
subText: S.of(context).findPeopleByName,
onTap: () async {
if (widget.personID == null) {
final result = await showAssignPersonAction(
context,
clusterID: widget.clusterID,
);
if (result != null &&
result is (PersonEntity, EnteFile)) {
Navigator.pop(context);
// ignore: unawaited_futures
routeToPage(context, PeoplePage(person: result.$1));
} else if (result != null && result is PersonEntity) {
Navigator.pop(context);
// ignore: unawaited_futures
routeToPage(context, PeoplePage(person: result));
}
} else {
showShortToast(context, "No personID or clusterID");
}
? SafeArea(
child: Dismissible(
key: const Key("namingBanner"),
direction: DismissDirection.horizontal,
onDismissed: (direction) {
setState(() {
userDismissedNamingBanner = true;
});
},
child: PeopleBanner(
type: PeopleBannerType.addName,
faceWidget: PersonFaceWidget(
files.first,
clusterID: widget.clusterID,
),
actionIcon: Icons.add_outlined,
text: S.of(context).addAName,
subText: S.of(context).findPeopleByName,
onTap: () async {
if (widget.personID == null) {
final result = await showAssignPersonAction(
context,
clusterID: widget.clusterID,
);
if (result != null &&
result is (PersonEntity, EnteFile)) {
Navigator.pop(context);
// ignore: unawaited_futures
routeToPage(context, PeoplePage(person: result.$1));
} else if (result != null && result is PersonEntity) {
Navigator.pop(context);
// ignore: unawaited_futures
routeToPage(context, PeoplePage(person: result));
}
} else {
showShortToast(context, "No personID or clusterID");
}
},
),
),
)
: const SizedBox.shrink(),