ZeroRating class
A rating component that allows users to rate something.
The rating component is used to rate something. It can be used to rate a product, a service, a movie, a book, etc. The icons of the rating use stars, you can edit the color of the stars and the number of stars.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ZeroRating
Constructors
-
ZeroRating.new({Key? key, int itemCount = 5, double initialValue = 1, double minValue = 0, bool allowHalfRating = true, ValueChanged<
double> ? onRatingUpdate, bool isDisabled = false, ZeroSizeType sizeType = ZeroSizeType.medium, RatingWidget? ratingWidget, ZeroRatingStyle? style}) -
const
Properties
- allowHalfRating → bool
-
Whether to allow half ratings.
The default value is true.
If allowHalfRating is true, the rating will be rounded to the nearest half.
If allowHalfRating is false, the rating will be rounded to the nearest whole number.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialValue → double
-
The initial value of the rating.
The default value is 1.
initialValue must be greater than or equal to minValue and less than or equal to itemCount
final
- isDisabled → bool
-
Whether the rating is disabled.
The default value is false.
If isDisabled is true, the rating will be disabled and the user will not be able to interact with it.
final
- itemCount → int
-
The number of items in the rating.
The default value is 5.
The minimum value is 0.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- minValue → double
-
The minimum value of the rating.
The default value is 0.
minValue must be greater than or equal to 0 and less than or equal to itemCount
final
-
onRatingUpdate
→ ValueChanged<
double> ? -
The callback function that is called when the rating is updated.
The default value is null.
The callback function will be called with the new rating value.
final
- ratingWidget → RatingWidget?
-
for customizing the icons of the rating.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sizeType → ZeroSizeType
-
The size of the rating.
The default value is ZeroSizeType.medium.
The size of the rating is determined by the sizeType.
There are 3 sizes available: ZeroSizeType.small, ZeroSizeType.medium, and ZeroSizeType.large.
final
- style → ZeroRatingStyle?
-
The style of rating.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ZeroRating> -
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