버전 업데이트 메서드 수정
This commit is contained in:
parent
c9c6973072
commit
b0fbf6d179
1 changed files with 8 additions and 2 deletions
|
|
@ -22,8 +22,14 @@ String jsonPrettyEncode(Object? object) {
|
|||
return JsonEncoder.withIndent(' ').convert(object);
|
||||
}
|
||||
|
||||
String incrementVersion(String version) {
|
||||
final parts = version.split('.').map(int.parse).toList();
|
||||
String incrementVersion(String version, {int fixedLength = 3}) {
|
||||
var parts = version.split('.').map(int.parse).toList();
|
||||
if (parts.length < fixedLength) {
|
||||
var needLength = fixedLength - parts.length;
|
||||
for (int i = 0; i < needLength; ++i) {
|
||||
parts.add(0);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = parts.length - 1; i >= 0; i--) {
|
||||
if (parts[i] < 999) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue