AutoUpdaterConfig class
Configuration for the auto-updater plugin.
All fields are optional with sensible defaults, making the plugin highly configurable while still being easy to use out of the box.
Constructors
-
AutoUpdaterConfig({required String baseUrl, required String appId, String versionPath = 'version', String environment = 'prod', bool releaseHubMode = false, bool checkOnStartup = true, Duration startupDelay = const Duration(seconds: 2), bool skipPermissionCheck = false, bool isDisabled = false, String apkFilenamePattern = '{appId}_update_{version}.apk', bool includeArchitecture = true, Map<
String, String> ? httpHeaders, Duration connectionTimeout = const Duration(seconds: 30), VersionResponseFields responseFields = const VersionResponseFields(), void logger(String message)?}) -
const
-
AutoUpdaterConfig.releaseHub({required String baseUrl, required String projectSlug, String channel = 'stable', bool checkOnStartup = true, Duration startupDelay = const Duration(seconds: 2), bool skipPermissionCheck = false, bool isDisabled = false, String apkFilenamePattern = '{appId}_update_{version}.apk', Map<
String, String> ? httpHeaders, Duration connectionTimeout = const Duration(seconds: 30), void logger(String message)?}) -
Factory constructor for ReleaseHub backends
factory
Properties
- apkFilenamePattern → String
-
Custom filename pattern for downloaded APK.
Placeholders: {appId}, {version}, {environment}
Default: '{appId}update{version}.apk'
final
- appId → String
-
Unique identifier for your app (e.g., 'com.example.myapp')
For ReleaseHub, this can be the project slug or bundle_id
final
- baseUrl → String
-
Base URL for the version check endpoint.
The final URL will be:
$baseUrl/$versionPath/$appId/$environmentFor ReleaseHub mode:$baseUrl/$versionPath/$appId?version=X&build=N&channel=$environment&arch=Yfinal - checkOnStartup → bool
-
Whether to automatically check for updates on service initialization
final
- connectionTimeout → Duration
-
Connection timeout for HTTP requests
final
- environment → String
-
Environment/flavor name (e.g., 'dev', 'staging', 'prod')
For ReleaseHub mode, this is used as the channel name
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
httpHeaders
→ Map<
String, String> ? -
Custom HTTP headers for version check and download requests
final
- includeArchitecture → bool
-
Whether to include device architecture in version check URL
final
- isDisabled → bool
-
Completely disable the auto-updater
final
- logger → void Function(String message)?
-
Callback for custom logging (defaults to debugPrint)
final
- releaseHubMode → bool
-
Enable ReleaseHub API format compatibility.
When true, uses ReleaseHub's nested response format and URL structure.
final
- responseFields → VersionResponseFields
-
Custom JSON field names for parsing version response
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- skipPermissionCheck → bool
-
Skip the Android install packages permission dialog
final
- startupDelay → Duration
-
Delay before the startup check (to let the app fully initialize)
final
- versionCheckUrl → String
-
Creates the full version check URL
no setter
- versionPath → String
-
Path segment for version checking (default: 'version')
For ReleaseHub mode, this is typically 'api/check'
final
Methods
-
copyWith(
{String? baseUrl, String? versionPath, String? appId, String? environment, bool? releaseHubMode, bool? checkOnStartup, Duration? startupDelay, bool? skipPermissionCheck, bool? isDisabled, String? apkFilenamePattern, bool? includeArchitecture, Map< String, String> ? httpHeaders, Duration? connectionTimeout, VersionResponseFields? responseFields, void logger(String message)?}) → AutoUpdaterConfig - Creates a copy with modified values
-
generateApkFilename(
String version) → String - Generates the APK filename from the pattern
-
log(
String message) → void - Log helper that uses custom logger or debugPrint
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
versionCheckUrlWithArch(
String? arch, {String? currentVersion, int? currentBuild}) → String - Creates the version check URL with optional architecture parameter For ReleaseHub mode, includes version, build, channel, and arch as query params
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited