minor fix

This commit is contained in:
Thibault Deckers 2022-08-27 18:14:38 +02:00
parent 440bad1734
commit 7eea63fdbf
2 changed files with 10 additions and 10 deletions

View file

@ -257,12 +257,12 @@ class CollectionSearchDelegate extends AvesSearchDelegate {
void _applyToParentCollectionPage(BuildContext context, CollectionFilter filter) { void _applyToParentCollectionPage(BuildContext context, CollectionFilter filter) {
parentCollection!.addFilter(filter); parentCollection!.addFilter(filter);
// we post closing the search page after applying the filter selection // We delay closing the current page after applying the filter selection
// so that hero animation target is ready in the `FilterBar`, // so that hero animation target is ready in the `FilterBar`,
// even when the target is a child of an `AnimatedList` // even when the target is a child of an `AnimatedList`.
WidgetsBinding.instance.addPostFrameCallback((_) { // Do not use `WidgetsBinding.instance.addPostFrameCallback`,
goBack(context); // as it may not trigger if there is no subsequent build.
}); Future.delayed(const Duration(milliseconds: 100), () => goBack(context));
} }
void _jumpToCollectionPage(BuildContext context, CollectionFilter filter) { void _jumpToCollectionPage(BuildContext context, CollectionFilter filter) {

View file

@ -341,12 +341,12 @@ class StatsPage extends StatelessWidget {
void _applyToParentCollectionPage(BuildContext context, CollectionFilter filter) { void _applyToParentCollectionPage(BuildContext context, CollectionFilter filter) {
parentCollection!.addFilter(filter); parentCollection!.addFilter(filter);
// we post closing the search page after applying the filter selection // We delay closing the current page after applying the filter selection
// so that hero animation target is ready in the `FilterBar`, // so that hero animation target is ready in the `FilterBar`,
// even when the target is a child of an `AnimatedList` // even when the target is a child of an `AnimatedList`.
WidgetsBinding.instance.addPostFrameCallback((_) { // Do not use `WidgetsBinding.instance.addPostFrameCallback`,
Navigator.pop(context); // as it may not trigger if there is no subsequent build.
}); Future.delayed(const Duration(milliseconds: 100), () => Navigator.pop(context));
} }
void _jumpToCollectionPage(BuildContext context, CollectionFilter filter) { void _jumpToCollectionPage(BuildContext context, CollectionFilter filter) {