show method
Checks if it is necessary to show an app update.
This method performs the following operations:
- Retrieves the app information.
- Checks if the JSON file containing the app information is available.
- Verifies if the app package matches any of the known packages (Android, iOS, Windows, Linux, macOS, Web).
- Checks if a new version of the app is available.
- Displays an update dialog if necessary.
Returns a Future<bool> indicating if the update dialog was shown.
Returns:
trueif the update dialog was shown.falseotherwise.
Implementation
Future<bool> show() async {
final upd = await checkUpdated();
if (!(showWeb ?? true) || !upd) return upd;
if (kIsWeb) {
_updateGenericDialog(context);
} else if (cupertinoDialog && (Platform.isIOS || Platform.isMacOS)) {
print(cupertinoDialog);
_updateDialogIos(context);
} else {
_updateGenericDialog(context);
}
return upd;
}