mirror of
https://github.com/foss42/apidash.git
synced 2025-06-28 03:19:40 +08:00
fix(headers list): some colorscheme fixes
This commit is contained in:
@ -65,35 +65,13 @@ class _HeaderFieldState extends State<HeaderField> {
|
|||||||
itemBuilder: (context, String suggestion) {
|
itemBuilder: (context, String suggestion) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
dense: true,
|
dense: true,
|
||||||
title: Text(
|
title: Text(suggestion),
|
||||||
suggestion,
|
|
||||||
style: TextStyle(color: colorScheme.inverseSurface),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
suggestionsCallback: headerSuggestionCallback,
|
suggestionsCallback: headerSuggestionCallback,
|
||||||
decorationBuilder: (context, child) =>
|
decorationBuilder: (context, child) =>
|
||||||
suggestionBoxDecorations(context, child, colorScheme),
|
suggestionBoxDecorations(context, child, colorScheme),
|
||||||
constraints: const BoxConstraints(maxHeight: 400),
|
constraints: const BoxConstraints(maxHeight: 400),
|
||||||
listBuilder: (context, children) => Theme(
|
|
||||||
data: ThemeData(
|
|
||||||
scrollbarTheme: ScrollbarThemeData(
|
|
||||||
thumbColor: MaterialStateProperty.all(colorScheme.inverseSurface),
|
|
||||||
trackColor: MaterialStateProperty.all(
|
|
||||||
colorScheme.inverseSurface.withOpacity(0.3)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: ListView.builder(
|
|
||||||
shrinkWrap: true,
|
|
||||||
itemCount: children.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
return Container(
|
|
||||||
margin: const EdgeInsets.all(8),
|
|
||||||
child: children[index],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
builder: (context, controller, focusNode) => TextField(
|
builder: (context, controller, focusNode) => TextField(
|
||||||
onChanged: widget.onChanged,
|
onChanged: widget.onChanged,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
@ -120,17 +98,19 @@ class _HeaderFieldState extends State<HeaderField> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Material suggestionBoxDecorations(
|
Theme suggestionBoxDecorations(
|
||||||
BuildContext context, Widget child, ColorScheme colorScheme) {
|
BuildContext context, Widget child, ColorScheme colorScheme) {
|
||||||
return Material(
|
return Theme(
|
||||||
elevation: 4,
|
data: ThemeData(colorScheme: colorScheme),
|
||||||
color: colorScheme.surface,
|
child: Material(
|
||||||
shape: RoundedRectangleBorder(
|
elevation: 4,
|
||||||
side: BorderSide(color: Theme.of(context).dividerColor, width: 1.2),
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(8)),
|
side: BorderSide(color: Theme.of(context).dividerColor, width: 1.2),
|
||||||
|
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(8)),
|
||||||
|
),
|
||||||
|
clipBehavior: Clip.hardEdge,
|
||||||
|
child: child,
|
||||||
),
|
),
|
||||||
clipBehavior: Clip.hardEdge,
|
|
||||||
child: child,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user