WidgetExtensions

Static Class

Extension Methods

Get<T>(property: ThemeProperty<T>, context: IThemeProvider, listen: bool): T
Resolves the value of the given ThemeProperty using the given IThemeProvider. If the context is null, global theme values will be used as a fallback before resorting to the default value of the property.
RemarksThe returned value may be invalid for struct types. Use WidgetExtensions.TryGet in cases where you need to be sure that the value is valid and intentionally assigned.

Parameters

property:ThemeProperty<T> - The property that is to be resolved.
context:IThemeProvider - The theme provider to use for resolution.
listen:bool - Whether to listen for theme changes if the context supports it.

Returns

T-The resolved value of the property.
OffendingElement(collector: InformationCollector, widget: IWidgetElement): InformationCollector
Adds information about the offending element to the collector, including a spacer before for better readability.
OffendingWidget(collector: InformationCollector, widget: Widget): InformationCollector
Adds information about the offending widget to the collector, including a spacer before for better readability.
OwnerChain(collector: InformationCollector, context: BuildContext): InformationCollector
Adds information about this context's owner chain to the collector, including a spacer before for better readability.
ToBuildable(widget: Widget): IBuildable
Converts a Widget instance to an IBuildable.
ToFactory(widget: Widget, apply: Action<VisualElement>): ElementFactory<VisualElement>
Converts a Widget instance to an ElementFactory.
ToWidget(factory: ElementFactory): Widget
Converts a generic ElementFactory to a Widget.
TryGet<T>(property: ThemeProperty<T>, context: IThemeProvider, value: T, listen: bool): bool
Attempts to resolve the value of the given ThemeProperty using the given IThemeProvider. If the context is null, global theme values will be used as a fallback before resorting to the default value of the property.

Parameters

property:ThemeProperty<T> - The property that is to be resolved.
context:IThemeProvider - The theme provider to use for resolution.
value:T - The resolved value of the property.
listen:bool - Whether to listen for theme changes if the context supports it.

Returns

bool-true if the value retrieved is valid, otherwise false.

Inherited Members

On this page