import 'dart:io'; import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; import 'package:healthcare_pharmacy/PushNotificationService.dart'; import 'package:healthcare_pharmacy/chat/chatpage.dart'; import 'package:sizer/sizer.dart'; import 'package:flutter/services.dart'; import 'splash_screen.dart'; void main () async { // Set default home. Widget _defaultHome = Splash(); WidgetsFlutterBinding.ensureInitialized(); FirebaseOptions firebaseOptions = FirebaseOptions( apiKey: 'AIzaSyC89L-Xg53Bd_mdCPvKOu7BcC9Ya6UZeds', appId: '1:60196905754:android:05ea9ecef5280e578a42a3', messagingSenderId: '60196905754 ', projectId: 'health-pharma-67443', storageBucket: "health-pharma-67443.appspot.com"// Firebase Realtime Database URL ); Platform.isAndroid? await Firebase.initializeApp(options: firebaseOptions):await Firebase.initializeApp(); PushNotificationService().initialize(); FirebaseMessaging.instance.setForegroundNotificationPresentationOptions(alert: true,badge: true,sound: true); SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]) .then((_) { runApp(Sizer( builder: (context, orientation, deviceType) { return MaterialApp( title: 'Pharmacy', theme: ThemeData.light(), home:_defaultHome, debugShowCheckedModeBanner: false, ); }, )); }); }