@@ -65,35 +65,13 @@ class _HeaderFieldState extends State<HeaderField> {
65
65
itemBuilder: (context, String suggestion) {
66
66
return ListTile (
67
67
dense: true ,
68
- title: Text (
69
- suggestion,
70
- style: TextStyle (color: colorScheme.inverseSurface),
71
- ),
68
+ title: Text (suggestion),
72
69
);
73
70
},
74
71
suggestionsCallback: headerSuggestionCallback,
75
72
decorationBuilder: (context, child) =>
76
73
suggestionBoxDecorations (context, child, colorScheme),
77
74
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
- ),
97
75
builder: (context, controller, focusNode) => TextField (
98
76
onChanged: widget.onChanged,
99
77
controller: controller,
@@ -120,17 +98,19 @@ class _HeaderFieldState extends State<HeaderField> {
120
98
);
121
99
}
122
100
123
- Material suggestionBoxDecorations (
101
+ Theme suggestionBoxDecorations (
124
102
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,
131
113
),
132
- clipBehavior: Clip .hardEdge,
133
- child: child,
134
114
);
135
115
}
136
116
0 commit comments