We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would like the ability to customize the message based on an optional upgrade vs a required update.
Suggestion: update the Upgrader class to support a second UpgraderMessages param for forced updates.
class OptionalMessages extends UpgraderMessages; class ForcedMessages extends UpgraderMessages;
Upgrader ( messages: OptionalMessages(), forcedMessages: ForcedMessages(), )
Update the determineMessages method to consider if the blocked method is true then return ForcedMessages.
The text was updated successfully, but these errors were encountered:
You have to override "blocked" method
class AppUpgrader extends Upgrader { static final AppUpgrader _instance = AppUpgrader._internal(); AppUpgrader._internal() : super( countryCode: 'BR', languageCode: 'pt', messages: AppUpgraderMessages(), durationUntilAlertAgain: const Duration(days: 1), debugDisplayAlways: true, debugLogging: true, ); static AppUpgrader get instance => _instance; @override bool blocked() { return super.blocked() || _isCriticalUpdate(AppUpgrader.instance.currentInstalledVersion, AppUpgrader.instance.currentAppStoreVersion); } }
and messages:
class AppUpgraderMessages extends UpgraderMessages { @override String get title => _isCriticalUpdate( AppUpgrader.instance.currentInstalledVersion, AppUpgrader.instance.currentAppStoreVersion, ) ? 'Atualização Necessária' : 'Atualizar aplicativo?'; }
_isCriticalUpdate:
bool _isCriticalUpdate(String? currentInstalledVersion, String? currentAppStoreVersion) { Version installedVersion = Version.parse(currentInstalledVersion ?? '0.0.0'); Version appStoreVersion = Version.parse(currentAppStoreVersion ?? '0.0.0'); return (installedVersion.major != appStoreVersion.major || installedVersion.minor != appStoreVersion.minor); }
Sorry, something went wrong.
No branches or pull requests
I would like the ability to customize the message based on an optional upgrade vs a required update.
Suggestion: update the Upgrader class to support a second UpgraderMessages param for forced updates.
class OptionalMessages extends UpgraderMessages;
class ForcedMessages extends UpgraderMessages;
Upgrader (
messages: OptionalMessages(),
forcedMessages: ForcedMessages(),
)
Update the determineMessages method to consider if the blocked method is true then return ForcedMessages.
The text was updated successfully, but these errors were encountered: