Browse Source

修复首页显示空白问题

tags/0.0.1
Weller 4 years ago
parent
commit
54d865297e
1 changed files with 4 additions and 9 deletions
  1. +4
    -9
      lib/util/widget_factory.dart

+ 4
- 9
lib/util/widget_factory.dart View File

@@ -50,30 +50,25 @@ class WidgetFactory {
} }
} else { } else {
if (creater.isSliverChild()) { if (creater.isSliverChild()) {
return _createEmpty(isSliver);
return _createEmpty(false);
} else { } else {
return result; return result;
} }
} }
} else {
print('${name} 未注册');
} }
return _createEmpty(isSliver); return _createEmpty(isSliver);
} }


static List<Widget> _createEmpty(bool isSliver) { static List<Widget> _createEmpty(bool isSliver) {
const bool inProduction = const bool.fromEnvironment("dart.vm.product");
if (!inProduction) {
return isSliver return isSliver
? [ ? [
SliverToBoxAdapter( SliverToBoxAdapter(
child: Container(),
child: Container(height: 0),
) )
] ]
: []; : [];
} else {
return isSliver
? [SliverToBoxAdapter(child: EmptyPage())]
: [EmptyPage()];
}
} }


/** /**


Loading…
Cancel
Save