diff --git a/lib/util/widget_factory.dart b/lib/util/widget_factory.dart index efe3cd0..9820b11 100644 --- a/lib/util/widget_factory.dart +++ b/lib/util/widget_factory.dart @@ -37,7 +37,7 @@ class WidgetFactory { creater = widgetCreaters[name]; List result = []; // if (type == WidgetType.normal) - result = creater.createWidgets(model); + result = creater.createWidgets(model); // else // result = creater.createSkeleton(model); if (isSliver) { @@ -50,21 +50,29 @@ class WidgetFactory { } } else { if (creater.isSliverChild()) { - return _createEmpty(); + return _createEmpty(isSliver); } else { return result; } } } - return _createEmpty(); + return _createEmpty(isSliver); } - static List _createEmpty() { + static List _createEmpty(bool isSliver) { const bool inProduction = const bool.fromEnvironment("dart.vm.product"); if (!inProduction) { - return []; + return isSliver + ? [ + SliverToBoxAdapter( + child: Container(), + ) + ] + : []; } else { - return [EmptyPage()]; + return isSliver + ? [SliverToBoxAdapter(child: EmptyPage())] + : [EmptyPage()]; } }