m3_lightmeter/lib/data/camera_info_service.dart

20 lines
502 B
Dart

import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
class CameraInfoService {
@visibleForTesting
static const cameraInfoPlatformChannel = MethodChannel(
"com.vodemn.lightmeter.CameraInfoPlatformChannel.MethodChannel",
);
const CameraInfoService();
Future<int?> mainCameraEfl() async {
if (Platform.isIOS) {
return null;
}
return (await cameraInfoPlatformChannel.invokeMethod<double?>('mainCameraEfl'))?.round();
}
}