September 2019
Beginner
512 pages
12h 52m
English
In the profile settings after login, we can add a profile picture. To request permission to access the camera, the process is very similar to requesting access to the user's contacts.
We create a function to check and request permission, if needed:
void _checkPermissions() async { PermissionStatus status = await PermissionHandler() .checkPermissionStatus(PermissionGroup.camera); // 1 if (status != PermissionStatus.granted) { // 2 await PermissionHandler().requestPermissions([PermissionGroup.camera]); // 3 } }
The method is very similar to the check completed in the contact import example:
Read now
Unlock full access