calculate image aspect ratio for more accurate blurhash
This commit is contained in:
parent
ed0292468a
commit
1d6a121ec4
1 changed files with 29 additions and 13 deletions
|
|
@ -316,19 +316,35 @@ class EventRenderer extends ConsumerWidget {
|
||||||
) => loadingProgress == null
|
) => loadingProgress == null
|
||||||
? child
|
? child
|
||||||
: switch (info?.blurHash) {
|
: switch (info?.blurHash) {
|
||||||
final blurHash? => SizedBox(
|
final blurHash? =>
|
||||||
width:
|
info?.width ==
|
||||||
info?.width ??
|
null ||
|
||||||
info?.height ??
|
info?.height ==
|
||||||
200,
|
null
|
||||||
height:
|
? SizedBox(
|
||||||
info?.height ??
|
width:
|
||||||
info?.width ??
|
200,
|
||||||
200,
|
height:
|
||||||
child: BlurHash(
|
200,
|
||||||
hash: blurHash,
|
child: BlurHash(
|
||||||
),
|
hash:
|
||||||
),
|
blurHash,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: AspectRatio(
|
||||||
|
aspectRatio:
|
||||||
|
info!
|
||||||
|
.width! /
|
||||||
|
info.height!,
|
||||||
|
child: SizedBox(
|
||||||
|
width: info
|
||||||
|
.width,
|
||||||
|
child: BlurHash(
|
||||||
|
hash:
|
||||||
|
blurHash,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
_ => Loading(),
|
_ => Loading(),
|
||||||
},
|
},
|
||||||
errorBuilder:
|
errorBuilder:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue