haroon_dev #175

Merged
Haroon6138 merged 3 commits from haroon_dev into master 19 hours ago

@ -1,6 +1,5 @@
import 'dart:io';
import 'package:device_preview/device_preview.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
@ -91,124 +90,121 @@ Future<void> callInitializations() async {
void main() async {
await callInitializations();
runApp(
DevicePreview(
enabled: false,
builder: (context) => EasyLocalization(
supportedLocales: const <Locale>[
Locale('en', 'US'),
Locale('ar', 'SA'),
],
path: 'assets/langs',
fallbackLocale: Locale('en', 'US'),
child: MultiProvider(providers: <SingleChildWidget>[
ChangeNotifierProvider<LabViewModel>(
create: (_) => getIt.get<LabViewModel>(),
),
ChangeNotifierProvider<RadiologyViewModel>(
create: (_) => getIt.get<RadiologyViewModel>(),
),
ChangeNotifierProvider<PrescriptionsViewModel>(
create: (_) => getIt.get<PrescriptionsViewModel>(),
),
ChangeNotifierProvider<InsuranceViewModel>(
create: (_) => getIt.get<InsuranceViewModel>(),
),
ChangeNotifierProvider<MedicalFileViewModel>(
create: (_) => getIt.get<MedicalFileViewModel>(),
),
ChangeNotifierProvider<ProfileSettingsViewModel>(
create: (_) => getIt.get<ProfileSettingsViewModel>(),
),
ChangeNotifierProvider<MyAppointmentsViewModel>(
create: (_) => getIt.get<MyAppointmentsViewModel>(),
),
ChangeNotifierProvider<AppointmentRatingViewModel>(
create: (_) => getIt.get<AppointmentRatingViewModel>(),
),
ChangeNotifierProvider<PayfortViewModel>(
create: (_) => getIt.get<PayfortViewModel>(),
),
ChangeNotifierProvider<HabibWalletViewModel>(
create: (_) => getIt.get<HabibWalletViewModel>(),
),
ChangeNotifierProvider<BookAppointmentsViewModel>(
create: (_) => getIt.get<BookAppointmentsViewModel>(),
),
ChangeNotifierProvider<ImmediateLiveCareViewModel>(
create: (_) => getIt.get<ImmediateLiveCareViewModel>(),
),
ChangeNotifierProvider<AuthenticationViewModel>(
create: (_) => getIt.get<AuthenticationViewModel>(),
),
ChangeNotifierProvider<AppointmentViaRegionViewmodel>(
create: (_) => getIt.get<AppointmentViaRegionViewmodel>(),
),
ChangeNotifierProvider<LabHistoryViewModel>(
create: (_) => getIt.get<LabHistoryViewModel>(),
),
ChangeNotifierProvider<DateRangeSelectorRangeViewModel>(
create: (_) => getIt.get<DateRangeSelectorRangeViewModel>(),
),
ChangeNotifierProvider<DoctorFilterViewModel>(
create: (_) => getIt.get<DoctorFilterViewModel>(),
),
ChangeNotifierProvider<EmergencyServicesViewModel>(
create: (_) => getIt.get<EmergencyServicesViewModel>(),
),
ChangeNotifierProvider<LocationViewModel>(
create: (_) => getIt.get<LocationViewModel>(),
),
ChangeNotifierProvider<TodoSectionViewModel>(
create: (_) => getIt.get<TodoSectionViewModel>(),
),
ChangeNotifierProvider<ContactUsViewModel>(
create: (_) => getIt.get<ContactUsViewModel>(),
),
ChangeNotifierProvider<HmgServicesViewModel>(
create: (_) => getIt.get<HmgServicesViewModel>(),
),
ChangeNotifierProvider<SymptomsCheckerViewModel>(
create: (_) => getIt.get<SymptomsCheckerViewModel>(),
),
ChangeNotifierProvider<BloodDonationViewModel>(
create: (_) => getIt.get<BloodDonationViewModel>(),
),
ChangeNotifierProvider<HealthProvider>(
create: (_) => getIt.get<HealthProvider>(),
),
ChangeNotifierProvider<HealthCalcualtorViewModel>(
create: (_) => getIt.get<HealthCalcualtorViewModel>(),
),
ChangeNotifierProvider<WaterMonitorViewModel>(
create: (_) => getIt.get<WaterMonitorViewModel>(),
),
ChangeNotifierProvider<MyInvoicesViewModel>(
create: (_) => getIt.get<MyInvoicesViewModel>(),
),
ChangeNotifierProvider<HealthTrackersViewModel>(
create: (_) => getIt.get<HealthTrackersViewModel>(),
),
ChangeNotifierProvider<MonthlyReportViewModel>(
create: (_) => getIt.get<MonthlyReportViewModel>(),
),
ChangeNotifierProvider<NotificationsViewModel>(
create: (_) => getIt.get<NotificationsViewModel>(),
),
ChangeNotifierProvider<ActivePrescriptionsViewModel>(
create: (_) => getIt.get<ActivePrescriptionsViewModel>(),
),
ChangeNotifierProvider<QrParkingViewModel>(
create: (_) => getIt.get<QrParkingViewModel>(),
),
ChangeNotifierProvider<TermsConditionsViewModel>(
create: (_) => getIt.get<TermsConditionsViewModel>(),
),
ChangeNotifierProvider<AskDoctorViewModel>(
create: (_) => getIt.get<AskDoctorViewModel>(),
)
], child: MyApp()),
), // Wrap your app
),
EasyLocalization(
supportedLocales: const <Locale>[
Locale('en', 'US'),
Locale('ar', 'SA'),
],
path: 'assets/langs',
fallbackLocale: Locale('en', 'US'),
child: MultiProvider(providers: <SingleChildWidget>[
ChangeNotifierProvider<LabViewModel>(
create: (_) => getIt.get<LabViewModel>(),
),
ChangeNotifierProvider<RadiologyViewModel>(
create: (_) => getIt.get<RadiologyViewModel>(),
),
ChangeNotifierProvider<PrescriptionsViewModel>(
create: (_) => getIt.get<PrescriptionsViewModel>(),
),
ChangeNotifierProvider<InsuranceViewModel>(
create: (_) => getIt.get<InsuranceViewModel>(),
),
ChangeNotifierProvider<MedicalFileViewModel>(
create: (_) => getIt.get<MedicalFileViewModel>(),
),
ChangeNotifierProvider<ProfileSettingsViewModel>(
create: (_) => getIt.get<ProfileSettingsViewModel>(),
),
ChangeNotifierProvider<MyAppointmentsViewModel>(
create: (_) => getIt.get<MyAppointmentsViewModel>(),
),
ChangeNotifierProvider<AppointmentRatingViewModel>(
create: (_) => getIt.get<AppointmentRatingViewModel>(),
),
ChangeNotifierProvider<PayfortViewModel>(
create: (_) => getIt.get<PayfortViewModel>(),
),
ChangeNotifierProvider<HabibWalletViewModel>(
create: (_) => getIt.get<HabibWalletViewModel>(),
),
ChangeNotifierProvider<BookAppointmentsViewModel>(
create: (_) => getIt.get<BookAppointmentsViewModel>(),
),
ChangeNotifierProvider<ImmediateLiveCareViewModel>(
create: (_) => getIt.get<ImmediateLiveCareViewModel>(),
),
ChangeNotifierProvider<AuthenticationViewModel>(
create: (_) => getIt.get<AuthenticationViewModel>(),
),
ChangeNotifierProvider<AppointmentViaRegionViewmodel>(
create: (_) => getIt.get<AppointmentViaRegionViewmodel>(),
),
ChangeNotifierProvider<LabHistoryViewModel>(
create: (_) => getIt.get<LabHistoryViewModel>(),
),
ChangeNotifierProvider<DateRangeSelectorRangeViewModel>(
create: (_) => getIt.get<DateRangeSelectorRangeViewModel>(),
),
ChangeNotifierProvider<DoctorFilterViewModel>(
create: (_) => getIt.get<DoctorFilterViewModel>(),
),
ChangeNotifierProvider<EmergencyServicesViewModel>(
create: (_) => getIt.get<EmergencyServicesViewModel>(),
),
ChangeNotifierProvider<LocationViewModel>(
create: (_) => getIt.get<LocationViewModel>(),
),
ChangeNotifierProvider<TodoSectionViewModel>(
create: (_) => getIt.get<TodoSectionViewModel>(),
),
ChangeNotifierProvider<ContactUsViewModel>(
create: (_) => getIt.get<ContactUsViewModel>(),
),
ChangeNotifierProvider<HmgServicesViewModel>(
create: (_) => getIt.get<HmgServicesViewModel>(),
),
ChangeNotifierProvider<SymptomsCheckerViewModel>(
create: (_) => getIt.get<SymptomsCheckerViewModel>(),
),
ChangeNotifierProvider<BloodDonationViewModel>(
create: (_) => getIt.get<BloodDonationViewModel>(),
),
ChangeNotifierProvider<HealthProvider>(
create: (_) => getIt.get<HealthProvider>(),
),
ChangeNotifierProvider<HealthCalcualtorViewModel>(
create: (_) => getIt.get<HealthCalcualtorViewModel>(),
),
ChangeNotifierProvider<WaterMonitorViewModel>(
create: (_) => getIt.get<WaterMonitorViewModel>(),
),
ChangeNotifierProvider<MyInvoicesViewModel>(
create: (_) => getIt.get<MyInvoicesViewModel>(),
),
ChangeNotifierProvider<HealthTrackersViewModel>(
create: (_) => getIt.get<HealthTrackersViewModel>(),
),
ChangeNotifierProvider<MonthlyReportViewModel>(
create: (_) => getIt.get<MonthlyReportViewModel>(),
),
ChangeNotifierProvider<NotificationsViewModel>(
create: (_) => getIt.get<NotificationsViewModel>(),
),
ChangeNotifierProvider<ActivePrescriptionsViewModel>(
create: (_) => getIt.get<ActivePrescriptionsViewModel>(),
),
ChangeNotifierProvider<QrParkingViewModel>(
create: (_) => getIt.get<QrParkingViewModel>(),
),
ChangeNotifierProvider<TermsConditionsViewModel>(
create: (_) => getIt.get<TermsConditionsViewModel>(),
),
ChangeNotifierProvider<AskDoctorViewModel>(
create: (_) => getIt.get<AskDoctorViewModel>(),
)
], child: MyApp()),
), // Wrap your app
);
}

@ -175,15 +175,15 @@ class AppointmentCard extends StatelessWidget {
AppCustomChipWidget(
labelText: isLoading
? 'Cardiology'
: (patientAppointmentHistoryResponseModel.clinicName!.length > 15
? '${patientAppointmentHistoryResponseModel.clinicName!.substring(0, 12)}...'
: (patientAppointmentHistoryResponseModel.clinicName!.length > 20
? '${patientAppointmentHistoryResponseModel.clinicName!.substring(0, 20)}...'
: patientAppointmentHistoryResponseModel.clinicName!),
).toShimmer2(isShow: isLoading),
AppCustomChipWidget(
labelText: isLoading
? 'Olaya'
: patientAppointmentHistoryResponseModel.projectName!.length > 15
? '${patientAppointmentHistoryResponseModel.projectName!.substring(0, 12)}...'
? '${patientAppointmentHistoryResponseModel.projectName!.substring(0, 15)}...'
: patientAppointmentHistoryResponseModel.projectName!)
.toShimmer2(isShow: isLoading),
AppCustomChipWidget(

@ -52,6 +52,7 @@ import 'package:hmg_patient_app_new/presentation/todo_section/ancillary_procedur
import 'package:hmg_patient_app_new/presentation/todo_section/widgets/ancillary_orders_list.dart';
import 'package:hmg_patient_app_new/routes/app_routes.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:hmg_patient_app_new/services/zoom_service.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/chip/app_custom_chip_widget.dart';
@ -96,7 +97,6 @@ class _LandingPageState extends State<LandingPage> {
super.dispose();
}
@override
void initState() {
authVM = context.read<AuthenticationViewModel>();
@ -206,20 +206,20 @@ class _LandingPageState extends State<LandingPage> {
children: [
Stack(children: [
if (appState.isAuthenticated)
Utils.buildSvgWithAssets(icon: AppAssets.bell, height: 24.h, width: 24.h).onPress(() async {
if (appState.isAuthenticated) {
notificationsViewModel.setNotificationStatusID(2);
notificationsViewModel.getAllNotifications();
Navigator.of(context).push(
CustomPageRoute(
page: NotificationsListPage(),
// page: LoginScreen(),
),
);
} else {
await authVM.onLoginPressed();
}
}),
Utils.buildSvgWithAssets(icon: AppAssets.bell, height: 24.h, width: 24.h).onPress(() async {
if (appState.isAuthenticated) {
notificationsViewModel.setNotificationStatusID(2);
notificationsViewModel.getAllNotifications();
Navigator.of(context).push(
CustomPageRoute(
page: NotificationsListPage(),
// page: LoginScreen(),
),
);
} else {
await authVM.onLoginPressed();
}
}),
(appState.isAuthenticated && (int.parse(todoSectionVM.notificationsCount ?? "0") > 0))
? Positioned(
right: 0,
@ -244,7 +244,7 @@ class _LandingPageState extends State<LandingPage> {
)
: SizedBox.shrink(),
]),
Utils.buildSvgWithAssets(icon: AppAssets.indoor_nav_icon, height: 24.h, width: 24.h).onPress(() {
Utils.buildSvgWithAssets(icon: AppAssets.indoor_nav_icon, height: 24.h, width: 24.w).onPress(() {
openIndoorNavigationBottomSheet(context);
}),
Utils.buildSvgWithAssets(icon: AppAssets.contact_icon, height: 24.h, width: 24.h).onPress(() {
@ -257,7 +257,7 @@ class _LandingPageState extends State<LandingPage> {
);
}),
!appState.isAuthenticated
? Utils.buildSvgWithAssets(icon: AppAssets.changeLanguageHomePageIcon, height: 18.h, width: 18.h).onPress(() {
? Utils.buildSvgWithAssets(icon: AppAssets.changeLanguageHomePageIcon, height: 24.h, width: 24.h).onPress(() {
context.setLocale(appState.isArabic() ? Locale('en', 'US') : Locale('ar', 'SA'));
})
: SizedBox.shrink()
@ -321,7 +321,7 @@ class _LandingPageState extends State<LandingPage> {
LocaleKeys.appointmentsAndVisits.tr(context: context).toText16(weight: FontWeight.w600),
Row(
children: [
LocaleKeys.viewAll.tr(context: context).toText14(color: AppColors.primaryRedColor,weight: FontWeight.w500),
LocaleKeys.viewAll.tr(context: context).toText14(color: AppColors.primaryRedColor, weight: FontWeight.w500),
SizedBox(width: 2.h),
Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 14.h),
],
@ -422,8 +422,7 @@ class _LandingPageState extends State<LandingPage> {
)
: Container(
width: double.infinity,
decoration: RoundedRectangleBorder()
.toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: true),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: true),
child: Padding(
padding: EdgeInsets.all(16.h),
child: Column(
@ -483,11 +482,7 @@ class _LandingPageState extends State<LandingPage> {
backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.10),
textColor: AppColors.primaryRedColor,
),
Utils.buildSvgWithAssets(
icon: AppAssets.appointment_checkin_icon,
width: 24.h,
height: 24.h,
iconColor: AppColors.primaryRedColor),
Utils.buildSvgWithAssets(icon: AppAssets.appointment_checkin_icon, width: 24.h, height: 24.h, iconColor: AppColors.primaryRedColor),
],
),
SizedBox(height: 8.h),

@ -223,11 +223,11 @@ class FadedLargeServiceCard extends StatelessWidget {
),
),
SizedBox(width: 12.w),
serviceCardData.title.toText18(weight: FontWeight.w500, color: AppColors.textColor).expanded,
serviceCardData.title.tr(context: context).toText18(weight: FontWeight.w500, color: AppColors.textColor).expanded,
],
),
SizedBox(height: 10.h),
serviceCardData.subtitle.toText14(weight: FontWeight.w500, color: AppColors.blackBgColor, letterSpacing: 0),
serviceCardData.subtitle.tr(context: context).toText14(weight: FontWeight.w500, color: AppColors.blackBgColor, letterSpacing: 0),
SizedBox(height: 12.h),
CustomButton(
text: serviceCardData.isBold ? "Visit Pharmacy Online".needTranslation : LocaleKeys.bookNow.tr(context: context),

@ -71,7 +71,7 @@ class ProfileSettingsState extends State<ProfileSettings> {
}
// Compute and clamp using sensible bounds (uses .h extension)
final double minH = 210.h;
final double minH = 215.h;
final double maxH = 380.h;
final double computed = (shorter * multiplier);
@ -420,7 +420,7 @@ class FamilyCardWidget extends StatelessWidget {
),
),
],
).paddingOnly(top: 16.h, right: 16.w, left: 16.w, bottom: 12.h),
).paddingOnly(top: 16.h, right: 16.w, left: 16.w, bottom: 0.h),
1.divider.paddingSymmetrical(16.w, 0.h),
_buildActionButton(appState),
],
@ -451,7 +451,7 @@ class FamilyCardWidget extends StatelessWidget {
borderColor: canSwitch ? AppColors.secondaryLightRedColor : AppColors.primaryRedColor,
textColor: canSwitch ? AppColors.primaryRedColor : AppColors.whiteColor,
iconColor: canSwitch ? AppColors.primaryRedColor : AppColors.whiteColor,
height: isFoldable ? 50.h : 40.h,
height: isFoldable ? 50.h : 45.h,
fontSize: 14.f,
).paddingOnly(top: 12.h, right: 16.w, left: 16.w, bottom: 16.h);
}

@ -0,0 +1,33 @@
// lib/services/zoom_service.dart
import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart';
class ZoomService {
static final ZoomService _instance = ZoomService._internal();
factory ZoomService() => _instance;
ZoomService._internal();
ZoomVideoSdk? _zoom;
bool _isInitialized = false;
Future<void> initializeZoomSDK() async {
if (_isInitialized) return;
try {
_zoom = ZoomVideoSdk();
InitConfig initConfig = InitConfig(
domain: "zoom.us",
enableLog: true, // Enable for debugging
);
await _zoom!.initSdk(initConfig);
_isInitialized = true;
print("Zoom SDK initialized successfully");
} catch (e) {
print("Error initializing Zoom SDK: $e");
rethrow;
}
}
ZoomVideoSdk? get zoom => _zoom;
bool get isInitialized => _isInitialized;
}

@ -19,6 +19,7 @@ import 'package:hmg_patient_app_new/presentation/tele_consultation/zoom/call_scr
import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/services/notification_service.dart';
import 'package:hmg_patient_app_new/services/zoom_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:lottie/lottie.dart';
@ -55,7 +56,7 @@ class _SplashScreenState extends State<SplashPage> {
await notificationService.initialize(onNotificationClick: (payload) {
// Handle notification click here
});
await ZoomService().initializeZoomSDK();
if (isAppOpenedFromCall) {
navigateToTeleConsult();
} else {
@ -68,12 +69,12 @@ class _SplashScreenState extends State<SplashPage> {
}
}
});
var zoom = ZoomVideoSdk();
InitConfig initConfig = InitConfig(
domain: "zoom.us",
enableLog: false,
);
zoom.initSdk(initConfig);
// var zoom = ZoomVideoSdk();
// InitConfig initConfig = InitConfig(
// domain: "zoom.us",
// enableLog: false,
// );
// zoom.initSdk(initConfig);
}
navigateToTeleConsult() async {

@ -43,7 +43,7 @@ dependencies:
lottie: ^3.3.1
flutter_ios_voip_kit_karmm: ^0.8.0
image_picker: ^1.2.0
file_picker: ^10.3.2
file_picker: 10.3.8
local_auth: ^2.3.0
share_plus: ^11.1.0
device_calendar_plus: ^0.3.1
@ -83,7 +83,7 @@ dependencies:
open_filex: ^4.7.0
flutter_swiper_view: ^1.1.8
flutter_callkit_incoming: ^3.0.0
device_preview: ^1.3.1
# device_preview: ^1.3.1
location: ^8.0.1
gms_check: ^1.0.4

Loading…
Cancel
Save