Skip to content

Commit 0a24da9

Browse files
simplify content type checking
1 parent 36ca4a3 commit 0a24da9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/src/utils/content_type.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
String getContentType<T>(content) {
2-
switch (T) {
3-
case Map<String, dynamic>:
4-
return 'application/json';
5-
default:
6-
return 'text/plain';
1+
String getContentType(content) {
2+
if (content is Map) {
3+
return 'application/json';
74
}
5+
6+
return 'text/plain';
87
}

0 commit comments

Comments
 (0)