Skip to content

Commit 0d9eae8

Browse files
committed
docs(article): add article example
1 parent 7e5ac9b commit 0d9eae8

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To use this plugin, add `flutter_weui` as a [dependency in your pubspec.yaml fil
1414

1515
- [`Button`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/button_example.dart)
1616
- [`ActionSheet`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/action_sheet_example.dart)
17-
- [`Article`]()
17+
- [`Article`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/article_example.dart)
1818
- [`Cell`]()
1919
- [`Dialog`]()
2020
- [`Footer`]()

README_zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
- [`Button`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/button_example.dart)
1616
- [`ActionSheet`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/action_sheet_example.dart)
17-
- [`Article`]()
17+
- [`Article`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/article_example.dart)
1818
- [`Cell`]()
1919
- [`Dialog`]()
2020
- [`Footer`]()

example/lib/article_example.dart

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_weui/flutter_weui.dart';
3+
class ArticleExample extends StatelessWidget {
4+
@override
5+
Widget build(BuildContext context) {
6+
return Scaffold(
7+
appBar: AppBar(title: Text("Article"),),
8+
body: Container(
9+
child: Article(
10+
children: <Widget>[
11+
H1(
12+
text: "大标题",
13+
),
14+
Section(
15+
children: <Widget>[
16+
H2(text: "章标题"),
17+
Section(
18+
children: <Widget>[
19+
H3(
20+
text: "节标题",
21+
),
22+
P(
23+
text:
24+
'''Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmodtempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo''',
25+
)
26+
],
27+
)
28+
],
29+
)
30+
],
31+
),
32+
),
33+
);
34+
}
35+
}

0 commit comments

Comments
 (0)