CardStackWidget class
This class has the aim to show a stack of cards based on cardList. ______ | C | |_____| <- For example, we have three cards (A, B, C) | B | <- and reverseOrder is set to false |________| | A | |___________|
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CardStackWidget
Constructors
-
CardStackWidget({required List<
CardModel> cardList, Key? key, double? positionFactor, double? scaleFactor, CardOrientation? cardDismissOrientation, CardOrientation? swipeOrientation, Alignment? alignment, bool reverseOrder = false, dynamic onCardTap(CardModel)?, bool opacityChangeOnDrag = false, bool animateCardScale = false, Duration? dismissedCardDuration}) -
Create a stack of card using the CardModel properties inside the
cardList
parameter.const - CardStackWidget.builder({required int count, required CardStackWidgetBuilder builder, Key? key, double? positionFactor, double? scaleFactor, CardOrientation? cardDismissOrientation, CardOrientation? swipeOrientation, Alignment? alignment, bool reverseOrder = false, dynamic onCardTap(CardModel)?, bool opacityChangeOnDrag = false, bool animateCardScale = false, Duration? dismissedCardDuration})
-
Create a stack of card with a specified length, via the
count
parameter.
Properties
- alignment → Alignment?
-
Cards alignment. Default it's Alignment.center.
final
- animateCardScale → bool
-
Animate the card using a smooth transition.
It's better to use with opacityChangeOnDrag set on
true
.final - cardDismissOrientation → CardOrientation
-
Direction where the card could be dismissed and removed from the list
By default is CardOrientation.both.
final
-
cardList
→ List<
CardModel> -
List of card shown.
final
- dismissedCardDuration → Duration?
-
The appear duration time for the back card on the stack,
when the card on the top is dismissed
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onCardTap → dynamic Function(CardModel)?
-
If not null, the function will be invoked on the tap of the card.
final
- opacityChangeOnDrag → bool
-
Change card opacity on drag (by default is disabled).
final
- positionFactor → double
-
Distance factor between items.
final
- reverseOrder → bool
-
Should show list in reverse order. By default is
false
.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleFactor → double
-
Scale factor for items into the list.
final
- swipeOrientation → CardOrientation
-
Drag direction enabled. By default is CardOrientation.both.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → CardStackWidgetState -
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
Constants
- positionFactorDefault → const double
- Default value for positionFactor.
- scaleFactorDefault → const double
- Default value for scaleFactor.