flutter_sanity_image_url 0.0.2 copy "flutter_sanity_image_url: ^0.0.2" to clipboard
flutter_sanity_image_url: ^0.0.2 copied to clipboard

outdated

A flutter package to quickly generate sanity image urls.

Flutter Sanity Image URL #

A dart package to quickly generate sanity image urls. Ported from sanity-io/image-url.

Intented to be used together with the flutter_sanity package

Features #

  • Respects crops and hotspots specified in Sanity.
  • Can be used to set the width and/or height of the image.
  • Provides a builder to access the processing options available from Sanity.

Getting started #

dart pub add flutter_sanity
dart pub add flutter_sanity_image_url

Usage #

See /example for a full example.

Creating a builder: #

// sanityClient is an instance of SanityClient from flutter_sanity
final builder = ImageUrlBuilder(sanityClient);

ImageUrlBuilder urlFor(asset) {
  return builder.image(asset);
}

Using the builder: #

using the builder design patten the options can be added in a chain, always call url() at the end to get the actual url of the image.

Image.network(urlFor(image).size(200, 200).url())
6
likes
0
pub points
71%
popularity

Publisher

verified publishertechurve.nl

A flutter package to quickly generate sanity image urls.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_sanity_image_url