checkVersion method
Will show the alert dialog when it should be dispalyed.
Implementation
void checkVersion({required BuildContext context}) {
final shouldDisplay = widget.upgrader.shouldDisplayUpgrade();
if (widget.upgrader.state.debugLogging) {
print('upgrader: shouldDisplayReleaseNotes: $shouldDisplayReleaseNotes');
}
if (shouldDisplay) {
displayed = true;
final appMessages = widget.upgrader.determineMessages(context);
Future.delayed(const Duration(milliseconds: 0), () {
showTheDialog(
key: widget.dialogKey ?? const Key('upgrader_alert_dialog'),
context: context,
title: appMessages.message(UpgraderMessage.title),
message: widget.upgrader.body(appMessages),
releaseNotes:
shouldDisplayReleaseNotes ? widget.upgrader.releaseNotes : null,
barrierDismissible: widget.barrierDismissible,
messages: appMessages,
);
});
}
}