feat:切换flutter版本
This commit is contained in:
1 parent
ee761ccc48
commit
72443f7abf
32 files changed
+536
-375
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:ducafe_ui_core/ducafe_ui_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -15,31 +16,11 @@ Widget appNetworkImg(
|
||||
double imgHeight = 60,
|
||||
BoxFit fit = BoxFit.cover,
|
||||
}) {
|
||||
return Image.network(
|
||||
src,
|
||||
width: imgWidth,
|
||||
height: imgHeight,
|
||||
fit: fit,
|
||||
loadingBuilder:
|
||||
(BuildContext context, Widget child, ImageChunkEvent? loadingProgress) {
|
||||
if (loadingProgress == null) {
|
||||
return child;
|
||||
} else {
|
||||
return Center(
|
||||
child: SizedBox(
|
||||
width: imgHeight,
|
||||
height: imgHeight,
|
||||
child: CircularProgressIndicator(
|
||||
value: loadingProgress.expectedTotalBytes != null
|
||||
? loadingProgress.cumulativeBytesLoaded /
|
||||
(loadingProgress.expectedTotalBytes ?? 1)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {
|
||||
return CachedNetworkImage(
|
||||
imageUrl: AppNetworkTool.ossImage(src),
|
||||
placeholder: (context, url) =>
|
||||
CircularProgressIndicator().width(50.w).height(50.w),
|
||||
errorWidget: (context, url, error) {
|
||||
final theme = FTheme.of(context);
|
||||
return FIcon(
|
||||
FAssets.icons.globeLock,
|
||||
@@ -48,19 +29,6 @@ Widget appNetworkImg(
|
||||
).width(imgWidth * 0.5).height(imgHeight * 0.5);
|
||||
},
|
||||
);
|
||||
// return CachedNetworkImage(
|
||||
// imageUrl: AppNetworkTool.ossImage(src),
|
||||
// placeholder: (context, url) =>
|
||||
// CircularProgressIndicator().width(50.w).height(50.w),
|
||||
// errorWidget: (context, url, error) {
|
||||
// final theme = FTheme.of(context);
|
||||
// return FIcon(
|
||||
// FAssets.icons.globeLock,
|
||||
// color: theme.colorScheme.error,
|
||||
// size: theme.typography.base.fontSize,
|
||||
// ).width(imgWidth * 0.5).height(imgHeight * 0.5);
|
||||
// },
|
||||
// );
|
||||
}
|
||||
|
||||
Widget appFileImg(
|
||||
|
||||
Reference in new issue
Block a user