Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
changing background color conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
4inka committed Jan 7, 2022
1 parent a030601 commit d563aca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class MyApp extends StatelessWidget {
return MaterialApp(
title: 'Example',
theme: ThemeData(
primarySwatch: Colors.blue,
primarySwatch: Colors.blue
),
home: SafeArea(
child: Scaffold(
Expand Down
7 changes: 6 additions & 1 deletion lib/widgets/filterable_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d563aca

Please sign in to comment.