AnnotationTheme class
Theme configuration for annotation visual appearance.
AnnotationTheme defines the visual styling of annotations in the flow editor, including colors for selection and highlight states, borders, and border radius.
The theme supports different visual states:
- Normal state (default appearance - handled by annotation's buildWidget)
- Selected state (when the annotation is selected)
- Highlighted state (when being dragged over or hovered)
Example:
// Create a custom annotation theme
final customTheme = AnnotationTheme(
selectionBorderColor: Colors.blue,
selectionBackgroundColor: Colors.blue.withOpacity(0.1),
highlightBorderColor: Colors.orange,
highlightBackgroundColor: Colors.orange.withOpacity(0.1),
borderWidth: 2.0,
borderRadius: BorderRadius.circular(8.0),
);
// Or use a predefined theme
final lightTheme = AnnotationTheme.light;
final darkTheme = AnnotationTheme.dark;
Constructors
- AnnotationTheme({required Color selectionBorderColor, required Color selectionBackgroundColor, required Color highlightBorderColor, required Color highlightBackgroundColor, required double borderWidth, double highlightBorderWidthDelta = 1.0, required BorderRadius borderRadius})
-
Creates an annotation theme with the specified visual properties.
const
Properties
- borderRadius → BorderRadius
-
Border radius for the selection/highlight overlay.
final
- borderWidth → double
-
Width of the selection border in logical pixels.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- highlightBackgroundColor → Color
-
Background overlay color when the annotation is highlighted.
final
- highlightBorderColor → Color
-
Border color when the annotation is highlighted.
final
- highlightBorderWidthDelta → double
-
Additional width added to the highlight border.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionBackgroundColor → Color
-
Background overlay color when the annotation is selected.
final
- selectionBorderColor → Color
-
Border color when the annotation is selected.
final
Methods
-
copyWith(
{Color? selectionBorderColor, Color? selectionBackgroundColor, Color? highlightBorderColor, Color? highlightBackgroundColor, double? borderWidth, double? highlightBorderWidthDelta, BorderRadius? borderRadius}) → AnnotationTheme - Creates a copy of this theme with the specified properties replaced.
-
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
Constants
- dark → const AnnotationTheme
- A predefined dark theme for annotations.
- light → const AnnotationTheme
- A predefined light theme for annotations.