CarouselGeneralFrameworkView class
A Material Design carousel widget.
The CarouselGeneralFrameworkView present a scrollable list of items, each of which can dynamically change size based on the chosen layout.
This widget supports uncontained carousel layout. It shows items that scroll to the edge of the container, behaving similarly to a ListView where all children are a uniform size.
The CarouselGeneralFrameworkController is used to control the CarouselGeneralFrameworkController.initialItem.
The CarouselGeneralFrameworkView.itemExtent
property must be non-null and defines the base
size of items. While items typically maintain this size, the first and last
visible items may be slightly compressed during scrolling. The shrinkExtent
property controls the minimum allowable size for these compressed items.
{@tool dartpad} Here is an example of CarouselGeneralFrameworkView to show the uncontained layout. Each carousel item has the same size but can be "squished" to the shrinkExtent when they are show on the view and out of view.
** See code in examples/api/lib/material/carousel/carousel.0.dart ** {@end-tool}
See also:
- CarouselGeneralFrameworkController, which controls the first visible item in the carousel.
- PageView, which is a scrollable list that works page by page.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CarouselGeneralFrameworkView
Constructors
-
CarouselGeneralFrameworkView.new({Key? key, EdgeInsets? padding, Color? backgroundColor, double? elevation, ShapeBorder? shape, WidgetStateProperty<
Color?> ? overlayColor, double shrinkExtent = 0.0, CarouselGeneralFrameworkController? controller, Axis scrollDirection = Axis.horizontal, bool reverse = false, required BoxConstraints constraints, required List<Widget> onBuilder(BuildContext context)}) -
Creates a Material Design carousel.
const
Properties
- backgroundColor → Color?
-
The background color for each carousel item.
final
- constraints → BoxConstraints
-
UncompleteDocumentation
final
- controller → CarouselGeneralFrameworkController?
-
An object that can be used to control the position to which this scroll
view is scrolled.
final
- elevation → double?
-
The z-coordinate of each carousel item.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onBuilder
→ List<
Widget> Function(BuildContext context) -
The child widgets for the carousel.
final
-
overlayColor
→ WidgetStateProperty<
Color?> ? -
The highlight color to indicate the carousel items are in pressed, hovered
or focused states.
final
- padding → EdgeInsets?
-
The amount of space to surround each carousel item with.
final
- reverse → bool
-
Whether the carousel list scrolls in the reading direction.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollDirection → Axis
-
The Axis along which the scroll view's offset increases with each item.
final
- shape → ShapeBorder?
-
The shape of each carousel item's Material.
final
- shrinkExtent → double
-
The minimum allowable extent (size) in the main axis for carousel items
during scrolling transitions.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< CarouselGeneralFrameworkView> -
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