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/new_note_screen.dart

365 lines
11 KiB
Dart

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