Button【核心控件】

按钮


YmTextButton("RoundedRectangle", textColor:Color(0xFFFFFFFF),onClick:  (){
	print("Button Pressed");
}),

YmTextButton("Stadium", textColor:Color(0xFFFFFFFF), onClick:(){
	print("Button Pressed");
},outlinedBorder: StadiumBorder(),),

YmTextButton("Circle", textColor:Color(0xFFFFFFFF), onClick:(){
	print("Button Pressed");
},outlinedBorder:CircleBorder()),

YmTextButton("RoundedRectangle", textColor:Color(0xFFFFFFFF),onClick: (){
	print("Button Pressed");
},outlinedBorder:RoundedRectangleBorder(borderRadius: BorderRadius.circular(5))),

YmTextButton("BeveledRectangle", textColor:Color(0xFFFFFFFF), onClick:(){
	print("Button Pressed");
},outlinedBorder:BeveledRectangleBorder(borderRadius: BorderRadius.circular(10))),

YmTextButton("Outlined", textColor:Color(0xFF3446F2),onClick: (){
	print("Button Pressed");
},isOutlined: true,borderColor:Color(0xFF3446F2),outlinedBorder:RoundedRectangleBorder(borderRadius: BorderRadius.circular(5))),

YmTextButton("Enable", textColor:Color(0xFFFFFFFF),backgroundColor:_enabled?Color(0xFF3446F2):Color(0xFFa1a3a6),
	pressedBackgroundColor:Color(0xFFa1a3a6),onClick:_enabled?(){
		print("Button Pressed");
		setState(() {
		  _enabled = false;
		});
	}:null,
	outlinedBorder:RoundedRectangleBorder(borderRadius: BorderRadius.circular(5))),

Row(
	children: [
		Padding(
		  padding: EdgeInsets.only(top:0,left: 10,right: 0,bottom: 0),
		  child:YmImageButton("Button",onClick: (){},size:Size(100,42),textColor:Color(0xFF666666),backgroundColor:Color(0xFFFFFFFF),pressedBackgroundColor:Color(0xFFEFEFEF),iconLeft: "assets/images/ic_download.png"),
		),
		Padding(
		  padding: EdgeInsets.only(top:0,left: 10,right: 10,bottom: 0),
		  child:YmImageButton("Button",onClick:(){},size:Size(100,42),textColor:Color(0xFF666666),backgroundColor:Color(0xFFFFFFFF),pressedBackgroundColor:Color(0xFFEFEFEF),iconRight: "assets/images/ic_download.png"),
		),
	]
),

YmImageButton("ImageButton", onClick:(){
	print("Button Pressed");
},textColor:Color(0xFFFFFFFF),size:Size(160,42),backgroundColor:Color(0xFF3446F2),pressedBackgroundColor:Color(0xFF606FFF),iconLeft:"assets/images/ic_download.png"),

YmImageButton("ImageButton", onClick:(){
	print("Button Pressed");
},textColor:Color(0xFFFFFFFF),size:Size(160,42),backgroundColor:Color(0xFF3446F2),pressedBackgroundColor:Color(0xFF606FFF),iconLeft:"assets/images/ic_download.png",outlinedBorder:StadiumBorder()),

YmImageButton("ImageButton", onClick:(){
	print("Button Pressed");
},textColor:Color(0xFFFFFFFF),size:Size(160,42),backgroundColor:Color(0xFF3446F2),pressedBackgroundColor:Color(0xFF606FFF),iconRight:"assets/images/ic_download.png",outlinedBorder:RoundedRectangleBorder(borderRadius: BorderRadius.circular(5))),

YmImageButton("ImageButton", onClick:(){
	print("Button Pressed");
},textColor:Color(0xFF3446F2),size:Size(160,42),isOutlined:true,iconRight:"assets/images/ic_download.png",outlinedBorder:RoundedRectangleBorder(borderRadius: BorderRadius.circular(5))),

YmGradientButton(
	"GradientButton",
	textColor:Color(0xFFFFFFFF),
	onClick: (){
	  print("Button Pressed");
	},
	size: Size(MediaQuery.of(context).size.width - 32, 40),
	fontSize: 14,
	borderColor:Color(0xFF606FFF),
	pressedBackgroundColor: Color(0xFF606FFF),
	gradient: LinearGradient(
		begin: Alignment.topCenter,
		end: Alignment.bottomCenter,
		colors: [Color(0xFF606FFF),Color(0xFF3446F2)]
	),
),




内容来源与作者发布和网络,如有版权相关问题请及时与我们取得联系,我们将立即删除。

关于作者

还如一梦中 点击这里给我发消息

相关推荐

这些你应该也会喜欢

框架介绍【快速开始】

Flutter开发首选控件集,封装移动APP常用控件,并包含完整精美的使用示例。源码和示例已经同步发布到GitHub和PubDev源码下载:https://github.com/ym6745476/y...

2021-07-19 17:46:06 还如一梦中
安装环境【快速开始】

框架源码已经的发布到Pub Dev,所以可以在你项目的yaml文件直接引用:dependencies: ym_flutter_widget: ^1.0.0然后执行flutter pub get 开...

2021-07-20 15:48:09 还如一梦中
Toast【提示组件】

小提示/// 中间位置YmUiUtil.showToast(context,"这是一条Toast");/// 指定位置 YmToast.show("这是一条Toast", context, durat...

2021-07-20 16:49:53 还如一梦中
Dialog【提示组件】

弹出框YmUiUtil.showLoading(context); Future.delayed(Duration(seconds: 3), () { YmUiUtil.hideLoad...

2021-07-20 16:47:35 还如一梦中
网络请求【网络框架】

Get请求YmHttp().postForm(url ,{"参数":"值","参数":"值"} ,success: (data) { print("成功:" + data.toString()...

2021-07-20 16:33:48 还如一梦中
CheckButton【核心控件】

单选按钮,多选按钮Row( children: [ YmCheckButton(value:0, checked:_radioGroupValue1==0, onChanged: (...

2021-07-20 16:27:40 还如一梦中
TabButton【核心控件】

Tab按钮List _tabButtonList = ["全部","待付款","待发货"]; int _tabButtonSelectedIndex = 0; YmTabButton(_tabBut...

2021-07-20 16:21:03 还如一梦中
Button【核心控件】

按钮YmTextButton("RoundedRectangle", textColor:Color(0xFFFFFFFF),onClick: (){ print("Button Pressed"...

2021-07-20 16:16:11 还如一梦中
SearchBar【核心控件】

搜索栏YmSearchBar( hint: "请输入关键词", width: MediaQuery.of(context).size.width - 40, height: 40, onSub...

2021-07-20 15:58:07 还如一梦中
AppBar【核心控件】

导航栏YmAppBar("AppBar自定义", background:[ const Color(0xFF606FFF), const Color(0xFF3446F2), ],onBa...

2021-07-20 15:56:11 还如一梦中
在线客服