gpt4 book ai didi

dart - BottomAppBar 中缺少停靠 FloatingActionButton 的缺口

转载 作者:IT王子 更新时间:2023-10-29 06:47:28 37 4
gpt4 key购买 nike

一次

您可以通过在 Scaffold 中指定 floatingActionButtonLocation停靠 FloatingActionButton使用 BottomAppBar

documentation谈论一个:

"notch"

docked fab

现在

screen capture

import 'package:flutter/material.dart';

main() => runApp(MaterialApp(
home: Scaffold(
bottomNavigationBar: BottomAppBar(
child: Container(
height: 300.0,
color: Colors.pinkAccent,
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: FloatingActionButton(onPressed: () {}),
),
));

使用 Flutter 版本 0.5.6,我无法重新创建缺口。第二张图片和下面的代码属于一体。

这是问题/错误还是我现在可以做些什么?

最佳答案

BottomAppBar 现在需要将其 shape 指定为 CircularNotchedRectangle ,它不像以前的 hasNotch 那样设置为默认值:

Scaffold(
floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,
floatingActionButton: FloatingActionButton(...),
bottomNavigationBar: BottomAppBar(
shape: CircularNotchedRectangle(),
...
),
);

关于dart - BottomAppBar 中缺少停靠 FloatingActionButton 的缺口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51251722/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com