MoonCarousel class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MoonCarousel
Constructors
- MoonCarousel({Key? key, Axis axisDirection = Axis.horizontal, bool autoPlay = false, bool isCentered = true, bool clampMaxExtent = false, bool loop = false, double anchor = 0.0, double? gap, required double itemExtent, double velocityFactor = 0.5, Duration? autoPlayDelay, Duration? transitionDuration, Curve? transitionCurve, required int itemCount, ScrollController? controller, ScrollPhysics? physics, ScrollBehavior? scrollBehavior, void onIndexChanged(int index)?, required Widget itemBuilder(BuildContext context, int itemIndex, int realIndex)})
-
Creates a Moon Design carousel.
const
Properties
- anchor → double
-
Positions the selected carousel item within the viewport. Values range from 0 to 1.
final
- autoPlay → bool
-
Whether to enable the automatic scrolling for the carousel.
final
- autoPlayDelay → Duration?
-
The delay between the items in the carousel's automatic scrolling sequence.
final
- axisDirection → Axis
-
The axis direction in which the carousel scrolls.
final
- clampMaxExtent → bool
-
Whether to limit the 'maxExtent' proportionally based on the anchor.
final
- controller → ScrollController?
-
The ScrollController used to control the carousel.
final
- gap → double?
-
The gap between the carousel items.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCentered → bool
-
Whether to align the selected carousel item to the center of the viewport.
When set to true, the anchor property is ignored.
final
- itemBuilder → Widget Function(BuildContext context, int itemIndex, int realIndex)
-
Builds carousel items lazily within the viewport.
final
- itemCount → int
-
The total number of items to build for the carousel.
final
- itemExtent → double
-
The maximum width for each carousel item in the viewport.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loop → bool
-
Whether to enable infinite looping for the carousel items.
final
- onIndexChanged → (void Function(int index)?)
-
The callback that is called when the carousel item index has changed.
final
- physics → ScrollPhysics?
-
The scroll physics of the carousel.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollBehavior → ScrollBehavior?
-
The custom scroll behavior for the carousel.
final
- transitionCurve → Curve?
-
The curve of the MoonCarousel
autoplay
transition animation.final - transitionDuration → Duration?
-
The duration of the MoonCarousel
autoplay
transition animation.final - velocityFactor → double
-
The factor to adjust and multiply the velocity of carousel scrolling.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MoonCarousel> -
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}) → 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