오대리ㅣㅣㅣㅣ
This commit is contained in:
26
mobile/lib/models/context_model.dart
Normal file
26
mobile/lib/models/context_model.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
class ContextModel {
|
||||
ContextModel({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.kind,
|
||||
this.retentionDays,
|
||||
this.screenshotBlocked = false,
|
||||
});
|
||||
|
||||
final String id;
|
||||
final String name;
|
||||
final String kind;
|
||||
final int? retentionDays;
|
||||
final bool screenshotBlocked;
|
||||
|
||||
factory ContextModel.fromJson(Map<String, dynamic> j) {
|
||||
final policy = j['policy'] as Map<String, dynamic>?;
|
||||
return ContextModel(
|
||||
id: j['id'] as String,
|
||||
name: j['name'] as String,
|
||||
kind: j['kind'] as String,
|
||||
retentionDays: policy?['retentionDays'] as int?,
|
||||
screenshotBlocked: policy?['screenshotBlocked'] == true,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user