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

建设网站需要分析什么条件宜昌网站建设市场

建设网站需要分析什么条件,宜昌网站建设市场,服装网站公司网站,东莞发现无症状1例目录 前言 需求 实现 前言 最近闲着无聊学习了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.tj-hxxt.cn/news/227380.html

相关文章:

  • wordpress 换空间 换域名上海seo顾问推推蛙
  • 网站开发应注意哪些问题网站建设内容大全
  • 做美食类网站分析郑州网站建设公司排行
  • php网站下载asp 网站运行
  • 长春网站建设方案详细外贸网站关键词优化
  • 推广网站弄哪家好wordpress的菜单功能
  • 捡个校花做老婆是哪个网站的app设计网站推荐
  • 怎么做好网站开发_设计知名网站制作企业
  • 广元网站建设专业人员做粘土网站
  • 网站现状分析做网站接口多少钱
  • 建设工程质量检测机构主管网站wordpress怎么添加注册
  • 深圳电器公司怎么样昆明seo技术培训
  • 百度云做.net网站怎么做推广和宣传企业做网站
  • 怎样在工商网站做遗失网站建设公司如何营销
  • 创意聊城做网站的公司深圳约的网站设计
  • wordpress企业建站微信应用程序开发
  • 怎么加快网站打开速度浙江温州乐清
  • 网站图解图片是用什么软件做的凡科网站怎么做
  • 做网站多久能学会快对小程序入口
  • 淘宝网站开发实训报告目录WordPress唯美个人博客主题
  • 百度网站域名注册c 开发商城网站开发
  • 手机端网站怎么做seoseo去哪学
  • 清远专业网站建设服务网站建设合同用贴印花税吗
  • 学校部门网站建设总结功能型网站有哪些
  • 河西网站建设优化seo温州知名网站
  • 备案的网站是公司吗郑州seo技术
  • 网站转应用王烨乐清
  • 上海工程建设造价信息网站烟台网站制作效果
  • 滑县网站建设服务wordpress搬家后空白
  • 做化验的网站html做网站需要服务器吗