|
|
|
|
@ -1,3 +1,5 @@
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
|
|
|
|
@ -16,11 +18,24 @@ import 'package:hmg_patient_app_new/widgets/input_widget.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/shimmer/movies_shimmer_widget.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class MedicalFilePage extends StatelessWidget {
|
|
|
|
|
class MedicalFilePage extends StatefulWidget {
|
|
|
|
|
MedicalFilePage({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<MedicalFilePage> createState() => _MedicalFilePageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _MedicalFilePageState extends State<MedicalFilePage> {
|
|
|
|
|
late InsuranceViewModel insuranceViewModel;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
scheduleMicrotask(() {
|
|
|
|
|
insuranceViewModel.initInsuranceProvider();
|
|
|
|
|
});
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
insuranceViewModel = Provider.of<InsuranceViewModel>(context);
|
|
|
|
|
@ -30,13 +45,11 @@ class MedicalFilePage extends StatelessWidget {
|
|
|
|
|
title: const Text('Appointments'),
|
|
|
|
|
backgroundColor: AppColors.bgScaffoldColor,
|
|
|
|
|
),
|
|
|
|
|
body: Padding(
|
|
|
|
|
padding: EdgeInsets.all(24.h),
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.medicalFile.tr(context: context).toText22(isBold: true),
|
|
|
|
|
LocaleKeys.medicalFile.tr(context: context).toText22(isBold: true).paddingSymmetrical(24.h, 0.0),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
TextInputWidget(
|
|
|
|
|
labelText: LocaleKeys.search.tr(context: context),
|
|
|
|
|
@ -50,7 +63,7 @@ class MedicalFilePage extends StatelessWidget {
|
|
|
|
|
isAllowLeadingIcon: true,
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 8.h),
|
|
|
|
|
leadingIcon: AppAssets.student_card,
|
|
|
|
|
),
|
|
|
|
|
).paddingSymmetrical(24.h, 0.0),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
@ -167,24 +180,24 @@ class MedicalFilePage extends StatelessWidget {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingSymmetrical(24.h, 0.0),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
CustomTabBar(
|
|
|
|
|
activeTextColor: Color(0xffED1C2B),
|
|
|
|
|
activeBackgroundColor: Color(0xffED1C2B).withValues(alpha: .1),
|
|
|
|
|
tabs: [
|
|
|
|
|
CustomTabBarModel(AppAssets.myFilesBottom, "General".needTranslation),
|
|
|
|
|
CustomTabBarModel(AppAssets.insurance, "Insurance".needTranslation),
|
|
|
|
|
CustomTabBarModel(AppAssets.requests, "Requests".needTranslation),
|
|
|
|
|
CustomTabBarModel(AppAssets.myFilesBottom, LocaleKeys.general.tr(context: context).needTranslation),
|
|
|
|
|
CustomTabBarModel(AppAssets.insurance, LocaleKeys.insurance.tr(context: context)),
|
|
|
|
|
CustomTabBarModel(AppAssets.requests, LocaleKeys.request.tr(context: context).needTranslation),
|
|
|
|
|
CustomTabBarModel(AppAssets.more, "More".needTranslation),
|
|
|
|
|
],
|
|
|
|
|
onTabChange: (index) {},
|
|
|
|
|
),
|
|
|
|
|
).paddingSymmetrical(24.h, 0.0),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
//Insurance Tab Data
|
|
|
|
|
Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) {
|
|
|
|
|
return insuranceVM.isInsuranceLoading
|
|
|
|
|
? const MoviesShimmerWidget()
|
|
|
|
|
? const MoviesShimmerWidget().paddingSymmetrical(24.h, 0.0)
|
|
|
|
|
: PatientInsuranceCard(
|
|
|
|
|
insuranceCardDetailsModel: insuranceVM.patientInsuranceList.first,
|
|
|
|
|
isInsuranceExpired: DateTime.now().isBefore(DateUtil.convertStringToDate(insuranceVM.patientInsuranceList.first.cardValidTo)));
|
|
|
|
|
@ -201,11 +214,11 @@ class MedicalFilePage extends StatelessWidget {
|
|
|
|
|
MedicalFileCard(label: "My Invoices List", textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.eye_result_icon),
|
|
|
|
|
MedicalFileCard(label: "Ancillary Orders List", textColor: AppColors.blackColor, backgroundColor: AppColors.whiteColor, svgIcon: AppAssets.eye_result_icon),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).paddingSymmetrical(24.h, 0.0),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|