Skip to content

Commit

Permalink
(fix) restrict hardcoded window size to macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulGD03 committed Dec 17, 2023
1 parent 70090cc commit 49d1403
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'package:flutter/foundation.dart';

import 'home/home_screen.dart';
import 'status/status_screen.dart';
import 'files/files_screen.dart';
Expand All @@ -12,11 +14,17 @@ import 'package:window_size/window_size.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
setWindowMinSize(const Size(800, 480));
setWindowMaxSize(const Size(800, 480));
runApp(const Orion());
}

void macDebug() {
if (kDebugMode) {
setWindowTitle('Orion Debug - Prometheus mSLA');
setWindowMinSize(const Size(800, 480));
setWindowMaxSize(const Size(800, 480));
}
}

/// The route configuration.
final GoRouter _router = GoRouter(
routes: <RouteBase>[
Expand Down Expand Up @@ -76,9 +84,10 @@ class Orion extends StatelessWidget {

@override
Widget build(BuildContext context) {
if (Theme.of(context).platform == TargetPlatform.macOS) {
macDebug();
}
return SizedBox(
width: 800,
height: 480,
child: MaterialApp.router(
debugShowCheckedModeBanner: false,
routerConfig: _router,
Expand Down
2 changes: 1 addition & 1 deletion macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: ae543142af37865437ba92bdbda0c110b25e440b

COCOAPODS: 1.14.2
COCOAPODS: 1.14.3

0 comments on commit 49d1403

Please sign in to comment.