-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update examples (blurhash) #31
Comments
same .blurHash is not defined |
/// Simple set to show [OctoPlaceholder.circularProgressIndicator] as OctoPlaceholderBuilder blurHashPlaceholderBuilder(String hash, {BoxFit? fit}) { OctoErrorBuilder blurHashErrorBuilder( is this the way? |
I'm also using OctoImage with blurHash and it works great for ^1.0.2. It'd be great if you could document how to migrate to ^2.0.0 and overcome this. |
For those interested, I fixed on my side by introducing this class : class OctoBlurHashFix {
static OctoPlaceholderBuilder placeHolder(String hash, {BoxFit? fit}) {
return (context) => SizedBox.expand(
child: Image(
image: BlurHashImage(hash),
fit: fit ?? BoxFit.cover,
),
);
}
static OctoErrorBuilder error(
String hash, {
BoxFit? fit,
Text? message,
IconData? icon,
Color? iconColor,
double? iconSize,
}) {
return OctoError.placeholderWithErrorIcon(
placeHolder(hash, fit: fit),
message: message,
icon: icon,
iconColor: iconColor,
iconSize: iconSize,
);
}
} Then, replace your usages of OctoError.blurhash and OctoPlaceholder.blurhash : OctoImage(
colorBlendMode: BlendMode.modulate,
fit: BoxFit.cover,
image: CachedNetworkImageProvider(imageUrl),
placeholderBuilder: OctoBlurHashFix.placeHolder(placeHolderBlurHashString),
errorBuilder: OctoBlurHashFix.error(errorBlurHashString, iconColor: Colors.transparent),
), You may also have to add the blurhash dependency |
It seems blurhash has been removed - but the first example in the documentation still showcases how to use it:
Yet there is no
OctoPlacholder.blurHash(...)
method anymore. Please update the examples!The text was updated successfully, but these errors were encountered: