multiline_underline_text.dart import'package:flutter/material.dart';classMultilineUnderlineTextextendsStatelessWidget{finalString text;finalTextStyle?textStyle;finalColor underlineColor;finaldouble underlineThickness;finaldouble?underlinePadding;finalTextAlign textAlign;constMultilineUnderlineText({super.key,required...
(1)、backgroundColor(文本的背景颜色)-- Color 或 Colors 类型 (2)、color(文本颜色)-- Color 或 Colors 类型 (3)、textDecoration(文本修饰)-- TextDecoration 类型,取值如:underline, lineThrough (4)、fontSize(文本大小)-- double 类型 (5)、fontWeight(字体粗细)-- FontWeight 类型 (6)、fontStyle(...
Text('Hello, World!') 回到顶部 二、定制化属性 2.1 文本样式 Text小部件的样式可以通过style属性进行定制: Text('Hello, World!', style: TextStyle( fontSize:24.0, fontWeight: FontWeight.bold, color: Colors.green, ), ) 上述代码将文本设置为大号、加粗的绿色文字。
style: TextStyle( color: Color(0xff3E6CDB), decoration: TextDecoration.underline, ), ),
Text("Text组件的使用",style:TextStyle(// 文字颜色color:Color(0xfff0000),// none 不显示装饰线条,underline 字体下方,overline 字体上方,lineThrough穿过文字decoration:TextDecoration.none,// solid 直线,double 双下划线,dotted 虚线,dashed 点下划线,wavy 波浪线decorationStyle:TextDecorationStyle.solid,// 装...
//中间删除线 TextDecoration.lineThrough //底部下划线TextDecoration.underline //顶部上划线 TextDecoration.overline decoration: TextDecoration.lineThrough, fontSize: 14, color: Colors.grey, ) 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 详细分析说明已录制为视频 可查看下方 ...
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: Text('Custom TextField Underline Color'), ), body: Center( child: Custom...
绘制文本装饰:下划线(TextDecoration.underline)上划线(TextDecoration.overline)删除线(TextDecoration.lineThrough)无(TextDecoration.none) Color decorationColor 绘制文本装饰的颜色。 TextDecorationStyle decorationStyle 绘制文本装饰的样式:画一条虚线 TextDecorationStyle.dashed画一条虚线 TextDecorationStyle.dotted画两条...
return TextStyle( textBaseline: TextBaseline.alphabetic, ///设置文字的颜色 color: Colors.deepPurple, ///设置文字的大小 fontSize: 16.0, ///用设置 Text 的线 /// TextDecoration.none 没有 /// TextDecoration.underline 下划线 /// TextDecoration.overline 上划线 ...
Text('Hello, Flutter!',style: TextStyle(fontSize: 24,fontWeight: FontWeight.bold,fontStyle: FontStyle.italic,color: Colors.blue,decoration: TextDecoration.underline,decorationColor: Colors.red,decorationStyle: TextDecorationStyle.dotted,),)