void main ()=>runApp(myApp());
class myApp extends StatelessWidget{
@override
Widget build(BuildContext context){
return MaterialApp(
title:'啦啦啦,fluterApp上线了',
home:Scaffold(
appBar:AppBar(
title:Text('古诗词'),
),
body:Center(
child: Text(
'一院丁香雪',//文字信息
maxLines:1, //显示行数
overflow: TextOverflow.ellipsis, //文字溢出处理 clip:超出一行切除,ellipsis:超出一行省略号代替,fade:从上到下颜色渐渐变淡
textAlign: TextAlign.center,//对齐方式
style:TextStyle(//对字体样式编辑
fontSize: 25.0,
color:Color.fromARGB(255, 255, 100, 100),
decoration: TextDecoration.underline,//添加下划线
decorationStyle: TextDecorationStyle.dashed//下划线类型
)
),
),
),
);
}
}
flutter Text组件
最新推荐文章于 2024-06-06 10:55:58 发布