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,165 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:get/get.dart';
class CustomForgetPasswordDialog extends StatelessWidget {
const CustomForgetPasswordDialog({
Key? key,
required this.dialogMessageText,
required this.headingText,
required this.dialogMessageTextBold,
required this.dialogButtonAcceptText,
required this.dialogButtonCloseText,
// this.acceptFunction,
}) : super(key: key);
final String headingText;
final String dialogMessageText;
final String dialogMessageTextBold;
final String dialogButtonAcceptText;
// final Function? acceptFunction;
final String dialogButtonCloseText;
@override
Widget build(BuildContext context) {
TextEditingController emailController = TextEditingController();
RxString emailErrorMsg = "".obs;
bool validateEmail() {
if (emailController.text.isEmpty) {
emailErrorMsg.value = ConstantText.kEmailIsRequired;
} else if (!GetUtils.isEmail(emailController.text)) {
emailErrorMsg.value = ConstantText.kInvalidEmail;
} else {
emailErrorMsg.value = "";
}
return emailErrorMsg.isEmpty;
}
return AlertDialog(
surfaceTintColor: CustomAppColors.kPrimaryColor,
shape: LinearBorder.top(side: BorderSide.none),
backgroundColor: CustomAppColors.kWhiteColor,
shadowColor: CustomAppColors.kWhiteColor,
titlePadding: EdgeInsets.only(top: 20.h),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
CustomTextWidget(
text: headingText,
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
),
Container(
padding: EdgeInsets.all(10.sp),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomTextWidget(
text: dialogMessageText,
isExpanded: false,
fontSize: 10.sp,
fontWeight: FontWeight.w400,
textAlign: TextAlign.center,
),
SizedBox(
height: 3.h,
),
dialogMessageTextBold != ""
? CustomTextWidget(
text: dialogMessageTextBold,
isExpanded: false,
fontSize: 10.sp,
fontWeight: FontWeight.bold,
textAlign: TextAlign.left,
)
: Container(),
],
),
),
// SizedBox(height: 10.h,),
Padding(
padding: EdgeInsets.only(top: 5.0.h),
child: CustomTextFieldWidget(
controller: emailController,
hintText: ConstantText.kPleaseInputEmail,
heading: ConstantText.kEmailHeading,
onChange: (_) {
validateEmail();
},
),
),
Obx(() {
return CustomErrorMsg(
message: emailErrorMsg.value,
);
}),
16.verticalSpace,
Row(
children: [
Expanded(
child: SizedBox(
height: 32.h,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: Size(double.infinity, 30.h),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
),
backgroundColor: CustomAppColors.kSecondaryColor),
onPressed: () async {
if (validateEmail()) {
Navigator.of(context).pop();
var response = await AuthService()
.forgetPassword(email: emailController.text)
.showLoader();
if (response == true) {
FrequentFunctions.showToast(
message:
"A password reset link has been sent to your registered email.",
);
}
// Add functionality for the "Agree" button.
}
},
child: CustomTextWidget(
text: dialogButtonAcceptText,
fontColor: CustomAppColors.kPrimaryColor,
fontSize: 14.sp,
fontWeight: FontWeight.w400),
),
),
),
SizedBox(width: 10.h),
Expanded(
child: SizedBox(
height: 32.h,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: Size(double.infinity, 30.h),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
),
backgroundColor: CustomAppColors.kLightGreyColor),
onPressed: () {
// Add functionality for the "pop" button.
Navigator.of(context).pop();
},
child: CustomTextWidget(
text: dialogButtonCloseText,
fontColor: CustomAppColors.kPrimaryColor,
fontSize: 14.sp,
fontWeight: FontWeight.w400),
),
),
),
],
),
],
),
);
}
}

View File

@@ -0,0 +1 @@
export 'custom_forget_password_dialog.dart';

View File

@@ -0,0 +1,46 @@
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:flutter/material.dart';
class CareNoteOptionCard extends StatelessWidget {
final String icon;
final String name;
const CareNoteOptionCard({
super.key,
required this.icon,
required this.name,
});
@override
Widget build(BuildContext context) {
return Card(
elevation: 2,
shadowColor: CustomAppColors.kLightGreyColor,
surfaceTintColor: Colors.white,
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4).r),
child: Padding(
padding: REdgeInsets.all(8),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
CustomImageWidget(
imagePath: icon,
height: 24.r,
width: 24.r,
),
12.verticalSpace,
CustomTextWidget(
text: name,
alignment: Alignment.center,
isExpanded: false,
fontWeight: FontWeight.w600,
fontColor: CustomAppColors.kDarkBlueTextColor,
fontSize: 14.sp)
],
),
),
);
}
}

View File

@@ -0,0 +1,170 @@
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/category_subcategory_widget_controller.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/models/clients/body_points_category.dart';
import 'package:get/get.dart';
class CategorySubcategoryDropdownsWidget extends StatelessWidget {
final CategorySubcategoryWidgetController controller;
const CategorySubcategoryDropdownsWidget(
{super.key, required this.controller});
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_bodyPartsDropdown,
_subcategoryDropdown,
],
);
}
Widget get _bodyPartsDropdown {
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: "Select Category",
fontSize: 10.sp,
fontWeight: FontWeight.w500,
fontColor: CustomAppColors.kLightTextColor,
alignment: Alignment.centerLeft,
),
Obx(() {
return DropdownButtonHideUnderline(
child: DropdownButtonFormField<BodyPointsCategory>(
onTap: () {
FocusScopeNode().unfocus();
},
dropdownColor: Colors.white,
decoration: const InputDecoration(
border: InputBorder.none,
),
hint: Text(
"Select...",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14.sp,
color: CustomAppColors.kLightTextColor,
),
),
items: controller.bodyPointsCategoryList
.map(
(e) => DropdownMenuItem<BodyPointsCategory>(
value: e,
child: Text(e.name),
),
)
.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.selectedBodyPart.value = category;
if ((category?.subCategory ?? []).isEmpty) {
controller.selectedSubcategory.value = null;
}
},
),
);
}),
],
),
);
}
Widget get _subcategoryDropdown {
return Obx(() {
return (controller.selectedBodyPart.value?.subCategory ?? []).isEmpty
? const SizedBox.shrink()
: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.r),
border: Border.all(
color: CustomAppColors.kLightGreyColor,
width: 1.sp,
),
),
margin: REdgeInsets.only(top: 20.r),
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: "Select Subcategory",
fontSize: 10.sp,
fontWeight: FontWeight.w500,
fontColor: CustomAppColors.kLightTextColor,
alignment: Alignment.centerLeft,
),
DropdownButtonHideUnderline(
child: DropdownButtonFormField<SubCat>(
onTap: () {
FocusScopeNode().unfocus();
},
dropdownColor: Colors.white,
decoration: const InputDecoration(
border: InputBorder.none,
),
hint: Text(
"Select...",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14.sp,
color: CustomAppColors.kLightTextColor,
),
),
items: controller.selectedBodyPart.value!.subCategory
.map(
(e) => DropdownMenuItem<SubCat>(
value: e,
child: Text(e.name),
),
)
.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: (value) {
if (value != null) {
controller.selectedSubcategory.value = value;
}
},
),
),
],
),
);
});
}
}

View File

@@ -0,0 +1,56 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomIconTile extends StatelessWidget {
const CustomIconTile({
super.key,
required this.iconPath,
required this.text,
required this.route,
this.arguments,
});
final String iconPath;
final String text;
final String route;
final Object? arguments;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
if (route.isNotEmpty) {
Navigator.pushNamed(context, route, arguments: arguments);
}
},
child: Container(
padding: REdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2.r),
border: Border.all(color: CustomAppColors.kSecondaryColor)),
child: Row(
children: [
CustomImageWidget(
imagePath: iconPath,
height: 16.r,
width: 16.r,
),
8.horizontalSpace,
Expanded(
child: CustomTextWidget(
text: text,
alignment: Alignment.centerLeft,
isExpanded: false,
fontWeight: FontWeight.w600,
fontColor: CustomAppColors.kDarkBlueTextColor,
fontSize: 14.sp),
),
Icon(Icons.arrow_forward_ios_rounded,
size: 12.r, color: CustomAppColors.kSecondaryColor)
],
),
),
);
}
}

View File

@@ -0,0 +1,161 @@
//
//
// import 'package:flutter/material.dart';
// import 'package:ftc_mobile_app/ftc_mobile_app.dart';
// import 'package:ftc_mobile_app/models/clients/service_users_model.dart';
// import 'package:get/get.dart';
// import '../../../models/clients/documents_list_model.dart';
//
// class ShowDocumentsOptionDialog extends StatelessWidget {
// final DocumentModel documentModel;
//
// const ShowDocumentsOptionDialog({
// super.key,required this.documentModel,
// });
//
// @override
// Widget build(BuildContext context) {
// final DocumentsListScreenController controller = Get.find();
// return AlertDialog(
// surfaceTintColor: CustomAppColors.kPrimaryColor,
// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.r)),
// backgroundColor: CustomAppColors.kPrimaryColor,
// title: Center(
// child: CustomTextWidget(
// text: 'Please Select what you wanna do',
// fontWeight: FontWeight.bold,
// isExpanded: false,
// alignment: Alignment.center,
// fontSize: 16.sp,
// ),
// ),
// content: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: [
// InkWell(
// onTap: () async{
// var response = await Navigator.pushNamed(controller.screenKey.currentContext!,
// CustomRouteNames.kAddNewDocumentScreenRoute,
// arguments: [documentModel,controller.serviceUser.value]);
// if(response is List){
// int index = controller.documentsList.value.documentList.indexWhere((item) => item == documentModel);
// controller.documentsList.value.documentList[index].title = response[0];
// controller.documentsList.value.documentList[index].details = response[1];
// controller.documentsList.refresh();
// }
// },
// child: Container(
// padding: EdgeInsets.all(1.sp),
// decoration: BoxDecoration(
// color: CustomAppColors.kYellowColor.withOpacity(0.5),
// borderRadius: BorderRadius.circular(50.r),
// ),
// child: const Icon(Icons.edit,color: CustomAppColors.kDarkYellowColor,size: 40,)),
// ),
// SizedBox(width: 3.w,),
// InkWell(
// onTap: () async {
// dynamic response = await ClientService().deleteDocumentService(docId: documentModel.id);
// if (response is bool) {
// controller.removeDocumentItem(documentModel);
// Navigator.pop(controller.screenKey.currentState!.context);
// }
// },
// child: Container(
// padding: EdgeInsets.all(1.sp),
// decoration: BoxDecoration(
// color: CustomAppColors.kRedColor.withOpacity(0.5),
// borderRadius: BorderRadius.circular(50.r),
// ),
// child: const Icon(Icons.delete,color: CustomAppColors.kRedColor,size: 40,)),
// ),
// SizedBox(width: 3.w,),
// InkWell(
// onTap: () async{
// dynamic response = await Navigator.pushNamed(
// controller.screenKey.currentContext!,
// CustomRouteNames.kAddNewDocumentScreenRoute,
// arguments: controller.serviceUser.value
// );
// if(response is DocumentModel){
// controller.documentsList.value.documentList.insert(0,response);
// controller.documentsList.refresh();
// }
// },
// child: Container(
// padding: EdgeInsets.all(1.sp),
// decoration: BoxDecoration(
// color: CustomAppColors.kSecondaryColor.withOpacity(0.5),
// borderRadius: BorderRadius.circular(50.r),
// ),
// child: const Icon(Icons.add,color: CustomAppColors.kSecondaryColor,size: 40,)),
// ),
// SizedBox(width: 3.w,),
// InkWell(
// onTap: () {
// Navigator.pushNamed(
// controller.screenKey.currentContext!,
// CustomRouteNames.kAddNewDocumentScreenRoute,
// arguments: [documentModel,true]
// );
// },
// child: Container(
// padding: EdgeInsets.all(1.sp),
// decoration: BoxDecoration(
// color: CustomAppColors.kGreenColor.withOpacity(0.5),
// borderRadius: BorderRadius.circular(50.r),
// ),
// child: const Icon(Icons.visibility,color: CustomAppColors.kGreenColor,size: 40,)),
// ),
// ],
// ),
// ],
// ),
// actions: [
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Visibility(
// visible: false,
// child: ElevatedButton(
// style: ElevatedButton.styleFrom(
// minimumSize: Size(double.infinity, 30.h),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(5.r),
// ),
// backgroundColor: CustomAppColors.kSecondaryColor
// ),
//
// onPressed: () {
// // Add functionality for the "Cancel Shift" button.
// Navigator.of(context).pop();
// },
// child: const CustomTextWidget(text: 'Cancel Shift',fontColor: CustomAppColors.kPrimaryColor),
// ),
// ),
// ElevatedButton(
// style: ElevatedButton.styleFrom(
// minimumSize: Size(double.infinity, 30.h),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(5.r),
// ),
// backgroundColor: CustomAppColors.kPrimaryColor
// ),
//
// onPressed: () {
// // Add functionality for the "Close" button.
// Navigator.of(context).pop();
// },
// child: CustomTextWidget(text: 'Close',fontColor: CustomAppColors.kBlackColor,fontSize: 15.sp),
// ),
// ],
// ),
// ],
// );
// }
// }

View File

@@ -0,0 +1,29 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CommonCloseTextButton extends StatelessWidget {
final VoidCallback? onTap;
const CommonCloseTextButton({super.key, this.onTap});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap ?? () => Navigator.of(context).pop(),
child: Container(
height: 30.h,
decoration: BoxDecoration(
border: Border.all(color: CustomAppColors.kLightGreyColor),
borderRadius: BorderRadius.circular(5.r),
),
alignment: Alignment.center,
child: CustomTextWidget(
text: 'Close',
fontColor: CustomAppColors.kBlackColor,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
),
),
);
}
}

View File

@@ -0,0 +1,143 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
final VoidCallback? onBackButtonPressed;
final Widget? action;
final Widget? leadingButton;
final Widget? titleWidget;
final String titleText;
final bool showBoxShadow;
const CustomAppBar({
Key? key,
this.onBackButtonPressed,
this.showBoxShadow = true,
this.leadingButton,
this.action,
this.titleWidget,
this.titleText = "",
}) : super(key: key);
@override
Widget build(BuildContext context) {
final ModalRoute<dynamic>? parentRoute = ModalRoute.of(context);
final bool canPop = parentRoute?.canPop ?? false;
return PreferredSize(
preferredSize: preferredSize,
child: Container(
decoration: BoxDecoration(
color: CustomAppColors.kPrimaryColor,
boxShadow: showBoxShadow
? [
BoxShadow(
color: CustomAppColors.kLightGreyColor,
spreadRadius: 1.2,
blurRadius: 4,
offset: const Offset(0, 2),
),
]
: null,
),
width: MediaQuery.of(context).size.width,
alignment: Alignment.center,
padding: EdgeInsets.only(
top: GetPlatform.isIOS ? 40.0 : 20.0,
),
child: Stack(
children: [
Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.only(top: 4.sp, left: 20.0.sp, right: 20.sp),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Builder(builder: (context) {
if (titleWidget != null) {
return titleWidget!;
}
return FittedBox(
child: CustomTextWidget(
text: titleText,
fontColor: CustomAppColors.kIconColor,
fontSize: 22.0.sp,
fontWeight: FontWeight.w500,
),
);
}),
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Visibility(
visible: canPop || leadingButton != null,
child: Padding(
padding: EdgeInsets.only(
left: 10.0.sp,
top: 32.0.sp,
),
child: leadingButton != null
? leadingButton!
: GestureDetector(
onTap: () {
if (onBackButtonPressed != null) {
onBackButtonPressed!();
} else {
Navigator.pop(context);
}
},
child: SizedBox(
width: 30.0,
height: 30.0,
child: Container(
padding: Platform.isIOS
? const EdgeInsets.symmetric(
horizontal: 10.0,
vertical: 5.0,
)
: null,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.sp),
color: CustomAppColors.kLightGreyColor,
),
alignment: Alignment.center,
child: Icon(
Icons.adaptive.arrow_back,
color: CustomAppColors.kIconColor,
size: 20.0,
),
),
),
),
),
),
const Spacer(),
Visibility(
visible: action != null,
child: Padding(
padding: EdgeInsets.only(
right: 15.0,
top: 25.0.sp,
),
child: action,
),
),
],
),
],
),
),
);
}
@override
Size get preferredSize => const Size.fromHeight(56.0);
}

View File

@@ -0,0 +1,33 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomAppBarTitleOnly extends AppBar {
CustomAppBarTitleOnly(BuildContext context,
{super.key, required String titleText})
: super(
toolbarHeight: 56.r,
leading: IconButton(
icon: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
onPressed: () {
Navigator.pop(context);
},
),
centerTitle: false,
titleSpacing: 0,
leadingWidth: 50.r,
surfaceTintColor: Colors.white,
title: CustomTextWidget(
text: titleText,
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
maxLines: 1,
textOverflow: TextOverflow.ellipsis,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
);
}

View File

@@ -0,0 +1,187 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomAppBarWithAction extends AppBar {
CustomAppBarWithAction(
BuildContext context, {
super.key,
required String titleText,
required String actionText,
Color? actionTextColor,
required Function() onActionTap,
}) : super(
toolbarHeight: 56.r,
leading: IconButton(
icon: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
onPressed: () {
Navigator.pop(context);
},
),
centerTitle: false,
titleSpacing: 0,
leadingWidth: 50.r,
surfaceTintColor: Colors.white,
title: CustomTextWidget(
text: titleText,
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
maxLines: 1,
textOverflow: TextOverflow.ellipsis,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
actions: [
TextButton(
onPressed: onActionTap,
child: Text(
actionText,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w600,
color: actionTextColor ?? CustomAppColors.kLightTextColor,
),
),
)
],
);
}
// class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
// final VoidCallback? onBackButtonPressed;
// final String titleText;
// final bool showBoxShadow;
//
// const CustomAppBar({
// Key? key,
// this.onBackButtonPressed,
// this.showBoxShadow = true,
// this.titleText = "",
// }) : super(key: key);
//
// @override
// Widget build(BuildContext context) {
// final ModalRoute<dynamic>? parentRoute = ModalRoute.of(context);
// final bool canPop = parentRoute?.canPop ?? false;
// return PreferredSize(
// preferredSize: preferredSize,
// child: Container(
// decoration: BoxDecoration(
// color: CustomAppColors.kPrimaryColor,
// boxShadow: showBoxShadow
// ? [
// BoxShadow(
// color: CustomAppColors.kLightGreyColor,
// spreadRadius: 1.2,
// blurRadius: 4,
// offset: const Offset(0, 2),
// ),
// ]
// : null,
// ),
// width: MediaQuery.of(context).size.width,
// alignment: Alignment.center,
// padding: EdgeInsets.only(
// top: GetPlatform.isIOS ? 40.0 : 20.0,
// ),
// child: Stack(
// children: [
// Container(
// width: MediaQuery.of(context).size.width,
// padding: EdgeInsets.only(top: 4.sp, left: 20.0.sp, right: 20.sp),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Builder(builder: (context) {
// CustomTextWidget(
// text: titleText,
// isExpanded: false,
// fontSize: 16.sp,
// fontWeight: FontWeight.w700,
// fontColor: CustomAppColors.kDarkBlueTextColor,
// );
// return FittedBox(
// child: CustomTextWidget(
// text: titleText,
// fontColor: CustomAppColors.kIconColor,
// fontSize: 22.0.sp,
// fontWeight: FontWeight.w500,
// ),
// );
// }),
// ],
// ),
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisSize: MainAxisSize.min,
// children: [
// Visibility(
// visible: canPop || leadingButton != null,
// child: Padding(
// padding: EdgeInsets.only(
// left: 10.0.sp,
// top: 32.0.sp,
// ),
// child: leadingButton != null
// ? leadingButton!
// : GestureDetector(
// onTap: () {
// if (onBackButtonPressed != null) {
// onBackButtonPressed!();
// } else {
// Navigator.pop(context);
// }
// },
// child: SizedBox(
// width: 30.0,
// height: 30.0,
// child: Container(
// padding: Platform.isIOS
// ? const EdgeInsets.symmetric(
// horizontal: 10.0,
// vertical: 5.0,
// )
// : null,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(4.sp),
// color: CustomAppColors.kLightGreyColor,
// ),
// alignment: Alignment.center,
// child: Icon(
// Icons.adaptive.arrow_back,
// color: CustomAppColors.kIconColor,
// size: 20.0,
// ),
// ),
// ),
// ),
// ),
// ),
// const Spacer(),
// Visibility(
// visible: action != null,
// child: Padding(
// padding: EdgeInsets.only(
// right: 15.0,
// top: 25.0.sp,
// ),
// child: action,
// ),
// ),
// ],
// ),
// ],
// ),
// ),
// );
// }
//
// @override
// Size get preferredSize => const Size.fromHeight(56.0);
// }

View File

@@ -0,0 +1,76 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomAppButton extends StatelessWidget {
final String buttonText;
final VoidCallback? onTap;
final Color? buttonColor;
final Color? textColor;
final Color? borderColor;
final bool isLoading;
const CustomAppButton({
super.key,
this.buttonColor,
this.textColor,
required this.buttonText,
this.onTap,
this.isLoading = false,
this.borderColor,
});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
if(isLoading) {
return;
}
FocusScope.of(context).unfocus();
if(onTap!=null) {
onTap!();
}
},
child: Container(
height: 48.h,
decoration: BoxDecoration(
color: buttonColor ?? CustomAppColors.kSecondaryColor,
borderRadius: BorderRadius.circular(3.r),
border: Border.all(
color: borderColor ?? CustomAppColors.kSecondaryColor,
),
),
// padding: EdgeInsets.symmetric(vertical: 15.h,),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CustomTextWidget(
text: buttonText,
fontWeight: FontWeight.w600,
isExpanded: false,
fontSize: 16.sp,
fontColor: textColor ?? CustomAppColors.kPrimaryColor,
),
Visibility(
visible: isLoading,
child: Padding(
padding: EdgeInsets.only(left: 8.0.w),
child: SizedBox(
height: 15.h,
width: 15.w,
child: CircularProgressIndicator(
color: textColor ?? CustomAppColors.kPrimaryColor,
strokeWidth: 3.0.w,
),
),
),
),
],
),
),
);
}
}

View File

@@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomCheckBox extends StatelessWidget {
final bool checkBoxValue;
final String titleText;
final VoidCallback? onTap;
const CustomCheckBox({
super.key,
required this.checkBoxValue,
required this.titleText,
this.onTap,
});
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
height: 25.h,
width: 25.w,
child: Checkbox(
value: checkBoxValue,
activeColor: CustomAppColors.kSecondaryColor,
onChanged: (_) {
if(onTap!=null) {
onTap!();
}
},
),
),
Padding(
padding: EdgeInsets.only(left: 8.0.w),
child: GestureDetector(
onTap: onTap,
child: CustomTextWidget(
text: titleText,
isExpanded: false,
fontWeight: FontWeight.w500,
fontSize: 12.sp,
),
),
),
],
);
}
}

View File

@@ -0,0 +1,26 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomErrorMsg extends StatelessWidget {
final String message;
final Alignment? alignment;
const CustomErrorMsg({
super.key,
required this.message,
this.alignment,
});
@override
Widget build(BuildContext context) {
return Visibility(
visible: message.isNotEmpty,
child: CustomTextWidget(
text: message,
fontColor: CustomAppColors.kRedColor,
fontWeight: FontWeight.w500,
alignment: alignment ?? Alignment.centerRight,
),
);
}
}

View File

@@ -0,0 +1,104 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomImageWidget extends StatelessWidget {
final String imagePath;
final BoxFit? fit;
final double? width;
final double? height;
final Color? imageColor;
const CustomImageWidget({
Key? key,
this.imagePath = "",
this.fit,
this.width,
this.height,
this.imageColor,
}) : super(key: key);
@override
Widget build(BuildContext context) {
if (imagePath.startsWith("http")) {
// handel network image here.
return Image.network(
imagePath,
fit: fit,
height: height,
width: width,
color: imageColor,
errorBuilder: (ctx, obj, stc) {
return _ErrorWidget(
size: height ?? 50.0,
color: imageColor,
);
},
);
} else if (imagePath.trim().isEmpty) {
return _ErrorWidget(
size: height ?? 50.0,
color: imageColor,
);
} else if (imagePath.startsWith("assets/") && imagePath.endsWith(".png")) {
return Image.asset(
imagePath,
fit: fit,
height: height,
width: width,
color: imageColor,
errorBuilder: (ctx, obj, stc) {
return _ErrorWidget(
size: height ?? 50.0,
color: imageColor,
);
},
);
} else if(imagePath.startsWith("assets/") && imagePath.endsWith(".svg")) {
return SvgPicture.asset(
imagePath,
height: height,
width: width,
colorFilter: imageColor!=null? ColorFilter.mode(imageColor!, BlendMode.srcIn):null,
// color: imageColor,
);
}
return Image.file(
File(imagePath),
fit: fit,
height: height,
width: width,
errorBuilder: (ctx, obj, stc) {
return _ErrorWidget(
size: height ?? 50.0,
color: imageColor,
);
},
);
}
}
class _ErrorWidget extends StatelessWidget {
final double size;
final Color? color;
const _ErrorWidget({
Key? key,
this.size = 50.0,
this.color,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Align(
alignment: Alignment.center,
child: Icon(
Icons.error_outline,
size: size,
color: color ?? CustomAppColors.kIconColor,
),
);
}
}

View File

@@ -0,0 +1,268 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/view/screens/webview/webview_screen.dart';
import 'package:get/get.dart';
import 'my_circle_image.dart';
class CustomDrawer extends StatefulWidget {
const CustomDrawer({Key? key}) : super(key: key);
@override
State<CustomDrawer> createState() => _CustomDrawerState();
}
class _CustomDrawerState extends State<CustomDrawer> {
DashboardScreenController dashboardController =
Get.put(DashboardScreenController());
CustomNavigationDrawerController drawerController =
Get.put(CustomNavigationDrawerController());
@override
Widget build(BuildContext context) {
return Drawer(
elevation: 5,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(1.r)),
backgroundColor: CustomAppColors.kPrimaryColor,
surfaceTintColor: CustomAppColors.kPrimaryColor,
child: SafeArea(
child: Column(
children: [
40.verticalSpace,
SizedBox(
width: double.infinity,
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Center(
child: GestureDetector(
onTap: () {
drawerController.selectedIndex.value = -1;
Navigator.pop(context);
Navigator.pushNamed(
context, CustomRouteNames.kViewProfileScreenRoute);
},
child: Obx(() {
return MyCircleImage(
imageSize: 80.r,
url:
"${WebUrls.baseUrl}${DashboardScreenController.instance.myProfileData()?.user?.profilePictureUrl ?? ""}",
errorWidget: CustomImageWidget(
imagePath: AssetsManager.kPersonMainIcon,
imageColor: CustomAppColors.kDarkBlueTextColor,
height: 80.r,
width: 80.r,
),
);
}),
),
),
10.verticalSpace,
Obx(
() => CustomTextWidget(
text: DashboardScreenController.instance
.myProfileData()
?.staffMemberName ??
"",
textAlign: TextAlign.center,
fontColor: CustomAppColors.kBlackColor,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
),
),
Obx(
() => CustomTextWidget(
text: DashboardScreenController.instance
.myProfileData()
?.staffDesignation ??
"",
fontColor: CustomAppColors.kLightGreyColor,
fontSize: 10.sp,
fontWeight: FontWeight.w500),
),
],
),
),
Expanded(
child: Container(
width: double.infinity,
padding: EdgeInsets.only(top: 20.h, bottom: 20.h),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: [
_getDrawerNavItem(
title: "Home",
iconPath: AssetsManager.kHomeIcon,
color: CustomAppColors.kLightGreyColor,
selected: drawerController.selectedIndex.value == 1,
onTap: () {
Navigator.pop(context);
dashboardController.selectedIndex.value = 1;
drawerController.selectedIndex.value = 1;
// Navigator.pushNamed(
// context,
// CustomRouteNames.kDashboardScreenRoute,
// );
}),
6.verticalSpace,
_getDrawerNavItem(
title: "Rota",
iconPath: AssetsManager.kPersonMainIcon,
color: CustomAppColors.kLightGreyColor,
selected: drawerController.selectedIndex.value == 0,
onTap: () {
Navigator.pop(context);
// dashboardController.selectedIndex.value = 0;
// drawerController.selectedIndex.value = 0;
Navigator.pushNamed(
context,
CustomRouteNames.kRotaDashboardScreenRoute,
);
}),
6.verticalSpace,
_getDrawerNavItem(
title: "Clients",
iconPath: AssetsManager.kPeopleIcon,
color: CustomAppColors.kLightGreyColor,
selected: drawerController.selectedIndex.value == 3,
onTap: () {
Navigator.pop(context);
dashboardController.selectedIndex.value = 3;
drawerController.selectedIndex.value = 3;
// Navigator.pushNamed(
// context,
// CustomRouteNames.kClientsListScreenRoute,
// );
}),
6.verticalSpace,
_getDrawerNavItem(
title: "Inbox",
iconPath: AssetsManager.kMessageIcon,
color: CustomAppColors.kLightGreyColor,
selected: drawerController.selectedIndex.value == 2,
onTap: () {
Navigator.pop(context);
dashboardController.selectedIndex.value = 2;
drawerController.selectedIndex.value = 2;
// Navigator.pushNamed(
// context,
// CustomRouteNames.kInboxScreenRoute,
// );
}),
6.verticalSpace,
_getDrawerNavItem(
title: "Policies and Procedures",
iconPath: AssetsManager.kPoliciesIcon,
color: CustomAppColors.kLightGreyColor,
onTap: () {
Navigator.pop(context);
Navigator.pushNamed(
context,
CustomRouteNames.kWebviewScreen,
arguments: WebviewScreenArgument(
title: 'Policies and Procedures',
url: ConstantText.privacyUrl),
);
}),
6.verticalSpace,
_getDrawerNavItem(
title: "Settings",
iconPath: AssetsManager.kSettingsIcon,
color: CustomAppColors.kLightGreyColor,
onTap: () {
Navigator.pop(context);
//Todo: uncomment when start working
// Navigator.pushNamed(
// context,
// CustomRouteNames.kSettingsScreen,
// );
}),
6.verticalSpace,
_getDrawerNavItem(
title: "Notifications",
iconPath: AssetsManager.kBellIcon,
color: CustomAppColors.kLightGreyColor,
selected: drawerController.selectedIndex.value == 6,
onTap: () {
Navigator.pop(context);
//Todo: uncomment
// Navigator.pushNamed(
// context,
// CustomRouteNames.kNotificationListScreenRoute,
// );
}),
const Expanded(child: FrequentFunctions.noWidget),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
CustomTextWidget(
text: "Shift end at ",
fontColor: CustomAppColors.kLightGreyColor,
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
),
CustomTextWidget(
text: "07Hrs 50Sec",
fontColor: CustomAppColors.kSecondaryColor,
isExpanded: false,
fontWeight: FontWeight.w700,
fontSize: 16.sp,
),
],
)
],
),
),
),
],
),
),
);
}
Widget _getDrawerNavItem(
{required String title,
required String iconPath,
Color color = CustomAppColors.kSecondaryColor,
bool selected = false,
required Function() onTap}) {
return Container(
color: selected
? CustomAppColors.kSecondaryColor
: CustomAppColors.kPrimaryColor,
padding: REdgeInsets.symmetric(horizontal: 26, vertical: 12),
child: GestureDetector(
onTap: onTap,
// onTap: ()=> controller.onTap(title),
child: Row(
children: [
// Icon(
// icon,
// size: 27,
// color: selected ? CustomAppColors.kWhiteColor : color,
// ),
CustomImageWidget(
imagePath: iconPath,
width: title == "Clients" ? 20.w : 22.w,
height: title == "Clients" ? 20.h : 26.h,
// height: 26.h,
imageColor: selected ? CustomAppColors.kWhiteColor : color,
),
10.horizontalSpace,
Expanded(
child: CustomTextWidget(
text: title,
textAlign: TextAlign.left,
fontColor: selected
? CustomAppColors.kWhiteColor
: CustomAppColors.kIconColor,
fontSize: 18.sp,
),
),
],
),
),
);
}
}

View File

@@ -0,0 +1,59 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ftc_mobile_app/utilities/custom_app_colors.dart';
import 'package:get/get.dart';
import 'custom_text_widget.dart';
class RadioButton extends StatelessWidget {
final String value;
final Rx<String?> selectedOption;
final bool isEnabled;
const RadioButton({
super.key,
required this.value,
required this.selectedOption,
this.isEnabled = true,
});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
selectedOption(value);
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Ink(
width: 32.r,
height: 32.r,
child: Obx(() {
return Radio(
value: value,
groupValue: selectedOption(),
onChanged: selectedOption,
fillColor: MaterialStateProperty.resolveWith((states) {
if (!isEnabled) return CustomAppColors.kLightGreyColor;
if (states.contains(MaterialState.selected)) {
return CustomAppColors.kSecondaryColor;
}
return Colors.black;
}),
);
}),
),
CustomTextWidget(
text: value,
isExpanded: false,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
fontColor:
isEnabled ? Colors.black : CustomAppColors.kLightGreyColor,
)
],
),
);
}
}

View File

@@ -0,0 +1,166 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomScaffold extends StatelessWidget {
final VoidCallback? onBackButton;
final VoidCallback? onScreenTap;
final String? titleText;
final bool avoidBottomInsets;
final bool? showShadow;
final bool showAppBar;
final bool enableLayoutBuilder;
final GlobalKey<ScaffoldState> screenKey;
final PreferredSizeWidget? appBar;
final Widget? body;
final Widget? sideDrawer;
final Widget? customTabViewWidget;
final Widget? bottomMenu;
final Widget? floatingActionButton;
final Color? backgroundColor;
const CustomScaffold({
Key? key,
this.onBackButton,
this.customTabViewWidget,
this.titleText,
this.appBar,
this.body,
this.showShadow,
this.bottomMenu,
this.floatingActionButton,
this.onScreenTap,
this.avoidBottomInsets = true,
this.showAppBar = false,
this.enableLayoutBuilder = true,
required this.screenKey,
this.backgroundColor,
this.sideDrawer,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final ModalRoute<dynamic>? parentRoute = ModalRoute.of(context);
final bool canPop = parentRoute?.canPop ?? false;
return GestureDetector(
onHorizontalDragEnd: GetPlatform.isIOS
? (details) {
if (details.velocity.pixelsPerSecond.dx > 0) {
if (onBackButton != null) {
onBackButton!();
} else {
if (canPop) {
Navigator.pop(context);
}
}
}
}
: null,
onTap: () {
if (onScreenTap != null) onScreenTap!();
},
child: WillPopScope(
onWillPop: () async {
if (onBackButton != null) {
onBackButton!();
} else {
if (canPop) {
Navigator.pop(context);
}
}
return false;
},
child: LayoutBuilder(
builder: (context, constraint) {
if (constraint.maxWidth > 600 && enableLayoutBuilder) {
return Scaffold(
drawer: sideDrawer,
key: screenKey,
resizeToAvoidBottomInset: avoidBottomInsets,
drawerEnableOpenDragGesture: false,
endDrawerEnableOpenDragGesture: false,
backgroundColor: backgroundColor ?? CustomAppColors.kPrimaryColor,
body: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Spacer(),
Expanded(
flex: 2,
child: customTabViewWidget ??
Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
2.0.sp,
),
color: backgroundColor ??
CustomAppColors.kPrimaryColor,
),
padding: EdgeInsets.all(
10.0.sp,
),
child: body,
),
],
),
),
const Spacer(),
],
),
appBar: showAppBar
? appBar ??
CustomAppBar(
titleText: titleText ?? "titleText",
onBackButtonPressed: () {
if (onBackButton != null) {
onBackButton!();
return;
}
if (canPop) {
Navigator.pop(context);
}
},
)
: null,
floatingActionButton: floatingActionButton,
);
}
return Scaffold(
drawer: sideDrawer,
resizeToAvoidBottomInset: avoidBottomInsets,
key: screenKey,
floatingActionButton: floatingActionButton,
appBar: showAppBar
? appBar ??
CustomAppBar(
showBoxShadow: showShadow ?? false,
titleText: titleText ?? "titleText",
onBackButtonPressed: () {
if (onBackButton != null) {
onBackButton!();
return;
}
if (canPop) {
Navigator.pop(context);
}
},
)
: null,
body: body ?? Container(),
backgroundColor:
backgroundColor ?? CustomAppColors.kPrimaryColor,
bottomNavigationBar: bottomMenu,
);
},
),
),
);
}
}

View File

@@ -0,0 +1,130 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomTextFieldWidget extends StatelessWidget {
final TextEditingController? controller;
final int? minLines;
final int? maxLines;
final int? maxLength;
final String hintText;
final String heading;
final ValueChanged<String>? onChange;
final bool isEnabled;
final bool isObscure;
final BorderRadius? borderRadius;
final Color? borderColor;
final double? borderWidth;
final Widget? bottomChild;
final TextInputType? inputType;
final TextCapitalization? textCapitalization;
final List<TextInputFormatter>? inputFormatters;
const CustomTextFieldWidget({
super.key,
this.controller,
required this.heading,
this.minLines = 1,
this.maxLines = 1,
this.maxLength,
this.hintText = "",
this.onChange,
this.isEnabled = true,
this.isObscure = false,
this.borderRadius,
this.borderColor,
this.borderWidth = 1.0,
this.bottomChild,
this.textCapitalization,
this.inputType,
this.inputFormatters,
});
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
borderRadius: borderRadius,
border: Border.all(
color: borderColor ?? CustomAppColors.kSmokeColor,
width: borderWidth ?? 1.5.sp,
),
),
padding: EdgeInsets.symmetric(
vertical: 10.h,
horizontal: 15.w,
),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// CustomTextWidget(
// text: heading,
// fontSize: 10.sp,
// fontWeight: FontWeight.w500,
// fontColor: CustomAppColors.kLightTextColor,
// alignment: Alignment.centerLeft,
// textAlign: TextAlign.left,
// ),
Text(
heading,
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 10.sp,
fontWeight: FontWeight.w500,
color: CustomAppColors.kLightTextColor,
),
),
4.verticalSpace,
TextField(
controller: controller,
enabled: isEnabled,
obscureText: isObscure,
minLines: minLines,
maxLines: maxLines,
maxLength: maxLength,
inputFormatters: inputFormatters,
onChanged: (_) {
if (onChange != null) {
onChange!(_);
}
},
keyboardType: inputType,
textCapitalization: textCapitalization ?? TextCapitalization.none,
cursorColor: CustomAppColors.kSecondaryColor,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14.sp,
color: CustomAppColors.kIconColor,
),
decoration: InputDecoration(
isDense: true,
hintText: hintText,
hintStyle: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14.sp,
color: CustomAppColors.kLightTextColor,
),
counterText: "",
contentPadding: EdgeInsets.zero,
border: const OutlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
),
disabledBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
),
),
),
if (bottomChild != null) bottomChild!,
],
),
);
}
}

View File

@@ -0,0 +1,53 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomTextWidget extends StatelessWidget {
final String text;
final double? fontSize;
final bool isExpanded;
final FontWeight? fontWeight;
final Color? fontColor;
final String? fontFamily;
final Alignment? alignment;
final TextOverflow? textOverflow;
final TextAlign textAlign;
final TextDecoration textDecoration;
final int? maxLines;
const CustomTextWidget({
Key? key,
required this.text,
this.fontSize,
this.fontWeight,
this.fontColor,
this.alignment,
this.isExpanded = true,
this.fontFamily,
this.textOverflow,
this.textAlign = TextAlign.center,
this.textDecoration = TextDecoration.none,
this.maxLines,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
alignment: alignment,
width: isExpanded ? MediaQuery.of(context).size.width : null,
child: Text(
text,
textAlign: textAlign,
maxLines: maxLines,
style: TextStyle(
fontSize: fontSize,
fontWeight: fontWeight,
color: fontColor ?? CustomAppColors.kIconColor,
fontFamily: fontFamily,
decoration: textDecoration,
decorationColor: fontColor ?? CustomAppColors.kIconColor,
),
overflow: textOverflow,
),
);
}
}

View File

@@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ftc_mobile_app/utilities/custom_app_colors.dart';
class EditIcon extends StatelessWidget {
final VoidCallback onTap;
const EditIcon({super.key, required this.onTap});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
child: Container(
width: 24.r,
height: 24.r,
// padding: REdgeInsets.all(8),
decoration: BoxDecoration(
color: CustomAppColors.kYellowColor.withOpacity(0.5),
borderRadius: BorderRadius.circular(50.r),
),
child: Center(
child: Icon(
Icons.edit,
color: CustomAppColors.kDarkYellowColor,
size: 16.r,
),
)),
);
}
}

View File

@@ -0,0 +1,16 @@
export 'custom_text_widget.dart';
export 'custom_app_bar.dart';
export 'custom_scaffold.dart';
export 'custom_image_widgets.dart';
export 'custom_text_field_widget.dart';
export 'custom_error_msg.dart';
export 'custom_check_box.dart';
export 'custom_app_button.dart';
export 'rota/export_rota.dart';
export 'home/export_home_widgets.dart';
export 'notifications/export_notification_widgets.dart';
export 'custom_navigation_drawer.dart';
export 'auth/export_auth_widgets.dart';
export 'custom_radio_button.dart';
export 'loading_widget.dart';
export 'custom_app_bar_title_only.dart';

View File

@@ -0,0 +1,84 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class CustomMessageDialog extends StatelessWidget {
const CustomMessageDialog({Key? key, required this.dialogMessageText, required this.headingText, required this.dialogMessageTextBold, required this.dialogButtonText}) : super(key: key);
final String headingText;
final String dialogMessageText;
final String dialogMessageTextBold;
final String dialogButtonText;
@override
Widget build(BuildContext context) {
return AlertDialog(
surfaceTintColor: CustomAppColors.kPrimaryColor,
insetPadding: REdgeInsets.all(18),
contentPadding: REdgeInsets.all(15),
shape: LinearBorder.top(side: BorderSide.none),
backgroundColor: CustomAppColors.kWhiteColor,
shadowColor: CustomAppColors.kWhiteColor,
// titlePadding: EdgeInsets.only(top: 20.h),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
CustomTextWidget(
text: headingText,
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
),
8.verticalSpace,
Container(
padding: EdgeInsets.all(10.sp),
decoration: BoxDecoration(
border: Border.all(color: CustomAppColors.kLightGreyColor)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomTextWidget(
text: dialogMessageText,
isExpanded: false,
fontSize: 10.sp,
fontWeight: FontWeight.w400,
textAlign: TextAlign.left,
),
12.verticalSpace,
dialogMessageTextBold != ""
? CustomTextWidget(
text: dialogMessageTextBold,
isExpanded: false,
fontSize: 10.sp,
fontWeight: FontWeight.bold,
textAlign: TextAlign.left,
)
: Container(),
],
),
),
12.verticalSpace,
SizedBox(
height: 32.h,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: Size(double.infinity, 30.h),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
),
backgroundColor: CustomAppColors.kSecondaryColor),
onPressed: () {
// Add functionality for the "Agree" button.
Navigator.of(context).pop();
},
child: CustomTextWidget(
text: dialogButtonText,
fontColor: CustomAppColors.kPrimaryColor,
fontSize: 14.sp,
fontWeight: FontWeight.w400),
),
),
],
),
);
}
}

View File

@@ -0,0 +1,89 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class PrivacyPolicyDialog extends StatelessWidget {
const PrivacyPolicyDialog({Key? key, required this.privacyPolicy, required this.checkBoxOnChange}) : super(key: key);
final String privacyPolicy;
final ValueChanged<bool>? checkBoxOnChange;
@override
Widget build(BuildContext context) {
return AlertDialog(
surfaceTintColor: CustomAppColors.kPrimaryColor,
insetPadding: EdgeInsets.only(right: 18.w,left: 18.w, top:40.h ,bottom: MediaQuery.of(context).size.height/3.h),
contentPadding: EdgeInsets.only(left: 15.w,right: 15.w,top: 11.h,bottom: 0.h),
shape: LinearBorder.top(side: BorderSide.none),
backgroundColor: CustomAppColors.kWhiteColor,
shadowColor: CustomAppColors.kWhiteColor,
titlePadding: EdgeInsets.only(top: 20.h),
title: CustomTextWidget(
text: "New Policy",
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
),
content: Column(
children: [
Container(
padding: EdgeInsets.all(10.sp),
decoration: BoxDecoration(
border: Border.all(color: CustomAppColors.kLightGreyColor)),
child: CustomTextWidget(
text: privacyPolicy,
isExpanded: false,
fontSize: 10.sp,
fontWeight: FontWeight.w400,
textAlign: TextAlign.left,
),
),
const Spacer(),
SizedBox(
height: 30.h,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Checkbox(
activeColor: CustomAppColors.kSecondaryColor,
value: true,
onChanged: (value) {
if (checkBoxOnChange != null && value!= null) {
checkBoxOnChange!(value);
}
}),
CustomTextWidget(
text: "Agree to the new policy",
isExpanded: false,
fontSize: 10.sp,
fontWeight: FontWeight.w400,
),
],
),
),
Container(
// padding: EdgeInsets.only(bottom: 50.h),
// height: 25.h,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: Size(double.infinity, 30.h),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
),
backgroundColor: CustomAppColors.kSecondaryColor),
onPressed: () {
// Add functionality for the "Agree" button.
Navigator.of(context).pop();
},
child: CustomTextWidget(
text: 'Agree',
fontColor: CustomAppColors.kPrimaryColor,
fontSize: 14.sp,
fontWeight: FontWeight.w400),
),
),
],
),
);
}
}

View File

@@ -0,0 +1,2 @@
export 'custom_privacy_policy_dialog.dart';
export 'custom_message_dialog.dart';

View File

@@ -0,0 +1,117 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import '../../utilities/enums/body_parts.dart';
class HumanBodyWidget extends StatefulWidget {
final double width;
final Map<BodyPart, Color?> visibleBodyPoints;
final Function(BodyPart, Offset position)? onPointTap;
const HumanBodyWidget({
super.key,
required this.visibleBodyPoints,
required this.width,
this.onPointTap,
});
@override
State<HumanBodyWidget> createState() => _HumanBodyWidgetState();
}
class _HumanBodyWidgetState extends State<HumanBodyWidget> {
final GlobalKey _imageKey = GlobalKey();
//Note: change the size if changing [AssetsManager.pngHumanBodyFrontBack] image
final _actualImageSize = const Size(500, 681);
late double height;
@override
void initState() {
super.initState();
height = widget.width / _actualImageSize.aspectRatio;
WidgetsBinding.instance.addPostFrameCallback((_) {
Size? imageSize = _imageKey.currentContext?.size;
// Now you can use imageSize.width and imageSize.height
print("image size: $imageSize");
});
}
@override
Widget build(BuildContext context) {
return UnconstrainedBox(
child: SizedBox(
width: widget.width,
height: height,
child: LayoutBuilder(builder: (_, constrains) {
return Stack(
fit: StackFit.loose,
children: [
Positioned.fill(
child: Image.asset(
AssetsManager.pngHumanBodyFrontBack,
key: _imageKey,
width: MediaQuery.of(context).size.width,
fit: BoxFit.contain,
),
),
...widget.visibleBodyPoints.entries
.map((e) => _pointWidget(
bodyPart: e.key,
color: e.value,
constrains: constrains,
onPointTap: widget.onPointTap,
))
.toList()
],
);
}),
),
);
}
Positioned _pointWidget({
required BodyPart bodyPart,
required BoxConstraints constrains,
Color? color,
Function(BodyPart, Offset position)? onPointTap,
}) {
return Positioned(
top: constrains.maxHeight * (bodyPart.topPercent / 100.0),
left: constrains.maxWidth * (bodyPart.leftPercent / 100.0),
child: InkWell(
onTap: () {
// RenderBox? button = context.findRenderObject() as RenderBox?;
// RenderBox? overlay =
// Overlay.of(context).context.findRenderObject() as RenderBox?;
// Rect? buttonRect = (button == null)
// ? null
// : Rect.fromPoints(
// button.localToGlobal(Offset.zero, ancestor: overlay),
// button.localToGlobal(button.size.bottomRight(Offset.zero),
// ancestor: overlay),
// );
// double screenHeight = MediaQuery.of(context).size.height;
// double popupHeight = screenHeight - (buttonRect?.bottom ?? 0.5.sh);
},
onTapUp: (d) {
if (onPointTap != null) {
onPointTap(bodyPart, d.globalPosition);
}
},
child: Container(
width: 12.r,
height: 12.r,
decoration: BoxDecoration(
color: color ?? CustomAppColors.kRedColor,
border: Border.all(color: CustomAppColors.kWhiteColor, width: 2),
borderRadius: BorderRadius.circular(6.r),
),
),
),
);
}
}

View File

@@ -0,0 +1,57 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class LabelValueBoxWidget extends StatelessWidget {
const LabelValueBoxWidget({
super.key,
required this.label,
required this.value,
this.trailing,
this.borderColor,
});
final String label;
final String value;
final Color? borderColor;
final Widget? trailing;
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(10.h),
decoration: BoxDecoration(
border: Border.all(color: borderColor ?? Colors.grey),
),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
CustomTextWidget(
text: label,
fontColor: CustomAppColors.kLightGreyColor,
fontWeight: FontWeight.w500,
isExpanded: false,
textAlign: TextAlign.left,
fontSize: 10.sp,
),
6.verticalSpace,
CustomTextWidget(
text: value,
fontColor: CustomAppColors.kBlackColor,
fontWeight: FontWeight.w600,
fontSize: 14.0.sp,
textAlign: TextAlign.left,
isExpanded: false,
),
],
),
),
trailing ?? const SizedBox.shrink()
],
),
);
}
}

View File

@@ -0,0 +1,48 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class LoadingWidget extends StatelessWidget {
const LoadingWidget({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Material(
type: MaterialType.transparency,
child: Center(
child: Container(
width: 150.w,
height: 170.h,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(8.r)),
child: LoaderColumn(
loadingText: "Loading",
textColor: Colors.black,
),
),
));
}
}
class LoaderColumn extends Column {
LoaderColumn({Key? key, String? loadingText, Color? color, Color? textColor})
: super(
key: key,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CircularProgressIndicator(color: color),
(loadingText == null || loadingText.isEmpty)
? const SizedBox.shrink()
: Padding(
padding: REdgeInsets.only(top: 16.0),
child: CustomTextWidget(
text: loadingText!,
textAlign: TextAlign.center,
),
),
],
);
}

View File

@@ -0,0 +1,237 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:get/get.dart';
class MultilineTextFieldSheet {
final String appBarTitle;
final String textFieldHint;
final String buttonLabel;
final bool wantLeadingIcon;
final String prevValueForField;
final int minLines;
final int maxLines;
// final ContentSheetAction action;
final Function(String text) onButtonClick;
MultilineTextFieldSheet({
required this.buttonLabel,
required this.appBarTitle,
required this.textFieldHint,
this.prevValueForField = "",
this.wantLeadingIcon = true,
required this.onButtonClick,
this.minLines = 5,
this.maxLines = 5,
});
show() {
Get.bottomSheet(
_ContentWidget(
key: const ValueKey(1),
appBarTitle: appBarTitle,
buttonLabel: buttonLabel,
onButtonClick: onButtonClick,
textFieldHint: textFieldHint,
prevValueForField: prevValueForField,
// action: action,
wantLeadingIcon: wantLeadingIcon,
minLines: minLines,
maxLines: maxLines,
),
clipBehavior: Clip.none,
backgroundColor: Colors.transparent,
elevation: 4,
isScrollControlled: true,
shape: RoundedRectangleBorder(
borderRadius: const BorderRadius.vertical(top: Radius.circular(32)).r,
),
);
}
}
class _ContentWidget extends StatefulWidget {
final String appBarTitle;
final String textFieldHint;
final String buttonLabel;
final String prevValueForField;
final bool wantLeadingIcon;
final Function onButtonClick;
final int minLines;
final int maxLines;
const _ContentWidget({
super.key,
required this.appBarTitle,
required this.buttonLabel,
required this.textFieldHint,
this.prevValueForField = "",
required this.onButtonClick,
required this.wantLeadingIcon,
this.minLines = 5,
this.maxLines = 5,
});
@override
_ContentWidgetState createState() => _ContentWidgetState();
}
class _ContentWidgetState extends State<_ContentWidget> {
final ContentController _controller = ContentController();
@override
void initState() {
_controller.initData(widget.prevValueForField, "");
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
padding: MediaQuery.of(context).viewPadding,
child: ListView(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
children: [
bottomSheetAppBar(context),
24.verticalSpace,
_textField().addPaddingHorizontal(24),
32.verticalSpace,
_addButton(context).addPaddingHorizontal(24),
24.verticalSpace,
],
),
);
}
AppBar bottomSheetAppBar(BuildContext context) {
return AppBar(
automaticallyImplyLeading: false,
title: Text(
widget.appBarTitle,
style: const TextStyle(color: Colors.black),
),
centerTitle: false,
titleSpacing: 24,
backgroundColor: Colors.transparent,
elevation: 0,
actions: [
InkWell(
child: const Icon(
Icons.close,
color: Colors.black,
),
onTap: () {
Navigator.pop(context);
}),
16.horizontalSpace,
],
);
}
Widget _textField() {
return DecoratedBox(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: (8).toRadius(),
border: Border.all(color: Colors.grey, width: 1)),
child: Padding(
padding: REdgeInsets.symmetric(horizontal: 16.0, vertical: 12),
child: TextField(
controller: _controller.textFieldTEC,
textCapitalization: TextCapitalization.sentences,
textInputAction: TextInputAction.next,
style: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w400),
onChanged: (text) {
_controller.isButtonEnable(
text.isNotNullOrEmpty() && text != widget.prevValueForField);
},
minLines: widget.minLines,
maxLines: widget.maxLines,
decoration: InputDecoration(
isDense: true,
hintText: widget.textFieldHint,
hintStyle: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w400)
.copyWith(color: Colors.grey),
border: InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
),
),
),
);
}
Widget _addButton(context) {
return InkWell(
onTap: () {
if (_controller.isButtonEnable()) {
Get.back();
widget.onButtonClick(_controller.textFieldTEC.text);
}
},
child: Obx(() {
return Container(
decoration: BoxDecoration(
color: _controller.isButtonEnable()
? Get.theme.primaryColor
: Colors.grey.withOpacity(0.5),
borderRadius: BorderRadius.circular(4.r),
boxShadow: [
BoxShadow(
color: Get.theme.primaryColor.withOpacity(0.2),
spreadRadius: _controller.isButtonEnable() ? 4 : 0,
blurRadius: _controller.isButtonEnable() ? 8 : 0,
offset: _controller.isButtonEnable()
? const Offset(4, 8)
: const Offset(0, 0))
]),
width: double.maxFinite,
height: 48,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Visibility(
visible: widget.wantLeadingIcon,
child: const Padding(
padding: EdgeInsets.only(right: 8.0),
child: Icon(
Icons.add,
color: Colors.white,
size: 20,
),
),
),
Text(widget.buttonLabel,
style: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w700)
.copyWith(color: Colors.white)),
],
),
);
}),
);
}
}
class ContentController extends GetxController {
final TextEditingController textFieldTEC = TextEditingController();
final FocusNode textFieldFN = FocusNode();
final isButtonEnable = false.obs;
initData(String prevText, String prevColor) {
textFieldTEC.text = (prevText.isNullOrEmptyNot()) ? prevText : "";
}
@override
void onClose() {
textFieldTEC.dispose();
textFieldFN.unfocus();
super.onClose();
}
}

View File

@@ -0,0 +1,35 @@
import 'package:flutter/material.dart';
import 'my_network_image.dart';
class MyCircleImage extends StatelessWidget {
final double imageSize;
final String url;
final Widget? loadingWidget;
final Widget? errorWidget;
final BoxFit? fit;
const MyCircleImage(
{Key? key,
required this.imageSize,
required this.url,
this.loadingWidget,
this.errorWidget,
this.fit})
: super(key: key);
@override
Widget build(BuildContext context) {
return ClipOval(
child: SizedBox(
width: imageSize,
height: imageSize,
child: MyNetworkImage(
url: url,
errorWidget: errorWidget,
loadingWidget: loadingWidget,
fit: fit,
),
),
);
}
}

View File

@@ -0,0 +1,77 @@
import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/utils.dart';
import 'package:path/path.dart' as path;
class MyNetworkImage extends StatelessWidget {
final String url;
final Widget? loadingWidget;
final Widget? errorWidget;
final BoxFit? fit;
final int? memCacheWidth;
final int? memCacheHeight;
const MyNetworkImage({
Key? key,
required this.url,
this.loadingWidget,
this.errorWidget,
this.fit,
this.memCacheWidth,
this.memCacheHeight,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final errWidget =
(errorWidget ?? ColoredBox(color: Colors.grey.withOpacity(0.3)));
return (url.isEmpty || !url.isImageFileName)
? errWidget
: _media;
}
Widget get _media {
return (path.extension(url).toLowerCase() == ".svg")
? SvgPicture.network(
url,
fit: fit ?? BoxFit.cover,
placeholderBuilder: (_) {
return Center(
child: SizedBox.square(
dimension: 32,
child: (Platform.isIOS)
? const CupertinoActivityIndicator(radius: 20)
: const CircularProgressIndicator(
strokeWidth: 2,
),
),
);
},
)
: CachedNetworkImage(
imageUrl: url,
fit: fit ?? BoxFit.cover,
memCacheWidth: memCacheWidth,
memCacheHeight: memCacheHeight,
placeholder: (context, url) {
return loadingWidget ??
Center(
child: SizedBox.square(
dimension: 32,
child: (Platform.isIOS)
? const CupertinoActivityIndicator(radius: 20)
: const CircularProgressIndicator(
strokeWidth: 2,
),
),
);
},
errorWidget: (context, url, error) {
return errorWidget ?? Icon(Icons.image_not_supported_outlined);
},
);
}
}

View File

@@ -0,0 +1,120 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class ShowDialogNotification extends StatelessWidget {
const ShowDialogNotification({
super.key,
required this.rotaShift,
});
final RotaShift rotaShift;
@override
Widget build(BuildContext context) {
return AlertDialog(
surfaceTintColor: CustomAppColors.kPrimaryColor,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2)),
backgroundColor: CustomAppColors.kPrimaryColor,
title: Center(
child: CustomTextWidget(
text: rotaShift.managerName,
fontWeight: FontWeight.bold,
isExpanded: false,
alignment: Alignment.center,
fontSize: 16.sp,
),
),
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
NotificationInfoRow( label: 'Service User:', value: rotaShift.name,),
const SizedBox(height: 5,),
NotificationInfoRow(label: 'Worker Type Role:', value: rotaShift.workerType),
const SizedBox(height: 5,),
NotificationInfoRow(label: 'Location:',value: rotaShift.location),
const SizedBox(height: 5,),
NotificationInfoRow(label: 'Start Time:', value: rotaShift.startTime),
const SizedBox(height: 5,),
NotificationInfoRow(label: 'End Time:',value: rotaShift.endTime),
const SizedBox(height: 5,),
NotificationInfoRow(label: 'Break Time:',value: rotaShift.breakTime),
const SizedBox(height: 5,),
NotificationInfoRow(label: 'Notes:',value: rotaShift.notes),
],
),
actions: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Visibility(
visible: false,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
maximumSize: Size(MediaQuery.of(context).size.width/3.5, 30.h),
minimumSize: Size(MediaQuery.of(context).size.width/3.5, 30.h),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.r),
),
backgroundColor: CustomAppColors.kRedColor
),
onPressed: () {
// Add functionality for the "Decline" button.
Navigator.of(context).pop();
},
child: const CustomTextWidget(text: 'Decline',fontColor: CustomAppColors.kPrimaryColor),
),
),
ElevatedButton(
style: ElevatedButton.styleFrom(
// maximumSize: Size(MediaQuery.of(context).size.width/3.5, 30.h),
maximumSize: Size(MediaQuery.of(context).size.width/1.8, 30.h),
// minimumSize: Size(MediaQuery.of(context).size.width/3.5, 30.h),
minimumSize: Size(MediaQuery.of(context).size.width/1.8, 30.h),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.r),
),
backgroundColor: CustomAppColors.kPrimaryColor
),
onPressed: () {
// Add functionality for the "Close" button.
Navigator.of(context).pop();
},
child: CustomTextWidget(text: 'Close',fontColor: CustomAppColors.kBlackColor,fontSize: 15.sp),
),
],
),
],
);
}
}
class NotificationInfoRow extends StatelessWidget {
const NotificationInfoRow({
super.key,required this.label, required this.value, this.half = false
});
final String label, value;
final bool half;
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
border: Border.all(width: 1.w, color: CustomAppColors.kLightGreyColor),
borderRadius: BorderRadius.circular(5.r)),
padding: EdgeInsets.only(left: 10.w,top: 1.h,bottom: 1.h),
width: half ? null : MediaQuery.of(context).size.width,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomTextWidget(text: label,isExpanded: false,fontSize: 12.sp),
CustomTextWidget(text: value,fontWeight: FontWeight.w600,isExpanded: false,fontSize: 14,),
],
),
);
}
}

View File

@@ -0,0 +1,2 @@
export 'custom_dialog_notification.dart';
export 'holiday_request_accept_dialog.dart';

View File

@@ -0,0 +1,105 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class HolidayRequestAcceptDialog extends StatelessWidget {
const HolidayRequestAcceptDialog({
super.key, required this.startDate, required this.endDate, required this.noOfDays,
});
final String startDate;
final String endDate;
final String noOfDays;
@override
Widget build(BuildContext context) {
return AlertDialog(
insetPadding: EdgeInsets.only(right: 18.w,left: 18.w, top:40.h ,bottom: 230.h),
contentPadding: EdgeInsets.only(left: 15.w,right: 15.w,top: 11.h,bottom: 0.h),
surfaceTintColor: CustomAppColors.kPrimaryColor,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2)),
backgroundColor: CustomAppColors.kPrimaryColor,
title: Center(
child: CustomTextWidget(
text: "Your Holiday Request has been sent",
fontWeight: FontWeight.w700,
isExpanded: false,
alignment: Alignment.center,
fontSize: 14.sp,
),
),
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
children: [
Expanded(child: DateInfo( label: 'Start Date', value: startDate,half: true)),
SizedBox(width: 5.w,),
Expanded(child: DateInfo(label: 'End Date', value: endDate,half: true)),
],
),
SizedBox(height: 10.h,),
DateInfo(label: 'Holiday Total Time',value: noOfDays),
SizedBox(height: 10.h,),
CustomTextWidget(text: "Kindly wait as we review your holiday request.",fontSize: 12.sp),
SizedBox(height: 10.h,),
],
),
actions: [
ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.r),
),
backgroundColor: CustomAppColors.kPrimaryColor,
surfaceTintColor: CustomAppColors.kPrimaryColor,
),
onPressed: () {
// Add functionality for the "Close" button.
Navigator.of(context).pop();
},
child: CustomTextWidget(
text: 'Close',
fontColor: CustomAppColors.kBlackColor,
fontSize: 15.sp),
),
],
);
}
}
class DateInfo extends StatelessWidget {
const DateInfo({
super.key,required this.label, required this.value, this.half = false
});
final String label, value;
final bool half;
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
border: Border.all(width: 1.w, color: CustomAppColors.kLightGreyColor),
borderRadius: BorderRadius.circular(5.r)),
padding: EdgeInsets.only(left: 10.w,top: 1.h,bottom: 1.h),
width: half ? null : MediaQuery.of(context).size.width,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomTextWidget(text: label, isExpanded: false, fontSize: 12.sp),
CustomTextWidget(
text: value,
fontWeight: FontWeight.w600,
isExpanded: false,
fontSize: 14,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
);
}
}

View File

@@ -0,0 +1,321 @@
import 'package:flutter/material.dart';
import 'package:flutter_calendar_carousel/classes/event.dart';
import 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import '../../../ftc_mobile_app.dart';
// class SetMonthAndYearWidget extends StatelessWidget {
// const SetMonthAndYearWidget({
// super.key,
// required this.currentMonthName,
// required this.previousMonthTap,
// required this.nextMonthTap,
// });
//
// final String currentMonthName;
// final VoidCallback previousMonthTap;
// final VoidCallback nextMonthTap;
//
// @override
// Widget build(BuildContext context) {
// return Container(
// padding: const EdgeInsets.only(left: 20.0, right: 20.0),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// GestureDetector(
// onTap: previousMonthTap,
// child: Transform.rotate(
// angle: 3.1415 * 2.5,
// child: const Icon(Icons.arrow_drop_down),
// ),
// ),
// CustomTextWidget(
// isExpanded: false,
// text: currentMonthName,
// textAlign: TextAlign.center,
// fontColor: CustomAppColors.kBlackColor,
// fontSize: 13,
// fontWeight: FontWeight.bold),
// GestureDetector(
// onTap: nextMonthTap,
// child: Transform.rotate(
// angle: 3.1415 * 3.5,
// child: const Icon(Icons.arrow_drop_down),
// ),
// ),
// ],
// ),
// );
// }
// }
typedef OnRangeSelect = Function(
DateTime rangeStart, DateTime? rangeEnd, List<String> selectedDates);
class CalendarWidget extends StatefulWidget {
static final dateFormat = DateFormat("dd-MM-yyyy");
const CalendarWidget({
super.key,
this.minDate,
this.maxDate,
this.onEventTap,
required this.targetDateTime,
required this.markedDatesMap,
this.onDayTap,
this.rangeStart,
this.rangeEnd,
this.canSelectRange = false,
this.onRangeSelect,
});
final DateTime? minDate;
final DateTime? maxDate;
final DateTime targetDateTime;
final EventList<Event> markedDatesMap;
final ValueChanged<List<Event>>? onEventTap;
final Function(DateTime, List<Event>)? onDayTap;
final bool canSelectRange;
///[selectedDates] will be in format dd-MM-yyyy
final OnRangeSelect? onRangeSelect;
final DateTime? rangeStart;
final DateTime? rangeEnd;
@override
State<CalendarWidget> createState() => _CalendarWidgetState();
///This method checks if [start] and [end] dates are at proper position i.e.,
///[start] date should be before [end] date. If not, this method corrects the two dates and
///return proper [start] [end] dates
static ({DateTime start, DateTime end}) rectifyStartEndDates(
DateTime start, DateTime end) {
final first = start.isBefore(end) ? start : end;
final last = end.isAfter(start) ? end : start;
return (start: first, end: last);
}
static List<String> getDatesFromStartEndRange(DateTime start, DateTime end) {
final List<String> dates = [];
// final first = start.isBefore(end) ? start : end;
// final last = end.isAfter(start) ? end : start;
final record = rectifyStartEndDates(start, end);
for (int i = 0; i <= record.end.difference(record.start).inDays; i++) {
dates.add(dateFormat.format(record.start.add(i.days)));
}
return dates;
}
static Widget shiftIcon(String day) => CircleAvatar(
backgroundColor: CustomAppColors.kSecondaryColor,
child: Text(
day,
style:
const TextStyle(color: CustomAppColors.kWhiteColor, fontSize: 13),
),
);
static Widget underlineIcon() => Container(
alignment: Alignment.center,
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
color: CustomAppColors.kSecondaryColor,
width: 3.0,
),
),
),
);
}
class _CalendarWidgetState extends State<CalendarWidget> {
//Selected dates will be in format dd-MM-yyyy
final selectedDates = RxList<String>();
DateTime? start, end;
@override
void initState() {
super.initState();
if (widget.canSelectRange &&
widget.rangeStart != null &&
widget.rangeEnd != null) {
start = widget.rangeStart;
end = widget.rangeEnd;
selectedDates.value =
CalendarWidget.getDatesFromStartEndRange(start!, end!);
} else {
selectedDates.value = [
CalendarWidget.dateFormat.format(widget.targetDateTime)
];
}
}
@override
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;
double textScaleFactor = MediaQuery.of(context).textScaleFactor;
double itemHeight = (height * textScaleFactor - kToolbarHeight - 24) / 4;
double calHeight = (height * textScaleFactor) / 2.9;
double itemWidth = width * 0.7;
return Container(
height: calHeight,
margin: const EdgeInsets.only(top: 10, bottom: 3),
padding: const EdgeInsets.only(left: 10.0, right: 10.0),
child: CalendarCarousel<Event>(
targetDateTime: widget.targetDateTime,
firstDayOfWeek: 0,
dayPadding: 1.0,
minSelectedDate: widget.minDate,
maxSelectedDate: widget.maxDate,
todayTextStyle: const TextStyle(
color: CustomAppColors.kBlackColor,
fontWeight: FontWeight.normal,
fontSize: 13.0,
),
weekdayTextStyle: const TextStyle(
color: CustomAppColors.kBlueColor,
fontWeight: FontWeight.bold,
fontSize: 13.0,
),
weekendTextStyle: const TextStyle(
color: CustomAppColors.kBlackColor,
fontSize: 13.0,
),
customDayBuilder: (bool isSelectable,
int index,
bool isSelectedDay,
bool isToday,
bool isPrevMonthDay,
TextStyle textStyle,
bool isNextMonthDay,
bool isThisMonthDay,
DateTime day) {
if (selectedDates.contains(CalendarWidget.dateFormat.format(day))) {
return Container(
width: double.maxFinite,
height: double.maxFinite,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).primaryColor,
),
child: Center(
child: Text(
day.day.toString(),
style: textStyle.copyWith(color: Colors.white),
),
),
);
}
return null;
},
onDayPressed: (DateTime date, List<Event> events) {
if (widget.onEventTap != null) {
widget.onEventTap!(events);
}
if (widget.onDayTap != null) {
widget.onDayTap!(date, events);
}
if (widget.canSelectRange) {
rangeSelectionHandler(date);
}
},
childAspectRatio: textScaleFactor > 1.5
? ((itemWidth / itemHeight) * 1.1)
: textScaleFactor > 1
? ((itemWidth / itemHeight) * 1.05)
: (itemWidth / itemHeight),
todayButtonColor: Colors.transparent,
todayBorderColor: Colors.transparent,
daysHaveCircularBorder: true,
isScrollable: true,
shouldShowTransform: false,
pageSnapping: true,
// selectedDateTime: DateTime(2024, 5, 25),
thisMonthDayBorderColor: Colors.transparent,
daysTextStyle: const TextStyle(
fontSize: 13.0,
color: CustomAppColors.kBlackColor,
),
weekFormat: false,
showOnlyCurrentMonthDate: true,
width: width,
onHeaderTitlePressed: () {},
customGridViewPhysics: const NeverScrollableScrollPhysics(),
markedDatesMap: widget.markedDatesMap,
//marked up dates
markedDateIconBuilder: (event) => event.icon,
markedDateCustomTextStyle: TextStyle(
fontSize: 13.sp,
color: CustomAppColors.kWhiteColor,
),
markedDateShowIcon: true,
markedDateIconMaxShown: 1,
markedDateMoreShowTotal: null,
showHeader: true,
leftButtonIcon: const Icon(
Icons.arrow_left,
color: Colors.black,
),
rightButtonIcon: const Icon(
Icons.arrow_right,
color: Colors.black,
),
headerTextStyle: const TextStyle(
color: CustomAppColors.kBlackColor,
fontSize: 13,
fontWeight: FontWeight.bold),
onCalendarChanged: (DateTime date) {},
onDayLongPressed: (DateTime date) {},
),
);
}
rangeSelectionHandler(DateTime selectedDay) {
final d = CalendarWidget.dateFormat.format(selectedDay);
if (selectedDates.contains(d)) {
selectedDates.remove(d);
} else {
selectedDates.add(d);
}
//meaning either no range selected or range already been selected
if (start == null || (start != null && end != null)) {
start = selectedDay;
end = null;
selectedDates
..clear()
..add(CalendarWidget.dateFormat.format(selectedDay));
if (widget.onRangeSelect != null) {
widget.onRangeSelect!(start!, null, selectedDates());
}
return;
}
//Already selected start date now selecting range end date
if (end == null) {
final record = CalendarWidget.rectifyStartEndDates(start!, selectedDay);
start = record.start;
end = record.end;
selectedDates.clear();
selectedDates.value =
CalendarWidget.getDatesFromStartEndRange(start!, end!);
}
print("start: ${start.toString()}\nEnd:${end.toString()}");
if (widget.onRangeSelect != null) {
widget.onRangeSelect!(start!, end, selectedDates());
}
}
}

View File

@@ -0,0 +1,3 @@
export 'custom_calendar_widget.dart';
export "package:ftc_mobile_app/dialogs/widgets/shift_dialog.dart";
export 'rota_list_item.dart';

View File

@@ -0,0 +1,130 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/models/rota/WeekArrayData.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import '../../../ftc_mobile_app.dart';
class RotaWidget extends StatelessWidget {
const RotaWidget(
{super.key, required this.data, required this.onViewShiftTap});
final DaysArrayData data;
final Function() onViewShiftTap;
@override
Widget build(BuildContext context) {
return Container(
// height: 150,
alignment: Alignment.center,
padding: EdgeInsets.all(10.sp),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: Colors.white,
border: Border(
left: BorderSide(
width: 6.r,
color: CustomAppColors.kSecondaryColor,
),
top: const BorderSide(
color: CustomAppColors.kSecondaryColor,
),
right: const BorderSide(
color: CustomAppColors.kSecondaryColor,
),
bottom: const BorderSide(
color: CustomAppColors.kSecondaryColor,
),
),
borderRadius: BorderRadius.all(Radius.circular(2.0.r)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text.rich(
TextSpan(
text: data.locationId?.shiftLocationName ?? "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w400,
),
children: [
const TextSpan(text: ' ('),
TextSpan(
text: ((data.serviceUserId?.displayName ??
"Unassigned"))
.trim(),
style: TextStyle(
color: data.serviceUserId?.displayName
.isNotNullOrEmpty() ==
true
? Colors.black
: Colors.red)),
const TextSpan(text: ')'),
],
),
),
),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
CustomTextWidget(
fontWeight: FontWeight.w500,
fontSize: 10.sp,
text: DateFormatter().getRotaNewDate(
shiftDate: data.shiftDate ?? 0,
startShiftTime: data.shiftStartTime ?? '0',
endShiftTime: data.shiftEndTime ?? '0',
),
isExpanded: false),
6.verticalSpace,
CustomTextWidget(
text: '${int.parse(data.workHrs?.toString() ?? "0")}hrs',
fontSize: 14.sp,
fontWeight: FontWeight.w600,
isExpanded: false,
),
],
),
],
),
10.verticalSpace,
ShiftButtonWidget(onTap: onViewShiftTap)
],
),
);
}
}
class ShiftButtonWidget extends StatelessWidget {
final VoidCallback onTap;
const ShiftButtonWidget({
super.key,
required this.onTap,
});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
child: Container(
width: MediaQuery.of(context).size.width,
height: 26.h,
alignment: Alignment.center,
decoration: BoxDecoration(
color: CustomAppColors.kSecondaryColor,
borderRadius: BorderRadius.circular(2.r),
),
child: const Text(
"View Shift",
style: TextStyle(color: CustomAppColors.kPrimaryColor),
),
),
);
}
}

View File

@@ -0,0 +1,2 @@
export 'custom_widgets/export_custom_widgets.dart';
export 'screens/export_screens.dart';

View File

@@ -0,0 +1,89 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:get/get.dart';
class AgencySignIn extends StatefulWidget {
const AgencySignIn({super.key});
@override
State<AgencySignIn> createState() => _AgencySignInState();
}
class _AgencySignInState extends State<AgencySignIn> {
final AgencySignInController _controller = Get.put(AgencySignInController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
screenKey: _controller.screenKey,
onScreenTap: _controller.removeFocus,
showAppBar: true,
titleText: "",
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 15.0.w),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CustomImageWidget(
imagePath: AssetsManager.kAppIcon,
imageColor: CustomAppColors.kIconColor,
height: 132.h,
width: 203.w,
),
CustomTextWidget(
text: ConstantText.kAgencyLogin,
fontColor: CustomAppColors.kIconColor,
fontWeight: FontWeight.w700,
fontSize: 24.sp,
),
CustomTextWidget(
text: ConstantText.kPleaseLoginToContinue,
fontColor: CustomAppColors.kIconColor,
fontWeight: FontWeight.w400,
fontSize: 14.sp,
),
Padding(
padding: EdgeInsets.only(top: 30.0.h),
child: CustomTextFieldWidget(
controller: _controller.emailPhoneController,
hintText: ConstantText.kInputEmailOrPhone,
heading: ConstantText.kEmailOrPhoneHeading,
onChange: (_){
_controller.validateEmailPhone();
},
),
),
Obx((){
return CustomErrorMsg(
message: _controller.emailPhoneErrorMsg.value,
);
}),
Padding(
padding: EdgeInsets.only(top: 25.0.h),
child: Obx((){
return CustomAppButton(
isLoading: _controller.isLoading.value,
buttonText: ConstantText.kSendCode.toUpperCase(),
onTap: _controller.onSendCodeButton,
);
}),
),
],
),
),
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,4 @@
export 'splash_screen.dart';
export 'sign_in_screen.dart';
export 'agency_sign_in.dart';
export 'otp_screen.dart';

View File

@@ -0,0 +1,124 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:get/get.dart';
import 'package:pin_code_fields/pin_code_fields.dart';
class OTPScreen extends StatefulWidget {
const OTPScreen({super.key});
@override
State<OTPScreen> createState() => _OTPScreenState();
}
class _OTPScreenState extends State<OTPScreen> {
final OTPScreenController _controller = Get.put(OTPScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
screenKey: _controller.screenKey,
onScreenTap: _controller.removeFocus,
avoidBottomInsets: false,
showAppBar: true,
titleText: "",
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 15.0.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
CustomImageWidget(
imagePath: AssetsManager.kLockIcon,
imageColor: CustomAppColors.kIconColor,
height: 84.h,
width: 75.w,
),
Padding(
padding: EdgeInsets.only(top: 30.0.h),
child: CustomTextWidget(
text: ConstantText.kTwoFactorAuth,
fontColor: CustomAppColors.kIconColor,
fontWeight: FontWeight.w700,
fontSize: 24.sp,
alignment: Alignment.centerLeft,
),
),
CustomTextWidget(
text: ConstantText.kOTPScreenMsg,
fontColor: CustomAppColors.kIconColor,
fontWeight: FontWeight.w400,
fontSize: 14.sp,
alignment: Alignment.centerLeft,
textAlign: TextAlign.start,
),
Padding(
padding: EdgeInsets.only(top: 20.0.h),
child: PinCodeTextField(
keyboardType: TextInputType.number,
textInputAction: TextInputAction.done,
autoDisposeControllers: false,
controller: _controller.otpController,
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
],
onAutoFillDisposeAction: AutofillContextAction.cancel,
appContext: context,
length: 6,
onChanged: (otp) {
_controller.validateOTP();
},
cursorColor: CustomAppColors.kIconColor,
textStyle: TextStyle(
color: CustomAppColors.kIconColor.withOpacity(0.6),
),
pinTheme: PinTheme(
shape: PinCodeFieldShape.box,
borderRadius: BorderRadius.circular(2.r),
fieldHeight: 56.0.h,
fieldWidth: 43.33.w,
borderWidth: 0.5.w,
fieldOuterPadding: EdgeInsets.symmetric(vertical: 10.0.h,),
activeFillColor: CustomAppColors.kIconColor.withOpacity(0.6),
activeColor: CustomAppColors.kIconColor.withOpacity(0.6),
errorBorderColor: CustomAppColors.kIconColor.withOpacity(0.6),
selectedColor: CustomAppColors.kIconColor.withOpacity(0.6),
inactiveColor: CustomAppColors.kIconColor.withOpacity(0.6),
selectedFillColor: CustomAppColors.kIconColor.withOpacity(0.6),
),
),
),
Obx(() {
return CustomErrorMsg(
message: _controller.otpErrorMsg.value,
);
}),
const Spacer(),
Padding(
padding: EdgeInsets.only(
bottom: Platform.isIOS ? 30.0.h : 20.0.h,
),
child: Obx((){
return CustomAppButton(
isLoading: _controller.isLoading.value,
buttonText: ConstantText.kSubmit.toUpperCase(),
onTap: _controller.onSubmitButton,
);
}),
),
],
),
),
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,160 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:get/get.dart';
class SignInScreen extends StatefulWidget {
const SignInScreen({super.key});
@override
State<SignInScreen> createState() => _SignInScreenState();
}
class _SignInScreenState extends State<SignInScreen> {
final SignInScreenController _controller = Get.put(SignInScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
screenKey: _controller.screenKey,
onScreenTap: _controller.removeFocus,
showAppBar: true,
titleText: "",
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 15.0.w),
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CustomImageWidget(
imagePath: AssetsManager.kAppIcon,
imageColor: CustomAppColors.kIconColor,
height: 132.h,
width: 203.w,
),
CustomTextWidget(
text: ConstantText.kWelcomeBack,
fontColor: CustomAppColors.kIconColor,
fontWeight: FontWeight.w700,
fontSize: 24.sp,
),
CustomTextWidget(
text: ConstantText.kPleaseLoginToContinue,
fontColor: CustomAppColors.kIconColor,
fontWeight: FontWeight.w400,
fontSize: 14.sp,
),
Padding(
padding: EdgeInsets.only(top: 30.0.h),
child: CustomTextFieldWidget(
controller: _controller.emailController,
hintText: ConstantText.kPleaseInputEmail,
heading: ConstantText.kEmailHeading,
onChange: (_){
_controller.validateEmail();
},
),
),
Obx((){
return CustomErrorMsg(
message: _controller.emailErrorMsg.value,
);
}),
Padding(
padding: EdgeInsets.only(top: 15.0.h),
child: CustomTextFieldWidget(
controller: _controller.passwordController,
hintText: "******",
heading: ConstantText.kPasswordHeading,
onChange: (_){
_controller.validatePassword();
},
isObscure: true,
maxLines: 1,
),
),
Obx((){
return CustomErrorMsg(
message: _controller.passwordErrorMsg.value,
);
}),
Padding(
padding: EdgeInsets.only(
top: 15.0.h,
bottom: 25.h,
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// Obx((){
// return CustomCheckBox(
// checkBoxValue: _controller.isRememberMe.value,
// titleText: ConstantText.kRememberMe,
// onTap: () {
// _controller.isRememberMe.toggle();
// },
// );
// }),
// const Spacer(),
GestureDetector(
onTap: _controller.onForgotButton,
child: CustomTextWidget(
text: ConstantText.kForgotPassword,
isExpanded: false,
fontSize: 12.sp,
fontWeight: FontWeight.w500,
),
),
],
),
),
Padding(
padding: EdgeInsets.only(bottom: 8.0.h),
child: Obx((){
return CustomAppButton(
isLoading: _controller.isLoading.value,
buttonText: ConstantText.kLogIn.toUpperCase(),
onTap: _controller.onLogInButton,
);
}),
),
],
),
),
),
// Padding(
// padding: EdgeInsets.only(
// bottom: Platform.isIOS ? 30.0.h : 20.0.h,
// ),
// child: CustomAppButton(
// buttonText: ConstantText.kAgencyLogin.toUpperCase(),
// buttonColor: CustomAppColors.kPrimaryColor,
// textColor: CustomAppColors.kSecondaryColor,
// onTap: _controller.onAgencyLogInButton,
// ),
// ),
],
),
),
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,41 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/utilities/notification_util.dart';
import 'package:get/get.dart';
class SplashScreen extends StatefulWidget {
const SplashScreen({super.key});
@override
State<SplashScreen> createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
final _controller = Get.put(SplashScreenController());
@override
void initState() {
requestNotificationPermissions();
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
screenKey: _controller.screenKey,
backgroundColor: CustomAppColors.kSecondaryColor,
body: const Center(
child: CustomImageWidget(
imagePath: AssetsManager.kAppIcon,
height: 200,
),
),
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/models/chat/ChatModel.dart';
import 'group_data_args.dart';
class ChatScreenArgs {
final String name;
final String profilePicPath;
final String otherUserId;
final GroupDataArgs? groupData;
final ValueChanged<ChatModel>? onLastMessageUpdate;
ChatScreenArgs({
required this.name,
required this.profilePicPath,
required this.otherUserId,
this.groupData,
this.onLastMessageUpdate,
});
}

View File

@@ -0,0 +1,13 @@
import 'package:ftc_mobile_app/models/chat/combined_last_messages_model_class.dart';
class GroupDataArgs {
final String groupId;
final List groupMembersIds;
final GroupWorkingScheduleTime scheduleTime;
GroupDataArgs({
required this.groupId,
required this.groupMembersIds,
required this.scheduleTime,
});
}

View File

@@ -0,0 +1,190 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/models/chat/ChatModel.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:ftc_mobile_app/view/custom_widgets/my_circle_image.dart';
import 'package:get/get.dart';
import 'package:grouped_list/grouped_list.dart';
import 'package:intl/intl.dart';
import 'arguments/chat_screen_args.dart';
import 'widgets/chat_screen_footer_widget.dart';
import 'widgets/message_bubble.dart';
class ChatScreen extends StatefulWidget {
final ChatScreenArgs args;
const ChatScreen({Key? key, required this.args}) : super(key: key);
@override
State<ChatScreen> createState() => _ChatScreenState();
}
class _ChatScreenState extends State<ChatScreen> {
late final ChatScreenController controller;
final sepFormatter = DateFormat("dd MMM yyyy");
@override
void initState() {
controller = Get.put(ChatScreenController(widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: Colors.white,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: _appBar,
body: SafeArea(
child: Column(
children: [
Expanded(child: messagesList()),
Obx(() {
return controller.isSocketConnected()
? ChatScreenFooterWidget(
controller: controller,
enabled: controller.isSocketConnected(),
)
: FrequentFunctions.noWidget;
})
],
),
),
);
}
AppBar get _appBar {
return AppBar(
toolbarHeight: 56.r,
leading: IconButton(
icon: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
onPressed: () {
Navigator.pop(context);
},
),
centerTitle: false,
titleSpacing: 0,
leadingWidth: 50.r,
surfaceTintColor: Colors.white,
title: Row(
mainAxisSize: MainAxisSize.min,
children: [
MyCircleImage(
imageSize: 32.r,
url: "${WebUrls.baseUrl}${widget.args.profilePicPath}",
errorWidget: CustomImageWidget(
imagePath: AssetsManager.kPersonMainIcon,
imageColor: CustomAppColors.kDarkBlueTextColor,
height: 32.r,
width: 32.r,
),
),
10.horizontalSpace,
CustomTextWidget(
text: widget.args.name,
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
);
}
Widget messagesList() {
return Obx(() {
final messages = controller.messages;
return (messages.isEmpty)
? FrequentFunctions.noWidget
: _messagesList(messages());
});
}
Widget _messagesList(List<ChatModel> list) {
final now = DateTime.now();
return GroupedListView<ChatModel, String>(
reverse: true,
elements: list,
padding: REdgeInsets.symmetric(horizontal: 18),
order: GroupedListOrder.DESC,
groupBy: (message) {
final messageDate =
DateTime.fromMillisecondsSinceEpoch(message.date ?? 0);
return DateFormatter.dateFormatter.format(messageDate);
},
groupSeparatorBuilder: (String date) {
final isToday = (date == DateFormatter.dateFormatter.format(now));
return _buildGroupSeparatorWidget(isToday
? "Today"
: sepFormatter.format(DateFormatter.dateFormatter.parse(date)));
},
itemBuilder: (_, e) => _buildItemWidget(list.indexOf(e), e),
sort: false,
separator: 8.verticalSpace,
);
}
Widget _buildGroupSeparatorWidget(String susTag) {
return Padding(
padding: REdgeInsets.symmetric(vertical: 12.0),
child: Row(
children: [
Expanded(
child: Divider(
height: 1,
color: Colors.grey.withOpacity(0.3),
)),
Text(
susTag,
style: TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w500),
).addPaddingHorizontal(10),
Expanded(
child: Divider(
height: 1,
color: Colors.grey.withOpacity(0.3),
)),
],
),
);
}
Widget _buildItemWidget(int index, ChatModel message) {
final isMyMessage = (message.from?.id == controller.myId);
final hasFile = message.filePath.isNotNullOrEmpty();
print("filePath: ${message.filePath}");
return MessageBubble(
senderName: message.from?.name ?? "",
profilePic: !isMyMessage ? (message.from?.profilePictureUrl ?? "") : "",
content: hasFile ? (message.filePath ?? '') : (message.message ?? ''),
type: isMyMessage ? MessageType.sent : MessageType.received,
contentType: hasFile
? (message.fileType == ChatModel.fileTypeLocalPath)
? MessageContentType.file
: MessageContentType.url
: MessageContentType.text,
sentMessageColor: CustomAppColors.kSmokeColor,
receivedMessageColor: CustomAppColors.kSecondaryColor,
messageTime: (message.date == null)
? ""
: DateTime.fromMillisecondsSinceEpoch(message.date!)
.toIso8601String(),
state: MessageState.stateNone,
status: MessageSeenStatus.seen,
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,503 @@
import 'dart:developer';
import 'dart:io';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ftc_mobile_app/controllers/home/inbox_screen_controller.dart';
import 'package:ftc_mobile_app/models/chat/all_group_messages_model.dart';
import 'package:ftc_mobile_app/models/chat/single_chat.dart';
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:ftc_mobile_app/utilities/frequent_functions.dart';
import 'package:ftc_mobile_app/utilities/image_picker_popup.dart';
import 'package:ftc_mobile_app/utilities/local_storage_manager/export_local_storage.dart';
import 'package:ftc_mobile_app/view/custom_widgets/home/custom_message_dialog.dart';
import 'package:ftc_mobile_app/view/screens/chat/arguments/chat_screen_args.dart';
import 'package:ftc_mobile_app/web_services/chat_services.dart';
import 'package:ftc_mobile_app/web_services/web_url.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:socket_io_client/socket_io_client.dart';
import '../../../../models/chat/ChatModel.dart';
class ChatScreenController extends GetxController {
final GlobalKey<ScaffoldState> screenKey = GlobalKey<ScaffoldState>();
final messageTEC = TextEditingController();
final messageFN = FocusNode();
final messages = RxList<ChatModel>();
final isSocketConnected = false.obs;
late final ChatScreenArgs args;
String myId = "";
ChatScreenController(ChatScreenArgs data) {
args = data;
}
late Socket _socketIO;
String listenId = "";
@override
void onInit() {
//Getting my ID
// String userJson = LocalStorageManager.getSessionToken(
// tokenKey: LocalStorageKeys.kUserModelKey,
// );
// UserModel userModel = UserModel.fromJson(json.decode(userJson));
myId = LocalStorageManager.userId;
if (_canChat) {
initializeSocket();
}
super.onInit();
}
@override
void onReady() {
if (isGroup) {
fetchGroupMessagesFromService(args.groupData!.groupId);
} else {
fetchSingleMessagesFromService();
}
if (_canChat.not) {
showCantMessageDialog();
}
super.onReady();
}
bool get isGroup => args.groupData != null;
/// This method checks the current date if it lies within schedule time or not.
/// If it does, it means chat is enabled else chat will be disabled.
/// If schedule times not available, it returns true;
bool get _canChat {
final startMills = args.groupData?.scheduleTime.startTime ?? 0;
final endMills = args.groupData?.scheduleTime.endTime ?? 0;
if (startMills > 0 && endMills > 0) {
// Schedule times are available
final scheduleTime = _getScheduleTime(startMills, endMills);
final currentTime = TimeOfDay.now();
// Current time within start, end schedule time
return (currentTime.isAfter(scheduleTime.start) &&
currentTime.isBefore(scheduleTime.end));
} else {
// Schedule times not available
return true;
}
}
//Make sure to pass correct millis values
({TimeOfDay start, TimeOfDay end}) _getScheduleTime(
int startMills, int endMills) {
final sd = DateTime.fromMillisecondsSinceEpoch(startMills);
final ed = DateTime.fromMillisecondsSinceEpoch(endMills);
final startTime = TimeOfDay(hour: sd.hour, minute: sd.minute);
final endTime = TimeOfDay(hour: ed.hour, minute: ed.minute);
return (start: startTime, end: endTime);
}
initializeSocket() {
debugPrint('Socket address: ${WebUrls.socketUrl}');
_socketIO = io(
WebUrls.socketUrl,
OptionBuilder()
.setTransports(['websocket']) // for Flutter or Dart VM
.enableForceNewConnection()
.enableAutoConnect()
.setExtraHeaders({'foo': 'bar'}) // optional
.build());
isSocketConnected.value = true;
_socketIO.onConnect((_) {
isSocketConnected.value = true;
debugPrint('Socket Connected');
});
_socketIO.onDisconnect((_) {
debugPrint('Socket Disconnected');
// isSocketConnected.value = false;
});
_socketIO.onConnectError((e) {
debugPrint('Socket Connection Error: ${e.toString()}');
// isSocketConnected.value = false;
});
_socketIO.onConnectTimeout((e) {
debugPrint('Socket timeout Error: ${e.toString()}');
// isSocketConnected.value = false;
});
//listenIdReceive
listenId = (isGroup) ? args.groupData!.groupId : (myId + args.otherUserId);
debugPrint('listen on: $listenId');
_socketIO.on(listenId, (data) {
debugPrint('listen on listenId: $data');
_handleIncomingMessages(data);
});
}
_handleIncomingMessages(Map<String, dynamic> chatJson) {
log("chat listen: $chatJson");
// _total += 1;
// _skip += 1;
final chatModel = ChatModel.fromJson(chatJson);
if (chatJson.containsKey('createdAt')) {
chatModel.date =
DateTime.tryParse(chatJson["createdAt"])?.millisecondsSinceEpoch ?? 0;
} else {
chatModel.date = DateTime.now().millisecondsSinceEpoch;
}
if (isGroup) {
if (chatJson.containsKey('userId') && chatJson["userId"] is Map) {
chatModel.from = UserData.fromJson(chatJson["userId"]);
}
_onFirstMessageSent();
} else {
chatModel.from = UserData(
id: args.otherUserId,
name: args.name,
profilePictureUrl: args.profilePicPath);
chatModel.to = UserData(id: chatJson['to']);
}
messages.insert(0, chatModel);
args.onLastMessageUpdate?.call(chatModel);
}
Future fetchSingleMessagesFromService() async {
// _skip = 0;
final response = await ChatService()
.allSingleUsersChatMessagesServerAdmin(
from: myId,
to: args.otherUserId,
)
.showLoader();
if (response is List<ChatModel>) {
if (response.isNotEmpty) {
//Note: Converting this response to List of ChatModel objects
// List<ChatModel> chats = [];
// await Future.forEach(response.reversed, (e) {
// chats.add(ChatModel(
// id: e.id,
// from: e.from,
// to: e.to,
// message: e.message,
// date:
// DateTime.tryParse(e.createdAt)?.millisecondsSinceEpoch ?? 0));
// });
messages.value = response.reversed.toList();
}
} else if (response is String) {
FrequentFunctions.showToast(message: response);
}
}
void fetchGroupMessagesFromService(String idOfGroup) async {
dynamic response = await ChatService().allGroupMessages(
sortOrder: -1,
offset: 0,
limit: 100000,
groupId: idOfGroup,
isDeleted: false).showLoader();
if (response is List<AllGroupMessages>) {
if (response.isNotEmpty) {
//Note: Converting this response to List of ChatModel objects
List<ChatModel> chats = [];
await Future.forEach(response, (e) {
chats.add(ChatModel(
id: e.id,
from: e.userId,
message: e.message,
messageType: e.messageType,
filePath: e.filePath,
date:
DateTime.tryParse(e.createdAt)?.millisecondsSinceEpoch ?? 0));
});
messages.value = chats;
}
} else if (response is String) {
FrequentFunctions.showToast(message: response);
}
}
void sendMessageButtonPressed() async {
if (messageTEC.text.trim().isEmpty) {
return;
}
_sendMessage(
message: messageTEC.text.trim(),
);
messageTEC.clear();
}
//if sending first message, then updating chat list screen by calling it's listing api
_onFirstMessageSent() {
if (messages.length == 1) {
try {
final iController = Get.find<InboxScreenController>();
iController.onFirstMessageSend.value = true;
print("Got controller");
} catch (e) {
debugPrint(e.toString());
}
}
}
_sendMessage({
String? message,
File? file,
}) {
if (isGroup) {
_sendGroupMessage(
message: message,
file: file,
);
} else {
_sendPrivateMessage(
message: message,
file: file,
);
}
}
///Note: no need to update ui for sent message here because
///it's gonna handled by socket event
_sendGroupMessage({
String? message,
File? file,
}) async {
await ChatService().addGroupMessageService(
message: message ?? "",
messageType: (file != null) ? MessageType.file : MessageType.message,
file: file,
userId: myId,
groupId: args.groupData!.groupId,
);
}
///Note: handling messages list update also here
_sendPrivateMessage({
String? message,
File? file,
}) async {
final id = DateTime.now().millisecondsSinceEpoch;
final model = ChatModel(
id: id.toString(),
from: UserData(id: LocalStorageManager.userId),
to: UserData(
id: args.otherUserId,
name: args.name,
profilePictureUrl: args.profilePicPath,
),
message: message,
messageType:
(file != null) ? MessageType.file.name : MessageType.message.name,
fileType: (file != null) ? ChatModel.fileTypeLocalPath : null,
date: id,
state: ChatModel.stateLoading,
);
messages.insert(0, model);
args.onLastMessageUpdate?.call(model);
dynamic response = await ChatService().addSingleMessage(
message: message ?? "",
messageType: (file != null) ? MessageType.file : MessageType.message,
file: file,
senderId: LocalStorageManager.userId,
receiverId: args.otherUserId,
);
final msg = messages.firstWhereOrNull((e) {
return e.id == id.toString();
});
if (msg != null) {
final index = messages.indexOf(msg);
if (response is SingleChatModelClass) {
//message sent successfully
msg.id = response.id;
msg.fileType = null;
msg.state = ChatModel.stateSuccess;
messages
..removeAt(index)
..insert(index, msg);
_onFirstMessageSent();
} else {
msg.state = ChatModel.stateError;
messages.removeAt(index);
}
}
}
pickAndSendFile() async {
Get.focusScope?.unfocus();
Get.bottomSheet(CupertinoActionSheet(
actions: [
ListTile(
onTap: () {
Get.back();
ImagePickerPopup.getImageFromSource(
fromCamera: true,
onFetchImage: (f) {
_sendMessage(file: f);
});
},
leading: const Icon(CupertinoIcons.camera),
title: const Text("Camera"),
trailing: Icon(
Icons.arrow_forward_ios_rounded,
size: 18.r,
),
),
ListTile(
onTap: () async {
Get.back();
FilePickerResult? result =
await FilePicker.platform.pickFiles(type: FileType.media);
if (result != null && result.files.single.path != null) {
if (result.files.single.path!.isImageFileName) {
_sendMessage(file: File(result.files.single.path!));
} else {
FrequentFunctions.showToast(message: "File doesn't supported ");
}
}
},
leading: const Icon(CupertinoIcons.photo_on_rectangle),
title: const Text("Gallery"),
trailing: Icon(
Icons.arrow_forward_ios_rounded,
size: 18.r,
),
),
ListTile(
onTap: () async {
Get.back();
final FilePickerResult? result = await FilePicker.platform
.pickFiles(
type: FileType.custom,
allowedExtensions: ["pdf", "doc", "docx", "xlsx", "xls"]);
if (result != null) {
_sendMessage(file: File(result.files.single.path!));
}
},
leading: const Icon(Icons.attach_file),
title: const Text("File"),
trailing: Icon(
Icons.arrow_forward_ios_rounded,
size: 18.r,
),
),
],
));
}
// _sendImage(File file) async {
// debugPrint("file: ${file.path}");
// //
// // ChatModel model = ChatModel(
// // sentBy: UserData(id: myId),
// // sentTo: otherUser,
// // date: DateTime.now().toUtc().millisecondsSinceEpoch,
// // files: [file.path],
// // fileType: fileTypeLocalPath,
// // state: ChatModel.stateLoading);
// //
// // final modelHash = model.hashCode.toString();
// // model.localId = modelHash;
// //
// // debugPrint("message modelHash: $modelHash");
// // _handleChat(model.toJson());
// //
// // // return;
// // var res = await repository.sendChatAttachmentApi(
// // req: ChatMessageRequest(
// // sentBy: myId,
// // sentTo: otherUser.id!,
// // files: [file],
// // fileType: "image"),
// // );
// //
// // final i = messages.indexWhere((e) => e.localId == modelHash);
// //
// // if (res.success == true) {
// // if (i != -1) {
// // messages[i].state = ChatModel.stateSuccess;
// // messages.refresh();
// // }
// // } else {
// // if (i != -1) {
// // messages[i].state = ChatModel.stateError;
// // messages.refresh();
// // }
// // }
// }
//Always call this method if _canChat is false
void showCantMessageDialog() {
final startMills = args.groupData!.scheduleTime.startTime;
final endMills = args.groupData!.scheduleTime.endTime;
final scheduleTime = _getScheduleTime(startMills, endMills);
final sd = DateTime(
2024, 1, 1, scheduleTime.start.hour, scheduleTime.start.minute, 0);
final ed =
DateTime(2024, 1, 1, scheduleTime.end.hour, scheduleTime.end.minute, 0);
showDialog(
context: screenKey.currentState!.context,
builder: (BuildContext context) {
return CustomMessageDialog(
dialogButtonText: "Close",
dialogMessageText:
"It is currently outside the working hours. You can only send message during the working hours",
dialogMessageTextBold:
"Working hours: ${DateFormat("hh:mm aa").format(sd)} - ${DateFormat("hh:mm aa").format(ed)}",
headingText: "You Can't message right now",
);
},
);
}
// new
void removeFocus() {
FocusScope.of(screenKey.currentContext!).unfocus();
}
@override
void dispose() {
try {
_socketIO.clearListeners();
_socketIO.disconnect();
_socketIO.destroy();
_socketIO.dispose();
} catch (e) {
print(e);
}
messageTEC.dispose();
messageFN.dispose();
// scrollController.dispose();
Get.delete<ChatScreenController>();
super.dispose();
}
}

View File

@@ -0,0 +1,89 @@
import 'package:flutter_svg/svg.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:get/get.dart';
class ChatScreenFooterWidget extends StatelessWidget {
const ChatScreenFooterWidget({
super.key,
required this.controller,
required this.enabled,
});
final ChatScreenController controller;
final bool enabled;
@override
Widget build(BuildContext context) {
return Padding(
padding: REdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: Align(
alignment: Alignment.bottomCenter,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
IconButton(
onPressed: controller.pickAndSendFile,
icon: SvgPicture.asset(
AssetsManager.svgIcAdd,
width: 32.r,
height: 32.r,
),
),
Expanded(
child: TextField(
minLines: 1,
maxLines: 5,
textAlign: TextAlign.left,
controller: controller.messageTEC,
keyboardType: TextInputType.multiline,
focusNode: controller.messageFN,
enabled: enabled,
decoration: InputDecoration(
hintText: 'Type Message...',
// border: InputBorder.none,
enabledBorder: OutlineInputBorder(
borderRadius: 4.toRadius(),
borderSide: BorderSide(
width: 1,
color: Colors.grey.withOpacity(0.3),
),
),
focusedBorder: OutlineInputBorder(
borderRadius: 4.toRadius(),
borderSide: BorderSide(
width: 1,
color: Get.theme.primaryColor,
),
),
contentPadding: EdgeInsets.symmetric(horizontal: 10.w),
),
),
),
5.horizontalSpace,
SizedBox(
width: 80.w,
height: 40.r,
child: IgnorePointer(
ignoring: enabled.not,
child: CustomAppButton(
buttonText: "Send",
buttonColor:
enabled ? Get.theme.primaryColor : Colors.grey,
borderColor:
enabled ? Get.theme.primaryColor : Colors.grey,
onTap: controller.sendMessageButtonPressed,
),
)),
],
),
8.verticalSpace,
],
),
));
}
}

View File

@@ -0,0 +1,420 @@
import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:flutter/material.dart';
import 'package:photo_view/photo_view.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../../custom_widgets/my_circle_image.dart';
import 'package:path/path.dart' as path;
enum MessageType { sent, received }
enum MessageSeenStatus { delivered, seen }
enum MessageContentType { text, file, url }
enum MessageState {
stateNone(0),
stateError(-1),
stateSending(1),
stateSuccess(2);
final int intValue;
static MessageState stateFromIntValue(int value) {
switch (value) {
case -1:
return MessageState.stateError;
case 1:
return MessageState.stateSending;
case 2:
return MessageState.stateSuccess;
default:
return MessageState.stateNone;
}
}
const MessageState(this.intValue);
}
class MessageBubble extends StatelessWidget {
final String senderName;
final String content;
final MessageState state;
final MessageContentType contentType;
final String profilePic;
final MessageType type;
final MessageSeenStatus status;
final String messageTime;
final Color? sentMessageColor;
final Color? receivedMessageColor;
final Color? sentMessageTextColor;
final Color? receivedMessageTextColor;
final bool showReportButton;
const MessageBubble({
Key? key,
required this.senderName,
required this.content,
required this.contentType,
required this.state,
required this.profilePic,
required this.type,
required this.status,
required this.messageTime,
this.sentMessageColor,
this.receivedMessageColor,
this.sentMessageTextColor,
this.receivedMessageTextColor,
this.showReportButton = true,
}) : super(key: key);
Color get _backgroundColor => (type == MessageType.sent)
? (sentMessageColor ?? Get.theme.primaryColor)
: (receivedMessageColor ?? const Color(0xffC1C1C5));
Color get messageColor => (type == MessageType.sent)
? (sentMessageTextColor ?? Colors.black)
: (receivedMessageTextColor ?? Colors.white);
// double get _paddingLeft => (type == MessageType.sent) ? 0.15.sw : 0;
final radius = 16.0;
@override
Widget build(BuildContext context) {
final loader = Visibility(
visible: (state == MessageState.stateSending),
child: Align(
alignment: Alignment.topCenter,
child: SizedBox.square(
dimension: 18,
child: CircularProgressIndicator(
color: Get.theme.primaryColor,
strokeWidth: 2,
)),
),
);
final messageBox = SizedBox(
width: 0.7.sw,
child: Padding(
padding: REdgeInsets.symmetric(vertical: 5),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(type == MessageType.received)
? MyCircleImage(
imageSize: 20.r,
url: WebUrls.baseUrl + profilePic,
errorWidget: const DecoratedBox(
decoration: BoxDecoration(color: Color(0xffC1C1C5)),
child: Center(
child: Icon(
Icons.image_not_supported_outlined,
color: Colors.black,
size: 12,
),
),
),
).paddingOnly(right: 8.r)
: FrequentFunctions.noWidget,
Expanded(
child: (contentType == MessageContentType.text)
? _textMessage()
: (content.isImageFileName)
? _imageWidget()
: _documentFileWidget(),
),
],
),
4.verticalSpace,
Row(
children: [
(type == MessageType.received)
? SizedBox(width: 28.r)
: FrequentFunctions.noWidget,
(state == MessageState.stateSending)
? loader
: (state == MessageState.stateError)
? Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.warning_amber_rounded,
color: Colors.red,
size: 14.r,
),
4.horizontalSpace,
Text(
'Message not sent',
style: const TextStyle().copyWith(
color: Colors.red,
),
)
],
)
: FrequentFunctions.noWidget
],
)
],
),
),
);
return SizedBox(
width: double.maxFinite,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: (type == MessageType.sent)
? MainAxisAlignment.end
: MainAxisAlignment.start,
children: [messageBox],
),
);
}
Widget _textMessage() => Container(
padding: REdgeInsets.symmetric(horizontal: 14, vertical: 12),
decoration:
BoxDecoration(color: _backgroundColor, borderRadius: 10.toRadius()),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
(type == MessageType.received)
? CustomTextWidget(
text: senderName,
fontColor: messageColor,
textAlign: TextAlign.left,
fontSize: 12.sp,
fontWeight: FontWeight.w600,
).paddingOnly(bottom: 10.r)
: FrequentFunctions.noWidget,
CustomTextWidget(
text: content,
fontColor: messageColor,
textAlign: TextAlign.left,
fontSize: 12.sp,
fontWeight: FontWeight.w400,
),
4.verticalSpace,
Align(
alignment: Alignment.centerRight,
child: _messageTimeWidget(),
)
],
),
);
Widget _imageWidget() {
return InkWell(
onTap: _openPreviewDialog,
child: Container(
width: 200.r,
height: 250.r,
clipBehavior: Clip.antiAlias,
padding: REdgeInsets.all(4),
decoration: BoxDecoration(
color: _backgroundColor,
borderRadius: radius.toRadius()),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
//Sender Name
(type == MessageType.received)
? CustomTextWidget(
text: senderName,
fontColor: messageColor,
textAlign: TextAlign.left,
fontSize: 12.sp,
fontWeight: FontWeight.w600,
).paddingOnly(bottom: 10.r)
: FrequentFunctions.noWidget,
//image
Expanded(
child: ClipRRect(
clipBehavior: Clip.antiAlias,
borderRadius: (radius - 4).toRadius(),
child: (contentType == MessageContentType.file)
? Image.file(File(content), fit: BoxFit.cover)
: CachedNetworkImage(
imageUrl: (WebUrls.baseUrl + content),
fit: BoxFit.cover,
),
),
),
8.verticalSpace,
//Time
Align(
alignment: Alignment.centerRight,
child: _messageTimeWidget(),
).addPaddingHorizontal(12),
8.verticalSpace,
],
),
),
);
}
Widget _documentFileWidget() {
return Container(
decoration: BoxDecoration(
color: _backgroundColor,
borderRadius: radius.toRadius(),
),
clipBehavior: Clip.antiAlias,
padding: REdgeInsets.all(4),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
//Sender Name
(type == MessageType.received)
? CustomTextWidget(
text: senderName,
fontColor: messageColor,
textAlign: TextAlign.left,
fontSize: 12.sp,
fontWeight: FontWeight.w600,
).paddingOnly(bottom: 10.r)
: FrequentFunctions.noWidget,
//File
InkWell(
onTap: () {
if (contentType == MessageContentType.url) {
_launchUrl(WebUrls.baseUrl + content);
} else {
_launchUrl(content);
}
},
child: Card(
elevation: 0,
surfaceTintColor: Colors.white,
child: Padding(
padding: REdgeInsets.symmetric(horizontal: 12, vertical: 12),
child: Row(
children: [
CircleAvatar(
radius: 24.r,
backgroundColor:
CustomAppColors.kSecondaryColor.withOpacity(0.1),
child: const Icon(
Icons.file_copy_outlined,
color: CustomAppColors.kSecondaryColor,
),
),
12.horizontalSpace,
Expanded(
child: CustomTextWidget(
text: path.basename(content),
fontColor: messageColor,
textAlign: TextAlign.left,
fontSize: 12.sp,
fontWeight: FontWeight.w400,
),
)
],
),
),
),
),
4.verticalSpace,
//Time
Align(
alignment: Alignment.centerRight,
child: _messageTimeWidget(),
).addPaddingHorizontal(12),
],
),
);
}
Widget _messageTimeWidget() {
return (messageTime.isNotEmpty)
? Text(
DateFormat("hh:mm aa")
.format(DateTime.parse(messageTime).toLocal()),
style: TextStyle(
color: (type == MessageType.sent) ? Colors.grey : Colors.white,
fontSize: 10.sp,
fontWeight: FontWeight.w400,
),
)
: FrequentFunctions.noWidget;
}
void _openPreviewDialog() {
final img = (contentType == MessageContentType.file)
? FileImage(File(content))
: CachedNetworkImageProvider(WebUrls.baseUrl + content);
Get.dialog(
Material(
type: MaterialType.transparency,
child: SizedBox(
width: double.maxFinite,
height: double.maxFinite,
child: Stack(
fit: StackFit.expand,
children: [
Positioned.fill(
child: PhotoViewGestureDetectorScope(
axis: Axis.vertical,
child: PhotoView(
tightMode: true,
backgroundDecoration: const BoxDecoration(
color: Colors.transparent,
),
minScale: PhotoViewComputedScale.contained,
maxScale: PhotoViewComputedScale.covered * 1.1,
initialScale: PhotoViewComputedScale.contained,
imageProvider: img as ImageProvider,
heroAttributes:
const PhotoViewHeroAttributes(tag: "someTag"),
),
),
),
Positioned(
right: 12,
top: 12,
child: InkWell(
onTap: Get.back,
child: Card(
color: Colors.white,
shape: 24.toRoundedRectRadius(),
elevation: 4,
child: RSizedBox.square(
dimension: 40,
child: Icon(
Icons.close,
color: Colors.black,
size: 24.r,
),
),
),
),
)
],
),
),
),
);
}
Future<void> _launchUrl(String url) async {
try {
await launchUrl(Uri.parse(url));
} catch (e) {
debugPrint(e.toString());
}
}
}

View File

@@ -0,0 +1,203 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/models/clients/memoryListResponse/MemoryListData.dart';
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import 'package:ftc_mobile_app/view/custom_widgets/my_network_image.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'controller/add_edit_memory_box_screen_controller.dart';
import 'widget/VideoPlayerWidget.dart';
class AddEditMemoryBoxScreenArgs {
final UserData userData;
final MemoryListData? data;
final bool viewOnly;
AddEditMemoryBoxScreenArgs({
required this.userData,
this.data,
this.viewOnly = false,
});
}
//This screen is used to view, add and edit memory box
class AddEditMemoryBoxScreen extends StatefulWidget {
final AddEditMemoryBoxScreenArgs args;
const AddEditMemoryBoxScreen({super.key, required this.args});
@override
State<AddEditMemoryBoxScreen> createState() => _AddEditMemoryBoxScreenState();
}
class _AddEditMemoryBoxScreenState extends State<AddEditMemoryBoxScreen> {
final controller = Get.put(AddEditMemoryBoxScreenController());
@override
void initState() {
controller.serviceUserId = widget.args.userData.id!;
if (forUpdate) {
controller.filePath.value =
'${WebUrls.baseUrl}${widget.args.data!.filePath ?? ""}';
controller.noteDetailsController.text = widget.args.data!.note ?? "";
}
super.initState();
}
bool get forUpdate => widget.args.data != null;
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText:
"${widget.args.viewOnly ? "View" : forUpdate ? "Update" : "Add"} Memory Box",
),
body: SafeArea(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 20.r),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: (widget.args.viewOnly)
? _viewOnlyWidgets
: [
12.verticalSpace,
Obx(() {
final path = controller.filePath();
return mediaViewer(path: path);
}),
CustomTextWidget(
text: "Upload File",
textAlign: TextAlign.left,
fontSize: 16.sp,
fontColor: Colors.black,
fontWeight: FontWeight.w600,
),
// CustomTextWidget(
// text: "Please upload a file that is 1MB or smaller.",
// textAlign: TextAlign.left,
// fontSize: 12.sp,
// fontColor: Colors.grey,
// ),
12.verticalSpace,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 1,
child: SizedBox(
height: 32.r,
child: CustomAppButton(
buttonColor: Get.theme.primaryColor,
buttonText: "Choose File",
onTap: controller.onFileChooseButtonTap,
),
).paddingOnly(right: 8.r),
),
Expanded(
flex: 2,
child: Obx(() {
return controller.filePath.isNotEmpty
? Obx(
() => CustomTextWidget(
text: controller.filePath.value
.split("/")
.last,
isExpanded: false,
textAlign: TextAlign.left,
),
)
: FrequentFunctions.noWidget;
}),
),
],
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
controller: controller.noteDetailsController,
heading: "Note Details",
hintText: "Type here...",
minLines: 6,
maxLines: 6,
onChange: (_) {},
),
32.verticalSpace,
CustomAppButton(
buttonText: forUpdate ? "Update" : "Save",
onTap: () {
forUpdate
? controller
.updateButtonPress(widget.args.data!.id!)
: controller.saveButtonPress();
},
),
5.verticalSpace,
],
),
),
),
),
);
}
List<Widget> get _viewOnlyWidgets {
return [
12.verticalSpace,
mediaViewer(
path: '${WebUrls.baseUrl}${widget.args.data?.filePath ?? ""}'),
20.verticalSpace,
Column(
children: [
CustomTextWidget(
text: "Note Details",
textAlign: TextAlign.left,
fontSize: 16.sp,
fontWeight: FontWeight.w600,
fontColor: Colors.black,
),
CustomTextWidget(
text: widget.args.data?.note ?? "",
textAlign: TextAlign.left,
fontSize: 14.sp,
fontColor: Colors.black,
),
],
)
];
}
Widget mediaViewer({required String path}) {
if (path.isVideoFileName) {
return VideoPlayerWidget(
path: path,
type: path.startsWith("http")
? VideoSourceType.network
: VideoSourceType.file,
);
} else if (path.isImageFileName) {
if (path.startsWith("http")) {
return MyNetworkImage(url: path);
} else {
return Image.file(File(path));
}
} else {
return FrequentFunctions.noWidget;
}
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,98 @@
import 'dart:io';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:ftc_mobile_app/utilities/frequent_functions.dart';
import 'package:ftc_mobile_app/web_services/client_services.dart';
import 'package:get/get.dart';
class AddEditMemoryBoxScreenController extends GetxController {
final GlobalKey<ScaffoldState> screenKey = GlobalKey<ScaffoldState>();
TextEditingController documentTitleController = TextEditingController();
TextEditingController noteDetailsController = TextEditingController();
late final String serviceUserId;
final file = Rx<File?>(null);
//Should stores full path of file or url
final filePath = "".obs;
onFileChooseButtonTap() async {
FilePickerResult? result =
await FilePicker.platform.pickFiles(type: FileType.media);
if (result != null && result.files.single.path != null) {
if (result.files.single.path!.isVideoFileName ||
result.files.single.path!.isImageFileName) {
file.value = File(result.files.single.path!);
filePath.value = result.files.single.path!;
} else {
FrequentFunctions.showToast(message: "Unsupported File");
}
}
}
Future<void> saveButtonPress() async {
if (file() == null) {
FrequentFunctions.showToast(message: "Please select file first");
return;
}
if (noteDetailsController.text.trim().isEmpty) {
FrequentFunctions.showToast(message: "Note details field is required");
return;
}
var response = await ClientService()
.addMemoryBoxFile(
userId: serviceUserId,
filePath: file.value!.path,
noteDetails: noteDetailsController.text,
)
.showLoader();
if (response == true) {
backButtonPressed(argument: true);
} else {
FrequentFunctions.showToast(message: response);
}
}
Future<void> updateButtonPress(String id) async {
if (noteDetailsController.text.trim().isEmpty) {
FrequentFunctions.showToast(message: "Note details field is required");
return;
}
var response = await ClientService()
.updateMemoryBoxFile(
id: id,
userId: serviceUserId,
filePath: file.value?.path ?? "",
noteDetails: noteDetailsController.text,
)
.showLoader();
if (response == true) {
backButtonPressed(argument: true);
} else {
FrequentFunctions.showToast(message: response);
}
}
void backButtonPressed({dynamic argument}) {
Navigator.of(screenKey.currentContext!).pop(argument);
}
void removeFocus() {
FocusScope.of(screenKey.currentContext!).unfocus();
}
@override
void dispose() {
noteDetailsController.dispose();
Get.delete<AddEditMemoryBoxScreenController>();
super.dispose();
}
}

View File

@@ -0,0 +1,93 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:video_player/video_player.dart';
enum VideoSourceType { file, network }
class VideoPlayerWidget extends StatefulWidget {
final String path;
final VideoSourceType type;
const VideoPlayerWidget({
super.key,
required this.path,
required this.type,
});
@override
State<VideoPlayerWidget> createState() => _VideoPlayerWidgetState();
}
class _VideoPlayerWidgetState extends State<VideoPlayerWidget> {
VideoPlayerController? _videoPlayerController;
final RxBool isInitialized = false.obs;
final RxBool isError = false.obs;
final RxBool isPlaying = false.obs;
double aspectRatio = 16.0 / 9.0;
@override
void initState() {
print("Video path: ${widget.path}");
if (widget.type == VideoSourceType.network) {
print("VideoSourceType.network");
_videoPlayerController =
VideoPlayerController.networkUrl(Uri.parse(widget.path));
} else {
print("VideoSourceType.file");
_videoPlayerController = VideoPlayerController.file(File(widget.path));
}
_videoPlayerController?.initialize().then((_) {
isInitialized.value = true;
});
super.initState();
}
@override
Widget build(BuildContext context) {
return AspectRatio(
aspectRatio: aspectRatio,
child: Obx(() {
return (isError())
? FrequentFunctions.centerText(text: "Something went wrong")
: isInitialized.isFalse
? FrequentFunctions.centerText(text: "Loading video...")
: Stack(
children: [
Positioned.fill(
child: VideoPlayer(_videoPlayerController!),
),
Center(
child: Obx(() {
return (isPlaying())
? FrequentFunctions.noWidget
: InkWell(
onTap: () {
if (isPlaying.isFalse) {
isPlaying.value = true;
_videoPlayerController?.play();
}
},
child: Icon(
Icons.play_circle,
color: Get.theme.primaryColor,
size: 56.r,
),
);
}),
)
],
);
}),
);
}
@override
void dispose() {
_videoPlayerController?.dispose();
_videoPlayerController = null;
super.dispose();
}
}

View File

@@ -0,0 +1,358 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/models/clients/riskAssessmentResponse/RiskAssessmentData.dart';
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:get/get.dart';
import 'controller/add_edit_risk_assessment_screen_controller.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
class AddEditRiskAssessmentScreenArgs {
final UserData userData;
//If [issueData] is not null, then this screen will update its content instead
final RiskAssessmentData? riskAssessmentData;
AddEditRiskAssessmentScreenArgs({
required this.userData,
this.riskAssessmentData,
});
}
class AddEditRiskAssessmentScreen extends StatefulWidget {
final AddEditRiskAssessmentScreenArgs args;
const AddEditRiskAssessmentScreen({Key? key, required this.args})
: super(key: key);
@override
State<AddEditRiskAssessmentScreen> createState() =>
_AddDetailsToNewBodyPointScreenState();
}
class _AddDetailsToNewBodyPointScreenState
extends State<AddEditRiskAssessmentScreen> {
final AddEditRiskAssessmentScreenController controller =
Get.put(AddEditRiskAssessmentScreenController());
@override
void initState() {
//Note: Important
controller.serviceUserId = widget.args.userData.id!;
if (widget.args.riskAssessmentData != null) {
controller.isEditing.value = true;
controller.hazardTEC.text = widget.args.riskAssessmentData!.hazard ?? "";
controller.personsExposedToHazardTEC.text =
widget.args.riskAssessmentData!.personsExposedToHazard ?? "";
controller.riskIdentifiedTEC.text =
widget.args.riskAssessmentData!.riskIdentified ?? "";
controller.controlMeasuresRequiredTEC.text =
widget.args.riskAssessmentData!.coldMeasureRequired ?? "";
//Pure Risk Rating
controller.pureRiskRatingCTEC.text =
widget.args.riskAssessmentData!.pureRiskRating?.c?.toString() ?? "";
controller.pureRiskRatingLTEC.text =
widget.args.riskAssessmentData!.pureRiskRating?.l?.toString() ?? "";
controller.pureRiskRatingRTEC.text =
widget.args.riskAssessmentData!.pureRiskRating?.r?.toString() ?? "";
//In Place Rating
controller.inPlaceYTEC.text =
widget.args.riskAssessmentData!.inPlace?.y?.toString() ?? "";
controller.inPlaceNTEC.text =
widget.args.riskAssessmentData!.inPlace?.n?.toString() ?? "";
//Residual Risk Rating
controller.residualRiskRatingCTEC.text =
widget.args.riskAssessmentData!.residualRiskRating?.c?.toString() ??
"";
controller.residualRiskRatingLTEC.text =
widget.args.riskAssessmentData!.residualRiskRating?.l?.toString() ??
"";
controller.residualRiskRatingRTEC.text =
widget.args.riskAssessmentData!.residualRiskRating?.r?.toString() ??
"";
}
super.initState();
}
@override
Widget build(BuildContext context) {
return Obx(() {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(context,
titleText: controller.isEditing()
? "Update Risk Assessment"
: "Add New Risk Assessment"),
body: SafeArea(
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 16.r),
children: [
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.hazardTEC,
textCapitalization: TextCapitalization.sentences,
heading: "Hazard",
hintText: "",
),
20.verticalSpace,
headingText("Pure Risk Rating"),
8.verticalSpace,
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Text("C"),
4.verticalSpace,
dropdown(
textEditingController:
controller.pureRiskRatingCTEC),
],
),
),
8.horizontalSpace,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Text("L"),
4.verticalSpace,
dropdown(
textEditingController:
controller.pureRiskRatingLTEC),
],
),
),
8.horizontalSpace,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Text("R"),
4.verticalSpace,
dropdown(
textEditingController:
controller.pureRiskRatingRTEC),
],
),
),
],
),
20.verticalSpace,
headingText("In Place"),
8.verticalSpace,
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Text("Y"),
4.verticalSpace,
dropdown(textEditingController: controller.inPlaceYTEC),
],
),
),
8.horizontalSpace,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Text("N"),
4.verticalSpace,
dropdown(textEditingController: controller.inPlaceNTEC),
],
),
),
],
),
20.verticalSpace,
headingText("Residual Risk Rating"),
8.verticalSpace,
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Text("C"),
4.verticalSpace,
dropdown(
textEditingController:
controller.residualRiskRatingCTEC),
],
),
),
8.horizontalSpace,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Text("L"),
4.verticalSpace,
dropdown(
textEditingController:
controller.residualRiskRatingLTEC),
],
),
),
8.horizontalSpace,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Text("R"),
4.verticalSpace,
dropdown(
textEditingController:
controller.residualRiskRatingRTEC),
],
),
),
],
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.personsExposedToHazardTEC,
inputType: TextInputType.multiline,
textCapitalization: TextCapitalization.sentences,
heading: "Personal (s) Exposed to hazard",
hintText: "",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.riskIdentifiedTEC,
inputType: TextInputType.multiline,
textCapitalization: TextCapitalization.sentences,
heading: "Risk Identified",
hintText: "",
onChange: (_) {},
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.controlMeasuresRequiredTEC,
inputType: TextInputType.multiline,
textCapitalization: TextCapitalization.sentences,
heading: "Control Measures Required",
hintText: "",
onChange: (_) {},
),
20.verticalSpace,
Obx(
() => CustomAppButton(
buttonText: controller.isEditing() ? "Update" : "Save",
onTap: () => controller.submitButtonPressed(context),
),
),
],
),
),
);
});
}
Widget headingText(String text) => CustomTextWidget(
text: text,
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
);
Widget dropdown({
required TextEditingController textEditingController,
}) {
return SizedBox(
height: 48.r,
child: DropdownButtonFormField<String>(
value: textEditingController.text,
isDense: true,
onTap: () {
FocusScopeNode().unfocus();
},
dropdownColor: Colors.white,
decoration: InputDecoration(
contentPadding: REdgeInsets.symmetric(horizontal: 12),
border: OutlineInputBorder(
borderSide: BorderSide(
color: CustomAppColors.kLightGreyColor.withOpacity(0.2)),
borderRadius: 8.toRadius(),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: CustomAppColors.kLightGreyColor),
borderRadius: 8.toRadius(),
),
),
hint: Text(
"Select...",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 14.sp,
color: CustomAppColors.kLightTextColor,
),
),
items: controller.ratings
.map(
(e) => DropdownMenuItem(
value: e.toString(),
child: Text(e.toString()),
),
)
.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: (v) {
textEditingController.text = v ?? "1";
},
),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,141 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/models/clients/riskAssessmentResponse/InPlace.dart';
import 'package:ftc_mobile_app/models/clients/riskAssessmentResponse/PureRiskRating.dart';
import 'package:ftc_mobile_app/models/clients/riskAssessmentResponse/ResidualRiskRating.dart';
import 'package:ftc_mobile_app/models/clients/riskAssessmentResponse/RiskAssessmentData.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:get/get.dart';
class AddEditRiskAssessmentScreenController extends GetxController {
final GlobalKey<ScaffoldState> screenKey = GlobalKey<ScaffoldState>();
final ratings = List.generate(9, (i) => i + 1);
final hazardTEC = TextEditingController();
final personsExposedToHazardTEC = TextEditingController();
final riskIdentifiedTEC = TextEditingController();
final controlMeasuresRequiredTEC = TextEditingController();
final pureRiskRatingCTEC = TextEditingController(text: "1");
final pureRiskRatingLTEC = TextEditingController(text: "1");
final pureRiskRatingRTEC = TextEditingController(text: "1");
final residualRiskRatingCTEC = TextEditingController(text: "1");
final residualRiskRatingLTEC = TextEditingController(text: "1");
final residualRiskRatingRTEC = TextEditingController(text: "1");
final inPlaceYTEC = TextEditingController(text: "1");
final inPlaceNTEC = TextEditingController(text: "1");
///[isEditing] will be true if using [AddDetailsToNewBodyPointScreen] screen to edit issue details,
/// or say issueData is not null
final isEditing = false.obs;
String serviceUserId = "";
RiskAssessmentData? issueData;
@override
void onReady() {
if (issueData != null) {
isEditing.value = true;
hazardTEC.text = issueData!.hazard ?? "";
personsExposedToHazardTEC.text = issueData!.personsExposedToHazard ?? "";
}
super.onReady();
}
Future<void> submitButtonPressed(BuildContext context) async {
if (hazardTEC.text.trim().isEmpty) {
FrequentFunctions.showToast(message: "Hazard is required");
return;
}
if (personsExposedToHazardTEC.text.trim().isEmpty) {
FrequentFunctions.showToast(
message: "Personal (s) Exposed to hazard is required");
return;
}
if (riskIdentifiedTEC.text.trim().isEmpty) {
FrequentFunctions.showToast(message: "Risk Identified is required");
return;
}
if (controlMeasuresRequiredTEC.text.trim().isEmpty) {
FrequentFunctions.showToast(
message: "Control Measures Required is required");
return;
}
// var result = (isEditing.isFalse)
final result = await ClientService()
.createRiskAssesments(
data: RiskAssessmentData(
userId: serviceUserId,
hazard: hazardTEC.text.trim(),
personsExposedToHazard: personsExposedToHazardTEC.text.trim(),
riskIdentified: riskIdentifiedTEC.text.trim(),
coldMeasureRequired: controlMeasuresRequiredTEC.text.trim(),
pureRiskRating: PureRiskRating(
c: int.parse(pureRiskRatingCTEC.text.trim()),
l: int.parse(pureRiskRatingLTEC.text.trim()),
r: int.parse(pureRiskRatingRTEC.text.trim()),
),
residualRiskRating: ResidualRiskRating(
c: int.parse(residualRiskRatingCTEC.text.trim()),
l: int.parse(residualRiskRatingLTEC.text.trim()),
r: int.parse(residualRiskRatingRTEC.text.trim()),
),
inPlace: InPlace(
y: int.parse(inPlaceYTEC.text.trim()),
n: int.parse(inPlaceNTEC.text.trim()),
),
),
)
.showLoader();
if (result == true) {
Navigator.of(screenKey.currentContext!).pop(true);
} else {
FrequentFunctions.showToast(message: result);
}
// : await ClientService()
// .updateHealthIssueData(
// issueId: issueData!.id,
// categoryId: issueData!.bodyPointsCategory!.id,
// healthNote: healthNoteController.text.trim(),
// complaint: complaintController.text.trim())
// .showLoader();
//
// if (result is! String) {
// Navigator.of(context).pop(true);
// } else {
// if (result.isNotEmpty) {
// FrequentFunctions.showToast(message: result);
// }
// }
}
void removeFocus() {
FocusScope.of(screenKey.currentContext!).unfocus();
}
@override
void dispose() {
hazardTEC.dispose();
personsExposedToHazardTEC.dispose();
riskIdentifiedTEC.dispose();
controlMeasuresRequiredTEC.dispose();
pureRiskRatingCTEC.dispose();
pureRiskRatingLTEC.dispose();
pureRiskRatingRTEC.dispose();
residualRiskRatingCTEC.dispose();
residualRiskRatingLTEC.dispose();
residualRiskRatingRTEC.dispose();
inPlaceYTEC.dispose();
inPlaceNTEC.dispose();
Get.delete<AddEditRiskAssessmentScreenController>();
super.dispose();
}
}

View File

@@ -0,0 +1,110 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/models/clients/HealthIssuesDetailsModel.dart';
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import 'package:get/get.dart';
import '../../../controllers/clients/add_details_to_new_body_point_screen_controller.dart';
import '../../../ftc_mobile_app.dart';
import '../../custom_widgets/clients/category_subcategory_dropdowns_widget.dart';
class AddDetailsToNewBodyPointScreenArgs {
final UserData userData;
//If [issueData] is not null, then this screen will update its content instead
final HealthIssueDetailsModel? issueData;
AddDetailsToNewBodyPointScreenArgs({
required this.userData,
this.issueData,
});
}
class AddDetailsToNewBodyPointScreen extends StatefulWidget {
final AddDetailsToNewBodyPointScreenArgs args;
const AddDetailsToNewBodyPointScreen({Key? key, required this.args})
: super(key: key);
@override
State<AddDetailsToNewBodyPointScreen> createState() =>
_AddDetailsToNewBodyPointScreenState();
}
class _AddDetailsToNewBodyPointScreenState
extends State<AddDetailsToNewBodyPointScreen> {
final AddDetailsToNewBodyPointScreenController controller =
Get.put(AddDetailsToNewBodyPointScreenController());
@override
void initState() {
controller.serviceUserId = widget.args.userData.id!;
controller.issueData = widget.args.issueData;
super.initState();
}
@override
Widget build(BuildContext context) {
return Obx(() {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(context,
titleText: controller.isEditing()
? "Update Health Issue - ${widget.args.issueData!.bodyPointsCategory?.name}"
: "Add Health Issue"),
body: SafeArea(
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 16.r),
children: [
controller.isEditing()
? FrequentFunctions.noWidget
: 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.healthNoteController,
textCapitalization: TextCapitalization.sentences,
heading: "Health Note",
hintText: "Example: Eye Pain / Headache",
),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 6,
maxLines: 6,
controller: controller.complaintController,
inputType: TextInputType.multiline,
textCapitalization: TextCapitalization.sentences,
heading: "Complaint",
hintText: "Example: Minor Pain on right Side",
onChange: (_) {},
),
20.verticalSpace,
Obx(
() => CustomAppButton(
buttonText:
controller.isEditing() ? "Update Issue" : "Add Issue",
onTap: () => controller.submitButtonPressed(context),
),
),
],
),
),
);
});
}
@override
void dispose() {
Get.delete<AddDetailsToNewBodyPointScreenController>();
super.dispose();
}
}

View File

@@ -0,0 +1,183 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../controllers/clients/add_new_document_screen_controller.dart';
import '../../../ftc_mobile_app.dart';
class AddNewDocumentScreen extends StatefulWidget {
const AddNewDocumentScreen({Key? key}) : super(key: key);
@override
State<AddNewDocumentScreen> createState() => _AddNewDocumentScreenState();
}
class _AddNewDocumentScreenState extends State<AddNewDocumentScreen> {
final controller = Get.put(AddNewDocumentScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
// onBackButton: () => controller.backButtonPressed(),
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: controller.docIdReceived.value
? " Update Document"
: controller.viewOnly.value
? " View Document"
: " Add Document",
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
controller: controller.documentTitleController,
hintText: "Document title",
heading: "Title",
onChange: (_) {},
),
// ConsentScreenTextField(
// headingText: "Document title",
// hintText: "Title of Document",
// viewOnly: controller.viewOnly.value,
// fieldController: controller.documentTitleController),
20.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
controller: controller.documentDetailsController,
heading: "Document Details",
hintText: "Details Of Document",
minLines: 6,
maxLines: 6,
onChange: (_) {},
),
// ConsentScreenTextField(
// headingText: "Document Details",
// hintText: "Details Of Document",
// viewOnly: controller.viewOnly.isTrue,
// fieldController: controller.documentDetailsController),
20.verticalSpace,
// Text(
// "Upload document",
// style: TextStyle(
// fontSize: 14.sp,
// fontWeight: FontWeight.w400,
// color: CustomAppColors.kDarkBlueTextColor,
// ),
// ),
// 6.verticalSpace,
// Obx(() {
//
// }),
// SizedBox(
// width: 150.r,
// height: 32.r,
// child: const CustomAppButton(buttonText: "Choose file"),
// ),
controller.viewOnly.value
? controller.docFilePath.isNotEmpty
? Row(
children: [
SizedBox(
width: MediaQuery.of(context).size.width / 3,
child: CustomTextWidget(
text: "Document:",
fontSize: 20.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
isExpanded: false,
),
),
SizedBox(
width: MediaQuery.of(context).size.width / 2,
child: Obx(
() => CustomTextWidget(
text: controller.docFilePath.value
.split("/")
.last,
isExpanded: false,
),
),
),
],
)
: Container(
width: MediaQuery.of(context).size.width / 2,
)
: Obx(
() => Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
controller.docFilePath.isNotEmpty
? Expanded(
flex: 1,
child: SizedBox(
width:
MediaQuery.of(context).size.width / 2,
child: Obx(
() => CustomTextWidget(
text: controller.docFilePath.value
.split("/")
.last,
isExpanded: false,
),
),
),
)
: Container(
width: MediaQuery.of(context).size.width / 2,
),
Expanded(
flex: 1,
child: CustomAppButton(
buttonColor: CustomAppColors.kIconColor,
borderColor: CustomAppColors.kIconColor,
buttonText: controller.docIdReceived.value
? "Change Document File"
: "Add Document File",
onTap: controller.onFileChooseButtonTap,
),
),
],
),
),
32.verticalSpace,
Obx(
() => CustomAppButton(
buttonText: controller.docIdReceived.value
? "Update Document"
: controller.viewOnly.value
? "Ok"
: "Add Document",
onTap: () => controller.submitButtonPressed(),
),
),
5.verticalSpace,
],
),
),
),
);
}
@override
void dispose() {
Get.delete<AddNewDocumentScreenController>();
super.dispose();
}
}

View File

@@ -0,0 +1,237 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/add_new_recent_incident_screen_controller.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/models/clients/recent_incidents_model.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:get/get.dart';
import 'package:quill_html_editor/quill_html_editor.dart';
class AddNewRecentIncidentsScreenArgs {
final String? userId;
final RecentIncidentsModel? incidentsModel;
AddNewRecentIncidentsScreenArgs({this.userId, this.incidentsModel});
}
class AddNewRecentIncidentsScreen extends StatefulWidget {
final AddNewRecentIncidentsScreenArgs args;
const AddNewRecentIncidentsScreen({Key? key, required this.args})
: super(key: key);
@override
State<AddNewRecentIncidentsScreen> createState() =>
_AddNewRecentIncidentsScreenState();
}
class _AddNewRecentIncidentsScreenState
extends State<AddNewRecentIncidentsScreen> {
late final AddNewRecentIncidentScreenController controller;
@override
void initState() {
controller = Get.put(AddNewRecentIncidentScreenController(widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
onBackButton: () => controller.onBackPress(context),
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
controller.onBackPress(context);
// Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: widget.args.userId.isNotNullOrEmpty()
? 'Add Recent Incident'
: 'Update Recent Incident',
// text: 'Add New Recent Incidents',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: SafeArea(
child: Padding(
padding: REdgeInsets.symmetric(horizontal: 20.0),
child: Column(
children: [
Column(
children: [
// const CustomTextWidget(
// text: "Select Incident Date",
// textAlign: TextAlign.left,
// fontSize: 14,
// fontWeight: FontWeight.w500,
// ),
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.incidentDateTEC,
hintText: "Select Incident Date",
heading: "Select Incident Date",
isEnabled: false,
onChange: (_) {},
),
),
// InkWell(
// onTap: () => controller.selectDateFromPicker(
// context: context,
// maxDate: DateTime(DateTime.now().year + 1),
// minDate: DateTime(DateTime.now().year - 4)),
// child: Row(
// children: [
// Obx(
// () => CustomTextWidget(
// text: DateFormatter()
// .getHolidayDate(controller.selectedDate.value),
// isExpanded: false,
// fontWeight: FontWeight.w500,
// fontColor: CustomAppColors.kSecondaryColor,
// ),
// ),
// const Spacer(),
// const Icon(Icons.calendar_today_outlined),
// ],
// ),
// ),
],
),
// Container(
// padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 5.h),
// child: CustomTextFieldWidget(
// controller: controller.incidentTitleTEC,
// heading: "Incident Title"),
// ),
12.verticalSpace,
CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.incidentTitleTEC,
textCapitalization: TextCapitalization.words,
hintText: "Incident Title",
heading: "Incident Title",
onChange: (_) {},
),
12.verticalSpace,
ToolBar(
toolBarColor: Colors.cyan.shade50,
activeIconColor: Colors.green,
padding: const EdgeInsets.all(8),
iconSize: 20,
toolBarConfig: ToolBarStyle.values
.where((e) => [
ToolBarStyle.image,
ToolBarStyle.video,
].contains(e).not)
.toList(),
controller: controller.incidentDetailsQuillFieldController,
),
Expanded(
child: LayoutBuilder(builder: (_, c) {
return QuillHtmlEditor(
hintText: 'Recent Incident Details',
controller: controller.incidentDetailsQuillFieldController,
isEnabled: true,
minHeight: c.maxHeight,
text: widget.args.incidentsModel?.note ?? "",
hintTextAlign: TextAlign.start,
padding: REdgeInsets.only(left: 10, top: 5, right: 5),
hintTextPadding:
REdgeInsets.only(left: 10, top: 5, right: 5),
backgroundColor: Colors.grey.withOpacity(0.1),
onFocusChanged: (hasFocus) {
debugPrint('has focus $hasFocus');
if (hasFocus && FocusScope.of(context).hasFocus) {
controller.removeFocus();
}
},
// onTextChanged: (text) =>
// debugPrint('widget text change $text'),
// onEditorCreated: () => debugPrint('Editor has been loaded'),
// onEditingComplete: (s) => debugPrint('Editing completed $s'),
onEditorResized: (height) =>
debugPrint('Editor resized $height'),
onSelectionChanged: (sel) =>
debugPrint('${sel.index},${sel.length}'),
loadingBuilder: (context) {
return Center(
child: CircularProgressIndicator(
strokeWidth: 0.4.r,
),
);
},
);
}),
),
24.verticalSpace,
Obx(() {
return IgnorePointer(
ignoring: controller.isButtonEnabled.isFalse,
child: CustomAppButton(
buttonText: widget.args.incidentsModel == null
? "Submit"
: "Update",
buttonColor: controller.isButtonEnabled()
? CustomAppColors.kSecondaryColor
: CustomAppColors.kLightGreyColor,
borderColor: controller.isButtonEnabled()
? CustomAppColors.kSecondaryColor
: CustomAppColors.kLightGreyColor,
onTap: () {
controller.submitButtonPressed(context);
},
),
);
}),
],
),
),
),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,163 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/all_care_notes_screen_contorller.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/models/clients/allCareNotes/CarePlans.dart';
import 'package:ftc_mobile_app/utilities/enums/care_note_form_type.dart';
import 'package:get/get.dart';
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
class AllCareNotesScreenArgs {
final String serviceUserId;
AllCareNotesScreenArgs({required this.serviceUserId});
}
class AllCareNotesScreen extends StatefulWidget {
final AllCareNotesScreenArgs args;
const AllCareNotesScreen({super.key, required this.args});
@override
State<AllCareNotesScreen> createState() => _AllCareNotesScreenState();
}
class _AllCareNotesScreenState extends State<AllCareNotesScreen> {
final AllCareNotesScreenController controller =
Get.put(AllCareNotesScreenController());
@override
void initState() {
super.initState();
//Important
controller.serviceUserId = widget.args.serviceUserId;
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
controller.getCareNotesList();
});
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
onBackButton: () => controller.backButtonPressed(context),
backgroundColor: CustomAppColors.kSmokeColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'All Care Notes',
),
body: SafeArea(
child: _listView(),
),
);
}
Widget _listView() {
return Obx(() {
final list = controller.notesList();
final canLoadMore = controller.canLoadMore.value;
return SmartRefresher(
controller: controller.listRC,
scrollController: controller.listSC,
header: FrequentFunctions.waterDropHeader,
enablePullUp: canLoadMore,
onRefresh: controller.onRefresh,
onLoading: controller.onLoading,
child: (list.isEmpty)
? Container(
color: Colors.white,
child: const Center(
child: Text("No data found"),
),
)
: ListView.separated(
itemCount: list.length,
itemBuilder: (_, index) {
final item = list[index];
return _listItem(item);
},
separatorBuilder: (_, i) => 8.verticalSpace,
),
);
});
}
Widget _listItem(CarePlan item) {
final isMoodRatingForm =
item.noteType == CareNotesFormType.moodRatingForm.apiValue;
return InkWell(
onTap: () {
_onListItemTap(item);
},
child: Container(
decoration: const BoxDecoration(color: Colors.white),
padding: REdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
CustomTextWidget(
text: item.noteType ?? "",
textAlign: TextAlign.left,
fontSize: 16.sp,
fontWeight: FontWeight.w500,
),
(item.eventDateTime == null)
? FrequentFunctions.noWidget
: CustomTextWidget(
text: DateFormatter.ddMMyyyyhhmmFormat(
DateTime.fromMillisecondsSinceEpoch(
item.eventDateTime!)
.toLocal()),
fontColor: Colors.grey,
textAlign: TextAlign.left,
fontSize: 10.sp,
),
(item.isHTML != true)
? CustomTextWidget(
text: isMoodRatingForm
? (item.title ?? "")
: (item.noteDetails ?? ""),
textAlign: TextAlign.left,
fontColor: Colors.black54,
fontSize: 12.sp,
maxLines: 3,
fontWeight: FontWeight.w400,
).paddingOnly(top: 6.r)
: FrequentFunctions.noWidget,
(item.flag == true)
? CustomTextWidget(
text: "Handover Review",
fontColor: Colors.green,
textAlign: TextAlign.left,
fontSize: 14.sp,
fontWeight: FontWeight.w500,
).paddingOnly(top: 6.r)
: FrequentFunctions.noWidget,
],
),
),
const Icon(Icons.keyboard_arrow_right_rounded)
],
),
),
);
}
void _onListItemTap(CarePlan item) {
Navigator.pushNamed(context, CustomRouteNames.kCareNoteDetailScreenRoute,
arguments: item);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,259 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/dialogs/app_dialogs.dart';
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import 'package:get/get.dart';
import 'package:grouped_list/grouped_list.dart';
import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
import '../../../ftc_mobile_app.dart';
import '../../../models/appointmentsListResponse/AppointmentsListResponse.dart';
import '../../custom_widgets/my_circle_image.dart';
class AppointmentScreen extends StatefulWidget {
final UserData userData;
const AppointmentScreen({Key? key, required this.userData}) : super(key: key);
@override
State<AppointmentScreen> createState() => _AppointmentScreenState();
}
class _AppointmentScreenState extends State<AppointmentScreen> {
final controller = Get.put(AppointmentScreenController());
@override
void initState() {
controller.serviceUserId = widget.userData.id ?? "";
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: 'Appointments',
),
body: Column(
children: [
16.verticalSpace,
MyCircleImage(
imageSize: 80.r,
url: "${WebUrls.baseUrl}${widget.userData.profilePictureUrl}",
errorWidget: CustomImageWidget(
imagePath: AssetsManager.kPersonMainIcon,
height: 80.r,
width: 80.r,
),
),
16.verticalSpace,
CustomTextWidget(
text: widget.userData.displayName,
fontSize: 14.sp,
fontWeight: FontWeight.w600),
16.verticalSpace,
Expanded(child: _appointmentsList()),
],
),
);
}
Widget _appointmentsList() {
return ObxValue((RxList<AppointmentsListResponseData> appointments) {
return SmartRefresher(
key: const ValueKey("refreshListAppointments"),
controller: controller.listRC,
scrollController: controller.listSC,
enablePullUp: false,
header: FrequentFunctions.waterDropHeader,
onRefresh: controller.onRefresh,
child: (appointments.isEmpty)
? FrequentFunctions.centerText(text: "No appointments yet")
: GroupedListView<AppointmentsListResponseData, int>(
elements: appointments(),
groupBy: (d) {
return DateTime.fromMillisecondsSinceEpoch(d.appointmentDate!)
.toLocal()
.isAfter(DateTime.now())
? 0
: 1;
},
groupSeparatorBuilder: (int groupByValue) {
final label = groupByValue == 0
? "Upcoming Appointments"
: "Previous Appointments";
return _buildGroupSeparatorWidget(label);
},
itemBuilder: (context, element) =>
_buildItemWidget(appointments.indexOf(element), element),
separator: 8.verticalSpace,
groupComparator: (item1, item2) {
return item1.compareTo(item2);
},
),
);
}, controller.appointments);
}
Widget _buildGroupSeparatorWidget(String susTag) {
return Container(
padding: EdgeInsets.only(left: 20.w),
child: CustomTextWidget(
alignment: Alignment.centerLeft,
isExpanded: false,
text: susTag,
fontSize: 16.sp,
fontWeight: FontWeight.w700),
);
}
Widget _buildItemWidget(int index, AppointmentsListResponseData data) {
return AppointmentWidget(data: data);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}
class AppointmentWidget extends StatelessWidget {
final AppointmentsListResponseData data;
const AppointmentWidget({
super.key,
required this.data,
});
@override
Widget build(BuildContext context) {
return Container(
// height: 150,
alignment: Alignment.center,
margin: EdgeInsets.only(left: 20.w, bottom: 5.h, right: 10.w, top: 10.h),
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 5.h),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: Colors.white,
border: Border(
left: BorderSide(color: Get.theme.primaryColor, width: 6),
top: BorderSide(color: Get.theme.primaryColor, width: 1),
right: BorderSide(color: Get.theme.primaryColor, width: 1),
bottom: BorderSide(color: Get.theme.primaryColor, width: 1),
),
borderRadius: BorderRadius.all(
Radius.circular(2.0.r),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CustomTextWidget(
text: data.staff?.name ?? "",
fontWeight: FontWeight.bold,
isExpanded: false),
CustomTextWidget(
text: data.appointmentStartTime ?? "",
fontSize: 10.sp,
fontWeight: FontWeight.w500,
fontColor: CustomAppColors.kLightTextColor,
isExpanded: false),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: CustomTextWidget(
text: data.appointmentDetails ?? "",
fontSize: 12.sp,
isExpanded: false,
maxLines: 2,
textAlign: TextAlign.left,
),
),
10.horizontalSpace,
CustomTextWidget(
text: DateFormatter().getAppointmentTime(
DateTime.fromMillisecondsSinceEpoch(data.appointmentDate!)),
fontSize: 14.sp,
isExpanded: false,
fontWeight: FontWeight.w600,
),
],
),
10.verticalSpace,
SizedBox(
height: 32.r,
child: CustomAppButton(
onTap: () {
AppDialog.showAppointmentDetailDialog(data: data);
},
buttonText: "View Appointment",
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
),
),
// SizedBox(
// height: 5.h,
// ),
// const ViewAppointmentButtonWidget(
// text: "+Add Note",
// textColor: CustomAppColors.kSecondaryColor,
// buttonColor: CustomAppColors.kPrimaryColor,
// borderColor: CustomAppColors.kSecondaryColor,
// ),
],
),
);
}
}
class ViewAppointmentButtonWidget extends StatelessWidget {
const ViewAppointmentButtonWidget({
super.key,
required this.text,
required this.textColor,
required this.buttonColor,
this.borderColor,
});
final String text;
final Color textColor;
final Color buttonColor;
final Color? borderColor;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {},
child: Container(
width: MediaQuery.of(context).size.width,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 5.h),
margin: EdgeInsets.symmetric(horizontal: 2.w),
decoration: BoxDecoration(
border: borderColor != null ? Border.all(color: borderColor!) : null,
color: buttonColor,
borderRadius: BorderRadius.circular(2.r),
),
child: CustomTextWidget(
text: text,
fontColor: textColor,
fontSize: 14.sp,
fontWeight: FontWeight.w700,
),
),
);
}
}

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();
}
}

View File

@@ -0,0 +1,191 @@
import 'dart:convert';
import 'dart:developer';
import 'package:flutter/foundation.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/utilities/enums/body_parts.dart';
import 'package:ftc_mobile_app/utilities/enums/care_note_form_type.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:get/get.dart';
import 'package:webview_flutter/webview_flutter.dart';
import '../../../controllers/clients/care_note_detail_screen_controller.dart';
import '../../../models/clients/allCareNotes/CarePlans.dart';
import '../../custom_widgets/human_body_mapper_widget.dart';
class CareNoteDetailScreen extends StatefulWidget {
final CarePlan data;
const CareNoteDetailScreen({super.key, required this.data});
static const meta =
"""<meta name="viewport" content="width=device-width, initial-scale=1">
""";
static const css = """<style>
strong {
display: block;
font-size: 16px;
color: black;
font-weight: bold;
}
p, small {
display: block;
font-size: 14px;
}
table {
width: 100%;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
border-color: rgba(0,0,0,0.1);
}
td {padding: 10px;}
tr:nth-child(odd) {
background-color: rgba(0,0,0,0.1);
}
tr:nth-child(even) {
background-color: rgba(255,255,255,1);
}
</style>
""";
@override
State<CareNoteDetailScreen> createState() => _CareNoteDetailScreenState();
}
class _CareNoteDetailScreenState extends State<CareNoteDetailScreen> {
late final CareNoteDetailScreenController controller;
final commonHtmlStyle = {
"strong": Style(
display: Display.block,
fontSize: FontSize(16),
fontWeight: FontWeight.w700,
),
"p, small": Style(
display: Display.block,
fontSize: FontSize(14),
),
};
@override
void initState() {
super.initState();
controller = Get.put(CareNoteDetailScreenController(widget.data));
}
@override
Widget build(BuildContext context) {
if (kDebugMode) {
log("CarePlan data: ${jsonEncode(widget.data.toJson())}");
}
final isMoodRatingForm =
widget.data.noteType == CareNotesFormType.moodRatingForm.apiValue;
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
automaticallyImplyLeading: false,
title: const CustomTextWidget(
text: 'View Care Note',
fontColor: Colors.white,
textAlign: TextAlign.left,
),
backgroundColor: Theme.of(context).primaryColor,
centerTitle: false,
actions: const [
CloseButton(color: Colors.white),
],
),
body: SafeArea(
child: (widget.data.isHTML == true)
? Obx(() {
return (controller.isLoadingWebPage())
? Center(
child: SizedBox.square(
dimension: 48.r,
child: const CircularProgressIndicator()),
)
: ListView(
children: [
Obx(() {
return SizedBox(
height: controller.webViewHeight(),
child: WebViewWidget(
controller: controller.webViewController),
);
}),
// Flexible(child: WebViewWidget(controller: controller)),
bodyPoints(),
],
);
})
: ListView(
children: [
Html(
data: controller.headerHtml,
style: {
"strong": Style(
display: Display.block,
fontSize: FontSize(16),
fontWeight: FontWeight.w700,
),
},
),
Html(
data: (widget.data.isHTML == true)
? widget.data.noteDetails
: """<p>
<strong>Title</strong>
<small>${widget.data.title ?? ""}</small>
</p>
${(!isMoodRatingForm && widget.data.noteDetails.isNotNullOrEmpty()) ? "<p><small>${widget.data.noteDetails!}</small></p>" : ''}
${(!isMoodRatingForm && widget.data.flag == true) ? """<p style="color:green;font-size:14px;">Handover Review</p>""" : ''}
""",
shrinkWrap: true,
style: commonHtmlStyle,
),
(widget.data.healthIssueId?.category == null)
? FrequentFunctions.noWidget
: Html(
data: """<p>
<strong>Effected Body Part</strong>
<small>${widget.data.healthIssueId!.category!.name}</small>
</p>""",
style: commonHtmlStyle,
),
bodyPoints().paddingOnly(top: 20.r),
],
),
),
);
}
Widget bodyPoints() {
if (widget.data.healthIssueId?.category == null) {
return FrequentFunctions.noWidget;
}
final Map<BodyPart, Color?> map = {};
BodyPart.values
.where((e) => e.apiValue == widget.data.healthIssueId!.category!.enumed)
.forEach((e) {
map[e] = Colors.red;
});
return HumanBodyWidget(
width: Get.width * 0.8,
visibleBodyPoints: map,
);
}
@override
void dispose() {
Get.delete<CareNoteDetailScreenController>();
super.dispose();
}
}

View File

@@ -0,0 +1,142 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/models/clients/care_note_category.dart';
import 'package:ftc_mobile_app/view/custom_widgets/clients/CareNoteOptionCard.dart';
import 'package:get/get.dart';
import 'all_care_notes_screen.dart';
class CareNotesScreenArgs {
final String serviceUserId;
CareNotesScreenArgs({required this.serviceUserId});
}
class CareNotesScreen extends StatefulWidget {
final CareNotesScreenArgs args;
const CareNotesScreen({super.key, required this.args});
@override
State<CareNotesScreen> createState() => _CareNotesScreenState();
}
class _CareNotesScreenState extends State<CareNotesScreen> {
final CareNotesScreenController controller =
Get.put(CareNotesScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
onBackButton: () => controller.backButtonPressed(context),
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () => controller.backButtonPressed(context),
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'Care Notes',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: SafeArea(
child: Padding(
padding: REdgeInsets.symmetric(horizontal: 18),
child: ListView(
children: [
Row(
children: [
Expanded(
child: AspectRatio(
aspectRatio: 1,
child: InkWell(
onTap: () {
Navigator.pushNamed(context,
CustomRouteNames.kAllCareNotesScreenRoute,
arguments: AllCareNotesScreenArgs(
serviceUserId: widget.args.serviceUserId));
},
child: const CareNoteOptionCard(
icon: AssetsManager.kIcGeneral,
name: "All Care Notes",
),
),
),
),
const Expanded(child: SizedBox.shrink()),
],
),
16.verticalSpace,
CustomTextWidget(
alignment: Alignment.centerLeft,
isExpanded: false,
text: "Common Options",
fontSize: 16.sp,
fontWeight: FontWeight.w700),
10.verticalSpace,
_categoriesList(),
// Flexible(child: ),
],
),
),
),
);
}
Widget _categoriesList() {
return GridView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, mainAxisSpacing: 6.r, crossAxisSpacing: 6.r),
itemCount: controller.categories.length,
itemBuilder: (_, index) {
return InkWell(
onTap: () => _onCategoryCardTap(controller.categories[index]),
child: CareNoteOptionCard(
icon: controller.categories[index].iconPath ?? "",
name: controller.categories[index].category ?? "",
),
);
},
);
}
// ---------Methods-----------
void _onCategoryCardTap(CareNoteCategory category) {
Navigator.pushNamed(
context,
CustomRouteNames.kCareNotesSubcategoriesScreenRoute,
arguments: CareNotesSubcategoriesScreenArgs(
serviceUserId: widget.args.serviceUserId,
category: category,
),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,235 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/careNoteFormControllers/common_care_note_forms_controller.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/utilities/enums/care_note_form_type.dart';
import 'package:get/get.dart';
import '../../../controllers/clients/care_notes_subcategories_screen_controller.dart';
import '../../../models/clients/care_note_category.dart';
class CareNotesSubcategoriesScreenArgs {
final String serviceUserId;
final CareNoteCategory category;
CareNotesSubcategoriesScreenArgs(
{required this.serviceUserId, required this.category});
}
class CareNotesSubcategoriesScreen extends StatefulWidget {
final CareNotesSubcategoriesScreenArgs args;
const CareNotesSubcategoriesScreen({super.key, required this.args});
@override
State<CareNotesSubcategoriesScreen> createState() =>
_CareNotesSubcategoriesScreenState();
}
class _CareNotesSubcategoriesScreenState
extends State<CareNotesSubcategoriesScreen> {
final CareNotesSubcategoriesScreenController controller =
Get.put(CareNotesSubcategoriesScreenController());
List<Subcategories> get _subcategories =>
widget.args.category.subcategories ?? [];
@override
Widget build(BuildContext context) {
return CustomScaffold(
onBackButton: () => controller.backButtonPressed(context),
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: widget.args.category.category ?? "",
),
// appBar: CustomAppBar(
// leadingButton: Container(),
// showBoxShadow: false,
// titleWidget: Row(
// children: [
// InkWell(
// onTap: () => controller.backButtonPressed(context),
// child: CustomImageWidget(
// imagePath: AssetsManager.kBackIcon,
// height: 11.53.h,
// width: 8.66.w,
// ),
// ),
// SizedBox(
// width: 15.w,
// ),
// CustomTextWidget(
// text: widget.args.category.category ?? "",
// isExpanded: false,
// fontSize: 16.sp,
// fontWeight: FontWeight.w700,
// fontColor: CustomAppColors.kDarkBlueTextColor,
// ),
// ],
// ),
// ),
body: Padding(
padding: REdgeInsets.symmetric(horizontal: 18),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
10.verticalSpace,
Expanded(child: _categoriesList()),
],
),
),
);
}
Widget _categoriesList() {
return GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, mainAxisSpacing: 6.r, crossAxisSpacing: 6.r),
itemCount: _subcategories.length,
itemBuilder: (_, index) {
return InkWell(
onTap: () {
_onSubcategoryCardTap(_subcategories[index]);
},
child: Card(
elevation: 2,
shadowColor: CustomAppColors.kLightGreyColor,
surfaceTintColor: Colors.white,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4).r),
child: Padding(
padding: REdgeInsets.all(8),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
CustomImageWidget(
imagePath: _subcategories[index].iconPath ?? "",
height: 24.r,
width: 24.r,
),
12.verticalSpace,
CustomTextWidget(
text: _subcategories[index].name ?? "",
alignment: Alignment.center,
isExpanded: false,
fontWeight: FontWeight.w600,
fontColor: CustomAppColors.kDarkBlueTextColor,
fontSize: 14.sp)
],
),
),
),
);
},
);
}
void _onSubcategoryCardTap(Subcategories subcategory) {
final args = CommonCareNoteFormArgs(
serviceUserId: widget.args.serviceUserId,
noteType: subcategory.apiValue!);
switch (CareNotesFormType.fromText(subcategory.formType ?? "")) {
case CareNotesFormType.injuryHealthIssueForm:
Navigator.pushNamed(
context,
CustomRouteNames.kInjuryHealthIssueFormScreenRoute,
arguments: args,
);
break;
case CareNotesFormType.weightHeightForm:
Navigator.pushNamed(
context,
CustomRouteNames.kWeightHeightFormScreenRoute,
arguments: args,
);
break;
case CareNotesFormType.healthAppointmentForm:
Navigator.pushNamed(
context,
CustomRouteNames.kHealthAppointmentsFormScreenRoute,
arguments: args,
);
break;
case CareNotesFormType.observationsForm:
Navigator.pushNamed(
context,
CustomRouteNames.kObservationsFormScreenRoute,
arguments: args,
);
break;
case CareNotesFormType.safeguardingForm:
Navigator.pushNamed(
context,
CustomRouteNames.kSafeguardingFormScreenRoute,
arguments: args,
);
break;
case CareNotesFormType.showeringBathForm:
Navigator.pushNamed(
context,
CustomRouteNames.kShoweringBathFormScreenRoute,
arguments: args,
);
break;
case CareNotesFormType.toiletingNoteForm:
Navigator.pushNamed(
context,
CustomRouteNames.kToiletingNoteFormScreenRoute,
arguments: args,
);
break;
case CareNotesFormType.moodRatingForm:
Navigator.pushNamed(
context,
CustomRouteNames.kMoodRatingFormScreenRoute,
arguments: args,
);
break;
case CareNotesFormType.ABCForm:
Navigator.pushNamed(
context,
CustomRouteNames.kABCFormScreenRoute,
arguments: args,
);
break;
case CareNotesFormType.physicalInterventionForm:
Navigator.pushNamed(
context,
CustomRouteNames.kPhysicalInterventionFormScreenRoute,
arguments: args,
);
break;
case CareNotesFormType.consentCapacityForm:
Navigator.pushNamed(
context,
CustomRouteNames.kConsentCapacityFormScreenRoute,
arguments: args,
);
break;
case CareNotesFormType.nutritionHydrationForm:
Navigator.pushNamed(
context,
CustomRouteNames.kNutritionHydrationFormScreenRoute,
arguments: args,
);
break;
default:
Navigator.pushNamed(
context,
CustomRouteNames.kFreeTextEntriesScreenRoute,
arguments: args,
);
break;
}
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,227 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../ftc_mobile_app.dart';
import '../../../models/profileData/user_data.dart';
import '../../custom_widgets/my_circle_image.dart';
class CarePlanMenuScreen extends StatefulWidget {
final UserData userData;
const CarePlanMenuScreen({Key? key, required this.userData})
: super(key: key);
@override
State<CarePlanMenuScreen> createState() => _CarePlanMenuScreenState();
}
class _CarePlanMenuScreenState extends State<CarePlanMenuScreen> {
late final CarePlanMenuScreenController controller;
@override
void initState() {
controller = Get.put(CarePlanMenuScreenController(data: widget.userData));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
onBackButton: () => controller.backButtonPressed(context),
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBarTitleOnly(
context,
titleText: "Care Plan Menu",
),
body: Obx(() {
if (controller.serviceUser() == null) {
return FrequentFunctions.centerText(text: "User detail not found");
}
final detail = controller.serviceUser()!;
return ListView(
children: [
16.verticalSpace,
UnconstrainedBox(
child: MyCircleImage(
imageSize: 80.r,
url: "${WebUrls.baseUrl}${detail.profilePictureUrl ?? ""}",
errorWidget: CustomImageWidget(
imagePath: AssetsManager.kPersonMainIcon,
height: 80.r,
width: 80.r,
),
),
),
SizedBox(height: 16.h),
CustomTextWidget(
text: detail.displayName,
fontSize: 14.sp,
fontWeight: FontWeight.w600),
16.verticalSpace,
Container(
padding: EdgeInsets.only(left: 20.w),
child: CustomTextWidget(
alignment: Alignment.centerLeft,
isExpanded: false,
text: "Care Plans",
fontSize: 16.sp,
fontWeight: FontWeight.w700),
),
// 5.verticalSpace,
// const LineWidget(
// text: "Key Contacts",
// ),
5.verticalSpace,
LineWidget(
text: "Care Notes",
onItemTap: () {
Navigator.pushNamed(
controller.screenKey.currentContext!,
CustomRouteNames.kCareNotesScreenRoute,
arguments: CareNotesScreenArgs(
serviceUserId: controller.serviceUser()!.id!),
);
},
),
5.verticalSpace,
LineWidget(
text: "Risk Assesments",
onItemTap: () {
Navigator.pushNamed(
context,
CustomRouteNames.kRiskAssessmentsTemplateScreenRoute,
arguments: controller.serviceUser(),
);
}),
5.verticalSpace,
LineWidget(
text: "Consent and capacity",
onItemTap: () {
Navigator.pushNamed(
context,
CustomRouteNames
.kConsentAndCapacityQuestionnaireScreenRoute,
arguments: controller.serviceUser()!,
);
}),
5.verticalSpace,
LineWidget(
text: "Current Health Issues",
onItemTap: () {
Navigator.pushNamed(
context,
CustomRouteNames.kCurrentHealthIssuesScreenRoute,
arguments: controller.serviceUser()!,
);
}),
5.verticalSpace,
// LineWidget(
// text: "Life History & Goals",
// onItemTap: () {
// Navigator.pushNamed(
// context,
// CustomRouteNames.kLifeHistoryAndGoalsScreenRoute,
// arguments: controller.serviceUser.value,
// );
// }),
// 5.verticalSpace,
// LineWidget(
// text: "Support Plan",
// onItemTap: () {
// Navigator.pushNamed(
// context,
// CustomRouteNames.kSupportPlanScreenRoute,
// arguments: controller.serviceUser.value,
// );
// }),
// 5.verticalSpace,
// const LineWidget(
// text: "Medication Profile",
// ),
// 5.verticalSpace,
LineWidget(
text: "PBS Plan",
onItemTap: () {
Navigator.pushNamed(
context,
CustomRouteNames.kPBSPlanScreenRoute,
arguments: controller.serviceUser.value,
);
}),
5.verticalSpace,
LineWidget(
text: "Recent Incidents",
onItemTap: () {
Navigator.pushNamed(
context, CustomRouteNames.kRecentIncidentsScreenRoute,
arguments: controller.serviceUser.value);
}),
5.verticalSpace,
LineWidget(
text: "Documents",
onItemTap: () {
Navigator.pushNamed(
context,
CustomRouteNames.kDocumentsListScreenRoute,
arguments: controller.serviceUser.value,
);
}),
],
);
}),
);
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}
class LineWidget extends StatelessWidget {
const LineWidget({
super.key,
required this.text,
this.onItemTap,
});
final Function? onItemTap;
final String text;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
if (onItemTap != null) {
onItemTap!();
}
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 15.w, vertical: 2.h),
padding: EdgeInsets.symmetric(horizontal: 10.r, vertical: 12.r),
decoration: BoxDecoration(
border: Border.all(color: CustomAppColors.kSecondaryColor)),
child: Row(
children: [
CustomTextWidget(
text: text,
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 16.sp),
const Spacer(),
Icon(
Icons.keyboard_arrow_right_rounded,
color: CustomAppColors.kSecondaryColor,
size: 18.r,
),
],
),
),
);
}
}

View File

@@ -0,0 +1,321 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:ftc_mobile_app/view/custom_widgets/my_circle_image.dart';
import 'package:get/get.dart';
import '../../../models/profileData/user_data.dart';
import 'all_care_notes_screen.dart';
class ClientProfileScreen extends StatefulWidget {
final UserData userData;
const ClientProfileScreen({Key? key, required this.userData})
: super(key: key);
@override
State<ClientProfileScreen> createState() => _ClientProfileScreenState();
}
class _ClientProfileScreenState extends State<ClientProfileScreen> {
late final ClientProfileScreenController controller;
@override
void initState() {
controller = Get.put(ClientProfileScreenController(data: widget.userData));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
onBackButton: () => controller.backButtonPressed(context),
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () => controller.backButtonPressed(context),
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
const SizedBox(
width: 15,
),
CustomTextWidget(
text: 'Client: ${controller.serviceUser()?.displayName ?? ""}',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor),
],
),
),
body: Obx(() {
if (controller.serviceUser() == null) {
return FrequentFunctions.centerText(text: "User detail not found");
}
final detail = controller.serviceUser()!;
return SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(height: 16.h),
MyCircleImage(
imageSize: 80.r,
url: "${WebUrls.baseUrl}${detail.profilePictureUrl ?? ""}",
errorWidget: CustomImageWidget(
imagePath: AssetsManager.kPersonMainIcon,
height: 53.h,
width: 53.w,
),
),
16.verticalSpace,
CustomTextWidget(
text: detail.displayName,
fontSize: 14.sp,
fontWeight: FontWeight.w600),
16.verticalSpace,
BuildDetailRow(
title: 'Contact Number',
value: detail.modelId?.phoneNo ?? "",
),
BuildDetailRow(
title: 'Home Address',
value: detail.modelId?.homeAddress ?? ""),
BuildDetailRow(
title: 'Next of Kin',
value: detail.modelId?.suFamilyHead ?? ""),
const BuildDetailRow(title: 'Diagnosis History', value: ''),
BuildRoundOutlinedBox(
context: context,
child: BuildDiagnosisHistoryList(
history:
(detail.modelId?.diagnosises.isNotNullOrEmpty() == true)
? detail.modelId!.diagnosises.first.diagnosisText
: "",
date: (detail.modelId?.aboutPatient.aboutDate
.isNotNullOrEmpty() ==
true)
? DateFormatter().getAppointmentTime(
detail.modelId!.aboutPatient.aboutDate)
: "",
),
),
const BuildDetailRow(title: 'About the Patient', value: ''),
BuildRoundOutlinedBox(
context: context,
child: BuildDiagnosisHistoryList(
history: detail.modelId?.aboutPatient.aboutText ?? "",
date: (detail.modelId?.aboutPatient.aboutDate
.isNotNullOrEmpty() ==
true)
? DateFormatter().getAppointmentTime(
detail.modelId!.aboutPatient.aboutDate)
: "",
),
),
16.verticalSpace,
BuildIconButton(
iconPath: AssetsManager.kNotesIcon,
text: 'Notes',
route: CustomRouteNames.kAllCareNotesScreenRoute,
arguments: AllCareNotesScreenArgs(
serviceUserId: controller.serviceUser()!.id!),
),
BuildIconButton(
iconPath: AssetsManager.kCarePlanIcon,
text: 'Care Plan',
route: CustomRouteNames.kCarePlanMenuScreenRoute,
arguments: controller.serviceUser()!,
),
BuildIconButton(
iconPath: AssetsManager.kCalendarAppointmentIcon,
text: 'Appointments',
route: CustomRouteNames.kAppointmentsScreenRoute,
arguments: controller.serviceUser()!,
),
BuildIconButton(
iconPath: AssetsManager.kPhotoGalleryIcon,
text: 'Photo Gallery',
route: CustomRouteNames.kPhotoGalleryScreenRoute,
arguments: controller.serviceUser()!,
),
],
),
);
}),
);
}
}
class BuildIconButton extends StatelessWidget {
const BuildIconButton({
super.key,
required this.iconPath,
required this.text,
required this.route,
required this.arguments,
});
final String iconPath;
final String text;
final String route;
final dynamic arguments;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
if (route.isNotEmpty) {
Navigator.pushNamed(context, route, arguments: arguments);
}
},
child: Container(
margin: EdgeInsets.symmetric(vertical: 5.h, horizontal: 25.w),
padding: EdgeInsets.symmetric(horizontal: 10.r, vertical: 8.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2.r),
border: Border.all(
color: CustomAppColors.kLightGreyColor.withOpacity(0.5))),
child: Row(
children: [
CustomImageWidget(
imagePath: iconPath,
height: 20.r,
width: 20.r,
),
12.horizontalSpace,
CustomTextWidget(
text: text,
isExpanded: false,
fontWeight: FontWeight.w600,
fontColor: CustomAppColors.kDarkBlueTextColor,
fontSize: 14.sp),
const Spacer(),
Icon(
Icons.arrow_forward_ios_rounded,
size: 12.sp,
)
],
),
),
);
}
}
class BuildDiagnosisHistoryList extends StatelessWidget {
const BuildDiagnosisHistoryList({
super.key,
required this.date,
required this.history,
});
final String date;
final String history;
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomTextWidget(
text: date,
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 10.sp,
fontColor: CustomAppColors.kLightGreyColor,
),
CustomTextWidget(
alignment: Alignment.centerLeft,
textAlign: TextAlign.left,
text: history,
isExpanded: false,
fontSize: 10.sp,
fontColor: CustomAppColors.kBlackColor,
),
],
);
}
}
class BuildRoundOutlinedBox extends StatelessWidget {
const BuildRoundOutlinedBox({
super.key,
required this.context,
required this.child,
});
final BuildContext context;
final Widget child;
@override
Widget build(BuildContext context) {
return Container(
alignment: Alignment.centerLeft,
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 22.r),
padding: EdgeInsets.all(10.sp),
decoration: BoxDecoration(
border: Border.all(color: CustomAppColors.kLightGreyColor),
borderRadius: BorderRadius.circular(10.r),
),
child: child,
);
}
}
class BuildDetailRow extends StatelessWidget {
const BuildDetailRow({
super.key,
required this.title,
required this.value,
});
final String title;
final String value;
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 20.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 4,
child: CustomTextWidget(
isExpanded: false,
text: '$title: ',
fontWeight: FontWeight.w600,
textAlign: TextAlign.left,
fontColor: CustomAppColors.kDarkBlueTextColor,
fontSize: 14.sp,
),
),
Expanded(
flex: 6,
child: CustomTextWidget(
text: value,
isExpanded: false,
maxLines: 2,
textAlign: TextAlign.right,
fontWeight: FontWeight.w600,
fontColor: CustomAppColors.kLightTextColor,
fontSize: 14.sp),
)
],
),
);
}
}

View File

@@ -0,0 +1,298 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/new_client_module_controllers/add_new_pbs_plan_screen_controller.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/models/clients/PBSPlanModel.dart';
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import 'package:get/get.dart';
import 'package:quill_html_editor/quill_html_editor.dart';
class AddNewPBSPlanScreenArgs {
final UserData userData;
final PbsList? pbsData;
final bool viewOnly;
AddNewPBSPlanScreenArgs({
required this.userData,
this.pbsData,
this.viewOnly = false,
});
}
class AddNewPBSPlanScreen extends StatefulWidget {
final AddNewPBSPlanScreenArgs args;
const AddNewPBSPlanScreen({Key? key, required this.args}) : super(key: key);
@override
State<AddNewPBSPlanScreen> createState() => _AddNewPBSPlanScreenState();
}
class _AddNewPBSPlanScreenState extends State<AddNewPBSPlanScreen> {
late final AddNewPbsPlanScreenController controller;
@override
void initState() {
controller = Get.put(AddNewPbsPlanScreenController(widget.args));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
onBackButton: () => controller.backButtonPressed(context, null),
screenKey: controller.screenKey,
backgroundColor: CustomAppColors.kPrimaryColor,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
controller.backButtonPressed(context, null);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: (widget.args.viewOnly)
? "View PBS Plan"
: widget.args.pbsData == null
? 'Add New PBS Plan'
: 'Update PBS Plan',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: SafeArea(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: SingleChildScrollView(
child: Obx(
() => Column(
children: [
//About Plan
SeparateQuillEditorForFields(
headingText: 'About Plan',
headingBackGroundColor:
CustomAppColors.kLightGreyColor.withAlpha(150),
headingTextColor: CustomAppColors.kBlackColor,
// noteHintText: "About Plan hint",
noteText: controller.addPbsPlanModel.value.aboutPlan,
quillEditorController: controller
.addPbsPlanModel.value.aboutPlanQuillController,
viewOnly: (widget.args.viewOnly),
),
Divider(
color: CustomAppColors.kLightGreyColor,
),
//Management of behavioural presentation
10.verticalSpace,
SeparateQuillEditorForFields(
headingText: 'Management of behavioural presentation',
headingBackGroundColor: CustomAppColors.kDarkestGreenColor,
// noteHintText: "Management of behavioural presentation hint",
noteText:
controller.addPbsPlanModel().managementOfBehaviorPlan,
quillEditorController: controller.addPbsPlanModel.value
.managementOfBehaviouralPresentationQuillController,
viewOnly: (widget.args.viewOnly),
),
Divider(
color: CustomAppColors.kLightGreyColor,
),
//Secondary Prevention
10.verticalSpace,
SeparateQuillEditorForFields(
headingText: 'Secondary Prevention',
headingBackGroundColor: CustomAppColors.kDarkYellowColor,
// noteHintText: "Secondary Prevention hint",
noteText:
controller.addPbsPlanModel.value.secondaryPrevention,
quillEditorController: controller.addPbsPlanModel.value
.secondaryPreventionQuillController,
viewOnly: (widget.args.viewOnly),
),
Divider(
color: CustomAppColors.kLightGreyColor,
),
//Reactive Strategies
10.verticalSpace,
SeparateQuillEditorForFields(
headingText: 'Reactive Strategies',
headingBackGroundColor: CustomAppColors.kDarkRedColor,
// noteHintText: "Reactive Strategies hint",
noteText:
controller.addPbsPlanModel.value.reactiveStrategies,
quillEditorController: controller.addPbsPlanModel.value
.reactiveStrategiesQuillController,
viewOnly: (widget.args.viewOnly),
),
Divider(
color: CustomAppColors.kLightGreyColor,
),
//Post Incident Support- Recovery
10.verticalSpace,
SeparateQuillEditorForFields(
headingText: 'Post Incident Support- Recovery',
headingBackGroundColor: const Color(0xff3c78d8),
// noteHintText: "Post Incident Support- Recovery hint",
noteText:
controller.addPbsPlanModel.value.postIncidentSupport,
quillEditorController: controller.addPbsPlanModel.value
.postIncidentSupportRecoveryQuillController,
viewOnly: (widget.args.viewOnly),
),
//Submit Button
(widget.args.viewOnly)
? FrequentFunctions.noWidget
: Obx(
() => CustomAppButton(
buttonText: widget.args.pbsData == null
? "Submit"
: "Update",
buttonColor: controller.enableSubmitButton.isTrue
? CustomAppColors.kSecondaryColor
: CustomAppColors.kLightGreyColor,
borderColor: controller.enableSubmitButton.isTrue
? CustomAppColors.kSecondaryColor
: CustomAppColors.kLightGreyColor,
onTap: () {
if (controller.enableSubmitButton.isTrue) {
controller.submitButtonPressed();
}
},
),
),
10.verticalSpace,
],
),
),
),
),
),
);
}
}
class SeparateQuillEditorForFields extends StatefulWidget {
const SeparateQuillEditorForFields({
super.key,
required this.headingText,
this.headingTextColor = CustomAppColors.kWhiteColor,
required this.headingBackGroundColor,
this.headingBorderColor = CustomAppColors.kLightTextColor,
required this.noteText,
required this.quillEditorController,
// required this.noteHintText,
required this.viewOnly,
});
final String headingText;
final Color headingTextColor;
final Color headingBackGroundColor;
final Color headingBorderColor;
final String noteText;
// final String noteHintText;
final bool viewOnly;
final QuillEditorController quillEditorController;
@override
State<SeparateQuillEditorForFields> createState() =>
_SeparateQuillEditorForFieldsState();
}
class _SeparateQuillEditorForFieldsState
extends State<SeparateQuillEditorForFields> {
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
decoration: BoxDecoration(
color: widget.headingBackGroundColor,
border: Border.all(color: widget.headingBorderColor)),
padding: REdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: CustomTextWidget(
text: widget.headingText,
fontColor: widget.headingTextColor,
textAlign: TextAlign.left,
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
),
(widget.viewOnly)
? FrequentFunctions.noWidget
: ToolBar(
toolBarColor: Colors.cyan.shade50,
activeIconColor: Colors.green,
padding: const EdgeInsets.all(8),
iconSize: 20,
controller: widget.quillEditorController,
),
Container(
padding: EdgeInsets.only(bottom: 10.h),
child: QuillHtmlEditor(
hintText: "Type here...",
controller: widget.quillEditorController,
isEnabled: !widget.viewOnly,
minHeight: 250,
text: widget.noteText,
hintTextAlign: TextAlign.start,
hintTextStyle: TextStyle(fontSize: 14.sp, color: Colors.black54),
padding: const EdgeInsets.only(left: 10, top: 5, right: 5),
hintTextPadding: const EdgeInsets.only(left: 10, top: 5, right: 5),
backgroundColor: widget.headingBackGroundColor.withAlpha(25),
onFocusChanged: (hasFocus) {
// if (hasFocus && FocusScope.of(context).hasFocus) {
// controller.removeFocus();
// }
},
onTextChanged: (text) {
// controller.enableDisableSubmitButton();
},
// onEditorCreated: () => debugPrint('Editor has been loaded'),
onEditingComplete: (s) {
// controller.enableDisableSubmitButton();
},
onEditorResized: (height) => debugPrint('Editor resized $height'),
onSelectionChanged: (sel) =>
debugPrint('${sel.index},${sel.length}'),
loadingBuilder: (context) {
return const Center(
child: CircularProgressIndicator(
strokeWidth: 0.4,
),
);
},
),
),
],
);
}
@override
void dispose() {
// Get.delete<AddNewPbsPlanScreenController>();
super.dispose();
}
}

View File

@@ -0,0 +1,93 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../ftc_mobile_app.dart';
class CrisisManagementScreen extends StatefulWidget {
const CrisisManagementScreen({Key? key}) : super(key: key);
@override
State<CrisisManagementScreen> createState() => _CrisisManagementScreenState();
}
class _CrisisManagementScreenState extends State<CrisisManagementScreen> {
final CrisisManagementScreenController controller =
Get.put(CrisisManagementScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'Crisis management',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: SingleChildScrollView(
child: Column(
children: [
CustomTextWidget(
text: "What crisis looks like to me",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took"),
SizedBox(height: 8.h),
CustomTextWidget(
text: "How can I effectively be supported?",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus."),
SizedBox(height: 8.h),
],
),
),
),
);
}
}

View File

@@ -0,0 +1,12 @@
export 'crisis_management_screen.dart';
export 'future_plans_screen.dart';
export 'health_full_body_map_screen.dart';
export 'health_screen.dart';
export 'introduction_screen.dart';
export 'medication_screen.dart';
export 'my_current_plan_screen.dart';
export 'mental_health_screen.dart';
export 'my_interests_screen.dart';
export 'support_plan_screen.dart';
export 'overview_screen.dart';
export 'things_i_want_you_to_help_me_screen.dart';

View File

@@ -0,0 +1,93 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../ftc_mobile_app.dart';
class FuturePlansScreen extends StatefulWidget {
const FuturePlansScreen({Key? key}) : super(key: key);
@override
State<FuturePlansScreen> createState() => _FuturePlansScreenState();
}
class _FuturePlansScreenState extends State<FuturePlansScreen> {
final FuturePlansScreenController controller = Get.put(FuturePlansScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'Future Plans',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: SingleChildScrollView(
child: Column(
children: [
CustomTextWidget(
text: "What are my future plans?",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took"),
SizedBox(height: 8.h),
CustomTextWidget(
text: "How am I going to achieve them?",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus."),
SizedBox(height: 8.h),
],
),
),
),
);
}
}

View File

@@ -0,0 +1,566 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../ftc_mobile_app.dart';
class HealthFullBodyMapScreen extends StatefulWidget {
const HealthFullBodyMapScreen({super.key});
@override
State<HealthFullBodyMapScreen> createState() => _HealthFullBodyMapState();
}
class _HealthFullBodyMapState extends State<HealthFullBodyMapScreen> {
HealthFullBodyMapScreenController controller =
Get.put(HealthFullBodyMapScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'Health Full Body Map',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 8.h),
SizedBox(
width: MediaQuery.of(context).size.width,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
listHeading(),
SizedBox(
height: 15.h,
),
InkWell(
onTap: () {
controller.firstPointVisible.value = false;
controller.secondPointVisible.value = false;
controller.thirdPointVisible.value = false;
controller.fourthPointVisible.value = false;
controller.fifthPointVisible.value = false;
controller.sixthPointVisible.value = false;
},
child: SizedBox(
height: MediaQuery.of(context).size.height / 1.22,
width: MediaQuery.of(context).size.width,
child: Stack(
children: [
const Positioned(
// left: 60,
bottom: 0,
child: CustomImageWidget(
imagePath: AssetsManager.kEclipseIcon),
),
const Positioned(
left: 100,
top: 5,
child: CustomImageWidget(
imagePath: AssetsManager.kManBodyImage),
),
pointWidgets(
leftPosition: 162,
topPosition: 10,
colorOfPoint: CustomAppColors.kRedColor,
onPointTap: () {
controller.firstPointVisible.toggle();
controller.secondPointVisible.value = false;
controller.thirdPointVisible.value = false;
controller.fourthPointVisible.value = false;
controller.fifthPointVisible.value = false;
controller.sixthPointVisible.value = false;
},
),
pointWidgets(
leftPosition: 218,
topPosition: 90,
colorOfPoint: CustomAppColors.kSecondaryColor,
onPointTap: () {
controller.secondPointVisible.toggle();
controller.firstPointVisible.value = false;
controller.thirdPointVisible.value = false;
controller.fourthPointVisible.value = false;
controller.fifthPointVisible.value = false;
controller.sixthPointVisible.value = false;
},
),
pointWidgets(
leftPosition: 118,
topPosition: 140,
colorOfPoint:
CustomAppColors.kRedColor.withAlpha(250),
onPointTap: () {
controller.firstPointVisible.value = false;
controller.secondPointVisible.value = false;
controller.fourthPointVisible.value = false;
controller.fifthPointVisible.value = false;
controller.sixthPointVisible.value = false;
controller.thirdPointVisible.toggle();
},
),
pointWidgets(
leftPosition: 150,
topPosition: 155,
colorOfPoint:
CustomAppColors.kRedColor.withAlpha(250),
onPointTap: () {
controller.firstPointVisible.value = false;
controller.secondPointVisible.value = false;
controller.thirdPointVisible.value = false;
controller.fifthPointVisible.value = false;
controller.sixthPointVisible.value = false;
controller.fourthPointVisible.toggle();
},
),
pointWidgets(
leftPosition: 145,
topPosition: 320,
colorOfPoint:
CustomAppColors.kRedColor.withAlpha(250),
onPointTap: () {
controller.firstPointVisible.value = false;
controller.secondPointVisible.value = false;
controller.thirdPointVisible.value = false;
controller.fourthPointVisible.value = false;
controller.sixthPointVisible.value = false;
controller.fifthPointVisible.toggle();
},
),
pointWidgets(
leftPosition: 190,
bottomPosition: 105,
colorOfPoint:
CustomAppColors.kRedColor.withAlpha(250),
onPointTap: () {
controller.firstPointVisible.value = false;
controller.secondPointVisible.value = false;
controller.thirdPointVisible.value = false;
controller.fourthPointVisible.value = false;
controller.fifthPointVisible.value = false;
controller.sixthPointVisible.toggle();
},
),
triangleView(
leftPosition: 158,
topPosition: 22,
visibility: controller.firstPointVisible,
),
issueDetailsDialog(
topPosition: 28,
leftPosition: 15,
showTriangle: false,
visibility: controller.firstPointVisible,
healthNote: "Headache",
selectedDropDownValue:
controller.firstPointSelectedDropdownValue,
complaint: "Issue No. 01, Issue No. 02",
lastUpdate: "Jul/0/2023",
),
triangleView(
leftPosition: 213,
topPosition: 102,
visibility: controller.secondPointVisible,
),
issueDetailsDialog(
topPosition: 108,
leftPosition: 35,
showTriangle: false,
visibility: controller.secondPointVisible,
healthNote: "Shoulders Muscle Pain",
selectedDropDownValue:
controller.secondPointSelectedDropdownValue,
complaint: "Issue No. 01, Issue No. 02",
lastUpdate: "Jul/0/2023",
),
triangleView(
leftPosition: 114,
topPosition: 152,
visibility: controller.thirdPointVisible,
),
issueDetailsDialog(
topPosition: 158,
leftPosition: 10,
showTriangle: false,
visibility: controller.thirdPointVisible,
healthNote: "Elbow Pain",
selectedDropDownValue:
controller.thirdPointSelectedDropdownValue,
complaint: "Issue No. 01, Issue No. 02",
lastUpdate: "Jul/0/2023",
),
triangleView(
leftPosition: 146,
topPosition: 168,
visibility: controller.fourthPointVisible,
),
issueDetailsDialog(
topPosition: 175,
leftPosition: 10,
showTriangle: false,
visibility: controller.fourthPointVisible,
healthNote: "Stomach Pain",
selectedDropDownValue:
controller.fourthPointSelectedDropdownValue,
complaint: "Issue No. 01, Issue No. 02",
lastUpdate: "Jul/0/2023",
),
triangleView(
leftPosition: 140,
topPosition: 333,
visibility: controller.fifthPointVisible,
),
issueDetailsDialog(
topPosition: 340,
leftPosition: 10,
showTriangle: false,
visibility: controller.fifthPointVisible,
healthNote: "Knee Pain",
selectedDropDownValue:
controller.fifthPointSelectedDropdownValue,
complaint: "Issue No. 01, Issue No. 02",
lastUpdate: "Jul/0/2023",
),
triangleView(
leftPosition: 185,
bottomPosition: 95,
visibility: controller.sixthPointVisible,
),
issueDetailsDialog(
topPosition: 430,
leftPosition: 10,
showTriangle: false,
visibility: controller.sixthPointVisible,
healthNote: "Foot Pain",
selectedDropDownValue:
controller.sixthPointSelectedDropdownValue,
complaint: "Issue No. 01, Issue No. 02",
lastUpdate: "Jul/0/2023",
),
],
),
),
),
SizedBox(
height: 15.h,
),
],
),
),
],
),
),
),
);
}
Positioned triangleView({
double? topPosition,
double? bottomPosition,
double? rightPosition,
double? leftPosition,
required RxBool visibility,
bool colorShow = false,
}) {
return Positioned(
top: topPosition,
left: leftPosition,
right: rightPosition,
bottom: bottomPosition,
child: Obx(
() => Container(
color: colorShow ? CustomAppColors.kGreenColor : null,
child: Visibility(
visible: visibility.value,
child: const CustomImageWidget(
imagePath: AssetsManager.kTriangleIcon,
),
),
),
),
);
}
Positioned pointWidgets({
double? topPosition,
double? bottomPosition,
double? rightPosition,
double? leftPosition,
required Color colorOfPoint,
required VoidCallback onPointTap,
}) {
return Positioned(
top: topPosition,
left: leftPosition,
right: rightPosition,
bottom: bottomPosition,
child: InkWell(
onTap: onPointTap,
child: CircleAvatar(
radius: 5,
backgroundColor: colorOfPoint,
child: const CustomTextWidget(
text: "",
isExpanded: false,
),
),
),
);
}
Widget issueDetailsDialog({
double? topPosition,
double? bottomPosition,
double? rightPosition,
double? leftPosition,
bool showTriangle = true,
required RxBool visibility,
required String healthNote,
required String complaint,
required String lastUpdate,
required RxString selectedDropDownValue,
}) {
return Obx(
() => Positioned(
top: topPosition,
left: leftPosition,
right: rightPosition,
bottom: bottomPosition,
child: Visibility(
visible: visibility.value,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Visibility(
visible: showTriangle,
child: const CustomImageWidget(
imagePath: AssetsManager.kTriangleIcon,
),
),
Container(
width: 300,
height: 90,
decoration: BoxDecoration(
border: Border.all(color: CustomAppColors.kLightGreyColor),
color: CustomAppColors.kWhiteColor,
boxShadow: [
BoxShadow(
color: CustomAppColors.kLightGreyColor.withOpacity(0.5),
spreadRadius: 2,
blurRadius: 5,
offset: const Offset(0, 3),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
padding: EdgeInsets.only(left: 10.sp),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomTextWidget(
text: 'Health Note',
isExpanded: false,
fontSize: 12.sp,
),
CustomTextWidget(
text: healthNote,
fontSize: 14.sp,
fontWeight: FontWeight.bold,
isExpanded: false),
],
),
),
Align(
alignment: Alignment.topRight,
child: Container(
alignment: Alignment.topRight,
margin: EdgeInsets.only(right: 5.w, top: 5.h),
height: 30.h,
width: 60.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.r),
color: selectedDropDownValue.value
.contains("Expired")
? CustomAppColors.kRedColor.withAlpha(80)
: CustomAppColors.kGreenColor.withAlpha(80),
),
child: FittedBox(
fit: BoxFit.scaleDown,
child: DropdownButtonHideUnderline(
child: DropdownButton(
padding: const EdgeInsets.all(0),
borderRadius: BorderRadius.circular(5.r),
isExpanded: false,
items: controller.activeList
.map(
(e) => DropdownMenuItem(
value: e,
child: CustomTextWidget(
alignment: Alignment.center,
fontColor: selectedDropDownValue
.value
.contains("Expired")
? CustomAppColors.kRedColor
: CustomAppColors.kGreenColor,
text: e.toString(),
isExpanded: false,
),
),
)
.toList(),
value: selectedDropDownValue.value,
onChanged: (value) {
selectedDropDownValue.value =
value.toString();
},
),
),
),
),
),
// ),
],
),
Divider(color: CustomAppColors.kLightGreyColor, height: 5),
Container(
padding: EdgeInsets.only(left: 17.sp, top: 3.sp),
child: Text.rich(
textAlign: TextAlign.left,
TextSpan(
children: [
TextSpan(
text: "Complaint: ",
style: TextStyle(
fontSize: 12.sp, fontWeight: FontWeight.w600),
),
TextSpan(
text: complaint,
style: TextStyle(
fontSize: 12.sp, fontWeight: FontWeight.w400),
),
],
),
),
),
Container(
padding: EdgeInsets.only(left: 17.sp, top: 3.sp),
child: Text.rich(
textAlign: TextAlign.left,
TextSpan(
children: [
TextSpan(
text: "Last Update: ",
style: TextStyle(
fontSize: 12.sp, fontWeight: FontWeight.w600),
),
TextSpan(
text: lastUpdate,
style: TextStyle(
fontSize: 12.sp, fontWeight: FontWeight.w400),
),
],
),
),
),
],
),
),
],
),
),
),
);
}
Widget listHeading() {
return Container(
decoration: const BoxDecoration(
border: Border(
top: BorderSide(
color: CustomAppColors.kSmokeColor,
),
bottom: BorderSide(color: CustomAppColors.kSmokeColor),
),
),
child: Container(
padding: const EdgeInsets.only(left: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
decoration: BoxDecoration(
color: CustomAppColors.kBlueColor.withAlpha(150),
border: Border.all(color: CustomAppColors.kBlueColor),
borderRadius: BorderRadius.circular(50.r),
),
padding:
const EdgeInsets.only(right: 5, left: 5, top: 5, bottom: 5),
child: CustomTextWidget(
textAlign: TextAlign.left,
text: "All Issues",
isExpanded: false,
fontWeight: FontWeight.w400,
fontSize: 14.sp),
),
Container(
padding: const EdgeInsets.only(right: 0, top: 10, bottom: 10),
child: const CustomTextWidget(
textAlign: TextAlign.left,
text: "Head Pain",
isExpanded: false,
fontWeight: FontWeight.w400),
),
Container(
padding: const EdgeInsets.only(right: 0, top: 10, bottom: 10),
child: CustomTextWidget(
text: "Nose Bone fracture",
isExpanded: false,
fontWeight: FontWeight.w400,
fontSize: 14.sp),
),
],
),
),
);
}
}

View File

@@ -0,0 +1,107 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../ftc_mobile_app.dart';
class HealthScreen extends StatefulWidget {
const HealthScreen({Key? key}) : super(key: key);
@override
State<HealthScreen> createState() => _HealthScreenState();
}
class _HealthScreenState extends State<HealthScreen> {
final HealthScreenController controller = Get.put(HealthScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'Health',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: SingleChildScrollView(
child: Column(
children: [
CustomTextWidget(
text: "What are we worried about and why?",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took"),
SizedBox(height: 8.h),
CustomTextWidget(
text: "What can we do to support?",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus."),
SizedBox(height: 140.h),
Padding(
padding: EdgeInsets.zero,
child: CustomAppButton(
buttonText: ConstantText.kViewFullBodyMap,
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: (){
Navigator.pushNamed(context, CustomRouteNames.kHealthFullBodyMapScreenRoute);
},
),
),
],
),
),
),
);
}
}

View File

@@ -0,0 +1,124 @@
import 'package:flutter/material.dart';
import '../../../../ftc_mobile_app.dart';
class ClientIntroductionScreen extends StatefulWidget {
const ClientIntroductionScreen({super.key});
@override
State<ClientIntroductionScreen> createState() => _ClientIntroductionScreenState();
}
class _ClientIntroductionScreenState extends State<ClientIntroductionScreen> {
ClientsIntroductionScreenController controller = ClientsIntroductionScreenController();
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(width: 15.w,),
CustomTextWidget(
text: "Introduction",
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Column(
children: [
// ClipRRect(
// borderRadius: BorderRadius.circular(50.r),
// child: CustomImageWidget(
// imagePath: FrequentFunctions
// .userModel.value.profilePictureUrl.isNotEmpty
// ? "${WebUrls.baseUrl}${FrequentFunctions.userModel.value.profilePictureUrl}"
// : AssetsManager.kPersonMainIcon,
// imageColor: FrequentFunctions
// .userModel.value.profilePictureUrl.isNotEmpty
// ? null
// : CustomAppColors.kLightTextColor,
// height: 80.h,
// width: 80.w,
// ),
// ),
SizedBox(height: 16.h),
CustomTextWidget(
text: 'user',
fontSize: 14.sp,
fontWeight: FontWeight.w600),
SizedBox(height: 16.h),
const Row(
children: [
Expanded(child: BuildDetailSingleItem(title: 'Email', value: "jaylon.n@ftcservices.com",)),
Expanded(child: BuildDetailSingleItem(title: 'Contact Number', value: "+44 (0) 00 0000 0000",)),
],
),
const Row(
children: [
Expanded(child: BuildDetailSingleItem(title: 'NI Number', value: "QQ 123456 C",)),
Expanded(child: BuildDetailSingleItem(title: 'DOB', value:"15/11/1996")),
],
),
const Row(
children: [
Expanded(child: BuildDetailSingleItem(title: 'Post Code', value: "GL55 8PN",)),
Expanded(child: BuildDetailSingleItem(title: 'Kin', value:"12PO025")),
],
),
const Row(
children: [
BuildDetailSingleItem(title: 'Address', value: "Gloucester, 1-2 Street Name",),
],
),
SizedBox(height: 16.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus."),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took"),
SizedBox(height: 8.h),
],
),
),
),
),
);
}
}

View File

@@ -0,0 +1,152 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../ftc_mobile_app.dart';
class MedicationScreen extends StatefulWidget {
const MedicationScreen({super.key});
@override
State<MedicationScreen> createState() => _MedicationScreenState();
}
class _MedicationScreenState extends State<MedicationScreen> {
final MedicationScreenController controller =
Get.put(MedicationScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
onBackButton:()=> controller.backButtonPressed(context),
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap:()=> controller.backButtonPressed(context),
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'Medication',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: SingleChildScrollView(
child: Column(
children: [
totalMedicinesNameRowField(
normalText: "Total medicines:", boldText: "2"),
SizedBox(height: 4.h),
SizedBox(height: 24.h),
medicationHeading(headingText: "Pregabalin 50mg"),
SizedBox(height: 24.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took"),
SizedBox(height: 8.h),
Divider(),
SizedBox(height: 8.h),
medicationHeading(headingText: "Lamotrigene"),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took"),
SizedBox(height: 8.h),
],
),
),
),
);
}
ListTile medicationHeading({required String headingText}) {
return ListTile(
contentPadding: EdgeInsets.only(left: 12.w, right: 0.w),
title: CustomTextWidget(
text: headingText,
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
// tileColor: Colors.black.withOpacity(0.2),
trailing: SizedBox(
width: 60.w,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
InkWell(
onTap: () {},
child: Container(
padding: EdgeInsets.all(1.sp),
decoration: BoxDecoration(
color: CustomAppColors.kYellowColor.withOpacity(0.5),
borderRadius: BorderRadius.circular(50.r),
),
child: const Icon(Icons.edit,color: CustomAppColors.kDarkYellowColor,)),
),
SizedBox(width: 3.w,),
InkWell(
onTap: () {},
child: Container(
padding: EdgeInsets.all(1.sp),
decoration: BoxDecoration(
color: CustomAppColors.kRedColor.withOpacity(0.5),
borderRadius: BorderRadius.circular(50.r),
),
child: const Icon(Icons.delete,color: CustomAppColors.kRedColor,)),
),
],
),
),
);
}
Row totalMedicinesNameRowField({required String boldText, required String normalText}) {
return Row(
children: [
CustomTextWidget(
text: normalText,
isExpanded: false,
fontWeight: FontWeight.w400,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
CustomTextWidget(
text: boldText,
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
],
);
}
}

View File

@@ -0,0 +1,93 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../ftc_mobile_app.dart';
class MentalHealthScreen extends StatefulWidget {
const MentalHealthScreen({Key? key}) : super(key: key);
@override
State<MentalHealthScreen> createState() => _MentalHealthScreenState();
}
class _MentalHealthScreenState extends State<MentalHealthScreen> {
final MentalHealthScreenController controller = Get.put(MentalHealthScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'Mental Health',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: SingleChildScrollView(
child: Column(
children: [
CustomTextWidget(
text: "the current presentation of mental health",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took"),
SizedBox(height: 8.h),
CustomTextWidget(
text: "Need Support to my current mental health",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus."),
SizedBox(height: 8.h),
],
),
),
),
);
}
}

View File

@@ -0,0 +1,93 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../ftc_mobile_app.dart';
class MyCurrentPlanScreen extends StatefulWidget {
const MyCurrentPlanScreen({Key? key}) : super(key: key);
@override
State<MyCurrentPlanScreen> createState() => _MyCurrentPlanScreenState();
}
class _MyCurrentPlanScreenState extends State<MyCurrentPlanScreen> {
final MyCurrentPlanScreenController controller = Get.put(MyCurrentPlanScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'My current plan',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: SingleChildScrollView(
child: Column(
children: [
CustomTextWidget(
text: "My current plan",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took"),
SizedBox(height: 8.h),
CustomTextWidget(
text: "Current support that I need",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus."),
SizedBox(height: 8.h),
],
),
),
),
);
}
}

View File

@@ -0,0 +1,93 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../ftc_mobile_app.dart';
class MyInterestsScreen extends StatefulWidget {
const MyInterestsScreen({Key? key}) : super(key: key);
@override
State<MyInterestsScreen> createState() => _MyInterestsScreenState();
}
class _MyInterestsScreenState extends State<MyInterestsScreen> {
final MyInterestsScreenController controller = Get.put(MyInterestsScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'My Interests',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: SingleChildScrollView(
child: Column(
children: [
CustomTextWidget(
text: "Things I like doing",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took"),
SizedBox(height: 8.h),
CustomTextWidget(
text: "How I can support these activities?",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus."),
SizedBox(height: 8.h),
],
),
),
),
);
}
}

View File

@@ -0,0 +1,94 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../ftc_mobile_app.dart';
class OverviewScreen extends StatefulWidget {
const OverviewScreen({Key? key}) : super(key: key);
@override
State<OverviewScreen> createState() => _OverviewScreenState();
}
class _OverviewScreenState extends State<OverviewScreen> {
final OverViewScreenController controller =
Get.put(OverViewScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'Overview (What I want you to know about me)',
isExpanded: false,
fontSize: 13.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: SingleChildScrollView(
child: Column(
children: [
CustomTextWidget(
text: "What I want you to know about me",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took"),
SizedBox(height: 8.h),
CustomTextWidget(
text: "Current support that I need",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus."),
SizedBox(height: 8.h),
],
),
),
),
);
}
}

View File

@@ -0,0 +1,106 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../ftc_mobile_app.dart';
class SupportPlanScreen extends StatefulWidget {
const SupportPlanScreen({Key? key}) : super(key: key);
@override
State<SupportPlanScreen> createState() => _SupportPlanScreenState();
}
class _SupportPlanScreenState extends State<SupportPlanScreen> {
SupportPlanScreenController controller =
Get.put(SupportPlanScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(width: 15.w,),
CustomTextWidget(
text: 'Support Plan Menu',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Center(
child: SingleChildScrollView(
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(height: 16.h),
LineWidget(
text: "Medications",
onItemTap: () {
Navigator.pushNamed(context,
CustomRouteNames.kMedicationScreenRoute);
}),
SizedBox(height: 5.h,),
LineWidget(text: "Mental Health",onItemTap: (){
Navigator.pushNamed(context, CustomRouteNames.kMentalHealthScreenRoute);
}),
SizedBox(height: 5.h,),
LineWidget(text: "Future Plans",onItemTap: (){
Navigator.pushNamed(context, CustomRouteNames.kFuturePlansScreenRoute);
}),
SizedBox(height: 5.h,),
LineWidget(text: "Introduction",onItemTap: (){
Navigator.pushNamed(context, CustomRouteNames.kClientsIntroductionScreenRoute);
}),
SizedBox(height: 5.h,),
LineWidget(text: "Overview",onItemTap: (){
Navigator.pushNamed(context, CustomRouteNames.kOverViewScreenRoute);
}),
SizedBox(height: 5.h,),
LineWidget(text: "My Current Plan",onItemTap:(){
Navigator.pushNamed(context, CustomRouteNames.kMyCurrentPlanScreenRoute);
}),
SizedBox(height: 5.h,),
LineWidget(text: "Things I want you to help me with",onItemTap: (){
Navigator.pushNamed(context, CustomRouteNames.kThingsIWantYouToHelpScreenRoute);
}),
SizedBox(height: 5.h,),
LineWidget(text: "My interests",onItemTap: (){
Navigator.pushNamed(context, CustomRouteNames.kMyInterestsScreenRoute);
}),
SizedBox(height: 5.h,),
LineWidget(text: "Health",onItemTap: (){
Navigator.pushNamed(context, CustomRouteNames.kHealthScreenRoute);
}),
SizedBox(height: 5.h,),
LineWidget(text: "Crisis Management",onItemTap: (){
Navigator.pushNamed(context, CustomRouteNames.kCrisisManagementScreenRoute);
}),
SizedBox(height: 5.h,),
],
),
),
),
);
}
}

View File

@@ -0,0 +1,93 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../ftc_mobile_app.dart';
class ThingsIWantYouToHelpScreen extends StatefulWidget {
const ThingsIWantYouToHelpScreen({Key? key}) : super(key: key);
@override
State<ThingsIWantYouToHelpScreen> createState() => _ThingsIWantYouToHelpScreenState();
}
class _ThingsIWantYouToHelpScreenState extends State<ThingsIWantYouToHelpScreen> {
final ThingsIWantYouToHelpMeWithScreenController controller =
Get.put(ThingsIWantYouToHelpMeWithScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'Things I want you to help me with',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: SingleChildScrollView(
child: Column(
children: [
CustomTextWidget(
text: "Things I want you to help me with",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took"),
SizedBox(height: 8.h),
CustomTextWidget(
text: "How I can help?",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
SizedBox(height: 8.h),
CustomTextWidget(
fontSize: 14.sp,
textAlign: TextAlign.left,
isExpanded: false,
text:
"It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus."),
SizedBox(height: 8.h),
],
),
),
),
);
}
}

View File

@@ -0,0 +1,317 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import '../../../ftc_mobile_app.dart';
import '../../../models/clients/consent_details_model.dart';
import '../../../models/profileData/user_data.dart';
class ConsentAndCapacityAddNewFormScreenArgs {
final UserData userData;
final ConsentDetailsModel? consentData;
ConsentAndCapacityAddNewFormScreenArgs({
required this.userData,
this.consentData,
});
}
class ConsentAndCapacityAddNewFormScreen extends StatefulWidget {
final ConsentAndCapacityAddNewFormScreenArgs args;
const ConsentAndCapacityAddNewFormScreen({Key? key, required this.args})
: super(key: key);
@override
State<ConsentAndCapacityAddNewFormScreen> createState() =>
_ConsentAndCapacityAddNewFormScreenState();
}
class _ConsentAndCapacityAddNewFormScreenState
extends State<ConsentAndCapacityAddNewFormScreen> {
final controller = Get.put(ConsentAndCapacityAddNewFormScreenController());
@override
void initState() {
controller.isForUpdate.value = (widget.args.consentData != null);
controller.firstNameController.text =
widget.args.userData.modelId?.suFirstMiddleName ?? "";
controller.lastNameController.text =
widget.args.userData.modelId?.suLastName ?? "";
controller.phoneController.text =
widget.args.userData.modelId?.phoneNo ?? "";
controller.emailController.text =
widget.args.userData.modelId?.suEmailWork ?? "";
controller.genderController.text =
widget.args.userData.modelId?.suSex ?? "";
controller.dobController.text = (widget.args.userData.modelId?.suDob ==
null)
? ""
: DateFormat("MMM/dd/yyyy").format(widget.args.userData.modelId!.suDob);
controller.ageController.text = widget.args.userData.modelId?.suAge ?? "";
controller.descriptionController.text =
widget.args.consentData?.description ?? "";
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
onBackButton: () => controller.backButtonPressed(context),
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Column(
children: [
Row(
children: [
InkWell(
onTap: () => controller.backButtonPressed(context),
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
15.horizontalSpace,
Obx(
() => CustomTextWidget(
text: controller.isForUpdate.value
? 'Update Consent And Capacity'
: 'Consent And Capacity',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
),
],
),
CustomTextWidget(
alignment: Alignment.topLeft,
textAlign: TextAlign.left,
text: ' Add New Form',
isExpanded: false,
fontSize: 12.sp,
fontColor: CustomAppColors.kLightGreyColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: SingleChildScrollView(
child: Column(
children: [
CustomTextWidget(
text: "Young Information",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
20.verticalSpace,
_textField(
controller: controller.firstNameController,
enabled: false,
headingText: "First & Middle Name",
hintText: "First & Middle Name",
),
20.verticalSpace,
_textField(
controller: controller.lastNameController,
enabled: false,
headingText: "Last Name",
hintText: "Last Name",
),
20.verticalSpace,
_textField(
controller: controller.phoneController,
enabled: false,
headingText: "Phone No.",
hintText: "Phone No.",
),
20.verticalSpace,
_textField(
controller: controller.emailController,
enabled: false,
headingText: "Email",
hintText: "Email",
),
20.verticalSpace,
_textField(
controller: controller.genderController,
enabled: false,
headingText: "Sex",
hintText: "Sex",
),
20.verticalSpace,
Row(
children: [
Expanded(
flex: 2,
child: _textField(
controller: controller.dobController,
enabled: false,
headingText: "Date Of Birth",
hintText: "Date Of Birth",
),
),
10.horizontalSpace,
Expanded(
flex: 1,
child: _textField(
controller: controller.ageController,
enabled: false,
headingText: "Age",
hintText: "Age",
),
),
],
),
20.verticalSpace,
CustomTextFieldWidget(
controller: controller.descriptionController,
heading: "Description",
minLines: 4,
maxLines: 4,
),
20.verticalSpace,
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.r),
),
backgroundColor: CustomAppColors.kSecondaryColor),
onPressed: () async {
controller.isForUpdate.value
? controller.updateButtonPressed(
widget.args.consentData!.id)
: await controller
.saveButtonPressed(widget.args.userData.id!);
Navigator.of(context).pop(controller.isForUpdate.value
? controller.descriptionController.text
: controller.saveResult);
},
child: Obx(
() => CustomTextWidget(
text: controller.isForUpdate.value
? "Update"
: 'Save',
fontColor: CustomAppColors.kPrimaryColor),
),
),
),
5.horizontalSpace,
Expanded(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
side: const BorderSide(
color: CustomAppColors.kSecondaryColor),
borderRadius: BorderRadius.circular(5.r),
),
backgroundColor: CustomAppColors.kPrimaryColor,
),
onPressed: () {
Navigator.of(context).pop();
},
child: CustomTextWidget(
text: 'Cancel',
fontColor: CustomAppColors.kSecondaryColor,
fontSize: 15.sp,
),
),
),
],
),
20.verticalSpace,
],
),
),
),
);
}
TextField _textField({
required String headingText,
required String hintText,
int minLines = 1,
int maxLines = 1,
TextEditingController? controller,
bool enabled = true,
TextInputType? inputType,
}) {
return TextField(
enabled: enabled,
maxLines: maxLines,
minLines: minLines,
controller: controller,
textAlign: TextAlign.left,
keyboardType: inputType,
decoration: InputDecoration(
isDense: true,
border: const OutlineInputBorder(),
hintText: hintText,
labelText: headingText,
),
);
}
@override
void dispose() {
Get.delete<ConsentAndCapacityAddNewFormScreenController>();
super.dispose();
}
}
class ConsentScreenTextField extends StatelessWidget {
const ConsentScreenTextField({
super.key,
required this.headingText,
required this.hintText,
this.minLines,
this.maxLines,
this.fieldIcon,
this.fieldController,
this.viewOnly,
});
final String headingText;
final String hintText;
final int? minLines;
final int? maxLines;
final IconData? fieldIcon;
final bool? viewOnly;
final TextEditingController? fieldController;
@override
Widget build(BuildContext context) {
return TextField(
enabled: !(viewOnly != null ? viewOnly == true : fieldController == null),
maxLines: maxLines,
minLines: minLines,
textAlign: TextAlign.left,
controller: fieldController ?? (TextEditingController()..text = hintText),
decoration: InputDecoration(
suffixIcon: Icon(fieldIcon),
border: const OutlineInputBorder(),
hintText: hintText,
labelText: headingText,
),
);
}
}

View File

@@ -0,0 +1,225 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:ftc_mobile_app/view/custom_widgets/custom_app_bar_with_action.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import '../../../ftc_mobile_app.dart';
import '../../../models/clients/consent_details_model.dart';
import '../../../models/profileData/user_data.dart';
class ConsentAndCapacityQuestionnaireScreen extends StatefulWidget {
final UserData userData;
const ConsentAndCapacityQuestionnaireScreen(
{Key? key, required this.userData})
: super(key: key);
@override
State<ConsentAndCapacityQuestionnaireScreen> createState() =>
_ConsentAndCapacityQuestionnaireScreenState();
}
class _ConsentAndCapacityQuestionnaireScreenState
extends State<ConsentAndCapacityQuestionnaireScreen> {
late final ConsentAndCapacityQuestionnaireScreenController controller;
@override
void initState() {
controller = Get.put(
ConsentAndCapacityQuestionnaireScreenController(data: widget.userData));
super.initState();
}
@override
Widget build(BuildContext context) {
return CustomScaffold(
// onBackButton: () => controller.backButtonPressed(context),
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
// sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: _appBar(context),
body: SafeArea(
child: Obx(() {
if (controller.serviceUser() == null) {
return FrequentFunctions.centerText(text: "User detail not found");
}
final detail = controller.serviceUser()!;
return Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: SingleChildScrollView(
child: Column(
children: [
CustomTextWidget(
text: "Questionnaire",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
16.verticalSpace,
nameRowField(boldText: "Name:", normalText: detail.displayName),
4.verticalSpace,
nameRowField(
boldText: "DOB:",
normalText: detail.modelId?.suDob == null
? ""
: DateFormatter()
.getHolidayDate(detail.modelId!.suDob)),
4.verticalSpace,
nameRowField(
boldText: "Sex:",
normalText: detail.modelId?.suSex ?? ""),
4.verticalSpace,
nameRowField(
boldText: "Contact No:",
normalText: detail.modelId?.phoneNo ?? ""),
4.verticalSpace,
nameRowField(
boldText: "Email:",
normalText: detail.modelId?.suEmailWork ?? ""),
24.verticalSpace,
Obx(
() => ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
separatorBuilder: (context, index) => 8.verticalSpace,
itemCount: controller.consentDetailsList.length,
itemBuilder: (BuildContext context, int index) {
return _listItem(
index, controller.consentDetailsList[index]);
},
),
),
24.verticalSpace,
],
),
),
);
}),
),
);
}
AppBar _appBar(BuildContext context) {
return CustomAppBarWithAction(
context,
titleText: "Consent And Capacity",
actionText: '+ Add New',
onActionTap: () async {
final result = await Navigator.pushNamed(
context, CustomRouteNames.kConsentAndCapacityAddNewFormScreenRoute,
arguments: ConsentAndCapacityAddNewFormScreenArgs(
userData: widget.userData,
));
if (result is ConsentDetailsModel) {
controller.consentDetailsList.insert(0, result);
}
},
);
}
Widget _listItem(int index, ConsentDetailsModel data) {
return Container(
key: ObjectKey(data),
decoration: BoxDecoration(
color: CustomAppColors.kLightGreyColor.withOpacity(0.2),
),
padding: REdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
CustomTextWidget(
text: data.description,
isExpanded: false,
textAlign: TextAlign.left,
fontSize: 16,
).paddingSymmetric(horizontal: 8.r),
6.verticalSpace,
Row(
children: [
Expanded(
child: CustomTextWidget(
text: DateFormat("dd/MM/yyyy / hh:mm:ss aa")
.format(data.updatedAt)
.toUpperCase(),
isExpanded: false,
textAlign: TextAlign.left,
fontSize: 14,
).paddingSymmetric(horizontal: 8.r),
),
// InkWell(
// borderRadius: 24.toRadius(),
// onTap: () {
// _onEditClick(index, data);
// },
// child:
// Icon(Icons.mode_edit_outlined, size: 22.r).addPaddingAll(4),
// ),
],
)
],
),
);
}
Row nameRowField({required String boldText, required String normalText}) {
return Row(
children: [
CustomTextWidget(
text: boldText,
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 16.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
8.horizontalSpace,
Expanded(
child: CustomTextWidget(
text: normalText,
isExpanded: false,
fontWeight: FontWeight.w400,
fontSize: 14.sp,
textAlign: TextAlign.left,
alignment: Alignment.topLeft),
),
],
);
}
_onEditClick(int index, ConsentDetailsModel data) async {
final result = await Navigator.pushNamed(
context,
CustomRouteNames.kConsentAndCapacityAddNewFormScreenRoute,
arguments: ConsentAndCapacityAddNewFormScreenArgs(
userData: widget.userData,
consentData: data,
),
);
if (result is String) {
controller.consentDetailsList[index].description = result;
controller.consentDetailsList.refresh();
}
// MultilineTextFieldSheet(
// buttonLabel: 'Submit',
// appBarTitle: '',
// textFieldHint: 'Type here...',
// prevValueForField: data.description,
// wantLeadingIcon: false,
// onButtonClick: (String text) {
// controller.updateButtonPressed(text, data.id, index);
// },
// ).show();
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,241 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/models/clients/HealthIssuesDetailsModel.dart';
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import 'package:ftc_mobile_app/utilities/enums/body_parts.dart';
import 'package:ftc_mobile_app/view/custom_widgets/custom_app_bar_with_action.dart';
import 'package:ftc_mobile_app/view/custom_widgets/human_body_mapper_widget.dart';
import 'package:ftc_mobile_app/view/custom_widgets/my_circle_image.dart';
import 'package:get/get.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import '../add_details_to_new_body_point_screen.dart';
import 'widget/IssueDetailPopupWidget.dart';
class CurrentHealthIssuesScreen extends StatefulWidget {
final UserData userData;
const CurrentHealthIssuesScreen({Key? key, required this.userData})
: super(key: key);
@override
State<CurrentHealthIssuesScreen> createState() =>
_CurrentHealthIssuesScreenState();
}
class _CurrentHealthIssuesScreenState extends State<CurrentHealthIssuesScreen> {
final CurrentHealthIssuesScreenController controller =
Get.put(CurrentHealthIssuesScreenController());
@override
void initState() {
controller.serviceUserId = widget.userData.id!;
super.initState();
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: controller.tabs.length,
child: CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
onBackButton: () => controller.onBackPress(context),
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: _appBar(context),
body: SingleChildScrollView(
child: Column(
children: [
//User details
serviceUserDetailWidget(),
Divider(
height: 1,
color: CustomAppColors.kLightGreyColor,
),
TabBar(
onTap: (i) {
controller.onTabChange(controller.tabs[i]);
},
tabs: controller.tabs
.map((e) => Tab(
text: e,
))
.toList()),
Divider(
height: 1,
color: CustomAppColors.kLightGreyColor,
),
8.verticalSpace,
Obx(() {
final entries = controller.issueBodyParts.entries;
if (entries.isEmpty) {
return FrequentFunctions.noWidget;
}
final map = <BodyPart, Color?>{};
for (var e in entries) {
map[e.key] = e.value.color;
}
return HumanBodyWidget(
visibleBodyPoints: map,
width: Get.width * 0.9,
onPointTap: (b, p) {
RenderBox? overlay = Overlay.of(context)
.context
.findRenderObject() as RenderBox?;
showMenu(
context: context,
surfaceTintColor: Colors.white,
position: RelativeRect.fromRect(
p & const Size(40, 40),
// Smaller rect, the touch area
Offset.zero &
(overlay?.size ??
Get.mediaQuery
.size), // Bigger rect, the entire screen
),
items: [
PopupMenuItem(
padding: EdgeInsets.zero,
child: IssueDetailPopupWidget(
userData: widget.userData,
data: controller.issueBodyParts[b]!.data,
onActionChange: (status, data) {
if (data.status != status) {
controller.updateHealthIssueStatus(
bodyPoint: b, data: data, status: status);
}
},
onUpdateButtonTap: (data) async {
Get.back();
onAddOrUpdateButtonTap(context, data);
},
),
),
]);
},
);
}),
],
),
),
),
);
}
AppBar _appBar(BuildContext context) {
return CustomAppBarWithAction(
context,
titleText: "Current Health Issues",
actionText: '+ Add New',
onActionTap: () => onAddOrUpdateButtonTap(context),
);
}
Widget serviceUserDetailWidget() {
return Padding(
padding: REdgeInsets.symmetric(horizontal: 20),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Align(
alignment: Alignment.center,
child: MyCircleImage(
imageSize: 80.r,
url:
"${WebUrls.baseUrl}${widget.userData.profilePictureUrl ?? ""}",
errorWidget: CustomImageWidget(
imagePath: AssetsManager.kPersonMainIcon,
height: 53.r,
width: 53.r,
),
),
),
10.verticalSpace,
CustomTextWidget(
text: widget.userData.displayName,
fontSize: 14.sp,
fontWeight: FontWeight.w600),
32.verticalSpace,
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _labelValueWidgets(
'Email:',
widget.userData.email ?? "",
),
)),
8.horizontalSpace,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _labelValueWidgets(
'Contact Number:',
widget.userData.modelId?.phoneNo ?? "",
),
)),
],
),
16.verticalSpace,
..._labelValueWidgets(
'Address 1:',
widget.userData.modelId?.suAddress1 ?? "",
),
16.verticalSpace,
..._labelValueWidgets(
'Address 2:',
widget.userData.modelId?.suAddress2 ?? "",
),
16.verticalSpace,
],
),
);
}
List<Widget> _labelValueWidgets(String label, String value) {
return [
CustomTextWidget(
textAlign: TextAlign.left,
isExpanded: false,
text: label,
fontWeight: FontWeight.w600,
fontColor: CustomAppColors.kLightTextColor,
fontSize: 12.sp),
4.verticalSpace,
CustomTextWidget(
textAlign: TextAlign.left,
text: value,
isExpanded: false,
fontWeight: FontWeight.w400,
fontColor: CustomAppColors.kBlackColor,
fontSize: 13.sp),
];
}
Future<void> onAddOrUpdateButtonTap(BuildContext context,
[HealthIssueDetailsModel? data]) async {
dynamic result = await Navigator.of(context)
.pushNamed(CustomRouteNames.kAddDetailsToNewPointScreenRoute,
arguments: AddDetailsToNewBodyPointScreenArgs(
userData: widget.userData,
issueData: data,
));
if (result == true) {
controller.getPointsDataFromService();
}
}
}

View File

@@ -0,0 +1,260 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/models/clients/HealthIssuesDetailsModel.dart';
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
class IssueDetailPopupWidget extends StatefulWidget {
const IssueDetailPopupWidget({
super.key,
required this.userData,
required this.data,
required this.onActionChange,
required this.onUpdateButtonTap,
});
final UserData userData;
final HealthIssueDetailsModel data;
final Function(bool status, HealthIssueDetailsModel data) onActionChange;
final Function(HealthIssueDetailsModel data) onUpdateButtonTap;
static const actionActive = "Active";
static const actionResolved = "Resolved";
@override
State<IssueDetailPopupWidget> createState() => _IssueDetailPopupWidgetState();
}
class _IssueDetailPopupWidgetState extends State<IssueDetailPopupWidget> {
final Map<String, bool> actionsMap = {
IssueDetailPopupWidget.actionActive: true,
IssueDetailPopupWidget.actionResolved: false
};
String selectedValue = IssueDetailPopupWidget.actionActive;
@override
void initState() {
selectedValue = widget.data.status
? IssueDetailPopupWidget.actionActive
: IssueDetailPopupWidget.actionResolved;
super.initState();
}
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
width: Get.width,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: double.maxFinite,
padding: REdgeInsets.symmetric(horizontal: 12),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Health Note',
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w400,
),
),
CustomTextWidget(
text: widget.data.healthNote,
fontSize: 14.sp,
fontWeight: FontWeight.bold,
textAlign: TextAlign.left,
isExpanded: false),
],
),
),
Container(
width: 90.r,
height: 32.r,
decoration: BoxDecoration(
borderRadius: 24.toRadius(),
color: (selectedValue ==
IssueDetailPopupWidget.actionActive)
? Colors.red.withOpacity(0.3)
: Colors.green.withOpacity(0.3),
),
child: DropdownButtonHideUnderline(
child: DropdownButtonFormField(
onTap: () {
FocusScopeNode().unfocus();
},
value: selectedValue,
dropdownColor: Colors.white,
borderRadius: 4.toRadius(),
decoration: InputDecoration(
isDense: true,
border: InputBorder.none,
suffixIcon: Icon(Icons.arrow_drop_down_sharp,
size: 18,
color: (selectedValue ==
IssueDetailPopupWidget.actionActive)
? Colors.red
: Colors.green)
.paddingOnly(right: 12.r),
suffixIconConstraints: BoxConstraints.tightFor(
width: 24.r, height: 32.r),
// contentPadding: REdgeInsets.only(left: 0),
),
elevation: 4,
icon: FrequentFunctions.noWidget,
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 10.sp,
color: Colors.black),
hint: Text(
"Select...",
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 12.sp,
color: CustomAppColors.kLightTextColor,
),
),
selectedItemBuilder: (_) {
return actionsMap.keys.map(
(e) {
return DropdownMenuItem<String>(
value: e,
child: Container(
// color: (selectedValue == e)
// ? (selectedValue ==
// IssueDetailPopupWidget
// .actionActive)
// ? Colors.red.withOpacity(0.3)
// : Colors.green.withOpacity(0.3)
// : Colors.white,
alignment: Alignment.center,
child: Text(
e,
style: TextStyle(
color: (selectedValue == e)
? (selectedValue ==
IssueDetailPopupWidget
.actionActive)
? Colors.red
: Colors.green
: Colors.black),
),
),
);
},
).toList();
},
items: actionsMap.keys
.map(
(e) => DropdownMenuItem<String>(
value: e,
child: Text(e),
),
)
.toList(),
// padding: EdgeInsets.zero,
isExpanded: true,
// iconSize: 20.h,
// icon: Padding(
// padding: REdgeInsets.only(right: 0.0),
// child: Icon(Icons.arrow_drop_down_sharp,
// size: 18,
// color: Colors.black),
// ),
onChanged: (v) {
if (v != null) {
setState(() {
selectedValue = v;
widget.onActionChange(
actionsMap[v]!, widget.data);
});
}
},
),
),
)
],
),
),
8.verticalSpace,
Divider(
height: 1,
color: Colors.grey.withOpacity(0.3),
),
Container(
width: double.maxFinite,
padding: REdgeInsets.symmetric(horizontal: 12, vertical: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
textAlign: TextAlign.left,
TextSpan(
children: [
TextSpan(
text: "Complaint: ",
style: TextStyle(
fontSize: 12.sp, fontWeight: FontWeight.w600),
),
TextSpan(
text: widget.data.complaint,
style: TextStyle(
fontSize: 12.sp, fontWeight: FontWeight.w400),
),
],
),
),
4.verticalSpace,
Text.rich(
textAlign: TextAlign.left,
TextSpan(
children: [
TextSpan(
text: "Last Update: ",
style: TextStyle(
fontSize: 12.sp, fontWeight: FontWeight.w600),
),
TextSpan(
text: DateFormat("MMM/dd/yyyy").format(
DateTime.parse(widget.data.updatedAt)
.toLocal()),
style: TextStyle(
fontSize: 12.sp, fontWeight: FontWeight.w400),
),
],
),
),
],
),
),
16.verticalSpace,
Center(
child: SizedBox(
width: 120.r,
height: 32.r,
child: CustomAppButton(
onTap: () => widget.onUpdateButtonTap(widget.data),
buttonText: "Update",
),
),
),
],
),
),
],
);
}
}

View File

@@ -0,0 +1,363 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:get/get.dart';
class DocumentDetailsScreen extends StatefulWidget {
const DocumentDetailsScreen({Key? key}) : super(key: key);
@override
State<DocumentDetailsScreen> createState() => _DocumentDetailsScreenState();
}
class _DocumentDetailsScreenState extends State<DocumentDetailsScreen> {
final DocumentDetailsScreenController controller =
Get.put(DocumentDetailsScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'Documents',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
const Spacer(),
InkWell(
onTap: () async {
// await Navigator.pushNamed(
// controller.screenKey.currentContext!,
// CustomRouteNames.kNewNoteScreenRoute,
// );
},
child: CustomTextWidget(
text: '+ Add New',
isExpanded: false,
fontSize: 14.sp,
fontWeight: FontWeight.w600,
fontColor: CustomAppColors.kLightTextColor,
),
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: SingleChildScrollView(
child: Column(
children: [
// ClipRRect(
// borderRadius: BorderRadius.circular(50.r),
// child: CustomImageWidget(
// imagePath: FrequentFunctions
// .userModel.value.profilePictureUrl.isNotEmpty
// ? "${WebUrls.baseUrl}${FrequentFunctions.userModel.value.profilePictureUrl}"
// : AssetsManager.kPersonMainIcon,
// imageColor: FrequentFunctions
// .userModel.value.profilePictureUrl.isNotEmpty
// ? null
// : CustomAppColors.kLightTextColor,
// height: 80.h,
// width: 80.w,
// ),
// ),
SizedBox(height: 16.h),
CustomTextWidget(
text: 'user', fontSize: 14.sp, fontWeight: FontWeight.w600),
SizedBox(height: 16.h),
const Row(
children: [
Expanded(
child: BuildDetailSingleItem(
title: 'Email',
value: "jaylon.n@ftcservices.com",
)),
Expanded(
child: BuildDetailSingleItem(
title: 'Contact Number',
value: "+44 (0) 00 0000 0000",
)),
],
),
const Row(
children: [
Expanded(
child: BuildDetailSingleItem(
title: 'NI Number',
value: "QQ 123456 C",
)),
Expanded(
child: BuildDetailSingleItem(
title: 'DOB', value: "15/11/1996")),
],
),
const Row(
children: [
Expanded(
child: BuildDetailSingleItem(
title: 'Post Code',
value: "GL55 8PN",
)),
Expanded(
child: BuildDetailSingleItem(
title: 'Kin', value: "12PO025")),
],
),
const Row(
children: [
BuildDetailSingleItem(
title: 'Address',
value: "Gloucester, 1-2 Street Name",
),
],
),
SizedBox(height: 16.h),
Container(
height: 30,
margin: EdgeInsets.symmetric(horizontal: 5.w, vertical: 10.h),
decoration: BoxDecoration(
border: Border.all(
color: CustomAppColors.kDarkBlueTextColor,
),
borderRadius: BorderRadius.circular(5.r),
),
child: Row(
children: [
Container(
padding: const EdgeInsets.only(left: 5, right: 10),
child: const Center(
child: Icon(Icons.search),
),
),
CustomTextWidget(
text: "Search...",
fontSize: 18.sp,
fontWeight: FontWeight.w400,
fontColor: CustomAppColors.kLightGreyColor,
isExpanded: false,
),
],
),
),
SizedBox(height: 8.h),
SizedBox(
width: MediaQuery.of(context).size.width,
child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
listHeading(),
listItemWidget(
text1: "Health Report and data",
text3: "Aug/01/2024",
color: false),
listItemWidget(
text1: "Health Report and data",
text3: "Sept/01/2024",
color: false),
listItemWidget(
text1: "Health Report and data",
text3: "Aug/01/2024",
color: false),
listItemWidget(
text1: "Health Report and data",
text3: "Sept/01/2024",
color: false),
listItemWidget(
text1: "Health Report and data",
text3: "Aug/01/2024",
color: false),
listItemWidget(
text1: "Health Report and data",
text3: "Sept/01/2024",
color: false),
listItemWidget(
text1: "Health Report and data",
text3: "Aug/01/2024",
color: false),
listItemWidget(
text1: "Health Report and data",
text3: "Sept/01/2024",
color: false),
listItemWidget(
text1: "Health Report and data",
text3: "Aug/01/2024",
color: false),
listItemWidget(
text1: "Health Report and data",
text3: "Sept/01/2024",
color: false),
],
),
)
],
),
),
),
);
}
Widget listHeading() {
return Container(
decoration: const BoxDecoration(
border: Border(
top: BorderSide(
color: CustomAppColors.kSmokeColor,
),
bottom: BorderSide(color: CustomAppColors.kSmokeColor),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 2,
child: Container(
padding: const EdgeInsets.only(right: 0, top: 10, bottom: 10),
child: const CustomTextWidget(
textAlign: TextAlign.left,
text: "All Documents",
isExpanded: false,
fontWeight: FontWeight.w700),
),
),
Expanded(
flex: 1,
child: Container(
padding: const EdgeInsets.only(right: 0, top: 10, bottom: 10),
child: CustomTextWidget(
text: "+ Add New",
isExpanded: false,
fontWeight: FontWeight.w500,
fontColor: CustomAppColors.kLightGreyColor),
),
),
],
),
);
}
Widget listItemWidget(
{required String text1, required String text3, required bool color}) {
return Container(
decoration: BoxDecoration(
color: color ? CustomAppColors.kBlueColor.withAlpha(20) : null,
border: const Border(
top: BorderSide(
color: CustomAppColors.kSmokeColor,
),
bottom: BorderSide(color: CustomAppColors.kSmokeColor),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 2,
child: Container(
padding: const EdgeInsets.only(top: 10, bottom: 10),
child: Row(
children: [
const CustomImageWidget(imagePath: AssetsManager.kFolderIcon),
SizedBox(
width: 5.sp,
),
Container(
padding: const EdgeInsets.only(
left: 5,
),
child: CustomTextWidget(
text: text1,
textAlign: TextAlign.left,
fontSize: 11.sp,
isExpanded: false,
),
),
],
),
),
),
Expanded(
flex: 1,
child: Container(
padding: const EdgeInsets.only(top: 10, bottom: 10, left: 3),
child: CustomTextWidget(
text: text3,
fontSize: 11.sp,
isExpanded: false,
),
),
),
],
),
);
}
}
class BuildDetailSingleItem extends StatelessWidget {
const BuildDetailSingleItem({
super.key,
required this.title,
required this.value,
});
final String title;
final String value;
@override
Widget build(BuildContext context) {
return Container(
height: 52.h,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 5.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomTextWidget(
textAlign: TextAlign.left,
isExpanded: false,
text: '$title: ',
fontWeight: FontWeight.w600,
fontColor: CustomAppColors.kLightTextColor,
fontSize: 12.sp),
const Spacer(),
CustomTextWidget(
textAlign: TextAlign.left,
text: value,
isExpanded: false,
fontWeight: FontWeight.w400,
fontColor: CustomAppColors.kBlackColor,
fontSize:
title.toLowerCase().contains("email") ? 11.sp : 13.sp),
],
),
),
);
}
}

View File

@@ -0,0 +1,202 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:ftc_mobile_app/models/clients/documents_list_model.dart';
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import 'package:ftc_mobile_app/view/custom_widgets/custom_app_bar_with_action.dart';
import 'package:ftc_mobile_app/view/custom_widgets/edit_icon.dart';
import 'package:ftc_mobile_app/view/screens/clientsListing/widgets/search_bar_widget.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
class DocumentsListScreen extends StatefulWidget {
final UserData userData;
const DocumentsListScreen({Key? key, required this.userData})
: super(key: key);
@override
State<DocumentsListScreen> createState() => _DocumentsListScreenState();
}
class _DocumentsListScreenState extends State<DocumentsListScreen> {
late final DocumentsListScreenController controller;
@override
void initState() {
controller = Get.put(DocumentsListScreenController(widget.userData));
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
appBar: _appBar(context),
body: Column(
children: [
SearchBarWidget(
controller: controller.searchTEC,
onSearchTextChange: controller.onSearch,
),
Expanded(
child: Obx(
() {
return controller.documentsList.isEmpty
? FrequentFunctions.centerText(text: "No data found")
: listView();
},
),
),
],
),
);
}
AppBar _appBar(BuildContext context) {
return CustomAppBarWithAction(
context,
titleText: "Documents",
actionText: '+ Add New',
onActionTap: () async {
dynamic response = await Navigator.pushNamed(
context, CustomRouteNames.kAddNewDocumentScreenRoute,
arguments: controller.serviceUser.value);
if (response is DocumentModel) {
controller.documentsList.insert(0, response);
controller.documentsList.refresh();
}
},
);
}
Widget _tableHeading(String text) {
return TableCell(
child: Padding(
padding: REdgeInsets.symmetric(horizontal: 12, vertical: 12),
child: Text(
text,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w600,
),
),
),
);
}
Widget listView() {
return InteractiveViewer(
constrained: false,
scaleEnabled: false,
child: SizedBox(
width: Get.width + 100.r,
child: Table(
border: TableBorder.all(
color: CustomAppColors.kSmokeColor,
),
columnWidths: const <int, TableColumnWidth>{
0: FlexColumnWidth(30.2),
1: FlexColumnWidth(35.0),
2: FlexColumnWidth(25.0),
// 3: FlexColumnWidth(15.0),
},
defaultVerticalAlignment: TableCellVerticalAlignment.middle,
children: [
TableRow(
children: [
_tableHeading("Document Name"),
_tableHeading("Details"),
_tableHeading("Date"),
// _tableHeading("Actions"),
],
),
...controller.documentsList
.map((e) => tableRow(controller.documentsList.indexOf(e), e))
.toList()
],
),
),
);
}
TableRow tableRow(index, DocumentModel e) {
return TableRow(
decoration: BoxDecoration(
color: controller.documentsList.indexOf(e) % 2 == 0
? CustomAppColors.kLightGreyColor.withOpacity(0.25)
: Colors.white),
children: <Widget>[
Padding(
padding: REdgeInsets.symmetric(vertical: 8.0, horizontal: 12),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const CustomImageWidget(imagePath: AssetsManager.kFolderIcon),
Expanded(
child: Container(
padding: const EdgeInsets.only(left: 5),
child: CustomTextWidget(
text: e.title,
textAlign: TextAlign.left,
fontSize: 11.sp,
isExpanded: false,
),
),
),
],
),
),
Padding(
padding: REdgeInsets.symmetric(vertical: 8.0, horizontal: 12),
child: CustomTextWidget(
text: e.details,
textAlign: TextAlign.left,
fontSize: 11.sp,
isExpanded: false,
),
),
Padding(
padding: REdgeInsets.symmetric(vertical: 8.0, horizontal: 12),
child: CustomTextWidget(
text: DateFormat("MMM/dd/yyyy").format(
DateTime.tryParse(e.createdAt)?.toLocal() ?? DateTime.now()),
textAlign: TextAlign.left,
fontSize: 11.sp,
isExpanded: false,
),
),
// Padding(
// padding: REdgeInsets.symmetric(vertical: 8.0, horizontal: 12),
// child: Row(
// mainAxisSize: MainAxisSize.min,
// children: [
// EditIcon(
// onTap: () => _onEditTap(index, e),
// ),
// ],
// ),
// )
],
);
}
// _onEditTap(int index, documentModel) async {
// var response = await Navigator.pushNamed(
// context, CustomRouteNames.kAddNewDocumentScreenRoute,
// arguments: [documentModel, controller.serviceUser()]);
// if (response is DocumentModel) {
// // int index = controller.documentsList.value.documentList.indexWhere((item) => item == documentModel);
// controller.documentsList[index]
// ..title = response.title
// ..details = response.details
// ..docPath = response.docPath;
// controller.documentsList.refresh();
// }
// }
@override
void dispose() {
controller.dispose();
super.dispose();
}
}

View File

@@ -0,0 +1,22 @@
export '../clientsListing/clients_list_screen.dart';
export 'client_profile_screen.dart';
export 'appointments_screen.dart';
export 'notes_screen.dart';
export 'select_note_screen.dart';
export 'new_note_screen.dart';
export 'care_plan_menu_screen.dart';
export 'documentsList/documents_list_screen.dart';
export 'document_details_screen.dart';
export 'recent_incidents_screen.dart';
export 'currentHealthIssues/current_health_issues_screen.dart';
export 'consent_and_capacity_add_new_form_screen.dart';
export 'consent_and_capacity_questionnaire_screen.dart';
export 'life_history_and_goals_screen.dart';
export 'risk_assessments_screen.dart';
export 'pbs_plan_screen.dart';
export 'photo_gallery_screen.dart';
export 'risk_assessments_template_screen.dart';
export 'clients_new_view_module/export_client_new_view.dart';
export 'care_notes_screen.dart';
export 'care_notes_subcategories_screen.dart';
export 'careNoteForms/export_care_note_forms.dart';

View File

@@ -0,0 +1,151 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/controllers/clients/export_clients_controllers.dart';
import 'package:get/get.dart';
import '../../../ftc_mobile_app.dart';
class LifeHistoryAndGoalsScreen extends StatefulWidget {
const LifeHistoryAndGoalsScreen({Key? key}) : super(key: key);
@override
State<LifeHistoryAndGoalsScreen> createState() => _LifeHistoryAndGoalsScreenState();
}
class _LifeHistoryAndGoalsScreenState extends State<LifeHistoryAndGoalsScreen> {
LifeHistoryAndGoalsScreenController controller = Get.put(LifeHistoryAndGoalsScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
sideDrawer: const CustomDrawer(),
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'Life History & Goals ',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: SingleChildScrollView(
child: Column(
children: [
CustomTextWidget(text: "Questionnaire",isExpanded: false,fontWeight: FontWeight.w600,fontSize: 14.sp,textAlign: TextAlign.left,alignment: Alignment.topLeft),
SizedBox(height: 22.h),
LifeHistoryQuestionCard(imagePath: AssetsManager.kManImagePng,name: "Leo Hurwitz",question: "Q: If there was one thing you could change about your health, what would it be?",date: "Aug/02/2023/7:30pm"),
LifeHistoryAnswerCard(imagePath: AssetsManager.kPersonMainIcon,name: "Leo Hurwitz",answer: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.",date: "Aug/02/2023/7:30pm"),
LifeHistoryQuestionCard(imagePath: AssetsManager.kManImagePng,name: "Leo Hurwitz",question: "Q: If there was one thing you could change about your health, what would it be?",date: "Aug/02/2023/7:30pm"),
LifeHistoryAnswerCard(imagePath: AssetsManager.kPersonMainIcon,name: "Leo Hurwitz",answer: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.",date: "Aug/02/2023/7:30pm"),
LifeHistoryQuestionCard(imagePath: AssetsManager.kManImagePng,name: "Leo Hurwitz",question: "Q: If there was one thing you could change about your health, what would it be?",date: "Aug/02/2023/7:30pm"),
LifeHistoryAnswerCard(imagePath: AssetsManager.kPersonMainIcon,name: "Leo Hurwitz",answer: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.",date: "Aug/02/2023/7:30pm"),
],
),
),
),
);
}
}
class LifeHistoryQuestionCard extends StatelessWidget {
const LifeHistoryQuestionCard({
super.key, required this.imagePath, required this.name, required this.question, required this.date,
});
final String imagePath;
final String name;
final String question;
final String date;
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
CustomImageWidget(imagePath: imagePath,width: 32.w,height: 32.h,),
SizedBox(width: 12.w,),
CustomTextWidget(text: name,isExpanded: false),
],
),
SizedBox(height: 8.h),
CustomTextWidget(text: question,isExpanded: false,fontWeight: FontWeight.bold,textAlign: TextAlign.left,alignment: Alignment.centerLeft,fontSize: 14.sp),
SizedBox(height: 8.h),
CustomTextWidget(text: date,isExpanded: false,textAlign: TextAlign.left,alignment: Alignment.centerLeft,fontSize: 12.sp),
SizedBox(height: 24.h),
],
);
}
}
class LifeHistoryAnswerCard extends StatelessWidget {
const LifeHistoryAnswerCard({
super.key, required this.imagePath, required this.name, required this.answer, required this.date,
});
final String imagePath;
final String name;
final String answer;
final String date;
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
CustomImageWidget(imagePath: imagePath,width: 32.w,height: 32.h,),
SizedBox(width: 12.w,),
CustomTextWidget(text: name,isExpanded: false),
const Spacer(),
CustomImageWidget(imagePath: AssetsManager.kPencilOutlineIcon,width: 14.w,height: 14.h,),
],
),
SizedBox(height: 8.h),
Text.rich(
TextSpan(
children: [
const TextSpan(
text: 'A: ',
style: TextStyle(fontWeight: FontWeight.bold),
),
TextSpan(style: TextStyle(fontSize: 14.sp,color: CustomAppColors.kBlackColor.withAlpha(180),),text: answer),
],
),
),
SizedBox(height: 8.h),
CustomTextWidget(text: date,isExpanded: false,textAlign: TextAlign.left,alignment: Alignment.centerLeft,fontSize: 12.sp),
SizedBox(height: 24.h),
],
);
}
}

View File

@@ -0,0 +1,364 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../ftc_mobile_app.dart';
class NewNoteScreen extends StatefulWidget {
const NewNoteScreen({Key? key}) : super(key: key);
@override
State<NewNoteScreen> createState() => _NewNoteScreenState();
}
class _NewNoteScreenState extends State<NewNoteScreen> {
NewNoteScreenController controller = Get.put(NewNoteScreenController());
@override
Widget build(BuildContext context) {
return CustomScaffold(
backgroundColor: CustomAppColors.kPrimaryColor,
screenKey: controller.screenKey,
onScreenTap: controller.removeFocus,
showAppBar: true,
appBar: CustomAppBar(
leadingButton: Container(),
showBoxShadow: false,
titleWidget: Row(
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: CustomImageWidget(
imagePath: AssetsManager.kBackIcon,
height: 11.53.h,
width: 8.66.w,
),
),
SizedBox(
width: 15.w,
),
CustomTextWidget(
text: 'New Note for ${controller.user.name}',
isExpanded: false,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontColor: CustomAppColors.kDarkBlueTextColor,
),
],
),
),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 18.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 20.h,bottom: 15.h),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
minLines: 1,
maxLines: 1,
controller: controller.titleController,
hintText: ConstantText.kTypeTitle,
heading: ConstantText.kTitle,
onChange: (_){},
),
),
Padding(
padding: EdgeInsets.only(bottom: 15.0.h),
child: const UploadWidget(),
),
Row(
children: [
Expanded(child: Padding(
padding: EdgeInsets.only(right: 7.5.w),
child: const FlagWidget(text1: "Flag",text2: "Choose Flag",flagIcon: AssetsManager.kFlagIcon),
)),
Expanded(child: Padding(
padding: EdgeInsets.only(left: 7.5.w),
child: const FlagWidget(text1: "Red Flag: How long?",text2: "Choose",chooseIcon: AssetsManager.kClockIcon),
)),
],
),
Padding(
padding: EdgeInsets.only(top: 20.h,bottom: 15.h),
child: CustomTextFieldWidget(
borderRadius: BorderRadius.circular(10.r),
borderColor: CustomAppColors.kLightGreyColor,
borderWidth: 1.0.sp,
maxLines: 6,
minLines: 6,
controller: controller.titleController,
hintText: ConstantText.kTypeTitle,
heading: ConstantText.kTitle,
onChange: (_){},
bottomChild: Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: EdgeInsets.only(right: 10.0.w,bottom: 10.h),
child: InkWell(
onTap: () {},
child: const CustomImageWidget(
imagePath:AssetsManager.kMicIcon,
),
),
),
),
),
),
const TitleWidget(
text1: "Link Note (Optional)",
text2: "Choose",
showDropDownButton: true,
showSwitchButton: false),
Padding(
padding: EdgeInsets.symmetric(vertical: 15.0.h),
child: const TitleWidget(
text1: "Handover To (Optional)",
text2: "Choose",
showDropDownButton: true,
showSwitchButton: false),
),
const TitleWidget(
text1: "Notify Management?",
text2: "No",
showDropDownButton: false,
showSwitchButton: true),
// const SubmitButtonWidget(
// text: "Submit",
// buttonColor: CustomAppColors.kSecondaryColor,
// textColor: CustomAppColors.kPrimaryColor,
// ),
Padding(
padding: EdgeInsets.only(
top: 15.h,
bottom: Platform.isIOS ? 30.0.h : 20.0.h,
),
child: CustomAppButton(
buttonText: ConstantText.kSubmit.toUpperCase(),
buttonColor: CustomAppColors.kSecondaryColor,
textColor: CustomAppColors.kPrimaryColor,
onTap: (){},
),
),
],
),
),
);
}
}
class UploadWidget extends StatelessWidget {
const UploadWidget({
super.key,
});
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
// height: 50,
padding: EdgeInsets.symmetric(vertical: 12.h,),
// margin: EdgeInsets.symmetric(horizontal: 20.w, vertical: 10.h),
decoration: BoxDecoration(
border: Border.all(
color: CustomAppColors.kLightGreyColor,
),
borderRadius: BorderRadius.circular(8.r)),
child: Column(
children: [
CustomImageWidget(
imagePath: AssetsManager.kUploadIcon,
height: 24.h,
width: 24.w,
),
CustomTextWidget(
text: "Upload Image",
fontSize: 14.sp,
fontWeight: FontWeight.w600,
fontColor: CustomAppColors.kLightTextColor,
isExpanded: false),
],
),
);
}
}
class TitleWidget extends StatelessWidget {
const TitleWidget({
super.key,
required this.text1,
required this.text2,
required this.showDropDownButton,
required this.showSwitchButton,
});
final String text1;
final String text2;
final bool showDropDownButton;
final bool showSwitchButton;
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.sp,),
decoration: BoxDecoration(
border: Border.all(
color: CustomAppColors.kLightGreyColor,
),
borderRadius: BorderRadius.circular(8.r)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
CustomTextWidget(
text: text1,
fontSize: 10.sp,
fontWeight: FontWeight.w500,
fontColor: CustomAppColors.kLightTextColor,
isExpanded: false),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CustomTextWidget(
text: text2,
fontSize: 14.sp,
fontWeight: FontWeight.w600,
fontColor: CustomAppColors.kDarkBlueTextColor,
isExpanded: false),
showDropDownButton
? const Icon(Icons.arrow_drop_down_outlined)
: showSwitchButton
? SizedBox(
height: 20.h,
width: 48.w,
child: Switch(
inactiveTrackColor: CustomAppColors.kPrimaryColor,
activeTrackColor: CustomAppColors.kSecondaryColor,
value: false,
onChanged: (val) {}),
)
: Container(),
],
),
],
),
);
}
}
class SubmitButtonWidget extends StatelessWidget {
const SubmitButtonWidget({
super.key,
required this.text,
required this.textColor,
required this.buttonColor,
this.borderColor,
});
final String text;
final Color textColor;
final Color buttonColor;
final Color? borderColor;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {},
child: Container(
width: MediaQuery.of(context).size.width,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 10.h),
decoration: BoxDecoration(
border: borderColor != null ? Border.all(color: borderColor!) : null,
color: buttonColor,
borderRadius: BorderRadius.circular(2.r),
),
child: CustomTextWidget(
text: text,
fontColor: textColor,
fontSize: 14.sp,
fontWeight: FontWeight.w700,
),
),
);
}
}
class FlagWidget extends StatelessWidget {
const FlagWidget({
super.key,
required this.text1,
required this.text2,
this.flagIcon,
this.chooseIcon,
});
final String text1;
final String text2;
final String? flagIcon;
final String? chooseIcon;
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 10.w,right: 10.w,top: 5.h,bottom: 5.h),
decoration: BoxDecoration(
border: Border.all(
color: CustomAppColors.kLightGreyColor,
),
borderRadius: BorderRadius.circular(10.r)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(bottom: 6.0.h),
child: CustomTextWidget(
text: text1,
fontSize: 10.sp,
fontWeight: FontWeight.w500,
fontColor: CustomAppColors.kLightTextColor,
isExpanded: false),
),
Row(
children: [
flagIcon!=null?
CustomImageWidget(
imagePath: flagIcon!,
height: 18.66.h,
width: 18.w,
): Container(),
Expanded(
child: CustomTextWidget(
alignment: Alignment.centerLeft,
text: text2,
fontSize: 14.sp,
fontWeight: FontWeight.w600,
fontColor: CustomAppColors.kDarkBlueTextColor,
isExpanded: false),
),
chooseIcon!=null?
CustomImageWidget(
imagePath: chooseIcon!,
height: 18.66.h,
width: 18.w,
): Container(),
],
),
],
),
);
}
}

Some files were not shown because too many files have changed in this diff Show More