Skip to content

Commit

Permalink
loading screen bug fixed, by giving permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham04Jha committed Nov 5, 2024
1 parent cae7c1f commit 63a35f7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
2 changes: 2 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
<uses-permission android:name="android.permission.VIBRATE" />
Expand Down
2 changes: 1 addition & 1 deletion lib/app/modules/about/controllers/about_controller.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:get/get.dart';
import 'package:taskwarrior/app/utils/language/supported_language.dart';
import 'package:taskwarrior/app/utils/theme/app_settings.dart';
import 'package:taskwarrior/app/utils/app_settings/app_settings.dart';

class AboutController extends GetxController {
final Rx<SupportedLanguage> selectedLanguage = SupportedLanguage.english.obs;
Expand Down
31 changes: 27 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,34 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized();
await AppSettings.init();

await Permission.notification.isDenied.then((value) {
if (value) {
Permission.notification.request();
// await Permission.notification.isDenied.then((value) {
// if (value) {
// Permission.notification.request();
// }
// });
if (await Permission.notification.isDenied) {
if (await Permission.notification.request().isGranted) {
print("Notification permission granted");
} else {
print("Notification permission denied");
}
});
}

if (await Permission.storage.isDenied) {
if (await Permission.storage.request().isGranted) {
print("Storage permission granted");
} else {
print("Storage permission denied");
}
}

if (await Permission.manageExternalStorage.isDenied) {
if (await Permission.manageExternalStorage.request().isGranted) {
print("Manage external storage permission granted");
} else {
print("Manage external storage permission denied");
}
}
runApp(
GetMaterialApp(
title: "Application",
Expand Down

0 comments on commit 63a35f7

Please sign in to comment.