WheelSegment<T> class

Represents a single slice or segment of the spinning wheel.

T is the type of value, e.g. WheelSegment<int> for prize amounts or WheelSegment<String> for coupon codes. It is inferred from the value you pass.

Constructors

WheelSegment(String label, T value, {Color? color, String? path, ImageProvider<Object>? imageProvider, Image? image, Widget? child, TextStyle? textStyle, String? semanticLabel, double? probability})
Creates a new WheelSegment.

Properties

child → Widget?
A widget drawn on the segment in place of the image, e.g. an Icon or an animated badge. It is laid out in a box of the wheel's image size and rotates with the wheel.
final
color → Color
The background color of the segment.
final
hashCode → int
The hash code for this object.
no setterinherited
image → Image?
The loaded ui.Image object, usually populated by the loader.
final
imageProvider → ImageProvider<Object>?
An image provider for the segment's icon, e.g. MemoryImage, FileImage or a NetworkImage with custom headers.
final
label → String
The text displayed on the segment.
final
needsImageLoad → bool
Whether this segment has an image that still needs to be loaded.
no setter
path → String?
The path to an image icon displayed on the segment. Supports both local asset paths and network URLs.
final
probability → double?
Weighted probability for this segment to be selected (0.0 to 1.0).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel → String?
A description of this segment for screen readers. Defaults to label.
final
textStyle → TextStyle?
Text style for this segment's label, merged on top of the wheel's WheelLabelStyle.labelStyle.
final
value → T
The value associated with this segment (e.g., prize amount).
final

Methods

copyWith({String? label, T? value, Color? color, String? path, ImageProvider<Object>? imageProvider, Image? image, Widget? child, TextStyle? textStyle, String? semanticLabel, double? probability}) → WheelSegment<T>
Creates a copy of this segment with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

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