import 'package:zhiying_base_widget/widgets/mine/mine_header/model/mine_profile_model.dart';

class MineDataModel {
  String accumulatedEarningsNameColor;
  String accumulatedEarningsColor;
  String accumulatedEarningsBgImg;
  String btnText;
  String btnTextColor;
  String btnImg;
  String requiredLogin;
  String requiredTaobaoAuth;
  String skipIdentifier;
  String gridViewBgColor;
  String gridViewNameColor;
  String gridViewValueColor;
  List<MineProfileDataModel> gridView;

  MineDataModel(
      {this.accumulatedEarningsNameColor,
        this.accumulatedEarningsColor,
        this.accumulatedEarningsBgImg,
        this.btnText,
        this.btnTextColor,
        this.btnImg,
        this.requiredLogin,
        this.requiredTaobaoAuth,
        this.skipIdentifier,
        this.gridViewBgColor,
        this.gridViewNameColor,
        this.gridViewValueColor,
        this.gridView});

  MineDataModel.fromJson(Map<String, dynamic> json) {
    accumulatedEarningsNameColor = json['accumulated_earnings_name_color'];
    accumulatedEarningsColor = json['accumulated_earnings_color'];
    accumulatedEarningsBgImg = json['accumulated_earnings_bg_img'];
    btnText = json['btn_text'];
    btnTextColor = json['btn_text_color'];
    btnImg = json['btn_img'];
    requiredLogin = json['required_login'];
    requiredTaobaoAuth = json['required_taobao_auth'];
    skipIdentifier = json['skip_identifier'];
    gridViewBgColor = json['grid_view_bg_color'];
    gridViewNameColor = json['grid_view_name_color'];
    gridViewValueColor = json['grid_view_value_color'];
    if (json['grid_view'] != null) {
      gridView = new List<MineProfileDataModel>();
      json['grid_view'].forEach((v) {
        gridView.add(new MineProfileDataModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['accumulated_earnings_name_color'] = this.accumulatedEarningsNameColor;
    data['accumulated_earnings_color'] = this.accumulatedEarningsColor;
    data['accumulated_earnings_bg_img'] = this.accumulatedEarningsBgImg;
    data['btn_text'] = this.btnText;
    data['btn_text_color'] = this.btnTextColor;
    data['btn_img'] = this.btnImg;
    data['required_login'] = this.requiredLogin;
    data['required_taobao_auth'] = this.requiredTaobaoAuth;
    data['skip_identifier'] = this.skipIdentifier;
    data['grid_view_bg_color'] = this.gridViewBgColor;
    data['grid_view_name_color'] = this.gridViewNameColor;
    data['grid_view_value_color'] = this.gridViewValueColor;
    if (this.gridView != null) {
      data['grid_view'] = this.gridView.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
