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,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),
// ),
// ],
// ),
// ],
// );
// }
// }