Skip to content

Commit afe7f77

Browse files
committed
Implemented Android API to check permissions
0 parents  commit afe7f77

File tree

108 files changed

+2845
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+2845
-0
lines changed

.gitignore

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Miscellaneous
2+
*.class
3+
*.lock
4+
*.log
5+
*.pyc
6+
*.swp
7+
.DS_Store
8+
.atom/
9+
.buildlog/
10+
.history
11+
.project
12+
.svn/
13+
bin/
14+
15+
# IntelliJ related
16+
*.iml
17+
*.ipr
18+
*.iws
19+
.idea/
20+
21+
# Android Studio related
22+
android/.classpath
23+
android/.settings/
24+
25+
# Visual Studio Code related
26+
.vscode/
27+
28+
# Flutter repo-specific
29+
/bin/cache/
30+
/bin/mingit/
31+
/dev/benchmarks/mega_gallery/
32+
/dev/bots/.recipe_deps
33+
/dev/bots/android_tools/
34+
/dev/docs/doc/
35+
/dev/docs/lib/
36+
/dev/docs/pubspec.yaml
37+
/packages/flutter/coverage/
38+
version
39+
40+
# Flutter/Dart/Pub related
41+
**/doc/api/
42+
.dart_tool/
43+
.flutter-plugins
44+
.packages
45+
.pub-cache/
46+
.pub/
47+
build/
48+
flutter_*.png
49+
linked_*.ds
50+
unlinked.ds
51+
unlinked_spec.ds
52+
53+
# Android related
54+
**/android/**/gradle-wrapper.jar
55+
**/android/.gradle
56+
**/android/captures/
57+
**/android/gradlew
58+
**/android/gradlew.bat
59+
**/android/local.properties
60+
**/android/**/GeneratedPluginRegistrant.java
61+
62+
# iOS/XCode related
63+
**/ios/**/*.mode1v3
64+
**/ios/**/*.mode2v3
65+
**/ios/**/*.moved-aside
66+
**/ios/**/*.pbxuser
67+
**/ios/**/*.perspectivev3
68+
**/ios/**/*sync/
69+
**/ios/**/.sconsign.dblite
70+
**/ios/**/.tags*
71+
**/ios/**/.vagrant/
72+
**/ios/**/DerivedData/
73+
**/ios/**/Icon?
74+
**/ios/**/Pods/
75+
**/ios/**/.symlinks/
76+
**/ios/**/profile
77+
**/ios/**/xcuserdata
78+
**/ios/.generated/
79+
**/ios/Flutter/App.framework
80+
**/ios/Flutter/Flutter.framework
81+
**/ios/Flutter/Generated.xcconfig
82+
**/ios/Flutter/app.flx
83+
**/ios/Flutter/app.zip
84+
**/ios/Flutter/flutter_assets/
85+
**/ios/ServiceDefinitions.json
86+
**/ios/Runner/GeneratedPluginRegistrant.*
87+
88+
# Exceptions to above rules.
89+
!**/ios/**/default.mode1v3
90+
!**/ios/**/default.mode2v3
91+
!**/ios/**/default.pbxuser
92+
!**/ios/**/default.perspectivev3
93+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* TODO: Describe initial release.

CODE_OF_CONDUCT.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [[email protected]](mailto:[email protected]). All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at [http://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: http://contributor-covenant.org
74+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Contributing to the Flutter Permission handler plugin
2+
=============================================
3+
4+
What you will need
5+
------------------
6+
7+
* A Linux, Mac OS X, or Windows machine (note: to run and compile iOS specific parts you'll need access to a Mac OS X machine);
8+
* git (used for source version control, installation instruction can be found [here](https://git-scm.com/));
9+
* The Flutter SDK (installation instructions can be found [here](https://flutter.io/get-started/install/));
10+
* A personal GitHub account (if you don't have one, you can sign-up for free [here](https://github.com/))
11+
12+
Setting up your development environment
13+
---------------------------------------
14+
15+
* Fork `https://github.com/BaseflowIT/flutter-permission-handler` into your own GitHub account. If you already have a fork and moving to a new computer, make sure you update you fork.
16+
* If you haven't configured your machine with an SSH key that's known to github, then
17+
follow [GitHub's directions](https://help.github.com/articles/generating-ssh-keys/)
18+
to generate an SSH key.
19+
* Clone your forked repo on your local development machine: `git clone [email protected]:<your_name_here>/flutter-permission-handler.git`
20+
* Change into the `flutter-permission-handler` directory: `cd flutter-permission-handler`
21+
* Add an upstream to the original repo, so that fetch from the master repository and not your clone: `git remote add upstream [email protected]:BaseflowIT/flutter-permission-handler.git`
22+
23+
Running the example project
24+
---------------------------
25+
26+
* Change into the example directory: `cd example`
27+
* Run the App: `flutter run`
28+
29+
Contribute
30+
----------
31+
32+
We really appreciate contributions via GitHub pull requests. To contribute take the following steps:
33+
34+
* Make sure you are up to date with the latest code on the master:
35+
* `git fetch upstream`
36+
* `git checkout upstream/develop -b <name_of_your_branch>`
37+
* Apply your changes
38+
* Verify your changes and fix potential warnings/ errors:
39+
* Check formatting: `flutter format .`
40+
* Run static analyses: `flutter analyzes`
41+
* Run unit-tests: `flutter test`
42+
* Commit your changes: `git commit -am "<your informative commit message>"`
43+
* Push changes to your fork: `git push origin <name_of_your_branch>`
44+
45+
Send us your pull request:
46+
47+
* Go to `https://github.com/BaseflowIT/flutter-permission-handler` and click the "Compare & pull request" button.
48+
49+
Please make sure you solved all warnings and errors reported by the static code analyses and that you fill in the full pull request template. Failing to do so will result in us asking you to fix it.

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Baseflow
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Permission handler
2+
3+
Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
4+
5+
## Want to contribute
6+
7+
If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our [contribution guide](CONTRIBUTING.md) and send us your [pull request](https://github.com/BaseflowIT/flutter-permission-handler/pulls).
8+
9+
## Author
10+
11+
The Permission handler plugin for Flutter is developed by [Baseflow](https://baseflow.com). You can contact us at <[email protected]>.

analysis_options.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# https://www.dartlang.org/guides/language/analysis-options
2+
analyzer:
3+
strong-mode: true
4+
5+
# Source of linter options:
6+
# http://dart-lang.github.io/linter/lints/options/options.html
7+
linter:
8+
rules:
9+
- always_declare_return_types
10+
- camel_case_types
11+
- empty_constructor_bodies
12+
- annotate_overrides
13+
- avoid_init_to_null
14+
- constant_identifier_names
15+
- one_member_abstracts
16+
- slash_for_doc_comments
17+
- sort_constructors_first
18+
- unnecessary_brace_in_string_interps

android/.classpath

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
4+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>

android/.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures

android/.project

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>permission_handler</name>
4+
<comment>Project permission_handler created by Buildship.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
22+
</natures>
23+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
connection.project.dir=
2+
eclipse.preferences.version=1

android/build.gradle

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
group 'com.baseflow.permissionhandler'
2+
version '1.0-SNAPSHOT'
3+
4+
buildscript {
5+
ext.kotlin_version = '1.1.51'
6+
repositories {
7+
google()
8+
jcenter()
9+
}
10+
11+
dependencies {
12+
classpath 'com.android.tools.build:gradle:3.0.1'
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14+
}
15+
}
16+
17+
rootProject.allprojects {
18+
repositories {
19+
google()
20+
jcenter()
21+
}
22+
}
23+
24+
apply plugin: 'com.android.library'
25+
apply plugin: 'kotlin-android'
26+
27+
android {
28+
compileSdkVersion 27
29+
30+
sourceSets {
31+
main.java.srcDirs += 'src/main/kotlin'
32+
}
33+
defaultConfig {
34+
minSdkVersion 16
35+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
36+
}
37+
lintOptions {
38+
disable 'InvalidPackage'
39+
}
40+
}
41+
42+
dependencies {
43+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
44+
implementation "com.google.code.gson:gson:2.8.5"
45+
implementation "com.android.support:support-compat:27.1.1"
46+
}

android/gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.gradle.jvmargs=-Xmx1536M

android/settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'permission_handler'

android/src/main/AndroidManifest.xml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.baseflow.permissionhandler">
3+
</manifest>

0 commit comments

Comments
 (0)