Просмотр исходного кода

fix: ProviderNotFound exception in overlay demo example

sky1095 2 лет назад
Родитель
Сommit
fecc1ec31b

+ 15 - 13
frontend/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/list_overlay.dart

@@ -41,20 +41,22 @@ class ListOverlay extends StatelessWidget {
     return OverlayContainer(
       constraints: BoxConstraints.tight(Size(width, totalHeight)),
       padding: padding,
-      child: Column(
-        children: [
-          ListView.builder(
-            shrinkWrap: true,
-            itemBuilder: itemBuilder,
-            itemCount: itemCount,
-            controller: controller,
-          ),
-          if (footer != null)
-            Padding(
-              padding: footer!.padding,
-              child: footer!.widget,
+      child: SingleChildScrollView(
+        child: Column(
+          children: [
+            ListView.builder(
+              shrinkWrap: true,
+              itemBuilder: itemBuilder,
+              itemCount: itemCount,
+              controller: controller,
             ),
-        ],
+            if (footer != null)
+              Padding(
+                padding: footer!.padding,
+                child: footer!.widget,
+              ),
+          ],
+        ),
       ),
     );
   }

+ 1 - 1
frontend/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/overlay_container.dart

@@ -18,7 +18,7 @@ class OverlayContainer extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
-    final theme = context.watch<AppTheme>();
+    final theme = context.watch<AppTheme?>() ?? AppTheme.fromType(ThemeType.light);
     return Material(
       type: MaterialType.transparency,
       child: Container(