패키지, 저장소 및 앱 카테고리 검색

gallery_image_viewer 표지
패키지 상세v1.2.0

gallery_image_viewer

핀치 앤 줌, 다중 이미지, 갤러리 이미지 및 내장된 전체 화면 대화 상자 지원이 있는 간편한 이미지 뷰어입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
726
좋아요
32
Pub 점수
150

패키지 설치

flutter pub add gallery_image_viewer

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

핀치 줌, 다중 이미지 탐색 및 갤러리 스타일 브라우징을 지원하는 직관적인 이미지 뷰어를 제공하는 플러터 패키지입니다. 내장된 전체 화면 대화 상자 기능을 포함하여 다양한 플랫폼에서 이미지를 원활하고 사용자 친화적으로 표시하기에 적합합니다. 단순성과 성능을 고려해 설계되었으며, 복잡한 커스텀 구현 없이도 강력한 이미지 보기 기능이 필요한 앱에 쉽게 통합할 수 있습니다. 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스 등 모든 주요 플랫폼을 지원합니다.

사용 사례

  • 이미지 갤러리 표시
  • 확대 기능으로 고해상도 이미지 보기
  • 전체 화면 이미지 브라우징
  • 사진 앱에 이미지 뷰어 통합하기
  • 미디어 중심 앱에서 사용자 경험 향상

주요 기능

  • 핀치 줌 조작 지원
  • 다중 이미지 탐색
  • 내장형 전체 화면 대화 상자
  • 크로스 플랫폼 호환성
  • 최소 설정으로 간단한 통합
  • 갤러리 스타일 이미지 브라우징

적합한 대상

  • 사진 공유 앱
  • 전자상거래 제품 이미지 뷰어
  • 여행 또는 포트폴리오 앱
  • 교육 또는 문서 앱
  • 인터랙티브 이미지 탐색이 필요한 앱

고려 사항

  • 적절한 이미지 자산 관리가 필요합니다
  • 사용자 정의 UI를 위해 추가 스타일링이 필요할 수 있습니다
  • 성능은 이미지 크기와 수에 따라 달라집니다
  • 이미지 콘텐츠만 가능
  • 비디오 재생을 위한 설계가 아님

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

GalleryImageViewer

An easy way to display images in a full-screen dialog, including pinch & zoom.

Pub Tests license

Easy Image Viewer Demo

Features

  • Show a single image or a swipeable list of images
  • Use pinch & zoom to zoom in and out of images
  • Optionally allow "swipe down to dismiss" by passing in swipeDismissible: true
  • No dependencies besides Flutter
  • Callbacks for onPageChanged and onViewerDismissed

Usage

Show a Gallery image:

final List<ImageProvider> _imageProviders = [
    Image.network("https://picsum.photos/id/237/200/300").image,
    Image.network("https://picsum.photos/seed/picsum/200/300").image,
    Image.network("https://picsum.photos/200/300?grayscale").image,
    Image.network("https://picsum.photos/200/300").image,
    Image.network("https://picsum.photos/200/300?grayscale").image
  ];
GalleryImageView(
  listImage: _imageProviders,
  width: 200,
  height: 200,
  imageDecoration: BoxDecoration(border: Border.all(color: Colors.white)),
),

Show a single image:

final imageProvider = Image.network("https://picsum.photos/id/1001/5616/3744").image;
showImageViewer(context, imageProvider, onViewerDismissed: () {
  print("dismissed");
});

Show a bunch of images:

MultiImageProvider multiImageProvider = MultiImageProvider([
  Image.network("https://picsum.photos/id/1001/5616/3744").image,
  Image.network("https://picsum.photos/id/1003/1181/1772").image,
  Image.network("https://picsum.photos/id/1004/5616/3744").image,
  Image.network("https://picsum.photos/id/1005/5760/3840").image
]);

showImageViewerPager(context, multiImageProvider, onPageChanged: (page) {
  print("page changed to $page");
}, onViewerDismissed: (page) {
  print("dismissed while on page $page");
});

Usually you'll want to implement your own EasyImageProvider. Suppose you have a list of Products, each of which has an imagePath property with the path to a local image file. You could create an EasyImageProvider that takes a list of Products like this:

class ProductsImageProvider extends EasyImageProvider {

  final List<Product> products;
  final int initialIndex;

  ProductsImageProvider({ required this.products, this.initialIndex = 0 });

  @override
  ImageProvider<Object> imageBuilder(BuildContext context, int index) {
    String? localImagePath = products[index].imagePath;
    File? imageFile;

    if (localImagePath != null) {
      imageFile = File(localImagePath);
    }

    ImageProvider imageProvider = imageFile != null ? FileImage(imageFile) : AssetImage("assets/images/product_placeholder.jpg") as ImageProvider;

    return imageProvider;
  }

  @override
  int get imageCount => products.length;
}

You could then use it like this:

ProductsImageProvider productsImageProvider = ProductsImageProvider(products: products);

showImageViewerPager(context, productsImageProvider, onPageChanged: (page) {
  print("page changed to $page");
}, onViewerDismissed: (page) {
  print("dismissed while on page $page");
});

Credits

GalleryImageViewer is custom from EasyImageViewer. EasyImageViewer is a project by TSG, a full-service digital agency taking software from concept to launch. Our powerhouse team of designers and engineers build iOS, Android, and web apps across many industries.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.