registerWithBlurView method

  1. @override
Future<void> registerWithBlurView({
  1. required num radius,
  2. String? localImagePath,
  3. Duration? timeAfterResume = const Duration(milliseconds: 1000),
})
override

iOS, Android activate a screenshot blocking with a blurred effect view (iOS 13+, Android 8+) radius radius

timeAfterResume (Android only) Time delayed for the view to stop displaying when going back to the application (in milliseconds). Default = 1000ms

function will throw warning when timeAfterResume bigger than 3000ms, users have to wait for the application to turn off the filter before going back to the main view, which is a very bad user experiences.

Throws a PlatformException if there were technical problems on native side (e.g. lack of relevant hardware).

Implementation

@override
Future<void> registerWithBlurView(
    {required num radius,
    String? localImagePath,
    Duration? timeAfterResume = const Duration(milliseconds: 1000)}) async {
  await methodChannel
      .invokeMethod<void>('registerWithBlurView', <String, dynamic>{
    'radius': radius,
    'localImagePath': localImagePath,
    'timeAfterResume': (timeAfterResume ?? const Duration(milliseconds: 1000))
        .inMilliseconds,
  });
}