Skip to content

Commit

Permalink
Testing new updates PR
Browse files Browse the repository at this point in the history
  • Loading branch information
kauemurakami committed Dec 3, 2024
1 parent b04c68d commit b38beaf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
12 changes: 4 additions & 8 deletions lib/app_version_update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,11 @@ class AppVersionUpdate {
AppVersionResult? appVersionResult,
bool? mandatory = false,
String? title = 'New version available',
TextStyle? titleTextStyle = const TextStyle(
fontSize: 24.0, fontWeight: FontWeight.w500, color: Colors.black),
TextStyle? titleTextStyle = const TextStyle(fontSize: 24.0, fontWeight: FontWeight.w500, color: Colors.black),
String? content = 'Would you like to update your application?',
TextStyle? contentTextStyle = const TextStyle(
fontSize: 16.0, fontWeight: FontWeight.w400, color: Colors.black),
ButtonStyle? cancelButtonStyle = const ButtonStyle(
backgroundColor: WidgetStatePropertyAll(Colors.redAccent)),
ButtonStyle? updateButtonStyle = const ButtonStyle(
backgroundColor: WidgetStatePropertyAll(Colors.green)),
TextStyle? contentTextStyle = const TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400, color: Colors.black),
ButtonStyle? cancelButtonStyle = const ButtonStyle(backgroundColor: WidgetStatePropertyAll(Colors.redAccent)),
ButtonStyle? updateButtonStyle = const ButtonStyle(backgroundColor: WidgetStatePropertyAll(Colors.green)),
String? cancelButtonText = 'UPDATE LATER',
String? updateButtonText = 'UPDATE',
TextStyle? cancelTextStyle = const TextStyle(color: Colors.white),
Expand Down
6 changes: 2 additions & 4 deletions lib/core/functions/convert_version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ convertVersion({String? version, String? versionStore}) {
var maxLength = max(localVersion.length, storeVersion.length);
for (int i = 0; i < maxLength; i++) {
/// if any of the store elements is smaller than a corresponding element of local version we will exit the function with false.
if (int.parse(storeVersion.getOrDefault(i, '0')) <
int.parse(localVersion.getOrDefault(i, '0'))) {
if (int.parse(storeVersion.getOrDefault(i, '0')) < int.parse(localVersion.getOrDefault(i, '0'))) {
return false;
}

/// if any element of the store version is greater than the corresponding local version, there is an update.
if (int.parse(storeVersion.getOrDefault(i, '0')) >
int.parse(localVersion.getOrDefault(i, '0'))) {
if (int.parse(storeVersion.getOrDefault(i, '0')) > int.parse(localVersion.getOrDefault(i, '0'))) {
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: app_version_update
description: An easy and quick way to check if the local app is updated with the same version in their respective stores (Play Store / Apple Store ).
# author: Kauê Tomaz Murakami<[email protected]>
version: 5.0.3
version: 6.0.0
homepage: https://github.com/kauemurakami/app_version_update

environment:
Expand Down

0 comments on commit b38beaf

Please sign in to comment.