flutter栏+展开的widget在android中显示奇怪,在ios中正常

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

一开始展开不起作用,黑块在中间,但几秒钟后正常显示,黑块显示在底部。很奇怪。

如果您知道原因请告诉我,非常感谢。

环境:android 13 / flutter 3.19.6.

class RegistrationInfoPage extends StatefulWidget {
  const RegistrationInfoPage({super.key});

  @override
  State<StatefulWidget> createState() => _RegistrationInfoPageState();
}

class _RegistrationInfoPageState extends State<RegistrationInfoPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          Expanded(child: Text('index')),
          Container(
            height: 100,
            color: Colors.black,
          )
        ],
      ),
    );
  }
}

来自

Navigator.of(context).push(
            MaterialPageRoute(builder: (context) => RegistrationInfoPage()));

enter image description here

我希望黑块只显示在按钮上,没有中间动作。

flutter
1个回答
0
投票

父页面显示输入板,如果不关闭,子页面使用MediaQuery.Sizeof()就会出现这种情况。

© www.soinside.com 2019 - 2024. All rights reserved.