Merge pull request #744 from sky1095/fix/overlay-demo-example

fix: ProviderNotFound exception in overlay demo example
This commit is contained in:
Nathan.fooo 2022-07-31 17:35:18 +08:00 committed by GitHub
commit 44d9b8ab26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 14 deletions

View File

@ -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,
),
],
),
),
);
}

View File

@ -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(