其他分享
首页 > 其他分享> > Flutter: floatingActionButton

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