Compare commits

..

No commits in common. '6060abb73e107ff472bd6d3694fb38aec99cdb52' and 'ae127807b634ed40ec30126913d27a9146b68cce' have entirely different histories.

@ -1,7 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:label="proxmox-dash"
android:name="${applicationName}"

@ -7,7 +7,7 @@ import 'src/settings/settings_service.dart';
void main() async {
final settingsController = SettingsController(SettingsService());
Future<void>.delayed(Duration.zero, () => settingsController.loadSettings());
await settingsController.loadSettings();
Log().info("Application started");
runApp(MyApp(settingsController: settingsController));

@ -8,7 +8,6 @@ import 'package:pi_dashboard/src/screen_helper.dart';
import 'package:pi_dashboard/src/settings/settings_controller.dart';
import '../settings/settings_view.dart';
import 'vm_card.dart';
import 'dart:io' show Platform;
class ProxmoxListerView extends StatefulWidget {
const ProxmoxListerView({
@ -77,34 +76,34 @@ class _ProxmoxListerState extends State<ProxmoxListerView> {
@override
Widget build(BuildContext context) {
// infinite touch container to turn screen back on
var widget = Stack(
children: [
Scaffold(
appBar: appbar(context),
body: bodyBuilder(context),
),
],
return IdleTurnOff(
timeout: const Duration(seconds: 60),
onExpire: () async {
await turnOffScreen();
Log().info("No input for 60 seconds. Screen turned off");
},
child: Stack(
children: [
Scaffold(
appBar: appbar(context),
body: bodyBuilder(context),
),
screenActivator(),
],
),
);
if (Platform.isLinux) {
widget.children.add(screenActivator());
return IdleTurnOff(
timeout: const Duration(seconds: 60),
onExpire: () async {
await turnOffScreen();
Log().info("No input for 60 seconds. Screen turned off");
},
child: widget,
);
} else {
return widget;
}
}
PreferredSizeWidget? appbar(BuildContext context) {
var app = AppBar(
return AppBar(
title: const Text("Proxmox VMs"),
actions: [
IconButton(
icon: const Icon(Icons.nightlight),
onPressed: () {
toggleScreen();
},
),
IconButton(
icon: const Icon(Icons.sync),
onPressed: () {
@ -128,20 +127,6 @@ class _ProxmoxListerState extends State<ProxmoxListerView> {
),
],
);
if (Platform.isLinux) {
app.actions?.insert(
0,
IconButton(
icon: const Icon(Icons.nightlight),
onPressed: () {
toggleScreen();
},
),
);
}
return app;
}
Widget bodyBuilder(BuildContext context) {

Loading…
Cancel
Save