2025-05-11 09:50:01 +00:00
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
|
|
|
class CameraInfoService {
|
|
|
|
@visibleForTesting
|
2025-05-11 10:48:10 +00:00
|
|
|
static const cameraInfoPlatformChannel = MethodChannel(
|
|
|
|
"com.vodemn.lightmeter.CameraInfoPlatformChannel.MethodChannel",
|
|
|
|
);
|
2025-05-11 09:50:01 +00:00
|
|
|
|
|
|
|
const CameraInfoService();
|
|
|
|
|
2025-05-11 22:36:41 +00:00
|
|
|
// TODO: fix focal length for iOS screenshots
|
|
|
|
// TODO: fix integration test (find 1.91x)
|
2025-05-11 09:50:01 +00:00
|
|
|
Future<int?> mainCameraEfl() async {
|
2025-05-11 11:17:52 +00:00
|
|
|
final focalLength = await cameraInfoPlatformChannel.invokeMethod<double?>('mainCameraEfl');
|
|
|
|
return focalLength?.round();
|
2025-05-11 09:50:01 +00:00
|
|
|
}
|
|
|
|
}
|