|
|
@@ -23,8 +23,7 @@ class WalletDetail extends StatefulWidget { |
|
|
|
_WalletDetailState createState() => _WalletDetailState(); |
|
|
|
} |
|
|
|
|
|
|
|
class _WalletDetailState extends State<WalletDetail> |
|
|
|
with TickerProviderStateMixin { |
|
|
|
class _WalletDetailState extends State<WalletDetail> with TickerProviderStateMixin { |
|
|
|
WalletDetailModel _model; |
|
|
|
|
|
|
|
TabController _tabController; |
|
|
@@ -35,24 +34,22 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
void initState() { |
|
|
|
if (widget.data != null) { |
|
|
|
_model = WalletDetailModel.fromJson(json.decode(widget.data['data'])); |
|
|
|
_tabController = |
|
|
|
TabController(length: _model.providers.length, vsync: this); |
|
|
|
_tabController = TabController(length: _model.providers.length, vsync: this); |
|
|
|
} |
|
|
|
_bloc = new WalletDetailBloc(); |
|
|
|
_bloc.loadData(_model.providers[0].type); |
|
|
|
_bloc.loadData(_model.providers[0].type, _bloc.selectDay); |
|
|
|
|
|
|
|
super.initState(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
void didChangeDependencies() { |
|
|
|
RefreshListener.listen(context, (event) { |
|
|
|
if (event == "refresh") { |
|
|
|
if (_bloc.currentType == null) { |
|
|
|
_bloc.loadData(_model.providers[0].type); |
|
|
|
_bloc.loadData(_model.providers[0].type, _bloc.selectDay); |
|
|
|
} else { |
|
|
|
_bloc.loadData(_bloc.currentType); |
|
|
|
_bloc.loadData(_bloc.currentType, _bloc.selectDay); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
@@ -69,15 +66,13 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
return StreamBuilder( |
|
|
|
stream: _bloc.outData, |
|
|
|
builder: (context, asyn) { |
|
|
|
if (_bloc.listDataModel.length == 0) { |
|
|
|
if (_bloc.currentWalletDetailDataModel == null) { |
|
|
|
///骨架图 |
|
|
|
return WalletDetailSkeleton(); |
|
|
|
} |
|
|
|
return Container( |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Colors.white, borderRadius: BorderRadius.circular(8)), |
|
|
|
margin: |
|
|
|
EdgeInsets.only(left: 12.5, right: 12.5, top: 7.5, bottom: 7.5), |
|
|
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), |
|
|
|
margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 7.5, bottom: 7.5), |
|
|
|
padding: const EdgeInsets.only(bottom: 13), |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
@@ -96,13 +91,10 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
color: HexColor.fromHex(_model.providers[0].selectColor), |
|
|
|
), |
|
|
|
isScrollable: true, |
|
|
|
unselectedLabelColor: |
|
|
|
HexColor.fromHex(_model.providers[0].unselectColor), |
|
|
|
labelColor: |
|
|
|
HexColor.fromHex(_model.providers[0].selectColor), |
|
|
|
unselectedLabelColor: HexColor.fromHex(_model.providers[0].unselectColor), |
|
|
|
labelColor: HexColor.fromHex(_model.providers[0].selectColor), |
|
|
|
controller: _tabController, |
|
|
|
indicatorColor: |
|
|
|
HexColor.fromHex(_model.providers[0].selectColor), |
|
|
|
indicatorColor: HexColor.fromHex(_model.providers[0].selectColor), |
|
|
|
indicatorSize: TabBarIndicatorSize.label, |
|
|
|
onTap: (index) { |
|
|
|
///变更平台 |
|
|
@@ -128,11 +120,7 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
height: 63, |
|
|
|
margin: EdgeInsets.only(top: 16, left: 15, right: 15), |
|
|
|
width: double.infinity, |
|
|
|
decoration: BoxDecoration( |
|
|
|
image: DecorationImage( |
|
|
|
image: CachedNetworkImageProvider( |
|
|
|
_model.providerDashbord.finish.bgImg), |
|
|
|
fit: BoxFit.fill)), |
|
|
|
decoration: BoxDecoration(image: DecorationImage(image: CachedNetworkImageProvider(_model.providerDashbord.finish.bgImg), fit: BoxFit.fill)), |
|
|
|
child: Column( |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
children: <Widget>[ |
|
|
@@ -142,10 +130,7 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
padding: const EdgeInsets.all(8.0), |
|
|
|
child: Text( |
|
|
|
_model.providerDashbord.finish.text, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 14, |
|
|
|
color: HexColor.fromHex(_model |
|
|
|
.providerDashbord.finish.textColor)), |
|
|
|
style: TextStyle(fontSize: 14, color: HexColor.fromHex(_model.providerDashbord.finish.textColor)), |
|
|
|
), |
|
|
|
), |
|
|
|
Row( |
|
|
@@ -159,9 +144,7 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
child: Padding( |
|
|
|
padding: const EdgeInsets.all(8.0), |
|
|
|
child: CachedNetworkImage( |
|
|
|
imageUrl: |
|
|
|
_model.providerDashbord.finish.tipIcon ?? |
|
|
|
"", |
|
|
|
imageUrl: _model.providerDashbord.finish.tipIcon ?? "", |
|
|
|
width: 10, |
|
|
|
height: 10, |
|
|
|
fit: BoxFit.fill, |
|
|
@@ -169,19 +152,13 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
), |
|
|
|
onTap: () { |
|
|
|
///显示弹窗 |
|
|
|
showTipDialog( |
|
|
|
null, _model.providerDashbord.finish.tipText); |
|
|
|
showTipDialog(null, _model.providerDashbord.finish.tipText); |
|
|
|
}) |
|
|
|
], |
|
|
|
), |
|
|
|
Text( |
|
|
|
_bloc.selectDateData.finish ?? "", |
|
|
|
style: TextStyle( |
|
|
|
color: Colors.red, |
|
|
|
fontSize: 20, |
|
|
|
fontFamily: 'Din', |
|
|
|
package: 'zhiying_comm', |
|
|
|
fontWeight: FontWeight.bold), |
|
|
|
style: TextStyle(color: Colors.red, fontSize: 20, fontFamily: 'Din', package: 'zhiying_comm', fontWeight: FontWeight.bold), |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
@@ -193,8 +170,7 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
shrinkWrap: true, |
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
itemBuilder: (context, index) { |
|
|
|
return _buildBottomItem( |
|
|
|
context, index, _model.providerDashbord); |
|
|
|
return _buildBottomItem(context, index, _model.providerDashbord); |
|
|
|
}), |
|
|
|
) |
|
|
|
], |
|
|
@@ -224,41 +200,26 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
child: Container( |
|
|
|
margin: EdgeInsets.only(top: 0, left: 8, right: 8), |
|
|
|
decoration: BoxDecoration( |
|
|
|
image: DecorationImage( |
|
|
|
image: CachedNetworkImageProvider( |
|
|
|
item.type == _bloc.selectDateData.type |
|
|
|
? item.btnImg ?? "" |
|
|
|
: item.btnNoColorImg ?? ""), |
|
|
|
fit: BoxFit.fitWidth), |
|
|
|
image: DecorationImage(image: CachedNetworkImageProvider(item.type == _bloc.selectDateData.type ? item.btnImg ?? "" : item.btnNoColorImg ?? ""), fit: BoxFit.fitWidth), |
|
|
|
), |
|
|
|
child: Padding( |
|
|
|
padding: const EdgeInsets.only(left: 16, right: 16), |
|
|
|
child: Center( |
|
|
|
child: Text( |
|
|
|
item.text, |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 11, |
|
|
|
color: HexColor.fromHex(item.type == _bloc.selectDateData.type |
|
|
|
? item.textSelectColor |
|
|
|
: item.textUnselectColor)), |
|
|
|
style: TextStyle(fontSize: 11, color: HexColor.fromHex(item.type == _bloc.selectDateData.type ? item.textSelectColor : item.textUnselectColor)), |
|
|
|
)), |
|
|
|
), |
|
|
|
), |
|
|
|
onTap: () { |
|
|
|
for (var select in _bloc.listDataModel) { |
|
|
|
if (select.type == item.type) { |
|
|
|
_bloc.selectDay = item.type; |
|
|
|
_bloc.refresh(); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
_bloc.selectDay = item.type; |
|
|
|
_bloc.loadData(_bloc.currentType, _bloc.selectDay); |
|
|
|
}, |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
///底部显示 |
|
|
|
Widget _buildBottomItem( |
|
|
|
BuildContext context, int index, ProviderDashbord dashbord) { |
|
|
|
Widget _buildBottomItem(BuildContext context, int index, ProviderDashbord dashbord) { |
|
|
|
SelfBuy item; |
|
|
|
if (index == 0) { |
|
|
|
item = dashbord.selfBuy; |
|
|
@@ -280,8 +241,7 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
? Container() |
|
|
|
: Text( |
|
|
|
item.title, |
|
|
|
style: TextStyle( |
|
|
|
color: HexColor.fromHex(item.titleColor), fontSize: 14), |
|
|
|
style: TextStyle(color: HexColor.fromHex(item.titleColor), fontSize: 14), |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
height: 7.5, |
|
|
@@ -294,11 +254,7 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
height: 61.5, |
|
|
|
margin: EdgeInsets.only(right: 8, left: 15), |
|
|
|
padding: EdgeInsets.only(left: 10), |
|
|
|
decoration: BoxDecoration( |
|
|
|
image: DecorationImage( |
|
|
|
image: CachedNetworkImageProvider( |
|
|
|
item.itemList[0].bgImg ?? ""), |
|
|
|
fit: BoxFit.fill)), |
|
|
|
decoration: BoxDecoration(image: DecorationImage(image: CachedNetworkImageProvider(item.itemList[0].bgImg ?? ""), fit: BoxFit.fill)), |
|
|
|
child: Column( |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
@@ -307,10 +263,7 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
children: <Widget>[ |
|
|
|
Text( |
|
|
|
item.itemList[0].text ?? "", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 11, |
|
|
|
color: HexColor.fromHex( |
|
|
|
item.itemList[0].textColor)), |
|
|
|
style: TextStyle(fontSize: 11, color: HexColor.fromHex(item.itemList[0].textColor)), |
|
|
|
), |
|
|
|
InkWell( |
|
|
|
child: Padding( |
|
|
@@ -335,8 +288,7 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
package: 'zhiying_comm', |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
fontSize: 17, |
|
|
|
color: |
|
|
|
HexColor.fromHex(item.itemList[1].valueColor), |
|
|
|
color: HexColor.fromHex(item.itemList[1].valueColor), |
|
|
|
)) |
|
|
|
], |
|
|
|
)), |
|
|
@@ -349,11 +301,7 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
right: 15, |
|
|
|
), |
|
|
|
padding: EdgeInsets.only(left: 10), |
|
|
|
decoration: BoxDecoration( |
|
|
|
image: DecorationImage( |
|
|
|
image: CachedNetworkImageProvider( |
|
|
|
item.itemList[1].bgImg ?? ""), |
|
|
|
fit: BoxFit.fill)), |
|
|
|
decoration: BoxDecoration(image: DecorationImage(image: CachedNetworkImageProvider(item.itemList[1].bgImg ?? ""), fit: BoxFit.fill)), |
|
|
|
child: Column( |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
@@ -362,10 +310,7 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
children: <Widget>[ |
|
|
|
Text( |
|
|
|
item.itemList[1].text ?? "", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 11, |
|
|
|
color: |
|
|
|
HexColor.fromHex(item.itemList[1].textColor)), |
|
|
|
style: TextStyle(fontSize: 11, color: HexColor.fromHex(item.itemList[1].textColor)), |
|
|
|
), |
|
|
|
InkWell( |
|
|
|
child: Padding( |
|
|
@@ -386,12 +331,7 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
), |
|
|
|
Text( |
|
|
|
dataMap[item.itemList[1].vauleKey], |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 17, |
|
|
|
color: HexColor.fromHex(item.itemList[1].valueColor), |
|
|
|
fontFamily: 'Din', |
|
|
|
package: 'zhiying_comm', |
|
|
|
fontWeight: FontWeight.bold), |
|
|
|
style: TextStyle(fontSize: 17, color: HexColor.fromHex(item.itemList[1].valueColor), fontFamily: 'Din', package: 'zhiying_comm', fontWeight: FontWeight.bold), |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
@@ -405,7 +345,8 @@ class _WalletDetailState extends State<WalletDetail> |
|
|
|
|
|
|
|
///变更平台 |
|
|
|
void changeProvider(String type) { |
|
|
|
_bloc.loadData(type); |
|
|
|
_bloc.currentType = type; |
|
|
|
_bloc.loadData(type, _bloc.selectDay); |
|
|
|
} |
|
|
|
|
|
|
|
///显示提示框 |
|
|
|