requestCameraPermission method

  1. @override
Future<bool> requestCameraPermission()
override

Implementation

@override
Future<bool> requestCameraPermission() async {
  try {
    await html.window.navigator.mediaDevices!.getUserMedia({
      'video': {'width': 640, 'height': 480}
    });

    _hasPermission = true;
    return true;
  } catch (e) {
    _hasPermission = false;
    return false;
  }
}