Skip to content

Commit

Permalink
Dynamically determine minimum window size
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Oct 31, 2023
1 parent 60e95da commit 4ba2a7f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import 'dart:ui';

import 'package:elastic_dashboard/pages/dashboard_page.dart';
import 'package:elastic_dashboard/services/field_images.dart';
import 'package:elastic_dashboard/services/globals.dart';
import 'package:elastic_dashboard/services/nt4_connection.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:shared_preferences/shared_preferences.dart';
Expand Down Expand Up @@ -37,7 +40,10 @@ void main() async {

await FieldImages.loadFields('assets/fields/');

await windowManager.setMinimumSize(const Size(1280, 720));
FlutterView screenView = PlatformDispatcher.instance.views.first;
Size screenSize = screenView.physicalSize * screenView.devicePixelRatio;

await windowManager.setMinimumSize(screenSize * 0.55);
await windowManager.setTitleBarStyle(TitleBarStyle.hidden,
windowButtonVisibility: false);

Expand Down

0 comments on commit 4ba2a7f

Please sign in to comment.