Skip to content

Commit

Permalink
reminder left
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya-Thakur-369 committed Nov 17, 2023
1 parent 6a255ef commit 565da86
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 115 deletions.
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
12 changes: 11 additions & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,9 @@ PODS:
- firebase_core
- Flutter
- nanopb (< 2.30910.0, >= 2.30908.0)
- connectivity_plus (0.0.1):
- Flutter
- ReachabilitySwift
- Firebase/Auth (10.16.0):
- Firebase/CoreOnly
- FirebaseAuth (~> 10.16.0)
Expand Down Expand Up @@ -794,6 +797,7 @@ PODS:
- permission_handler_apple (9.1.1):
- Flutter
- PromisesObjC (2.3.1)
- ReachabilitySwift (5.0.0)
- RecaptchaInterop (100.0.0)
- share_plus (0.0.1):
- Flutter
Expand All @@ -804,6 +808,7 @@ PODS:

DEPENDENCIES:
- cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- Flutter (from `Flutter`)
Expand Down Expand Up @@ -836,12 +841,15 @@ SPEC REPOS:
- leveldb-library
- nanopb
- PromisesObjC
- ReachabilitySwift
- RecaptchaInterop
- Toast

EXTERNAL SOURCES:
cloud_firestore:
:path: ".symlinks/plugins/cloud_firestore/ios"
connectivity_plus:
:path: ".symlinks/plugins/connectivity_plus/ios"
firebase_auth:
:path: ".symlinks/plugins/firebase_auth/ios"
firebase_core:
Expand Down Expand Up @@ -870,6 +878,7 @@ SPEC CHECKSUMS:
AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570
BoringSSL-GRPC: 3175b25143e648463a56daeaaa499c6cb86dad33
cloud_firestore: 8adb36c2bc754352c717984153ecd7e6c6898047
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
Firebase: 25899099b77d255a636e3579c3d9dce10ec150d5
firebase_auth: ff474dcf17bee5762106162e0791433024890ada
firebase_core: 68027ba03585e3efe1608e35d3ab2777a64eabe9
Expand All @@ -894,11 +903,12 @@ SPEC CHECKSUMS:
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
RecaptchaInterop: 7d1a4a01a6b2cb1610a47ef3f85f0c411434cb21
share_plus: c3fef564749587fc939ef86ffb283ceac0baf9f5
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196

PODFILE CHECKSUM: 07c8de5daf3dba39cc68c5cf5a73c3a909d10c9a
PODFILE CHECKSUM: a57f30d18f102dd3ce366b1d62a55ecbef2158e5

COCOAPODS: 1.14.0
74 changes: 37 additions & 37 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,38 +81,38 @@ class splash_screen extends StatefulWidget {
}

class splash_screenState extends State<splash_screen> {
AskPermission() async {
final prefs = await SharedPreferences.getInstance();
final hasNotificationPermission =
prefs.getBool('notificationPermissionGranted');

if (hasNotificationPermission == null ||
hasNotificationPermission == false) {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text('Please grant notification permission'),
content: Text(
'In order to receive notifications, please grant the app permission to access your notifications.'),
actions: [
TextButton(
child: Text('Cancel'),
onPressed: () => Navigator.of(context).pop(),
),
TextButton(
child: Text('Grant Permission'),
onPressed: () async {
await requestNotificationPermission();
Navigator.of(context).pop();
},
),
],
),
);
} else {
stateChage();
}
}
// AskPermission() async {
// final prefs = await SharedPreferences.getInstance();
// final hasNotificationPermission =
// prefs.getBool('notificationPermissionGranted');

// if (hasNotificationPermission == null ||
// hasNotificationPermission == false) {
// showDialog(
// context: context,
// builder: (context) => AlertDialog(
// title: Text('Please grant notification permission'),
// content: Text(
// 'In order to receive notifications, please grant the app permission to access your notifications.'),
// actions: [
// TextButton(
// child: Text('Cancel'),
// onPressed: () => Navigator.of(context).pop(),
// ),
// TextButton(
// child: Text('Grant Permission'),
// onPressed: () async {
// await requestNotificationPermission();
// Navigator.of(context).pop();
// },
// ),
// ],
// ),
// );
// } else {
// stateChage();
// }
// }

Future<bool> requestExactAlarmsPermission() async {
if (TargetPlatform.android == defaultTargetPlatform) {
Expand Down Expand Up @@ -168,20 +168,20 @@ class splash_screenState extends State<splash_screen> {
Timer(Duration(seconds: 3), () {
if (isLoggedIn != null) {
if (isLoggedIn) {
Navigator.push(
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => home_screen(),
));
} else {
Navigator.push(
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => signin_screen(),
));
}
} else {
Navigator.push(
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => signin_screen(),
Expand All @@ -193,8 +193,8 @@ class splash_screenState extends State<splash_screen> {
Future<void> _init() async {
await requestNotificationPermission();
await requestExactAlarmsPermission();
// stateChage();
AskPermission();
stateChage();
// AskPermission();
}

@override
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/bottomsheet_profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ showOptions(BuildContext context, String name , String email){
fontWeight: FontWeight.w400),
),
onPressed: () {
sign_out;
sign_out(context);
},
),
],
Expand Down
Loading

0 comments on commit 565da86

Please sign in to comment.