show static method

void show(
  1. List<String> imageUrls, {
  2. BuildContext? context,
  3. int initialPage = 0,
  4. String? heroTagPrefix = '',
})

Implementation

static void show(
  List<String> imageUrls, {
  BuildContext? context,
  int initialPage = 0,
  String? heroTagPrefix = '',
}) {
  var previewView = BZPreviewView(
    imageUrls: imageUrls,
    pageController: PageController(initialPage: initialPage),
    heroTagPrefix: heroTagPrefix,
  );

  if (context == null) {
    Get.dialog(previewView, useSafeArea: false);
  } else {
    Navigator.push(
      context,
      PageRouteBuilder(
        pageBuilder: (context, animation, secondaryAnimation) => previewView,
        transitionsBuilder: (context, animation, secondaryAnimation, child) =>
            FadeTransition(
          opacity: animation,
          child: child,
        ),
      ),
    );
  }
}