This commit is contained in:
ImBenji
2024-05-17 17:38:34 +01:00
parent 1f48f8f4b0
commit 3556639acc
10 changed files with 636 additions and 49 deletions

View File

@@ -733,7 +733,7 @@ class EasyAnnouncementPicker extends StatelessWidget {
label: entry.shortName,
onPressed: () {
LiveInformation liveInformation = LiveInformation();
liveInformation.announcementModule.queueAnnounementByInfoIndex(
liveInformation.announcementModule.queueAnnouncementByInfoIndex(
infoIndex: liveInformation.announcementModule.manualAnnouncements.indexOf(entry),
sendToServer: true
);
@@ -1431,6 +1431,10 @@ class _FullscreenDisplayState extends State<FullscreenDisplay> {
@override
Widget build(BuildContext context) {
// Get the current screen orientation
final Orientation orientation = MediaQuery.of(context).orientation;
// Make the screen landscape
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeRight,
@@ -1440,9 +1444,18 @@ class _FullscreenDisplayState extends State<FullscreenDisplay> {
return PopScope(
onPopInvoked: (isPop) {
if (isPop) {
SystemChrome.setPreferredOrientations([
// SystemChrome.setPreferredOrientations([
// DeviceOrientation.portraitUp,
// DeviceOrientation.portraitDown
// ]);
// Set the orientation back to whatever it was before
SystemChrome.setPreferredOrientations(orientation == Orientation.portrait ? [
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown
] : [
DeviceOrientation.landscapeRight,
DeviceOrientation.landscapeLeft
]);
}
},
@@ -1460,12 +1473,17 @@ class _FullscreenDisplayState extends State<FullscreenDisplay> {
hasBorder: false,
),
),
ShadButton.ghost(
icon: const Icon(Icons.arrow_back),
padding: const EdgeInsets.all(8),
onPressed: () {
Navigator.pop(context);
},
Container(
alignment: Alignment.bottomRight,
child: ShadButton.ghost(
icon: const Icon(Icons.arrow_back),
padding: const EdgeInsets.all(8),
onPressed: () {
Navigator.pop(context);
},
),
)
],
),