|
|
|
|
@ -219,12 +219,11 @@ class _ProfilePageState extends State<ProfilePage> {
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context),
|
|
|
|
|
if (context.settingProvider.isUserFlowMedical)
|
|
|
|
|
FutureBuilder<List<UserRotaModel>>(
|
|
|
|
|
FutureBuilder<UserRotaModel?>(
|
|
|
|
|
future: _userProvider.getUserRota(),
|
|
|
|
|
builder: (cxt, snapshot) {
|
|
|
|
|
bool isLoading = snapshot.connectionState == ConnectionState.waiting;
|
|
|
|
|
|
|
|
|
|
if ((!isLoading && (snapshot.hasError || (snapshot.data?.isEmpty ?? true)))) {
|
|
|
|
|
if ((!isLoading && (snapshot.hasError || !snapshot.hasData))) {
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -238,56 +237,6 @@ class _ProfilePageState extends State<ProfilePage> {
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.black10),
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
if (!isLoading)
|
|
|
|
|
ListView.separated(
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
itemBuilder: (cxt, index) => Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
// Text(
|
|
|
|
|
// 'Site: ${_user.clientName ?? "-"}',
|
|
|
|
|
// style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
// ),
|
|
|
|
|
Text(
|
|
|
|
|
'Shift Name: ${snapshot.data![index].shiftName ?? "-"}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'Break: ${snapshot.data![index].breakTime ?? "-"}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
if (snapshot.data![index].leaveTypeCode?.isNotEmpty ?? false)
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Column(children: [
|
|
|
|
|
8.height,
|
|
|
|
|
Text(
|
|
|
|
|
snapshot.data![index].leaveTypeCode ?? "",
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120, fontWeight: FontWeight.w600),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
snapshot.data![index].leaveDescription ?? "",
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
)
|
|
|
|
|
else ...[
|
|
|
|
|
Text(
|
|
|
|
|
'Shift Start Time: ${snapshot.data![index].shTActualStartTime?.toTime ?? "-"}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'Shift Start Time: ${snapshot.data![index].shTActualEndTime?.toTime ?? "-"}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
separatorBuilder: (cxt, index) => const Divider().defaultStyle(context),
|
|
|
|
|
itemCount: snapshot.data!.length),
|
|
|
|
|
if (isLoading) ...[
|
|
|
|
|
Text(
|
|
|
|
|
'Shift Start Time Time',
|
|
|
|
|
@ -297,8 +246,60 @@ class _ProfilePageState extends State<ProfilePage> {
|
|
|
|
|
Text(
|
|
|
|
|
'Shift Actual Actual Start Time',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
).toShimmer(context: context, isShow: isLoading),
|
|
|
|
|
]
|
|
|
|
|
).toShimmer(context: context, isShow: isLoading)
|
|
|
|
|
] else
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
// Text(
|
|
|
|
|
// 'Site: ${_user.clientName ?? "-"}',
|
|
|
|
|
// style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
// ),
|
|
|
|
|
Text(
|
|
|
|
|
'Shift Name: ${snapshot.data!.shiftName ?? "-"}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'Break: ${snapshot.data!.breakTime ?? "-"}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
if (snapshot.data!.leaveTypeCode?.isNotEmpty ?? false)
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Column(children: [
|
|
|
|
|
8.height,
|
|
|
|
|
Text(
|
|
|
|
|
snapshot.data!.leaveTypeCode ?? "",
|
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120, fontWeight: FontWeight.w600),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
snapshot.data!.leaveDescription ?? "",
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
]),
|
|
|
|
|
)
|
|
|
|
|
else ...[
|
|
|
|
|
Text(
|
|
|
|
|
'Shift Start Time: ${snapshot.data!.shiftActualStartDatetime?.chatMsgTime ?? "-"}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'Shift Start Time: ${snapshot.data!.shiftActualEndDateTime?.chatMsgTime ?? "-"}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
Text(
|
|
|
|
|
'Swipe In: ${snapshot.data!.shTActualStartTime?.toTime ?? "-"}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
'Swipe Out: ${snapshot.data!.shTActualEndTime?.toTime ?? "-"}',
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral120),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context),
|
|
|
|
|
);
|
|
|
|
|
|