265 lines
8.7 KiB
Dart
265 lines
8.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../../../ftc_mobile_app.dart';
|
|
|
|
class SelectNoteScreen extends StatefulWidget {
|
|
const SelectNoteScreen({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<SelectNoteScreen> createState() => _SelectNoteScreenState();
|
|
}
|
|
|
|
class _SelectNoteScreenState extends State<SelectNoteScreen> {
|
|
|
|
SelectNoteScreenController controller = Get.put(SelectNoteScreenController());
|
|
|
|
@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: 'Select Note',
|
|
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: Center(
|
|
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(40.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),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
padding: EdgeInsets.only(left: 20.w,right: 20.w),
|
|
alignment: Alignment.topLeft,
|
|
height: 60.h,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
CustomTextWidget(
|
|
text: "Choose Categories",
|
|
fontSize: 14.sp,
|
|
fontWeight: FontWeight.w600,
|
|
fontColor: CustomAppColors.kDarkBlueTextColor,
|
|
isExpanded: false),
|
|
const SizedBox(height: 10,),
|
|
SingleChildScrollView(
|
|
scrollDirection: Axis.horizontal,
|
|
child: Row(
|
|
children: [
|
|
const SelectCategoryWidget(selected: true),
|
|
SizedBox(width: 5.w,),
|
|
const SelectCategoryWidget(textOfButton: "Category 2"),
|
|
SizedBox(width: 5.w,),
|
|
const SelectCategoryWidget(textOfButton: "Category 3"),
|
|
SizedBox(width: 5.w,),
|
|
const SelectCategoryWidget(textOfButton: "Category 4"),
|
|
SizedBox(width: 5.w,),
|
|
const SelectCategoryWidget(textOfButton: "Category 5"),
|
|
SizedBox(width: 5.w,),
|
|
const SelectCategoryWidget(textOfButton: "Category 6"),
|
|
SizedBox(width: 5.w,),
|
|
const SelectCategoryWidget(textOfButton: "Category 7"),
|
|
SizedBox(width: 5.w,),
|
|
const SelectCategoryWidget(textOfButton: "Category 8"),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
padding: EdgeInsets.only(left: 25.w,top: 10),
|
|
child: CustomTextWidget(
|
|
alignment: Alignment.topLeft,
|
|
text: "Notes",
|
|
fontSize: 14.sp,
|
|
fontWeight: FontWeight.w600,
|
|
fontColor: CustomAppColors.kDarkBlueTextColor,
|
|
isExpanded: false),
|
|
),
|
|
SizedBox(
|
|
height: MediaQuery.of(context).size.height/1.45,
|
|
child: ListView.builder(
|
|
itemCount: controller.users.length,
|
|
itemBuilder: (BuildContext context, int index) {
|
|
return NotesRoundOutlinedBox2(
|
|
context: context,
|
|
child: BuildNotesList2(
|
|
history: controller.user.aboutPatient,
|
|
date: controller.user.diagnosisDate,
|
|
userName: controller.users[index],
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class SelectCategoryWidget extends StatelessWidget {
|
|
const SelectCategoryWidget({
|
|
super.key,this.selected,this.textOfButton
|
|
});
|
|
|
|
final String? textOfButton;
|
|
final bool? selected;
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding: EdgeInsets.only(
|
|
left: 5.w, right: 5.w, bottom: 3.h, top: 3.h),
|
|
decoration: BoxDecoration(
|
|
color: selected!=null? CustomAppColors.kSecondaryColor:CustomAppColors.kPrimaryColor,
|
|
borderRadius: BorderRadius.circular(20.r),
|
|
border: Border.all(color: CustomAppColors.kSecondaryColor),
|
|
),
|
|
child: CustomTextWidget(
|
|
text: textOfButton??"Category 1",
|
|
fontSize: 12.sp,
|
|
fontWeight: FontWeight.w400,
|
|
fontColor: selected!=null?CustomAppColors.kWhiteColor : CustomAppColors.kSecondaryColor,
|
|
isExpanded: false),
|
|
);
|
|
}
|
|
}
|
|
|
|
class NotesRoundOutlinedBox2 extends StatelessWidget {
|
|
const NotesRoundOutlinedBox2({
|
|
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: 25.w,vertical: 5.h),
|
|
padding: EdgeInsets.all(16.sp),
|
|
decoration: BoxDecoration(
|
|
border: Border.all(color: CustomAppColors.kSecondaryColor),
|
|
borderRadius: BorderRadius.circular(18.r),
|
|
),
|
|
child: child,
|
|
);
|
|
}
|
|
}
|
|
|
|
class BuildNotesList2 extends StatelessWidget {
|
|
const BuildNotesList2({
|
|
super.key,
|
|
required this.date,
|
|
required this.history, required this.userName,
|
|
});
|
|
|
|
final String date;
|
|
final String history;
|
|
final String userName;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
CustomTextWidget(
|
|
text: 'Note Title',
|
|
isExpanded: false,
|
|
fontWeight: FontWeight.w600,
|
|
fontSize: 14.sp,
|
|
fontColor: CustomAppColors.kDarkBlueTextColor,
|
|
),
|
|
const Spacer(),
|
|
CustomImageWidget(
|
|
imagePath: AssetsManager.kGoToArrowIcon,
|
|
height: 18.66.h,
|
|
width: 18.w,
|
|
),
|
|
],
|
|
),
|
|
SizedBox(height: 5.h),
|
|
CustomTextWidget(
|
|
alignment: Alignment.centerLeft,
|
|
textAlign: TextAlign.left,
|
|
text: history,
|
|
isExpanded: false,
|
|
fontSize: 10.sp,
|
|
fontColor: CustomAppColors.kBlackColor,
|
|
),
|
|
],
|
|
);
|
|
}
|
|
} |