Flutter之交互类型组件FloatingActionButton

FloatingActionButton buildFloatingActionButton(){
  return FloatingActionButton(
    onPressed: _incrementCounter,
      tooltip: 'Increment',
      child: Icon(Icons.add),
    foregroundColor: Colors.red,//图标颜色
    backgroundColor: Colors.yellow,
    focusColor:Colors.tealAccent,//有焦点的输入按钮的颜色
    hoverColor: Colors.white,
    splashColor: Colors.red,
    heroTag:null, //hero动画
    elevation: 10.0,//z轴阴影大小,默认6

  );
}
FloatingActionButton buildFloatingActionButtonExtended(){
  return FloatingActionButton.extended(
    onPressed: _incrementCounter,
    tooltip: 'Increment',

    icon: Icon(Icons.done),
    label: new Text('恭喜你完成'),
    foregroundColor: Colors.red,//图标颜色
    backgroundColor: Colors.yellow,
    focusColor:Colors.tealAccent,//有焦点的输入按钮的颜色
    hoverColor: Colors.white,
    splashColor: Colors.red,
    heroTag:null, //hero动画
    elevation: 10.0,//z轴阴影大小,默认6

  );
}
发布了368 篇原创文章 · 获赞 22 · 访问量 20万+

猜你喜欢

转载自blog.csdn.net/BianHuanShiZhe/article/details/104764952