Flutter学习笔记-Text对其方式和自动换行

Flutter学习笔记-Text对其方式和自动换行,第1张

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 WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello World",
            style: TextStyle
            (
              color: Colors.green,
              fontSize: 30,
              fontWeight: FontWeight.w500
            ),
            textAlign: TextAlign.end,
            softWrap: true,
          ),
        ),
      ),
    );
  }
}

 

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/997077.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存