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

fix: fix fvm check #331

Merged
merged 3 commits into from
Sep 4, 2024
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
3 changes: 0 additions & 3 deletions lib/src/modules/compatibility_checks/compat.dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,5 @@ String _genCommand(CompatibilityCheck check) {
if (!check.git) {
command += gitInstallCmd;
}
if (!check.fvm) {
command += fvmInstallCmd;
}
return command;
}
13 changes: 2 additions & 11 deletions lib/src/modules/compatibility_checks/compat.dto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ class CompatibilityCheck {
/// Git Install Status
bool git;

/// FVM Install Status
bool fvm;

/// Cohocolately Install Status
bool choco;

Expand All @@ -19,7 +16,6 @@ class CompatibilityCheck {
/// Constructor
CompatibilityCheck({
required this.git,
required this.fvm,
required this.choco,
required this.brew,
this.waiting = false,
Expand All @@ -30,7 +26,6 @@ class CompatibilityCheck {
return CompatibilityCheck(
brew: false,
choco: false,
fvm: false,
git: false,
waiting: true,
);
Expand All @@ -49,7 +44,6 @@ class CompatibilityCheck {
}) {
return CompatibilityCheck(
git: git ?? this.git,
fvm: fvm ?? this.fvm,
choco: choco ?? this.choco,
brew: brew ?? this.brew,
);
Expand All @@ -58,7 +52,6 @@ class CompatibilityCheck {
Map<String, dynamic> toMap() {
return {
'git': git,
'fvm': fvm,
'choco': choco,
'brew': brew,
};
Expand All @@ -67,7 +60,6 @@ class CompatibilityCheck {
factory CompatibilityCheck.fromMap(Map<String, dynamic> map) {
return CompatibilityCheck(
git: map['git'] ?? false,
fvm: map['fvm'] ?? false,
choco: map['choco'] ?? false,
brew: map['brew'] ?? false,
);
Expand All @@ -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
Expand All @@ -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;
}
}
2 changes: 0 additions & 2 deletions lib/src/modules/compatibility_checks/compat.provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ class CompatStateNotifier extends StateNotifier<CompatibilityCheck> {
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,
);
Expand Down
10 changes: 0 additions & 10 deletions lib/src/modules/compatibility_checks/compat.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down
13 changes: 1 addition & 12 deletions lib/src/modules/compatibility_checks/compat.utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ Future<bool> isBrewInstalled() async {
return false;
}

Future<bool> isFvmInstalled() async {
final fvmRes = await which("git");
if (fvmRes != null) {
return true;
}
return false;
}

Future<bool> isGitInstalled() async {
final gitRes = await which("git");
Expand All @@ -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";
3 changes: 0 additions & 3 deletions windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <screen_retriever/screen_retriever_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h>
#include <window_manager/window_manager_plugin.h>
#include <window_size/window_size_plugin.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
BitsdojoWindowPluginRegisterWithRegistrar(
Expand All @@ -27,6 +26,4 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
WindowManagerPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("WindowManagerPlugin"));
WindowSizePluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("WindowSizePlugin"));
}
1 change: 0 additions & 1 deletion windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
screen_retriever
url_launcher_windows
window_manager
window_size
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
Loading