|
|
|
|
@ -7,8 +7,11 @@ import 'package:firebase_messaging/firebase_messaging.dart';
|
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/api/api_client.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/api_consts.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/enums.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/active_prescriptions/active_prescriptions_view_model.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/ask_doctor/ask_doctor_view_model.dart';
|
|
|
|
|
@ -76,12 +79,12 @@ Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
|
|
|
|
|
|
|
|
|
|
// flutter3_32 pub run easy_localization:generate -O ./lib/generated -f keys -o locale_keys.g.dart --source-dir ./assets/langs
|
|
|
|
|
|
|
|
|
|
// class MyHttpOverrides extends HttpOverrides {
|
|
|
|
|
// @override
|
|
|
|
|
// HttpClient createHttpClient(SecurityContext? context) {
|
|
|
|
|
// return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
class MyHttpOverrides extends HttpOverrides {
|
|
|
|
|
@override
|
|
|
|
|
HttpClient createHttpClient(SecurityContext? context) {
|
|
|
|
|
return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> callAppStateInitializations() async {
|
|
|
|
|
final String deviceTypeId = (Platform.isIOS
|
|
|
|
|
@ -130,7 +133,7 @@ Future<void> callInitializations() async {
|
|
|
|
|
|
|
|
|
|
await AppDependencies.addDependencies();
|
|
|
|
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
|
|
|
|
// HttpOverrides.global = MyHttpOverrides();
|
|
|
|
|
HttpOverrides.global = MyHttpOverrides();
|
|
|
|
|
await callAppStateInitializations();
|
|
|
|
|
|
|
|
|
|
// Initialize Security Service early to catch threats before app logic runs
|
|
|
|
|
|