flutter_lightbox 0.1.3 copy "flutter_lightbox: ^0.1.3" to clipboard
flutter_lightbox: ^0.1.3 copied to clipboard

A Simple Lightbox Component for Flutter with swiping and thumbnail capabilities. Created as I could not find any lightbox components that met my needs.

Open Source Love License

A Simple Lightbox Component for Flutter with swiping and thumbnail capabilities, supports many customisation features. 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.network 
        );
      },
    );

For example of usage, please refer to example.

Customisation #

Misc

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

Image

  • initialIndex - initial image shown
  • imageWidth - width of Image
  • imageHeight - height of Image
  • imageFit - BoxFit of Image
  • imageType - ImageType of Image (assetImage, network)

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';
4
likes
160
points
90
downloads

Publisher

unverified uploader

Weekly Downloads

A Simple Lightbox Component for Flutter with swiping and thumbnail capabilities. Created as I could not find any lightbox components that met my needs.

Repository (GitHub)

Topics

#flutter #lighthbox #carousel #widget #images

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_lightbox