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)),
],
),
)
],
)
),
);
}
}