259 lines
9.1 KiB
Dart
259 lines
9.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import '../../../ftc_mobile_app.dart';
|
|
|
|
class RiskAssessmentsScreen extends StatefulWidget {
|
|
const RiskAssessmentsScreen({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<RiskAssessmentsScreen> createState() => _RiskAssessmentsScreenState();
|
|
}
|
|
|
|
class _RiskAssessmentsScreenState extends State<RiskAssessmentsScreen> {
|
|
RiskAssessmentsScreenController controller = Get.put(RiskAssessmentsScreenController());
|
|
|
|
|
|
@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: 'Risk Assessments',
|
|
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: [
|
|
Container(
|
|
height: 40,
|
|
margin: EdgeInsets.symmetric(horizontal: 20.w, vertical: 10.h),
|
|
decoration: BoxDecoration(
|
|
border: Border.all(
|
|
color: CustomAppColors.kLightGreyColor,
|
|
),
|
|
borderRadius: BorderRadius.circular(5.r)),
|
|
child: Row(
|
|
children: [
|
|
IconButton(
|
|
onPressed: () {}, icon: const Icon(Icons.search)),
|
|
CustomTextWidget(
|
|
text: "Search...",
|
|
fontSize: 18.sp,
|
|
fontWeight: FontWeight.w400,
|
|
fontColor: CustomAppColors.kLightGreyColor,
|
|
isExpanded: false),
|
|
],
|
|
),
|
|
),
|
|
InkWell(
|
|
// onTap: () {
|
|
// Navigator.pushNamed(
|
|
// controller.screenKey.currentContext!,
|
|
// CustomRouteNames.kDocumentDetailsScreenRoute,
|
|
// );
|
|
// },
|
|
child: SizedBox(
|
|
width: MediaQuery.of(context).size.width,
|
|
child: Column(
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
raListHeading(),
|
|
raListItemWidget(text1: "Jaylon George",text2: "High",text3: "Aug/01/2024",color: true),
|
|
raListItemWidget(text1: "Jaylon George",text2: "Low",text3: "Sept/01/2024",color: false),
|
|
raListItemWidget(text1: "Jaylon George",text2: "Medium",text3: "Aug/01/2024",color: true),
|
|
raListItemWidget(text1: "Jaylon George",text2: "High",text3: "Sept/01/2024",color: false),
|
|
raListItemWidget(text1: "Jaylon George",text2: "Low",text3: "Aug/01/2024",color: true),
|
|
raListItemWidget(text1: "Jaylon George",text2: "High",text3: "Sept/01/2024",color: false),
|
|
raListItemWidget(text1: "Jaylon George",text2: "Low",text3: "Aug/01/2024",color: true),
|
|
raListItemWidget(text1: "Jaylon George",text2: "Medium",text3: "Sept/01/2024",color: false),
|
|
raListItemWidget(text1: "Jaylon George",text2: "High",text3: "Aug/01/2024",color: true),
|
|
raListItemWidget(text1: "Jaylon George",text2: "Low",text3: "Sept/01/2024",color: false),
|
|
],
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
|
|
}
|
|
|
|
Widget raListHeading() {
|
|
return Container(
|
|
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
|
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(
|
|
// decoration: const BoxDecoration(
|
|
// border: Border(
|
|
// right: BorderSide(
|
|
// color: CustomAppColors.kSmokeColor,
|
|
// ),
|
|
// ),
|
|
// ),
|
|
padding: const EdgeInsets.only(right: 0, top: 10, bottom: 10),
|
|
child: CustomTextWidget(
|
|
text: "Service User",
|
|
isExpanded: false,
|
|
fontWeight: FontWeight.w600,
|
|
fontSize: 12.sp,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 2.w,
|
|
color: CustomAppColors.kSmokeColor,
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
border: Border(
|
|
left: BorderSide(
|
|
color: CustomAppColors.kSmokeColor,
|
|
width: 2.w
|
|
),
|
|
),
|
|
),
|
|
padding: const EdgeInsets.only(right: 0, top: 10, bottom: 10),
|
|
child: CustomTextWidget(
|
|
text: "Risk",
|
|
isExpanded: false,
|
|
fontWeight: FontWeight.w600,
|
|
fontSize: 12.sp,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget raListItemWidget({required String text1,required String text2,required String text3,required bool color, Color? centerBorderColor}) {
|
|
return InkWell(
|
|
onTap: (){
|
|
Navigator.pushNamed(context, CustomRouteNames.kRiskAssessmentsTemplateScreenRoute);
|
|
},
|
|
child: Container(
|
|
padding: EdgeInsets.only(right: 3.w,left: 10.w),
|
|
height: 50.h,
|
|
decoration: BoxDecoration(
|
|
color: color ? CustomAppColors.kBlueColor.withAlpha(20) : null,
|
|
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(top: 10, bottom: 10),
|
|
child: Row(
|
|
children: [
|
|
CustomImageWidget(imagePath: AssetsManager.kManImagePng,width: 24.w,height: 24.h),
|
|
Container(
|
|
padding: const EdgeInsets.only(left: 5,),
|
|
child: CustomTextWidget(
|
|
text: text1,
|
|
textAlign: TextAlign.left,
|
|
fontSize: 11.sp,
|
|
isExpanded: false,),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: 2.w,
|
|
color: text2.toLowerCase() == "low"
|
|
? CustomAppColors.kDarkGreenColor
|
|
: text2.toLowerCase() == "medium"
|
|
? CustomAppColors.kYellowColor
|
|
: text2.toLowerCase() == "high"
|
|
? CustomAppColors.kDarkRedColor
|
|
: centerBorderColor ?? CustomAppColors.kLightGreyColor,
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Container(
|
|
padding: EdgeInsets.only(top: 10.h, bottom: 10.h,left: 12.w,right: 19.w),
|
|
child: CustomTextWidget(
|
|
text: text2,
|
|
textAlign: TextAlign.left,
|
|
fontSize: 12.sp,
|
|
isExpanded: false,),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
}
|