Files
Bus-Infotainment--IBus-/lib/pages/display.dart
2024-02-27 16:04:12 +00:00

85 lines
2.4 KiB
Dart

import 'package:bus_infotainment/pages/components/ibus_display.dart';
import 'package:bus_infotainment/pages/tfl_dataset_test.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class pages_Display extends StatefulWidget {
final TfL_Dataset_TestState _tfL_Dataset_TestState;
pages_Display(this._tfL_Dataset_TestState, {Key? key}) : super(key: key);
@override
State<pages_Display> createState() => _pages_DisplayState();
}
class _pages_DisplayState extends State<pages_Display> {
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: widget._tfL_Dataset_TestState.hideUI ? Colors.black : Theme.of(context).colorScheme.background
),
width: double.infinity,
child: Stack(
children: [
Positioned.fill(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (MediaQuery.of(context).size.width < 600)
Expanded(
child: RotatedBox(
quarterTurns: 1,
child: ibus_display(
hasBorder: false,
),
),
)
else
Expanded(
child: ibus_display(
hasBorder: false,
),
),
],
),
),
Positioned.fill(
child: Container(
alignment: Alignment.bottomRight,
child: IconButton(
icon: Icon(Icons.fullscreen),
onPressed: () {
// Hide the app bar and nav bar
widget._tfL_Dataset_TestState.setState(() {
widget._tfL_Dataset_TestState.hideUI = !widget._tfL_Dataset_TestState.hideUI;
});
setState(() {
});
// Hide the notification bar and make the app full screen and display over notch
if (widget._tfL_Dataset_TestState.hideUI) {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
} else {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
}
},
),
),
)
],
)
);
}
}