Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sai Srinivas
GEN_ERP_2025
Commits
8639a1e1
Commit
8639a1e1
authored
Nov 28, 2025
by
Sai Srinivas
Browse files
Contact permission fixed
parent
9fbbf730
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/screens/hrm/ContactList.dart
View file @
8639a1e1
...
...
@@ -271,6 +271,7 @@ class _ContactListScreenState extends State<ContactListScreen> {
// This will automatically take full height of the list item
SlidableAction
(
onPressed:
(
_
)
async
{
await
_requestContactsPermission
();
_addToContact
(
contact
.
name
??
'Contact'
,
contact
.
mobileNumber
??
''
,
...
...
@@ -412,4 +413,18 @@ class _ContactListScreenState extends State<ContactListScreen> {
),
);
}
Future
<
void
>
_requestContactsPermission
()
async
{
final
status
=
await
Permission
.
contacts
.
status
;
if
(
status
.
isPermanentlyDenied
)
{
// Show dialog and send user to settings
await
openAppSettings
();
return
;
}
if
(!
status
.
isGranted
)
{
await
Permission
.
contacts
.
request
();
}
}
}
\ No newline at end of file
lib/screens/splash.dart
View file @
8639a1e1
...
...
@@ -243,8 +243,24 @@ class _SplashState extends State<Splash> {
await
getCameraPermissions
();
await
getStoragePermission
();
await
getLocationPermissions
();
await
_requestContactsPermission
();
}
Future
<
void
>
_requestContactsPermission
()
async
{
final
status
=
await
Permission
.
contacts
.
status
;
if
(
status
.
isPermanentlyDenied
)
{
// Show dialog and send user to settings
await
openAppSettings
();
return
;
}
if
(!
status
.
isGranted
)
{
await
Permission
.
contacts
.
request
();
}
}
Future
<
void
>
getStoragePermission
()
async
{
if
(
await
Permission
.
manageExternalStorage
.
request
().
isGranted
)
{
print
(
"Storage"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment