FluentColorPickerScope class
Carries the picker's colour, shape and change callback down to the controls inside it.
The Flutter answer to upstream's React context. A plain InheritedWidget and not an InheritedTheme: it holds a value, not a style, and a picker and its children always share a subtree — capturing a stale colour into an overlay would be a bug, not a feature.
Not an InheritedModel either. The dependency graph is dense — the alpha rail depends on hue, saturation and value; the saturation and value rails on hue; every control on the colour — so per-aspect notification would save almost nothing and buy a whole class of bug where a forgotten aspect makes a control quietly stop updating.
A rebuild costs three build calls, three style resolutions and three
shouldRepaint checks. The element types are stable, so nothing is
remounted and nothing re-lays-out.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- ProxyWidget
- InheritedWidget
- FluentColorPickerScope
Constructors
-
FluentColorPickerScope({Key? key, required HSVColor color, required FluentColorPickerShape shape, required ValueChanged<
HSVColor> ? onColorChanged, required Widget child}) -
Publishes
color,shapeandonColorChangedtochild.const
Properties
- child → Widget
-
The widget below this widget in the tree.
finalinherited
- color → HSVColor
-
The colour every control inside shows, unless it was given its own.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onColorChanged
→ ValueChanged<
HSVColor> ? -
Called by a control inside with the colour it landed on. Null disables
every control that has no callback of its own.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shape → FluentColorPickerShape
-
The corner treatment every control inside takes, unless it was given its
own.
final
Methods
-
createElement(
) → InheritedElement -
Inflates this configuration to a concrete instance.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
-
updateShouldNotify(
covariant FluentColorPickerScope oldWidget) → bool -
Whether the framework should notify widgets that inherit from this widget.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
maybeOf(
BuildContext context) → FluentColorPickerScope? - The nearest picker scope, or null when a control stands alone.