小编pal*_*lak的帖子

底部工作表中的范围滑块在颤动中不起作用

当我在底部工作表上使用范围滑块时,我被困在这里,范围滑块无法工作。我收到 0 错误,所以我不知道它卡在哪里。当我在构建函数中使用该函数但不在底部工作表中时,该函数工作正常。下面是它的代码-:

RangeValues Myheight = const RangeValues(150, 180);
 
  @override
  Widget build(BuildContext context) {

    return Scaffold(
      body: InkWell(
                  child: TextField(
                    controller: interest,
                    decoration: InputDecoration(
                      enabled: false,
                      suffixIcon: Padding(
                        padding: EdgeInsets.only(top: 15),
                        // add padding to adjust icon
                        child: Icon(Icons.add),
                      ),
                      prefixIcon: Padding(
                        padding: EdgeInsets.only(top: 15),
                        // add padding to adjust icon
                        child: Icon(Icons.favorite_border_rounded),
                      ),
                    ),
                  ),
                  onTap: () {
                    _bottomSheet(context, Myheight);
                  },
                ),
    );
  }


    _bottomSheet(context, myheight) {
    showModalBottomSheet(
        context: context,
        builder: (BuildContext c) {
          return Container(
            height: 250,
            child: …
Run Code Online (Sandbox Code Playgroud)

rangeslider flutter bottom-sheet flutter-layout

1
推荐指数
1
解决办法
1903
查看次数