setBlurBackground method

  1. @override
void setBlurBackground(
  1. int level,
  2. dynamic errorCallback(
    1. int code,
    2. String message
    )?
)
override

Implementation

@override
void setBlurBackground(int level, Function(int code, String message)? errorCallback) async {
  try {
    if (!kIsWeb && (Platform.isIOS || Platform.isAndroid)) {
      await methodChannel.invokeMethod("setBlurBackground", {'level': level});
    } else {
      errorCallback!(-1, 'This platform is not supported');
    }
  } on PlatformException catch (error) {
    errorCallback!(int.fromEnvironment(error.code), error.message!);
  } on Exception catch (error) {
    errorCallback!(-1, error.toString());
  }
}