DesignCarousel class

Slides itemBuilder builds, itemCount of them.

The frame's shape is the look's to hold. The slides are cut at the viewport's edge as clipBehavior says, square by default, so a slide whose corners are rounded shows square ones mid-swipe where it crosses that edge. A look with a rounded frame clips the viewport it gets in layoutBuilder to that shape (a ClipRRect around it).

DesignCarousel(itemCount: 3, itemBuilder: (context, index) => Text('Slide $index'))
Inheritance

Constructors

DesignCarousel({Key? key, required int itemCount, required IndexedWidgetBuilder itemBuilder, Widget layoutBuilder(BuildContext context, Widget viewport, DesignCarouselControls controls)?, int initialPage = 0, double viewportFraction = 1, bool loop = false, Duration? autoplayInterval, ValueChanged<int>? onPageChanged, bool focusable = true, FocusNode? focusNode, bool autofocus = false, String? semanticLabel, String slideLabel(int index, int count)?, Duration duration = const Duration(milliseconds: 350), Clip clipBehavior = Clip.hardEdge})
A carousel of itemCount slides.
const

Properties

autofocus → bool
Whether the slides take focus when they first appear (with focusable).
final
autoplayInterval → Duration?
How long each slide shows while it plays; null: it does not play.
final
clipBehavior → Clip
How the slides are cut at the viewport's edge, as PageView.clipBehavior: Clip.hardEdge, a square cut, by default. Clip.none lets a moving slide paint past the edge, for slides that run to the screen's edge, or inside a frame the look clips itself.
final
duration → Duration
How long a turn takes.
final
focusable → bool
Whether the slides are a tab stop the arrows turn.
final
focusNode → FocusNode?
The slides' focus.
final
hashCode → int
The hash code for this object.
no setterinherited
initialPage → int
The slide it starts on.
final
itemBuilder → IndexedWidgetBuilder
Builds slide index.
final
itemCount → int
How many slides there are.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
layoutBuilder → Widget Function(BuildContext context, Widget viewport, DesignCarouselControls controls)?
Lays out the slides (viewport) with the controls; null: the slides alone (a swipe, the keys and a screen reader still turn them).
final
loop → bool
Whether it goes round: next at the last slide turns on to the first (and a swipe past it does), previous at the first back to the last.
final
onPageChanged → ValueChanged<int>?
Called when the slide shown changes.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel → String?
What a screen reader calls the carousel; null: DesignLocalizations.carouselLabel.
final
slideLabel → String Function(int index, int count)?
What a screen reader calls slide index of count; null: DesignLocalizations.carouselSlideLabel.
final
viewportFraction → double
Each slide's share of the view (under 1 shows the neighbours).
final

Methods

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