Open Source Love License

A Simple Lightbox Component for Flutter with swiping and thumbnail capabilities. If you have any suggestions or improvements, feel free to raise issues or contribute by creating pull requests.

Demo

Features

  • Supports Image.Asset and Image.Network
  • Swiping left and right
  • Animation for Swiping
  • Clickable Thumbnails

Example Usage

Wrap your images with an InkWell and add this to the onTap function().

    showGeneralDialog(
      context: context,
      pageBuilder: (BuildContext context, Animation animation,
          Animation secondaryAnimation) {
        return LightBox(
          initialIndex: index,
          images: images,
          imageType: imageType,
        );
      },
    );

For example of usage, please refer to example.

Customisation

Misc

  • blur - background blur
  • animationType - Curves (reference)
  • animationDuration - how long is the swipe animation

Image

  • imageWidth - width of Image
  • imageHeight - height of Image
  • imageFit - BoxFit of Image

Thumbnail

  • thumbnailWidth - width of thumbnail
  • thumbnailHeight - height of thumbnail
  • thumbnailBorderSize - size of thumbnail border
  • thumbNailBorderRadius - border radius of thumbnail
  • thumbNailFocusedBorderColor - thumbnail focused border color
  • thumbNailUnFocusedBorderColor - thumbnail unfocused border color
  • thumbNailUnfocusedOpacity - thumbnail unfocused opacity
  • thumbNailGap - EdgeInset - how far apart are each thumbnail from one another
  • thumbNailFit - BoxFit of thumbnail
  • thumbNailMarginFromBottom - thumbnail margin bottom

Installation

Run this command:

flutter pub add flutter_lightbox

Import It

Now in your Dart Code, you can use:

import 'package:flutter_lightbox/flutter_lightbox.dart';