WidgetStateBorderSide class abstract

Defines a BorderSide whose value depends on a set of WidgetStates which represent the interactive state of a component.

This class enables existing widget implementations with BorderSide properties to be extended to also effectively support WidgetStateProperty<BorderSide> property values. It should only be used for parameters that document support for WidgetStateBorderSide objects.

A WidgetStateBorderSide can be created in one of the following ways:

  1. Create a subclass of WidgetStateBorderSide and implement the abstract resolve method.
  2. Use WidgetStateBorderSide.resolveWith and pass in a callback that will be used to resolve the color in the given states.
  3. Use WidgetStateBorderSide.fromMap to assign a value using a WidgetStateMap.

This example defines a WidgetStateBorderSide which resolves to different border colors depending on how the user interacts with it.
link

To create a local project with this code sample, run:
flutter create --sample=widgets.WidgetStateBorderSide.1 mysample

Inheritance
Implemented types

Constructors

WidgetStateBorderSide()
Abstract const constructor. This constructor enables subclasses to provide const constructors so that they can be used in const expressions.
const
WidgetStateBorderSide.fromMap(WidgetStateMap<BorderSide?> map)
Creates a WidgetStateBorderSide from a WidgetStateMap.
const
factory
WidgetStateBorderSide.resolveWith(WidgetPropertyResolver<BorderSide?> callback)
Creates a WidgetStateBorderSide from a WidgetPropertyResolver<BorderSide?> callback function.
const
factory

Properties

color → Color
The color of this side of the border.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
strokeAlign → double
The relative position of the stroke on a BorderSide in an OutlinedBorder or Border.
finalinherited
strokeInset → double
Get the amount of the stroke width that lies inside of the BorderSide.
no setterinherited
strokeOffset → double
The offset of the stroke, taking into account the stroke alignment.
no setterinherited
strokeOutset → double
Get the amount of the stroke width that lies outside of the BorderSide.
no setterinherited
style → BorderStyle
The style of this side of the border.
finalinherited
width → double
The width of this side of the border, in logical pixels.
finalinherited

Methods

copyWith({Color? color, double? width, BorderStyle? style, double? strokeAlign}) → BorderSide
Creates a copy of this border but with the given fields replaced with the new values.
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
resolve(Set<WidgetState> states) → BorderSide?
Returns a BorderSide that's to be used when a Widget is in the specified state. Return null to defer to the default value of the widget or theme.
override
scale(double t) → BorderSide
Creates a copy of this border side description but with the width scaled by the factor t.
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
toPaint() → Paint
Create a Paint object that, if used to stroke a line, will draw the line in this border's style.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringShort() → String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

lerp(WidgetStateProperty<BorderSide?>? a, WidgetStateProperty<BorderSide?>? b, double t) → WidgetStateProperty<BorderSide?>?
Linearly interpolate between two WidgetStatePropertys of BorderSide.
override