From 4df30af8264ee11e7b91cb92622a2c24a02d81cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=8D=8E=E8=BD=A9?= <646903573@qq.com> Date: Mon, 2 Nov 2020 18:53:37 +0800 Subject: [PATCH] =?UTF-8?q?1.=E9=92=B1=E5=8C=85=E6=98=8E=E7=BB=86=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=AA=A8=E6=9E=B6=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bil_detail_page/bil_detail_page.dart | 4 +- .../wallet_bil_detail/wallet_bil_sk.dart | 211 ++++++++++++++++++ 2 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 lib/widgets/wallet_bil_detail/wallet_bil_sk.dart diff --git a/lib/pages/bil_detail_page/bil_detail_page.dart b/lib/pages/bil_detail_page/bil_detail_page.dart index 4da82d7..13f9cd5 100644 --- a/lib/pages/bil_detail_page/bil_detail_page.dart +++ b/lib/pages/bil_detail_page/bil_detail_page.dart @@ -10,6 +10,8 @@ import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_bg_notifi import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_notifier.dart'; import 'package:zhiying_base_widget/utils/contants.dart'; import 'package:zhiying_base_widget/widgets/others/mine_header_bg_widget.dart'; +import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/wallet_detail_sk.dart'; +import 'package:zhiying_base_widget/widgets/wallet_bil_detail/wallet_bil_sk.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; import 'package:zhiying_comm/util/base_bloc.dart'; import 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart'; @@ -73,7 +75,7 @@ class _BilDetailPageContainerState extends State { stream: _bloc.outData, builder: (context, sny) { if (sny.data == null) { - return Container(); + return WalletBilDetailSkeleton(); } var model = sny.data; return Scaffold( diff --git a/lib/widgets/wallet_bil_detail/wallet_bil_sk.dart b/lib/widgets/wallet_bil_detail/wallet_bil_sk.dart new file mode 100644 index 0000000..4de4555 --- /dev/null +++ b/lib/widgets/wallet_bil_detail/wallet_bil_sk.dart @@ -0,0 +1,211 @@ +import 'package:flutter/material.dart'; +import 'package:shimmer/shimmer.dart'; + +class WalletBilDetailSkeleton extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + child: Shimmer.fromColors( + baseColor: Colors.grey[300], + highlightColor: Colors.grey[100], + child: Column( + children: [ + Container( + color: Colors.white, + height: 80, + ), + SizedBox( + height: 32, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + color: Colors.white, + height: 40, + width: 100, + ), + Container( + color: Colors.white, + height: 40, + width: 100, + ) + ], + ), + SizedBox( + height: 16, + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 40, + width: 80, + ), + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 40, + width: 80, + ), + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 40, + width: 80, + ), + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 40, + width: 80, + ) + ], + ), + Expanded( + child: ListView.builder( + itemCount: 3, + itemBuilder: _buildItem, + )) + ], + )), + ); + } + + Widget _buildItem(BuildContext context, int index) { + return Container( + margin: EdgeInsets.all(16), + child: Column( + children: [ + Row( + children: [ + Container( + color: Colors.white, + height: 20, + width: 40, + ), + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 20, + width: 100, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + children: [ + Container( + color: Colors.white, + height: 20, + width: 40, + ), + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 20, + width: 120, + ), + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 20, + width: 40, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + children: [ + Container( + color: Colors.white, + height: 20, + width: 40, + ), + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 20, + width: 100, + ), + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 20, + width: 40, + ), + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 20, + width: 100, + ), + ], + ), + SizedBox( + height: 8, + ), + Row( + children: [ + Container( + color: Colors.white, + height: 20, + width: 40, + ), + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 20, + width: 100, + ), + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 20, + width: 40, + ), + SizedBox( + width: 16, + ), + Container( + color: Colors.white, + height: 20, + width: 100, + ), + ], + ) + ], + ), + ); + } +}