Flutter: floatingActionButton
作者:互联网
class _MyHomeState extends State<MyHome> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Flutter Demo'),
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
onPressed: () {},
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, // 调整button在bottomNavigationBar上的位置
bottomNavigationBar: BottomAppBar(
color: Colors.yellow,
child: Container(height: 50.0,),
),
body: Column(
children: <Widget>[],
),
);
}
}
标签:Container,Icons,floatingActionButton,bottomNavigationBar,child,Flutter 来源: https://www.cnblogs.com/ajanuw/p/10923829.html