AdaptiveGallery constructor
const
AdaptiveGallery({
- Key? key,
- required List<
AdaptiveGalleryItem> items, - AdaptiveSize spotlightAt = AdaptiveSize.medium,
- AdaptiveHeight minimumSpotlightHeight = AdaptiveHeight.compact,
- bool useContainerConstraints = true,
- bool considerOrientation = false,
- double selectorWidth = 240,
- int previewFlex = 3,
- double spacing = 16,
- double previewSpacing = 16,
- double selectorItemSpacing = 12,
- double compactHeight = 380,
- double compactViewportFraction = 0.92,
- 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 gallery surface.
Implementation
const AdaptiveGallery({
super.key,
required this.items,
this.spotlightAt = AdaptiveSize.medium,
this.minimumSpotlightHeight = AdaptiveHeight.compact,
this.useContainerConstraints = true,
this.considerOrientation = false,
this.selectorWidth = 240,
this.previewFlex = 3,
this.spacing = 16,
this.previewSpacing = 16,
this.selectorItemSpacing = 12,
this.compactHeight = 380,
this.compactViewportFraction = 0.92,
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(selectorWidth > 0, 'selectorWidth must be greater than zero.'),
assert(previewFlex > 0, 'previewFlex must be greater than zero.'),
assert(spacing >= 0, 'spacing must be zero or greater.'),
assert(previewSpacing >= 0, 'previewSpacing must be zero or greater.'),
assert(
selectorItemSpacing >= 0,
'selectorItemSpacing 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.');