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
);
}
Flutter之交互类型组件FloatingActionButton
最新推荐文章于 2024-03-27 07:26:36 发布