fix: ProviderNotFound exception in overlay demo example

This commit is contained in:
sky1095
2022-07-31 13:36:52 +05:30
parent fde2538466
commit fecc1ec31b
2 changed files with 16 additions and 14 deletions

View File

@ -41,6 +41,7 @@ class ListOverlay extends StatelessWidget {
return OverlayContainer( return OverlayContainer(
constraints: BoxConstraints.tight(Size(width, totalHeight)), constraints: BoxConstraints.tight(Size(width, totalHeight)),
padding: padding, padding: padding,
child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
ListView.builder( ListView.builder(
@ -56,6 +57,7 @@ class ListOverlay extends StatelessWidget {
), ),
], ],
), ),
),
); );
} }

View File

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