From f0dbee5666ec2cbfeeaf22ed6a6f4865d0ffbaec Mon Sep 17 00:00:00 2001 From: wurong <953969641@qq.com> Date: Wed, 5 Jul 2023 16:11:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=BE=99=E9=AA=A8=E6=9E=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mine/mine_page.dart | 1 - lib/union/union_list.dart | 76 ++++++++++++++++++++++++++++++++++----- pubspec.lock | 7 ++++ pubspec.yaml | 2 ++ 4 files changed, 77 insertions(+), 9 deletions(-) diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index c1e2f4e8..98a91778 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -238,7 +238,6 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin { Container( height: 306.h, decoration: BoxDecoration( - // color: Color(0xFF32A060) image: DecorationImage( fit: BoxFit.fill, image: AssetImage("assets/image/settlement_bg.webp"), diff --git a/lib/union/union_list.dart b/lib/union/union_list.dart index d10df8c5..5f5e1964 100644 --- a/lib/union/union_list.dart +++ b/lib/union/union_list.dart @@ -11,6 +11,7 @@ import 'package:huixiang/view_widget/request_permission.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shimmer/shimmer.dart'; import '../view_widget/no_data_view.dart'; @@ -49,13 +50,20 @@ class _UnionList extends State { header: MyHeader(), onRefresh: widget.onRefresh, child: (widget.storeList == null || widget.storeList.length == 0) - ? NoDataView( - src:"assets/image/di_zhi.webp", - isShowBtn: false, - text: "暂无店铺列表~", - fontSize: 16.sp, - margin: EdgeInsets.only(top: 120.h), - ):ListView.builder( + ? ListView.builder( + itemCount:5, + padding: EdgeInsets.only( + top: 8.h, + bottom: 100.h, /* + (375.h - 88.h) + 4.h*/ + ), + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return InkWell( + onTap: () { + }, + child:sm(), + ); + }):ListView.builder( itemCount:widget.storeList == null ? 0 : widget.storeList.length, padding: EdgeInsets.only( top: 8.h, @@ -93,7 +101,8 @@ class _UnionList extends State { ); } }, - child: buildStoreItem(widget.storeList[position], position), + child: + buildStoreItem(widget.storeList[position], position), ); })), ) @@ -101,6 +110,57 @@ class _UnionList extends State { ); } + Widget sm(){ + return Container( + margin:EdgeInsets.symmetric(horizontal: 14.w,vertical: 8.h), + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(6), + ), + height: 223.h, + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + color: Color(0XFFD8D8D8), + width: double.infinity, + height: 140.h, + ), + ), + Padding(padding: EdgeInsets.only(left: 6.w,bottom: 5.h,top: 12.h), + child: Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 108.w, + height: 20.h, + ), + ),),Padding(padding: EdgeInsets.only(left: 6.w,), + child: Shimmer.fromColors( + baseColor: Color(0XFFD8D8D8), + highlightColor: Color(0XFFD8D8D8), + child: Container( + decoration: BoxDecoration( + color: Color(0XFFD8D8D8), + borderRadius: BorderRadius.circular(2), + ), + width: 260.w, + height: 20.h, + ), + ),), + ], + ), + ); + } + Widget buildSearchItem() { return Container( height: 36.h, diff --git a/pubspec.lock b/pubspec.lock index e71495c9..b78eaca5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -693,6 +693,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.3.6" + shimmer: + dependency: "direct main" + description: + name: shimmer + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.0" simple_gesture_detector: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 9f5cffaf..6f52ab0b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -106,6 +106,8 @@ dependencies: mqtt_client: ^9.6.8 + shimmer: ^3.0.0 + # 时间选择器 flutter_datetime_picker: ^1.5.1