Added new hmg patient app redirection in offer details page

master
haroon amjad 1 day ago
parent 282d8835bf
commit d5e180e428

@ -2857,4 +2857,5 @@ const Map localizedValues = {
"servicePriceList6": {"en": "Dietician Consultation", "ar": "كشف أخصائي تغذية"},
"servicePriceList7": {"en": "LiveCare Consultation", "ar": "كشف استشارة عن بعد ( لايف كير )"},
"servicePriceListRights": {"en": "The patient has the right to a free follow-up within 14 days of initial visit", "ar": "يحق للمريض الحصول على متابعة مجانية في غضون 14 يومًا من الزيارة الأولى"},
"downloadNewApp": {"en": "Download the new app now", "ar": "حمل التطبيق الجديد الآن"},
};

@ -251,6 +251,12 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
MyRichText(TranslationBase.of(context).number + ": ", cOCItemList[index].itemID.toString(), isArabic),
Text(cOCItemList[index].cOCTitle!,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
Container(
margin: EdgeInsets.only(top: 12.0),
width: MediaQuery.of(context).size.width * 0.55,
child: Text((TranslationBase.of(context).details + ": " + cOCItemList[index].detail!),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
),
],
),
Column(

@ -1,4 +1,5 @@
import 'dart:developer';
import 'dart:io';
import 'dart:ui';
import 'package:auto_size_text/auto_size_text.dart' show AutoSizeText;
@ -31,6 +32,7 @@ import 'package:hmg_patient_app/widgets/in_app_browser/InAppBrowser.dart';
import 'package:hmg_patient_app/widgets/others/app_scaffold_widget.dart';
import 'package:hmg_patient_app/widgets/transitions/fade_page.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../../widgets/dialogs/confirm_dialog.dart';
import '../../ToDoList/payment_method_select.dart';
@ -173,11 +175,13 @@ class _OfferDetailsPageState extends State<OfferDetailsPage> {
const SizedBox(height: 24),
/// Hospital Dropdown (mock UI)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
projectViewModel.havePrivilege(113)
? Container()
: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
color: Colors.grey.shade300,
borderRadius: BorderRadius.circular(12),
),
@ -237,10 +241,20 @@ class _OfferDetailsPageState extends State<OfferDetailsPage> {
SizedBox(
width: MediaQuery.of(context).size.width - 24,
height: 50,
child: DefaultButton("Pay Now ادفع الآن", () {
if (projectViewModel.isLogin) {
if (selectedHospital != null) {
startPaymentProcess(context);
child: projectViewModel.havePrivilege(113)
? DefaultButton(TranslationBase.of(context).downloadNewApp, () {
if (Platform.isAndroid) {
_launchURL("https://play.google.com/store/apps/details?id=com.cloudsolutions.HMGPatientApp");
}
if (Platform.isIOS) {
_launchURL("https://itunes.apple.com/app/id6758851027");
// _launchURL("https://apps.apple.com/us/app/dr-sulaiman-alhabib-beta/id6758851027");
}
})
: DefaultButton("Pay Now ادفع الآن", () {
if (projectViewModel.isLogin) {
if (selectedHospital != null) {
startPaymentProcess(context);
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).selectHospital);
}
@ -267,6 +281,14 @@ class _OfferDetailsPageState extends State<OfferDetailsPage> {
);
}
_launchURL(String url) async {
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
startPaymentProcess(BuildContext context) {
Navigator.push(
context,

@ -3542,6 +3542,7 @@ class TranslationBase {
String get servicePriceList6 => localizedValues["servicePriceList6"][locale.languageCode];
String get servicePriceList7 => localizedValues["servicePriceList7"][locale.languageCode];
String get servicePriceListRights => localizedValues["servicePriceListRights"][locale.languageCode];
String get downloadNewApp => localizedValues["downloadNewApp"][locale.languageCode];
String getTranslation(String label) {
switch (label) {

Loading…
Cancel
Save