当前位置: 首页 > 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.wangmingla.cn/news/114231.html

相关文章:

  • 网站维护的工作内容怎么做网站关键词优化
  • 做自媒体的网站百度搜索推广是什么
  • 专业杭州网站建设青岛seo计费
  • 深圳建网站多少钱一年业务推广平台
  • 极速网站建设定制网络广告有哪些形式
  • 汕头公司做网站南京做网站的公司
  • 网站在哪里建立百度开放平台登录
  • 手机版网站制作模板aso优化师主要是干嘛的
  • 个人主页网站设计论文seo案例分析方案
  • 网站建设服务领域网络推广计划书
  • 东莞网站建站模板鹤壁网站seo
  • 南通网站定制企业电商seo是什么
  • app 快速开发平台seo发展前景怎么样啊
  • 网站哪里可以查到做ddos分享推广
  • 东莞官方网站高端网站建设公司排行
  • 安徽做网站的公司有哪些东莞网站定制开发
  • 深圳市甘泉建设监理有限公司网站宁波营销型网站建设优化建站
  • app小程序开发费用优化师的工作内容
  • 微网站开发价格企业网站有哪些平台
  • 网站快速备案价格广告联盟平台排名
  • 网站开发轮播图西安百度公司官网
  • 云南文山网站建设制作百度400电话
  • qq网页版登录官网登录入口网站seo排名优化工具
  • 沅江网站设计公司电子营销主要做什么
  • 佛山新网站制作seo网站推广排名
  • 福清建设局网站简介宁波seo软件
  • 官网设计制作什么是seo推广
  • 中纪委网站两学一做征文西安网红
  • wordpress 少数派百度排名优化专家
  • 广州网站优化哪里有深圳百度公司地址在哪里