mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 04:19:50 +00:00
refactor: Update CakeImageWidget to allow nullable BoxFit (#2326)
This commit is contained in:
parent
65402ba1eb
commit
c6cb48096d
2 changed files with 5 additions and 8 deletions
|
@ -1,6 +1,5 @@
|
|||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
||||
import 'package:cake_wallet/themes/core/material_base_theme.dart';
|
||||
import 'package:cake_wallet/utils/responsive_layout_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
|
|
|
@ -7,7 +7,7 @@ class CakeImageWidget extends StatelessWidget {
|
|||
this.imageUrl,
|
||||
this.height,
|
||||
this.width,
|
||||
this.fit = BoxFit.cover,
|
||||
this.fit,
|
||||
this.loadingWidget,
|
||||
this.errorWidget,
|
||||
this.color,
|
||||
|
@ -16,7 +16,7 @@ class CakeImageWidget extends StatelessWidget {
|
|||
final String? imageUrl;
|
||||
final double? height;
|
||||
final double? width;
|
||||
final BoxFit fit;
|
||||
final BoxFit? fit;
|
||||
final Widget? loadingWidget;
|
||||
final Widget? errorWidget;
|
||||
final Color? color;
|
||||
|
@ -37,8 +37,7 @@ class CakeImageWidget extends StatelessWidget {
|
|||
imageUrl!,
|
||||
height: height,
|
||||
width: width,
|
||||
fit: fit,
|
||||
color: color,
|
||||
fit: fit ?? BoxFit.contain,
|
||||
)
|
||||
: Image.asset(
|
||||
imageUrl!,
|
||||
|
@ -53,8 +52,7 @@ class CakeImageWidget extends StatelessWidget {
|
|||
imageUrl!,
|
||||
height: height,
|
||||
width: width,
|
||||
fit: fit,
|
||||
color: color,
|
||||
fit: fit ?? BoxFit.contain,
|
||||
placeholderBuilder: (_) {
|
||||
return loadingWidget ?? const Center(child: CircularProgressIndicator());
|
||||
},
|
||||
|
@ -64,7 +62,7 @@ class CakeImageWidget extends StatelessWidget {
|
|||
imageUrl!,
|
||||
height: height,
|
||||
width: width,
|
||||
fit: fit,
|
||||
fit: fit ?? BoxFit.cover,
|
||||
color: color,
|
||||
loadingBuilder: (_, Widget child, ImageChunkEvent? progress) {
|
||||
if (progress == null) return child;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue