Skip to content

Commit

Permalink
Fix crash on android due to unknown OS name (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Mar 11, 2023
1 parent 24f2c23 commit af77c03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## 2.4.1

* Fix a crash on dart sdks under experimental OS support.

* Work around a bug in Vite when bundling packages for the browser.

## 2.4.0
Expand Down
10 changes: 4 additions & 6 deletions lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,12 @@ Uri url(String url) {
/// Returns the human-friendly name for the given [os] string.
String humanOSName(String os) {
switch (os) {
case "linux":
return "Linux";
case "ios":
return "iOS";
case "macos":
return "Mac OS";
case "windows":
return "Windows";
return "macOS";
default:
throw ArgumentError("Unknown OS $os.");
return "${os[0].toUpperCase()}${os.substring(1).toLowerCase()}";
}
}

Expand Down

0 comments on commit af77c03

Please sign in to comment.