set minimum desktop window size (odd startup behaviour?)

This commit is contained in:
julian 2022-09-14 18:28:11 -06:00
parent f61621896c
commit f21e046bb7
8 changed files with 33 additions and 0 deletions

View file

@ -56,6 +56,7 @@ import 'package:stackwallet/utilities/enums/backup_frequency_type.dart';
import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/prefs.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:window_size/window_size.dart';
final openedFromSWBFileStringStateProvider =
StateProvider<String?>((ref) => null);
@ -65,6 +66,13 @@ final openedFromSWBFileStringStateProvider =
// miscellaneous box for later use
void main() async {
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
if (Platform.isLinux || Platform.isWindows || Platform.isMacOS) {
setWindowTitle('Stack Wallet');
setWindowMinSize(const Size(1200, 900));
setWindowMaxSize(Size.infinite);
}
Directory appDirectory = (await getApplicationDocumentsDirectory());
if (Platform.isIOS) {
appDirectory = (await getLibraryDirectory());

View file

@ -13,6 +13,7 @@
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
#include <stack_wallet_backup/stack_wallet_backup_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_size/window_size_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) devicelocale_registrar =
@ -36,4 +37,7 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
g_autoptr(FlPluginRegistrar) window_size_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowSizePlugin");
window_size_plugin_register_with_registrar(window_size_registrar);
}

View file

@ -10,6 +10,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
isar_flutter_libs
stack_wallet_backup
url_launcher_linux
window_size
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST

View file

@ -17,6 +17,7 @@ import shared_preferences_macos
import stack_wallet_backup
import url_launcher_macos
import wakelock_macos
import window_size
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
@ -31,4 +32,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
StackWalletBackupPlugin.register(with: registry.registrar(forPlugin: "StackWalletBackupPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin"))
WindowSizePlugin.register(with: registry.registrar(forPlugin: "WindowSizePlugin"))
}

View file

@ -1596,6 +1596,15 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.7.0"
window_size:
dependency: "direct main"
description:
path: "plugins/window_size"
ref: HEAD
resolved-ref: "17d4710c17f4913137e7ec931f6e71eaef443363"
url: "https://github.com/google/flutter-desktop-embedding.git"
source: git
version: "0.1.0"
xdg_directories:
dependency: transitive
description:

View file

@ -64,6 +64,11 @@ dependencies:
zxcvbn: ^1.0.0
dart_numerics: ^0.0.6
window_size:
git:
url: https://github.com/google/flutter-desktop-embedding.git
path: plugins/window_size
# Bitcoin plugins
bip39:
git:

View file

@ -13,6 +13,7 @@
#include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <stack_wallet_backup/stack_wallet_backup_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>
#include <window_size/window_size_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
ConnectivityPlusWindowsPluginRegisterWithRegistrar(
@ -29,4 +30,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("StackWalletBackupPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
WindowSizePluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("WindowSizePlugin"));
}

View file

@ -10,6 +10,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
permission_handler_windows
stack_wallet_backup
url_launcher_windows
window_size
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST