UpdatWidget class

This widget is the default Updat widget, that will only be shown when a new update is detected (This is checked only once per widget initialization by default). If you want a custom widget to be shown, you can pass it as the updateChipBuilder parameter.

Inheritance

Constructors

UpdatWidget({required String currentVersion, required Future<String?> getLatestVersion(), required Future<String> getBinaryUrl(String? latestVersion), required String appName, Future<File> getDownloadFileLocation(String? latestVersion)?, Widget updateChipBuilder({required String appVersion, required void checkForUpdate(), required BuildContext context, required void dismissUpdate(), required String? latestVersion, required Future<void> launchInstaller(), required void openDialog(), required void startUpdate(), required UpdatStatus status})?, void updateDialogBuilder({required String appVersion, required String? changelog, required void checkForUpdate(), required BuildContext context, required void dismissUpdate(), required String? latestVersion, required Future<void> launchInstaller(), required void openDialog(), required void startUpdate(), required UpdatStatus status})?, Future<String?> getChangelog(String latestVersion, String appVersion)?, void callback(UpdatStatus status)?, bool openOnDownload = true, bool closeOnInstall = false, Key? key})
const

Properties

appName String
The name of the app.
final
callback → (void Function(UpdatStatus status)?)
final
closeOnInstall bool
If true, the app will be closed when the installer is launched.
final
currentVersion String
Current version of the app. This will be used to compare the latest version. The String must be a semantic version.
final
getBinaryUrl Future<String> Function(String? latestVersion)
Get the url of the binary file to download provided with a certain version.
final
getChangelog → (Future<String?> Function(String latestVersion, String appVersion)?)
This function will be invoked if there is a new release to get the changes.
final
getDownloadFileLocation → (Future<File> Function(String? latestVersion)?)
Override the default download location.
final
getLatestVersion Future<String?> Function()
This function will be invoked to ckeck if there is a new version available. The return string must be a semantic version.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
openOnDownload bool
If true, the installer will be opened when the update is downloaded.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
updateChipBuilder → (Widget Function({required String appVersion, required void checkForUpdate(), required BuildContext context, required void dismissUpdate(), required String? latestVersion, required Future<void> launchInstaller(), required void openDialog(), required void startUpdate(), required UpdatStatus status})?)
This Function can be used to override the default chip shown when there is a new version available.
final
updateDialogBuilder → (void Function({required String appVersion, required String? changelog, required void checkForUpdate(), required BuildContext context, required void dismissUpdate(), required String? latestVersion, required Future<void> launchInstaller(), required void openDialog(), required void startUpdate(), required UpdatStatus status})?)
This Function can be used to override the default dialog shown when there is a new version available. You must call showDialog yourself.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<UpdatWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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