Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
permission_handler
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songyanzhi
permission_handler
Commits
203dd6ba
Commit
203dd6ba
authored
Feb 12, 2019
by
Maurits van Beusekom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build against stable flutter build
parent
8da89888
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
.travis.yml
+1
-1
lib/permission_handler.dart
+5
-5
scripts/before_build_apks.sh
+1
-1
scripts/before_build_ipas.sh
+1
-1
No files found.
.travis.yml
View file @
203dd6ba
...
@@ -14,7 +14,7 @@ matrix:
...
@@ -14,7 +14,7 @@ matrix:
-
libstdc++6
-
libstdc++6
-
fonts-droid
-
fonts-droid
before_script
:
before_script
:
-
git clone --single-branch --branch
dev
https://github.com/flutter/flutter.git $HOME/flutter
-
git clone --single-branch --branch
stable
https://github.com/flutter/flutter.git $HOME/flutter
-
export PATH=$HOME/flutter/bin:$HOME/flutter/bin/cache/dart-sdk/bin:$PATH
-
export PATH=$HOME/flutter/bin:$HOME/flutter/bin/cache/dart-sdk/bin:$PATH
-
flutter doctor
-
flutter doctor
script
:
script
:
...
...
lib/permission_handler.dart
View file @
203dd6ba
...
@@ -34,7 +34,7 @@ class PermissionHandler {
...
@@ -34,7 +34,7 @@ class PermissionHandler {
/// Returns a [Future] containing the current permission status for the supplied [PermissionGroup].
/// Returns a [Future] containing the current permission status for the supplied [PermissionGroup].
Future
<
PermissionStatus
>
checkPermissionStatus
(
Future
<
PermissionStatus
>
checkPermissionStatus
(
PermissionGroup
permission
)
async
{
PermissionGroup
permission
)
async
{
final
String
status
=
await
_methodChannel
.
invokeMethod
<
String
>
(
final
String
status
=
await
_methodChannel
.
invokeMethod
(
'checkPermissionStatus'
,
Codec
.
encodePermissionGroup
(
permission
));
'checkPermissionStatus'
,
Codec
.
encodePermissionGroup
(
permission
));
return
Codec
.
decodePermissionStatus
(
status
);
return
Codec
.
decodePermissionStatus
(
status
);
...
@@ -45,7 +45,7 @@ class PermissionHandler {
...
@@ -45,7 +45,7 @@ class PermissionHandler {
/// Returns a [Future] containing the current service status for the supplied [PermissionGroup].
/// Returns a [Future] containing the current service status for the supplied [PermissionGroup].
Future
<
ServiceStatus
>
checkServiceStatus
(
Future
<
ServiceStatus
>
checkServiceStatus
(
PermissionGroup
permission
)
async
{
PermissionGroup
permission
)
async
{
final
String
status
=
await
_methodChannel
.
invokeMethod
<
String
>
(
final
String
status
=
await
_methodChannel
.
invokeMethod
(
'checkServiceStatus'
,
Codec
.
encodePermissionGroup
(
permission
));
'checkServiceStatus'
,
Codec
.
encodePermissionGroup
(
permission
));
return
Codec
.
decodeServiceStatus
(
status
);
return
Codec
.
decodeServiceStatus
(
status
);
...
@@ -55,7 +55,7 @@ class PermissionHandler {
...
@@ -55,7 +55,7 @@ class PermissionHandler {
///
///
/// Returns [true] if the app settings page could be opened, otherwise [false] is returned.
/// Returns [true] if the app settings page could be opened, otherwise [false] is returned.
Future
<
bool
>
openAppSettings
()
async
{
Future
<
bool
>
openAppSettings
()
async
{
final
bool
hasOpened
=
await
_methodChannel
.
invokeMethod
<
bool
>
(
final
bool
hasOpened
=
await
_methodChannel
.
invokeMethod
(
'openAppSettings'
);
'openAppSettings'
);
return
hasOpened
;
return
hasOpened
;
...
@@ -68,7 +68,7 @@ class PermissionHandler {
...
@@ -68,7 +68,7 @@ class PermissionHandler {
List
<
PermissionGroup
>
permissions
)
async
{
List
<
PermissionGroup
>
permissions
)
async
{
final
String
jsonData
=
Codec
.
encodePermissionGroups
(
permissions
);
final
String
jsonData
=
Codec
.
encodePermissionGroups
(
permissions
);
final
String
status
=
final
String
status
=
await
_methodChannel
.
invokeMethod
<
String
>
(
await
_methodChannel
.
invokeMethod
(
'requestPermissions'
,
jsonData
);
'requestPermissions'
,
jsonData
);
return
Codec
.
decodePermissionRequestResult
(
status
);
return
Codec
.
decodePermissionRequestResult
(
status
);
...
@@ -84,7 +84,7 @@ class PermissionHandler {
...
@@ -84,7 +84,7 @@ class PermissionHandler {
return
false
;
return
false
;
}
}
final
bool
shouldShowRationale
=
await
_methodChannel
.
invokeMethod
<
bool
>
(
final
bool
shouldShowRationale
=
await
_methodChannel
.
invokeMethod
(
'shouldShowRequestPermissionRationale'
,
'shouldShowRequestPermissionRationale'
,
Codec
.
encodePermissionGroup
(
permission
));
Codec
.
encodePermissionGroup
(
permission
));
...
...
scripts/before_build_apks.sh
View file @
203dd6ba
...
@@ -20,7 +20,7 @@ unzip -qq gradle-4.1-bin.zip -d $HOME/gradle-4.1
...
@@ -20,7 +20,7 @@ unzip -qq gradle-4.1-bin.zip -d $HOME/gradle-4.1
export
GRADLE_HOME
=
$HOME
/gradle-4.1
export
GRADLE_HOME
=
$HOME
/gradle-4.1
export
PATH
=
$GRADLE_HOME
/bin:
$PATH
export
PATH
=
$GRADLE_HOME
/bin:
$PATH
gradle
-v
gradle
-v
git clone
--single-branch
--branch
dev
https://github.com/flutter/flutter.git
$HOME
/flutter
git clone
--single-branch
--branch
stable
https://github.com/flutter/flutter.git
$HOME
/flutter
export
PATH
=
$HOME
/flutter/bin:
$HOME
/flutter/bin/cache/dart-sdk/bin:
$PATH
export
PATH
=
$HOME
/flutter/bin:
$HOME
/flutter/bin/cache/dart-sdk/bin:
$PATH
flutter doctor
flutter doctor
scripts/before_build_ipas.sh
View file @
203dd6ba
...
@@ -5,6 +5,6 @@ brew install ideviceinstaller
...
@@ -5,6 +5,6 @@ brew install ideviceinstaller
brew install ios-deploy
brew install ios-deploy
pod repo update
pod repo update
gem update cocoapods
gem update cocoapods
git clone
--single-branch
--branch
dev
https://github.com/flutter/flutter.git
$HOME
/flutter
git clone
--single-branch
--branch
stable
https://github.com/flutter/flutter.git
$HOME
/flutter
export
PATH
=
$HOME
/flutter/bin:
$HOME
/flutter/bin/cache/dart-sdk/bin:
$PATH
export
PATH
=
$HOME
/flutter/bin:
$HOME
/flutter/bin/cache/dart-sdk/bin:
$PATH
flutter doctor
flutter doctor
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