getAspectRatio method
Get camera aspect ratio and resolution
If deviceId is provided, gets info for that specific device.
Otherwise, gets info for the currently active camera.
Returns aspect ratio as double, or null if unavailable.
Implementation
@override
Future<double?> getAspectRatio({String? deviceId}) async {
try {
final Map<String, dynamic>? arguments =
deviceId != null ? {'deviceId': deviceId} : null;
final result = await methodChannel.invokeMethod<Map<String, dynamic>>(
'getAspectRatio',
arguments,
);
if (result == null) return null;
final aspectRatio = result['aspectRatio'] as double?;
return aspectRatio;
} catch (e) {
return null;
}
}