SmartAutoSuggestTheme class
A ThemeExtension for customizing the appearance of SmartAutoSuggestBox and SmartAutoSuggestView.
Provides granular control over colors, shadows, border radius, padding, and text styles used by the suggestion widgets.
Usage with ThemeData:
MaterialApp(
theme: ThemeData.light().copyWith(
extensions: [SmartAutoSuggestTheme.light()],
),
darkTheme: ThemeData.dark().copyWith(
extensions: [SmartAutoSuggestTheme.dark()],
),
)
Or pass directly to a widget:
SmartAutoSuggestBox<String>(
theme: SmartAutoSuggestTheme.light().copyWith(
overlayBorderRadius: BorderRadius.circular(12),
),
// ...
)
- Inheritance
-
- Object
- ThemeExtension<
SmartAutoSuggestTheme> - SmartAutoSuggestTheme
Constructors
-
SmartAutoSuggestTheme({Color? overlayColor, Color? overlayCardColor, List<
BoxShadow> ? overlayShadows, BorderRadius? overlayBorderRadius, double? overlayMargin, BorderSide? listBorderSide, Color? tileColor, Color? selectedTileColor, Color? selectedTileTextColor, EdgeInsetsGeometry? tilePadding, TextStyle? tileSubtitleStyle, TextStyle? noResultsSubtitleStyle, TextStyle? loadingSubtitleStyle, TextStyle? errorSubtitleStyle, Color? errorIconColor, double? progressIndicatorHeight, Color? progressIndicatorColor, double? dividerIndent, Color? disabledItemColor}) -
Creates a SmartAutoSuggestTheme.
const
- SmartAutoSuggestTheme.dark()
-
Dark theme defaults.
factory
- SmartAutoSuggestTheme.light()
-
Light theme defaults.
factory
Properties
- disabledItemColor → Color?
-
Text color for disabled items.
final
- dividerIndent → double?
-
Indent for the divider between custom no-results widget and default text.
final
- errorIconColor → Color?
-
Icon color for the error state.
final
- errorSubtitleStyle → TextStyle?
-
Text style for the error subtitle shown when
onSearchthrows.final - hashCode → int
-
The hash code for this object.
no setterinherited
- listBorderSide → BorderSide?
-
Border shown between the text field and the inline list
(used by SmartAutoSuggestView).
final
- loadingSubtitleStyle → TextStyle?
-
Text style for "searching in server" subtitle.
final
- noResultsSubtitleStyle → TextStyle?
-
Text style for "no results" subtitle.
final
- overlayBorderRadius → BorderRadius?
-
Border radius of the overlay container.
final
- overlayCardColor → Color?
-
Color of the card inside the overlay.
final
- overlayColor → Color?
-
Background color of the overlay / inline list.
final
- overlayMargin → double?
-
Margin around the overlay container.
final
-
overlayShadows
→ List<
BoxShadow> ? -
Box shadows applied to the overlay container.
final
- progressIndicatorColor → Color?
-
Color of the progress indicator.
final
- progressIndicatorHeight → double?
-
Height of the progress indicator shown during loading.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedTileColor → Color?
-
Background color of a selected / focused suggestion tile.
final
- selectedTileTextColor → Color?
-
Foreground color (text/icon) of a selected / focused suggestion tile.
final
- tileColor → Color?
-
Background color of a suggestion tile.
final
- tilePadding → EdgeInsetsGeometry?
-
Padding around each suggestion tile.
final
- tileSubtitleStyle → TextStyle?
-
Text style for the tile subtitle.
final
- type → Object
-
The extension's type.
no setterinherited
Methods
-
copyWith(
{Color? overlayColor, Color? overlayCardColor, List< BoxShadow> ? overlayShadows, BorderRadius? overlayBorderRadius, double? overlayMargin, BorderSide? listBorderSide, Color? tileColor, Color? selectedTileColor, Color? selectedTileTextColor, EdgeInsetsGeometry? tilePadding, TextStyle? tileSubtitleStyle, TextStyle? noResultsSubtitleStyle, TextStyle? loadingSubtitleStyle, TextStyle? errorSubtitleStyle, Color? errorIconColor, double? progressIndicatorHeight, Color? progressIndicatorColor, double? dividerIndent, Color? disabledItemColor}) → SmartAutoSuggestTheme -
Creates a copy of this theme extension with the given fields
replaced by the non-null parameter values.
override
-
lerp(
covariant ThemeExtension< SmartAutoSuggestTheme> ? other, double t) → SmartAutoSuggestTheme -
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.
inherited