Browse Source

1、商品详情图片的加载中占位

2、微信的key
tags/0.0.2+15^0
PH2 3 years ago
parent
commit
112b5c1d7f
4 changed files with 32 additions and 22 deletions
  1. +10
    -20
      example/android/app/build.gradle
  2. BIN
     
  3. +1
    -1
      example/android/app/src/main/res/drawable/launch_background.xml
  4. +21
    -1
      lib/widgets/goods_details/detail_img/goods_details_img.dart

+ 10
- 20
example/android/app/build.gradle View File

@@ -107,31 +107,14 @@ android {
} }




// // 签名配置
// signingConfigs {
// // 智夜生活
// zhiying {
// storeFile file('zhiying.jks')
// storePassword 'zhioscom'
// keyAlias 'zysh'
// keyPassword 'zhioscom'
// v1SigningEnabled true
// v2SigningEnabled true
// }
//
// }
//
// flavorDimensions "app"
//
//
// // 应用信息配置
// 应用信息配置
// productFlavors { // productFlavors {
// // 智夜生活 // // 智夜生活
// zhiying { // zhiying {
// applicationId "cn.zhios.zhiying" // applicationId "cn.zhios.zhiying"
// versionCode 3
// versionCode 14
// dimension "app" // dimension "app"
// versionName '1.0.3'
// versionName '1.1.4'
// // 签名信息 // // 签名信息
// signingConfig signingConfigs.zhiying // signingConfig signingConfigs.zhiying
// } // }
@@ -229,6 +212,13 @@ MobSDK {
bypassApproval false bypassApproval false
enable true enable true
} }
Wechat {
appId "wx598aaef252cd78e4"
appSecret "d2fc2edf9ece746765b3bfc0bf1b230e"
withShareTicket true
bypassApproval false
enable true
}
WechatMoments { WechatMoments {
enable true enable true
} }


BIN
View File


+ 1
- 1
example/android/app/src/main/res/drawable/launch_background.xml View File

@@ -6,6 +6,6 @@
<!-- You can insert your own image assets here --> <!-- You can insert your own image assets here -->
<item> <item>
<bitmap <bitmap
android:src="@drawable/bg_launcher" />
android:src="@mipmap/start" />
</item> </item>
</layer-list> </layer-list>

+ 21
- 1
lib/widgets/goods_details/detail_img/goods_details_img.dart View File

@@ -4,6 +4,7 @@ import 'package:zhiying_base_widget/widgets/goods_details/detail_img/bloc/goods_
import 'package:zhiying_base_widget/widgets/goods_details/detail_img/goods_details_img_sk.dart'; import 'package:zhiying_base_widget/widgets/goods_details/detail_img/goods_details_img_sk.dart';
import 'package:zhiying_base_widget/widgets/goods_details/detail_img/model/goods_details_img_model.dart'; import 'package:zhiying_base_widget/widgets/goods_details/detail_img/model/goods_details_img_model.dart';
import 'package:zhiying_comm/zhiying_comm.dart'; import 'package:zhiying_comm/zhiying_comm.dart';
import 'package:shimmer/shimmer.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:zhiying_base_widget/widgets/goods_details/detail_img/bloc/goods_details_img_repository.dart'; import 'package:zhiying_base_widget/widgets/goods_details/detail_img/bloc/goods_details_img_repository.dart';


@@ -111,7 +112,13 @@ class _GoodsDetailsImgWidgetContainerState
placeholder: (context, url){ placeholder: (context, url){
return AspectRatio( return AspectRatio(
aspectRatio: 1/1, aspectRatio: 1/1,
child: Container(color: Colors.white, height: double.infinity, width: double.infinity,),
child: _shimmerWidget(height: double.infinity, width: double.infinity,),
);
},
progressIndicatorBuilder: (context, url ,progress){
return AspectRatio(
aspectRatio: 1/1,
child: _shimmerWidget(height: double.infinity, width: double.infinity,),
); );
}, },
), ),
@@ -151,4 +158,17 @@ class _GoodsDetailsImgWidgetContainerState
], ],
); );
} }

/// 骨架视图
Widget _shimmerWidget({double width, double height, double radius = 0}) {
return Shimmer.fromColors(
baseColor: Colors.grey[300],
highlightColor: Colors.grey[100],
child: Container(
width: width,
height: height,
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(radius)),
),
);
}
} }

Loading…
Cancel
Save