当前位置: 首页 > news >正文

桐乡建设局网站微信公众号优惠和网站绑定怎么做

桐乡建设局网站,微信公众号优惠和网站绑定怎么做,动画设计师工资一般多少,驻马店网站建设公司目录 前言 需求 实现 前言 最近闲着无聊学习了flutter的一下知识#xff0c;发现flutter和安卓之间#xff0c;页面开发的方式还是有较大的差异的#xff0c;众所周知#xff0c;android的页面开发都是写在xml文件中的#xff0c;而flutter直接写在代码里#xff08;da…目录 前言 需求 实现 前言 最近闲着无聊学习了flutter的一下知识发现flutter和安卓之间页面开发的方式还是有较大的差异的众所周知android的页面开发都是写在xml文件中的而flutter直接写在代码里dart文件中从目前我的认识来看两者在UI上的“套娃”方式flutter更能套简直就是“套中套”啊哈哈。比如今天的手写一个最简单的自定义按钮吧效果如下图所示 需求 带文本的普通按钮可修改字体大小和字体颜色提供修改背景色按下后的背景色支持支持圆角和边框提供点击事件的回调 这几个需求还是毕竟常用的目前没考虑渐变色和图标具体需求具体改吧 实现 本次demo的代码本身属于练手相当于flutter的hello world(毕竟我才刚了解flutter没几天。 以下是具体的代码实现 import package:flutter/material.dart;class CustomTextButton extends StatefulWidget {//按钮的宽度final double? width;//按钮的长度final double? height;final String text;final double? textSize;final Color textColor;final Color backgroundColor;final Color pressedBackgroundColor;final VoidCallback onClick;final double borderRadius;final Color borderColor;const CustomTextButton({super.key,required this.onClick,required this.text,this.textSize 16,this.width double.infinity,required this.height,this.backgroundColor Colors.white,this.pressedBackgroundColor Colors.white,this.borderRadius 0.0,this.borderColor Colors.white,this.textColor Colors.black});overrideStateCustomTextButton createState() _CustomTextButtonState(); }class _CustomTextButtonState extends StateCustomTextButton {bool _isPressed false;overrideWidget build(BuildContext context) {return ConstrainedBox(constraints:BoxConstraints.expand(width: widget.width, height: widget.height),child: GestureDetector(onTap: () {widget.onClick();},onTapDown: (details) {setState(() {_isPressed true;});},onTapUp: (details) {setState(() {_isPressed false;});},child: Container(alignment: Alignment.center,decoration: BoxDecoration(color: _isPressed? widget.pressedBackgroundColor: widget.backgroundColor,borderRadius: BorderRadius.circular(widget.borderRadius),border: Border.fromBorderSide(BorderSide(width: 1, color: widget.borderColor))),child: Text(widget.text,maxLines: 1,overflow: TextOverflow.ellipsis,style: TextStyle(color: widget.textColor,fontSize: widget.textSize,fontStyle: FontStyle.normal,),),),),);} }extension HexColor on Color {/// String is in the format aabbcc or ffaabbcc with an optional leading #.static Color fromHex(String hexString) {final buffer StringBuffer();if (hexString.length 6 || hexString.length 7) buffer.write(ff);buffer.write(hexString.replaceFirst(#, ));return Color(int.parse(buffer.toString(), radix: 16));}}代码演示如何使用这个还是非常简单易懂的有什么需要改进的地方也请大佬指示改进。 Container(margin: const EdgeInsets.only(left: 20, right: 20),child: CustomTextButton(text: 注册,textSize: 18,textColor: Colors.white,backgroundColor: HexColor.fromHex(F9AC00),pressedBackgroundColor: HexColor.fromHex(E0CE32),height: 44,borderRadius: 30,onClick: () {Fluttertoast.showToast(msg: 您按了注册,toastLength: Toast.LENGTH_SHORT,gravity: ToastGravity.BOTTOM,timeInSecForIosWeb: 1,backgroundColor: Colors.black12,textColor: Colors.black,fontSize: 14.0);},),),
http://www.zqtcl.cn/news/26200/

相关文章:

  • 南宁seo外包服务南宁快速优化排名
  • 主机屋怎么做网站做网站怎样实现网上支付
  • 贵阳网站建设外包东莞网站推广渠道
  • 厦门优秀的网站设计德州百度推广公司
  • wordpress spam郑州网站seo公司
  • 网址的英文企业网站优化设计的含义
  • 网站推广包含哪些方法wordpress 大前端2.0
  • 中国建设网官方网站企业网银网站功能详细设计
  • 百度关键字怎么搜到公司网站内蒙古工程建设网站
  • 做网站不带优化的吗网站建设费计入销售费用的子目
  • 施工员证怎么查询网站百度做网站好吗
  • 上海网站建设 网站开发wordpress 主题 更新
  • 网站建设的毕业设计成果微信跳转链接生成器免费
  • 东营二手房出售信息网关键词排名优化品牌
  • 建设科技信息 网站建设c 手机网站开发工具
  • 洛阳做网站那家好怎么免费创造自己的网址
  • 北京做网站建设多少钱菏泽网架公司
  • 网站制作教程步骤公司要建立网站要怎么做
  • 温州阀门外贸网站建设教程网站建设
  • 小学学校网站上海建筑工程公司排行榜
  • 有限公司网站入口企业做网站电话约见客户的对话
  • 娄底网站优化成都成达设计院
  • 京东网站建设流程网站网页优化技巧
  • 做网站需要提供的资料东道设计公司官网首页
  • 网站如何制作做吸引客户软文推荐
  • 网站的安全怎么做网站的策划建设方案书
  • 学习怎样建网站阿里巴巴国际站怎么做网站模版
  • 广州网站推广找谁wordpress一直刷不出来
  • 网页制作流程视频360排名优化工具
  • 做一个门户网站要多少钱建站平台选择建议