Fix bugs
This commit is contained in:
@@ -14,7 +14,6 @@ class AppInfo with _$AppInfo {
|
||||
required String version,
|
||||
required String buildNumber,
|
||||
required Release release,
|
||||
String? installerMedia,
|
||||
required String operatingSystem,
|
||||
required String operatingSystemVersion,
|
||||
required Environment environment,
|
||||
@@ -28,8 +27,8 @@ class AppInfo with _$AppInfo {
|
||||
|
||||
/// formats app info for sharing
|
||||
String format() => '''
|
||||
$name v$version ($buildNumber) ${environment.name}
|
||||
${release.name} release ${installerMedia != null ? "via $installerMedia" : ""}
|
||||
$name v$version ($buildNumber) [${environment.name}]
|
||||
${release.name} release
|
||||
$operatingSystem [$operatingSystemVersion]''';
|
||||
|
||||
factory AppInfo.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -23,6 +23,15 @@ sealed class ConnectionStatus with _$ConnectionStatus {
|
||||
_ => false,
|
||||
};
|
||||
|
||||
String format() => switch (this) {
|
||||
Disconnected(:final connectionFailure) => connectionFailure != null
|
||||
? "CONNECTION FAILURE: $connectionFailure"
|
||||
: "DISCONNECTED",
|
||||
Connecting() => "CONNECTING",
|
||||
Connected() => "CONNECTED",
|
||||
Disconnecting() => "DISCONNECTING",
|
||||
};
|
||||
|
||||
String present(TranslationsEn t) => switch (this) {
|
||||
Disconnected() => t.home.connection.tapToConnect,
|
||||
Connecting() => t.home.connection.connecting,
|
||||
|
||||
Reference in New Issue
Block a user