import 'package:test_sa/extensions/enum_extensions.dart'; class FieldPermissionModel { int? id; String? code; String? text; SelectedAction? selectedAction; FieldPermissionModel({this.id, this.code, this.text, this.selectedAction}); FieldPermissionModel.fromJson(Map json) { id = json['id']; code = json['code']; text = json['text']; selectedAction = json['selectedAction'] != null ? new SelectedAction.fromJson(json['selectedAction']) : null; } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['code'] = this.code; data['text'] = this.text; if (this.selectedAction != null) { data['selectedAction'] = this.selectedAction!.toJson(); } return data; } } class SelectedAction { int? id; String? code; String? name; PermissionActionEnum? actionCodeEnum; SelectedAction({this.id, this.code, this.name,this.actionCodeEnum}); SelectedAction.fromJson(Map json) { id = json['id']; code = json['code']; name = json['name']; actionCodeEnum = json['code'] == null ? null : (json['code']).fromCode(); } Map toJson() { final Map data = new Map(); data['id'] = this.id; data['code'] = this.code; data['name'] = this.name; return data; } }