Skip to content

Commit

Permalink
chore(1.8.0): pretty toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
ziqq committed Sep 11, 2024
1 parent 904b49d commit 8d04e4c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/src/model/in_store_app_version_checker_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,23 @@ class InStoreAppVersionCheckerResult {
}

@override
String toString() => 'Current Version: $currentVersion\n'
'New Version: $newVersion\n'
'App URL: $appURL\n'
'can update: $canUpdate\n'
'error: $errorMessage';
String toString() {
final buffer = StringBuffer()
..write('Current version: $currentVersion\n')
..write('New version: $newVersion\n')
..write('App url: $appURL\n')
..write('Can update: $canUpdate');
if (errorMessage != null) buffer.write('\nError: $errorMessage, ');
return buffer.toString();
}

@override
bool operator ==(covariant InStoreAppVersionCheckerResult other) {
if (identical(this, other)) return true;
return other.currentVersion == currentVersion &&
other.newVersion == newVersion &&
other.appURL == appURL &&
other.canUpdate == canUpdate &&
other.errorMessage == errorMessage;
}

Expand Down

0 comments on commit 8d04e4c

Please sign in to comment.