Skip to content

Commit 11515a9

Browse files
committed
fix: colors not changing in headers suggestion list
1 parent d22608a commit 11515a9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/widgets/headerfield.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class _HeaderFieldState extends State<HeaderField> {
5454
var colorScheme = widget.colorScheme ?? Theme.of(context).colorScheme;
5555
return TypeAheadField(
5656
key: Key(widget.keyId),
57-
hideOnEmpty: false,
57+
hideOnEmpty: true,
5858
controller: controller,
5959
onSelected: (value) {
6060
setState(() {
@@ -65,11 +65,15 @@ class _HeaderFieldState extends State<HeaderField> {
6565
itemBuilder: (context, String suggestion) {
6666
return ListTile(
6767
dense: true,
68-
title: Text(suggestion),
68+
title: Text(
69+
suggestion,
70+
style: TextStyle(color: colorScheme.inverseSurface),
71+
),
6972
);
7073
},
7174
suggestionsCallback: headerSuggestionCallback,
72-
decorationBuilder: suggestionBoxDecorations,
75+
decorationBuilder: (context, child) =>
76+
suggestionBoxDecorations(context, child, colorScheme),
7377
constraints: const BoxConstraints(maxHeight: 400),
7478
builder: (context, controller, focusNode) => TextField(
7579
onChanged: widget.onChanged,
@@ -97,9 +101,11 @@ class _HeaderFieldState extends State<HeaderField> {
97101
);
98102
}
99103

100-
Material suggestionBoxDecorations(BuildContext context, Widget child) {
104+
Material suggestionBoxDecorations(
105+
BuildContext context, Widget child, ColorScheme colorScheme) {
101106
return Material(
102107
elevation: 4,
108+
color: colorScheme.surface,
103109
shape: RoundedRectangleBorder(
104110
side: BorderSide(color: Theme.of(context).dividerColor, width: 1.2),
105111
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(8)),

0 commit comments

Comments
 (0)