StreamMessageLayoutResolver<S> class
Resolves style properties from an ordered list of style sources for a given StreamMessageLayoutData.
{@tool snippet}
final resolve = StreamMessageLayoutResolver<StreamMessageBubbleStyle>(
layout,
[widgetStyle, themeStyle, defaults],
);
final color = resolve((s) => s?.backgroundColor);
final side = resolve.maybeResolve((s) => s?.side);
{@end-tool}
See also:
- StreamMessageLayoutProperty, the resolver type for each field.
- StreamMessageLayoutData, the context passed to each resolver.
Constructors
-
StreamMessageLayoutResolver(StreamMessageLayoutData _layout, List<
S?> _styles) -
Creates a resolver that cascades through
stylesin order.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call<
T extends Object> (StreamMessageLayoutProperty< T?> ? getProperty(S? style)) → T -
Resolves the first non-null value for
getPropertyacross all style sources. -
maybeResolve<
T extends Object> (StreamMessageLayoutProperty< T?> ? getProperty(S? style)) → T? -
Resolves the first non-null value for
getPropertyacross all style sources, returningnullif none is found. -
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