Modifier

Abstract Class
Modifiers provide a way to manipulate the underlying VisualElement of a widget. Modifiers may alter appearance, layout, or other properties of the element. They can also be used to register even callbacks, but are expected to behave mostly immutably.

When applying modifiers, deltas are computed and passed to the modifier using the Modifier.Apply method. Once a modifier is not used anymore, it is expected to call Modifier.Reset to reset any alterations it may have made to the underlying VisualElement.

All modifiers of the same type must be equal to each other, changes are tracked using Modifier.DeepEquals and the respective Modifier.HasChanged implementations.

Mustn't expect any ordering guarantees as ModifierSet uses a hashset internally.

Fields

isFallback: bool

Static Methods

Append(modifiers: HashSet<Modifier>, modifier: Modifier): void
ApplyDelta(previous: ModifierSet, current: ModifierSet, element: VisualElement): void
ApplyDelta(previous: Widget, next: Widget, element: VisualElement): void

Instance Methods

DeepEquals(other: Modifier): bool
DebugFillProperties(properties: DiagnosticPropertiesBuilder): void
Equals(obj: object): bool
GetHashCode(): int
ToStringShort(): string
Apply(prev: Modifier, element: VisualElement): void
Apply(element: VisualElement): void
FillModifierProperties(properties: DiagnosticPropertiesBuilder): void
FindConstantName(): string
HasChanged(previous: Modifier): bool
Reset(element: VisualElement): void

Operators

Modifier(style: BackgroundStyle): Modifier
Modifier(constraints: BoxConstraints): Modifier
Modifier(style: TextStyle): Modifier

Inherited Members

Extension Methods

ToDiagnosticsNodeSafeFallbackDescribeIdentityShortHashToStringNullable

On this page