requestCameraPermission method
Implementation
@override
Future<bool> requestCameraPermission() async {
try {
final constraints = {
'video': {'width': 640, 'height': 480},
}.jsify() as MediaStreamConstraints;
await window.navigator.mediaDevices
.getUserMedia(constraints)
.toDart;
_hasPermission = true;
return true;
} catch (e) {
_hasPermission = false;
return false;
}
}