mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-05-28 11:46:49 +08:00
feat(text demo): ;
This commit is contained in:
33
lib/widgets/elements/Form/Text/RichText/demo.dart
Normal file
33
lib/widgets/elements/Form/Text/RichText/demo.dart
Normal 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)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -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']),
|
||||
],
|
||||
),
|
||||
|
Reference in New Issue
Block a user