flatChipWithSilentDownload function
Widget
flatChipWithSilentDownload({
- required BuildContext context,
- required String? latestVersion,
- required String appVersion,
- required UpdatStatus status,
- required void checkForUpdate(),
- required void openDialog(),
- required void startUpdate(),
- required Future<
void> launchInstaller(), - required void dismissUpdate(),
Implementation
Widget flatChipWithSilentDownload({
required BuildContext context,
required String? latestVersion,
required String appVersion,
required UpdatStatus status,
required void Function() checkForUpdate,
required void Function() openDialog,
required void Function() startUpdate,
required Future<void> Function() launchInstaller,
required void Function() dismissUpdate,
}) {
if (UpdatStatus.available == status ||
UpdatStatus.availableWithChangelog == status) {
startUpdate();
}
if (UpdatStatus.readyToInstall == status) {
return Tooltip(
message: 'Click to Install',
child: TextButton.icon(
onPressed: launchInstaller,
icon: const Icon(Icons.check_circle),
label: const Text('Update Ready to install'),
),
);
}
return Container();
}