@@ -255,9 +255,9 @@ | |||
}, | |||
{ | |||
"name": "fluttertoast", | |||
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/fluttertoast-7.0.4", | |||
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/fluttertoast-4.0.1", | |||
"packageUri": "lib/", | |||
"languageVersion": "2.7" | |||
"languageVersion": "2.0" | |||
}, | |||
{ | |||
"name": "glob", | |||
@@ -680,7 +680,7 @@ | |||
"languageVersion": "2.1" | |||
} | |||
], | |||
"generated": "2020-09-14T04:30:17.438032Z", | |||
"generated": "2020-09-15T02:01:44.342412Z", | |||
"generator": "pub", | |||
"generatorVersion": "2.7.2" | |||
} |
@@ -32,6 +32,6 @@ Map<String, dynamic> _$HomeGoodsStyleModelToJson( | |||
'coupon_font_color': instance.couponFontColor, | |||
'commission_background_color': instance.commissionBackgroundColor, | |||
'commission_font_color': instance.commissionFontColor, | |||
'MarketPriceColor': instance.marketPriceColor, | |||
'market_price_color': instance.marketPriceColor, | |||
'current_price_color': instance.currentPriceColor, | |||
}; |
@@ -1,7 +1,10 @@ | |||
import 'dart:convert' as convert; | |||
import 'package:cached_network_image/cached_network_image.dart'; | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'mine_header_sk.dart'; | |||
import 'package:zhiying_base_widget/widgets/mine/mine_header/model/mine_header_model.dart'; | |||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||
class MineHeader extends StatefulWidget { | |||
final Map<String, dynamic> data; | |||
@@ -15,11 +18,21 @@ class MineHeader extends StatefulWidget { | |||
class _MineHeaderState extends State<MineHeader> { | |||
@override | |||
Widget build(BuildContext context) { | |||
return _MineContainer(); | |||
return _MineContainer(widget.data); | |||
} | |||
} | |||
class _MineContainer extends StatefulWidget { | |||
final Map<String, dynamic> data; | |||
Map<String, dynamic> json; | |||
MineHeaderModel staticModel; | |||
_MineContainer(this.data, {Key key}) : super(key: key) { | |||
String d = data['data']; | |||
json = convert.jsonDecode(d); | |||
staticModel = MineHeaderModel.fromJson(json); | |||
} | |||
@override | |||
_MineContainerState createState() => _MineContainerState(); | |||
} | |||
@@ -27,6 +40,52 @@ class _MineContainer extends StatefulWidget { | |||
class _MineContainerState extends State<_MineContainer> { | |||
@override | |||
Widget build(BuildContext context) { | |||
return MineHeaderSkeleton(); | |||
return Container( | |||
child: Row( | |||
children: <Widget>[ | |||
GestureDetector( | |||
child: Container( | |||
margin: EdgeInsets.only(left: 20, top: 20, bottom: 20, right: 12), | |||
width: 56, | |||
height: 56, | |||
child: ClipRRect( | |||
borderRadius: BorderRadius.circular(28), | |||
child: CachedNetworkImage( | |||
imageUrl: widget.staticModel.defaultAvatar, | |||
fit: BoxFit.cover)), | |||
), | |||
onTap: () { | |||
RouterUtil.route(widget.json, context); | |||
}, | |||
), | |||
Expanded( | |||
child: Column( | |||
mainAxisAlignment: MainAxisAlignment.start, | |||
crossAxisAlignment: CrossAxisAlignment.start, | |||
children: <Widget>[ | |||
Container( | |||
width: 120, | |||
height: 20, | |||
child: Text( | |||
widget.staticModel.loginName, | |||
style: TextStyle( | |||
color: HexColor.fromHex(widget.staticModel.loginColor), | |||
fontSize: 17), | |||
), | |||
), | |||
Container( | |||
margin: EdgeInsets.only(top: 8), | |||
width: 80, | |||
child: Text( | |||
widget.staticModel.loginNameHelpText, | |||
style: TextStyle( | |||
color: HexColor.fromHex(widget.staticModel.loginColor), | |||
fontSize: 13), | |||
)), | |||
], | |||
)) | |||
], | |||
), | |||
); | |||
} | |||
} |
@@ -18,7 +18,7 @@ class MineHeaderBloc extends BlocBase { | |||
} | |||
void loadData(int id) { | |||
NetUtil.request('/api/v1/mod', | |||
NetUtil.request('/api/v1/user/profile', | |||
method: NetMethod.POST, | |||
params: Map<String, dynamic>.from({ | |||
'ids': [id] | |||
@@ -0,0 +1,58 @@ | |||
import 'package:json_annotation/json_annotation.dart'; | |||
part 'mine_header_model.g.dart'; | |||
@JsonSerializable() | |||
class MineHeaderModel extends Object { | |||
@JsonKey(name: 'non_login_avatar') | |||
String defaultAvatar; | |||
@JsonKey(name: 'user_name_color') | |||
String userNameColor; | |||
@JsonKey(name: 'invited_code_text') | |||
String invitedCodeText; | |||
@JsonKey(name: 'invited_code_color') | |||
String invitedCodeColor; | |||
@JsonKey(name: 'login_color') | |||
String loginColor; | |||
@JsonKey(name: 'login_name') | |||
String loginName; | |||
@JsonKey(name: 'login_name_help_text') | |||
String loginNameHelpText; | |||
@JsonKey(name: 'coype_icon') | |||
String coypeIcon; | |||
@JsonKey(name: 'required_login') | |||
String requiredLogin; | |||
@JsonKey(name: 'required_taobao_auth') | |||
String requiredTaobaoAuth; | |||
@JsonKey(name: 'skip_identifier') | |||
String skipIdentifier; | |||
MineHeaderModel( | |||
this.defaultAvatar, | |||
this.userNameColor, | |||
this.invitedCodeText, | |||
this.invitedCodeColor, | |||
this.loginColor, | |||
this.loginName, | |||
this.loginNameHelpText, | |||
this.coypeIcon, | |||
this.requiredLogin, | |||
this.requiredTaobaoAuth, | |||
this.skipIdentifier, | |||
); | |||
factory MineHeaderModel.fromJson(Map<String, dynamic> srcJson) => | |||
_$MineHeaderModelFromJson(srcJson); | |||
Map<String, dynamic> toJson() => _$MineHeaderModelToJson(this); | |||
} |
@@ -0,0 +1,38 @@ | |||
// GENERATED CODE - DO NOT MODIFY BY HAND | |||
part of 'mine_header_model.dart'; | |||
// ************************************************************************** | |||
// JsonSerializableGenerator | |||
// ************************************************************************** | |||
MineHeaderModel _$MineHeaderModelFromJson(Map<String, dynamic> json) { | |||
return MineHeaderModel( | |||
json['non_login_avatar'] as String, | |||
json['user_name_color'] as String, | |||
json['invited_code_text'] as String, | |||
json['invited_code_color'] as String, | |||
json['login_color'] as String, | |||
json['login_name'] as String, | |||
json['login_name_help_text'] as String, | |||
json['coype_icon'] as String, | |||
json['required_login'] as String, | |||
json['required_taobao_auth'] as String, | |||
json['skip_identifier'] as String, | |||
); | |||
} | |||
Map<String, dynamic> _$MineHeaderModelToJson(MineHeaderModel instance) => | |||
<String, dynamic>{ | |||
'non_login_avatar': instance.defaultAvatar, | |||
'user_name_color': instance.userNameColor, | |||
'invited_code_text': instance.invitedCodeText, | |||
'invited_code_color': instance.invitedCodeColor, | |||
'login_color': instance.loginColor, | |||
'login_name': instance.loginName, | |||
'login_name_help_text': instance.loginNameHelpText, | |||
'coype_icon': instance.coypeIcon, | |||
'required_login': instance.requiredLogin, | |||
'required_taobao_auth': instance.requiredTaobaoAuth, | |||
'skip_identifier': instance.skipIdentifier, | |||
}; |