Skip to content

Commit

Permalink
Update tray menu (Add website & discussion)
Browse files Browse the repository at this point in the history
  • Loading branch information
lijy91 committed Nov 14, 2021
1 parent 81d57b5 commit acfaee7
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import 'dart:io';

import 'package:anyinspect/anyinspect.dart';
import 'package:anyinspect_plugin_network/anyinspect_plugin_network.dart';
import 'package:anyinspect_plugin_shared_preferences/anyinspect_plugin_shared_preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:easy_localization_loader/easy_localization_loader.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:launch_at_startup/launch_at_startup.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:window_manager/window_manager.dart';

import './includes.dart';
Expand All @@ -11,15 +19,31 @@ void main() async {
await EasyLocalization.ensureInitialized();

await AudioPlayer.ensureInitialized();
await ProAccount.instance.ensureInitialized();
if (kIsLinux || kIsMacOS || kIsWindows) {
await WindowManager.instance.ensureInitialized();
}

if (kIsMacOS || kIsWindows) {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
LaunchAtStartup.instance.setup(
appName: packageInfo.appName,
appPath: Platform.resolvedExecutable,
);
}

await ProAccount.instance.ensureInitialized();

await initEnv('dev');
await initLocalDb();
await initConfig();

if (!kReleaseMode) {
AnyInspect anyInspect = AnyInspect.instance;
anyInspect.addPlugin(AnyInspectPluginNetwork());
anyInspect.addPlugin(AnyInspectPluginSharedPreferences());
anyInspect.start();
}

runApp(
EasyLocalization(
supportedLocales: [
Expand Down

0 comments on commit acfaee7

Please sign in to comment.