SwipeableCardsSection constructor

SwipeableCardsSection({
  1. Key? key,
  2. SwipeableCardSectionController? cardController,
  3. required BuildContext context,
  4. required List<Widget> items,
  5. Function? onCardSwiped,
  6. double cardWidthTopMul = 0.9,
  7. double cardWidthMiddleMul = 0.85,
  8. double cardWidthBottomMul = 0.8,
  9. double cardHeightTopMul = 0.6,
  10. double cardHeightMiddleMul = 0.55,
  11. double cardHeightBottomMul = 0.5,
  12. Function? appendItemCallback,
  13. bool enableSwipeUp = true,
  14. bool enableSwipeDown = true,
})

Implementation

SwipeableCardsSection({
  Key? key,
  this.cardController,
  required BuildContext context,
  required this.items,
  this.onCardSwiped,
  this.cardWidthTopMul = 0.9,
  this.cardWidthMiddleMul = 0.85,
  this.cardWidthBottomMul = 0.8,
  this.cardHeightTopMul = 0.6,
  this.cardHeightMiddleMul = 0.55,
  this.cardHeightBottomMul = 0.5,
  this.appendItemCallback,
  this.enableSwipeUp = true,
  this.enableSwipeDown = true,
}) {
  cardsSize[0] = Size(MediaQuery.of(context).size.width * cardWidthTopMul,
      MediaQuery.of(context).size.height * cardHeightTopMul);
  cardsSize[1] = Size(MediaQuery.of(context).size.width * cardWidthMiddleMul,
      MediaQuery.of(context).size.height * cardHeightMiddleMul);
  cardsSize[2] = Size(MediaQuery.of(context).size.width * cardWidthBottomMul,
      MediaQuery.of(context).size.height * cardHeightBottomMul);
}