Wrap add person name banner inside safeArea
This commit is contained in:
parent
232acfa211
commit
c291fa70d3
1 changed files with 38 additions and 36 deletions
|
@ -161,43 +161,45 @@ class _ClusterPageState extends State<ClusterPage> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
showNamingBanner
|
showNamingBanner
|
||||||
? Dismissible(
|
? SafeArea(
|
||||||
key: const Key("namingBanner"),
|
child: Dismissible(
|
||||||
direction: DismissDirection.horizontal,
|
key: const Key("namingBanner"),
|
||||||
onDismissed: (direction) {
|
direction: DismissDirection.horizontal,
|
||||||
setState(() {
|
onDismissed: (direction) {
|
||||||
userDismissedNamingBanner = true;
|
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");
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
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(),
|
: const SizedBox.shrink(),
|
||||||
|
|
Loading…
Reference in a new issue