Skip to content

Commit 043d180

Browse files
committed
feat:增加文档热更功能
1 parent 5ffdc87 commit 043d180

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

lib/components/widgetComp.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,19 @@ class IndexState extends State<Index> {
6262

6363
void init() async {
6464
this._bodyList.length = 0;
65-
if (this.demoChild != null && this.demoChild.length != 0) {
66-
// markdown text
65+
String mdText = await this.getMdFile(this.mdUrl);
66+
print('mdText.length ======================================== ${mdText.length}');
67+
if (mdText.length > 30) {
6768
this
6869
._bodyList
69-
.add(await MarkDownComp.Index(await this.getMdFile(this.mdUrl)));
70+
.add(await MarkDownComp.Index(mdText));
7071
// demo
7172
this.demoChild.forEach((Widget item) {
7273
this._bodyList.add(ExampleComp.Index(child: item));
7374
});
7475
} else {
7576
this._bodyList.add(UpdatingComp.Index());
7677
}
77-
7878
setState(() {
7979
this.loading = false;
8080
});
@@ -138,14 +138,14 @@ class IndexState extends State<Index> {
138138
);
139139
},
140140
),
141-
// IconButton(
142-
// icon: Icon(
143-
// Icons.code,
144-
// ),
145-
// onPressed: () async {
146-
// this.openPage(context);
147-
// },
148-
// ),
141+
IconButton(
142+
icon: Icon(
143+
Icons.code,
144+
),
145+
onPressed: () async {
146+
this.openPage(context);
147+
},
148+
),
149149
IconButton(
150150
icon: Icon(Icons.share),
151151
onPressed: () {

lib/config/index.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'development.dart' as Development;
22
import 'production.dart' as Production;
33

4-
const bool isPro = false;
4+
const bool isPro = true;
55

66
Object env = isPro ? Production.Config() : Development.Config();

0 commit comments

Comments
 (0)