feat(text demo): ;

This commit is contained in:
sanfan.hx
2019-01-14 22:58:36 +08:00
parent 5c4d1a2938
commit bd2253ee7a
2 changed files with 35 additions and 15 deletions

View File

@ -0,0 +1,33 @@
/**
* Created with Android Studio.
* User: 三帆
* Date: 14/01/2019
* Time: 19:02
* email: sanfan.hx@alibaba-inc.com
* tartget: xxx
*/
import 'package:flutter/material.dart';
class Demo extends StatefulWidget {
_Demo createState() => _Demo();
}
class _Demo extends State<Demo> {
Widget build(BuildContext context) {
return Container(
color: Color(0xff000000),
width: 750.0,
child: RichText(
text: TextSpan(
text: 'Hello ',
children: <TextSpan>[
TextSpan(text: 'bold', style: TextStyle(fontWeight: FontWeight.bold, color: Color(0xfffffc42))),
TextSpan(text: ' world!', style: TextStyle(fontStyle: FontStyle.italic)),
],
),
),
);
}
}

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import '../../../../../common/widget_demo.dart';
import 'demo.dart';
const String intro = """
# 富文本显示
@ -70,20 +70,7 @@ class _Demo extends State<Demo> {
contentList: [new Column(
children: <Widget>[
MarkdownBody(data: markDesc['intro']),
Container(
color: Color(0xff000000),
width: 750.0,
child: RichText(
text: TextSpan(
text: 'Hello ',
// style: TextStyle(fontWeight: FontWeight.normal, inherit: true, fontSize: 44),
children: <TextSpan>[
TextSpan(text: 'bold', style: TextStyle(fontWeight: FontWeight.bold, color: Color(0xfffffc42))),
TextSpan(text: ' world!', style: TextStyle(fontStyle: FontStyle.italic)),
],
),
),
),
Demo(),
MarkdownBody(data: markDesc['diff']),
],
),