fist commit ftc staff app clone

This commit is contained in:
2024-08-01 13:46:46 +05:30
commit bf9064a9c9
515 changed files with 42796 additions and 0 deletions

View File

@@ -0,0 +1,116 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import '../../../../controllers/clients/careNoteFormControllers/ABC_form_screen_controller.dart';
class ABCFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const ABCFormScreen({Key? key, required this.args}) : super(key: key);
@override
State<ABCFormScreen> createState() => _ABCFormScreenState();
}
class _ABCFormScreenState extends State<ABCFormScreen> {
late final ABCFormScreenController controller;
@override
void initState() {
controller = Get.put(ABCFormScreenController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add ABC Note',
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
16.verticalSpace,
InkWell(
onTap: () =>controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select...",
heading: "Date / Time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.antecedentEventsController,
textCapitalization: TextCapitalization.sentences,
heading: 'Antecedent Events',
hintText: 'Type here...',
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.behaviourController,
textCapitalization: TextCapitalization.sentences,
heading: 'Behaviour',
hintText: 'Type here...',
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.consequenceEventsController,
textCapitalization: TextCapitalization.sentences,
heading: 'Consequence Events',
hintText: 'Type here...',
onChange: (_) {},
),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,663 @@
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/consent_capacity_form_screen_controller.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class ConsentCapacityFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const ConsentCapacityFormScreen({Key? key, required this.args})
: super(key: key);
@override
State<ConsentCapacityFormScreen> createState() =>
_ConsentCapacityFormScreenState();
}
class _ConsentCapacityFormScreenState extends State<ConsentCapacityFormScreen> {
late final ConsentCapacityFormScreenController controller;
@override
void initState() {
controller =
Get.put(ConsentCapacityFormScreenController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add Consent, Capacity, MCA & DOLS note',
),
body: SafeArea(
child: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
16.verticalSpace,
InkWell(
onTap: () => controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select...",
heading: "Date / Time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.commentsController,
heading: "Comments",
hintText: "Type comments here...",
onChange: (_) {},
),
20.verticalSpace,
Padding(
padding: REdgeInsets.only(left: 8.0),
child: CustomTextWidget(
text: "Is an MCA required to be completed?",
isExpanded: false,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
fontColor: Colors.black,
),
),
8.verticalSpace,
_radioGroup(controller.selectedMCARequiredOption),
20.verticalSpace,
Obx(() {
return controller.selectedMCARequiredOption() == "Yes"
? Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: _otherFormWidgets(),
)
: const SizedBox.shrink();
}),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
),
);
}
Widget _radioGroup(Rx<String?> selectedOption) {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Flexible(
child: RadioButton(
value: 'Yes',
selectedOption: selectedOption,
),
),
16.horizontalSpace,
Flexible(
child: RadioButton(
value: 'No',
selectedOption: selectedOption,
),
),
],
);
}
List<Widget> _otherFormWidgets() {
return [
Html(data: """<div class="row">
<div class="col-md-12">
<p><strong>This Mental Capacity Assessment must adhere to the Acts 5 principles:</strong>
</p>
<ul>
<li>Every adult has the right to make his or her own decisions and must be assumed to
have capacity to make them unless proved otherwise.
</li>
<li>A person must be given all practicable help before anyone treat them as not being
able to make their own decisions.
</li>
<li>Just because an individual makes what may be seen as an unwise decision, they should
not be treated as lacking capacity to make that decision
</li>
<li>Anything done or any decision made on behalf of a person who lacks capacity must be
done in their best interests.
</li>
<li>Anything done or any decision made on behalf of a person who lacks capacity should
be the least restrictive of their basic rights and freedoms.
</li>
</ul>
</div>
<div class="col-md-12"><p>This form has been developed to support compliance with the Mental
Capacity Act 2005. There is a statutory requirement for anyone undertaking an assessment to
have regard to the Code of Practice for the Mental Capacity Act. References given below
refer to the relevant paragraphs of the Mental Capacity Act Code of Practice. Please also
refer to MCA and DoLS Policy and Guidance. (For day to day decisions, please print out/ fill
in relevant sections 1.1 - 1.10)</p>
</div>
</div>"""),
10.verticalSpace,
_multilineTextField(
controller: controller.mentalCapacityAssessmentDetailController,
heading: "Detail",
hintText: "Type here...",
),
Html(
data: """<div class="row">
<div class="col-md-12"><p><strong>1.2 What is the specific decision relevant to this mental
capacity assessment?</strong> Please ensure that the decision is phrased in a way to enable
all viable options to be discussed. The MCA Code paragraph 4.4 states 'An assessment of a
persons capacity must be based on their ability to make a specific decision at the time it
needs to be made, and not their ability to make decisions in general.'</p>
</div>
</div>""",
),
10.verticalSpace,
_multilineTextField(
controller: controller.specificDecisionDetailController,
heading: "Detail",
hintText: "Type here...",
),
Html(
data:
"""<div class="col-md-12"><p><strong>1.3 Person undertaking/or who has undertaken this assessment of
capacity?</strong> The person with greatest responsibility for the specific decision is known as
the decision-maker and should assess capacity. The decision maker is the person intending to
make the decision or carry out the action. Complex decisions may require specialist assessment -
seek guidance. See 4.38 to 4.43 of the Code.</p></div>
""",
),
10.verticalSpace,
_singleLineTextField(
controller: controller.name1Controller,
heading: "Name",
hintText: "Type here...",
inputType: TextInputType.name,
),
20.verticalSpace,
_singleLineTextField(
controller: controller.roleController,
heading: "Role",
hintText: "Type here...",
),
20.verticalSpace,
_singleLineTextField(
controller: controller.organisationController,
heading: "Organisation",
hintText: "Type here...",
),
20.verticalSpace,
_singleLineTextField(
controller: controller.addressController,
heading: "Address",
hintText: "Type here...",
),
20.verticalSpace,
_singleLineTextField(
controller: controller.telController,
heading: "Tel",
hintText: "Type here...",
inputType: TextInputType.phone,
),
20.verticalSpace,
_singleLineTextField(
controller: controller.emailController,
heading: "Email",
hintText: "Type here...",
inputType: TextInputType.emailAddress,
),
20.verticalSpace,
InkWell(
onTap: () => controller.selectAssessmentDateTime(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.assessmentDateTimeController,
hintText: "Select...",
heading: "Date and time of assessment",
isEnabled: false,
onChange: (_) {},
),
),
Html(
data:
"""<div class="col-md-12"><p><strong>1.4 What concerns/triggers have given rise to this assessment of
capacity?</strong> People have the right to make decisions that others might think are unwise. A
person who makes a decision that others think is unwise should not automatically be labelled as
lacking the capacity to make a decision. See MCA Code 4.35.</p></div>
<p><strong>What is the reason to believe this person may lack capacity to make this particular decision? State your evidence:</strong></p>
""",
),
10.verticalSpace,
_multilineTextField(
controller:
controller.lackCapacityToMakeParticularDecisionDetailController,
heading: "Detail",
hintText: "Type here...",
),
Html(
data:
"""<div class="col-md-12"><p><strong>1.5 Record your evidence here of the actions you have taken to
support the person. </strong>Consider what kind of help and support you can give the person to
help them understand, retain, weigh up information and communicate their decision. </p>
<p><strong>Have you discussed with the person and/or appropriate others the most suitable venue
for the assessment? </strong>For example: Does the person feel more comfortable in their own
room? Does it need to be quiet? See MCA Code 3.13.</p>
<p><strong>Have you discussed with the person and/or appropriate others to establish timing of
assessment</strong> For example: Is there a time of day that is better for the person? Would
it help to have a particular person present? See MCA Code 3.14.</p>
<p><strong>Does the person have any language/communication issues? </strong> For example: Do
they have hearing or speech difficulties? Do you need an interpreter? Do they communicate
using special equipment e.g. a light talker communication device? See MCA Code 3.11.</p>
<p><strong>Have you provided all the information, regarding all viable and available options
that the person needs to consider, to make an informed decision? </strong>See MCA Code 3.7.
The assessor must ensure that the person has:</p>
<ol>
<li>Sufficiently detailed alternative plans explained to them to allow them to weigh up the
alternatives and make an informed choice where possible.
</li>
<li>Been supported by the assessor to explore the reasonably foreseeable consequences of
deciding one way or another, or failing to make the decision.
</li>
</ol>
</div>""",
),
10.verticalSpace,
_multilineTextField(
controller: controller.recordYourEvidenceDescribeController,
heading: "Describe",
hintText: "Type here...",
),
20.verticalSpace,
_multilineTextField(
controller: controller.viableOptionsConsideredController,
heading: "Viable options considered",
hintText: "Type here...",
),
Html(
data:
"""<div class="col-md-12"><p><strong>If the decision is not urgent can it be delayed because the person
is likely to regain or develop the capacity to make it for themselves?</strong></p>
</div>""",
),
10.verticalSpace,
...List.generate(controller.canDecisionBeDelayedOptions.length, (index) {
final e = controller.canDecisionBeDelayedOptions[index];
return ObxValue((RxBool isChecked) {
return CheckboxListTile(
value: isChecked(),
onChanged: isChecked,
controlAffinity: ListTileControlAffinity.trailing,
shape: const RoundedRectangleBorder(
side: BorderSide(color: CustomAppColors.kSmokeColor)),
tileColor:
(index % 2 == 0) ? CustomAppColors.kSmokeColor : Colors.white,
title: CustomTextWidget(
text: e.requirements,
isExpanded: false,
fontSize: 13.sp,
fontWeight: FontWeight.w400,
fontColor: Colors.black,
textAlign: TextAlign.left,
),
);
}, e.isChecked);
}),
20.verticalSpace,
_multilineTextField(
controller: controller.explainWhyTickedBoxController,
heading: "Explain why you have ticked box(s)",
hintText: "Type here...",
),
Html(
data:
"""<div class="col-md-12"><p><strong>1.6 Two Stage Capacity Assessment</strong> Answer the question
with facts. The questions cannot be answered with a simple “yes” or “no” and you are asked to
describe the assessment process. See MCA Code Ch. 4. </p>
<p><strong>Stage 1. Is there an impairment or disturbance in the functioning of the persons
mind or brain</strong> The person may not have a diagnosis but the Code says that proof of
an impairment or disturbance of the functioning of the mind or brain is required. You should
record here your reasons for believing this to be the case. See 4.11 - 4.12 of the Code.
This could be because of, for example, a head injury, a suspected infection or stroke, a
diagnosed dementia, mental illness, or learning disability.</p>
</div>""",
),
_radioGroup(controller.selectedImpairmentOption),
20.verticalSpace,
_multilineTextField(
controller: controller.impairmentDescribeController,
heading: "Describe",
hintText: "Type here...",
),
Html(
data: """<div>
<p><strong>If the person does not meet Stage 1, the assessment should immediately stop. Stage 2.
Record here how the identified impairment or disturbance in Stage 1 is affecting the
persons ability to make the decision.</strong>See 4.13 to 4.30 of the Code.</p>
<p><strong>Can the person understand the information relevant to the decision? </strong> See
4.16 to 4.19 of the Code.</p>
</div>""",
),
_radioGroup(controller.selectedCanPersonDecisionInfoOption),
20.verticalSpace,
_multilineTextField(
controller: controller.describeCanPersonDecisionInfoController,
heading: "Describe how you assessed this",
hintText: "Type here...",
),
Html(
data:
"""<p><strong>Can they retain that information long enough to make the decision? </strong>See 4.20 to 4.22 of the Code.</p>""",
),
_radioGroup(controller.selectedCanTheyRetainOption),
20.verticalSpace,
_multilineTextField(
controller: controller.describeCanTheyRetainController,
heading: "Describe how you assessed this",
hintText: "Type here...",
),
Html(
data:
"""<p><strong>Can they use or weigh up that information as part of the process of making the decision? </strong>See 4.21 to 4.22 of the Code.</p>""",
),
_radioGroup(controller.selectedCanTheyUseOption),
20.verticalSpace,
_multilineTextField(
controller: controller.describeCanTheyUseController,
heading: "Describe how you assessed this",
hintText: "Type here...",
),
Html(
data:
"""<p><strong>Can they communicate their decision, by any means available to them? </strong>See 4.23 to 4.25 of the Code.</p>""",
),
_radioGroup(controller.selectedCanTheyCommunicateOption),
20.verticalSpace,
_multilineTextField(
controller: controller.describeCanTheyCommunicateController,
heading: "Describe how you assessed this",
hintText: "Type here...",
),
Html(
data: """<div>
<p><strong>NB. If all of the answers to the four questions above are YES, then Stage 2 is not
met
and the assessment must end. </strong></p>
<p><strong>Stage 3: Causative Nexus</strong> There is a causative link between the impairment or
disturbance in the functioning of mind and brain AND the inability to make the required
decision. You must be able to evidence that the reason the person is unable to make the
decision is because of the impairment or disturbance in the functioning of mind or brain and
for no other reason. </p>
</div>""",
),
...List.generate(controller.causativeNexusOptions.length, (index) {
final e = controller.causativeNexusOptions[index];
return ObxValue((RxBool isChecked) {
return CheckboxListTile(
value: isChecked(),
onChanged: isChecked,
controlAffinity: ListTileControlAffinity.trailing,
shape: const RoundedRectangleBorder(
side: BorderSide(color: CustomAppColors.kSmokeColor)),
tileColor:
(index % 2 == 0) ? CustomAppColors.kSmokeColor : Colors.white,
title: CustomTextWidget(
text: e.requirements,
isExpanded: false,
fontSize: 13.sp,
fontWeight: FontWeight.w400,
fontColor: Colors.black,
textAlign: TextAlign.left,
),
);
}, e.isChecked);
}),
20.verticalSpace,
_multilineTextField(
controller: controller.evidenceController,
heading: "Evidence",
hintText: "Type here...",
),
Html(
data:
"""<div><p><strong>1.7 Lack of mental capacity as a result of an impairment/disturbance in mind/brain
must
be distinguished from a situation where a person is unable to make their own decision as a
result of duress or undue influence. A person who has the mental capacity to make decisions may
have their ability to give free and true consent impaired if they are under constraint, coercion
or undue influence. Duress and undue influence may be affected by eroded confidence due to fear
of reprisal or abandonment, sense of obligation, cultural factors, power relationships or
coercive control within domestic abuse. Do you have a concern that the person may be under
duress/coercion or undue influence in relation to the making of this decision? If so, this will
not satisfy the Stage 1 (Diagnostic) test. You have to have an impairment or disturbance of the
mind or brain to satisfy that test. </strong></p><p><strong>Do you have a concern that the person may be under duress, coercion or undue influence?</strong></p></div>""",
),
_radioGroup(controller.selectedDoYouHaveConcernOption),
20.verticalSpace,
_multilineTextField(
controller: controller.whatIsYourEvidenceController,
heading: "If yes, what is your evidence for saying this?",
hintText: "Type here...",
),
10.verticalSpace,
Html(
data:
"""<p>If yes, what actions you intend to take (including consideration of seeking management/legal advice)</p>"""),
_multilineTextField(
controller: controller.seekingManagementDescribeController,
heading: "Describe",
hintText: "Type here...",
),
Html(
data:
"""<p><strong>1.8 Please record here any further information or content of your interview with the person.</strong></p>"""),
_multilineTextField(
controller: controller.recordInterviewDescribeController,
heading: "Describe",
hintText: "Type here...",
),
Html(
data:
"""<div class="col-md-12"><p><strong>1.9 Determination of Capacity</strong></p>
<p>I have assessed this persons capacity to make the specific decision and determined on the
balance of probability that they do not have the capacity to make this decision at this
time.</p></div>"""),
_singleLineTextField(
controller: controller.dontHaveDecisionNameController,
heading: "Name",
hintText: "Type here...",
inputType: TextInputType.name,
),
20.verticalSpace,
InkWell(
onTap: () => controller.selectDontHaveDecisionDateTime(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dontHaveDecisionDateController,
hintText: "Select...",
heading: "Date",
isEnabled: false,
onChange: (_) {},
),
),
Html(
data:
"""<div class="col-md-12"><p>I have assessed this persons capacity to make the specific decision and
determined that on the balance of probability that they have the capacity to make this decision
at this time.</p></div>"""),
_singleLineTextField(
controller: controller.haveDecisionNameController,
heading: "Name",
hintText: "Type here...",
inputType: TextInputType.name,
),
20.verticalSpace,
InkWell(
onTap: () => controller.selectHaveDecisionDateTime(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.haveDecisionDateController,
hintText: "Select...",
heading: "Date",
isEnabled: false,
onChange: (_) {},
),
),
Html(
data:
"""<div class="col-md-12"><p><strong>Is an IMCA Required?</strong></p>
<ul>
<li>If the person (16+) is unbefriended and the decision is about a change of accommodation,
or serious medical treatment, you MUST involve an IMCA.
</li>
<li>If a friend or family member exists, but they may not act in the persons best interests
(for example because they are the alleged victim or abuser in a Safeguarding Adults
investigation) you MAY involve an IMCA.
</li>
<li>If the person is unbefriended and a health or social care review is being carried out,
you MAY CONSIDER involving an IMCA as good practice.
</li>
<li>Although you may involve an IMCA under the Mental Capacity Act legislation, if there is
no appropriate person, for people over age 18, you MUST instruct a Care Act Advocate if
the person has substantial difficulty engaging with the relevant assessment &amp;
support planning/review/safeguarding process. Please use the most appropriate
legislation to ensure entitlement to advocacy.
</li>
</ul>
<p>Does the individual require an IMCA?</p>
</div>"""),
_radioGroup(controller.selectedDoesRequireIMCAOption),
20.verticalSpace,
_multilineTextField(
controller: controller.requireIMCAController,
heading: "If not, please give reasons.",
hintText: "Type here...",
),
20.verticalSpace,
InkWell(
onTap: () => controller.selectDateTimeOfWhyIMCARequired(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.whyIMCARequiredDateController,
hintText: "Select...",
heading: "Date and time of assessment",
isEnabled: false,
onChange: (_) {},
),
),
Html(
data: """<p><strong>Assessors Details.</strong></p>""",
),
10.verticalSpace,
_singleLineTextField(
controller: controller.assessorsName4Controller,
heading: "Name",
hintText: "Type here...",
inputType: TextInputType.name,
),
20.verticalSpace,
_singleLineTextField(
controller: controller.designationController,
heading: "Designation",
hintText: "Type here...",
),
20.verticalSpace,
_singleLineTextField(
controller: controller.baseAddressController,
heading: "Base / Address",
hintText: "Type here...",
),
20.verticalSpace,
_singleLineTextField(
controller: controller.contactDetailsController,
heading: "Contact Details",
hintText: "Type here...",
),
];
}
Widget _multilineTextField(
{required TextEditingController controller,
required String heading,
required String hintText}) {
return CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 4,
maxLines: 4,
controller: controller,
heading: heading,
hintText: hintText,
onChange: (_) {},
);
}
Widget _singleLineTextField(
{required TextEditingController controller,
required String heading,
required String hintText,
TextInputType inputType = TextInputType.text}) {
return CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller,
heading: heading,
hintText: hintText,
inputType: inputType,
onChange: (_) {},
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,11 @@
export 'package:ftc_mobile_app/view/screens/clients/careNoteForms/ABC_form_screen.dart';
export 'package:ftc_mobile_app/view/screens/clients/careNoteForms/consent_capacity_form_screen.dart';
export 'package:ftc_mobile_app/view/screens/clients/careNoteForms/free_text_entries_form_screen.dart';
export 'package:ftc_mobile_app/view/screens/clients/careNoteForms/health_appointments_form_screen.dart';
export 'package:ftc_mobile_app/view/screens/clients/careNoteForms/injury_health_issue_form_screen.dart';
export 'package:ftc_mobile_app/view/screens/clients/careNoteForms/observations_form_screen.dart';
export 'package:ftc_mobile_app/view/screens/clients/careNoteForms/physical_intervention_form_screen.dart';
export 'package:ftc_mobile_app/view/screens/clients/careNoteForms/safeguarding_form_screen.dart';
export 'package:ftc_mobile_app/view/screens/clients/careNoteForms/showering_bath_form_screen.dart';
export 'package:ftc_mobile_app/view/screens/clients/careNoteForms/toileting_note_form_screen.dart';
export 'package:ftc_mobile_app/view/screens/clients/careNoteForms/weight_height_form_screen.dart';

View File

@@ -0,0 +1,139 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/free_text_entries_form_screen_controller.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class FreeTextEntriesFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const FreeTextEntriesFormScreen({Key? key, required this.args})
: super(key: key);
@override
State<FreeTextEntriesFormScreen> createState() =>
_FreeTextEntriesFormScreenState();
}
class _FreeTextEntriesFormScreenState extends State<FreeTextEntriesFormScreen> {
late final FreeTextEntriesFormScreenController controller;
@override
void initState() {
controller =
Get.put(FreeTextEntriesFormScreenController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add note',
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
16.verticalSpace,
InkWell(
onTap: () =>controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select date and time",
heading: "Event Date / Time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.titleController,
textCapitalization: TextCapitalization.words,
hintText: ConstantText.kTypeTitle,
heading: ConstantText.kTitle,
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.noteDetailsController,
textCapitalization: TextCapitalization.sentences,
heading: ConstantText.kNoteDetails,
hintText: ConstantText.kNoteDetailsHint,
onChange: (_) {},
),
10.verticalSpace,
SizedBox(
height: 30.h,
child: GestureDetector(
onTap: controller.flagForHandover.toggle,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Obx(
() => Ink(
width: 32.r,
height: 32.r,
child: Checkbox(
value: controller.flagForHandover.value,
activeColor: CustomAppColors.kSecondaryColor,
onChanged: (value) {
controller.flagForHandover.value = value ?? false;
},
),
),
),
CustomTextWidget(
text: ConstantText.kFlagForHandover,
isExpanded: false,
fontSize: 10.sp,
fontWeight: FontWeight.w400,
),
],
),
),
),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,175 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/health_appointments_form_screen_controller.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class HealthAppointmentsFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const HealthAppointmentsFormScreen({Key? key, required this.args})
: super(key: key);
@override
State<HealthAppointmentsFormScreen> createState() =>
_HealthAppointmentsFormScreenState();
}
class _HealthAppointmentsFormScreenState
extends State<HealthAppointmentsFormScreen> {
late final HealthAppointmentsFormScreenController controller;
@override
void initState() {
controller =
Get.put(HealthAppointmentsFormScreenController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add Health Appointments note',
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
16.verticalSpace,
InkWell(
onTap: () => controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select...",
heading: "Date / Time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
_appointmentWithDropdown,
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.reasonController,
heading: "Reason for appointment",
hintText: "Reason for appointment",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.commentsController,
heading: "Comments",
hintText: "Type comments here...",
onChange: (_) {},
),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
);
}
Widget get _appointmentWithDropdown {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.r),
border: Border.all(
color: CustomAppColors.kLightGreyColor,
width: 1.sp,
),
),
padding: EdgeInsets.symmetric(
vertical: 5.h,
horizontal: 15.w,
),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomTextWidget(
text: "Appointment With",
fontSize: 10.sp,
fontWeight: FontWeight.w500,
fontColor: CustomAppColors.kLightTextColor,
alignment: Alignment.centerLeft,
),
DropdownButtonHideUnderline(
child: DropdownButtonFormField<String>(
onTap: () {
FocusScopeNode().unfocus();
},
dropdownColor: Colors.white,
decoration: const InputDecoration(
border: InputBorder.none,
),
hint: Text(
"Appointment With",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14.sp,
color: CustomAppColors.kLightTextColor,
),
),
items: controller.appointmentWith
.map(
(e) => DropdownMenuItem<String>(
value: e,
child: Text(e),
),
)
.toList(),
isExpanded: true,
iconSize: 20.h,
icon: Padding(
padding: REdgeInsets.only(right: 4.0),
child:
const Icon(Icons.arrow_drop_down_sharp, color: Colors.grey),
),
onChanged: (category) {
controller.selectedAppointmentWith = category;
},
),
),
],
),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,263 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/injury_health_issue_form_screen_controller.dart';
import 'package:ftc_mobile_app/view/custom_widgets/clients/category_subcategory_dropdowns_widget.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class InjuryHealthIssueFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const InjuryHealthIssueFormScreen({Key? key, required this.args})
: super(key: key);
@override
State<InjuryHealthIssueFormScreen> createState() =>
_InjuryHealthIssueFormScreenState();
}
class _InjuryHealthIssueFormScreenState
extends State<InjuryHealthIssueFormScreen> {
late final InjuryHealthIssueFormScreenController controller;
@override
void initState() {
controller =
Get.put(InjuryHealthIssueFormScreenController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add Injury Health Issue note',
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
16.verticalSpace,
InkWell(
onTap: () =>controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select date and time",
heading: "Date and time of accident",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 4,
maxLines: 4,
controller: controller.nameOfWitnesses,
heading: "Name of witnesses/adults present",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 4,
maxLines: 4,
controller: controller.placeOfAccident,
heading: "Place accident occured",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 4,
maxLines: 4,
controller: controller.accidentDescription,
heading: "Description how the accident occured",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 4,
maxLines: 4,
controller: controller.recordOfInjury,
heading: "Record of any injury and action taken",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 4,
maxLines: 4,
controller: controller.conditionOfPatient,
heading: "Condition of the patient following of the accident",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
CategorySubcategoryDropdownsWidget(
controller: controller.catSubCatController,
),
20.verticalSpace,
Padding(
padding: REdgeInsets.only(left: 8.0),
child: CustomTextWidget(
text: "Parent Contacted",
isExpanded: false,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
fontColor: Colors.black,
),
),
8.verticalSpace,
radioGroup(),
Obx(() => controller.isParentContacted() == "Yes"
? Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: widgetsIfParentContacted(),
)
: const SizedBox.shrink()),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
);
}
List<Widget> widgetsIfParentContacted() {
return [
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.nameOfParentContacted,
heading: "Name of parent contacted",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
InkWell(
onTap: () => controller.selectParentContactTime(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.parentContactedTime,
hintText: "Contact time",
heading: "Contact time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
Padding(
padding: REdgeInsets.only(left: 8.0),
child: CustomTextWidget(
text: "How parent was contacted",
isExpanded: false,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
fontColor: Colors.black,
),
),
8.verticalSpace,
howParentContactedRadioGroup(),
];
}
Widget radioGroup() {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Flexible(
child: RadioButton(
value: 'Yes',
selectedOption: controller.isParentContacted,
),
),
16.horizontalSpace,
Flexible(
child: RadioButton(
value: 'No',
selectedOption: controller.isParentContacted,
),
),
],
);
}
Widget howParentContactedRadioGroup() {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Flexible(
child: RadioButton(
value: 'Call',
selectedOption: controller.howParentContacted,
),
),
16.horizontalSpace,
Flexible(
child: RadioButton(
value: 'Email',
selectedOption: controller.howParentContacted,
),
),
16.horizontalSpace,
Flexible(
child: RadioButton(
value: 'Text',
selectedOption: controller.howParentContacted,
),
),
],
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,110 @@
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import '../../../../controllers/clients/careNoteFormControllers/mood_rating_form_controller.dart';
class MoodRatingFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const MoodRatingFormScreen({super.key, required this.args});
@override
State<MoodRatingFormScreen> createState() => _MoodRatingFormScreenState();
}
class _MoodRatingFormScreenState extends State<MoodRatingFormScreen> {
late final MoodRatingFormController controller;
@override
void initState() {
controller = Get.put(MoodRatingFormController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add Mood Rating note',
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
children: [
16.verticalSpace,
InkWell(
onTap: () => controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select date and time",
heading: "Event Date / Time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
//...Other widgets
ListView.separated(
shrinkWrap: true,
itemCount: controller.ratings.length,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (_, index) {
return Obx(() {
return CheckboxListTile(
value: controller.selectedRating() ==
controller.ratings[index],
contentPadding: const EdgeInsets.symmetric(horizontal: 0),
secondary: Image.asset(
controller.ratings[index].icon,
width: 40.r,
height: 40.r,
),
title: CustomTextWidget(
text: controller.ratings[index].name,
textAlign: TextAlign.left,
fontSize: 16.sp,
fontWeight: FontWeight.w600,
),
controlAffinity: ListTileControlAffinity.trailing,
onChanged: (bool? value) {
if (value == true) {
controller.selectedRating.value =
controller.ratings[index];
}
},
);
});
},
separatorBuilder: (_, index) => 10.verticalSpace,
),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,153 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/nutrition_hydration_form_screen_controller.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class NutritionHydrationFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const NutritionHydrationFormScreen({Key? key, required this.args})
: super(key: key);
@override
State<NutritionHydrationFormScreen> createState() =>
_NutritionHydrationFormScreenState();
}
class _NutritionHydrationFormScreenState
extends State<NutritionHydrationFormScreen> {
late final NutritionHydrationFormScreenController controller;
@override
void initState() {
controller =
Get.put(NutritionHydrationFormScreenController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add Nutrition Hydration Note',
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
16.verticalSpace,
InkWell(
onTap: () => controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select date and time",
heading: "Date / Time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
_radioGroup(controller.typeOptions, controller.selectedType),
20.verticalSpace,
Obx(() {
return CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.mealDrinkTypeController,
textCapitalization: TextCapitalization.words,
heading:
(controller.selectedType() == NutritionHydrationType.food)
? "Meal Type: (Breakfast, Lunch, Dinner, Snack etc)"
: 'Drink Type',
hintText: "Type here...",
onChange: (_) {},
);
}),
20.verticalSpace,
Obx(() {
return CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.amountController,
textCapitalization: TextCapitalization.words,
heading:
(controller.selectedType() == NutritionHydrationType.food)
? "Amount Eaten"
: "Amount (ML)",
hintText: "Type here...",
onChange: (_) {},
);
}),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.commentsController,
textCapitalization: TextCapitalization.sentences,
heading: "Comments",
hintText: "Type comments here...",
onChange: (_) {},
),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
);
}
Widget _radioGroup(List<String> options, Rx<String?> selected) {
options.map((e) => Flexible(
child: RadioButton(
value: e,
selectedOption: selected,
),
));
return Wrap(
runAlignment: WrapAlignment.start,
direction: Axis.horizontal,
runSpacing: 8.r,
spacing: 16.r,
children: options
.map((e) => RadioButton(
value: e,
selectedOption: selected,
))
.toList(),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,135 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/observations_form_screen_controller.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class ObservationsFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const ObservationsFormScreen({Key? key, required this.args})
: super(key: key);
@override
State<ObservationsFormScreen> createState() => _ObservationsFormScreenState();
}
class _ObservationsFormScreenState extends State<ObservationsFormScreen> {
late final ObservationsFormScreenController controller;
@override
void initState() {
controller = Get.put(ObservationsFormScreenController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add Health Observations note',
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
16.verticalSpace,
InkWell(
onTap: () =>controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select...",
heading: "Date / Time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
_singleLineTextField(
textEditingController: controller.heartRateController,
hint: "Heart Rate (BPM)",
heading: "Heart Rate (BPM)",
),
20.verticalSpace,
_singleLineTextField(
textEditingController: controller.bloodPressureController,
hint: "Blood Pressure (/MMHG)",
heading: "Blood Pressure (/MMHG)",
),
20.verticalSpace,
_singleLineTextField(
textEditingController: controller.respiratoryRateController,
hint: "Respiratory Rate",
heading: "Respiratory Rate",
),
20.verticalSpace,
_singleLineTextField(
textEditingController: controller.oxygenController,
hint: "Oxygen (%)",
heading: "Oxygen (%)",
),
20.verticalSpace,
_singleLineTextField(
textEditingController: controller.temperatureController,
hint: "Temperature (°C)",
heading: "Temperature (°C)",
),
20.verticalSpace,
_singleLineTextField(
textEditingController: controller.bloodSugarController,
hint: "Blood Sugar (MMOL/L)",
heading: "Blood Sugar (MMOL/L)",
),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
);
}
Widget _singleLineTextField(
{required TextEditingController textEditingController,
required String heading,
required String hint}) {
return CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
maxLength: 4,
controller: textEditingController,
heading: heading,
hintText: hint,
inputType: const TextInputType.numberWithOptions(),
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
onChange: (_) {},
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,329 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/physical_intervention_form_screen_controller.dart';
import 'package:ftc_mobile_app/view/custom_widgets/clients/category_subcategory_dropdowns_widget.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class PhysicalInterventionFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const PhysicalInterventionFormScreen({Key? key, required this.args})
: super(key: key);
@override
State<PhysicalInterventionFormScreen> createState() =>
_PhysicalInterventionFormScreenState();
}
class _PhysicalInterventionFormScreenState
extends State<PhysicalInterventionFormScreen> {
late final PhysicalInterventionFormScreenController controller;
@override
void initState() {
controller =
Get.put(PhysicalInterventionFormScreenController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add Physical Intervention note',
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
16.verticalSpace,
InkWell(
onTap: () => controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select...",
heading: "Date / Time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.durationOfIncidentController,
heading: "Duration of incident (Mins)",
hintText: "Type here...",
inputType: const TextInputType.numberWithOptions(),
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.staffDebriefFormNumberController,
heading: "Staff Debrief Form Number",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
_multilineTextField(
textEditingController: controller.nameOfWitnessController,
heading: "Name of witnesses/adults present",
hint: "Type here...",
),
20.verticalSpace,
_multilineTextField(
textEditingController: controller.incidentPlaceController,
heading: "Place incident occured",
hint: "Type here...",
),
20.verticalSpace,
_multilineTextField(
textEditingController: controller.whatWasUsedController,
heading:
"What was used prior to intervention to defuse/deescalae the situation?",
hint: "Type here...",
),
20.verticalSpace,
_multilineTextField(
textEditingController: controller.wasThePbsFollowedController,
heading:
"Was the PBS followed and was it sufficient enough to manage this incident?",
hint: "Type here...",
),
20.verticalSpace,
_multilineTextField(
textEditingController: controller.reasonForPhysicalInterventionController,
heading: "Reason for physical intervention",
hint: "Type here...",
),
20.verticalSpace,
_multilineTextField(
textEditingController: controller.staffInvolvedController,
heading: "Staff involved in the physical intervention",
hint: "Type here...",
),
20.verticalSpace,
_multilineTextField(
textEditingController: controller.conditionOfServiceUserController,
heading:
"Condition of service user following the incident, including breathing monitoring",
hint: "Type here...",
),
20.verticalSpace,
_multilineTextField(
textEditingController: controller.userClamedController,
heading: "How was the service user calmed?",
hint: "Type here...",
),
32.verticalSpace,
CustomTextWidget(
text: "Why was the use of force necessary?",
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w500,
fontColor: Colors.black,
),
12.verticalSpace,
...List.generate(controller.whyForceNecessaryOptions.length,
(index) {
final e = controller.whyForceNecessaryOptions[index];
return ObxValue((RxBool isChecked) {
return CheckboxListTile(
value: isChecked(),
onChanged: isChecked,
controlAffinity: ListTileControlAffinity.trailing,
shape: const RoundedRectangleBorder(
side: BorderSide(color: CustomAppColors.kSmokeColor)),
tileColor: (index % 2 == 0)
? CustomAppColors.kSmokeColor
: Colors.white,
title: CustomTextWidget(
text: e.requirements,
isExpanded: false,
fontSize: 13.sp,
fontWeight: FontWeight.w400,
fontColor: Colors.black,
textAlign: TextAlign.left,
),
);
}, e.isChecked);
}),
20.verticalSpace,
_multilineTextField(
textEditingController: controller.explainController,
heading: "If ticked \"Other\" please explain",
hint: "Type here...",
),
20.verticalSpace,
CategorySubcategoryDropdownsWidget(
controller: controller.catSubCatController,
),
20.verticalSpace,
Padding(
padding: REdgeInsets.only(left: 8.0),
child: CustomTextWidget(
text: "Parent Contacted",
isExpanded: false,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
fontColor: Colors.black,
),
),
8.verticalSpace,
_radioGroup(controller.isParentContactedOptions,
controller.isParentContacted),
Obx(() => controller.isParentContacted() == "Yes"
? Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: widgetsIfParentContacted(),
)
: const SizedBox.shrink()),
20.verticalSpace,
_multilineTextField(
textEditingController: controller.commentsController,
heading: "Parent/carer's comments",
hint: "Type here...",
),
20.verticalSpace,
Padding(
padding: REdgeInsets.only(left: 8.0),
child: CustomTextWidget(
text: "How was this form shared with parents/carers?",
isExpanded: false,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
fontColor: Colors.black,
),
),
8.verticalSpace,
_radioGroup(
controller.howFormSharedOptions, controller.howFormSharedRx),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
);
}
Widget _multilineTextField(
{required TextEditingController textEditingController,
required String heading,
required String hint}) {
return CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 4,
maxLines: 4,
controller: textEditingController,
heading: heading,
hintText: hint,
onChange: (_) {},
);
}
List<Widget> widgetsIfParentContacted() {
return [
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.nameOfParentContacted,
heading: "Name of parent contacted",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
InkWell(
onTap: () => controller.selectParentContactTime(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.parentContactedTime,
hintText: "Contact time",
heading: "Contact time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
Padding(
padding: REdgeInsets.only(left: 8.0),
child: CustomTextWidget(
text: "How parent was contacted",
isExpanded: false,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
fontColor: Colors.black,
),
),
8.verticalSpace,
_radioGroup(
controller.howParentContactedOptions, controller.howParentContacted),
];
}
Widget _radioGroup(List<String> options, Rx<String?> selected) {
options.map((e) => Flexible(
child: RadioButton(
value: e,
selectedOption: selected,
),
));
return Wrap(
runAlignment: WrapAlignment.start,
direction: Axis.horizontal,
runSpacing: 8.r,
spacing: 16.r,
children: options
.map((e) => RadioButton(
value: e,
selectedOption: selected,
))
.toList(),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,214 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/safeguarding_form_screen_controller.dart';
import 'package:ftc_mobile_app/view/custom_widgets/clients/category_subcategory_dropdowns_widget.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class SafeguardingFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const SafeguardingFormScreen({Key? key, required this.args})
: super(key: key);
@override
State<SafeguardingFormScreen> createState() => _SafeguardingFormScreenState();
}
class _SafeguardingFormScreenState extends State<SafeguardingFormScreen> {
late final SafeguardingFormScreenController controller;
@override
void initState() {
controller = Get.put(SafeguardingFormScreenController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add Safeguarding note',
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
16.verticalSpace,
InkWell(
onTap: () => controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select date and time",
heading: "Date and time of disclosure/findings",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 4,
maxLines: 4,
controller: controller.concernAboutServiceUserController,
heading: "Concerns about the service user",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 4,
maxLines: 4,
controller: controller.voiceOfServiceUserController,
heading: "Voice of the service user",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 4,
maxLines: 4,
controller: controller.anyImmediateRisksController,
heading: "Are there any immediate risks",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 4,
maxLines: 4,
controller: controller.qActionTakenController,
heading: "What action do you feel should be taken?",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 4,
maxLines: 4,
controller: controller.commentsController,
heading: "Comments",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
CategorySubcategoryDropdownsWidget(
controller: controller.catSubCatController),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.nameController1,
heading: "Your Name",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.anyWitnessesController,
heading: "Any witnesses",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
InkWell(
onTap: () => controller.selectDateAndTimeOfReporting(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.reportingDateTimeController,
hintText: "Select date and time",
heading: "Date and time of reporting",
isEnabled: false,
onChange: (_) {},
),
),
32.verticalSpace,
CustomTextWidget(
text: "To be completed by DSL/DDSL",
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w500,
fontColor: Colors.black,
),
12.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.nameController2,
heading: "Your Name",
hintText: "Type here...",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.actionTakenController,
heading: "Action taken",
hintText: "Type here...",
onChange: (_) {},
),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,142 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/showering_bath_form_screen_controller.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class ShoweringBathFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const ShoweringBathFormScreen({Key? key, required this.args})
: super(key: key);
@override
State<ShoweringBathFormScreen> createState() =>
_ShoweringBathFormScreenState();
}
class _ShoweringBathFormScreenState extends State<ShoweringBathFormScreen> {
late final ShoweringBathFormScreenController controller;
@override
void initState() {
controller = Get.put(ShoweringBathFormScreenController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add ShoweringBath note',
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
16.verticalSpace,
InkWell(
onTap: () =>controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select...",
heading: "Date / Time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
radioGroup(),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.commentsController,
heading: "Comments",
hintText: "Type comments here...",
onChange: (_) {},
),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
);
}
Widget radioGroup() {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Expanded(
child: RadioButton(
value: 'Bath',
selectedOption: controller.selectedOption,
),
),
Expanded(
child: RadioButton(
value: 'Shower',
selectedOption: controller.selectedOption,
),
),
Expanded(
child: RadioButton(
value: 'Wash',
selectedOption: controller.selectedOption,
),
),
],
);
}
// _selectDate() async {
// Get.focusScope?.unfocus();
// final date = await CommonCode.datePicker(context);
//
// if (date != null) {
// controller.date = date;
// controller.dateController.text =
// CommonCode.careNoteDateFormatter.format(date);
// }
// }
// _selectTime() async {
// TimeOfDay? timeOfDay = await CommonCode.selectTime(context,
// selectedTime: TimeOfDay.now(),
// themeColor: Get.theme.colorScheme.primary);
//
// if (timeOfDay != null) {
// controller.timeController.text = timeOfDay.toString();
// controller.time = timeOfDay;
// }
// }
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,169 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import '../../../../controllers/clients/careNoteFormControllers/toileting_note_form_screen_controller.dart';
class ToiletingNoteFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const ToiletingNoteFormScreen({Key? key, required this.args})
: super(key: key);
@override
State<ToiletingNoteFormScreen> createState() =>
_ToiletingNoteFormScreenState();
}
class _ToiletingNoteFormScreenState extends State<ToiletingNoteFormScreen> {
late final ToiletingNoteFormScreenController controller;
@override
void initState() {
controller = Get.put(ToiletingNoteFormScreenController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add Toileting note',
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
16.verticalSpace,
InkWell(
onTap: () =>controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select...",
heading: "Date / Time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
SizedBox(
height: 30.h,
child: GestureDetector(
onTap: controller.assistanceRequired.toggle,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Obx(
() => Ink(
width: 32.r,
height: 32.r,
child: Checkbox(
value: controller.assistanceRequired.value,
activeColor: CustomAppColors.kSecondaryColor,
onChanged: (value) {
controller.assistanceRequired.value =
value ?? false;
},
),
),
),
CustomTextWidget(
text: "Was assistance required with toileting?",
isExpanded: false,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
),
],
),
),
),
20.verticalSpace,
Padding(
padding: REdgeInsets.only(left: 8.0),
child: CustomTextWidget(
text: "If yes, what assistance?",
isExpanded: false,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
fontColor: Colors.black,
),
),
8.verticalSpace,
radioGroup(),
20.verticalSpace,
Obx(() {
return CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
isEnabled: controller.assistanceRequired(),
controller: controller.commentsController,
heading: "Comments",
hintText: "Type comments here...",
onChange: (_) {},
);
}),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
);
}
Widget radioGroup() {
return Obx(() {
return IgnorePointer(
ignoring: controller.assistanceRequired.isFalse,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Flexible(
child: RadioButton(
value: 'Bowel',
selectedOption: controller.selectedOption,
isEnabled: controller.assistanceRequired(),
),
),
16.horizontalSpace,
Flexible(
child: RadioButton(
value: 'Urine',
selectedOption: controller.selectedOption,
isEnabled: controller.assistanceRequired(),
),
),
],
),
);
});
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,126 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/weight_height_form_screen_controller.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class WeightHeightFormScreen extends StatefulWidget {
final CommonCareNoteFormArgs args;
const WeightHeightFormScreen({Key? key, required this.args})
: super(key: key);
@override
State<WeightHeightFormScreen> createState() => _WeightHeightFormScreenState();
}
class _WeightHeightFormScreenState extends State<WeightHeightFormScreen> {
late final WeightHeightFormScreenController controller;
@override
void initState() {
controller = Get.put(WeightHeightFormScreenController(args: widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Add Weight/Height note',
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
16.verticalSpace,
InkWell(
onTap: () => controller.selectDate(context),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.dateController,
hintText: "Select...",
heading: "Date / Time",
isEnabled: false,
onChange: (_) {},
),
),
20.verticalSpace,
Row(
children: [
Expanded(
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
maxLength: 3,
controller: controller.heightController,
hintText: "Height (CM)",
heading: "Height (CM)",
inputType: const TextInputType.numberWithOptions(),
onChange: (_) {},
),
),
16.horizontalSpace,
Expanded(
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
maxLength: 3,
controller: controller.weightController,
hintText: 'Weight (KG)',
heading: 'Weight (KG',
inputType: const TextInputType.numberWithOptions(),
onChange: (_) {},
),
),
],
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.commentsController,
heading: "Comments",
hintText: "Type comments here...",
onChange: (_) {},
),
32.verticalSpace,
CustomAppButton(
buttonText: ConstantText.kSave,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: controller.onSaveButtonTap,
),
20.verticalSpace,
],
),
),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}