lab result changes

pull/8/head
Haroon Amjad 2 months ago
parent e044fc8c5e
commit a77fc49c68

@ -134,9 +134,7 @@ class ApiClientImp implements ApiClient {
} }
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] ?? IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND;
? body['isDentalAllowedBackend'] ?? IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
} }
//Todo: I have converted it to string //Todo: I have converted it to string
@ -229,8 +227,7 @@ class ApiClientImp implements ApiClient {
} else if (parsed['Result'] == 'OK') { } else if (parsed['Result'] == 'OK') {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode, onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode, failureType: ServerFailure("Error While Fetching data"));
failureType: ServerFailure("Error While Fetching data"));
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
} }
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {

@ -17,8 +17,8 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/'; // var BASE_URL = 'http://10.50.100.198:2018/';
var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/'; var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.201.204.103/'; // var BASE_URL = 'http://10.201.204.103/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';

@ -6,6 +6,8 @@ import 'package:hmg_patient_app_new/features/authentication/authentication_repo.
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart'; import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_repo.dart'; import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_repo.dart';
import 'package:hmg_patient_app_new/features/common/common_repo.dart'; import 'package:hmg_patient_app_new/features/common/common_repo.dart';
import 'package:hmg_patient_app_new/features/lab/lab_repo.dart';
import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_repo.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_repo.dart';
import 'package:hmg_patient_app_new/services/analytics/analytics_service.dart'; import 'package:hmg_patient_app_new/services/analytics/analytics_service.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart'; import 'package:hmg_patient_app_new/services/cache_service.dart';
@ -54,12 +56,20 @@ class AppDependencies {
// Repositories // Repositories
getIt.registerLazySingleton<CommonRepo>(() => CommonRepoImp(loggerService: getIt())); getIt.registerLazySingleton<CommonRepo>(() => CommonRepoImp(loggerService: getIt()));
getIt.registerLazySingleton<AuthenticationRepo>(() => AuthenticationRepoImp(loggerService: getIt<LoggerService>(), apiClient: getIt())); getIt.registerLazySingleton<AuthenticationRepo>(() => AuthenticationRepoImp(loggerService: getIt<LoggerService>(), apiClient: getIt()));
getIt.registerLazySingleton<BookAppointmentsRepo>( getIt.registerLazySingleton<BookAppointmentsRepo>(() => BookAppointmentsRepoImp(loggerService: getIt<LoggerService>(), apiClient: getIt()));
() => BookAppointmentsRepoImp(loggerService: getIt<LoggerService>(), apiClient: getIt()));
getIt.registerLazySingleton<MyAppointmentsRepo>(() => MyAppointmentsRepoImp(loggerService: getIt<LoggerService>(), apiClient: getIt())); getIt.registerLazySingleton<MyAppointmentsRepo>(() => MyAppointmentsRepoImp(loggerService: getIt<LoggerService>(), apiClient: getIt()));
getIt.registerLazySingleton<LabRepo>(() => LabRepoImp(loggerService: getIt<LoggerService>(), apiClient: getIt()));
// ViewModels // ViewModels
// Global/shared VMs LazySingleton // Global/shared VMs LazySingleton
getIt.registerLazySingleton<LabViewModel>(
() => LabViewModel(
labRepo: getIt(),
errorHandlerService: getIt(),
),
);
getIt.registerLazySingleton<AuthenticationViewModel>( getIt.registerLazySingleton<AuthenticationViewModel>(
() => AuthenticationViewModel( () => AuthenticationViewModel(
authenticationRepo: getIt(), authenticationRepo: getIt(),

@ -1,9 +1,59 @@
import 'package:hmg_patient_app_new/core/api/api_client.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart'; import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart';
import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart'; import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_response_model.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart';
abstract class AuthenticationRepo { abstract class LabRepo {
Future<Either<Failure, GenericApiModel<dynamic>>> getPatientLabOrders({ Future<Either<Failure, GenericApiModel<List<PatientLabOrdersResponseModel>>>> getPatientLabOrders({required num patientId});
required String firebaseToken, }
});
class LabRepoImp implements LabRepo {
final ApiClient apiClient;
final LoggerService loggerService;
LabRepoImp({required this.loggerService, required this.apiClient});
@override
Future<Either<Failure, GenericApiModel<List<PatientLabOrdersResponseModel>>>> getPatientLabOrders({required num patientId}) async {
final mapDevice = {"PatientID": patientId};
try {
GenericApiModel<List<PatientLabOrdersResponseModel>>? apiResponse;
Failure? failure;
await apiClient.post(
GET_Patient_LAB_ORDERS,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus}) {
try {
final list = response['ListPLO'];
if (list == null || list.isEmpty) {
throw Exception("lab list is empty");
}
final labOrders = list.map((item) => PatientLabOrdersResponseModel.fromJson(item as Map<String, dynamic>)).toList();
apiResponse = GenericApiModel<List<PatientLabOrdersResponseModel>>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: labOrders,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
} }

@ -1,13 +1,45 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/features/lab/lab_repo.dart';
import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_response_model.dart';
import 'package:hmg_patient_app_new/services/error_handler_service.dart';
class LabViewModel extends ChangeNotifier { class LabViewModel extends ChangeNotifier {
bool isLabOrdersLoading = false; bool isLabOrdersLoading = false;
bool isLabResultsLoading = false; bool isLabResultsLoading = false;
LabRepo labRepo;
ErrorHandlerService errorHandlerService;
List<PatientLabOrdersResponseModel> patientLabOrders = [];
LabViewModel({required this.labRepo, required this.errorHandlerService});
initLabProvider() { initLabProvider() {
isLabOrdersLoading = true; patientLabOrders.clear();
isLabResultsLoading = true; // isLabOrdersLoading = true;
// isLabResultsLoading = true;
// getPatientLabOrders();
notifyListeners(); notifyListeners();
} }
Future<void> getPatientLabOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await labRepo.getPatientLabOrders(patientId: 1231755);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
patientLabOrders = apiResponse.data!;
isLabOrdersLoading = false;
isLabResultsLoading = false;
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
} }

@ -0,0 +1,126 @@
class PatientLabOrdersResponseModel {
String? description;
dynamic femaleInterpretativeData;
int? gender;
bool? isCertificateAllowed;
int? lineItemNo;
dynamic maleInterpretativeData;
dynamic notes;
int? orderLineItemNo;
int? orderNo;
String? packageID;
int? patientID;
String? projectID;
String? referanceRange;
String? resultValue;
int? resultValueBasedLineItemNo;
String? resultValueFlag;
String? sampleCollectedOn;
String? sampleReceivedOn;
String? setupID;
dynamic superVerifiedOn;
String? testCode;
String? uOM;
String? verifiedOn;
String? packageShortDescription;
String? testShortDescription;
dynamic verifiedOnDateTime;
num? percentage;
num? width;
num? resultTypeID;
PatientLabOrdersResponseModel(
{this.description,
this.femaleInterpretativeData,
this.gender,
this.isCertificateAllowed,
this.lineItemNo,
this.maleInterpretativeData,
this.notes,
this.orderLineItemNo,
this.orderNo,
this.packageID,
this.patientID,
this.projectID,
this.referanceRange,
this.resultValue,
this.resultValueBasedLineItemNo,
this.resultValueFlag,
this.sampleCollectedOn,
this.sampleReceivedOn,
this.setupID,
this.superVerifiedOn,
this.testCode,
this.uOM,
this.verifiedOn,
this.verifiedOnDateTime});
PatientLabOrdersResponseModel.fromJson(Map<String, dynamic> json, {String? flag}) {
description = json['Description'];
femaleInterpretativeData = json['FemaleInterpretativeData'];
gender = json['Gender'];
isCertificateAllowed = json['IsCertificateAllowed'];
lineItemNo = json['LineItemNo'];
maleInterpretativeData = json['MaleInterpretativeData'];
notes = json['Notes'];
orderLineItemNo = json['OrderLineItemNo'];
orderNo = json['OrderNo'];
packageID = json['PackageID'];
patientID = json['PatientID'];
projectID = json['ProjectID'];
referanceRange = json['ReferanceRange'];
resultValue = json['ResultValue'];
resultValueBasedLineItemNo = json['ResultValueBasedLineItemNo'];
resultValueFlag = json['ResultValueFlag'];
sampleCollectedOn = json['SampleCollectedOn'];
sampleReceivedOn = json['SampleReceivedOn'];
setupID = json['SetupID'];
superVerifiedOn = json['SuperVerifiedOn'];
testCode = json['TestCode'];
uOM = json['UOM'];
verifiedOn = json['VerifiedOn'];
verifiedOnDateTime = json['VerifiedOnDateTime'];
packageShortDescription = json['PackageShortDescription'];
testShortDescription = json['TestShortDescription'];
resultTypeID = json['ResultTypeID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Description'] = this.description;
data['FemaleInterpretativeData'] = this.femaleInterpretativeData;
data['Gender'] = this.gender;
data['IsCertificateAllowed'] = this.isCertificateAllowed;
data['LineItemNo'] = this.lineItemNo;
data['MaleInterpretativeData'] = this.maleInterpretativeData;
data['Notes'] = this.notes;
data['OrderLineItemNo'] = this.orderLineItemNo;
data['OrderNo'] = this.orderNo;
data['PackageID'] = this.packageID;
data['PatientID'] = this.patientID;
data['ProjectID'] = this.projectID;
data['ReferanceRange'] = this.referanceRange;
data['ResultValue'] = this.resultValue;
data['ResultValueBasedLineItemNo'] = this.resultValueBasedLineItemNo;
data['ResultValueFlag'] = this.resultValueFlag;
data['SampleCollectedOn'] = this.sampleCollectedOn;
data['SampleReceivedOn'] = this.sampleReceivedOn;
data['SetupID'] = this.setupID;
data['SuperVerifiedOn'] = this.superVerifiedOn;
data['TestCode'] = this.testCode;
data['UOM'] = this.uOM;
data['VerifiedOn'] = this.verifiedOn;
data['VerifiedOnDateTime'] = this.verifiedOnDateTime;
data['PackageShortDescription'] = this.packageShortDescription;
data['TestShortDescription'] = this.testShortDescription;
return data;
}
bool shouldShowResultBarAndGraph() {
if (resultTypeID == null) return false;
if (resultTypeID == 6) return false;
return true;
}
}

@ -7,7 +7,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart'; import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/providers/bottom_navigation_provider.dart';
import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart'; import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart';
import 'package:hmg_patient_app_new/routes/app_routes.dart'; import 'package:hmg_patient_app_new/routes/app_routes.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart'; import 'package:hmg_patient_app_new/services/logger_service.dart';
@ -52,11 +51,11 @@ void main() async {
path: 'assets/langs', path: 'assets/langs',
fallbackLocale: Locale('en', 'US'), fallbackLocale: Locale('en', 'US'),
child: MultiProvider(providers: <SingleChildWidget>[ child: MultiProvider(providers: <SingleChildWidget>[
ChangeNotifierProvider<BottomNavigationProvider>(
create: (_) => BottomNavigationProvider(),
),
ChangeNotifierProvider<LabViewModel>( ChangeNotifierProvider<LabViewModel>(
create: (_) => LabViewModel(), create: (_) => LabViewModel(
labRepo: getIt(),
errorHandlerService: getIt(),
),
), ),
ChangeNotifierProvider<AuthenticationViewModel>( ChangeNotifierProvider<AuthenticationViewModel>(
create: (_) => AuthenticationViewModel( create: (_) => AuthenticationViewModel(

@ -16,7 +16,6 @@ import 'package:hmg_patient_app_new/presentation/home/widgets/habib_wallet_card.
import 'package:hmg_patient_app_new/presentation/home/widgets/large_service_card.dart'; import 'package:hmg_patient_app_new/presentation/home/widgets/large_service_card.dart';
import 'package:hmg_patient_app_new/presentation/home/widgets/small_service_card.dart'; import 'package:hmg_patient_app_new/presentation/home/widgets/small_service_card.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart';
import 'package:hmg_patient_app_new/providers/bottom_navigation_provider.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart'; import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
@ -34,247 +33,245 @@ class _LandingPageState extends State<LandingPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>(); AppState appState = getIt.get<AppState>();
final AuthenticationViewModel authenticationViewModel = context.read<AuthenticationViewModel>(); final AuthenticationViewModel authenticationViewModel = context.read<AuthenticationViewModel>();
return Consumer<BottomNavigationProvider>(builder: (context, navigationProvider, child) { return Scaffold(
return Scaffold( backgroundColor: AppColors.bgScaffoldColor,
backgroundColor: AppColors.bgScaffoldColor, body: Padding(
body: Padding( padding: EdgeInsets.all(24.h),
padding: EdgeInsets.all(24.h), child: SingleChildScrollView(
child: SingleChildScrollView( child: Column(
child: Column( children: [
children: [ Padding(
Padding( padding: EdgeInsets.only(top: 50.0),
padding: EdgeInsets.only(top: 50.0), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [ CustomButton(
CustomButton( text: LocaleKeys.loginOrRegister.tr(context: context),
text: LocaleKeys.loginOrRegister.tr(context: context), onPressed: () async {
onPressed: () async { await authenticationViewModel.selectDeviceImei();
await authenticationViewModel.selectDeviceImei(); },
}, backgroundColor: Color(0xffFEE9EA),
backgroundColor: Color(0xffFEE9EA), borderColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA), textColor: Color(0xffED1C2B),
textColor: Color(0xffED1C2B), fontSize: 16,
fontSize: 16, fontWeight: FontWeight.w500,
fontWeight: FontWeight.w500, borderRadius: 12,
borderRadius: 12, padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), height: 50,
height: 50, ),
), Utils.buildSvgWithAssets(
Utils.buildSvgWithAssets( icon: AppAssets.contact_icon,
icon: AppAssets.contact_icon, width: 24,
width: 24, height: 24,
height: 24, ).onPress(() {
).onPress(() { Navigator.of(context).push(
Navigator.of(context).push( FadePage(
FadePage( page: MedicalFilePage(),
page: MedicalFilePage(), // page: LoginScreen(),
// page: LoginScreen(), ),
), );
); }),
}), ],
],
),
), ),
SizedBox(height: 16.h), ),
appState.isAuthenticated SizedBox(height: 16.h),
? Column( appState.isAuthenticated
children: [ ? Column(
Container( children: [
width: double.infinity, Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( width: double.infinity,
color: AppColors.whiteColor, decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
borderRadius: 24, color: AppColors.whiteColor,
), borderRadius: 24,
child: Padding(
padding: EdgeInsets.all(12.h),
child: Column(
children: [
Utils.buildSvgWithAssets(icon: AppAssets.home_calendar_icon, width: 32.h, height: 32.h),
SizedBox(height: 12.h),
"You do not have any upcoming appointment. Please book an appointment".toText12(isCenter: true),
SizedBox(height: 12.h),
CustomButton(
text: LocaleKeys.bookAppo.tr(context: context),
onPressed: () {
Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (BuildContext context) => LandingPage()),
);
},
backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA),
textColor: Color(0xffED1C2B),
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40,
icon: AppAssets.add_icon,
iconColor: AppColors.primaryRedColor,
),
],
),
),
), ),
SizedBox(height: 12.h), child: Padding(
Row( padding: EdgeInsets.all(12.h),
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Column(
children: [ children: [
"Quick Links".toText16(isBold: true), Utils.buildSvgWithAssets(icon: AppAssets.home_calendar_icon, width: 32.h, height: 32.h),
Row( SizedBox(height: 12.h),
children: [ "You do not have any upcoming appointment. Please book an appointment".toText12(isCenter: true),
"View medical file".toText12(color: AppColors.primaryRedColor), SizedBox(height: 12.h),
SizedBox(width: 2.h), CustomButton(
Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h), text: LocaleKeys.bookAppo.tr(context: context),
], onPressed: () {
), Navigator.of(context).pushReplacement(
], MaterialPageRoute(builder: (BuildContext context) => LandingPage()),
);
},
backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA),
textColor: Color(0xffED1C2B),
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40,
icon: AppAssets.add_icon,
iconColor: AppColors.primaryRedColor,
),
],
),
), ),
SizedBox(height: 12.h), ),
Container( SizedBox(height: 12.h),
height: 127.h, Row(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( mainAxisAlignment: MainAxisAlignment.spaceBetween,
color: AppColors.whiteColor, children: [
borderRadius: 24, "Quick Links".toText16(isBold: true),
Row(
children: [
"View medical file".toText12(color: AppColors.primaryRedColor),
SizedBox(width: 2.h),
Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h),
],
), ),
child: Padding( ],
padding: EdgeInsets.all(16.h), ),
child: Column( SizedBox(height: 12.h),
children: [ Container(
Expanded( height: 127.h,
child: ListView.separated( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
scrollDirection: Axis.horizontal, color: AppColors.whiteColor,
itemCount: LandingPageData.getLoggedInServiceCardsList.length, borderRadius: 24,
shrinkWrap: true, ),
padding: const EdgeInsets.only(left: 0, right: 8), child: Padding(
itemBuilder: (context, index) { padding: EdgeInsets.all(16.h),
return AnimationConfiguration.staggeredList( child: Column(
position: index, children: [
duration: const Duration(milliseconds: 1000), Expanded(
child: SlideAnimation( child: ListView.separated(
horizontalOffset: 100.0, scrollDirection: Axis.horizontal,
child: FadeInAnimation( itemCount: LandingPageData.getLoggedInServiceCardsList.length,
child: SmallServiceCard( shrinkWrap: true,
serviceName: LandingPageData.getLoggedInServiceCardsList[index].serviceName, padding: const EdgeInsets.only(left: 0, right: 8),
icon: LandingPageData.getLoggedInServiceCardsList[index].icon, itemBuilder: (context, index) {
title: LandingPageData.getLoggedInServiceCardsList[index].title, return AnimationConfiguration.staggeredList(
subtitle: LandingPageData.getLoggedInServiceCardsList[index].subtitle, position: index,
iconColor: LandingPageData.getLoggedInServiceCardsList[index].iconColor, duration: const Duration(milliseconds: 1000),
textColor: LandingPageData.getLoggedInServiceCardsList[index].textColor, child: SlideAnimation(
backgroundColor: LandingPageData.getLoggedInServiceCardsList[index].backgroundColor, horizontalOffset: 100.0,
isBold: LandingPageData.getLoggedInServiceCardsList[index].isBold, child: FadeInAnimation(
), child: SmallServiceCard(
serviceName: LandingPageData.getLoggedInServiceCardsList[index].serviceName,
icon: LandingPageData.getLoggedInServiceCardsList[index].icon,
title: LandingPageData.getLoggedInServiceCardsList[index].title,
subtitle: LandingPageData.getLoggedInServiceCardsList[index].subtitle,
iconColor: LandingPageData.getLoggedInServiceCardsList[index].iconColor,
textColor: LandingPageData.getLoggedInServiceCardsList[index].textColor,
backgroundColor: LandingPageData.getLoggedInServiceCardsList[index].backgroundColor,
isBold: LandingPageData.getLoggedInServiceCardsList[index].isBold,
), ),
), ),
); ),
}, );
separatorBuilder: (BuildContext cxt, int index) => 0.width, },
), separatorBuilder: (BuildContext cxt, int index) => 0.width,
), ),
], ),
), ],
), ),
) ),
], )
) ],
: Container( )
height: 127.h, : Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( height: 127.h,
color: AppColors.whiteColor, decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
borderRadius: 24, color: AppColors.whiteColor,
), borderRadius: 24,
child: Padding( ),
padding: EdgeInsets.all(16.h), child: Padding(
child: Column( padding: EdgeInsets.all(16.h),
children: [ child: Column(
Expanded( children: [
child: ListView.separated( Expanded(
scrollDirection: Axis.horizontal, child: ListView.separated(
itemCount: LandingPageData.getNotLoggedInServiceCardsList.length, scrollDirection: Axis.horizontal,
shrinkWrap: true, itemCount: LandingPageData.getNotLoggedInServiceCardsList.length,
padding: const EdgeInsets.only(left: 0, right: 8), shrinkWrap: true,
itemBuilder: (context, index) { padding: const EdgeInsets.only(left: 0, right: 8),
return AnimationConfiguration.staggeredList( itemBuilder: (context, index) {
position: index, return AnimationConfiguration.staggeredList(
duration: const Duration(milliseconds: 1000), position: index,
child: SlideAnimation( duration: const Duration(milliseconds: 1000),
horizontalOffset: 100.0, child: SlideAnimation(
child: FadeInAnimation( horizontalOffset: 100.0,
child: SmallServiceCard( child: FadeInAnimation(
icon: LandingPageData.getNotLoggedInServiceCardsList[index].icon, child: SmallServiceCard(
title: LandingPageData.getNotLoggedInServiceCardsList[index].title, icon: LandingPageData.getNotLoggedInServiceCardsList[index].icon,
subtitle: LandingPageData.getNotLoggedInServiceCardsList[index].subtitle, title: LandingPageData.getNotLoggedInServiceCardsList[index].title,
iconColor: LandingPageData.getNotLoggedInServiceCardsList[index].iconColor, subtitle: LandingPageData.getNotLoggedInServiceCardsList[index].subtitle,
textColor: LandingPageData.getNotLoggedInServiceCardsList[index].textColor, iconColor: LandingPageData.getNotLoggedInServiceCardsList[index].iconColor,
backgroundColor: LandingPageData.getNotLoggedInServiceCardsList[index].backgroundColor, textColor: LandingPageData.getNotLoggedInServiceCardsList[index].textColor,
isBold: LandingPageData.getNotLoggedInServiceCardsList[index].isBold, backgroundColor: LandingPageData.getNotLoggedInServiceCardsList[index].backgroundColor,
), isBold: LandingPageData.getNotLoggedInServiceCardsList[index].isBold,
), ),
), ),
); ),
}, );
separatorBuilder: (BuildContext cxt, int index) => 0.width, },
), separatorBuilder: (BuildContext cxt, int index) => 0.width,
), ),
], ),
), ],
), ),
), ),
SizedBox(height: 16.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Services".toText16(isBold: true),
Row(
children: [
"View all services".toText12(color: AppColors.primaryRedColor),
SizedBox(width: 2.h),
Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h),
],
), ),
], SizedBox(height: 16.h),
), Row(
SizedBox(height: 16.h), mainAxisAlignment: MainAxisAlignment.spaceBetween,
SizedBox( children: [
height: 325.h, "Services".toText16(isBold: true),
child: Column( Row(
children: [ children: [
Expanded( "View all services".toText12(color: AppColors.primaryRedColor),
child: ListView.separated( SizedBox(width: 2.h),
scrollDirection: Axis.horizontal, Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h),
itemCount: LandingPageData.getServiceCardsList.length, ],
shrinkWrap: true, ),
padding: const EdgeInsets.only(left: 0, right: 8), ],
itemBuilder: (context, index) { ),
return AnimationConfiguration.staggeredList( SizedBox(height: 16.h),
position: index, SizedBox(
duration: const Duration(milliseconds: 1000), height: 325.h,
child: SlideAnimation( child: Column(
horizontalOffset: 100.0, children: [
child: FadeInAnimation( Expanded(
child: LargeServiceCard( child: ListView.separated(
image: LandingPageData.getServiceCardsList[index].icon, scrollDirection: Axis.horizontal,
title: LandingPageData.getServiceCardsList[index].title, itemCount: LandingPageData.getServiceCardsList.length,
subtitle: LandingPageData.getServiceCardsList[index].subtitle, shrinkWrap: true,
icon: LandingPageData.getServiceCardsList[index].largeCardIcon, padding: const EdgeInsets.only(left: 0, right: 8),
), itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 1000),
child: SlideAnimation(
horizontalOffset: 100.0,
child: FadeInAnimation(
child: LargeServiceCard(
image: LandingPageData.getServiceCardsList[index].icon,
title: LandingPageData.getServiceCardsList[index].title,
subtitle: LandingPageData.getServiceCardsList[index].subtitle,
icon: LandingPageData.getServiceCardsList[index].largeCardIcon,
), ),
), ),
); ),
}, );
separatorBuilder: (BuildContext cxt, int index) => 0.width, },
), separatorBuilder: (BuildContext cxt, int index) => 0.width,
), ),
], ),
), ],
), ),
SizedBox(height: 16.h), ),
appState.isAuthenticated ? HabibWalletCard() : SizedBox(), SizedBox(height: 16.h),
], appState.isAuthenticated ? HabibWalletCard() : SizedBox(),
), ],
), ),
), ),
); ),
}); );
} }
} }

@ -29,10 +29,10 @@ class _LabOrdersPageState extends State<LabOrdersPage> {
// Sample data for demonstration // Sample data for demonstration
final List<String> labOrders = [ final List<String> labOrders = [
'Blood Test', 'Mohammad Al Harbi',
'Urine Test', 'Mohammad Al Harbi',
'X-Ray', 'Mohammad Al Harbi',
'MRI', 'Mohammad Al Harbi',
]; ];
@override @override
@ -116,7 +116,7 @@ class _LabOrdersPageState extends State<LabOrdersPage> {
borderColor: getLabOrderStatusColor(44).withOpacity(0.01), borderColor: getLabOrderStatusColor(44).withOpacity(0.01),
textColor: getLabOrderStatusColor(44), textColor: getLabOrderStatusColor(44),
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.normal, fontWeight: FontWeight.w500,
borderRadius: 8, borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 30.h, height: 30.h,
@ -125,7 +125,48 @@ class _LabOrdersPageState extends State<LabOrdersPage> {
], ],
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),
Text(labOrders[index], style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), Row(
children: [
Image.network(
"https://hmgwebservices.com/Images/MobileImages/SUWAIDI/152305.png",
width: 24.h,
height: 24.h,
fit: BoxFit.fill,
).circle(100),
SizedBox(width: 4.h),
Text(labOrders[index], style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
],
),
SizedBox(height: 8.h),
Row(
children: [
CustomButton(
text: "12th June, 2025",
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 12,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 24.h,
),
SizedBox(width: 8.h),
CustomButton(
text: "Clinic: Cardiology",
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 12,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 24.h,
),
],
),
], ],
), ),
), ),

@ -1,12 +0,0 @@
import 'package:flutter/material.dart';
class BottomNavigationProvider extends ChangeNotifier {
int _currentIndex = 0;
int get currentIndex => _currentIndex;
void setIndex(int index) {
_currentIndex = index;
notifyListeners();
}
}
Loading…
Cancel
Save