Alot of changes
This commit is contained in:
@@ -67,19 +67,17 @@ class LiveInformation {
|
||||
syncedTimeModule = SyncedTimeModule();
|
||||
announcementModule = AnnouncementModule();
|
||||
|
||||
// Tracker module is not supported on desktop
|
||||
if (defaultTargetPlatform != TargetPlatform.windows && defaultTargetPlatform != TargetPlatform.linux && defaultTargetPlatform != TargetPlatform.macOS) {
|
||||
// Tracker module is not supported on web
|
||||
Permission.location.request().then((value) {
|
||||
if (value.isGranted) {
|
||||
trackerModule = TrackerModule();
|
||||
}
|
||||
});
|
||||
}
|
||||
initTrackerModule();
|
||||
|
||||
print("Initialised LiveInformation");
|
||||
}
|
||||
|
||||
Future<void> initTrackerModule() async {
|
||||
if (await Permission.location.isGranted) {
|
||||
trackerModule = TrackerModule();
|
||||
}
|
||||
}
|
||||
|
||||
// Auth
|
||||
AuthAPI auth = AuthAPI();
|
||||
|
||||
@@ -120,7 +118,15 @@ class LiveInformation {
|
||||
// Cache/Load the audio files
|
||||
await announcementModule
|
||||
.announcementCache
|
||||
.loadAnnouncementsFromBytes(await LiveInformation().announcementModule.getBundleBytes(), audioFiles);
|
||||
.loadAnnouncementsFromBytes(await LiveInformation().announcementModule.getBundleBytes(), [
|
||||
...audioFiles,
|
||||
if (!routeVariant.busRoute.routeNumber.toLowerCase().startsWith("ul"))
|
||||
"R_${routeVariant.busRoute.routeNumber}_001.mp3"
|
||||
else
|
||||
"R_RAIL_REPLACEMENT_SERVICE_001.mp3",
|
||||
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
// Public methods
|
||||
|
||||
Reference in New Issue
Block a user