Pārlūkot izejas kodu

0114 个人中心,会员背景图设置

tags/0.0.3+6^0
23028876916@qq.com pirms 4 gadiem
vecāks
revīzija
80a9242b9a
2 mainītis faili ar 109 papildinājumiem un 80 dzēšanām
  1. +24
    -3
      lib/widgets/mine/mine_header/mine_header_container.dart
  2. +85
    -77
      lib/widgets/mine/mine_header/model/mine_header_model.dart

+ 24
- 3
lib/widgets/mine/mine_header/mine_header_container.dart Parādīt failu

@@ -42,6 +42,19 @@ class _MineHeaderContainerState extends State<MineHeaderContainer> {
@override
Widget build(BuildContext context) {
var width = MediaQuery.of(context).size.width;
BoxDecoration boxDecoration;
if (widget.staticModel.lvBgType == "image") {
boxDecoration = BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
image: NetworkImage(
widget.staticModel.lvBgImage,
)),
borderRadius: BorderRadius.circular(9));
} else {
boxDecoration =
BoxDecoration(color: HexColor.fromHex(widget.staticModel.bgColor), borderRadius: BorderRadius.circular(9));
}
return StreamBuilder<MineProfileModel>(
stream: _bloc.outData,
builder: (BuildContext context, AsyncSnapshot snapshot) {
@@ -93,9 +106,17 @@ class _MineHeaderContainerState extends State<MineHeaderContainer> {
height: 18,
margin: EdgeInsets.only(left: 6),
padding: EdgeInsets.only(left: 6, right: 6),
decoration: BoxDecoration(
color: HexColor.fromHex(widget.staticModel.bgColor),
borderRadius: BorderRadius.circular(9)),
decoration: boxDecoration,
// BoxDecoration(
// image: DecorationImage(
// fit: BoxFit.fitWidth,
// image: NetworkImage(
// widget.staticModel.lvBgImage,
//
// )),
// // color: HexColor.fromHex(widget.staticModel.bgColor),
// // borderRadius: BorderRadius.circular(9)
// ),
child: Row(
children: <Widget>[
Container(


+ 85
- 77
lib/widgets/mine/mine_header/model/mine_header_model.dart Parādīt failu

@@ -1,128 +1,136 @@
class MineHeaderModel {
String assistColor;
String bgColor;
String bgImage;
String bottomLeftRadius;
String bottomRightRadius;
String coypeIcon;
String name;
String desc;
String invitedCodeColor;
String moduleType;
String moduleKey;
String isTopMargin;
String isLeftRightMargin;
String isShow;
String isTopMargin;
String topMargin;
String leftRightMargin;
String loginName;
String loginNameHelpText;
String topLeftRadius;
String topRightRadius;
String bottomLeftRadius;
String bottomRightRadius;
String bgColor;
String themeType;
String themeColor;
String assistColor;
String bgImage;
String lvBgType;
String lvBgColor;
String lvBgImage;
String lvNameColor;
String moduleKey;
String moduleType;
String name;
String invitedCodeColor;
String coypeIcon;
String loginName;
String loginNameHelpText;
String nonLginAvatar;
String userNameColor;
int requiredLogin;
int requiredTaobaoAuth;
String skipIdentifier;
String themeColor;
String themeType;
String topLeftRadius;
String topMargin;
String topRightRadius;
String userNameColor;

MineHeaderModel(
{this.assistColor,
this.bgColor,
this.bgImage,
this.bottomLeftRadius,
this.bottomRightRadius,
this.coypeIcon,
{this.name,
this.desc,
this.invitedCodeColor,
this.moduleType,
this.moduleKey,
this.isTopMargin,
this.isLeftRightMargin,
this.isShow,
this.isTopMargin,
this.topMargin,
this.leftRightMargin,
this.loginName,
this.loginNameHelpText,
this.topLeftRadius,
this.topRightRadius,
this.bottomLeftRadius,
this.bottomRightRadius,
this.bgColor,
this.themeType,
this.themeColor,
this.assistColor,
this.bgImage,
this.lvBgType,
this.lvBgColor,
this.lvBgImage,
this.lvNameColor,
this.moduleKey,
this.moduleType,
this.name,
this.invitedCodeColor,
this.coypeIcon,
this.loginName,
this.loginNameHelpText,
this.nonLginAvatar,
this.userNameColor,
this.requiredLogin,
this.requiredTaobaoAuth,
this.skipIdentifier,
this.themeColor,
this.themeType,
this.topLeftRadius,
this.topMargin,
this.topRightRadius,
this.userNameColor});
this.skipIdentifier});

MineHeaderModel.fromJson(Map<String, dynamic> json) {
assistColor = json['assist_color'];
bgColor = json['bg_color'];
bgImage = json['bg_image'];
bottomLeftRadius = json['bottom_left_radius'];
bottomRightRadius = json['bottom_right_radius'];
coypeIcon = json['coype_icon'];
name = json['name'];
desc = json['desc'];
invitedCodeColor = json['invited_code_color'];
moduleType = json['module_type'];
moduleKey = json['module_key'];
isTopMargin = json['is_top_margin'];
isLeftRightMargin = json['is_left_right_margin'];
isShow = json['is_show'];
isTopMargin = json['is_top_margin'];
topMargin = json['top_margin'];
leftRightMargin = json['left_right_margin'];
loginName = json['login_name'];
loginNameHelpText = json['login_name_help_text'];
topLeftRadius = json['top_left_radius'];
topRightRadius = json['top_right_radius'];
bottomLeftRadius = json['bottom_left_radius'];
bottomRightRadius = json['bottom_right_radius'];
bgColor = json['bg_color'];
themeType = json['theme_type'];
themeColor = json['theme_color'];
assistColor = json['assist_color'];
bgImage = json['bg_image'];
lvBgType = json['lv_bg_type'];
lvBgColor = json['lv_bg_color'];
lvBgImage = json['lv_bg_image'];
lvNameColor = json['lv_name_color'];
moduleKey = json['module_key'];
moduleType = json['module_type'];
name = json['name'];
invitedCodeColor = json['invited_code_color'];
coypeIcon = json['coype_icon'];
loginName = json['login_name'];
loginNameHelpText = json['login_name_help_text'];
nonLginAvatar = json['non_lgin_avatar'];
userNameColor = json['user_name_color'];
requiredLogin = json['required_login'];
requiredTaobaoAuth = json['required_taobao_auth'];
skipIdentifier = json['skip_identifier'];
themeColor = json['theme_color'];
themeType = json['theme_type'];
topLeftRadius = json['top_left_radius'];
topMargin = json['top_margin'];
topRightRadius = json['top_right_radius'];
userNameColor = json['user_name_color'];
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['assist_color'] = this.assistColor;
data['bg_color'] = this.bgColor;
data['bg_image'] = this.bgImage;
data['bottom_left_radius'] = this.bottomLeftRadius;
data['bottom_right_radius'] = this.bottomRightRadius;
data['coype_icon'] = this.coypeIcon;
data['name'] = this.name;
data['desc'] = this.desc;
data['invited_code_color'] = this.invitedCodeColor;
data['module_type'] = this.moduleType;
data['module_key'] = this.moduleKey;
data['is_top_margin'] = this.isTopMargin;
data['is_left_right_margin'] = this.isLeftRightMargin;
data['is_show'] = this.isShow;
data['is_top_margin'] = this.isTopMargin;
data['top_margin'] = this.topMargin;
data['left_right_margin'] = this.leftRightMargin;
data['login_name'] = this.loginName;
data['login_name_help_text'] = this.loginNameHelpText;
data['top_left_radius'] = this.topLeftRadius;
data['top_right_radius'] = this.topRightRadius;
data['bottom_left_radius'] = this.bottomLeftRadius;
data['bottom_right_radius'] = this.bottomRightRadius;
data['bg_color'] = this.bgColor;
data['theme_type'] = this.themeType;
data['theme_color'] = this.themeColor;
data['assist_color'] = this.assistColor;
data['bg_image'] = this.bgImage;
data['lv_bg_type'] = this.lvBgType;
data['lv_bg_color'] = this.lvBgColor;
data['lv_bg_image'] = this.lvBgImage;
data['lv_name_color'] = this.lvNameColor;
data['module_key'] = this.moduleKey;
data['module_type'] = this.moduleType;
data['name'] = this.name;
data['invited_code_color'] = this.invitedCodeColor;
data['coype_icon'] = this.coypeIcon;
data['login_name'] = this.loginName;
data['login_name_help_text'] = this.loginNameHelpText;
data['non_lgin_avatar'] = this.nonLginAvatar;
data['user_name_color'] = this.userNameColor;
data['required_login'] = this.requiredLogin;
data['required_taobao_auth'] = this.requiredTaobaoAuth;
data['skip_identifier'] = this.skipIdentifier;
data['theme_color'] = this.themeColor;
data['theme_type'] = this.themeType;
data['top_left_radius'] = this.topLeftRadius;
data['top_margin'] = this.topMargin;
data['top_right_radius'] = this.topRightRadius;
data['user_name_color'] = this.userNameColor;
return data;
}
}


Notiek ielāde…
Atcelt
Saglabāt