import 'package:zhiying_base_widget/widgets/public/custom_button/custom_button_model.dart';

class GoodsShareTempEditorModel {
  CustomButtonModel regainDefault;
  CustomButtonModel saveTemplate1;
  CustomButtonModel previewTemplate;
  CustomButtonModel backEdit;
  CustomButtonModel saveTemplate2;

  GoodsShareTempEditorModel(
      {this.regainDefault,
      this.saveTemplate1,
      this.previewTemplate,
      this.backEdit,
      this.saveTemplate2});

  GoodsShareTempEditorModel.fromJson(Map<String, dynamic> json) {
    regainDefault = json['regain_default'] != null
        ? new CustomButtonModel.fromJson(json['regain_default'])
        : null;
    saveTemplate1 = json['save_template1'] != null
        ? new CustomButtonModel.fromJson(json['save_template1'])
        : null;
    previewTemplate = json['preview_template'] != null
        ? new CustomButtonModel.fromJson(json['preview_template'])
        : null;
    backEdit = json['back_edit'] != null
        ? new CustomButtonModel.fromJson(json['back_edit'])
        : null;
    saveTemplate2 = json['save_template2'] != null
        ? new CustomButtonModel.fromJson(json['save_template2'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.regainDefault != null) {
      data['regain_default'] = this.regainDefault.toJson();
    }
    if (this.saveTemplate1 != null) {
      data['save_template1'] = this.saveTemplate1.toJson();
    }
    if (this.previewTemplate != null) {
      data['preview_template'] = this.previewTemplate.toJson();
    }
    if (this.backEdit != null) {
      data['back_edit'] = this.backEdit.toJson();
    }
    if (this.saveTemplate2 != null) {
      data['save_template2'] = this.saveTemplate2.toJson();
    }
    return data;
  }
}
