main
Haroon Amjad 2 months ago
parent 2293db00ea
commit c65d44ae4d

@ -1,6 +1,3 @@
import 'dart:io';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:hmg_patient_app_new/main.dart'; import 'package:hmg_patient_app_new/main.dart';

@ -3,132 +3,20 @@ class ApiConsts {
static bool isDevelopment = true; static bool isDevelopment = true;
// static String baseUrlBackend = 'http://ec2-13-51-36-142.eu-north-1.compute.amazonaws.com:8082/api/'; // Backend API URL UAT // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT
// static String baseUrlBackend = 'http://207.127.99.20:82/api/'; // Backend API URL PROD static String baseUrl = 'https://hmgwebservices.com/'; // HIS API URL PROD
static String baseUrlBackend = 'https://api-mob.meena-health.com/api/'; // Backend API URL PROD
static String checkIfUserExists = 'UserRegistrationHIS/phone'; static String SELECT_DEVICE_IMEI = 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI';
static String checkIfUserExistsMultiple = 'UserRegistrationHIS/phone/multiple';
static String checkIfUserExistsByMRN = 'UserRegistrationHIS/mrn/phone';
static String checkIfUserLastLoggedIn = 'UserRegistrationHIS/device-token';
static String updateUserLastLogIn = 'UserRegistrationHIS/save-device-token';
static String getStories = 'Stories';
static String saveAppointmentDetailsInBackend = 'UserAppointment';
static String getPatientAppointmentHistory = 'UserAppointment/my-appointments';
static String updateAppointmentDetailsInBackend = 'UserAppointment/update/';
static String submitDoctorReview = 'DoctorReview/submit-review';
static String getUserDataFromYakeenByIqama = 'Yakeen/by-iqama';
static String getUserDataFromYakeenByNin = 'Yakeen/by-nin';
static String sendVerificationCode = 'UserLogin/otp-request';
static String checkVerificationCode = 'UserLogin/otp-verify';
static String registerNewPatient = 'UserRegistrationHIS/save/patient';
static String getPatientVitalSignsHistory = 'Vitals/my-vitals';
static String getPatientLabReports = 'LabsOrder/my-orders';
static String getPatientRadReports = 'RadiologyOrder/my-orders';
static String getPatientPrescriptionsReports = 'Prescription/my-prescriptions';
static String updatePatientStoryViewedAPI = 'Stories/view';
static String getClinicsList = 'Clinics';
static String getDoctorsList = 'Doctors';
static String checkAppVersion = 'AppVersion/check-version';
static String getPatientLabOrdersAndResults = 'LabsOrder/my-order-result';
static String updatePatientProfile = 'Users/profile-update';
static String getPatientVitalSignsFromHIS = 'getpatientvital';
static String getDoctorReviewsByDoctorID = 'DoctorReview/';
// static String baseUrl = 'http://158.101.230.106:5016/phi/'; // HIS API URL UAT
static String baseUrl = 'http://158.101.232.32:5016/phi/'; // HIS API URL PROD
//Doctor Search
static String doctorSearch = 'doctor/search';
//Get Patient Data
static String getPatientData = 'patientdata/getpatientsdata';
//Get Free Slots
static String getFreeSlots = 'doctor/timeslot';
//Create Appointment
static String createAppointment = 'patient/appointment/create';
//Cancel Appointment
static String cancelAppointment = 'patient/appointment/create';
//Create Deposit
static String createDeposit = 'patient/PatientDeposits';
//Update Patient Photo
static String updatePatientPhoto = 'patientphoto';
// get Patient Insurance Details
static String getPatientInsuranceDetails = "http://158.101.232.32:5021/getpolicydetails";
// get Patient Insurance Details
static String getDoctorSessionsByAppointments = "http://158.101.232.32:5016/phi/doctor/getdoctorsessionbyappointment"; // Prod
// static String getDoctorSessionsByAppointments = "http://158.101.230.106:5016/phi/doctor/getdoctorsessionbyappointment"; // UAT
//get Organization List
static String getOrganizationsList = 'organisationsearch';
//get Departments List
static String getDepartmentsList = 'getdepartmentsearch';
static String VERSION_ID = "1.6"; static String VERSION_ID = "1.6";
// Nabed APIs
static String nabedBaseUrl = "https://portal.nabed.net/api/"; // Live
static String nabedAuthenticationURL = "auth/jwt-token";
static String nabedGetPatientData = "educate/external/content/icd?page=";
// SANED URLs
static String sanedLoginPassword = "Aa123456@";
static String sanedSource = "Meena Mobile App";
static String baseUrlSaned = 'https://staging.sanedhealth.com/'; // SANED API URL STAGING
// static String baseUrlSaned = 'https://hc.sanedhealth.com/'; // SANED API URL PRODUCTION
static String sanedAPIVersion = 'mn_hc/';
// static String sanedWebSocketURL = 'wss://locationapi.sanedhealth.com/ws?apikey=st_zuhDm9xSyI'; // UAT SANED WEBSOCKET URL
static String sanedWebSocketURL = 'wss://locationapiprod.sanedhealth.com/ws?apikey=st_A1xVs5qA7z'; // PRODUCTION WEBSOCKET URL
static String getSanedAuthToken = 'api/external/login';
static String getSanedProductCategories = 'get_product_categories';
static String getProductPackages = 'get/product/packages';
static String getPackageDetails = 'get/package/details';
static String checkPatientByNationalitySaned = 'check_patient_by_nationality';
static String signupPatient = 'api/signup';
static String getPatientCartDetails = 'shop/cart';
static String addPackageToCart = 'shop/cart/update';
static String updateCartItems = 'shop/cart/update_json';
static String getPatientLocationList = 'get_patient_location_list';
static String updatePatientLocationList = 'update_patient_location';
static String getAvailableSlots = 'get/category/slot';
static String createHHCAppointment = 'api/create/appointment';
static String cancelHHCAppointment = 'cancel_appointment';
static String getBlackOutDates = 'get/blackout/dates';
// static String createConfirmHHCAppointment = 'api/create/appointment';
static String getPatientHHCAppointmentHistory = 'get_patient_medical_history/appointment';
static setBackendURLs() { static setBackendURLs() {
if (isDevelopment) { if (isDevelopment) {
baseUrlSaned = 'https://staging.sanedhealth.com/'; baseUrl = "https://uat.hmgwebservices.com/";
sanedWebSocketURL = "wss://locationapi.sanedhealth.com/ws?apikey=st_zuhDm9xSyI";
baseUrlBackend = "http://ec2-13-51-36-142.eu-north-1.compute.amazonaws.com:8082/api/";
baseUrl = "http://158.101.230.106:5016/phi/";
getDoctorSessionsByAppointments = "http://158.101.230.106:5016/phi/doctor/getdoctorsessionbyappointment";
} else { } else {
baseUrlSaned = 'https://hc.sanedhealth.com/'; baseUrl = "https://hmgwebservices.com/";
sanedWebSocketURL = "wss://locationapiprod.sanedhealth.com/ws?apikey=st_A1xVs5qA7z";
baseUrlBackend = "https://api-mob.meena-health.com/api/";
baseUrl = "http://158.101.232.32:5016/phi/";
getDoctorSessionsByAppointments = "http://158.101.232.32:5016/phi/doctor/getdoctorsessionbyappointment";
} }
} }
// Login
// static String baseUrlLogin = 'https://keycloak.dev.evxtest.monster/realms/';
// static String getLoginToken = 'my_city_uat/protocol/openid-connect/token';
} }
class SharedPrefsConsts { class SharedPrefsConsts {

@ -255,6 +255,7 @@ class PushNotificationHandler {
} }
if (Platform.isIOS) { if (Platform.isIOS) {
final permission = await FirebaseMessaging.instance.requestPermission();
await FirebaseMessaging.instance.getAPNSToken().then((value) async { await FirebaseMessaging.instance.getAPNSToken().then((value) async {
log("APNS token: " + value.toString()); log("APNS token: " + value.toString());
await Utils.saveStringFromPrefs(SharedPrefsConsts.APNS_TOKEN, value.toString()); await Utils.saveStringFromPrefs(SharedPrefsConsts.APNS_TOKEN, value.toString());
@ -264,7 +265,6 @@ class PushNotificationHandler {
badge: true, badge: true,
sound: true, sound: true,
); );
final permission = await FirebaseMessaging.instance.requestPermission();
if (permission.authorizationStatus == AuthorizationStatus.denied) return; if (permission.authorizationStatus == AuthorizationStatus.denied) return;
} else {} } else {}

@ -3,7 +3,6 @@ import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:sizer/sizer.dart';
extension CapExtension on String { extension CapExtension on String {
String get toCamelCase => "${this[0].toUpperCase()}${this.substring(1)}"; String get toCamelCase => "${this[0].toUpperCase()}${this.substring(1)}";

@ -6,9 +6,12 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/providers/authentication_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/theme/app_theme.dart'; import 'package:hmg_patient_app_new/theme/app_theme.dart';
import 'package:logger/logger.dart'; import 'package:logger/logger.dart';
import 'package:provider/provider.dart';
import 'package:provider/single_child_widget.dart';
import 'core/utils/size_utils.dart'; import 'core/utils/size_utils.dart';
import 'firebase_options.dart'; import 'firebase_options.dart';
@ -45,7 +48,7 @@ class MyHttpOverrides extends HttpOverrides {
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized(); await EasyLocalization.ensureInitialized();
await Firebase.initializeApp(name: "hmg-patient-app", options: DefaultFirebaseOptions.currentPlatform); await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
HttpOverrides.global = MyHttpOverrides(); HttpOverrides.global = MyHttpOverrides();
runApp( runApp(
@ -56,8 +59,11 @@ void main() async {
], ],
path: 'assets/langs', path: 'assets/langs',
fallbackLocale: Locale('en', 'US'), fallbackLocale: Locale('en', 'US'),
// assetLoader: const CodegenLoader(), child: MultiProvider(providers: <SingleChildWidget>[
child: MyApp(), ChangeNotifierProvider<AuthenticationViewModel>(
create: (_) => AuthenticationViewModel(),
),
], child: MyApp()),
), ),
); );
} }
@ -71,7 +77,8 @@ class MyApp extends StatelessWidget {
return SafeArea( return SafeArea(
top: false, // Set to true if you want to avoid the notch area as well top: false, // Set to true if you want to avoid the notch area as well
bottom: Platform.isIOS ? false : true, bottom: Platform.isIOS ? false : true,
child: LayoutBuilder(builder: (context, constraints) { child: LayoutBuilder(
builder: (context, constraints) {
return Sizer( return Sizer(
builder: (context, orientation, deviceType) { builder: (context, orientation, deviceType) {
// SizeConfig().init(constraints, orientation); // SizeConfig().init(constraints, orientation);
@ -98,6 +105,8 @@ class MyApp extends StatelessWidget {
); );
}, },
); );
})); },
),
);
} }
} }

@ -14,9 +14,10 @@ class _LandingPageState extends State<LandingPage> {
return Scaffold( return Scaffold(
body: Column( body: Column(
children: [ children: [
Center( Padding(
child: "Home Page".toText18(color: Colors.black), padding: const EdgeInsets.all(64.0),
) child: "Login".toText18(color: Colors.black),
),
], ],
), ),
); );

@ -0,0 +1,5 @@
import 'package:flutter/material.dart';
class AuthenticationViewModel extends ChangeNotifier {
// Add properties and methods related to authentication here
}

@ -7,8 +7,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart';
import 'package:hmg_patient_app_new/presentation/home/landing_page.dart'; import 'package:hmg_patient_app_new/presentation/home/landing_page.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'core/consts.dart';
import 'core/utils/LocalNotification.dart'; import 'core/utils/LocalNotification.dart';
import 'core/utils/push-notification-handler.dart'; import 'core/utils/push-notification-handler.dart';
@ -22,17 +24,21 @@ class _SplashScreenState extends State<SplashPage> {
void initState() { void initState() {
super.initState(); super.initState();
print("Splash init called............."); print("Splash init called.............");
Timer(
Duration(milliseconds: 500),
() async {
ApiConsts.setBackendURLs();
PushNotificationHandler().init(context); // Asyncronously
},
);
Timer(Duration(seconds: 3, milliseconds: 500), () async { Timer(Duration(seconds: 3, milliseconds: 500), () async {
LocalNotification.init(onNotificationClick: (payload) {}); LocalNotification.init(onNotificationClick: (payload) {});
Navigator.of(context).pushReplacement( Navigator.of(context).pushReplacement(
MaterialPageRoute( FadePage(
builder: (BuildContext context) => LandingPage(), page: LandingPage(),
), ),
); );
// } else {}
}); });
// },
// );
var zoom = ZoomVideoSdk(); var zoom = ZoomVideoSdk();
InitConfig initConfig = InitConfig( InitConfig initConfig = InitConfig(
@ -40,11 +46,6 @@ class _SplashScreenState extends State<SplashPage> {
enableLog: true, enableLog: true,
); );
zoom.initSdk(initConfig); zoom.initSdk(initConfig);
// AppSharedPreferences().getAll().then((value) {
// debugPrint("ALL SHARED PREFERENCES!!!!!");
// debugPrint(jsonEncode(value));
// });
} }
/// load the Privilege from service /// load the Privilege from service

Loading…
Cancel
Save