GlassRating class
A star rating: a row of stars that fill with amber as far as value. Tap a star, or drag across them, to set it; the star touched pops.
With onChanged null the rating only shows value, which may be any fraction, such as an average of 4.3.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- GlassRating
Constructors
-
GlassRating.new({Key? key, required double value, required ValueChanged<
double> ? onChanged, int count = 5, bool allowHalf = false, double size = 28, double spacing = 4, Color? color, Color? emptyColor, String? semanticLabel, FocusNode? focusNode, bool autofocus = false}) -
Creates a star rating;
countandsizemust be positive andspacingnot negative.const
Properties
- allowHalf → bool
-
Whether a rating can end in half a star.
final
- autofocus → bool
-
Whether it takes focus when first built.
final
- color → Color?
-
The filled stars' colour. Defaults to glassRatingAmber.
final
- count → int
-
How many stars there are.
final
- emptyColor → Color?
-
The empty stars' colour. Defaults to the theme's track.
final
- focusNode → FocusNode?
-
The control's focus node, to drive or watch its focus.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onChanged
→ ValueChanged<
double> ? -
Called with the new rating. Null makes the rating read-only.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
Names the control for assistive technology.
final
- size → double
-
Each star's width and height.
final
- spacing → double
-
The gap between stars.
final
- value → double
-
How many stars are filled, from 0 to count.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< GlassRating> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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.
inherited
-
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