UpdateService class

Service responsible for managing CLI updates.

Uses PubUpdater to check for and apply updates from pub.flutter-io.cn. Implements the singleton pattern with a private constructor.

Constructors

UpdateService.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
pubUpdater ← PubUpdater
Setter for PubUpdater instance, used for testing.
no getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkForUpdates() Future<TurboResponse<(ShouldUpdate, VersionNumber)>>
Checks if a newer version of the CLI is available on pub.flutter-io.cn.
dispose() Future<void>
getCurrentVersion() Future<String>
Gets the current package version from pubspec.yaml.
manualUpdate() Future<TurboResponse>
Manually checks for and applies updates.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setTestPubspecPath(String path) → void
Sets a test pubspec path for testing purposes.
toString() String
A string representation of this object.
inherited
update() Future<TurboResponse>
Updates the CLI to the latest version available on pub.flutter-io.cn.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

locate UpdateService
no setter

Static Methods

registerLazySingleton() → void