【问题标题】:Flutter: TextButton UnderlineFlutter:TextButton 下划线
【发布时间】:2021-06-21 15:57:52
【问题描述】:

我有一个DrawerTextButton.icon。类似的东西

但我需要下划线从 h 开始并在抽屉结束时结束

(对不起图片)(“i”是图标的符号)

【问题讨论】:

    标签: drawer


    【解决方案1】:
     - 
    
    
    ----------
    
    
     
    
            Text('hello',
         style: textStyle.copyWith( 
        decoration: TextDecoration.underline,
        color: Colors.black)),            
    
    if we need underline only below the text we can provide text style decoration as 
    decoration : TextDecoration.underline; 
    If we need this text view  as button then just wrap this text widget with -InkWell or -TextButton or -GestureDetector.
    
     
    
        InkWell(  
        onTap: () {
         print('undelined text button');
         },
         child: Text('hello',
                      style: headingStyle.copyWith(
                           decoration: TextDecoration.underline,
                           color: Colors.black))),
                      
    

    【讨论】:

    • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 2013-08-22
    • 2012-12-21
    • 2012-04-26
    • 2021-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-09
    • 2012-12-17
    相关资源
    最近更新 更多