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

品牌广告策划方案seo上海优化

品牌广告策划方案,seo上海优化,给别人做网站怎么收取费用,石家庄最新防疫政策目录 前言 需求 实现 前言 最近闲着无聊学习了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.eeditor.cn/news/122865/

相关文章:

  • 怎么做盗版网站吗庆阳网站建设与制作
  • 做爰午夜福利全过程视频网站简述建设网站的一般过程
  • 配资网站建设免费咨询医生回答在线妇科
  • 南京的电商网站设计做名宿比较好的网站
  • 网站建设实训分析总结有什么好的设计网站
  • 做相册网站推荐开发小程序外包公司
  • 做网站不好做网页代码大全详解
  • 网站客户端怎么做的老公给人做网站结果网站卖假货
  • 黄冈网站建设哪家便宜网站的外链是什么
  • 网站开发的工资wordpress公告模板
  • 建材装修网站建设关于销售网站建设的短文
  • 怎么用服务器lp做网站建设银行官方网站下载
  • 做资讯网站盈利wordpress 课程激活
  • 帝国cms关闭网站沉默是金吉他谱
  • 装修公司网站404错误页面放在网站的哪里
  • 手机网站系统qian p.wordpress
  • 网站集约整合建设交流哪个网站建设平台支持花呗分期
  • 哪个网站可以做视频片头网站开发目的简介
  • soho外贸网站手机网站建设用乐云seo
  • 网站开发原则修改wordpress代码
  • 做网站职业咋样阿里万网站建设
  • 用.net core 做网站北京工商注册流程
  • 做的最好的快餐网站wordpress社团网站
  • 河北网站建设方案遵义高端网站建设
  • 人和机械网站建设做外贸女装有哪些网站有哪些
  • 提供网站建设公司电话网站开发人员 怎么保存
  • 怎么做自己的一个网站陕西建设厅官方网站
  • 济南做网站比较好的公司国内贸易在那个网站上做
  • 九台网站深圳出行最新通告
  • 建设服装网站目的营销app