You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			80 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Dart
		
	
			
		
		
	
	
			80 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Dart
		
	
| import 'dart:io';
 | |
| 
 | |
| import 'package:easy_localization/easy_localization.dart';
 | |
| import 'package:firebase_core/firebase_core.dart';
 | |
| import 'package:firebase_messaging/firebase_messaging.dart';
 | |
| import 'package:flutter/material.dart';
 | |
| import 'package:hmg_patient_app_new/core/app_state.dart';
 | |
| import 'package:hmg_patient_app_new/routes/app_routes.dart';
 | |
| import 'package:hmg_patient_app_new/theme/app_theme.dart';
 | |
| import 'package:logger/logger.dart';
 | |
| 
 | |
| import 'firebase_options.dart';
 | |
| 
 | |
| var globalMessengerKey = GlobalKey<ScaffoldMessengerState>();
 | |
| final navigatorKey = GlobalKey<NavigatorState>();
 | |
| 
 | |
| Logger logger = Logger(
 | |
|   printer: PrettyPrinter(
 | |
|     lineLength: 0,
 | |
|   ),
 | |
| );
 | |
| 
 | |
| late AppState appState;
 | |
| 
 | |
| @pragma('vm:entry-point')
 | |
| Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
 | |
|   await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
 | |
|   print("Firebase backgroundMessageHandler Main!!!");
 | |
|   // debugPrint('backgroundMessage: message => ${message.notification!.title.toString()}');
 | |
|   // messagesOpended = message.notification!.title.toString();
 | |
|   var payload = message.data;
 | |
|   // showCallkitIncoming(payload);
 | |
|   // await backgroundCallHandler(payload);
 | |
| }
 | |
| 
 | |
| class MyHttpOverrides extends HttpOverrides {
 | |
|   @override
 | |
|   HttpClient createHttpClient(SecurityContext? context) {
 | |
|     return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
 | |
|   }
 | |
| }
 | |
| 
 | |
| void main() {
 | |
|   runApp(const MyApp());
 | |
| }
 | |
| 
 | |
| class MyApp extends StatelessWidget {
 | |
|   const MyApp({super.key});
 | |
| 
 | |
|   // This widget is the root of your application.
 | |
|   @override
 | |
|   Widget build(BuildContext context) {
 | |
|     return SafeArea(
 | |
|       top: false, // Set to true if you want to avoid the notch area as well
 | |
|       bottom: Platform.isIOS ? false : true,
 | |
|       child: MaterialApp(
 | |
|         title: 'Dr. AlHabib',
 | |
|         builder: (context, mchild) {
 | |
|           return MediaQuery(
 | |
|               data: MediaQuery.of(context).copyWith(
 | |
|                 textScaler: TextScaler.linear(1.0),
 | |
|               ), //set desired text scale factor here
 | |
|               child: mchild!);
 | |
|         },
 | |
|         showSemanticsDebugger: false,
 | |
|         debugShowCheckedModeBanner: false,
 | |
|         localizationsDelegates: context.localizationDelegates,
 | |
|         supportedLocales: context.supportedLocales,
 | |
|         locale: context.locale,
 | |
|         initialRoute: AppRoutes.initialRoute,
 | |
|         routes: AppRoutes.routes,
 | |
|         theme: AppTheme.getTheme(
 | |
|           EasyLocalization.of(context)?.locale.languageCode == "ar",
 | |
|         ),
 | |
|         navigatorKey: navigatorKey,
 | |
|       ),
 | |
|     );
 | |
|   }
 | |
| }
 |