This commit is contained in:
2025-03-04 18:49:40 +02:00
parent 4c85540558
commit d3b6bc5b38
3 changed files with 10 additions and 10 deletions

View File

@@ -112,7 +112,7 @@ class AstromicImage extends StatelessWidget {
/// Used when the height is Master and want to set fixed height OR if width is Master and want to constraint the height
final double? fixedHeight;
//S1 -- STYLING
final bool? isCircular;
final bool isCircular;
final double? borderWidth;
final Color? borderColor;
final EdgeInsetsGeometry? borderPadding;
@@ -181,14 +181,14 @@ class AstromicImage extends StatelessWidget {
)
: null;
Widget buildImage(Size size) {
Widget buildImage(Size size) {
return Stack(
children: <Widget>[
OctoImage(
key: ValueKey<String>(assetType == _DeclaredAssetType.bytes ? (assetRef as Uint8List).length.toString() : assetRef),
//
width: size.width,
height: size.height,
height: size.height == double.infinity? null : size.height,
fit: fit,
alignment: alignment,
filterQuality: FilterQuality.none,
@@ -196,7 +196,6 @@ class AstromicImage extends StatelessWidget {
colorBlendMode: blendMode ?? (isSVG ? BlendMode.srcATop : null),
//
errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {
debugPrint('AstromicImage Error: $error');
return errorWidget != null
? errorWidget!(error, stackTrace)
: assetFallback != null
@@ -206,7 +205,7 @@ class AstromicImage extends StatelessWidget {
//
progressIndicatorBuilder: (_, ImageChunkEvent? bytes) => SizedBox(
width: size.width,
height: size.height,
height: size.height == double.infinity? null : size.height,
child: loadingWidget != null ? loadingWidget!(bytes?.cumulativeBytesLoaded, bytes?.expectedTotalBytes) : defaultLoadingWidget,
),
// placeholderBuilder: (BuildContext context) => loadingWidget != null ? loadingWidget!(null, null) : defaultLoadingWidget,
@@ -214,7 +213,7 @@ class AstromicImage extends StatelessWidget {
fadeInDuration: fadeInDuration,
imageBuilder: (BuildContext context, Widget image) => Container(
width: size.width,
height: size.height,
height: size.height == double.infinity? null : size.height,
padding: borderPadding ?? EdgeInsets.zero,
margin: EdgeInsets.zero,
decoration: BoxDecoration(
@@ -224,15 +223,15 @@ class AstromicImage extends StatelessWidget {
color: borderColor ?? const Color(0xff000000),
)
: null,
borderRadius: isCircular! ? BorderRadius.circular(10000000) : radius,
borderRadius: isCircular ? BorderRadius.circular(10000000) : radius,
boxShadow: shadow,
),
child: isCircular!
child: isCircular
? ClipOval(
child: isSVG ? finalSVGWidget(size, loadingWidget != null ? loadingWidget!(null, null) : defaultLoadingWidget) : image,
)
: ClipRRect(
borderRadius: isCircular! ? BorderRadius.circular(10000000) : radius!,
borderRadius: isCircular ? BorderRadius.circular(10000000) : radius!,
child: isSVG ? finalSVGWidget(size, loadingWidget != null ? loadingWidget!(null, null) : defaultLoadingWidget) : image,
),
),

View File

@@ -61,7 +61,7 @@ class AstromicWidgets {
/// Used when the height is Master and want to set fixed height OR if width is Master and want to constraint the height
fixedHeight: fixedHeight,
isCircular: isCircular,
isCircular: isCircular ?? false,
borderWidth: borderWidth,
borderColor: borderColor,
borderPadding: borderPadding,