Gallery constructor
const
Gallery({
- Key? key,
- required int initialIndex,
- required int dismissDragDistance,
- required Color backgroundColor,
- required double opacity,
- required void setBackgroundOpacity(),
- int? itemCount,
- IndexedWidgetBuilder? itemBuilder,
- List<
Widget> ? children, - int? transitionDuration,
- PageController? controller,
- void onSwipe()?,
- 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);