From 6dfb8aca0fb3d2a61f186eceefca1a1410a330f8 Mon Sep 17 00:00:00 2001 From: arce lai Date: Mon, 2 Sep 2024 22:31:35 +0800 Subject: [PATCH 1/2] fix: fix fvm check --- lib/src/modules/compatibility_checks/compat.utils.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/modules/compatibility_checks/compat.utils.dart b/lib/src/modules/compatibility_checks/compat.utils.dart index 7dea1cd..fe987b5 100644 --- a/lib/src/modules/compatibility_checks/compat.utils.dart +++ b/lib/src/modules/compatibility_checks/compat.utils.dart @@ -21,7 +21,7 @@ Future isBrewInstalled() async { } Future isFvmInstalled() async { - final fvmRes = await which("git"); + final fvmRes = await which("fvm"); if (fvmRes != null) { return true; } From d0643a5b98ac6deff4f0d08c39cabb6d3c624fb1 Mon Sep 17 00:00:00 2001 From: arce lai Date: Wed, 4 Sep 2024 16:26:42 +0800 Subject: [PATCH 2/2] refactor(fvm): delete fvm check code --- .../modules/compatibility_checks/compat.dialog.dart | 3 --- .../modules/compatibility_checks/compat.dto.dart | 13 ++----------- .../compatibility_checks/compat.provider.dart | 2 -- .../modules/compatibility_checks/compat.screen.dart | 10 ---------- .../modules/compatibility_checks/compat.utils.dart | 13 +------------ windows/flutter/generated_plugin_registrant.cc | 3 --- windows/flutter/generated_plugins.cmake | 1 - 7 files changed, 3 insertions(+), 42 deletions(-) diff --git a/lib/src/modules/compatibility_checks/compat.dialog.dart b/lib/src/modules/compatibility_checks/compat.dialog.dart index 1be5600..65a850e 100644 --- a/lib/src/modules/compatibility_checks/compat.dialog.dart +++ b/lib/src/modules/compatibility_checks/compat.dialog.dart @@ -99,8 +99,5 @@ String _genCommand(CompatibilityCheck check) { if (!check.git) { command += gitInstallCmd; } - if (!check.fvm) { - command += fvmInstallCmd; - } return command; } diff --git a/lib/src/modules/compatibility_checks/compat.dto.dart b/lib/src/modules/compatibility_checks/compat.dto.dart index 5dfae3e..c4f45cc 100644 --- a/lib/src/modules/compatibility_checks/compat.dto.dart +++ b/lib/src/modules/compatibility_checks/compat.dto.dart @@ -5,9 +5,6 @@ class CompatibilityCheck { /// Git Install Status bool git; - /// FVM Install Status - bool fvm; - /// Cohocolately Install Status bool choco; @@ -19,7 +16,6 @@ class CompatibilityCheck { /// Constructor CompatibilityCheck({ required this.git, - required this.fvm, required this.choco, required this.brew, this.waiting = false, @@ -30,7 +26,6 @@ class CompatibilityCheck { return CompatibilityCheck( brew: false, choco: false, - fvm: false, git: false, waiting: true, ); @@ -49,7 +44,6 @@ class CompatibilityCheck { }) { return CompatibilityCheck( git: git ?? this.git, - fvm: fvm ?? this.fvm, choco: choco ?? this.choco, brew: brew ?? this.brew, ); @@ -58,7 +52,6 @@ class CompatibilityCheck { Map toMap() { return { 'git': git, - 'fvm': fvm, 'choco': choco, 'brew': brew, }; @@ -67,7 +60,6 @@ class CompatibilityCheck { factory CompatibilityCheck.fromMap(Map map) { return CompatibilityCheck( git: map['git'] ?? false, - fvm: map['fvm'] ?? false, choco: map['choco'] ?? false, brew: map['brew'] ?? false, ); @@ -80,7 +72,7 @@ class CompatibilityCheck { @override String toString() { - return 'CompatibilityCheck(git: $git, fvm: $fvm, choco: $choco, brew: $brew)'; + return 'CompatibilityCheck(git: $git, choco: $choco, brew: $brew)'; } @override @@ -89,13 +81,12 @@ class CompatibilityCheck { return other is CompatibilityCheck && other.git == git && - other.fvm == fvm && other.choco == choco && other.brew == brew; } @override int get hashCode { - return git.hashCode ^ fvm.hashCode ^ choco.hashCode ^ brew.hashCode; + return git.hashCode ^ choco.hashCode ^ brew.hashCode; } } diff --git a/lib/src/modules/compatibility_checks/compat.provider.dart b/lib/src/modules/compatibility_checks/compat.provider.dart index 9615b78..9585627 100644 --- a/lib/src/modules/compatibility_checks/compat.provider.dart +++ b/lib/src/modules/compatibility_checks/compat.provider.dart @@ -21,11 +21,9 @@ class CompatStateNotifier extends StateNotifier { final chocoState = Platform.isWindows ? await isChocoInstalled() : false; final brewState = Platform.isLinux || Platform.isMacOS ? await isBrewInstalled() : false; - final fvmState = await isFvmInstalled(); final gitState = await isGitInstalled(); state = CompatibilityCheck( git: gitState, - fvm: fvmState, choco: chocoState, brew: brewState, ); diff --git a/lib/src/modules/compatibility_checks/compat.screen.dart b/lib/src/modules/compatibility_checks/compat.screen.dart index 688e1f3..e6b960f 100644 --- a/lib/src/modules/compatibility_checks/compat.screen.dart +++ b/lib/src/modules/compatibility_checks/compat.screen.dart @@ -74,16 +74,6 @@ class CompatCheckScreen extends ConsumerWidget { const SizedBox( height: 15, ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Heading("FVM"), - Icon(provider.fvm - ? Icons.check_circle_outline_rounded - : Icons.error_outline_rounded) - ], - ), const SizedBox( height: 5, ), diff --git a/lib/src/modules/compatibility_checks/compat.utils.dart b/lib/src/modules/compatibility_checks/compat.utils.dart index fe987b5..eeb3a85 100644 --- a/lib/src/modules/compatibility_checks/compat.utils.dart +++ b/lib/src/modules/compatibility_checks/compat.utils.dart @@ -20,13 +20,6 @@ Future isBrewInstalled() async { return false; } -Future isFvmInstalled() async { - final fvmRes = await which("fvm"); - if (fvmRes != null) { - return true; - } - return false; -} Future isGitInstalled() async { final gitRes = await which("git"); @@ -51,8 +44,4 @@ const chocoInstallCmd = 'Set-ExecutionPolicy AllSigned\nSet-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(\'https://community.chocolatey.org/install.ps1\'))\n'; final gitInstallCmd = - Platform.isWindows ? "choco install git -yf\n" : "brew install git\n"; - -final fvmInstallCmd = Platform.isWindows - ? "choco install fvm -y\n" - : "brew tap leoafarias/fvm\nbrew install fvm\n"; + Platform.isWindows ? "choco install git -yf\n" : "brew install git\n"; \ No newline at end of file diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 9cbcc48..6917e57 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -12,7 +12,6 @@ #include #include #include -#include void RegisterPlugins(flutter::PluginRegistry* registry) { BitsdojoWindowPluginRegisterWithRegistrar( @@ -27,6 +26,4 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("UrlLauncherWindows")); WindowManagerPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("WindowManagerPlugin")); - WindowSizePluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("WindowSizePlugin")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 79f2d52..fdc7a3d 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -9,7 +9,6 @@ list(APPEND FLUTTER_PLUGIN_LIST screen_retriever url_launcher_windows window_manager - window_size ) list(APPEND FLUTTER_FFI_PLUGIN_LIST