From 885e7c029e4495a86ea372f509bc183d7c62c293 Mon Sep 17 00:00:00 2001 From: Tricked <72335827+SkyBlockDev@users.noreply.github.com> Date: Thu, 3 Mar 2022 10:49:25 +0100 Subject: [PATCH] fix --- lib/main.dart | 140 +++++++++--------- linux/flutter/generated_plugin_registrant.cc | 4 - linux/flutter/generated_plugins.cmake | 1 - pubspec.lock | 35 ----- pubspec.yaml | 2 +- .../flutter/generated_plugin_registrant.cc | 3 - windows/flutter/generated_plugins.cmake | 1 - 7 files changed, 71 insertions(+), 115 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index c61558b..d855fd5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,7 +6,7 @@ // You should have received a copy of the license along with this // work. If not, see . -import 'package:bitsdojo_window/bitsdojo_window.dart'; +// import 'package:bitsdojo_window/bitsdojo_window.dart'; import 'package:args/args.dart'; import 'package:flutter/foundation.dart'; import 'package:tmodinstaller/config.dart'; @@ -40,10 +40,10 @@ void main(List args) async { windowManager.waitUntilReadyToShow().then((_) async { // Hide window title bar - if (defaultTargetPlatform == TargetPlatform.windows) { - await windowManager.setTitleBarStyle('hidden'); - await windowManager.setMinimumSize(const Size(755, 545)); - } + // if (defaultTargetPlatform == TargetPlatform.windows) { + // await windowManager.setTitleBarStyle('hidden'); + // await windowManager.setMinimumSize(const Size(755, 545)); + // } await windowManager.setSize(const Size(800, 600)); await windowManager.center(); await windowManager.show(); @@ -177,23 +177,23 @@ class _TModInstallerPageState extends State { return true; }).toList(); return NavigationView( - appBar: defaultTargetPlatform == TargetPlatform.windows - ? NavigationAppBar( - title: () { - return const DragToMoveArea( - child: Align( - alignment: AlignmentDirectional.centerStart, - child: Text("TMod Installer"), - ), - ); - }(), - actions: DragToMoveArea( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: const [Spacer(), WindowButtons()], - ), - )) - : null, + // appBar: defaultTargetPlatform == TargetPlatform.windows + // ? NavigationAppBar( + // title: () { + // return const DragToMoveArea( + // child: Align( + // alignment: AlignmentDirectional.centerStart, + // child: Text("TMod Installer"), + // ), + // ); + // }(), + // actions: DragToMoveArea( + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: const [Spacer(), WindowButtons()], + // ), + // )) + // : null, pane: NavigationPane( selected: index, onChanged: (i) => setState(() => index = i), @@ -250,52 +250,52 @@ class _TModInstallerPageState extends State { } } -class WindowButtons extends StatelessWidget { - const WindowButtons({Key? key}) : super(key: key); +// class WindowButtons extends StatelessWidget { +// const WindowButtons({Key? key}) : super(key: key); - @override - Widget build(BuildContext context) { - assert(debugCheckHasFluentTheme(context)); - assert(debugCheckHasFluentLocalizations(context)); - final ThemeData theme = FluentTheme.of(context); - final buttonColors = WindowButtonColors( - iconNormal: theme.inactiveColor, - iconMouseDown: theme.inactiveColor, - iconMouseOver: theme.inactiveColor, - mouseOver: ButtonThemeData.buttonColor( - theme.brightness, {ButtonStates.hovering}), - mouseDown: ButtonThemeData.buttonColor( - theme.brightness, {ButtonStates.pressing}), - ); - final closeButtonColors = WindowButtonColors( - mouseOver: Colors.red, - mouseDown: Colors.red.dark, - iconNormal: theme.inactiveColor, - iconMouseOver: Colors.red.basedOnLuminance(), - iconMouseDown: Colors.red.dark.basedOnLuminance(), - ); - return Row(children: [ - Tooltip( - message: FluentLocalizations.of(context).minimizeWindowTooltip, - child: MinimizeWindowButton(colors: buttonColors), - ), - Tooltip( - message: FluentLocalizations.of(context).restoreWindowTooltip, - child: WindowButton( - colors: buttonColors, - iconBuilder: (context) { - if (appWindow.isMaximized) { - return RestoreIcon(color: context.iconColor); - } - return MaximizeIcon(color: context.iconColor); - }, - onPressed: appWindow.maximizeOrRestore, - ), - ), - Tooltip( - message: FluentLocalizations.of(context).closeWindowTooltip, - child: CloseWindowButton(colors: closeButtonColors), - ), - ]); - } -} +// @override +// Widget build(BuildContext context) { +// assert(debugCheckHasFluentTheme(context)); +// assert(debugCheckHasFluentLocalizations(context)); +// final ThemeData theme = FluentTheme.of(context); +// final buttonColors = WindowButtonColors( +// iconNormal: theme.inactiveColor, +// iconMouseDown: theme.inactiveColor, +// iconMouseOver: theme.inactiveColor, +// mouseOver: ButtonThemeData.buttonColor( +// theme.brightness, {ButtonStates.hovering}), +// mouseDown: ButtonThemeData.buttonColor( +// theme.brightness, {ButtonStates.pressing}), +// ); +// final closeButtonColors = WindowButtonColors( +// mouseOver: Colors.red, +// mouseDown: Colors.red.dark, +// iconNormal: theme.inactiveColor, +// iconMouseOver: Colors.red.basedOnLuminance(), +// iconMouseDown: Colors.red.dark.basedOnLuminance(), +// ); +// return Row(children: [ +// Tooltip( +// message: FluentLocalizations.of(context).minimizeWindowTooltip, +// child: MinimizeWindowButton(colors: buttonColors), +// ), +// Tooltip( +// message: FluentLocalizations.of(context).restoreWindowTooltip, +// child: WindowButton( +// colors: buttonColors, +// iconBuilder: (context) { +// if (appWindow.isMaximized) { +// return RestoreIcon(color: context.iconColor); +// } +// return MaximizeIcon(color: context.iconColor); +// }, +// onPressed: appWindow.maximizeOrRestore, +// ), +// ), +// Tooltip( +// message: FluentLocalizations.of(context).closeWindowTooltip, +// child: CloseWindowButton(colors: closeButtonColors), +// ), +// ]); +// } +// } diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 2adb80f..930593f 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,7 +6,6 @@ #include "generated_plugin_registrant.h" -#include #include #include #include @@ -14,9 +13,6 @@ #include void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) bitsdojo_window_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "BitsdojoWindowPlugin"); - bitsdojo_window_plugin_register_with_registrar(bitsdojo_window_linux_registrar); g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); file_selector_plugin_register_with_registrar(file_selector_linux_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index f0c0dd4..9dc93b5 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - bitsdojo_window_linux file_selector_linux flutter_acrylic isar_flutter_libs diff --git a/pubspec.lock b/pubspec.lock index 05bc891..620f6d4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -36,41 +36,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.8.2" - bitsdojo_window: - dependency: "direct main" - description: - name: bitsdojo_window - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1+1" - bitsdojo_window_linux: - dependency: transitive - description: - name: bitsdojo_window_linux - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1" - bitsdojo_window_macos: - dependency: transitive - description: - name: bitsdojo_window_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" - bitsdojo_window_platform_interface: - dependency: transitive - description: - name: bitsdojo_window_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" - bitsdojo_window_windows: - dependency: transitive - description: - name: bitsdojo_window_windows - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" boolean_selector: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 2607c6c..fd5b6b1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: flutter_native_splash: ^2.0.5 url_launcher: ^6.0.20 url_strategy: ^0.2.0 - bitsdojo_window: ^0.1.1+1 + # bitsdojo_window: ^0.1.1+1 window_manager: ^0.1.6 shared_preferences: ^2.0.8 flutter_svg: ^1.0.3 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 8aea4e2..6783935 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,7 +6,6 @@ #include "generated_plugin_registrant.h" -#include #include #include #include @@ -15,8 +14,6 @@ #include void RegisterPlugins(flutter::PluginRegistry* registry) { - BitsdojoWindowPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("BitsdojoWindowPlugin")); FileSelectorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("FileSelectorWindows")); FlutterAcrylicPluginRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index eaa05b8..85b3b71 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - bitsdojo_window_windows file_selector_windows flutter_acrylic isar_flutter_libs