-
Notifications
You must be signed in to change notification settings - Fork 15
/
main.dart
46 lines (40 loc) · 1.64 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:provider/provider.dart';
import 'package:upgrader/upgrader.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:encointer_wallet/app.dart';
import 'package:encointer_wallet/config.dart';
import 'package:encointer_wallet/modules/modules.dart';
import 'package:encointer_wallet/service/notification/lib/notification.dart';
import 'package:encointer_wallet/service/subscan.dart';
import 'package:encointer_wallet/store/app.dart';
import 'package:encointer_wallet/utils/local_storage.dart' as util;
Future<void> main({AppcastConfiguration? appCast}) async {
WidgetsFlutterBinding.ensureInitialized();
await NotificationPlugin.setup();
// var notificationAppLaunchDetails =
// await flutterLocalNotificationsPlugin.getNotificationAppLaunchDetails();
if (Platform.isAndroid) {
// this is enabled by default in IOS dev-builds.
await InAppWebViewController.setWebContentsDebuggingEnabled(true);
}
HttpOverrides.global = MyHttpOverrides();
final localService = LangService(await SharedPreferences.getInstance());
runApp(
MultiProvider(
providers: [
Provider<AppSettings>(
create: (context) => AppSettings(localService)..init(),
),
Provider<AppStore>(
// On test mode instead of LocalStorage() must be use MockLocalStorage()
create: (context) => AppStore(util.LocalStorage(), config: AppConfig(appCast: appCast)),
)
],
child: const WalletApp(),
),
);
}