11/20/1
This commit is contained in:
@@ -3,9 +3,11 @@ import 'dart:io';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:flutter_stripe/flutter_stripe.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:ride/constant/box_name.dart';
|
||||
import 'package:ride/constant/credential.dart';
|
||||
import 'package:ride/constant/info.dart';
|
||||
import 'package:ride/splash_screen_page.dart';
|
||||
@@ -18,6 +20,7 @@ import 'firebase_options.dart';
|
||||
import 'models/db_sql.dart';
|
||||
|
||||
final box = GetStorage();
|
||||
const storage = FlutterSecureStorage();
|
||||
DbSql sql = DbSql.instance;
|
||||
@pragma('vm:entry-point')
|
||||
Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
||||
@@ -31,7 +34,13 @@ Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await GetStorage.init();
|
||||
Stripe.publishableKey = StripeKey.publishableKey;
|
||||
if (box.read(BoxName.apiKeyRun).toString() != 'run') {
|
||||
await AppCredintials().getApiKey();
|
||||
}
|
||||
String? stripePublishableKey =
|
||||
await storage.read(key: BoxName.stripePublishableKey);
|
||||
Stripe.publishableKey = stripePublishableKey ?? '';
|
||||
//StripeKey.publishableKey;
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
@@ -51,6 +60,7 @@ void main() async {
|
||||
DeviceOrientation.portraitUp,
|
||||
DeviceOrientation.portraitDown,
|
||||
]);
|
||||
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user