Gallery constructor

const Gallery({
  1. required int initialIndex,
  2. required int dismissDragDistance,
  3. required Color backgroundColor,
  4. required double opacity,
  5. required void setBackgroundOpacity(
    1. double
    ),
  6. int? itemCount,
  7. IndexedWidgetBuilder? itemBuilder,
  8. List<Widget>? children,
  9. int? transitionDuration,
  10. PageController? controller,
  11. void onSwipe(
    1. int
    )?,
  12. List<ImageGalleryHeroProperties>? heroProperties,
})

Implementation

const Gallery({
  required this.initialIndex,
  required this.dismissDragDistance,
  required this.backgroundColor,
  required this.opacity,
  required this.setBackgroundOpacity,
  this.itemCount,
  this.itemBuilder,
  this.children,
  this.transitionDuration,
  this.controller,
  this.onSwipe,
  this.heroProperties,
})  : assert(
        (children != null &&
                children.length > 0 &&
                itemCount == null &&
                itemBuilder == null) ||
            (itemCount != null &&
                itemCount > 0 &&
                itemBuilder != null &&
                children == null),
      ),
      assert(
        (heroProperties != null &&
                heroProperties.length == (children?.length ?? itemCount)) ||
            heroProperties == null,
      );