Skip to content

Commit 8b85cd1

Browse files
committed
fix:增加判断
1 parent 043d180 commit 8b85cd1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/components/widgetComp.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,16 @@ class IndexState extends State<Index> {
6363
void init() async {
6464
this._bodyList.length = 0;
6565
String mdText = await this.getMdFile(this.mdUrl);
66-
print('mdText.length ======================================== ${mdText.length}');
6766
if (mdText.length > 30) {
6867
this
6968
._bodyList
7069
.add(await MarkDownComp.Index(mdText));
7170
// demo
72-
this.demoChild.forEach((Widget item) {
73-
this._bodyList.add(ExampleComp.Index(child: item));
74-
});
71+
if (this.demoChild != null && this.demoChild.length > 0) {
72+
this.demoChild.forEach((Widget item) {
73+
this._bodyList.add(ExampleComp.Index(child: item));
74+
});
75+
}
7576
} else {
7677
this._bodyList.add(UpdatingComp.Index());
7778
}

0 commit comments

Comments
 (0)