mirror of
https://github.com/foss42/apidash.git
synced 2025-06-21 06:40:08 +08:00
fix: colors not changing in headers suggestion list
This commit is contained in:
@ -54,7 +54,7 @@ class _HeaderFieldState extends State<HeaderField> {
|
|||||||
var colorScheme = widget.colorScheme ?? Theme.of(context).colorScheme;
|
var colorScheme = widget.colorScheme ?? Theme.of(context).colorScheme;
|
||||||
return TypeAheadField(
|
return TypeAheadField(
|
||||||
key: Key(widget.keyId),
|
key: Key(widget.keyId),
|
||||||
hideOnEmpty: false,
|
hideOnEmpty: true,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
onSelected: (value) {
|
onSelected: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
@ -65,11 +65,15 @@ class _HeaderFieldState extends State<HeaderField> {
|
|||||||
itemBuilder: (context, String suggestion) {
|
itemBuilder: (context, String suggestion) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
dense: true,
|
dense: true,
|
||||||
title: Text(suggestion),
|
title: Text(
|
||||||
|
suggestion,
|
||||||
|
style: TextStyle(color: colorScheme.inverseSurface),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
suggestionsCallback: headerSuggestionCallback,
|
suggestionsCallback: headerSuggestionCallback,
|
||||||
decorationBuilder: suggestionBoxDecorations,
|
decorationBuilder: (context, child) =>
|
||||||
|
suggestionBoxDecorations(context, child, colorScheme),
|
||||||
constraints: const BoxConstraints(maxHeight: 400),
|
constraints: const BoxConstraints(maxHeight: 400),
|
||||||
builder: (context, controller, focusNode) => TextField(
|
builder: (context, controller, focusNode) => TextField(
|
||||||
onChanged: widget.onChanged,
|
onChanged: widget.onChanged,
|
||||||
@ -97,9 +101,11 @@ class _HeaderFieldState extends State<HeaderField> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Material suggestionBoxDecorations(BuildContext context, Widget child) {
|
Material suggestionBoxDecorations(
|
||||||
|
BuildContext context, Widget child, ColorScheme colorScheme) {
|
||||||
return Material(
|
return Material(
|
||||||
elevation: 4,
|
elevation: 4,
|
||||||
|
color: colorScheme.surface,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(color: Theme.of(context).dividerColor, width: 1.2),
|
side: BorderSide(color: Theme.of(context).dividerColor, width: 1.2),
|
||||||
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(8)),
|
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(8)),
|
||||||
|
Reference in New Issue
Block a user