FlowTheme class final
Fully-resolved visual values consumed directly by the canvas painters.
This is a plain value class on purpose: painters must not perform context lookups while painting. Resolve once against the widget tree with FlowTheme.resolve, then hand the resulting plain theme down to painters.
Theming options, in precedence order:
- Pass an explicit
theme:to the canvas widget. - Register a FlowTheme as a ThemeExtension on your ThemeData:
ThemeData(extensions: [FlowTheme.dark().copyWith(...)]). - Do nothing and get the built-in dark palette, FlowTheme.dark.
- Inheritance
-
- Object
- ThemeExtension<
FlowTheme> - FlowTheme
Constructors
- FlowTheme({Color background = _Defaults.background, Color gridDot = _Defaults.gridDot, double gridGap = _Defaults.gridGap, Color selectionFill = _Defaults.selectionFill, Color selectionStroke = _Defaults.selectionStroke, double selectionStrokeWidth = _Defaults.selectionStrokeWidth, Color edge = _Defaults.edge, Color edgeSelected = _Defaults.edgeSelected, Color warning = _Defaults.warning, Color nodeHandleFill = _Defaults.nodeHandleFill, Color nodeHandleBorder = _Defaults.nodeHandleBorder, Color connectionPreview = _Defaults.connectionPreview, Color minimapBackground = _Defaults.minimapBackground, Color minimapNode = _Defaults.minimapNode, Color minimapViewport = _Defaults.minimapViewport, Color minimapBorder = _Defaults.minimapBorder, Color snapGuide = _Defaults.snapGuide, double handleSize = _Defaults.handleSize, double branchHandleSize = _Defaults.branchHandleSize, double minimapRadius = _Defaults.minimapRadius})
-
const
- FlowTheme.dark()
-
The dark default palette. Identical to a bare
FlowTheme(); provided as a named constructor so call sites can state the intent explicitly.const
Properties
- background → Color
-
Canvas background fill.
final
- branchHandleSize → double
-
Diameter of a PortVisual.branch handle, in graph units.
final
- connectionPreview → Color
-
Stroke color of the drag-to-connect preview line.
final
- edge → Color
-
Default edge (connection) stroke color.
final
- edgeSelected → Color
-
Edge stroke color when the edge is selected.
final
- gridDot → Color
-
Color of a single grid dot.
final
- gridGap → double
-
Spacing between grid dots, in graph units.
final
- handleSize → double
-
Diameter of a PortVisual.circle handle, in graph units.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- minimapBackground → Color
-
Fill of the minimap's glass panel (a high-alpha background).
final
- minimapBorder → Color
-
Border of the minimap's glass panel.
final
- minimapNode → Color
-
Fill of an unselected node rectangle in the minimap. Selected nodes use
selectionStroke.
final
- minimapRadius → double
-
Corner radius of the minimap's glass panel, in logical pixels.
final
- minimapViewport → Color
-
Stroke/fill accent of the minimap's viewport indicator rectangle.
final
- nodeHandleBorder → Color
-
Border of a port handle.
final
- nodeHandleFill → Color
-
Fill of a port handle.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionFill → Color
-
Fill of the marquee selection rectangle.
final
- selectionStroke → Color
-
Stroke of the marquee selection rectangle.
final
- selectionStrokeWidth → double
-
Stroke width of the marquee selection rectangle, in screen pixels.
final
- snapGuide → Color
-
Stroke of the alignment guide lines shown while dragging nodes.
final
- type → Object
-
The extension's type.
no setterinherited
- warning → Color
-
Accent used for warnings (e.g. the dangling-edge badge).
final
Methods
-
copyWith(
{Color? background, Color? gridDot, double? gridGap, Color? selectionFill, Color? selectionStroke, double? selectionStrokeWidth, Color? edge, Color? edgeSelected, Color? warning, Color? nodeHandleFill, Color? nodeHandleBorder, Color? connectionPreview, Color? minimapBackground, Color? minimapNode, Color? minimapViewport, Color? minimapBorder, Color? snapGuide, double? handleSize, double? branchHandleSize, double? minimapRadius}) → FlowTheme -
Creates a copy of this theme extension with the given fields
replaced by the non-null parameter values.
override
-
lerp(
covariant ThemeExtension< FlowTheme> ? other, double t) → FlowTheme -
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
Static Methods
-
resolve(
BuildContext context) → FlowTheme -
Resolves the canvas palette for
context: a FlowTheme registered as a ThemeExtension on the ambient Theme wins, else FlowTheme.dark.