StarRating class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- StarRating
Constructors
-
StarRating.new({Key? key, int starCount = 5, int initialRating = 0, double starSize = 40.0, double starSpacing = 4.0, Color selectedFillColor = Colors.amber, bool showSelectedBorder = true, Color selectedStrokeColor = Colors.amber, double selectedStrokeWidth = 2.0, Color unselectedStrokeColor = Colors.grey, double unselectedStrokeWidth = 2.0, StarEdgeStyle starEdgeStyle = StarEdgeStyle.smooth, ValueChanged<
int> ? onRatingChanged, BoxDecoration? decoration}) -
const
Properties
- decoration → BoxDecoration?
-
An optional decoration for the container that holds all the stars.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialRating → int
-
The initial rating (how many stars are initially selected).
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onRatingChanged
→ ValueChanged<
int> ? -
Callback that returns the new rating when a star is tapped.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedFillColor → Color
-
The fill color for selected stars.
final
- selectedStrokeColor → Color
-
The stroke color for selected stars (only used if showSelectedBorder is true).
final
- selectedStrokeWidth → double
-
The stroke width for selected stars (only used if showSelectedBorder is true).
final
- showSelectedBorder → bool
-
Whether to show a border around selected stars.
final
- starCount → int
-
Total number of stars (default is 5).
final
- starEdgeStyle → StarEdgeStyle
-
Enum controlling the corners of the star (sharp or smooth).
final
- starSize → double
-
The width/height of each star.
final
- starSpacing → double
-
Spacing between stars.
final
- unselectedStrokeColor → Color
-
The fill color (actually just the stroke color) for unselected stars.
final
- unselectedStrokeWidth → double
-
The stroke width for unselected stars.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _StarRatingState -
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