【问题标题】:Floating Action Button centerDocked, overlapping any screen or dialogue?浮动操作按钮中心停靠,重叠任何屏幕或对话?
【发布时间】:2019-06-28 14:58:18
【问题描述】:

我在底部导航栏的FloatingActionButton (FAB) 中使用动画图标。但是FAB 与从BottomAppBar 打开的任何页面或对话框重叠,我该如何解决这个问题?

当我打开带有Navigator.push、Navigator.pushNamed、modalBottomSheet 或对话的新页面时,晶圆厂将它们重叠。
仅当我使用 pushReplacementNamed 打开新页面时才有效。

我怎样才能显示没有工厂的modalSheet 和只使用pushNamed 的页面?

我使用this 参考。

floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
        floatingActionButton: _buildFab(context, model),
        bottomNavigationBar: BottomAppBar(
          color: CustomTheme.getThemeData(context).getAccentColor(),
          shape: CircularNotchedRectangle(),
          notchMargin: 4.0,
          child: new Row(
            mainAxisSize: MainAxisSize.max,
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              IconButton(
                icon: Icon(Icons.menu),
                onPressed: () => _showModal(),

              ),
              IconButton(
                icon: Icon(Icons.home),
                onPressed: () => {},
              ),
            ],
          ),
        ),

这是我的 FAB

当显示模态或任何页面时会发生这种情况

我需要你的帮助.. 我不知道还能做什么。 :-(

【问题讨论】:

    标签: flutter dart flutter-layout flutter-animation


    【解决方案1】:

    如果模态底页发生这种情况,请尝试增加底页的高度。像这样

    showModalBottomSheet(context: context, builder: (context) {
      return AddressChangeBottomSheet(
          title: "Change Area",
          showAddress: false,
          cityAreaList: list, onAddressChangeSubmit: () {
        mainBloc.fetchUpdatedUser();
      });
    }, elevation: 10.0)
    

    【讨论】:

      猜你喜欢
      • 2020-03-19
      • 1970-01-01
      • 2021-10-11
      • 2023-03-18
      • 1970-01-01
      • 2023-01-23
      • 1970-01-01
      • 2019-05-25
      • 1970-01-01
      相关资源
      最近更新 更多