mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-21 20:00:49 +01:00
feat(desktop): mark the desktop version as beta
Desktop release builds show the version as "5.2.5 (beta)" wherever the display version appears: Settings, About, the update dialog and the version noted in backups. Mobile builds and the version used for update checks and logs are unchanged.
This commit is contained in:
1 parent
45339bf467
commit
b0c60acaee
2 files changed
+26
-1
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:mornye/utils/desktop_platform.dart';
|
||||
|
||||
class AppInfo {
|
||||
static const String version = '5.2.5';
|
||||
@@ -8,7 +9,14 @@ class AppInfo {
|
||||
static String get shortGitCommit =>
|
||||
gitCommit.length > 8 ? gitCommit.substring(0, 8) : gitCommit;
|
||||
|
||||
static String get displayVersion => kDebugMode ? 'Internal' : version;
|
||||
/// The version shown to people; desktop builds are still in beta.
|
||||
static String get displayVersion => versionLabel();
|
||||
|
||||
@visibleForTesting
|
||||
static String versionLabel({bool debug = kDebugMode, bool? desktop}) {
|
||||
if (debug) return 'Internal';
|
||||
return desktop ?? isDesktopPlatform ? '$version (beta)' : version;
|
||||
}
|
||||
|
||||
static const String appName = 'Mornye';
|
||||
static const String copyright = '© 2026 Zarz Eleutherius';
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mornye/constants/app_info.dart';
|
||||
|
||||
void main() {
|
||||
test('desktop release builds mark the version as beta', () {
|
||||
expect(
|
||||
AppInfo.versionLabel(debug: false, desktop: true),
|
||||
'${AppInfo.version} (beta)',
|
||||
);
|
||||
expect(AppInfo.versionLabel(debug: false, desktop: false), AppInfo.version);
|
||||
});
|
||||
|
||||
test('debug builds stay internal on every platform', () {
|
||||
expect(AppInfo.versionLabel(debug: true, desktop: true), 'Internal');
|
||||
expect(AppInfo.versionLabel(debug: true, desktop: false), 'Internal');
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user