ExpressiveRating class

Stars out of max: Material Symbols' star, filled (FILL 1, primary) up to value, a star_half at a half, outlined (FILL 0, onSurfaceVariant) after. The fill springs when value changes.

With onChanged each star is a pressable (state layer, ripple, focus, keyboard, the 48dp touch target around the glyph) that rates the whole number it stands for, announced as "Rate N of max"; without it the rating is one image, announced by semanticLabel ("Rated 4.5 of 5" when null).

ExpressiveRating(value: 4.5, size: ExpressiveRatingSize.small)
Inheritance

Constructors

ExpressiveRating({required double value, int max = 5, ValueChanged<int>? onChanged, ExpressiveRatingSize size = ExpressiveRatingSize.medium, String? semanticLabel, ExpressiveComponentThemeData? style, Key? key})
A rating of value stars out of max.
const

Properties

enabled → bool
Whether it takes input: false when onChanged is null, as in Flutter.
no setter
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
max → int
How many stars.
final
onChanged → ValueChanged<int>?
Called with the whole number of stars tapped; read-only when null.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel → String?
The accessible name of the rating. Its current score is announced separately.
final
size → ExpressiveRatingSize
The stars' size.
final
style → ExpressiveComponentThemeData?
Stateful visual slots for each star target.
final
value → double
The rating, 0 to max, in halves.
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
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.
override
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

Operators

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