refactor(mobile): Use switch expression when possible (#15852)

refactor: Use `switch` expression when possible

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Damiano Ferrari 2025-02-02 22:46:46 +01:00 committed by GitHub
parent 4efacfbb91
commit 96a6cc20b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 219 additions and 374 deletions

View file

@ -519,18 +519,12 @@ class BackupService {
return responseBody.containsKey('id') ? responseBody['id'] : null;
}
String _getAssetType(AssetType assetType) {
switch (assetType) {
case AssetType.audio:
return "AUDIO";
case AssetType.image:
return "IMAGE";
case AssetType.video:
return "VIDEO";
case AssetType.other:
return "OTHER";
}
}
String _getAssetType(AssetType assetType) => switch (assetType) {
AssetType.audio => "AUDIO",
AssetType.image => "IMAGE",
AssetType.video => "VIDEO",
AssetType.other => "OTHER",
};
}
class MultipartRequest extends http.MultipartRequest {