* chore: fix version parsing for debug builds

* chore: don't cast doubles as ints
This commit is contained in:
ggurdin 2025-07-08 16:12:09 -04:00 committed by GitHub
parent 9b13e27a0c
commit aa3b3a3d1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 6 deletions

View file

@ -74,8 +74,8 @@ class LevelUpManager {
prevVocab = lastSummary.levelVocabConstructs!;
prevGrammar = lastSummary.levelGrammarConstructs!;
} else {
prevGrammar = (nextGrammar / prevLevel) as int;
prevVocab = (nextVocab / prevLevel) as int;
prevGrammar = (nextGrammar / prevLevel).round();
prevVocab = (nextVocab / prevLevel).round();
}
}
}

View file

@ -76,10 +76,17 @@ class AppVersionUtil {
// convert the version number string into a list of ints
// and the build number string into an int
final currentVersionParts =
currentVersion.split(".").map((e) => int.parse(e)).toList();
final remoteVersionParts =
remoteVersion.split(".").map((e) => int.parse(e)).toList();
final currentVersionParts = currentVersion
.replaceAll(RegExp(r'[^0-9.]'), '')
.split(".")
.map((e) => int.parse(e))
.toList();
final remoteVersionParts = remoteVersion
.replaceAll(RegExp(r'[^0-9.]'), '')
.split(".")
.map((e) => int.parse(e))
.toList();
final currentBuildNumberInt = int.parse(currentBuildNumber);
final remoteBuildNumberInt = int.parse(remoteBuildNumber);