This repository has been archived on 2024-10-18. You can view files and clone it, but cannot push or open issues or pull requests.
ftc_patient_app/lib/view/screens/clients/document_details_screen.dart

364 lines
12 KiB
Dart

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