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