FilledButton( style: FilledButton.styleFrom( shape: const ContinuousRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(20)) ), ), // other arguments ) Output: Below is the list of named parameters you can pass to FilledButton.styleFrom static method. Color? foregroundColor: Foregrou...
// 2.圆角按钮Container(margin:EdgeInsets.only(left:10),height:40,width:80,child:RaisedButton(color:Colors.blue,textColor:Colors.white,onPressed:(){},child:Text("圆角"),shape:RoundedRectangleBorder(borderRadius:BorderRadius.circular(10),),),), // 3.带阴影RaisedButton(onPressed:(){},child:T...
pressedOpacity = 0.4:点击是按钮透明的 borderRadius = const BorderRadius.all(Radius.circular(8.0)):圆角 onPressed:点击事件 3.CupertinoButton、CupertinoButton.filled 1601964982(1).png ··· class _CupertinoButtonPageState extends State<CupertinoButtonPage> { _myCupertinoButton() { return CupertinoButton( c...
圆角按钮 ElevatedButton(style:ButtonStyle(backgroundColor:MaterialStateProperty.all(Colors.blue),foregroundColor:MaterialStateProperty.all(Colors.white),elevation:MaterialStateProperty.all(20),shape:MaterialStateProperty.all(RoundedRectangleBorder(borderRadius:BorderRadius.circular(10))),),onPressed:(){print(...
ButtonStyle 里面的常用的参数 foregroundColor文本颜色 backgroundColor按钮的颜色 shadowColor阴影颜色 elevation阴影的范围,值越大阴影范围越大 padding内边距 shape设置按钮的形状 shape: MaterialStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(10)) ) ...
OutlinedButton.icon( onPressed: () {}, icon: Icon(Icons.access_time_filled_sharp), label: Text("增加")) ]); } } 修改按钮的宽度高度 classMyApp5extendsStatelessWidget {constMyApp5({super.key}); @override Widget build(BuildContext context) {returnSizedBox( ...
borderRadius: BorderRadius.circular(4.0), border: Border.all( width: 1.0 / MediaQuery.of(context).devicePixelRatio, color: Colors.grey.withOpacity(0.5)), ), alignment: Alignment.center, //color: Colors.red, child: Text('item ${index}'), ...
(controller:TextEditingController(),decoration:InputDecoration(contentPadding:constEdgeInsets.symmetric(horizontal:15.0),hintText:'创建订单名称',hintStyle:TextStyle(fontSize:14.0),border:OutlineInputBorder(borderRadius:BorderRadius.circular(10.0),borderSide:BorderSide.none),filled:true,fillColor:Color(0xFF...
borderRadius: BorderRadius.all(Radius.circular(20.0)), image: DecorationImage( image: AssetImage("images/avatar.png"), centerSlice: Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0) ), ), padding: EdgeInsets.all(8.0), alignment: Alignment.center, ...
默认高度bottomSheet是screenSize的一半