AdaptiveDeck constructor
const
AdaptiveDeck({
- Key? key,
- required List<
AdaptiveDeckItem> items, - AdaptiveSize gridAt = AdaptiveSize.medium,
- AdaptiveHeight minimumGridHeight = AdaptiveHeight.compact,
- bool useContainerConstraints = true,
- bool considerOrientation = false,
- double minColumnWidth = 280,
- double columnSpacing = 16,
- double rowSpacing = 16,
- double compactHeight = 320,
- double compactViewportFraction = 0.9,
- double pageSpacing = 16,
- EdgeInsetsGeometry cardPadding = const EdgeInsets.all(16),
- int initialIndex = 0,
- ValueChanged<
int> ? onSelectedIndexChanged, - bool showPageIndicator = true,
- bool animateTransitions = true,
- Duration transitionDuration = const Duration(milliseconds: 250),
- 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.');