setFilter method

Future<void> setFilter(
  1. int type, {
  2. String? filePath,
})

The set filter

Throws a CameraException if the capture fails.

Implementation

Future<void> setFilter(int type,{String? filePath}) async {
  if (!value.isInitialized! || _isDisposed) {
    throw CameraException(
      'Uninitialized CameraController.',
      'setFilter was called on uninitialized CameraController',
    );
  }
  if (!Platform.isAndroid) {
    throw CameraException(
      'Unsupported platforms.',
      'setFilter supported android.',
    );
  }
  try {
    await _channel.invokeMethod<void>(
      'setFilter',
      <String, dynamic>{ 'type': type,'filePath': filePath},
    );
  } on PlatformException catch (e) {
    throw CameraException(e.code, e.message);
  }
}