Gallery constructor

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

Implementation

const Gallery({
  Key? key,
  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,
      ),
      super(key: key);