don't await ensureVisible
This commit is contained in:
parent
9793635bed
commit
647f84f31f
1 changed files with 8 additions and 6 deletions
|
|
@ -58,7 +58,7 @@ class EmojiPicker extends HookConsumerWidget {
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
void syncSelectedCategoryWithScroll() async {
|
void syncSelectedCategoryWithScroll() {
|
||||||
final viewport =
|
final viewport =
|
||||||
scrollViewKey.currentContext?.findRenderObject()
|
scrollViewKey.currentContext?.findRenderObject()
|
||||||
as RenderBox?;
|
as RenderBox?;
|
||||||
|
|
@ -86,11 +86,13 @@ class EmojiPicker extends HookConsumerWidget {
|
||||||
chipKeys[firstVisibleIndex].currentContext;
|
chipKeys[firstVisibleIndex].currentContext;
|
||||||
|
|
||||||
if (chipContext != null) {
|
if (chipContext != null) {
|
||||||
await Scrollable.ensureVisible(
|
unawaited(
|
||||||
|
Scrollable.ensureVisible(
|
||||||
chipContext,
|
chipContext,
|
||||||
duration: Duration(milliseconds: 300),
|
duration: Duration(milliseconds: 300),
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
alignment: 0,
|
alignment: 0,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue