mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-31 12:42:34 +00:00
NEW - [Networking] Strict TLS/SSL validation is now disabled globally - [Routing] Hold the AppBar back button to pop back to the home page of the module - [Settings/Sonarr] Toggle to enable Sonarr v3 features - [Sonarr] Complete rewrite of Sonarr - [Sonarr] State is now held across module switches - [Sonarr/Overview] View tags applied to series - [Sonarr/Catalogue] (v3 only) Ability to set and update language profile - [Sonarr/Catalogue] Ability to view all, only monitored, or only unmonitored series - [Sonarr/Releases] (v3 only) Ability to interactively search for season packs - [Sonarr/Releases] Ability to view all, only approved, or only rejected releases TWEAKS - [Settings] Removed all toggles for strict TLS - [Sonarr] Many tweaks to Sonarr's design - [Sonarr/Add] (v3 only) Tapping an already-added series will take you to the series page - [Sonarr/Add] Automatically navigate to newly added series - [Sonarr/Series] Toggling monitored state of series has now been moved to the edit prompt FIXES - [Images] Images will now load for invalid/self-signed certificates - [Tautulli/Activity] Fix grey screen for music activity - [TextField] Fix TextField actions (cut, copy, paste, etc.) not showing - [Timestamps] Fix 12:xx AM being shown as 00:xx AM - Additional small bug fixes
65 lines
2.1 KiB
Dart
65 lines
2.1 KiB
Dart
import 'dart:async';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:lunasea/core.dart';
|
|
|
|
/// LunaSea Entry Point: Initialize & Run Application
|
|
/// Runs app in guarded zone to attempt to capture fatal (crashing) errors
|
|
void main() async {
|
|
await _init();
|
|
runZonedGuarded<void>(
|
|
() => runApp(LunaBIOS()),
|
|
(Object error, StackTrace stack) => LunaLogger.fatal(error, stack),
|
|
);
|
|
}
|
|
|
|
Future<void> _init() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
//Set system UI style (navbar, statusbar)
|
|
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
|
systemNavigationBarColor: Colors.black,
|
|
systemNavigationBarDividerColor: Colors.black,
|
|
statusBarColor: Colors.transparent,
|
|
));
|
|
//LunaSea initialization
|
|
LunaNetworking.initialize();
|
|
LunaLogger.initialize();
|
|
LunaImageCache.initialize();
|
|
LunaRouter.intialize();
|
|
await LunaInAppPurchases.initialize();
|
|
await Database.initialize();
|
|
}
|
|
|
|
class LunaBIOS extends StatefulWidget {
|
|
static final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
|
|
|
@override
|
|
State<StatefulWidget> createState() => _State();
|
|
}
|
|
|
|
class _State extends State<LunaBIOS> {
|
|
@override
|
|
Widget build(BuildContext context) => LunaProvider.providers(
|
|
child: ValueListenableBuilder(
|
|
valueListenable: Database.lunaSeaBox.listenable(keys: [LunaSeaDatabaseValue.THEME_AMOLED.key]),
|
|
builder: (context, box, _) {
|
|
return MaterialApp(
|
|
navigatorKey: LunaBIOS.navigatorKey,
|
|
routes: LunaRouter.routes,
|
|
onGenerateRoute: LunaRouter.router.generator,
|
|
darkTheme: LunaTheme.darkTheme,
|
|
theme: LunaTheme.darkTheme,
|
|
title: Constants.APPLICATION_NAME,
|
|
);
|
|
}
|
|
),
|
|
);
|
|
|
|
@override
|
|
void dispose() {
|
|
Database.deinitialize()
|
|
.whenComplete(() => LunaInAppPurchases.deinitialize())
|
|
.whenComplete(() => super.dispose());
|
|
}
|
|
}
|