ScaledList constructor

const ScaledList({
  1. Key? key,
  2. required Widget itemBuilder(
    1. int index,
    2. int selectedIndex
    ),
  3. required int itemCount,
  4. required Color itemColor(
    1. int index
    ),
  5. bool showDots = true,
  6. double cardWidthRatio = 0.6,
  7. double marginWidthRatio = 0.1,
  8. double selectedCardHeightRatio = 0.4,
  9. double unSelectedCardHeightRatio = 0.3,
})

Implementation

const ScaledList({
  Key? key,
  required this.itemBuilder,
  required this.itemCount,
  required this.itemColor,
  this.showDots = true,
  this.cardWidthRatio = 0.6,
  this.marginWidthRatio = 0.1,
  this.selectedCardHeightRatio = 0.4,
  this.unSelectedCardHeightRatio = 0.3,
})  : assert(cardWidthRatio + marginWidthRatio >= 0.5,
          " Card width + margin width should exceed 0.5 of the screen"),
      assert(selectedCardHeightRatio > unSelectedCardHeightRatio,
          " selectedCardHeight should alwayes excceed the unSelectedCardHeight to show desire effect");