Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changed enum values to lowercase
  • Loading branch information
danielroek committed Dec 23, 2020
commit 81799a7cd60d89c42058f08c2334a3d50458f365
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,33 @@ enum ImageFormatGroup {
/// Extension on [ImageFormatGroup] to stringify the enum
extension ImageFormatGroupName on ImageFormatGroup {
/// returns a String value for [ImageFormatGroup]
/// returns 'UNKNOWN' if platform is not supported
/// returns 'unknown' if platform is not supported
/// or if [ImageFormatGroup] is not supported for the platform
String name() {
if (defaultTargetPlatform == TargetPlatform.android) {
switch (this) {
case ImageFormatGroup.jpeg:
return 'JPEG';
return 'jpeg';
case ImageFormatGroup.yuv420:
return 'YUV420';
return 'yuv420';
case ImageFormatGroup.bgra8888:
case ImageFormatGroup.unknown:
default:
return 'UNKNOWN';
return 'unknown';
}
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
switch (this) {
case ImageFormatGroup.bgra8888:
return 'BGRA888';
return 'bgra8888';
case ImageFormatGroup.yuv420:
return 'YUV420';
return 'yuv420';
case ImageFormatGroup.jpeg:
case ImageFormatGroup.unknown:
default:
return 'UNKNOWN';
return 'unknown';
}
}
// unsupported platform
return 'UNKNOWN';
return 'unknown';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void main() {
methods: {
'create': {
'cameraId': 1,
'imageFormatGroup': 'UNKNOWN',
'imageFormatGroup': 'unknown',
}
});
final camera = MethodChannelCamera();
Expand Down Expand Up @@ -112,7 +112,7 @@ void main() {
methods: {
'create': {
'cameraId': 1,
'imageFormatGroup': 'UNKNOWN',
'imageFormatGroup': 'unknown',
},
'initialize': null
});
Expand All @@ -136,7 +136,7 @@ void main() {
'initialize',
arguments: {
'cameraId': 1,
'imageFormatGroup': 'UNKNOWN',
'imageFormatGroup': 'unknown',
},
),
]);
Expand Down