74 lines
3.5 KiB
Dart
74 lines
3.5 KiB
Dart
import 'package:quill_html_editor/quill_html_editor.dart';
|
|
|
|
class AddPBSPlanModel{
|
|
// String incidentTitle = "";
|
|
// String incidentId = "";
|
|
// String userId = "";
|
|
// int incidentDate = 0;
|
|
// bool active = false;
|
|
// String createdAt = "";
|
|
// String updatedAt = "";
|
|
// int v = 0;
|
|
String userId = "";
|
|
String staffId = "";
|
|
String planId = "";
|
|
String aboutPlanNote = "";
|
|
QuillEditorController aboutPlanQuillController = QuillEditorController();
|
|
String managementOfBehaviouralPresentationNote = "";
|
|
QuillEditorController managementOfBehaviouralPresentationQuillController = QuillEditorController();
|
|
String secondaryPreventionNote = "";
|
|
QuillEditorController secondaryPreventionQuillController = QuillEditorController();
|
|
String reactiveStrategiesNote = "";
|
|
QuillEditorController reactiveStrategiesQuillController = QuillEditorController();
|
|
String postIncidentSupportRecoveryNote = "";
|
|
QuillEditorController postIncidentSupportRecoveryQuillController = QuillEditorController();
|
|
|
|
Future<bool> get areAllFieldsEdited async {
|
|
String aboutPlanText = await aboutPlanQuillController.getText();
|
|
String managementOfBehaviouralPresentationText =
|
|
await managementOfBehaviouralPresentationQuillController.getText();
|
|
String secondaryPreventionText =
|
|
await secondaryPreventionQuillController.getText();
|
|
String reactiveStrategiesText =
|
|
await reactiveStrategiesQuillController.getText();
|
|
String postIncidentSupportRecoveryText =
|
|
await postIncidentSupportRecoveryQuillController.getText();
|
|
return aboutPlanText.isNotEmpty &&
|
|
managementOfBehaviouralPresentationText.isNotEmpty &&
|
|
secondaryPreventionText.isNotEmpty &&
|
|
reactiveStrategiesText.isNotEmpty &&
|
|
postIncidentSupportRecoveryText.isNotEmpty;
|
|
}
|
|
|
|
AddPBSPlanModel.empty();
|
|
|
|
AddPBSPlanModel.fromJson(Map<String, dynamic> json){
|
|
userId = json['userId'];
|
|
staffId = json['staffId'];
|
|
aboutPlanNote = json['aboutPlan'];
|
|
managementOfBehaviouralPresentationNote = json['managementOfBehaviorPlan'];
|
|
secondaryPreventionNote = json['secondaryPrevention'];
|
|
reactiveStrategiesNote = json['reactiveStartegies'];
|
|
postIncidentSupportRecoveryNote = json['postIncidentSupport'];
|
|
planId = json['_id'];
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AddPBSPlanModel{userId: $userId, staffId: $staffId, planId: $planId, aboutPlanNote: $aboutPlanNote, aboutPlanQuillController: $aboutPlanQuillController, managementOfBehaviouralPresentationNote: $managementOfBehaviouralPresentationNote, managementOfBehaviouralPresentationQuillController: $managementOfBehaviouralPresentationQuillController, secondaryPreventionNote: $secondaryPreventionNote, secondaryPreventionQuillController: $secondaryPreventionQuillController, reactiveStrategiesNote: $reactiveStrategiesNote, reactiveStrategiesQuillController: $reactiveStrategiesQuillController, postIncidentSupportRecoveryNote: $postIncidentSupportRecoveryNote, postIncidentSupportRecoveryQuillController: $postIncidentSupportRecoveryQuillController}';
|
|
}
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
// final _data = <String, dynamic>{};
|
|
// _data['userId'] = userId;
|
|
// _data['staffId'] = staffId;
|
|
// _data['aboutPlan'] = aboutPlan;
|
|
// _data['managementOfBehaviorPlan'] = managementOfBehaviorPlan;
|
|
// _data['secondaryPrevention'] = secondaryPrevention;
|
|
// _data['reactiveStartegies'] = reactiveStartegies;
|
|
// _data['postIncidentSupport'] = postIncidentSupport;
|
|
// _data['_id'] = _id;
|
|
// return _data;
|
|
// }
|
|
|
|
} |