SmartSearchTheme class
Theme extension for SmartSearch widgets.
This extension provides customizable theming for all SmartSearch components including the search box, overlay dropdown, and result items.
Usage
Add the theme extension to your app's theme:
MaterialApp(
theme: ThemeData.light().copyWith(
extensions: [SmartSearchTheme.light()],
),
darkTheme: ThemeData.dark().copyWith(
extensions: [SmartSearchTheme.dark()],
),
)
Or create a custom theme:
SmartSearchTheme(
searchBoxBackgroundColor: Colors.grey[100],
searchBoxTextColor: Colors.black87,
// ... other properties
)
- Inheritance
-
- Object
- ThemeExtension<
SmartSearchTheme> - SmartSearchTheme
Constructors
- SmartSearchTheme({Color? searchBoxBackgroundColor, Color? searchBoxTextColor, Color? searchBoxHintColor, Color? searchBoxBorderColor, Color? searchBoxFocusedBorderColor, Color? searchBoxIconColor, Color? searchBoxCursorColor, BorderRadius? searchBoxBorderRadius, double? searchBoxElevation, Color? searchBoxShadowColor, Color? overlayBackgroundColor, Color? overlayBorderColor, BorderRadius? overlayBorderRadius, double? overlayElevation, Color? overlayShadowColor, Color? itemBackgroundColor, Color? itemHoverColor, Color? itemFocusedColor, Color? itemSelectedColor, Color? itemTextColor, Color? itemSubtitleColor, Color? itemIconColor, Color? itemDividerColor, Color? loadingIndicatorColor, Color? emptyStateIconColor, Color? emptyStateTextColor, Color? errorIconColor, Color? errorTextColor, Color? errorButtonColor, Color? scrollbarColor, double? scrollbarThickness, Radius? scrollbarRadius})
-
Creates a SmartSearchTheme with the given properties.
const
- SmartSearchTheme.dark()
-
Creates a dark theme for SmartSearch widgets.
factory
- SmartSearchTheme.light()
-
Creates a light theme for SmartSearch widgets.
factory
Properties
- emptyStateIconColor → Color?
-
Icon color in the empty state.
final
- emptyStateTextColor → Color?
-
Text color in the empty state.
final
- errorButtonColor → Color?
-
Button color in the error state (retry button).
final
- errorIconColor → Color?
-
Icon color in the error state.
final
- errorTextColor → Color?
-
Text color in the error state.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- itemBackgroundColor → Color?
-
Default background color of items.
final
- itemDividerColor → Color?
-
Divider color between items.
final
- itemFocusedColor → Color?
-
Background color of the focused item (keyboard navigation).
final
- itemHoverColor → Color?
-
Background color when hovering over an item.
final
- itemIconColor → Color?
-
Icon color in items.
final
- itemSelectedColor → Color?
-
Background color of the selected item.
final
- itemSubtitleColor → Color?
-
Subtitle/secondary text color of items.
final
- itemTextColor → Color?
-
Primary text color of items.
final
- loadingIndicatorColor → Color?
-
Color of the loading indicator.
final
- overlayBackgroundColor → Color?
-
Background color of the overlay dropdown.
final
- overlayBorderColor → Color?
-
Border color of the overlay dropdown.
final
- overlayBorderRadius → BorderRadius?
-
Border radius of the overlay dropdown.
final
- overlayElevation → double?
-
Elevation of the overlay dropdown.
final
- overlayShadowColor → Color?
-
Shadow color of the overlay dropdown.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollbarColor → Color?
-
Color of the scrollbar.
final
- scrollbarRadius → Radius?
-
Radius of the scrollbar.
final
- scrollbarThickness → double?
-
Thickness of the scrollbar.
final
- searchBoxBackgroundColor → Color?
-
Background color of the search box.
final
- searchBoxBorderColor → Color?
-
Border color of the search box.
final
- searchBoxBorderRadius → BorderRadius?
-
Border radius of the search box.
final
- searchBoxCursorColor → Color?
-
Cursor color in the search box.
final
- searchBoxElevation → double?
-
Elevation of the search box.
final
- searchBoxFocusedBorderColor → Color?
-
Border color when the search box is focused.
final
- searchBoxHintColor → Color?
-
Hint text color in the search box.
final
- searchBoxIconColor → Color?
-
Icon color in the search box (prefix/suffix icons).
final
- searchBoxShadowColor → Color?
-
Shadow color of the search box.
final
- searchBoxTextColor → Color?
-
Text color in the search box.
final
- type → Object
-
The extension's type.
no setterinherited
Methods
-
copyWith(
{Color? searchBoxBackgroundColor, Color? searchBoxTextColor, Color? searchBoxHintColor, Color? searchBoxBorderColor, Color? searchBoxFocusedBorderColor, Color? searchBoxIconColor, Color? searchBoxCursorColor, BorderRadius? searchBoxBorderRadius, double? searchBoxElevation, Color? searchBoxShadowColor, Color? overlayBackgroundColor, Color? overlayBorderColor, BorderRadius? overlayBorderRadius, double? overlayElevation, Color? overlayShadowColor, Color? itemBackgroundColor, Color? itemHoverColor, Color? itemFocusedColor, Color? itemSelectedColor, Color? itemTextColor, Color? itemSubtitleColor, Color? itemIconColor, Color? itemDividerColor, Color? loadingIndicatorColor, Color? emptyStateIconColor, Color? emptyStateTextColor, Color? errorIconColor, Color? errorTextColor, Color? errorButtonColor, Color? scrollbarColor, double? scrollbarThickness, Radius? scrollbarRadius}) → SmartSearchTheme -
Creates a copy of this theme extension with the given fields
replaced by the non-null parameter values.
override
-
lerp(
covariant ThemeExtension< SmartSearchTheme> ? other, double t) → SmartSearchTheme -
Linearly interpolate with another ThemeExtension object.
override
-
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.
override
Static Methods
-
maybeOf(
BuildContext context) → SmartSearchTheme? - Gets the SmartSearchTheme from the current context, or null if not found.
-
of(
BuildContext context) → SmartSearchTheme - Gets the SmartSearchTheme from the current context.