SuggestionStyle class
Styling options for the code completion suggestion popup.
This class extends OverlayStyle to provide specific styling for the autocomplete suggestion list that appears while typing in the editor. Enhanced with VSCode-like styling options.
Example:
SuggestionStyle(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
backgroundColor: Color(0xFF252526), // VSCode dark theme background
selectedBackgroundColor: Color(0xFF094771), // VSCode selection color
focusColor: Color(0xff024281),
hoverColor: Color(0xFF2A2D2E), // VSCode hover color
splashColor: Colors.blueAccent.withAlpha(50),
borderColor: Color(0xFF454545), // VSCode border color
borderWidth: 1.0,
itemHeight: 24.0, // VSCode item height
iconSize: 16.0, // VSCode icon size
methodIconColor: Color(0xFFDCDFE4), // Light for methods
propertyIconColor: Color(0xFF98C379), // Green for properties
classIconColor: Color(0xFFE06C75), // Red for classes
variableIconColor: Color(0xFF61AFEF), // Blue for variables
keywordIconColor: Color(0xFFC678DD), // Purple for keywords
textStyle: TextStyle(color: Colors.white, fontSize: 13),
labelTextStyle: TextStyle(fontWeight: FontWeight.w500),
detailTextStyle: TextStyle(color: Colors.white70, fontSize: 11),
)
- Inheritance
-
- Object
- OverlayStyle
- SuggestionStyle
Constructors
- SuggestionStyle({double elevation = 6, required ShapeBorder shape, required Color backgroundColor, required Color focusColor, required Color hoverColor, required Color splashColor, required TextStyle textStyle, Color? selectedBackgroundColor, Color? borderColor, double? borderWidth, double? itemHeight, double? iconSize, Color? methodIconColor, Color? propertyIconColor, Color? classIconColor, Color? variableIconColor, Color? keywordIconColor, TextStyle? labelTextStyle, TextStyle? detailTextStyle, TextStyle? typeTextStyle})
- Creates a SuggestionStyle with the specified options.
Properties
- backgroundColor → Color
-
The background color of the overlay.
finalinherited
- borderColor → Color?
-
The border color for the suggestion popup.
final
- borderWidth → double?
-
The border width for the suggestion popup.
final
- classIconColor → Color?
-
The color for class/type icons.
final
- detailTextStyle → TextStyle?
-
The text style for additional information (like import paths).
final
- elevation → double
-
The elevation of the overlay, which determines the shadow depth.
Defaults to 6.
finalinherited
- focusColor → Color
-
The color used when the overlay is focused.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hoverColor → Color
-
The color used when the overlay is hovered.
finalinherited
- iconSize → double?
-
The size of icons in the suggestion list.
final
- itemHeight → double?
-
The height of each suggestion item.
final
- keywordIconColor → Color?
-
The color for keyword icons.
final
- labelTextStyle → TextStyle?
-
The text style for the suggestion label.
final
- methodIconColor → Color?
-
The color for method/function icons.
final
- propertyIconColor → Color?
-
The color for property/field icons.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedBackgroundColor → Color?
-
The background color for the selected item.
final
- shape → ShapeBorder
-
The shape of the overlay, which defines its border and corner radius.
This can be a ShapeBorder such as RoundedRectangleBorder, CircleBorder, etc.
finalinherited
- splashColor → Color
-
The color used for the splash effect when the overlay is tapped.
finalinherited
- textStyle → TextStyle
-
The text style used for the text in the overlay.
This is typically a TextStyle that defines the font size, weight, color, etc.
finalinherited
- typeTextStyle → TextStyle?
-
The text style for type information.
final
- variableIconColor → Color?
-
The color for variable icons.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited