import 'package:zhiying_comm/zhiying_comm.dart';

class MineQuickModel {
  String myFunctionsText;
  String myFunctionsTextColor;
  String layout;
  String functionsBgColor;
  List<MineQuickItemModel> functionsList;

  MineQuickModel(
      {this.myFunctionsText,
        this.myFunctionsTextColor,
        this.layout,
        this.functionsBgColor,
        this.functionsList});

  MineQuickModel.fromJson(Map<String, dynamic> json) {
    myFunctionsText = json['my_functions_text'];
    myFunctionsTextColor = json['my_functions_text_color'];
    layout = json['layout'];
    functionsBgColor = json['functions_bg_color'];
    if (json['functions_list'] != null) {
      functionsList = new List<MineQuickItemModel>();
      json['functions_list'].forEach((v) {
        functionsList.add(new MineQuickItemModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['my_functions_text'] = this.myFunctionsText;
    data['my_functions_text_color'] = this.myFunctionsTextColor;
    data['layout'] = this.layout;
    data['functions_bg_color'] = this.functionsBgColor;
    if (this.functionsList != null) {
      data['functions_list'] =
          this.functionsList.map((v) => v.toJson()).toList();
    }
    return data;
  }
}


class MineQuickItemModel extends SkipModel {
  String icon;
  String name;
  String nameColor;
  String requiredLogin;
  String requiredTaobaoAuth;
  String skipIdentifier;

  MineQuickItemModel(
      {this.icon,
        this.name,
        this.nameColor,
        this.requiredLogin,
        this.requiredTaobaoAuth,
        this.skipIdentifier}): super(requiredLogin: requiredLogin, requiredTaobaoAuth: requiredTaobaoAuth, skipIdentifier: skipIdentifier,);

  MineQuickItemModel.fromJson(Map<String, dynamic> json) {
    icon = json['icon'];
    name = json['name'];
    nameColor = json['name_color'];
    requiredLogin = json['required_login'];
    requiredTaobaoAuth = json['required_taobao_auth'];
    skipIdentifier = json['skip_identifier'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['icon'] = this.icon;
    data['name'] = this.name;
    data['name_color'] = this.nameColor;
    data['required_login'] = this.requiredLogin;
    data['required_taobao_auth'] = this.requiredTaobaoAuth;
    data['skip_identifier'] = this.skipIdentifier;
    return data;
  }
}
