-
-
Notifications
You must be signed in to change notification settings - Fork 920
Open
Description
Please check the following before submitting a new issue.
- I have searched the existing issues.
- I have carefully read the documentation and verified I have added the required platform specific configuration.
Please select affected platform(s)
- Android
- iOS
- Windows
Steps to reproduce
Issue looks similar to #1206 but problem is opposite.
- Request permission (e.g. with Permission.location.request()) and in Android permission dialog select "Ask every time".
- Request permission second time and in Android permission dialog select "Deny". In this case Android will deny permission permanently (it has same behavior as if on step 1 we choose "Deny").
- Request permission third again. Result of this and all next requests will be incorrect.
Expected results
The status is PermissionStatus.permanentlyDenied.
Actual results
The status is PermissionStatus.denied.
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
PermissionStatus? _currentStatus;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(),
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text('Permission Status: $_currentStatus'),
TextButton(
onPressed: _checkStatus,
child: const Text('Check Permission Status'),
),
TextButton(
onPressed: _requestStatus,
child: const Text('Request Permission'),
),
],
),
),
),
);
}
void _checkStatus() async {
final status = await Permission.camera.status;
setState(() {
_currentStatus = status;
});
}
void _requestStatus() async {
final status = await Permission.camera.request();
setState(() {
_currentStatus = status;
});
}
}Screenshots or video
Screenshots or video demonstration
[Upload media here]
Version
12.0.1
Flutter Doctor output
Doctor output
[√] Flutter (Channel stable, 3.35.7, on Microsoft Windows [Version 10.0.19045.6456], locale ru-RU)
[√] Windows Version (10 Enterprise 64-bit, 22H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2024.2)
[√] IntelliJ IDEA Ultimate Edition (version 2022.1)
[√] Connected device (4 available)
[√] Network resourcesGenixPL
Metadata
Metadata
Assignees
Labels
No labels