2023-07-05 20:30:09 +00:00
|
|
|
import 'package:flutter/foundation.dart';
|
2021-12-10 10:40:20 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-04-15 07:16:41 +00:00
|
|
|
import 'package:flutter/services.dart';
|
2023-07-04 19:20:14 +00:00
|
|
|
import 'package:media_kit/media_kit.dart';
|
2021-12-10 23:01:44 +00:00
|
|
|
|
2022-08-29 15:16:51 +00:00
|
|
|
import 'app.dart';
|
2022-08-28 20:51:12 +00:00
|
|
|
import 'db/database.dart';
|
2021-12-11 12:33:46 +00:00
|
|
|
import 'log/log.dart';
|
2022-09-02 16:42:38 +00:00
|
|
|
import 'login/login_container.dart';
|
2022-08-30 21:37:24 +00:00
|
|
|
import 'utils/platform.dart';
|
2021-12-10 10:40:20 +00:00
|
|
|
|
2022-04-15 07:16:41 +00:00
|
|
|
void main() async {
|
2021-12-11 12:33:46 +00:00
|
|
|
Log.i("App init!");
|
2023-07-04 19:20:14 +00:00
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
MediaKit.ensureInitialized();
|
|
|
|
|
2023-07-05 20:30:09 +00:00
|
|
|
if (!kIsWeb && !isDesktop()) {
|
|
|
|
Log.i("init device info");
|
2022-04-15 07:16:41 +00:00
|
|
|
await loadDeviceInfo();
|
|
|
|
}
|
2023-07-05 20:30:09 +00:00
|
|
|
|
|
|
|
Log.i("Mediakit initialized");
|
|
|
|
|
2022-11-30 23:50:55 +00:00
|
|
|
await Db().init();
|
2022-08-28 20:51:12 +00:00
|
|
|
|
2022-04-15 07:16:41 +00:00
|
|
|
runApp(Shortcuts(shortcuts: <LogicalKeySet, Intent>{
|
|
|
|
LogicalKeySet(LogicalKeyboardKey.select): ActivateIntent(),
|
|
|
|
}, child: const LoginContainer(child: App())));
|
2021-12-10 10:40:20 +00:00
|
|
|
}
|