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/home/home_screen.dart

215 lines
8.5 KiB
Dart

import 'package:ftc_mobile_app/ftc_mobile_app.dart';
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/view/custom_widgets/my_circle_image.dart';
import 'package:ftc_mobile_app/view/screens/rota/new_rota_list_widget.dart';
import 'package:ftc_mobile_app/view/screens/webview/webview_screen.dart';
import 'package:get/get.dart';
import 'widgets/home_row_items.dart';
import 'widgets/line_row_widget.dart';
class HomeScreen extends StatelessWidget {
const HomeScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final controller = Get.find<DashboardScreenController>();
return Stack(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
60.verticalSpace,
Container(
height: 400.h,
padding: EdgeInsets.only(top: 100.h),
decoration: BoxDecoration(
color: CustomAppColors.kSecondaryColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20.r),
topRight: Radius.circular(20.r),
),
),
),
],
),
SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
16.verticalSpace,
//profile picture
Obx(() {
return MyCircleImage(
imageSize: 80.r,
url:
"${WebUrls.baseUrl}${DashboardScreenController.instance.myProfileData()?.user?.profilePictureUrl ?? ""}",
errorWidget: CircleAvatar(
backgroundColor: Colors.white,
child: CustomImageWidget(
imagePath: AssetsManager.kPersonMainIcon,
imageColor: CustomAppColors.kDarkBlueTextColor,
height: 80.r,
width: 80.r,
),
),
);
}),
3.verticalSpace,
//Name
Obx(
() => CustomTextWidget(
text: DashboardScreenController.instance
.myProfileData()
?.staffMemberName ??
"",
fontSize: 14.sp,
fontWeight: FontWeight.w600,
fontColor: CustomAppColors.kPrimaryColor,
),
),
//designation
Obx(
() => CustomTextWidget(
text: DashboardScreenController.instance
.myProfileData()
?.staffDesignation ??
"",
fontSize: 14.sp,
fontColor: CustomAppColors.kPrimaryColor,
fontWeight: FontWeight.w600,
),
),
16.verticalSpace,
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
HomeRowItems(
iconUrl: AssetsManager.kCalendarIcon,
textOfItem: "Rota",
onTap: () {
Navigator.pushNamed(
context,
CustomRouteNames.kRotaDashboardScreenRoute,
);
},
),
HomeRowItems(
iconUrl: AssetsManager.kPeopleUnselectedIcon,
textOfItem: "Clients",
color: CustomAppColors.kLightTextColor,
onTap: () {
Get.find<DashboardScreenController>()
.selectedIndex
.value = 3;
},
),
HomeRowItems(
iconUrl: AssetsManager.kMessageIcon,
textOfItem: "Message",
onTap: () {
Get.find<DashboardScreenController>()
.selectedIndex
.value = 2;
},
),
],
),
10.verticalSpace,
Container(
height: MediaQuery.of(context).size.height / 1.5,
decoration: BoxDecoration(
color: CustomAppColors.kWhiteColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20.r),
topRight: Radius.circular(20.r),
),
),
child: Column(
children: [
Obx(() {
return (controller.myShiftsList.isEmpty)
? FrequentFunctions.noWidget
: Padding(
padding: EdgeInsets.symmetric(
horizontal: 20.r, vertical: 10.r),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
CustomTextWidget(
text: "Your next Shifts",
isExpanded: false,
fontWeight: FontWeight.w600,
fontSize: 16.sp),
InkWell(
onTap: () {
Navigator.pushNamed(
context,
CustomRouteNames
.kYourRotaScreenRoute);
},
child: CustomTextWidget(
text: "See all",
isExpanded: false,
fontSize: 12.sp,
fontWeight: FontWeight.w600),
),
],
),
);
}),
Obx(
() => (controller.myShiftsList.isEmpty)
? FrequentFunctions.noWidget
: NewRotaListWidget(
shifts: controller.myShiftsList,
physics: const NeverScrollableScrollPhysics(),
),
),
10.verticalSpace,
InkWell(
onTap: () {
Navigator.pushNamed(
context,
CustomRouteNames.kWebviewScreen,
arguments: WebviewScreenArgument(
title: 'Policies and Procedures',
url: ConstantText.privacyUrl),
);
},
child: const LineRowWidget(
text: "Policies & Procedures",
icon: AssetsManager.kPoliciesIcon),
),
InkWell(
onTap: () {
//Todo: uncomment when start working
// Navigator.pushNamed(
// context,
// CustomRouteNames.kSettingsScreen,
// );
},
child: const LineRowWidget(
text: "Settings",
icon: AssetsManager.kSettingsIcon),
),
],
),
),
],
),
),
),
],
);
}
}