mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-31 12:42:34 +00:00
* fix(database): Use native extension instead of describeEnum * new(sonarr): [Catalogue] Previous airing sorting options * splash: Rebuild Android & iOS splash screens * changelog: Refactor changelog sheet * Continued WIP Polish of UI * chore: Reintegrate pods * calendar: Added second line for Lidarr/Radarr entries * settings: Show quick actions information as banner block * lidarr: Add support for monitoring options on add, posters in result list * uiux: Fade edges of scrollable text * drawer: Restyle header * Remove redundant body texts in edit/add content * macos: Set window size & alignment * settings: Add description banner block for profiles
69 lines
2.5 KiB
Dart
69 lines
2.5 KiB
Dart
import 'dart:io';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:lunasea/core.dart';
|
|
import 'package:lunasea/main.dart';
|
|
import 'package:lunasea/modules.dart';
|
|
|
|
class LunaRouter {
|
|
static FluroRouter router = FluroRouter();
|
|
static TransitionType get transitionType {
|
|
// Required otherwise no transition is executed
|
|
if (Platform.isMacOS) return TransitionType.cupertino;
|
|
return TransitionType.native;
|
|
}
|
|
|
|
/// Calls `defineAllRoutes()` on all module routers that implement [LunaModuleRouter].
|
|
void initialize() {
|
|
router.notFoundHandler = Handler(
|
|
handlerFunc: (context, params) => LunaInvalidRoute(),
|
|
);
|
|
router.define(
|
|
'/',
|
|
handler: Handler(handlerFunc: (context, params) => const LunaOS()),
|
|
transitionType: transitionType,
|
|
);
|
|
// Module routers
|
|
DashboardRouter().defineAllRoutes(router);
|
|
ExternalModulesRouter().defineAllRoutes(router);
|
|
OverseerrRouter().defineAllRoutes(router);
|
|
RadarrRouter().defineAllRoutes(router);
|
|
SearchRouter().defineAllRoutes(router);
|
|
SettingsRouter().defineAllRoutes(router);
|
|
SonarrRouter().defineAllRoutes(router);
|
|
TautulliRouter().defineAllRoutes(router);
|
|
}
|
|
|
|
/// **Will be removed when all module routers are integrated.**
|
|
///
|
|
/// Returns a map of all module routes.
|
|
Map<String, WidgetBuilder> get routes => <String, WidgetBuilder>{
|
|
..._lidarr,
|
|
..._sabnzbd,
|
|
..._nzbget,
|
|
};
|
|
|
|
Map<String, WidgetBuilder> get _lidarr => <String, WidgetBuilder>{
|
|
Lidarr.ROUTE_NAME: (context) => const Lidarr(),
|
|
LidarrAddSearch.ROUTE_NAME: (context) => const LidarrAddSearch(),
|
|
LidarrAddDetails.ROUTE_NAME: (context) => const LidarrAddDetails(),
|
|
LidarrEditArtist.ROUTE_NAME: (context) => const LidarrEditArtist(),
|
|
LidarrDetailsAlbum.ROUTE_NAME: (context) => const LidarrDetailsAlbum(),
|
|
LidarrDetailsArtist.ROUTE_NAME: (context) =>
|
|
const LidarrDetailsArtist(),
|
|
LidarrSearchResults.ROUTE_NAME: (context) =>
|
|
const LidarrSearchResults(),
|
|
};
|
|
|
|
Map<String, WidgetBuilder> get _nzbget => <String, WidgetBuilder>{
|
|
NZBGet.ROUTE_NAME: (context) => const NZBGet(),
|
|
NZBGetStatistics.ROUTE_NAME: (context) => const NZBGetStatistics(),
|
|
};
|
|
|
|
Map<String, WidgetBuilder> get _sabnzbd => <String, WidgetBuilder>{
|
|
SABnzbd.ROUTE_NAME: (context) => const SABnzbd(),
|
|
SABnzbdStatistics.ROUTE_NAME: (context) => const SABnzbdStatistics(),
|
|
SABnzbdHistoryStages.ROUTE_NAME: (context) =>
|
|
const SABnzbdHistoryStages(),
|
|
};
|
|
}
|