Skip to content

Commit 63a35f7

Browse files
committed
loading screen bug fixed, by giving permissions
1 parent cae7c1f commit 63a35f7

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<uses-permission android:name="android.permission.INTERNET" />
44
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
55
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
6+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
7+
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
68
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
79
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
810
<uses-permission android:name="android.permission.VIBRATE" />

lib/app/modules/about/controllers/about_controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:get/get.dart';
22
import 'package:taskwarrior/app/utils/language/supported_language.dart';
3-
import 'package:taskwarrior/app/utils/theme/app_settings.dart';
3+
import 'package:taskwarrior/app/utils/app_settings/app_settings.dart';
44

55
class AboutController extends GetxController {
66
final Rx<SupportedLanguage> selectedLanguage = SupportedLanguage.english.obs;

lib/main.dart

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,34 @@ void main() async {
1010
WidgetsFlutterBinding.ensureInitialized();
1111
await AppSettings.init();
1212

13-
await Permission.notification.isDenied.then((value) {
14-
if (value) {
15-
Permission.notification.request();
13+
// await Permission.notification.isDenied.then((value) {
14+
// if (value) {
15+
// Permission.notification.request();
16+
// }
17+
// });
18+
if (await Permission.notification.isDenied) {
19+
if (await Permission.notification.request().isGranted) {
20+
print("Notification permission granted");
21+
} else {
22+
print("Notification permission denied");
1623
}
17-
});
24+
}
25+
26+
if (await Permission.storage.isDenied) {
27+
if (await Permission.storage.request().isGranted) {
28+
print("Storage permission granted");
29+
} else {
30+
print("Storage permission denied");
31+
}
32+
}
33+
34+
if (await Permission.manageExternalStorage.isDenied) {
35+
if (await Permission.manageExternalStorage.request().isGranted) {
36+
print("Manage external storage permission granted");
37+
} else {
38+
print("Manage external storage permission denied");
39+
}
40+
}
1841
runApp(
1942
GetMaterialApp(
2043
title: "Application",

0 commit comments

Comments
 (0)