Apply autofixes
This commit is contained in:
parent
9055c8cb0a
commit
d117972d0c
3 changed files with 14 additions and 12 deletions
|
@ -3,19 +3,21 @@ import 'package:nbteditor/Constants.dart';
|
|||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
class PermissionsRequiredPage extends StatelessWidget {
|
||||
const PermissionsRequiredPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("NBT Editor - Permissions Denied"),
|
||||
title: const Text("NBT Editor - Permissions Denied"),
|
||||
backgroundColor: Constants.TITLEBAR_COLOR,
|
||||
),
|
||||
body: Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
ListTile(
|
||||
const ListTile(
|
||||
title: Text(
|
||||
"We require only one permission, it is being denied by your device. Please grant file permissions to be able to open or save files."),
|
||||
),
|
||||
|
@ -25,17 +27,17 @@ class PermissionsRequiredPage extends StatelessWidget {
|
|||
var stat =
|
||||
await Permission.manageExternalStorage.request();
|
||||
if (stat.isPermanentlyDenied) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||
content: Text(
|
||||
"The storage permission is reporting it is permanently denied. Please open settings and allow that permission.")));
|
||||
} else if (stat.isGranted) {
|
||||
Future.delayed(Duration(seconds: 5), () {
|
||||
Future.delayed(const Duration(seconds: 5), () {
|
||||
Navigator.pushReplacementNamed(context, "/edit");
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Text("GRANT"))
|
||||
child: const Text("GRANT"))
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue