AdaptiveDeck constructor

const AdaptiveDeck({
  1. Key? key,
  2. required List<AdaptiveDeckItem> items,
  3. AdaptiveSize gridAt = AdaptiveSize.medium,
  4. AdaptiveHeight minimumGridHeight = AdaptiveHeight.compact,
  5. bool useContainerConstraints = true,
  6. bool considerOrientation = false,
  7. double minColumnWidth = 280,
  8. double columnSpacing = 16,
  9. double rowSpacing = 16,
  10. double compactHeight = 320,
  11. double compactViewportFraction = 0.9,
  12. double pageSpacing = 16,
  13. EdgeInsetsGeometry cardPadding = const EdgeInsets.all(16),
  14. int initialIndex = 0,
  15. ValueChanged<int>? onSelectedIndexChanged,
  16. bool showPageIndicator = true,
  17. bool animateTransitions = true,
  18. Duration transitionDuration = const Duration(milliseconds: 250),
  19. Curve transitionCurve = Curves.easeInOutCubic,
})

Creates an adaptive deck surface.

Implementation

const AdaptiveDeck({
  super.key,
  required this.items,
  this.gridAt = AdaptiveSize.medium,
  this.minimumGridHeight = AdaptiveHeight.compact,
  this.useContainerConstraints = true,
  this.considerOrientation = false,
  this.minColumnWidth = 280,
  this.columnSpacing = 16,
  this.rowSpacing = 16,
  this.compactHeight = 320,
  this.compactViewportFraction = 0.9,
  this.pageSpacing = 16,
  this.cardPadding = const EdgeInsets.all(16),
  this.initialIndex = 0,
  this.onSelectedIndexChanged,
  this.showPageIndicator = true,
  this.animateTransitions = true,
  this.transitionDuration = const Duration(milliseconds: 250),
  this.transitionCurve = Curves.easeInOutCubic,
})  : assert(minColumnWidth > 0, 'minColumnWidth must be greater than zero.'),
      assert(columnSpacing >= 0, 'columnSpacing must be zero or greater.'),
      assert(rowSpacing >= 0, 'rowSpacing must be zero or greater.'),
      assert(compactHeight > 0, 'compactHeight must be greater than zero.'),
      assert(
        compactViewportFraction > 0 && compactViewportFraction <= 1,
        'compactViewportFraction must be between 0 and 1.',
      ),
      assert(pageSpacing >= 0, 'pageSpacing must be zero or greater.');