Skip to content

Commit

Permalink
Add window size package
Browse files Browse the repository at this point in the history
  • Loading branch information
hazarbelge committed Sep 5, 2021
1 parent 78be39b commit 0d8c385
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:window_size/window_size.dart';

import '../../routes/index.dart';
import '../../util/index.dart';
Expand All @@ -18,6 +19,11 @@ Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await initServices();

if (GetPlatform.isDesktop) {
setWindowTitle('Flutter The Movie DB');
setWindowMinSize(const Size(300, 650));
}

runApp(
DevicePreview(
enabled: false,
Expand Down Expand Up @@ -45,11 +51,13 @@ class MovieApp extends StatelessWidget {
theme: Style.lightTheme,
darkTheme: Style.darkTheme,
themeMode: ThemeMode.system,
defaultTransition: Transition.cupertino,
defaultTransition: Transition.fadeIn,
getPages: AppPages.routes,
initialRoute: AppRoutes.START,
enableLog: true,
//logWriterCallback: (String text, {bool isError = false}) {}
logWriterCallback: (String text, {bool isError = false}) {
debugPrint("GetXLog: $text");
},
navigatorObservers: <NavigatorObserver>[
GetObserver(),
],
Expand Down
9 changes: 9 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,15 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.8"
window_size:
dependency: "direct main"
description:
path: "plugins/window_size"
ref: HEAD
resolved-ref: "1d9232e2c172992b74ba538851ffea26a0cb2640"
url: "git://github.com/google/flutter-desktop-embedding.git"
source: git
version: "0.1.0"
xdg_directories:
dependency: transitive
description:
Expand Down
5 changes: 5 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ dependencies:
url_launcher: ^6.0.3
video_player: ^2.1.15

window_size:
git:
url: git://github.com/google/flutter-desktop-embedding.git
path: plugins/window_size

dev_dependencies:
flutter_lints: ^1.0.4
flutter_test:
Expand Down

0 comments on commit 0d8c385

Please sign in to comment.