@@ -23,7 +23,7 @@ class IntellectCreate { | |||
if (state == AppLifecycleState.resumed && !isRequest) { | |||
isRequest = true; | |||
try { | |||
_requestSetData(context); | |||
await _requestSetData(context); | |||
} catch (e, s) { | |||
isRequest = false; | |||
print(e); | |||
@@ -76,7 +76,7 @@ class IntellectCreate { | |||
static checkAndCreateFirst(BuildContext context) async { | |||
///检查规则 | |||
IntellectCreate.checkAndCreate(AppLifecycleState.resumed, context); | |||
await IntellectCreate.checkAndCreate(AppLifecycleState.resumed, context); | |||
} | |||
///请求数据打开弹窗 | |||
@@ -47,7 +47,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver { | |||
Logger.error(error); | |||
} | |||
Constants.isShowIntellectDialog = false; | |||
AppUpdateUtil.updateApp(context); | |||
TaobaoAuth.initAuth(context); | |||
// 弹窗 | |||
@@ -212,7 +212,10 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver { | |||
// 活动弹窗 | |||
await ActivityDialog.show(context); | |||
await AppUpdateUtil.updateApp(context); | |||
IntellectCreate.checkAndCreateFirst(context); | |||
} | |||
// 场景还原,记录邀请码 | |||
@@ -107,7 +107,7 @@ class _GoodsDetailsImgWidgetContainerState extends State<GoodsDetailsImgWidgetCo | |||
placeholder: (context, url) { | |||
return AspectRatio( | |||
aspectRatio: 1 / 1, | |||
child: _shimmerWidget( | |||
child: shimmerWidget( | |||
height: double.infinity, | |||
width: double.infinity, | |||
), | |||
@@ -116,7 +116,7 @@ class _GoodsDetailsImgWidgetContainerState extends State<GoodsDetailsImgWidgetCo | |||
progressIndicatorBuilder: (context, url, progress) { | |||
return AspectRatio( | |||
aspectRatio: 1 / 1, | |||
child: _shimmerWidget( | |||
child: shimmerWidget( | |||
height: double.infinity, | |||
width: double.infinity, | |||
), | |||
@@ -160,26 +160,28 @@ class _GoodsDetailsImgWidgetContainerState extends State<GoodsDetailsImgWidgetCo | |||
); | |||
} | |||
/// 骨架视图 | |||
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)), | |||
// ), | |||
// ); | |||
//修改后返回默认图片 | |||
return Image.asset( | |||
'assets/images/occupation_map/occupation_map.png', | |||
package: 'zhiying_base_widget', | |||
width: width, | |||
height: height, | |||
fit: BoxFit.fill, | |||
); | |||
} | |||
} | |||
/// 骨架视图 | |||
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)), | |||
// ), | |||
// ); | |||
//修改后返回默认图片 | |||
return Image.asset( | |||
'assets/images/occupation_map/occupation_map.png', | |||
package: 'zhiying_base_widget', | |||
width: width, | |||
height: height, | |||
fit: BoxFit.fill, | |||
); | |||
} |
@@ -1,6 +1,7 @@ | |||
import 'package:flutter/material.dart'; | |||
import 'package:flutter_bloc/flutter_bloc.dart'; | |||
import 'package:flutter_swiper/flutter_swiper.dart'; | |||
import 'package:zhiying_base_widget/widgets/goods_details/detail_img/goods_details_img.dart'; | |||
import 'package:zhiying_base_widget/widgets/goods_details/slide_banner/bloc/goods_details_slide_banner_bloc.dart'; | |||
import 'package:zhiying_base_widget/widgets/goods_details/slide_banner/bloc/goods_details_slide_banner_repository.dart'; | |||
import 'package:zhiying_base_widget/widgets/goods_details/slide_banner/goods_details_slide_banner_sk.dart'; | |||
@@ -102,7 +103,7 @@ class _GoodsDetailsSlideBannerContainerState | |||
Widget _getMainWidget(GoodsDetailsSlideBannerModel datas) { | |||
return Container( | |||
width: double.infinity, | |||
height: 375, | |||
height: MediaQuery.of(context).size.width, | |||
child: Swiper( | |||
controller: _control, | |||
itemBuilder: (BuildContext context, int index) { | |||
@@ -114,7 +115,25 @@ class _GoodsDetailsSlideBannerContainerState | |||
: Hero( | |||
tag: items + "top", | |||
child: CachedNetworkImage( | |||
imageUrl: items ?? '', fit: BoxFit.cover)), | |||
placeholder: (context, url) { | |||
return AspectRatio( | |||
aspectRatio: 1 / 1, | |||
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, | |||
), | |||
); | |||
}, | |||
imageUrl: items ?? '', fit: BoxFit.fitWidth)), | |||
); | |||
}, | |||
itemCount: datas?.image_list?.length ?? 0, | |||