TextStyle 的参数
//代码块 importM import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( home: Scaffold( appBar: AppBar(title: const Text("你好Flutter")), body: const MyApp(), ), )); } // 代码块 statelessW class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Center( child: Container( alignment: Alignment.center, height: 200, width: 200, decoration: BoxDecoration( color: Colors.yellow, gradient: const LinearGradient( //LinearGradient 背景线性渐变 RadialGradient径向渐变 colors: [Colors.red, Colors.orange], ), boxShadow: const [ //卡片阴影 BoxShadow( color: Colors.blue, offset: Offset(2.0, 2.0), blurRadius: 10.0, ) ], border: Border.all(color: Colors.black, width: 1)), transform: Matrix4.rotationZ(.2), child: const Text('这是内容', textAlign: TextAlign.left, overflow: TextOverflow.ellipsis, // overflow:TextOverflow.fade , maxLines: 2, textScaleFactor: 1.8, style: TextStyle( fontSize: 16.0, color: Colors.black, // color:Color.fromARGB(a, r, g, b) fontWeight: FontWeight.w800, fontStyle: FontStyle.italic, decoration: TextDecoration.lineThrough, decorationColor: Colors.white, decorationStyle: TextDecorationStyle.dashed, letterSpacing: 5.0)), ), ); } }
标签:const,MyApp,color,Text,Colors,详解,key,组件 From: https://www.cnblogs.com/xbinbin/p/17802490.html