键盘打开/关闭时颤动重建小部件然后再次调用函数

时间:2021-06-15 07:22:03

标签: flutter dart

<块引用>

使用故事视图 并且想在键盘打开时对每个故事发表评论调用故事控制器暂停>功能
问题是当再次打开键盘小部件构建调用并且更多故事功能再次启动时>然后故事控制器播放功能 如何停止重建小部件


        body: SizedBox(
          height: height,
          width: width,
          child: Stack(
            children: [
              Positioned.fill(
                child: GestureDetector(
                  onLongPress: () {
                    setState(() {
                      crewLongPress = true;
                    });
                  },
                  onLongPressEnd: (details) {
                    setState(() {
                      crewLongPress = false;
                    });
                  },
                  child: MoreStories(userSameStory, controller),
                ),
              ),
             Padding(padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
                                          child: buildTextField(height, width),
                                        ),])) ```

2 个答案:

答案 0 :(得分:0)

尝试在每次操作后“处理”您的控制器。

答案 1 :(得分:0)

尝试在您的应用程序中实现“延迟加载”功能