pull/212/head
haroon amjad 13 hours ago
parent 081dfce480
commit e3f5bb69ac

@ -50,6 +50,8 @@
android:name="android.permission.ACCESS_BACKGROUND_LOCATION"
tools:node="remove" /> <!-- <uses-permission android:name="android.permission.INTERNET" /> -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" tools:node="remove" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" tools:node="remove" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" tools:node="remove" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />

@ -45,6 +45,7 @@
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" tools:node="remove" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" tools:node="remove" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" tools:node="remove" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" tools:node="remove" />
<uses-permission
android:name="android.permission.ACCESS_BACKGROUND_LOCATION"

@ -1679,10 +1679,15 @@
"overWeight": "وزن زائد",
"underWeight": "وزن ناقص",
"nearestGate": "أقرب بوابة",
"RRTDDetails": "فريق الاستجابة السريعة يقوم بتقديم رعاية صحية متكاملة لجميع الحالات الطارئة و المستقرة، الخدمة تشمل جميع الأعمار بما في ذلك حالات الأطفال."
"RRTDDetails": "فريق الاستجابة السريعة يقوم بتقديم رعاية صحية متكاملة لجميع الحالات الطارئة و المستقرة، الخدمة تشمل جميع الأعمار بما في ذلك حالات الأطفال.",
"fromHospitalSubtitle": "نقل من المستشفى إلى منزلك",
"normalMapType": "افتراضي",
"satelliteMapType": "قمر صناعي",
"terrainMapType": "تضاريس",
"hybridMapType": "هجين"
"hybridMapType": "هجين",
"openCamera": "افتح الكاميرا",
"openGallery": "افتح المعرض",
"openFiles": "فتح الملفات",
"generateAiAnalysisRadResult": "بإنشاء تحليل الذكاء الاصطناعي لهذا التقرير",
"grantLocationPermission": "يرجى منح إذن الوصول إلى الموقع من إعدادات التطبيق للحصول على نتائج أفضل."
}

@ -1671,10 +1671,15 @@
"overWeight": "OverWeight",
"underWeight": "UnderWeight",
"nearestGate": "Nearest Gate",
"RRTDDetails": "The Rapid response team provides a comprehensive medical service for all sorts of urgent and stable cases of all ages, including adult and paediatric patients."
"RRTDDetails": "The Rapid response team provides a comprehensive medical service for all sorts of urgent and stable cases of all ages, including adult and paediatric patients.",
"fromHospitalSubtitle": "Transfer from the hospital back to your home",
"normalMapType": "Default",
"satelliteMapType": "Satellite",
"terrainMapType": "Terrain",
"hybridMapType": "Hybrid"
"hybridMapType": "Hybrid",
"openCamera": "Open Camera",
"openGallery": "Open Gallery",
"openFiles": "Open Files",
"generateAiAnalysisRadResult": "Generate AI analysis for this result",
"grantLocationPermission": "Please grant location permission from app settings to see better results."
}

@ -4,7 +4,7 @@ import 'package:hmg_patient_app_new/core/enums.dart';
class ApiConsts {
static const maxSmallScreen = 660;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.preProd;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT
@ -940,6 +940,8 @@ const PROFILE_SETTING = 'Services/Patients.svc/REST/GetPateintInfoForUpdate';
const SAVE_SETTING = 'Services/Patients.svc/REST/UpdatePateintInfo';
const DOWNLOAD_INVOICE_PDF = 'Services/Notifications.svc/REST/DownloadInvoiceReport';
class ApiKeyConstants {
static final String googleMapsApiKey = 'AIzaSyB6TERnxIr0yJ3qG4ULBZbu0sAD4tGqtng';
}

@ -99,7 +99,7 @@ class LocationUtils {
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
navigationService.navigatorKey.currentContext!,
child: Utils.getWarningWidget(
loadingText: "Please grant location permission from app settings to see better results",
loadingText: LocaleKeys.grantLocationPermission.tr(),
isShowActionButtons: true,
onCancelTap: () {
navigationService.pop();
@ -124,7 +124,7 @@ class LocationUtils {
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
navigationService.navigatorKey.currentContext!,
child: Utils.getWarningWidget(
loadingText: "Please grant location permission from app settings to see better results",
loadingText: LocaleKeys.grantLocationPermission.tr(),
isShowActionButtons: true,
onCancelTap: () {
navigationService.pop();
@ -285,7 +285,7 @@ class LocationUtils {
title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!),
navigationService.navigatorKey.currentContext!,
child: Utils.getWarningWidget(
loadingText: "Please grant location permission from app settings to see better results",
loadingText: LocaleKeys.grantLocationPermission.tr(),
isShowActionButtons: true,
onCancelTap: () {
navigationService.pop();

@ -51,7 +51,7 @@ class VitalSignUiModel {
}
// Warning for both low and overweight/underweight BMI, since they can indicate potential health issues.
if (s.contains('low') || s.contains(LocaleKeys.underWeight.tr()) || s.contains(LocaleKeys.overWeight.tr())) {
if (s.contains('low') || s.contains("OverWeight") || s.contains("وزن زائد") || s.contains("UnderWeight") || s.contains("وزن ناقص")) {
final Color yellowBg = AppColors.highAndLow.withValues(alpha: 0.12);
return VitalSignUiModel(
iconBg: yellowBg,

@ -13,6 +13,8 @@ abstract class MyInvoicesRepo {
Future<Either<Failure, GenericApiModel<GetInvoiceDetailsResponseModel>>> getInvoiceDetails({required num appointmentNo, required num invoiceNo, required int projectID});
Future<Either<Failure, GenericApiModel<dynamic>>> sendInvoiceEmail({required num appointmentNo, required int projectID});
Future<Either<Failure, GenericApiModel<dynamic>>> downloadInvoice({required String setupId, required int invoiceNo, required int projectID});
}
class MyInvoicesRepoImp implements MyInvoicesRepo {
@ -138,4 +140,42 @@ class MyInvoicesRepoImp implements MyInvoicesRepo {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel>> downloadInvoice({required String setupId, required int invoiceNo, required int projectID}) async {
Map<String, dynamic> mapDevice = {
"SetupID": setupId,
"ProjectID": projectID,
"InvoiceNo": invoiceNo,
};
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(
DOWNLOAD_INVOICE_PDF,
body: mapDevice,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
apiResponse = GenericApiModel(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: response["InvoiceReportPDFContent"],
);
} 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()));
}
}
}

@ -26,6 +26,8 @@ class MyInvoicesViewModel extends ChangeNotifier {
TextEditingController filterSearchController = TextEditingController();
String? selectedFilterItem;
String? downloadInvoicePDFBase64 = "";
MyInvoicesViewModel({required this.myInvoicesRepo, required this.errorHandlerService, required this.navServices});
setInvoicesListLoading() {
@ -68,7 +70,6 @@ class MyInvoicesViewModel extends ChangeNotifier {
Future<void> getInvoiceDetails({required num appointmentNo, required num invoiceNo, required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myInvoicesRepo.getInvoiceDetails(appointmentNo: appointmentNo, invoiceNo: invoiceNo, projectID: projectID);
result.fold(
(failure) async {
isInvoiceDetailsLoading = false;
@ -93,6 +94,32 @@ class MyInvoicesViewModel extends ChangeNotifier {
);
}
Future<void> downloadInvoicePDF({required String setupId, required int invoiceNo, required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myInvoicesRepo.downloadInvoice(setupId: setupId, invoiceNo: invoiceNo, projectID: projectID);
result.fold(
(failure) async {
if (onError != null) {
onError(failure.message);
}
},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
if (apiResponse.data != null && apiResponse.data!.isNotEmpty) {
downloadInvoicePDFBase64 = apiResponse.data!;
} else {
downloadInvoicePDFBase64 = "";
}
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> sendInvoiceEmail({required num appointmentNo, required int projectID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myInvoicesRepo.sendInvoiceEmail(appointmentNo: appointmentNo, projectID: projectID);

@ -1676,5 +1676,10 @@ abstract class LocaleKeys {
static const satelliteMapType = 'satelliteMapType';
static const terrainMapType = 'terrainMapType';
static const hybridMapType = 'hybridMapType';
static const openCamera = 'openCamera';
static const openGallery = 'openGallery';
static const openFiles = 'openFiles';
static const generateAiAnalysisRadResult = 'generateAiAnalysisRadResult';
static const grantLocationPermission = 'grantLocationPermission';
}

@ -622,19 +622,21 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
iconSize: 36.w,
isLocked: !(myAppointmentsVM.appointmentRatedResponseModel!.isAppointmentRated ?? true),
).onPress(() {
showCommonBottomSheetWithoutHeight(
context,
title: LocaleKeys.doctorRating.tr(context: context),
isCloseButtonVisible: true,
child: StatefulBuilder(
builder: (context, setState) {
return AppointmentRatingWidget(
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
);
},
),
isFullScreen: false,
);
if(!(myAppointmentsVM.appointmentRatedResponseModel!.isAppointmentRated ?? true)) {
showCommonBottomSheetWithoutHeight(
context,
title: LocaleKeys.doctorRating.tr(context: context),
isCloseButtonVisible: true,
child: StatefulBuilder(
builder: (context, setState) {
return AppointmentRatingWidget(
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
);
},
),
isFullScreen: false,
);
}
}),
],
);

@ -75,7 +75,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: false,
side: BorderSide(color: AppColors.ratingColorYellow, width: 3.h),
// side: BorderSide(color: AppColors.ratingColorYellow, width: 3.h),
),
child: Padding(
padding: EdgeInsets.all(16.h),
@ -120,7 +120,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
color: AppColors.whiteColor,
borderRadius: 20.h,
hasShadow: false,
side: BorderSide(color: AppColors.ratingColorYellow, width: 3.h),
// side: BorderSide(color: AppColors.ratingColorYellow, width: 3.h),
),
child: Padding(
padding: EdgeInsets.all(16.h),

@ -31,25 +31,26 @@ class RrtMapScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
floatingActionButton: Visibility(
visible: context.watch<EmergencyServicesViewModel>().bottomSheetType ==
BottomSheetType.FIXED,
child: Padding(
padding: EdgeInsetsDirectional.only(end: 8.h, bottom: 68.h),
child: DecoratedBox(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, borderRadius: 12.h),
child: Utils.buildSvgWithAssets(
icon: AppAssets.locate_me, width: 24.h, height: 24.h)
.paddingAll(12.h)
.onPress(() {
context
.read<EmergencyServicesViewModel>()
.moveToCurrentLocation();
}),
),
),
),
// floatingActionButton: Visibility(
// visible: context.watch<EmergencyServicesViewModel>().bottomSheetType ==
// BottomSheetType.FIXED,
// child: Padding(
// padding: EdgeInsetsDirectional.only(end: 8.h, bottom: 68.h),
// child: DecoratedBox(
// decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
// color: AppColors.whiteColor, borderRadius: 12.h),
// child: Container()
// // Utils.buildSvgWithAssets(
// // icon: AppAssets.locate_me, width: 24.h, height: 24.h)
// // .paddingAll(12.h)
// // .onPress(() {
// // context
// // .read<EmergencyServicesViewModel>()
// // .moveToCurrentLocation();
// // }),
// ),
// ),
// ),
bottomSheet: ExpandableBottomSheet(
bottomSheetType:
context.watch<EmergencyServicesViewModel>().bottomSheetType,
@ -73,6 +74,7 @@ class RrtMapScreen extends StatelessWidget {
inputController:
context.read<EmergencyServicesViewModel>().gmsController,
showCenterMarker: true,
bottomPaddingHeight: MediaQuery.of(context).size.height * 0.3,
)
else
HMSMap(
@ -189,10 +191,7 @@ class RrtMapScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 16.h,
children: [
hospitalAndPickUpSection(context),
],
).paddingOnly(top: 24.h, bottom: 32.h,left: 24.h, right: 24.h),
@ -227,9 +226,8 @@ class RrtMapScreen extends StatelessWidget {
shrinkWrap: true,
itemCount: 3,
itemBuilder: (__, index) {
if (index ==
2) // todo means the end of the list so handle as per the viewmodel
{
if (index == 2) // todo means the end of the list so handle as per the viewmodel
{
return CustomButton(
height: 40.h,
backgroundColor: AppColors.lightRedButtonColor,
@ -243,7 +241,7 @@ class RrtMapScreen extends StatelessWidget {
return AddressItem(
isSelected: index == 0,
address:
"Flat No 301, Building No 12, Palm Spring Apartment, Sector 45, Gurugram, Haryana 122003",
"",
title: index == 0 ? LocaleKeys.home.tr() : LocaleKeys.work.tr(),
onTap: () {},
);

@ -33,18 +33,18 @@ class CallAmbulancePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
floatingActionButton: Visibility(
visible: context.watch<EmergencyServicesViewModel>().bottomSheetType == BottomSheetType.FIXED,
child: Padding(
padding: EdgeInsetsDirectional.only(end: 8.h, bottom: 68.h),
child: DecoratedBox(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.h),
child: Utils.buildSvgWithAssets(icon: AppAssets.locate_me, width: 24.h, height: 24.h).paddingAll(12.h).onPress(() {
context.read<EmergencyServicesViewModel>().moveToCurrentLocation();
}),
),
),
),
// floatingActionButton: Visibility(
// visible: context.watch<EmergencyServicesViewModel>().bottomSheetType == BottomSheetType.FIXED,
// child: Padding(
// padding: EdgeInsetsDirectional.only(end: 8.h, bottom: 68.h),
// child: DecoratedBox(
// decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.h),
// child: Utils.buildSvgWithAssets(icon: AppAssets.locate_me, width: 24.h, height: 24.h).paddingAll(12.h).onPress(() {
// context.read<EmergencyServicesViewModel>().moveToCurrentLocation();
// }),
// ),
// ),
// ),
bottomSheet: Column(
mainAxisSize: MainAxisSize.min,
children: [
@ -67,6 +67,7 @@ class CallAmbulancePage extends StatelessWidget {
myLocationEnabled: true,
inputController: context.read<EmergencyServicesViewModel>().gmsController,
showCenterMarker: true,
bottomPaddingHeight: MediaQuery.of(context).size.height * 0.42,
)
else
HMSMap(

@ -253,7 +253,9 @@ class TrackingScreen extends StatelessWidget {
},
currentLocation: context.read<EmergencyServicesViewModel>().getGMSLocation(),
onCameraMoved: (value) => context.read<EmergencyServicesViewModel>().handleGMSMapCameraMoved(value));
onCameraMoved: (value) => context.read<EmergencyServicesViewModel>().handleGMSMapCameraMoved(value),
bottomPaddingHeight: MediaQuery.of(context).size.height * 0.2,
);
} else {
return HMSMap(
myLocationEnabled: false,

@ -1050,7 +1050,7 @@ class _LandingPageState extends State<LandingPage> {
color: AppColors.whiteColor,
borderRadius: 20.r,
hasShadow: true,
side: BorderSide(color: AppColors.ratingColorYellow, width: 3.h),
// side: BorderSide(color: AppColors.ratingColorYellow, width: 3.h),
),
child: Padding(
padding: EdgeInsets.all(16.h),
@ -1071,7 +1071,11 @@ class _LandingPageState extends State<LandingPage> {
),
CustomButton(
text: LocaleKeys.viewDetails.tr(context: context),
onPressed: () {},
onPressed: () {
Navigator.of(context).push(
CustomPageRoute(page: ImmediateLiveCarePendingRequestPage()),
);
},
backgroundColor: AppColors.warningColorYellow.withValues(alpha: 0.20),
textColor: AppColors.alertColor,
borderColor: AppColors.infoBannerBgColor,

@ -242,7 +242,12 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(appState.getAuthenticatedUser()?.gender == 1 ? AppAssets.maleImg : AppAssets.femaleImg, width: 56.w, height: 56.h),
Image.asset(
(appState.getAuthenticatedUser()?.gender == 1
? ((appState.getAuthenticatedUser()?.age ?? 0) < 7 ? AppAssets.babyBoyImg : AppAssets.maleImg)
: ((appState.getAuthenticatedUser()?.age ?? 0) < 7 ? AppAssets.babyGirlImg : AppAssets.femaleImg)),
width: 56.w,
height: 56.h),
SizedBox(width: 8.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -176,7 +176,12 @@ class _FamilyCardsState extends State<FamilyCards> {
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(appState.getAuthenticatedUser()?.gender == 1 ? AppAssets.maleImg : AppAssets.femaleImg, width: 56.w, height: 56.h),
Image.asset(
(appState.getAuthenticatedUser()?.gender == 1
? ((appState.getAuthenticatedUser()?.age ?? 0) < 7 ? AppAssets.babyBoyImg : AppAssets.maleImg)
: ((appState.getAuthenticatedUser()?.age ?? 0) < 7 ? AppAssets.babyGirlImg : AppAssets.femaleImg)),
width: 56.w,
height: 56.h),
SizedBox(width: 8.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -18,6 +18,7 @@ import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:open_filex/open_filex.dart';
import 'package:provider/provider.dart';
import 'dart:ui' as ui;
@ -47,10 +48,39 @@ class _MyInvoicesDetailsPageState extends State<MyInvoicesDetailsPage> {
title: LocaleKeys.invoiceDetails.tr(context: context),
downloadInvoice: Utils.isVidaPlusProject(widget.getInvoiceDetailsResponseModel.projectID ?? 0) ? null : () {
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.loadingText.tr(context: context));
},
myInvoicesViewModel.downloadInvoicePDF(
setupId: widget.getInvoicesListResponseModel.setupId!,
invoiceNo: widget.getInvoicesListResponseModel.invoiceNo!,
projectID: widget.getInvoicesListResponseModel.projectID!,
onError: (err) {
LoaderBottomSheet.hideLoader();
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: err),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
},
onSuccess: (value) async {
LoaderBottomSheet.hideLoader();
if (myInvoicesViewModel.downloadInvoicePDFBase64!.isNotEmpty) {
String path = await Utils.createFileFromString(myInvoicesViewModel.downloadInvoicePDFBase64!, "pdf");
try {
OpenFilex.open(path);
} catch (ex) {
showCommonBottomSheetWithoutHeight(
context,
child: Utils.getErrorWidget(loadingText: "Cannot open file"),
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
}
},
);
},
sendEmail: Utils.isVidaPlusProject(widget.getInvoiceDetailsResponseModel.projectID ?? 0) ? () async {
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.sendingEmailPleaseWait.tr(context: context));
await myInvoicesViewModel.sendInvoiceEmail(

@ -543,7 +543,17 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
// ],
// ),
// ),
),
).onPress(() {
model.setPrescriptionsDetailsLoading();
Navigator.of(context).push(
CustomPageRoute(
page: PrescriptionDetailPage(
prescriptionsResponseModel: model.patientPrescriptionOrders[index],
isFromAppointments: false,
),
),
);
}),
),
),
)

@ -207,7 +207,7 @@ class _RadiologyResultPageState extends State<RadiologyResultPage> {
padding: EdgeInsets.only(right: 4.w, left: 4.w),
child: Utils.buildSvgWithAssets(icon: AppAssets.aiOverView, width: 16.h, height: 16.h, iconColor: Colors.white),
),
LocaleKeys.generateAiAnalysisResult.tr(context: context).toText16(isBold: true, color: Colors.white)
LocaleKeys.generateAiAnalysisRadResult.tr(context: context).toText16(isBold: true, color: Colors.white)
],
),
).paddingSymmetrical(24.h, 12.h).onPress(() {

@ -1,5 +1,12 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@ -12,28 +19,84 @@ class AttachmentOptions extends StatelessWidget {
AttachmentOptions({Key? key, required this.onCameraTap, required this.onGalleryTap, required this.onFilesTap, this.showFilesOption = true}) : super(key: key);
late AppState? appState;
@override
Widget build(BuildContext context) {
appState = getIt.get<AppState>();
return SizedBox(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Upload Attachment".toSectionHeading(),
"Select from gallery or open camera".toText11(isBold: true),
GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 105 / 105, crossAxisSpacing: 9, mainAxisSpacing: 9),
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.only(top: 21, bottom: 14),
shrinkWrap: true,
// "Upload Attachment".toSectionHeading(),
// "Select from gallery or open camera".toText11(isBold: true),
checkInOptionCard(
AppAssets.ask_doctor_icon,
LocaleKeys.openCamera.tr(context: context),
"",
).onPress(() {
onCameraTap();
}),
SizedBox(height: 16.h),
checkInOptionCard(
AppAssets.ask_doctor_icon,
LocaleKeys.openGallery.tr(context: context),
"",
).onPress(() {
onGalleryTap();
}),
SizedBox(height: 16.h),
checkInOptionCard(
AppAssets.ask_doctor_icon,
LocaleKeys.openFiles.tr(context: context),
"",
).onPress(() {
onFilesTap();
}),
],
).paddingOnly(),
);
}
Widget checkInOptionCard(String icon, String title, String subTitle) {
return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 20.r,
hasShadow: false,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Utils.buildSvgWithAssets(icon: icon, width: 24.h, height: 24.h, fit: BoxFit.fill, iconColor: AppColors.textColor),
// SizedBox(height: 16.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
itemView("open_camera.svg", "Open\nCamera", onCameraTap),
itemView("gallery.svg", "Upload from\nGallery", onGalleryTap),
if (showFilesOption) itemView("files.svg", "Upload from\nFiles", onFilesTap),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
title.toText16(isBold: true, color: AppColors.textColor),
// subTitle.toText12(isBold: true, color: AppColors.greyTextColor),
],
),
),
Transform.flip(
flipX: appState!.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon_small,
iconColor: AppColors.blackColor,
width: 18.h,
height: 13.h,
fit: BoxFit.contain,
),
),
],
)
),
],
).paddingOnly(left: 21, right: 21, bottom: 21),
).paddingAll(16.h),
);
}

@ -127,10 +127,7 @@ class CustomTabBarState extends State<CustomTabBar> {
width: 18.w,
iconColor: isSelected ? activeTextColor : inActiveTextColor,
),
tabBar.title.toText13(
weight: isSelected ? FontWeight.w600 : FontWeight.w600,
color: isSelected ? activeTextColor : inActiveTextColor,
letterSpacing: isSelected ? -0.3 : -0.1),
tabBar.title.toText13(color: isSelected ? activeTextColor : inActiveTextColor, letterSpacing: isSelected ? -0.3 : -0.1, isBold: true),
],
)).onPress(() {
setState(() {

@ -1,21 +1,24 @@
import 'dart:convert';
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/attachment_options.dart';
import 'package:hmg_patient_app_new/widgets/bottom_sheet.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:image_picker/image_picker.dart';
final ImagePicker picker = ImagePicker();
class ImageOptions {
static void showImageOptionsNew(BuildContext context, bool showFilesOption, Function(String, File) image) {
showMyBottomSheet(
showCommonBottomSheetWithoutHeight(
context,
callBackFunc: () {},
title: LocaleKeys.feedback.tr(),
child: AttachmentOptions(
showFilesOption: showFilesOption,
onCameraTap: () async {
@ -66,7 +69,63 @@ class ImageOptions {
image(result.files.first.path.toString(), files.first);
},
),
callBackFunc: () {},
isFullScreen: false,
);
// showMyBottomSheet(
// context,
// callBackFunc: () {},
// child: AttachmentOptions(
// showFilesOption: showFilesOption,
// onCameraTap: () async {
// if (Platform.isAndroid) {
// cameraImageAndroid(image);
// } else {
// File _image = File((await ImagePicker.platform.pickImage(source: ImageSource.camera, imageQuality: 20))?.path ?? "");
// // XFile? media = await picker.pickMedia();
// String? fileName = _image.path;
// var bytes = File(fileName!).readAsBytesSync();
// String base64Encode = base64.encode(bytes);
// if (base64Encode != null) {
// image(base64Encode, _image);
// }
// }
// },
// onGalleryTap: () async {
// if (Platform.isAndroid) {
// galleryImageAndroid(image);
// } else {
// File _image = File((await picker.pickMedia())?.path ?? "");
// String fileName = _image.path;
// var bytes = File(fileName).readAsBytesSync();
// String base64Encode = base64.encode(bytes);
// if (base64Encode != null) {
// image(base64Encode, _image);
// }
// }
// },
// onFilesTap: () async {
// FilePickerResult? result = await FilePicker.platform.pickFiles(
// type: FileType.custom,
// allowedExtensions: [
// 'jpg',
// 'jpeg ',
// 'pdf',
// 'txt',
// 'docx',
// 'doc',
// 'pptx',
// 'xlsx',
// 'png',
// 'rar',
// 'zip',
// ],
// );
// List<File> files = result!.paths.map((path) => File(path!)).toList();
// image(result.files.first.path.toString(), files.first);
// },
// ),
// );
}
// static void showImageOptions(BuildContext context, Function(String, File) image) {

@ -72,6 +72,7 @@ class GMSMap extends StatefulWidget {
final bool myLocationEnabled;
final bool showCenterMarker;
final Completer<GoogleMapController>? inputController;
final num bottomPaddingHeight;
const GMSMap({
super.key,
@ -83,6 +84,7 @@ class GMSMap extends StatefulWidget {
this.showCenterMarker = false,
this.myLocationEnabled = true,
this.inputController,
required this.bottomPaddingHeight,
});
@override
@ -93,6 +95,7 @@ class _GMSMapState extends State<GMSMap> {
late Completer<GoogleMapController> _controller;
late MapType _selectedMapType;
bool _showMapTypeSelector = false;
num bottomPaddingHeight = 0;
/// All supported map types with display labels and icons
final List<_MapTypeOption> _mapTypeOptions = [
@ -145,7 +148,8 @@ class _GMSMapState extends State<GMSMap> {
mapType: _selectedMapType,
zoomControlsEnabled: true,
myLocationEnabled: widget.myLocationEnabled,
myLocationButtonEnabled: false,
myLocationButtonEnabled: true,
padding: EdgeInsets.only(bottom: double.parse(widget.bottomPaddingHeight.toString())),
compassEnabled: widget.compassEnabled,
initialCameraPosition: widget.currentLocation,
onCameraMove: widget.onCameraMoved,
@ -163,7 +167,7 @@ class _GMSMapState extends State<GMSMap> {
Icons.location_pin,
size: 36.h,
color: AppColors.primaryRedColor,
).paddingOnly(bottom: 24.h),
).paddingOnly(bottom: double.parse((widget.bottomPaddingHeight + 25.h).toString())),
),
// Map-type toggle button

@ -48,15 +48,15 @@ class MapUtilityScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
floatingActionButton: Padding(
padding: EdgeInsetsDirectional.only(end: 8.h, bottom: 68.h),
child: DecoratedBox(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.h),
child: Utils.buildSvgWithAssets(icon: AppAssets.locate_me, width: 24.h, height: 24.h).paddingAll(12.h).onPress(() {
context.read<LocationViewModel>().moveToCurrentLocation();
}),
),
),
// floatingActionButton: Padding(
// padding: EdgeInsetsDirectional.only(end: 8.h, bottom: 68.h),
// child: DecoratedBox(
// decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.h),
// child: Utils.buildSvgWithAssets(icon: AppAssets.locate_me, width: 24.h, height: 24.h).paddingAll(12.h).onPress(() {
// context.read<LocationViewModel>().moveToCurrentLocation();
// }),
// ),
// ),
bottomSheet: FixedBottomSheet(context),
body: Stack(
children: [
@ -68,6 +68,7 @@ class MapUtilityScreen extends StatelessWidget {
myLocationEnabled: true,
inputController: context.read<LocationViewModel>().gmsController,
showCenterMarker: true,
bottomPaddingHeight: MediaQuery.of(context).size.height * 0.2,
)
else
HMSMap(

Loading…
Cancel
Save