Gallery constructor

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

Implementation

const Gallery({
  Key? key,
  required this.initialIndex,
  required this.dismissDragDistance,
  required this.scrollDirection,
  required this.backgroundColor,
  required this.opacity,
  required this.dragEnabled,
  required this.setBackgroundOpacity,
  this.reverseDirection,
  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,
      ),
      super(key: key);