fnx_gallery 0.0.7

  • README.md
  • Installing
  • Versions
  • 0

fnx_gallery

Easy to use AngularDart gallery component.

Getting started

First of all, in a Dart app you have to prepare list of images and optionally some caption provider:

List<Image> images = [];

List<String> names = [
  "butterfly.jpg",
  "tunnel.jpg",
  "coast.jpg",
  "flower.jpg",
  "meadow.jpg",
];

ExampleComponent() {
  for (var name in names) {
    name = "imgs/$name";
    Image i = new Image(name, thumbSrc: name+"?thumg=1", htmlCaptionProvider: () => name);
    images.add(i);
  }
}

In your template, you can use the component like this:

<fnx-gallery
    [images]="images"
    [withCaptions]="true"
    [withThumbnails]="true"></fnx-gallery>
    ...

Caption provider

htmlCaptionProvider is a function which returns FutureOr<String> and you can use is to fetch your image caption from an asynchronous source (server, etc.).

Caption is handled as HTML, and is displayed using innerHtml with NodeTreeSanitizer.trusted, please make sure your caption can be TRUSTED!

Your user can navigate through your gallery by simply pressing the left/right buttons or on mobile also by swiping to left or right.

fnx_gallery package contains <fnx-gallery> element. It's a simple position: fixed; element which you can use as a gallery.

Specify dependency in pubspec.yaml:

dependencies:
  fnx_gallery: ^0.0.7

Run pub get and in your "index.dart" (or whatever is the name of your main script):

import 'package:fnx_gallery/fnx_gallery.dart';

We recommended to use *ngIf to show and hide the gallery. <fnx-gallery> emits (close) event, which indicates that the user clicked on the close button (or pressed ESC key etc.). Hide the gallery after this event.

Element inputs

You use some of these AngularDart inputs to modify the element:

input namedata typepurpose
imagesListList of images of the gallery.
selectedImageImageSelected image object, default 0th.
withCaptionsboolShow captions below the images.
withThumbnailsboolShow thumbnails at the bottom of the gallery.

Contact

Fill-in a bugreport or feature request on Github issue tracking.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  fnx_gallery: ^0.0.7

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:fnx_gallery/fnx_gallery.dart';
  
Version Uploaded Documentation Archive
0.0.7 Jul 20, 2017 Go to the documentation of fnx_gallery 0.0.7 Download fnx_gallery 0.0.7 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0