Notice: 函数 WP_Scripts::localize 的调用方法不正确$l10n 参数必须是一个数组。若要将任意数据传递给脚本,请改用 wp_add_inline_script() 函数。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 5.7.0 版本添加的。) in /data/www/appblog/wp-includes/functions.php on line 6131

Flutter Widget之Text

Widget:https://flutter.io/docs/development/ui/widgets
Text:https://docs.flutter.io/flutter/widgets/Text-class.html

import 'package:flutter/material.dart';

class TextDemoPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => new _TextDemoPageState();
}

class _TextDemoPageState extends State<TextDemoPage> {
  String _name = 'Joe.Ye';

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(title: new Text('Text Page Demo'),),
      body: Center(
        child: Column(
          children: <Widget>[
            Text(
              'Hello, $_name! How are you?',
              textAlign: TextAlign.center,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(fontWeight: FontWeight.bold),
            ),
            const Text.rich(
              TextSpan(
                text: 'Hello', // default text style
                children: <TextSpan>[
                  TextSpan(text: ' beautiful ', style: TextStyle(fontStyle: FontStyle.italic)),
                  TextSpan(text: 'world', style: TextStyle(fontWeight: FontWeight.bold)),
                ],
              ),
            )
          ],
        )
      ),
    );
  }
}
上一篇 Flutter Widget之Column
下一篇 Flutter Widget之Image