dart - flutter bottomsheet with notch(类似于bottomNavigationBar:BottomAppBar的shape属性)
问题描述
问题1:如何在floatingactionbutton周围添加一个凹口来颤动底部工作表,使其看起来像一个bottomappbar(具有CircularNotchedRectangle()的形状)但表现得像bottomsheet(可以拖动以关闭)
问题 2:如何使底页不可关闭但仍可拖动。(类似于android的底页)
问题 3:bottomsheet 窥视高度,bottomsheet 可忽略,但也可扩展(再次,就像 android bottomsheet)
是否有可能实现我上面列出的内容?还是我运气不好,必须使用第 3 方库?(如果有的话?)
解决方案
你也可以使用这种技术
Scaffold(
backgroundColor: myBackgroundColor,
floatingActionButtonLocation: FloatingActionButtonLocation.startDocked, //specify the location of the FAB
floatingActionButton: CircleAvatar(
radius: 32,
backgroundColor: myBackgroundColor,
child: Padding(
padding: EdgeInsets.all(1),
child: FloatingActionButton(
backgroundColor: MyColor.textColor,
onPressed: () {
print('OK');
},
child: Container(
margin: EdgeInsets.all(15.0),
child: Icon(Icons.add),
),
elevation: 4.0,
),
),
),
bottomNavigationBar: BottomAppBar(
child: Container(
color: MyColor.textColor,
height: 35,
),
)
);
推荐阅读
- mongodb - 使用索引的MongoDB慢查询
- docker - 在 kubernetes 集群中部署映像获取 CrashLoopBackOff
- ios - iOS 12 - NSLocale 问题
- amazon-web-services - 我们可以创建一个有权在 AWS 中创建其他 IAM 用户的 IAM 用户吗
- json.net - 为什么 Json.Net 在反序列化第一次时间会导致大量分配
- android - ConstraintLayout by Code - 过早设置约束
- python - 上传到云笔记本(如 colaboratory 或 azure 笔记本)时,jupyter 笔记本图像不显示
- javascript - 在这种情况下该功能的实现是什么
- twitter - 将流式推文存储在列表中以供进一步分析
- javascript - 12小时格式的一天的时刻js间隔