From 476392f42a8e5fb58f54f1431d611f462ff5915d Mon Sep 17 00:00:00 2001 From: PH2 <1293456824@qq.com> Date: Tue, 10 Nov 2020 14:12:45 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=9B=B4=E6=96=B0=E7=9A=84=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=202=E3=80=81=E6=B7=98=E5=AE=9D=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E5=A4=8D=203=E3=80=81=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E7=9A=84=E7=A9=BA=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/about_us_page/about_us_page.dart | 2 +- lib/pages/home_page/home_page.dart | 6 +- lib/pages/withdraw_page/withdraw_page.dart | 18 +- .../goods_details/coupon/counpon_widget.dart | 4 +- .../goods_details_evaluate_widget.dart | 5 +- .../footer/goods_details_footer_widget.dart | 8 +- lib/widgets/home/home_auth/home_auth.dart | 9 +- .../wallet_bil_detail/wallet_bil_detail.dart | 343 +++++------------- .../wallet_bil_detail/wallet_list_widget.dart | 0 9 files changed, 117 insertions(+), 278 deletions(-) create mode 100644 lib/widgets/wallet_bil_detail/wallet_list_widget.dart diff --git a/lib/pages/about_us_page/about_us_page.dart b/lib/pages/about_us_page/about_us_page.dart index 31881cf..5b5978d 100644 --- a/lib/pages/about_us_page/about_us_page.dart +++ b/lib/pages/about_us_page/about_us_page.dart @@ -37,7 +37,7 @@ class __AboutUsPageContainerState extends State<_AboutUsPageContainer> { /// 检查更新 void _onClickCheckUpdate() async{ Logger.log('点击了更新'); - // AppUpdateUtil.updateApp(context); + AppUpdateUtil.updateApp(context, needToast: true, mustShowDialog: true); } /// 给个评价 diff --git a/lib/pages/home_page/home_page.dart b/lib/pages/home_page/home_page.dart index b656dc2..7a451bb 100644 --- a/lib/pages/home_page/home_page.dart +++ b/lib/pages/home_page/home_page.dart @@ -34,10 +34,14 @@ class _HomePageState extends State<HomePage> { Logger.error(error); } Constants.isShowIntellectDialog = false; - // AppUpdateUtil.updateApp(context); + AppUpdateUtil.updateApp(context); + TaobaoAuth.initAuth(context); + super.initState(); } + + @override Widget build(BuildContext context) { ScreenUtil.init(context, width: 750, height: 1334); diff --git a/lib/pages/withdraw_page/withdraw_page.dart b/lib/pages/withdraw_page/withdraw_page.dart index 18ccdb6..31293bc 100644 --- a/lib/pages/withdraw_page/withdraw_page.dart +++ b/lib/pages/withdraw_page/withdraw_page.dart @@ -51,7 +51,7 @@ class _WithdrawContainerState extends State<_WithdrawContainer> { int _currentIndex = 0; TextEditingController _controller = TextEditingController(); - bool _submitable = true; + bool _submitable = false; bool _inputable = false; @override @@ -363,6 +363,19 @@ class _WithdrawContainerState extends State<_WithdrawContainer> { } Widget _createSubmit(WithdrawModel model) { + + String value = model.cashOutDashbordItems[_currentIndex].value; + try { + if (num.tryParse(value) != null && null != _bloc.withdrawDataModel && num.tryParse(value) < num.tryParse(_bloc.withdrawDataModel.finValue)) { + _submitable = true; + } else { + _submitable = false; + } + } catch (e, s) { + print(e); + print(s); + } + return GestureDetector( onTap: () { ///提现 @@ -424,8 +437,7 @@ class _WithdrawContainerState extends State<_WithdrawContainer> { void _checkSubmit(String value) { try { if (num.tryParse(value) != null && - num.tryParse(value) < - num.tryParse(_bloc.withdrawDataModel.finValue)) { + num.tryParse(value) < num.tryParse(_bloc.withdrawDataModel.finValue)) { _submitable = true; } else { _submitable = false; diff --git a/lib/widgets/goods_details/coupon/counpon_widget.dart b/lib/widgets/goods_details/coupon/counpon_widget.dart index 7825d6d..e76d216 100644 --- a/lib/widgets/goods_details/coupon/counpon_widget.dart +++ b/lib/widgets/goods_details/coupon/counpon_widget.dart @@ -72,8 +72,8 @@ class _CounponWidgetContainerState extends State<CounponWidgetContainer> { return; } if (model.provider== 'taobao') { - bool isAuth = await TaobaoAuth.isAuth(); - if (!isAuth) { + // bool isAuth = await TaobaoAuth.isAuth(); + if (!_user.isTBAuth) { TaobaoAuth.auth(context); return; } diff --git a/lib/widgets/goods_details/evaluate/goods_details_evaluate_widget.dart b/lib/widgets/goods_details/evaluate/goods_details_evaluate_widget.dart index c4776fd..938d758 100644 --- a/lib/widgets/goods_details/evaluate/goods_details_evaluate_widget.dart +++ b/lib/widgets/goods_details/evaluate/goods_details_evaluate_widget.dart @@ -34,13 +34,12 @@ class GoodsDetailsEvaluateWidget extends StatelessWidget { return; } - bool isAuth = await TaobaoAuth.isAuth(); - if (!isAuth) { + // bool isAuth = await TaobaoAuth.isAuth(); + if (!_user.isTBAuth) { TaobaoAuth.auth(context); return; } TradeResult result; - if (!EmptyUtil.isEmpty(_modell?.comment_url)) { if (Platform.isAndroid) { result = await FlutterAlibc.openByUrl(url: _modell?.comment_url, backUrl: "alisdk://"); diff --git a/lib/widgets/goods_details/footer/goods_details_footer_widget.dart b/lib/widgets/goods_details/footer/goods_details_footer_widget.dart index 3b7a6d9..aeda916 100644 --- a/lib/widgets/goods_details/footer/goods_details_footer_widget.dart +++ b/lib/widgets/goods_details/footer/goods_details_footer_widget.dart @@ -112,8 +112,8 @@ class _GooddsDetailsFooterContainerState return; } if (shopType == 'taobao') { - bool isAuth = await TaobaoAuth.isAuth(); - if (!isAuth) { + // bool isAuth = await TaobaoAuth.isAuth(); + if (!_user.isTBAuth) { TaobaoAuth.auth(context); return; } @@ -145,8 +145,8 @@ class _GooddsDetailsFooterContainerState return; } if (shopType == 'taobao') { - bool isAuth = await TaobaoAuth.isAuth(); - if (!isAuth) { + // bool isAuth = await TaobaoAuth.isAuth(); + if (!_user.isTBAuth) { TaobaoAuth.auth(context); return; } diff --git a/lib/widgets/home/home_auth/home_auth.dart b/lib/widgets/home/home_auth/home_auth.dart index 8d52c60..f8288c0 100644 --- a/lib/widgets/home/home_auth/home_auth.dart +++ b/lib/widgets/home/home_auth/home_auth.dart @@ -27,10 +27,9 @@ class _HomeAuthState extends State<HomeAuth> { @override void initState() { - TaobaoAuth.isAuth().then((isAuth) { - - setState(() => this._isAuth = isAuth); - }); + // TaobaoAuth.isAuth().then((isAuth) { + // setState(() => this._isAuth = isAuth); + // }); super.initState(); } @@ -38,7 +37,7 @@ class _HomeAuthState extends State<HomeAuth> { @override void didChangeDependencies() { _user = Provider.of<UserInfoNotifier>(context).userInfo; - _isAuth = _user.isTBAuth; + _isAuth = _user?.isTBAuth ?? false; super.didChangeDependencies(); } diff --git a/lib/widgets/wallet_bil_detail/wallet_bil_detail.dart b/lib/widgets/wallet_bil_detail/wallet_bil_detail.dart index 3f1824d..69cc4ac 100644 --- a/lib/widgets/wallet_bil_detail/wallet_bil_detail.dart +++ b/lib/widgets/wallet_bil_detail/wallet_bil_detail.dart @@ -6,7 +6,6 @@ import 'package:intl/intl.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:tab_indicator_styler/tab_indicator_styler.dart'; import 'package:zhiying_base_widget/dialog/select_date_ym_dialog/select_date_ym_dialog.dart'; -import 'package:zhiying_base_widget/widgets/empty/empty_widget.dart'; import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/wallet_detail_bloc.dart'; import 'package:zhiying_base_widget/widgets/wallet_bil_detail/wallet_bil_detail_widget_bloc.dart'; import 'package:zhiying_comm/util/base_bloc.dart'; @@ -27,8 +26,7 @@ class WalletBilDetail extends StatefulWidget { _WalletBilDetailState createState() => _WalletBilDetailState(); } -class _WalletBilDetailState extends State<WalletBilDetail> - with TickerProviderStateMixin, AutomaticKeepAliveClientMixin { +class _WalletBilDetailState extends State<WalletBilDetail> with TickerProviderStateMixin, AutomaticKeepAliveClientMixin { WalletBilDetailWidgetBloc _bloc; TabController _tabController; @@ -37,8 +35,7 @@ class _WalletBilDetailState extends State<WalletBilDetail> void initState() { _bloc = WalletBilDetailWidgetBloc(); _bloc.initStyleData(json.decode(widget.data['data'])); - _tabController = - TabController(length: _bloc.styleData.tabList.length, vsync: this); + _tabController = TabController(length: _bloc.styleData.tabList.length, vsync: this); _bloc.loadInputData(_bloc.inPutCurrentPage, _bloc.inputShowDate); _bloc.loadOutputData(_bloc.outPutCurrentPage, _bloc.outputShowDate); @@ -54,8 +51,7 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ AppBar( brightness: Brightness.light, - backgroundColor: - HexColor.fromHex(_bloc.styleData.appBarBgColor), + backgroundColor: HexColor.fromHex(_bloc.styleData.appBarBgColor), centerTitle: true, leading: IconButton( icon: Icon( @@ -68,10 +64,7 @@ class _WalletBilDetailState extends State<WalletBilDetail> }), title: Text( _bloc.styleData.appBarName ?? "", - style: TextStyle( - color: HexColor.fromHex(_bloc.styleData.appBarNameColor), - fontWeight: FontWeight.bold, - fontSize: 18), + style: TextStyle(color: HexColor.fromHex(_bloc.styleData.appBarNameColor), fontWeight: FontWeight.bold, fontSize: 18), ), ), Container( @@ -88,22 +81,15 @@ class _WalletBilDetailState extends State<WalletBilDetail> controller: _tabController, tabs: _buildTabBarItem(), indicatorWeight: 9.5, - labelStyle: - TextStyle(fontSize: 15, fontWeight: FontWeight.bold), - unselectedLabelStyle: - TextStyle(fontSize: 15, fontWeight: FontWeight.bold), + labelStyle: TextStyle(fontSize: 15, fontWeight: FontWeight.bold), + unselectedLabelStyle: TextStyle(fontSize: 15, fontWeight: FontWeight.bold), labelColor: HexColor.fromHex(_bloc.styleData.tabSeletedColor), - unselectedLabelColor: - HexColor.fromHex(_bloc.styleData.tabNoSeletedColor), - indicatorColor: - HexColor.fromHex(_bloc.styleData.tabLineColor), + unselectedLabelColor: HexColor.fromHex(_bloc.styleData.tabNoSeletedColor), + indicatorColor: HexColor.fromHex(_bloc.styleData.tabLineColor), indicatorSize: TabBarIndicatorSize.label, ), ), - Expanded( - child: TabBarView( - controller: _tabController, - children: _buildTabViewPage())) + Expanded(child: TabBarView(controller: _tabController, children: _buildTabViewPage())) ], ), )); @@ -139,14 +125,8 @@ class _WalletBilDetailState extends State<WalletBilDetail> }, child: Padding( padding: const EdgeInsets.only(top: 8, bottom: 8), - child: Text( - tabList.type == "input" - ? _bloc.inputShowDate - : _bloc.outputShowDate, - style: TextStyle( - fontSize: 28.sp, - color: HexColor.fromHex(_bloc.styleData.timeSelectColor), - fontWeight: FontWeight.bold))), + child: Text(tabList.type == "input" ? _bloc.inputShowDate : _bloc.outputShowDate, + style: TextStyle(fontSize: 28.sp, color: HexColor.fromHex(_bloc.styleData.timeSelectColor), fontWeight: FontWeight.bold))), ), Icon( Icons.arrow_drop_down, @@ -166,15 +146,11 @@ class _WalletBilDetailState extends State<WalletBilDetail> if (tabList.type == 'input') { _bloc.inputSelectType = tabViewBtns[index].type; _bloc.inPutCurrentPage = 1; - _bloc.loadInputData( - _bloc.inPutCurrentPage, _bloc.inputShowDate, - type: _bloc.inputSelectType); + _bloc.loadInputData(_bloc.inPutCurrentPage, _bloc.inputShowDate, type: _bloc.inputSelectType); } else { _bloc.outputSelectType = tabViewBtns[index].type; _bloc.outPutCurrentPage = 1; - _bloc.loadOutputData( - _bloc.outPutCurrentPage, _bloc.outputShowDate, - type: _bloc.outputSelectType); + _bloc.loadOutputData(_bloc.outPutCurrentPage, _bloc.outputShowDate, type: _bloc.outputSelectType); } _bloc.refresh(); }, @@ -182,24 +158,16 @@ class _WalletBilDetailState extends State<WalletBilDetail> child: Container( alignment: Alignment.center, margin: EdgeInsets.only(right: 12.5), - padding: EdgeInsets.only( - left: 16, right: 16, top: 2.5, bottom: 2.5), + padding: EdgeInsets.only(left: 16, right: 16, top: 2.5, bottom: 2.5), decoration: BoxDecoration( border: Border.all( - color: HexColor.fromHex( - selectType == tabViewBtns[index].type - ? _bloc.styleData.btnSelectedColor - : _bloc.styleData.btnNoSelectedColor), + color: HexColor.fromHex(selectType == tabViewBtns[index].type ? _bloc.styleData.btnSelectedColor : _bloc.styleData.btnNoSelectedColor), ), borderRadius: BorderRadius.circular(50)), child: Text( tabViewBtns[index].name ?? "", style: TextStyle( - fontSize: 11, - color: HexColor.fromHex( - selectType == tabViewBtns[index].type - ? _bloc.styleData.btnSelectedColor - : _bloc.styleData.btnNoSelectedColor)), + fontSize: 11, color: HexColor.fromHex(selectType == tabViewBtns[index].type ? _bloc.styleData.btnSelectedColor : _bloc.styleData.btnNoSelectedColor)), ), ), ); @@ -210,11 +178,9 @@ class _WalletBilDetailState extends State<WalletBilDetail> } _selectDate(TabList tabList) async { - var result = await showDialog( - context: context, builder: (context) => SelectDateYMDialog()); + var result = await showDialog(context: context, builder: (context) => SelectDateYMDialog()); if (result != null) { - var dataTime = DateFormat('yyyy-MM').format( - DateTime(int.parse(result['year']), int.parse(result['month']))); + var dataTime = DateFormat('yyyy-MM').format(DateTime(int.parse(result['year']), int.parse(result['month']))); if (tabList.type == "input") { _bloc.inputShowDate = dataTime; _bloc.loadInputData(_bloc.inPutCurrentPage, _bloc.inputShowDate); @@ -229,9 +195,7 @@ class _WalletBilDetailState extends State<WalletBilDetail> _buildBottomItem(TabList tabList) { return ListView.builder( shrinkWrap: true, - itemCount: tabList.type == 'input' - ? _bloc.inputDataVM.length - : _bloc.outputDataVM.length, + itemCount: tabList.type == 'input' ? _bloc.inputDataVM.length : _bloc.outputDataVM.length, itemBuilder: (context, index) { return _buildItem(context, index, tabList); }); @@ -243,11 +207,8 @@ class _WalletBilDetailState extends State<WalletBilDetail> var modelItem = _bloc.inputDataVM[index]; return Container( margin: EdgeInsets.only(left: 12.5, right: 12.5, bottom: 4, top: 4), - padding: - EdgeInsets.only(left: 25.w, right: 25.w, top: 20.h, bottom: 20.h), - decoration: BoxDecoration( - color: HexColor.fromHex("#FFFFFF"), - borderRadius: BorderRadius.circular(8)), + padding: EdgeInsets.only(left: 25.w, right: 25.w, top: 20.h, bottom: 20.h), + decoration: BoxDecoration(color: HexColor.fromHex("#FFFFFF"), borderRadius: BorderRadius.circular(8)), child: Column( children: <Widget>[ Row( @@ -257,21 +218,13 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Container( decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4), - color: HexColor.fromHex("#FFFFF3F3"), - border: Border.all( - color: HexColor.fromHex( - inputItemStyle.typeNameColor))), + borderRadius: BorderRadius.circular(4), color: HexColor.fromHex("#FFFFF3F3"), border: Border.all(color: HexColor.fromHex(inputItemStyle.typeNameColor))), child: Padding( - padding: const EdgeInsets.only( - left: 4, right: 4, top: 2, bottom: 2), + padding: const EdgeInsets.only(left: 4, right: 4, top: 2, bottom: 2), child: Center( child: Text( modelItem['type'] ?? "", - style: TextStyle( - color: HexColor.fromHex( - inputItemStyle.typeNameColor), - fontSize: 20.sp), + style: TextStyle(color: HexColor.fromHex(inputItemStyle.typeNameColor), fontSize: 20.sp), ), ), ), @@ -291,16 +244,11 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( "+ ", - style: TextStyle( - color: HexColor.fromHex(inputItemStyle.amountColor)), + style: TextStyle(color: HexColor.fromHex(inputItemStyle.amountColor)), ), Text( "¥ " + modelItem['amount'], - style: TextStyle( - color: HexColor.fromHex(inputItemStyle.amountColor), - fontSize: 30.sp, - fontFamily: 'Din', - package: 'zhiying_base_widget'), + style: TextStyle(color: HexColor.fromHex(inputItemStyle.amountColor), fontSize: 30.sp, fontFamily: 'Din', package: 'zhiying_base_widget'), ) ], ) @@ -315,44 +263,33 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( inputItemStyle.orderIdText, - style: TextStyle( - color: HexColor.fromHex(inputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), ), SizedBox( width: 4, ), Text( modelItem['order_id'], - style: TextStyle( - color: HexColor.fromHex(inputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), ), SizedBox( width: 28.w, ), GestureDetector( onTap: () { - Clipboard.setData( - ClipboardData(text: modelItem['order_id'])); + Clipboard.setData(ClipboardData(text: modelItem['order_id'])); Fluttertoast.showToast(msg: "已复制"); }, child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), color: HexColor.fromHex(inputItemStyle.copyBtnBgColor), - border: Border.all( - color: - HexColor.fromHex(inputItemStyle.contentColor))), + border: Border.all(color: HexColor.fromHex(inputItemStyle.contentColor), width: 0.5)), child: Padding( - padding: EdgeInsets.only( - left: 16, right: 16, top: 1, bottom: 1), + padding: EdgeInsets.only(left: 16, right: 16, top: 1, bottom: 1), child: Text( inputItemStyle.copyBtnText, - style: TextStyle( - color: - HexColor.fromHex(inputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), ), ), ), @@ -369,18 +306,14 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( inputItemStyle.orderTypeText, - style: TextStyle( - color: HexColor.fromHex(inputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), ), SizedBox( width: 4, ), Text( modelItem['order_type'] ?? "", - style: TextStyle( - color: HexColor.fromHex("#FF999999"), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), ), ], )), @@ -389,9 +322,7 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( inputItemStyle.amountText + " ¥" + modelItem['amount'], - style: TextStyle( - color: HexColor.fromHex(inputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), ), ], )) @@ -407,18 +338,14 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( inputItemStyle.timeText, - style: TextStyle( - color: HexColor.fromHex(inputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), ), SizedBox( width: 4, ), Text( modelItem['time'] ?? "", - style: TextStyle( - color: HexColor.fromHex("#FF999999"), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), ), ], )), @@ -426,13 +353,8 @@ class _WalletBilDetailState extends State<WalletBilDetail> child: Row( children: <Widget>[ Text( - inputItemStyle.settleTimeText + - " " + - modelItem['settle_time'] ?? - "", - style: TextStyle( - color: HexColor.fromHex(inputItemStyle.contentColor), - fontSize: 22.sp), + inputItemStyle.settleTimeText + " " + modelItem['settle_time'] ?? "", + style: TextStyle(color: HexColor.fromHex(inputItemStyle.contentColor), fontSize: 22.sp), ), ], )) @@ -448,11 +370,8 @@ class _WalletBilDetailState extends State<WalletBilDetail> ///消费返回的Item return Container( margin: EdgeInsets.only(left: 12.5, right: 12.5, bottom: 4, top: 4), - padding: - EdgeInsets.only(left: 25.w, right: 25.w, top: 20.h, bottom: 20.h), - decoration: BoxDecoration( - color: HexColor.fromHex("#FFFFFF"), - borderRadius: BorderRadius.circular(8)), + padding: EdgeInsets.only(left: 25.w, right: 25.w, top: 20.h, bottom: 20.h), + decoration: BoxDecoration(color: HexColor.fromHex("#FFFFFF"), borderRadius: BorderRadius.circular(8)), child: Column( children: <Widget>[ Row( @@ -464,19 +383,13 @@ class _WalletBilDetailState extends State<WalletBilDetail> decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), color: HexColor.fromHex("#FFFFF3F3"), - border: Border.all( - color: HexColor.fromHex( - outputItemStyle.typeNameColor))), + border: Border.all(color: HexColor.fromHex(outputItemStyle.typeNameColor))), child: Padding( - padding: const EdgeInsets.only( - left: 4, right: 4, top: 2, bottom: 2), + padding: const EdgeInsets.only(left: 4, right: 4, top: 2, bottom: 2), child: Center( child: Text( modelItem['type'] ?? "", - style: TextStyle( - color: HexColor.fromHex( - outputItemStyle.typeNameColor), - fontSize: 20.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.typeNameColor), fontSize: 20.sp), ), ), ), @@ -496,16 +409,11 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( "- ", - style: TextStyle( - color: - HexColor.fromHex(outputItemStyle.amountColor)), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.amountColor)), ), Text( "¥ " + modelItem['amount'], - style: TextStyle( - color: - HexColor.fromHex(outputItemStyle.amountColor), - fontSize: 30.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.amountColor), fontSize: 30.sp), ) ], ) @@ -520,45 +428,33 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( outputItemStyle.orderIdText, - style: TextStyle( - color: HexColor.fromHex(outputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), SizedBox( width: 4, ), Text( modelItem['order_id'], - style: TextStyle( - color: HexColor.fromHex(outputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), SizedBox( width: 28.w, ), GestureDetector( onTap: () { - Clipboard.setData( - ClipboardData(text: modelItem['order_id'])); + Clipboard.setData(ClipboardData(text: modelItem['order_id'])); Fluttertoast.showToast(msg: "已复制"); }, child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), - color: - HexColor.fromHex(outputItemStyle.copyBtnBgColor), - border: Border.all( - color: HexColor.fromHex( - outputItemStyle.contentColor))), + color: HexColor.fromHex(outputItemStyle.copyBtnBgColor), + border: Border.all(color: HexColor.fromHex(outputItemStyle.contentColor),width: 0.5)), child: Padding( - padding: EdgeInsets.only( - left: 16, right: 16, top: 1, bottom: 1), + padding: EdgeInsets.only(left: 16, right: 16, top: 1, bottom: 1), child: Text( outputItemStyle.copyBtnText ?? "", - style: TextStyle( - color: HexColor.fromHex( - outputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), ), ), @@ -575,19 +471,14 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( outputItemStyle.consumeOrderTypeText, - style: TextStyle( - color: - HexColor.fromHex(outputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), SizedBox( width: 4, ), Text( modelItem['order_type'] ?? "", - style: TextStyle( - color: HexColor.fromHex("#FF999999"), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), ), ], )), @@ -595,13 +486,8 @@ class _WalletBilDetailState extends State<WalletBilDetail> child: Row( children: <Widget>[ Text( - outputItemStyle.consumeAmountText + - " ¥" + - modelItem['amount'], - style: TextStyle( - color: - HexColor.fromHex(outputItemStyle.contentColor), - fontSize: 22.sp), + outputItemStyle.consumeAmountText + " ¥" + modelItem['amount'], + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), ], )) @@ -617,19 +503,14 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( outputItemStyle.consumeTimeText, - style: TextStyle( - color: - HexColor.fromHex(outputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), SizedBox( width: 4, ), Text( modelItem['time'] ?? "", - style: TextStyle( - color: HexColor.fromHex("#FF999999"), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), ), ], )), @@ -655,11 +536,8 @@ class _WalletBilDetailState extends State<WalletBilDetail> } else if (modelItem['type'] == '提现') { return Container( margin: EdgeInsets.only(left: 12.5, right: 12.5, bottom: 4, top: 4), - padding: - EdgeInsets.only(left: 25.w, right: 25.w, top: 20.h, bottom: 20.h), - decoration: BoxDecoration( - color: HexColor.fromHex("#FFFFFF"), - borderRadius: BorderRadius.circular(8)), + padding: EdgeInsets.only(left: 25.w, right: 25.w, top: 20.h, bottom: 20.h), + decoration: BoxDecoration(color: HexColor.fromHex("#FFFFFF"), borderRadius: BorderRadius.circular(8)), child: Column( children: <Widget>[ Row( @@ -671,19 +549,13 @@ class _WalletBilDetailState extends State<WalletBilDetail> decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), color: HexColor.fromHex("#FFFFF3F3"), - border: Border.all( - color: HexColor.fromHex( - outputItemStyle.typeNameColor))), + border: Border.all(color: HexColor.fromHex(outputItemStyle.typeNameColor))), child: Padding( - padding: const EdgeInsets.only( - left: 4, right: 4, top: 2, bottom: 2), + padding: const EdgeInsets.only(left: 4, right: 4, top: 2, bottom: 2), child: Center( child: Text( modelItem['type'] ?? "", - style: TextStyle( - color: HexColor.fromHex( - outputItemStyle.typeNameColor), - fontSize: 20.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.typeNameColor), fontSize: 20.sp), ), ), ), @@ -703,16 +575,11 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( "- ", - style: TextStyle( - color: - HexColor.fromHex(outputItemStyle.amountColor)), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.amountColor)), ), Text( "¥ " + modelItem['amount'], - style: TextStyle( - color: - HexColor.fromHex(outputItemStyle.amountColor), - fontSize: 30.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.amountColor), fontSize: 30.sp), ) ], ) @@ -727,45 +594,33 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( outputItemStyle.orderIdText, - style: TextStyle( - color: HexColor.fromHex(outputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), SizedBox( width: 4, ), Text( modelItem['order_id'], - style: TextStyle( - color: HexColor.fromHex(outputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), SizedBox( width: 28.w, ), GestureDetector( onTap: () { - Clipboard.setData( - ClipboardData(text: modelItem['order_id'])); + Clipboard.setData(ClipboardData(text: modelItem['order_id'])); Fluttertoast.showToast(msg: "已复制"); }, child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), - color: - HexColor.fromHex(outputItemStyle.copyBtnBgColor), - border: Border.all( - color: HexColor.fromHex( - outputItemStyle.contentColor))), + color: HexColor.fromHex(outputItemStyle.copyBtnBgColor), + border: Border.all(color: HexColor.fromHex(outputItemStyle.contentColor), width: 0.5)), child: Padding( - padding: EdgeInsets.only( - left: 16, right: 16, top: 1, bottom: 1), + padding: EdgeInsets.only(left: 16, right: 16, top: 1, bottom: 1), child: Text( outputItemStyle.copyBtnText ?? "", - style: TextStyle( - color: HexColor.fromHex( - outputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), ), ), @@ -782,20 +637,14 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( outputItemStyle.withdrawAccountText, - style: TextStyle( - color: - HexColor.fromHex(outputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), SizedBox( width: 4, ), Text( modelItem['account'] ?? "", - style: TextStyle( - color: - HexColor.fromHex(outputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), ], )), @@ -803,21 +652,14 @@ class _WalletBilDetailState extends State<WalletBilDetail> child: Row( children: <Widget>[ Text( - outputItemStyle.withdrawAmountText + - " ¥" + - modelItem['amount'], - style: TextStyle( - color: - HexColor.fromHex(outputItemStyle.contentColor), - fontSize: 22.sp), + outputItemStyle.withdrawAmountText + " ¥" + modelItem['amount'], + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), ], )) ], ), - SizedBox( - height: 4, - ), + SizedBox(height: 4), Row( children: <Widget>[ Expanded( @@ -825,19 +667,14 @@ class _WalletBilDetailState extends State<WalletBilDetail> children: <Widget>[ Text( outputItemStyle.withdrawTimeText, - style: TextStyle( - color: - HexColor.fromHex(outputItemStyle.contentColor), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), SizedBox( width: 4, ), Text( modelItem['time'] ?? "", - style: TextStyle( - color: HexColor.fromHex("#FF999999"), - fontSize: 22.sp), + style: TextStyle(color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), ), ], )), @@ -845,14 +682,8 @@ class _WalletBilDetailState extends State<WalletBilDetail> child: Row( children: <Widget>[ Text( - outputItemStyle.withdrawOrderStatusText + - " " + - modelItem['order_status'] ?? - "", - style: TextStyle( - color: - HexColor.fromHex(outputItemStyle.contentColor), - fontSize: 22.sp), + outputItemStyle.withdrawOrderStatusText + " " + modelItem['order_status'] ?? "", + style: TextStyle(color: HexColor.fromHex(outputItemStyle.contentColor), fontSize: 22.sp), ), ], )) @@ -891,10 +722,7 @@ class _WalletBilDetailState extends State<WalletBilDetail> onRefresh: () { _bloc.inputRefresh(); }, - child: _bloc.inputDataVM == null || - _bloc.inputDataVM.length == 0 - ? EmptyWidget() - : _buildBottomItem(item)), + child: EmptyUtil.isEmpty(_bloc.inputDataVM ) ? EmptyWidget() : _buildBottomItem(item)), ) ], ), @@ -922,10 +750,7 @@ class _WalletBilDetailState extends State<WalletBilDetail> onRefresh: () { _bloc.outputRefresh(); }, - child: _bloc.outputDataVM == null || - _bloc.outputDataVM.length == 0 - ? EmptyWidget() - : _buildBottomItem(item)), + child: EmptyUtil.isEmpty(_bloc.outputDataVM) ? EmptyWidget() : _buildBottomItem(item)), ) ], ), diff --git a/lib/widgets/wallet_bil_detail/wallet_list_widget.dart b/lib/widgets/wallet_bil_detail/wallet_list_widget.dart new file mode 100644 index 0000000..e69de29