Flutter Stepper最后一步未完全滚动

问题描述 投票:0回答:1

我使用具有8个步骤的步进器进行用户注册。最后一步是用户输入的所有数据的摘要。现在,当我运行此命令时,“摘要”步骤并没有完全向下滚动到显示所有字段的末尾,尽管很容易放在屏幕上,但用户必须在整个步骤中手动滚动。

有没有办法告诉步进器在屏幕上显示步进的全部内容?

编辑:截图enter image description here

flutter dart
1个回答
0
投票

我在每个步骤中都通过在“下一步”按钮中使用钩子解决了它,以使滚动延迟,看起来非常漂亮且流畅。

buttonNext() {
  ...
  delayedScroll();
}

void delayedScroll() async {
    Future.delayed(const Duration(milliseconds: 300), () {
      _scrollController.animateTo(_scrollController.position.maxScrollExtent, duration: const Duration(milliseconds: 500), curve: Curves.easeOut);
    });
}
© www.soinside.com 2019 - 2024. All rights reserved.