fixes and updates.

pull/253/head
Sultan khan 1 day ago
parent ce0eda7448
commit 9ff303d514

@ -51,12 +51,15 @@ _incomingCall(Map<String, dynamic> data) async {
// GetIt.instance<CacheService>().saveString(key: CacheConst.zoomRoomID, value: roomID); // GetIt.instance<CacheService>().saveString(key: CacheConst.zoomRoomID, value: roomID);
// GetIt.instance<CacheService>().saveBool(key: CacheConst.isAppOpenedFromCall, value: true); // GetIt.instance<CacheService>().saveBool(key: CacheConst.isAppOpenedFromCall, value: true);
Utils.saveStringFromPrefs(CacheConst.zoomRoomID, roomID); await Utils.saveStringFromPrefs(CacheConst.zoomRoomID, roomID);
Utils.saveStringFromPrefs(CacheConst.callTypeID, callTypeID); await Utils.saveStringFromPrefs(CacheConst.callTypeID, callTypeID);
Utils.saveBoolFromPrefs(CacheConst.isAppOpenedFromCall, true); await Utils.saveBoolFromPrefs(CacheConst.isAppOpenedFromCall, true);
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
int callKitType = callTypeID == '2' ? 0 : 1;
var _currentUuid = Uuid().v4(); var _currentUuid = Uuid().v4();
CallKitParams callKitParams = CallKitParams( CallKitParams callKitParams = CallKitParams(
id: _currentUuid, id: _currentUuid,
@ -64,7 +67,7 @@ _incomingCall(Map<String, dynamic> data) async {
appName: 'Dr Al Habib', appName: 'Dr Al Habib',
avatar: 'https://play-lh.googleusercontent.com/FBNNpxb7m6eM6wtW7MV1Ffp6OXOGLI38q47zcvP29OCYA1yhYH5mZzl5itZi0TgOyZpG', avatar: 'https://play-lh.googleusercontent.com/FBNNpxb7m6eM6wtW7MV1Ffp6OXOGLI38q47zcvP29OCYA1yhYH5mZzl5itZi0TgOyZpG',
// handle: LandingPage.incomingCallData.name, // handle: LandingPage.incomingCallData.name,
type: 1, type: callKitType,
textAccept: 'Accept', textAccept: 'Accept',
textDecline: 'Decline', textDecline: 'Decline',
missedCallNotification: NotificationParams( missedCallNotification: NotificationParams(
@ -80,7 +83,11 @@ _incomingCall(Map<String, dynamic> data) async {
callbackText: 'Hang Up', callbackText: 'Hang Up',
), ),
duration: 30000, duration: 30000,
extra: <String, dynamic>{'userId': '1a2b3c4d'}, extra: <String, dynamic>{
'userId': '1a2b3c4d',
'callTypeID': callTypeID, // Store actual callTypeID here
'roomID': roomID, // Store roomID here for backup
},
headers: <String, dynamic>{'apiKey': 'Abc@123!', 'platform': 'flutter'}, headers: <String, dynamic>{'apiKey': 'Abc@123!', 'platform': 'flutter'},
android: const AndroidParams( android: const AndroidParams(
isImportant: true, isImportant: true,

@ -151,7 +151,7 @@ class AppointmentDoctorCard extends StatelessWidget {
), ),
), ),
patientAppointmentHistoryResponseModel.isLiveCareAppointment! || patientAppointmentHistoryResponseModel.isClinicReBookingAllowed! || patientAppointmentHistoryResponseModel.isActiveDoctor! == false patientAppointmentHistoryResponseModel.isLiveCareAppointment! || patientAppointmentHistoryResponseModel.isClinicReBookingAllowed! ==false || patientAppointmentHistoryResponseModel.isActiveDoctor! == false
? SizedBox.shrink() ? SizedBox.shrink()
: Utils.buildSvgWithAssets(icon: AppAssets.doctor_profile_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown).onPress(() async { : Utils.buildSvgWithAssets(icon: AppAssets.doctor_profile_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown).onPress(() async {
DoctorsListResponseModel selectedDoctor = DoctorsListResponseModel(); DoctorsListResponseModel selectedDoctor = DoctorsListResponseModel();

@ -70,7 +70,8 @@ class LoginScreenState extends State<LoginScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Utils.showLottie(context: context, assetPath: AppAnimations.login, width: 200.h, height: 200.h, repeat: true, fit: BoxFit.cover), Utils.showLottie(context: context, assetPath: AppAnimations.login, width: 200.h, height: 200.h, repeat: true, fit: BoxFit.cover),
SizedBox(height: 130.h), // Adjusted to sizer unit // SizedBox(height: 130.h),
SizedBox(height: MediaQuery.of(context).size.height * 0.12), // based on the screen height Adjusted to sizer unit
LocaleKeys.welcomeToDrSulaiman.tr(context: context).toText32(isBold: true, color: AppColors.textColor ), LocaleKeys.welcomeToDrSulaiman.tr(context: context).toText32(isBold: true, color: AppColors.textColor ),
SizedBox(height: 32.h), SizedBox(height: 32.h),
Localizations.override(context: context, locale: Locale('en', 'US'), child: Container()), // Force English locale for this widget Localizations.override(context: context, locale: Locale('en', 'US'), child: Container()), // Force English locale for this widget

@ -350,7 +350,8 @@ class _MedicalFileAppointmentCardState extends State<MedicalFileAppointmentCard>
), ),
SizedBox(height: 24.h), SizedBox(height: 24.h),
// Countdown Timer - DD : HH : MM : SS format with labels // Countdown Timer - DD : HH : MM : SS format with labels
Row( Directionality(
textDirection: ui.TextDirection.ltr, child:Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -378,7 +379,7 @@ class _MedicalFileAppointmentCardState extends State<MedicalFileAppointmentCard>
LocaleKeys.seconds.tr(context: context), LocaleKeys.seconds.tr(context: context),
), ),
], ],
), )),
SizedBox(height: 24.h), SizedBox(height: 24.h),
// Green Acknowledge button with checkmark icon // Green Acknowledge button with checkmark icon
CustomButton( CustomButton(

@ -80,7 +80,7 @@ class _TriagePageState extends State<TriagePage> {
} }
// Case 2: Should stop flag is true OR Case 3: Probability >= 70% OR Case 4: 7 or more questions answered // Case 2: Should stop flag is true OR Case 3: Probability >= 70% OR Case 4: 7 or more questions answered
if (viewModel.shouldStopTriage || highestProbability >= 70.0 || viewModel.triageQuestionCount >= 15) { if (viewModel.shouldStopTriage || highestProbability >= 70.0 || viewModel.triageQuestionCount >= 30) {
// Navigate to results/possible conditions screen // Navigate to results/possible conditions screen
context.navigateWithName(AppRoutes.possibleConditionsPage); context.navigateWithName(AppRoutes.possibleConditionsPage);
return; return;

@ -79,10 +79,9 @@ class _SplashScreenState extends State<SplashPage> {
} }
navigateToTeleConsult() async { navigateToTeleConsult() async {
String roomID = await Utils.getStringFromPrefs(CacheConst.zoomRoomID); String roomID = await Utils.getStringFromPrefs(CacheConst.zoomRoomID);
String callTypeID = await Utils.getStringFromPrefs(CacheConst.callTypeID); String callTypeID = await Utils.getStringFromPrefs(CacheConst.callTypeID);
print('RoomID: $roomID');
print('callTypeID: $callTypeID');
// GetIt.instance<CacheService>().remove(key: CacheConst.isAppOpenedFromCall); // GetIt.instance<CacheService>().remove(key: CacheConst.isAppOpenedFromCall);
Utils.removeFromPrefs(CacheConst.isAppOpenedFromCall); Utils.removeFromPrefs(CacheConst.isAppOpenedFromCall);
@ -116,6 +115,18 @@ class _SplashScreenState extends State<SplashPage> {
print('actionCallAccept Event Received: ------->'); print('actionCallAccept Event Received: ------->');
FlutterCallkitIncoming.endAllCalls(); FlutterCallkitIncoming.endAllCalls();
try { try {
// Get callTypeID and roomID from event's extra data
String? eventCallTypeID = event.body['extra']?['callTypeID'];
String? eventRoomID = event.body['extra']?['roomID'];
// Re-save to SharedPreferences to ensure they're available
if (eventCallTypeID != null && eventCallTypeID.isNotEmpty) {
await Utils.saveStringFromPrefs(CacheConst.callTypeID, eventCallTypeID);
}
if (eventRoomID != null && eventRoomID.isNotEmpty) {
await Utils.saveStringFromPrefs(CacheConst.zoomRoomID, eventRoomID);
}
navigateToTeleConsult(); navigateToTeleConsult();
// String roomID = await Utils.getStringFromPrefs(SharedPrefsConsts.ZOOM_ROOM_ID); // String roomID = await Utils.getStringFromPrefs(SharedPrefsConsts.ZOOM_ROOM_ID);
// String roomPass = await Utils.getStringFromPrefs(SharedPrefsConsts.ZOOM_ROOM_PASS); // String roomPass = await Utils.getStringFromPrefs(SharedPrefsConsts.ZOOM_ROOM_PASS);

@ -56,8 +56,7 @@ class _LanguageSelectorState extends State<LanguageSelector> {
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Utils.buildSvgWithAssets(icon: AppAssets.language),
SizedBox(width: 6.h),
Text( Text(
// currentLangData['name']?.toUpperCase() ?? 'EN', // currentLangData['name']?.toUpperCase() ?? 'EN',
widget.currentLanguage == 'ar' ? "ENGLISH" : "العربية", widget.currentLanguage == 'ar' ? "ENGLISH" : "العربية",
@ -69,6 +68,9 @@ class _LanguageSelectorState extends State<LanguageSelector> {
isLanguageSwitcher: true, isLanguageSwitcher: true,
fontFamily: widget.currentLanguage == 'ar' ? "Poppins" : "CairoArabic"), fontFamily: widget.currentLanguage == 'ar' ? "Poppins" : "CairoArabic"),
), ),
SizedBox(width: 6.h),
Utils.buildSvgWithAssets(icon: AppAssets.language),
], ],
), ),
), ),

Loading…
Cancel
Save