Gallery in Flutterflow

Hello everyone, please does anyone know how to create a gallery with lightbox. I have tried using gallery image viewer package to create a custom widget but i keep getting this error "The method 'GalleryImageViewer' isn't defined for the type 'MyGalleryImageViewer'. Try correcting the name to the name of an existing method, or defining a method named 'GalleryImageViewer'

This is the code i used

import 'package:gallery_image_viewer/gallery_image_viewer.dart';

class MyGalleryImageViewer extends StatelessWidget {
  final List<String> imageUrls;
  final int initialIndex;

  const MyGalleryImageViewer({
    Key? key,
    required this.imageUrls,
    this.initialIndex = 0,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GalleryImageViewer(
      images: imageUrls,
      initialIndex: initialIndex,
    );
  }
}
1
7 replies