diff --git a/example/lib/main.dart b/example/lib/main.dart index 7859b7a..a5f8de5 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -13,7 +13,7 @@ class MyApp extends StatelessWidget { return MaterialApp( title: 'Example', theme: ThemeData( - primarySwatch: Colors.blue, + primarySwatch: Colors.blue ), home: SafeArea( child: Scaffold( diff --git a/lib/widgets/filterable_list.dart b/lib/widgets/filterable_list.dart index 3546826..84a72ef 100644 --- a/lib/widgets/filterable_list.dart +++ b/lib/widgets/filterable_list.dart @@ -50,10 +50,15 @@ class FilterableList extends StatelessWidget { @override Widget build(BuildContext context) { + final ThemeData theme = Theme.of(context); + final ScaffoldState? scaffold = Scaffold.maybeOf(context); + + Color _suggestionBackgroundColor = suggestionBackgroundColor ?? scaffold?.widget.backgroundColor ?? theme.scaffoldBackgroundColor; + return Material( elevation: 5, borderRadius: BorderRadius.circular(5), - color: suggestionBackgroundColor ?? Colors.white, + color: _suggestionBackgroundColor, child: Container( constraints: BoxConstraints( maxHeight: maxListHeight