You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.4 KiB
Dart
55 lines
1.4 KiB
Dart
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<String, dynamic> json) {
|
|
id = json['id'];
|
|
code = json['code'];
|
|
text = json['text'];
|
|
selectedAction = json['selectedAction'] != null
|
|
? new SelectedAction.fromJson(json['selectedAction'])
|
|
: null;
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
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<String, dynamic> json) {
|
|
id = json['id'];
|
|
code = json['code'];
|
|
name = json['name'];
|
|
actionCodeEnum = json['code'] == null ? null : (json['code']).fromCode();
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['id'] = this.id;
|
|
data['code'] = this.code;
|
|
data['name'] = this.name;
|
|
return data;
|
|
}
|
|
}
|