Skip to content

Commit b802ca7

Browse files
committed
fix(headers list): some colorscheme fixes
1 parent 79b9c31 commit b802ca7

File tree

1 file changed

+12
-32
lines changed

1 file changed

+12
-32
lines changed

lib/widgets/headerfield.dart

Lines changed: 12 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -65,35 +65,13 @@ class _HeaderFieldState extends State<HeaderField> {
6565
itemBuilder: (context, String suggestion) {
6666
return ListTile(
6767
dense: true,
68-
title: Text(
69-
suggestion,
70-
style: TextStyle(color: colorScheme.inverseSurface),
71-
),
68+
title: Text(suggestion),
7269
);
7370
},
7471
suggestionsCallback: headerSuggestionCallback,
7572
decorationBuilder: (context, child) =>
7673
suggestionBoxDecorations(context, child, colorScheme),
7774
constraints: const BoxConstraints(maxHeight: 400),
78-
listBuilder: (context, children) => Theme(
79-
data: ThemeData(
80-
scrollbarTheme: ScrollbarThemeData(
81-
thumbColor: MaterialStateProperty.all(colorScheme.inverseSurface),
82-
trackColor: MaterialStateProperty.all(
83-
colorScheme.inverseSurface.withOpacity(0.3)),
84-
),
85-
),
86-
child: ListView.builder(
87-
shrinkWrap: true,
88-
itemCount: children.length,
89-
itemBuilder: (context, index) {
90-
return Container(
91-
margin: const EdgeInsets.all(8),
92-
child: children[index],
93-
);
94-
},
95-
),
96-
),
9775
builder: (context, controller, focusNode) => TextField(
9876
onChanged: widget.onChanged,
9977
controller: controller,
@@ -120,17 +98,19 @@ class _HeaderFieldState extends State<HeaderField> {
12098
);
12199
}
122100

123-
Material suggestionBoxDecorations(
101+
Theme suggestionBoxDecorations(
124102
BuildContext context, Widget child, ColorScheme colorScheme) {
125-
return Material(
126-
elevation: 4,
127-
color: colorScheme.surface,
128-
shape: RoundedRectangleBorder(
129-
side: BorderSide(color: Theme.of(context).dividerColor, width: 1.2),
130-
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(8)),
103+
return Theme(
104+
data: ThemeData(colorScheme: colorScheme),
105+
child: Material(
106+
elevation: 4,
107+
shape: RoundedRectangleBorder(
108+
side: BorderSide(color: Theme.of(context).dividerColor, width: 1.2),
109+
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(8)),
110+
),
111+
clipBehavior: Clip.hardEdge,
112+
child: child,
131113
),
132-
clipBehavior: Clip.hardEdge,
133-
child: child,
134114
);
135115
}
136116

0 commit comments

Comments
 (0)