Set min screen size

This commit is contained in:
Морозов Андрей 2021-11-12 02:02:22 +04:00
parent b853664230
commit 4953a9ad19
5 changed files with 17 additions and 6 deletions

View File

@ -1,21 +1,21 @@
import 'package:graphs/pages/drawing_page.dart'; import 'package:graphs/pages/drawing_page.dart';
//import 'package:desktop_window/desktop_window.dart'; import 'package:desktop_window/desktop_window.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
void main() { void main() {
runApp(const MyApp()); runApp(const MyApp());
} }
/*Future setupWindow() async { Future setupWindow() async {
await DesktopWindow.setMinWindowSize(const Size(850, 620)); await DesktopWindow.setMinWindowSize(const Size(850, 700));
}*/ }
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key); const MyApp({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
//setupWindow(); setupWindow();
return const MaterialApp( return const MaterialApp(
title: "Graphs", title: "Graphs",
home: DrawingPage(), home: DrawingPage(),

View File

@ -57,6 +57,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.3" version: "1.0.3"
desktop_window:
dependency: "direct main"
description:
name: desktop_window
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:

View File

@ -35,7 +35,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
#desktop_window: ^0.4.0 desktop_window: ^0.4.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

View File

@ -6,6 +6,9 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <desktop_window/desktop_window_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
DesktopWindowPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DesktopWindowPlugin"));
} }

View File

@ -3,6 +3,7 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
desktop_window
) )
set(PLUGIN_BUNDLED_LIBRARIES) set(PLUGIN_BUNDLED_LIBRARIES)