AdaptiveGallery constructor

const AdaptiveGallery({
  1. Key? key,
  2. required List<AdaptiveGalleryItem> items,
  3. AdaptiveSize spotlightAt = AdaptiveSize.medium,
  4. AdaptiveHeight minimumSpotlightHeight = AdaptiveHeight.compact,
  5. bool useContainerConstraints = true,
  6. bool considerOrientation = false,
  7. double selectorWidth = 240,
  8. int previewFlex = 3,
  9. double spacing = 16,
  10. double previewSpacing = 16,
  11. double selectorItemSpacing = 12,
  12. double compactHeight = 380,
  13. double compactViewportFraction = 0.92,
  14. double pageSpacing = 16,
  15. EdgeInsetsGeometry cardPadding = const EdgeInsets.all(16),
  16. int initialIndex = 0,
  17. ValueChanged<int>? onSelectedIndexChanged,
  18. bool showPageIndicator = true,
  19. bool animateTransitions = true,
  20. Duration transitionDuration = const Duration(milliseconds: 250),
  21. 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.');