---flutter:万物皆控件
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
var name = "world";
@override
Widget build (BuildContext context){
return MaterialApp(
title: "Text widget",
home: Scaffold(
appBar:AppBar(
title:Text("Text widget"),
),
body: Center(
child: Text(
'''Hello, $name! How are you?An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:54236/''',
textAlign:TextAlign.start, // 对齐方式 默认 start,另外有 left, right, end, center
overflow: TextOverflow.ellipsis, // 溢出处理方式 默认 clip(直接剪掉),另外fade(渐变),ellipsis(省略号)
maxLines: 2, // 最大行数
style: TextStyle(
fontSize: 26, // 字体大小
fontWeight: FontWeight.bold, // 字体粗细 默认 normal,另外bold(加粗),其他具体加粗值
// color: Color(0xffff0000), // 字体颜色
color: Color.fromARGB(255, 0, 255, 0),
decoration: TextDecoration.underline, // underline 下划线,lineThrough 中划线,overline 上划线
decorationColor: Color.fromARGB(255, 255, 0, 0),
decorationStyle: TextDecorationStyle.dotted // solid 实线,double 双实线,dashed 虚线,dotted 点线,wavy 波浪线
),
),
),
),
);
}
}
图片.png
网友评论