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

台州网站制作服务大型网站的技术架构问题

台州网站制作服务,大型网站的技术架构问题,酒类网站建设方案,给个网站好人有好报变态需求 flutter中再满足多行文本,文本内有多个样式,并且多个样式可触发事件的情况,将其中的一部分文本的下划线往下移 方式一: 实现 使用RichText组件,主要是看中里面的WidgetSpan可以穿child为一个widget 实现源…

变态需求 

flutter中再满足多行文本,文本内有多个样式,并且多个样式可触发事件的情况,将其中的一部分文本的下划线往下移

方式一:

 实现

使用RichText组件,主要是看中里面的WidgetSpan可以穿child为一个widget

实现源码

     Expanded(child: RichText(text: TextSpan(children: [TextSpan(text: MmStrings.confirmService,style:MmTextStyles.textRegular.copyWith(fontSize: 12.sp),recognizer: TapGestureRecognizer()..onTap = () {context.read<MmSignUpBloc>().add(SignAgreePrivacyChangeEvent(!state.isAgreePrivacyPolicy,),);},),WidgetSpan(child: InkWell(onTap: () {MmWebUtils.launchWebUrl("${CommonConfig.instance.apiPreConfig.webUrl}${MmStrings.serviceAgreementUrl}",);},child: Stack(clipBehavior: Clip.none,children: [Text(MmStrings.serviceAgreement,style: MmTextStyles.agreementStyle.copyWith(fontSize: 12.sp,decoration: TextDecoration.none,),),Positioned(left: 0,right: 0,bottom: -2,child: Container(height: 1,color: MmColors.colorAgreement,),)],),),),TextSpan(text: MmStrings.andThe,style:MmTextStyles.textRegular.copyWith(fontSize: 12.sp),),WidgetSpan(child: InkWell(onTap: () {MmWebUtils.launchWebUrl("${CommonConfig.instance.apiPreConfig.webUrl}${MmStrings.privacyPolicyUrl}",);},child: Stack(clipBehavior: Clip.none,children: [Text(MmStrings.privacyPolicy,style: MmTextStyles.agreementStyle.copyWith(fontSize: 12.sp,decoration: TextDecoration.none,),),Positioned(left: 0,right: 0,bottom: -2,child: Container(height: 1,color: MmColors.colorAgreement,),)],),),),TextSpan(text: ".",style:MmTextStyles.textRegular.copyWith(fontSize: 12.sp),),],),),),

上面的方式有缺点和限制:如当一行文字换行就GG

但是

方式二:

新思路 使用shadow(具体实现很简单 设置shadow

extension MmTextStyleExtension on TextStyle {TextStyle toShadowStyle({double offset = -4,double thickness = 3,bool hasUnderline = true,}) {return this.copyWith(shadows: [Shadow(color: this.color ?? Colors.black,offset: Offset(0, offset),),],decoration: hasUnderline ? TextDecoration.underline : TextDecoration.none,decorationThickness: thickness,color: Colors.transparent,);}
}

使用

Text.rich(TextSpan(children: [TextSpan(text: "example example example example example example ",style: MmTextStyles.textSemiBold.toShadowStyle(hasUnderline: false),),TextSpan(text: "underline underline underline underline underline underline underline ",style: MmTextStyles.textSemiBoldUnLiner.toShadowStyle(),),],),),

方式三:

下面的方式过于复杂不建议

Flutter-Engine 的定制实践:Text 绘制流程浅析及自定义underline的间距-CSDN博客

http://www.yayakq.cn/news/111470/

相关文章:

  • 普陀建设机械网站平台网站建设公司哪家好
  • 中国建筑股票二十条优化措施原文
  • 网页源代码图片提取宁波网站优化公司电话
  • 静态网站制作视频ps网页设计从零开始教程
  • 商丘网站建设制作网站上做扫一扫
  • 上海网站建设报网页是网站的什么颜色好看
  • 站长工具pingwordpress 发表文章
  • 怎么去掉网站首页尾缀网站建设的步骤过程文库
  • 网站建设英文字体公司网站建设应注意
  • 设计师如何注册个人网站无极电影网手机在线观看
  • 电影网站怎么做要多少钱怎么自己找外贸订单
  • 网站 宕机 优化打开2345网址大全
  • 全国甲级建筑设计院名单南宁seo建站
  • 建网站的费用百度快快速排名
  • 网站素材免费可以转app的网站怎么做
  • 建网站莱阳哪家强?新手学做网站步骤
  • 南通做企业网站帮别人做网站怎么赚钱
  • 做网站采集黑龙江网站建设seo优化
  • 二类电商平台都有哪些佛山百度seo代理
  • 江苏SEO网站建设net网站开发框架
  • 自己怎么建购物网站找到网站后台地址
  • 企业的网站开发费用如何入账数字营销传播
  • 济南网站维护公司ps做图哪个网站好
  • 管理软件网站模板网站开发员一月多少工资
  • 服装网站建设策划书的基本结构百度竞价推广优势
  • 淘宝网站建设的详细策划天河网站建设外包
  • 5g云网站建设网站开发知识版权
  • 上海网站建设开广州建网站哪里比较好
  • 厦门网站快速排名优化求个网站急急急
  • 哪里做公司网站比较好办公用品网站建设市场定位