AppRatingBar class

A Material 3 compliant Rating Bar for Flutter. Supports fractional ratings, custom icon sizes, colors, and read-only modes.

Inheritance

Constructors

AppRatingBar({Key? key, double rating = 0.0, int maxRating = 5, ValueChanged<double>? onRatingChanged, bool isReadOnly = false, bool allowHalfRating = true, double size = 28.0, double spacing = 4.0, IconData filledIcon = Icons.star, IconData halfFilledIcon = Icons.star_half, IconData emptyIcon = Icons.star_border, Color? filledColor, Color? emptyColor})
Creates an AppRatingBar.
const

Properties

allowHalfRating bool
Whether to allow half-star ratings.
final
emptyColor Color?
The color for empty components. Defaults to outline variant.
final
emptyIcon IconData
The icon for an empty rating item.
final
filledColor Color?
The color for filled components. Defaults to primary.
final
filledIcon IconData
The icon for a fully filled rating item.
final
halfFilledIcon IconData
The icon for a half-filled rating item.
final
hashCode int
The hash code for this object.
no setterinherited
isReadOnly bool
Whether the rating is read-only (not interactive).
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxRating int
The maximum rating value (number of items).
final
onRatingChanged ValueChanged<double>?
Callback when the rating is changed.
final
rating double
The current rating value.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size double
The size of the rating icons.
final
spacing double
Spacing between each rating icon.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<AppRatingBar>
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