当前位置: 首页 > 工具软件 > TeXt Theme > 使用案例 >

Flutter学习笔记-设置Text的字体的大小和粗细。

史意致
2023-12-01
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget 
{
  Widget build(BuildContext context) 
  {
    return MaterialApp
    (
      title: 'flutter Demo',
      theme: ThemeData
      (
        primarySwatch: Colors.green,
      ),
      home: Scaffold
      (
        body: Center
        (
          child: Text
          (
            "Hello World",
            style: TextStyle
            (
              color: Colors.green,
              fontSize: 30,
              fontWeight: FontWeight.w500
            ),
          ),
        ),
      ),
    );
  }
}

fontWeight: FontWeight.w100 ~ w900

 类似资料: