Skip to content

Commit

Permalink
replaced desktop_window with window_manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Stem-LG committed Mar 26, 2022
1 parent 8543852 commit 5c36747
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
12 changes: 9 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import 'package:flutter/material.dart';
import 'pages/home.dart';
import 'package:desktop_window/desktop_window.dart';
import 'package:window_manager/window_manager.dart';

void main() => runApp(const MyApp());
void main() {
WidgetsFlutterBinding.ensureInitialized();
windowManager.ensureInitialized();
windowManager.unmaximize();
windowManager.setSize(const Size(800, 300));
windowManager.show();
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
Expand All @@ -11,7 +18,6 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
DesktopWindow.setWindowSize(const Size(600, 250));
return MaterialApp(
title: _title,
theme: ThemeData(
Expand Down
8 changes: 4 additions & 4 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

#include "generated_plugin_registrant.h"

#include <desktop_window/desktop_window_plugin.h>
#include <window_manager/window_manager_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) desktop_window_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopWindowPlugin");
desktop_window_plugin_register_with_registrar(desktop_window_registrar);
g_autoptr(FlPluginRegistrar) window_manager_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin");
window_manager_plugin_register_with_registrar(window_manager_registrar);
}
2 changes: 1 addition & 1 deletion linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
desktop_window
window_manager
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
flutter:
sdk: flutter

desktop_window: ^0.4.0
window_manager: ^0.2.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 5c36747

Please sign in to comment.