Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solved: window size on desktop #41

Merged
merged 1 commit into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/plugin_management/plugins.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import 'dart:ui';

import 'package:flutter/foundation.dart';
import 'package:flutter_downloader/flutter_downloader.dart';
import 'package:netshare/data/hivedb/hive_storage.dart';
import 'package:netshare/util/utility_functions.dart';
import 'package:window_size/window_size.dart';

Future <void> initPlugins() async {
if(UtilityFunctions.isMobile) {
await FlutterDownloader.initialize(debug: kDebugMode, ignoreSsl: true);
}
await HiveStorage().init();

// window_size configuration
if(UtilityFunctions.isDesktop) {
setWindowMinSize(const Size(700, 600));
setWindowMaxSize(Size.infinite);
}
}
2 changes: 2 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import open_dir_macos
import path_provider_foundation
import share_plus
import shared_preferences_foundation
import window_size

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DesktopDropPlugin.register(with: registry.registrar(forPlugin: "DesktopDropPlugin"))
Expand All @@ -21,4 +22,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
WindowSizePlugin.register(with: registry.registrar(forPlugin: "WindowSizePlugin"))
}
6 changes: 6 additions & 0 deletions macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ PODS:
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- window_size (0.0.2):
- FlutterMacOS

DEPENDENCIES:
- desktop_drop (from `Flutter/ephemeral/.symlinks/plugins/desktop_drop/macos`)
Expand All @@ -26,6 +28,7 @@ DEPENDENCIES:
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
- window_size (from `Flutter/ephemeral/.symlinks/plugins/window_size/macos`)

EXTERNAL SOURCES:
desktop_drop:
Expand All @@ -44,6 +47,8 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos
shared_preferences_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
window_size:
:path: Flutter/ephemeral/.symlinks/plugins/window_size/macos

SPEC CHECKSUMS:
desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898
Expand All @@ -54,6 +59,7 @@ SPEC CHECKSUMS:
path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852
share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7
shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca
window_size: 339dafa0b27a95a62a843042038fa6c3c48de195

PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7

Expand Down
9 changes: 9 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,15 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.3"
window_size:
dependency: "direct main"
description:
path: "plugins/window_size"
ref: HEAD
resolved-ref: "6c66ad23ee79749f30a8eece542cf54eaf157ed8"
url: "https://github.com/google/flutter-desktop-embedding.git"
source: git
version: "0.1.0"
xdg_directories:
dependency: transitive
description:
Expand Down
4 changes: 4 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ dependencies:
qr_flutter: ^4.0.0
qr_code_scanner: ^1.0.1
desktop_drop: ^0.4.1
window_size:
git:
url: https://github.com/google/flutter-desktop-embedding.git
path: plugins/window_size

dev_dependencies:
flutter_test:
Expand Down