fvm library

Classes

AppConfig
AppConfigCopyWith<$R, $In extends AppConfig, $Out>
AppConfigMapper
CacheFlutterVersion
A cached Flutter SDK version with metadata loaded from disk.
CacheFlutterVersionCopyWith<$R, $In extends CacheFlutterVersion, $Out>
CacheFlutterVersionMapper
CacheService
ChangeCase
Channels
Release channels model
ChannelsCopyWith<$R, $In extends Channels, $Out>
ChannelsMapper
Config
ConfigOptionsMapper
EnvConfig
EnvConfigCopyWith<$R, $In extends EnvConfig, $Out>
EnvConfigMapper
FileConfig
FlutterChannelMapper
FlutterFork
FlutterForkCopyWith<$R, $In extends FlutterFork, $Out>
FlutterForkMapper
FlutterReleaseClient
FlutterReleasesResponse
Flutter Releases
FlutterReleasesResponseCopyWith<$R, $In extends FlutterReleasesResponse, $Out>
FlutterReleasesResponseMapper
FlutterRootVersionFile
Represents the contents of $FLUTTER_ROOT/bin/cache/flutter.version.json.
FlutterRootVersionFileCopyWith<$R, $In extends FlutterRootVersionFile, $Out>
FlutterRootVersionFileMapper
FlutterSdkRelease
Release Model
FlutterSdkReleaseCopyWith<$R, $In extends FlutterSdkRelease, $Out>
FlutterSdkReleaseMapper
FlutterVersion
Provides a structured way to handle Flutter SDK versions.
FlutterVersionCopyWith<$R, $In extends FlutterVersion, $Out>
FlutterVersionMapper
FlutterVersionOutput
Parsed Flutter version information from flutter --version output.
FvmContext
FvmContextCopyWith<$R, $In extends FvmContext, $Out>
FvmContextMapper
GeneratorsMapper
LevelMapper
LocalAppConfig
LocalAppConfigCopyWith<$R, $In extends LocalAppConfig, $Out>
LocalAppConfigMapper
Project
Represents a Flutter project.
ProjectConfig
Project config
ProjectConfigCopyWith<$R, $In extends ProjectConfig, $Out>
ProjectConfigMapper
ProjectCopyWith<$R, $In extends Project, $Out>
ProjectMapper
ProjectService
Flutter Project Services APIs for interacting with local Flutter projects
PubspecMapper
VersionTypeMapper

Constants

kCiEnvironmentVariables → const List<String>
A list of common environment variable names used by Continuous Integration (CI) systems. These variables can be checked to determine if FVM is running in a CI environment, which might affect interactive prompts or logging.
kDefaultFlutterUrl → const String
The default Git URL for cloning the Flutter SDK. This URL is used when no alternative source is specified.
kDescription → const String
A brief description of FVM. This description is used in help messages and documentation.
kFlutterChannels → const List<String>
The list of supported Flutter release channels. These channels (e.g. 'stable', 'dev', etc.) are used when selecting the version of Flutter to install.
kFvmConfigFileName → const String
The name of the FVM configuration file within a project. This file contains the configuration settings for FVM.
kFvmDirName → const String
The directory name used within projects to store FVM-related files. This directory is created in the root of a Flutter project.
kFvmDocsConfigUrl → const String
The URL to the configuration documentation for FVM. This helps users understand how to set up FVM in their projects.
kFvmDocsUrl → const String
The URL to the FVM documentation website.
kFvmLegacyConfigFileName → const String
The legacy FVM configuration file name, used for backward compatibility.
kIntelliJ → const String
Constant for the IntelliJ (or Android Studio) editor name. This helps in identifying the IDE when configuring FVM.
kPackageName → const String
The package name for Flutter Version Management (FVM). This value is used to construct directory paths and identifiers for FVM.
kVsCode → const String
Constant for the Visual Studio Code editor name. This is used when selecting an IDE in FVM configurations.
skipCopyWith → const int

Properties

dartExecFileName String
The file name of the Dart executable, including the platform-specific extension. This is used to locate and invoke the Dart VM.
getter/setter pair
flutterExecFileName String
The file name of the Flutter executable, including the platform-specific extension. This is used to locate and invoke the Flutter command-line interface.
final
kAppConfigFile String
The full path to the global FVM configuration file. It is located in the user's configuration home directory.
final
kAppDirHome String
The FVM home directory, constructed by joining the user's home directory with the package name. This directory stores global FVM configuration and state files.
final
kUserHome String
final

Functions

assignVersionWeight(String version) String
Converts Flutter versions and channels to comparable semver strings. Assigns weights: git commits (500.0.0), master (400.0.0), stable (300.0.0), beta (200.0.0), dev (100.0.0), invalid (0.0.0).
checkIfNeedsPrivilegePermission(FileSystemException err) bool
extractDartVersionOutput(String input) String
Extracts Dart version from dart --version output.
extractFlutterVersionOutput(String content) FlutterVersionOutput
Parses Flutter version output from flutter --version command.
formatFriendlyBytes(int bytes, [int decimals = 2]) String
Formats bytes into human-readable format (e.g., "1.5 GB").
friendlyDate(DateTime dateTime) String
Formats a DateTime as "Month Day, Year" (e.g., "Jan 15, 2024").
getDirectorySize(Directory dir) Future<int>
Calculates total size of a directory recursively.
getFullDirectorySize(List<CacheFlutterVersion> versions, Logger logger) Future<int>
Calculates total size of all cached Flutter versions in parallel.
isFlutterChannel(String name) bool
Checks if name is a valid Flutter release channel.
isPossibleGitCommit(String hash) bool
isValidGitUrl(String url) bool
Validates if a URL is a valid Git repository URL.
isVsCode() bool
Returns true if running inside Visual Studio Code.
lookUpDirectoryAncestor<T>({required Directory directory, required T? validate(Directory), void debugPrinter(String)?}) → T?
Recursively searches for a directory and returns the first valid candidate.
mapToYaml(Map<String, dynamic> map, [int indentLevel = 0]) String
prettyJson(Map<String, dynamic> json) String
Formats json
stringToBool(String value) bool?
Converts string to boolean. Returns null for invalid values.
updateEnvironmentVariables(List<String> paths, Map<String, String> env) Map<String, String>
Updates environment variables by prepending paths to PATH.

Typedefs

Generator<T extends Contextual> = T Function(FvmContext context)
Generates an FvmContext value.

Exceptions / Errors

AppDetailedException
AppException
Represents an FVM-specific exception that carries a user-facing message.
ForceExit
GitCacheDependentSdkRemovalException