如何在Flutter中制作抽屉按钮UnClickable

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

当我的应用程序启动时,一些数据将在后台加载我不希望用户在那时点击Drawer图标,所以我做了类似的事情。

@override
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: Text('Title'),
    ),
    drawer: _isLoading ? null : HomeDrawer(),
    body: _isLoading ? CircularProgressIndicator() : _body(),
  );
}

在这种情况下,当应用程序加载抽屉按钮时不可见 qazxsw poi

加载后,按钮返回。 enter image description here

我想要的是抽屉按钮应该在加载状态下可见,但它不应该是可点击的。

dart flutter
2个回答
© www.soinside.com 2019 - 2024. All rights reserved.