openImage function

void openImage(
  1. BuildContext context,
  2. int index,
  3. List<String> unitImages,
  4. List<String>? captions,
  5. Map<String, String>? headers,
)

View Image(s)

Implementation

void openImage(BuildContext context, final int index, List<String> unitImages,
    List<String>? captions, Map<String, String>? headers) {
  Navigator.push(
    context,
    MaterialPageRoute(
      builder: (context) => GalleryPhotoViewWrapper(
        galleryItems: unitImages,
        captions: captions,
        backgroundDecoration: const BoxDecoration(
          color: Colors.black,
        ),
        initialIndex: index,
        scrollDirection: Axis.horizontal,
        headers: headers,
      ),
    ),
  );
}