Showing
80 changed files
with
606 additions
and
1681 deletions
.github/workflows/checks.yml
0 → 100644
| 1 | +name: Checks | ||
| 2 | + | ||
| 3 | +on: | ||
| 4 | + pull_request: | ||
| 5 | + branches: | ||
| 6 | + - master | ||
| 7 | + paths: | ||
| 8 | + - '**/lib/**' | ||
| 9 | + - '**/android/**' | ||
| 10 | + - '**/ios/**' | ||
| 11 | + - '**/pubspec.yaml' | ||
| 12 | + - '**/test/**' | ||
| 13 | + - '**/test_driver/**' | ||
| 14 | + | ||
| 15 | +jobs: | ||
| 16 | + analyze: | ||
| 17 | + runs-on: ${{ matrix.os }} | ||
| 18 | + name: Format check & analysis (${{ matrix.channel }} on ${{ matrix.os }}) | ||
| 19 | + strategy: | ||
| 20 | + matrix: | ||
| 21 | + os: | ||
| 22 | + - ubuntu-latest | ||
| 23 | + channel: | ||
| 24 | + - 'stable' | ||
| 25 | + - 'beta' | ||
| 26 | + - 'dev' | ||
| 27 | + fail-fast: false | ||
| 28 | + | ||
| 29 | + steps: | ||
| 30 | + - uses: actions/checkout@v2 | ||
| 31 | + - uses: subosito/flutter-action@v1.2.0 | ||
| 32 | + with: | ||
| 33 | + channel: ${{ matrix.channel }} | ||
| 34 | + - name: Setup projects (root & example) | ||
| 35 | + run: | | ||
| 36 | + flutter pub get | ||
| 37 | + cd example | ||
| 38 | + flutter create . | ||
| 39 | + rm -rf test | ||
| 40 | + flutter pub get | ||
| 41 | + cd .. | ||
| 42 | + - name: Check format | ||
| 43 | + run: flutter format . --set-exit-if-changed --fix | ||
| 44 | + - run: flutter analyze | ||
| 45 | + | ||
| 46 | + test: | ||
| 47 | + # Not using the conditional as jobs are not re-run when the draft status changes. | ||
| 48 | + #if: github.event.pull_request.draft == false | ||
| 49 | + runs-on: macos-latest | ||
| 50 | + name: Unit & integration tests (${{ matrix.channel }} on ${{ matrix.device }}) | ||
| 51 | + strategy: | ||
| 52 | + matrix: | ||
| 53 | + device: | ||
| 54 | + - 'iPhone 11 (13.3)' | ||
| 55 | + - 'Android' | ||
| 56 | + channel: | ||
| 57 | + - 'stable' | ||
| 58 | + - 'beta' | ||
| 59 | + - 'dev' | ||
| 60 | + fail-fast: true | ||
| 61 | + | ||
| 62 | + steps: | ||
| 63 | + - name: Start iOS simulator | ||
| 64 | + if: contains(matrix.device, 'iPhone') | ||
| 65 | + run: | | ||
| 66 | + xcrun instruments -s | ||
| 67 | + UDID=$( | ||
| 68 | + xcrun instruments -s | | ||
| 69 | + awk \ | ||
| 70 | + -F ' *[][]' \ | ||
| 71 | + -v 'device=${{ matrix.device }}' \ | ||
| 72 | + '$1 == device { print $2 }' | ||
| 73 | + ) | ||
| 74 | + xcrun simctl boot "${UDID:?simulator not found}" | ||
| 75 | + - uses: actions/checkout@v2 | ||
| 76 | + - uses: subosito/flutter-action@v1.2.0 | ||
| 77 | + with: | ||
| 78 | + channel: ${{ matrix.channel }} | ||
| 79 | + - name: Setup projects (root & example) | ||
| 80 | + run: | | ||
| 81 | + flutter pub get | ||
| 82 | + cd example | ||
| 83 | + flutter create . | ||
| 84 | + rm -rf test | ||
| 85 | + flutter pub get | ||
| 86 | + cd .. | ||
| 87 | + - name: Run unit tests | ||
| 88 | + run: flutter test | ||
| 89 | + - name: Run integration tests on iOS | ||
| 90 | + if: contains(matrix.device, 'iPhone') | ||
| 91 | + run: | | ||
| 92 | + cd example | ||
| 93 | + flutter drive --target=test_driver/app.dart | ||
| 94 | + - name: Run integration tests on Android | ||
| 95 | + if: contains(matrix.device, 'Nexus') | ||
| 96 | + uses: reactivecircus/android-emulator-runner@v2.5.0 | ||
| 97 | + with: | ||
| 98 | + api-level: 29 | ||
| 99 | + disable-animations: false | ||
| 100 | + script: cd example && flutter drive --target=test_driver/app.dart |
.github/workflows/pana.yml
0 → 100644
| 1 | +name: Pana | ||
| 2 | + | ||
| 3 | +on: | ||
| 4 | + pull_request: | ||
| 5 | + branches: | ||
| 6 | + - master | ||
| 7 | + paths: | ||
| 8 | + - '**/lib/**' | ||
| 9 | + - '**/android/**' | ||
| 10 | + - '**/ios/**' | ||
| 11 | + - '**/pubspec.yaml' | ||
| 12 | + - '**/test/**' | ||
| 13 | + - '**/test_driver/**' | ||
| 14 | + | ||
| 15 | +jobs: | ||
| 16 | + configure: | ||
| 17 | + # Not using the conditional as jobs are not re-run when the draft status changes. | ||
| 18 | + #if: github.event.pull_request.draft == false | ||
| 19 | + runs-on: ubuntu-latest | ||
| 20 | + | ||
| 21 | + steps: | ||
| 22 | + - uses: actions/checkout@v2 | ||
| 23 | + - uses: axel-op/dart-package-analyzer@v2.0.0 | ||
| 24 | + with: | ||
| 25 | + githubToken: ${{ secrets.GITHUB_TOKEN }} |
.github/workflows/publish.yml
0 → 100644
| 1 | +name: Publish | ||
| 2 | + | ||
| 3 | +on: | ||
| 4 | + push: | ||
| 5 | + branches: | ||
| 6 | + - master | ||
| 7 | + | ||
| 8 | +jobs: | ||
| 9 | + checks: | ||
| 10 | + runs-on: macos-latest | ||
| 11 | + name: Check format, analyze, and test | ||
| 12 | + | ||
| 13 | + steps: | ||
| 14 | + - uses: actions/checkout@v2 | ||
| 15 | + - uses: subosito/flutter-action@v1.2.0 | ||
| 16 | + with: | ||
| 17 | + channel: stable | ||
| 18 | + - name: Setup projects (root & example) | ||
| 19 | + run: | | ||
| 20 | + flutter pub get | ||
| 21 | + cd example | ||
| 22 | + flutter create . | ||
| 23 | + rm -rf test | ||
| 24 | + flutter pub get | ||
| 25 | + cd .. | ||
| 26 | + - name: Check format | ||
| 27 | + run: flutter format . --set-exit-if-changed --fix | ||
| 28 | + - run: flutter analyze | ||
| 29 | + - name: Run unit tests | ||
| 30 | + run: flutter test | ||
| 31 | + - name: Run integration tests on Android | ||
| 32 | + uses: reactivecircus/android-emulator-runner@v2.5.0 | ||
| 33 | + with: | ||
| 34 | + api-level: 29 | ||
| 35 | + disable-animations: false | ||
| 36 | + script: cd example && flutter drive --target=test_driver/app.dart | ||
| 37 | + publish: | ||
| 38 | + needs: checks | ||
| 39 | + runs-on: ubuntu-latest | ||
| 40 | + name: Publish plugin | ||
| 41 | + | ||
| 42 | + steps: | ||
| 43 | + - uses: actions/checkout@v2 | ||
| 44 | + - uses: sakebook/actions-flutter-pub-publisher@v1.2.1 | ||
| 45 | + with: | ||
| 46 | + credential: ${{ secrets.PUB_CREDENTIAL }} | ||
| 47 | + flutter_package: true | ||
| 48 | + skip_test: true |
.travis.yml
deleted
100644 → 0
| 1 | -matrix: | ||
| 2 | - include: | ||
| 3 | - - stage: Format checking | ||
| 4 | - | ||
| 5 | - name: Dart code | ||
| 6 | - | ||
| 7 | - os: linux | ||
| 8 | - dist: trusty | ||
| 9 | - language: generic | ||
| 10 | - | ||
| 11 | - install: | ||
| 12 | - - git clone -b master https://github.com/flutter/flutter.git | ||
| 13 | - - ./flutter/bin/flutter --version | ||
| 14 | - before_script: | ||
| 15 | - - export PATH=$HOME/.pub-cache/bin:$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH | ||
| 16 | - script: | ||
| 17 | - - flutter format lib example --set-exit-if-changed --fix | ||
| 18 | - | ||
| 19 | - - stage: Code analysis | ||
| 20 | - | ||
| 21 | - name: Dart code | ||
| 22 | - | ||
| 23 | - os: linux | ||
| 24 | - dist: trusty | ||
| 25 | - language: generic | ||
| 26 | - | ||
| 27 | - before_install: | ||
| 28 | - - cd .. | ||
| 29 | - install: | ||
| 30 | - - git clone -b master https://github.com/flutter/flutter.git | ||
| 31 | - - ./flutter/bin/flutter --version | ||
| 32 | - before_script: | ||
| 33 | - - export PATH=$HOME/.pub-cache/bin:$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH | ||
| 34 | - | ||
| 35 | - - cd wakelock | ||
| 36 | - | ||
| 37 | - - flutter packages get | ||
| 38 | - script: | ||
| 39 | - - flutter analyze | ||
| 40 | - | ||
| 41 | - - stage: Integration testing | ||
| 42 | - | ||
| 43 | - name: iOS | ||
| 44 | - | ||
| 45 | - os: osx | ||
| 46 | - osx_image: xcode10.2 | ||
| 47 | - | ||
| 48 | - before_install: | ||
| 49 | - - open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app | ||
| 50 | - - export HOMEBREW_NO_AUTO_UPDATE=1 | ||
| 51 | - install: | ||
| 52 | - - brew install libimobiledevice | ||
| 53 | - - brew install ideviceinstaller | ||
| 54 | - - brew install ios-deploy | ||
| 55 | - - brew install cocoapods || echo 'ignore exit(1)' | ||
| 56 | - - brew link --overwrite cocoapods | ||
| 57 | - | ||
| 58 | - - git clone -b master https://github.com/flutter/flutter.git | ||
| 59 | - - ./flutter/bin/flutter --version | ||
| 60 | - before_script: | ||
| 61 | - - export PATH=$HOME/.pub-cache/bin:$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH | ||
| 62 | - | ||
| 63 | - - flutter doctor -v | ||
| 64 | - | ||
| 65 | - - cd example | ||
| 66 | - script: | ||
| 67 | - - travis_retry flutter driver test_driver/app.dart | ||
| 68 | - exclude: # Currently excluding the Android test as Flutter seems to require Vulkan (https://travis-ci.com/creativecreatorormaybenot/wakelock/jobs/214156381). | ||
| 69 | - - name: Android | ||
| 70 | - | ||
| 71 | - os: linux | ||
| 72 | - dist: trusty | ||
| 73 | - sudo: true | ||
| 74 | - language: android | ||
| 75 | - | ||
| 76 | - android: | ||
| 77 | - components: | ||
| 78 | - - tools | ||
| 79 | - - platform-tools | ||
| 80 | - | ||
| 81 | - - build-tools-28.0.3 | ||
| 82 | - - android-28 | ||
| 83 | - - android-24 | ||
| 84 | - | ||
| 85 | - - extra-google-m2repository | ||
| 86 | - - extra-android-m2repository | ||
| 87 | - | ||
| 88 | - - sys-img-armeabi-v7a-android-24 | ||
| 89 | - | ||
| 90 | - install: | ||
| 91 | - - git clone -b master https://github.com/flutter/flutter.git | ||
| 92 | - - ./flutter/bin/flutter --version | ||
| 93 | - before_script: | ||
| 94 | - - export PATH=$HOME/.pub-cache/bin:$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin:$PATH | ||
| 95 | - | ||
| 96 | - - echo no | android create avd --force -n test -t android-24 --abi armeabi-v7a | ||
| 97 | - - emulator -avd test -no-window & | ||
| 98 | - - android-wait-for-emulator | ||
| 99 | - - adb shell input keyevent 82 & | ||
| 100 | - | ||
| 101 | - - flutter doctor -v | ||
| 102 | - | ||
| 103 | - - cd example | ||
| 104 | - script: | ||
| 105 | - - flutter driver test_driver/app.dart --enable-software-rendering |
| 1 | +## 0.1.4 | ||
| 2 | + | ||
| 3 | +* Added assertion for `on` in `Wakelock.toggle` to be non-null and `@required` annotation. | ||
| 4 | + This is not a breaking change since it was logically required before. | ||
| 5 | +* Switched from Java to Kotlin for the Android implementation. | ||
| 6 | +* Updated plugin files to the latest Flutter standards. | ||
| 7 | +* Updated structure to ignore unnecessary files. | ||
| 8 | +* Added unit testing. | ||
| 9 | +* Improved the integration tests to make use of the example app. | ||
| 10 | +* Updated example app. | ||
| 11 | +* Added GitHub actions and removed Travis CI. | ||
| 12 | +* Made `CHANGELOG.md` formulations more consistent. | ||
| 13 | +* Updated year in `LICENSE`. | ||
| 14 | +* Enforced `pedantic` lint rules. | ||
| 15 | + | ||
| 1 | ## 0.1.3+4 | 16 | ## 0.1.3+4 |
| 2 | 17 | ||
| 3 | -* Fix iOS simulator issue. | 18 | +* Fixed iOS simulator issue. |
| 4 | 19 | ||
| 5 | ## 0.1.3+3 | 20 | ## 0.1.3+3 |
| 6 | 21 | ||
| 7 | -* Fix Flutter SDK version constraint. | 22 | +* Fixed Flutter SDK version constraint. |
| 8 | 23 | ||
| 9 | ## 0.1.3+2 | 24 | ## 0.1.3+2 |
| 10 | 25 | ||
| 11 | -* Fix `pubspec.yaml`. | 26 | +* Fixed `pubspec.yaml`. |
| 12 | 27 | ||
| 13 | ## 0.1.3+1 | 28 | ## 0.1.3+1 |
| 14 | 29 | ||
| @@ -24,7 +39,7 @@ | @@ -24,7 +39,7 @@ | ||
| 24 | 39 | ||
| 25 | ## 0.1.2+7 | 40 | ## 0.1.2+7 |
| 26 | 41 | ||
| 27 | -* Formatting in `AndroidManifest.xml`. | 42 | +* Formatted `AndroidManifest.xml`. |
| 28 | 43 | ||
| 29 | ## 0.1.2+6 | 44 | ## 0.1.2+6 |
| 30 | 45 | ||
| @@ -101,5 +116,4 @@ | @@ -101,5 +116,4 @@ | ||
| 101 | 116 | ||
| 102 | ## 0.0.1 | 117 | ## 0.0.1 |
| 103 | 118 | ||
| 104 | -* The wakelock plugin allows you to toggle the Android and iOS wakelock | ||
| 105 | - and retrieve its current status. | 119 | +* Initial version. |
| 1 | BSD 3-Clause License | 1 | BSD 3-Clause License |
| 2 | 2 | ||
| 3 | -Copyright (c) 2019, creativecreatorormaybenot | 3 | +Copyright (c) 2020, creativecreatorormaybenot |
| 4 | All rights reserved. | 4 | All rights reserved. |
| 5 | 5 | ||
| 6 | Redistribution and use in source and binary forms, with or without | 6 | Redistribution and use in source and binary forms, with or without |
| 1 | -# Wakelock [](https://travis-ci.com/creativecreatorormaybenot/wakelock) [](https://github.com/creativecreatorormaybenot/wakelock) [](https://pub.dev/packages/wakelock) | 1 | +# Wakelock [](https://github.com/creativecreatorormaybenot/wakelock/actions) [](https://github.com/creativecreatorormaybenot/wakelock) [](https://pub.dev/packages/wakelock) |
| 2 | 2 | ||
| 3 | This Flutter plugin allows you to enable and toggle the screen wakelock on Android and iOS, which prevents the screen from turning off automatically. | 3 | This Flutter plugin allows you to enable and toggle the screen wakelock on Android and iOS, which prevents the screen from turning off automatically. |
| 4 | Essentially, this allows you to keep the device awake, i.e. prevent the device from sleeping. | 4 | Essentially, this allows you to keep the device awake, i.e. prevent the device from sleeping. |
| 1 | -group 'wakelock.wakelock' | 1 | +group 'creativecreatorormaybenot.wakelock' |
| 2 | version '1.0-SNAPSHOT' | 2 | version '1.0-SNAPSHOT' |
| 3 | 3 | ||
| 4 | buildscript { | 4 | buildscript { |
| 5 | + ext.kotlin_version = '1.3.50' | ||
| 5 | repositories { | 6 | repositories { |
| 6 | google() | 7 | google() |
| 7 | jcenter() | 8 | jcenter() |
| 8 | } | 9 | } |
| 9 | 10 | ||
| 10 | dependencies { | 11 | dependencies { |
| 11 | - classpath 'com.android.tools.build:gradle:3.3.0' | 12 | + classpath 'com.android.tools.build:gradle:3.5.0' |
| 13 | + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
| 12 | } | 14 | } |
| 13 | } | 15 | } |
| 14 | 16 | ||
| @@ -20,15 +22,22 @@ rootProject.allprojects { | @@ -20,15 +22,22 @@ rootProject.allprojects { | ||
| 20 | } | 22 | } |
| 21 | 23 | ||
| 22 | apply plugin: 'com.android.library' | 24 | apply plugin: 'com.android.library' |
| 25 | +apply plugin: 'kotlin-android' | ||
| 23 | 26 | ||
| 24 | android { | 27 | android { |
| 25 | compileSdkVersion 28 | 28 | compileSdkVersion 28 |
| 26 | 29 | ||
| 30 | + sourceSets { | ||
| 31 | + main.java.srcDirs += 'src/main/kotlin' | ||
| 32 | + } | ||
| 27 | defaultConfig { | 33 | defaultConfig { |
| 28 | minSdkVersion 16 | 34 | minSdkVersion 16 |
| 29 | - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
| 30 | } | 35 | } |
| 31 | lintOptions { | 36 | lintOptions { |
| 32 | disable 'InvalidPackage' | 37 | disable 'InvalidPackage' |
| 33 | } | 38 | } |
| 34 | } | 39 | } |
| 40 | + | ||
| 41 | +dependencies { | ||
| 42 | + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
| 43 | +} |
No preview for this file type
| 1 | -#Sat Jul 06 23:01:28 UTC 2019 | ||
| 2 | distributionBase=GRADLE_USER_HOME | 1 | distributionBase=GRADLE_USER_HOME |
| 3 | distributionPath=wrapper/dists | 2 | distributionPath=wrapper/dists |
| 4 | zipStoreBase=GRADLE_USER_HOME | 3 | zipStoreBase=GRADLE_USER_HOME |
| 5 | zipStorePath=wrapper/dists | 4 | zipStorePath=wrapper/dists |
| 6 | -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip | 5 | +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip |
android/gradlew
deleted
100644 → 0
| 1 | -#!/usr/bin/env sh | ||
| 2 | - | ||
| 3 | -############################################################################## | ||
| 4 | -## | ||
| 5 | -## Gradle start up script for UN*X | ||
| 6 | -## | ||
| 7 | -############################################################################## | ||
| 8 | - | ||
| 9 | -# Attempt to set APP_HOME | ||
| 10 | -# Resolve links: $0 may be a link | ||
| 11 | -PRG="$0" | ||
| 12 | -# Need this for relative symlinks. | ||
| 13 | -while [ -h "$PRG" ] ; do | ||
| 14 | - ls=`ls -ld "$PRG"` | ||
| 15 | - link=`expr "$ls" : '.*-> \(.*\)$'` | ||
| 16 | - if expr "$link" : '/.*' > /dev/null; then | ||
| 17 | - PRG="$link" | ||
| 18 | - else | ||
| 19 | - PRG=`dirname "$PRG"`"/$link" | ||
| 20 | - fi | ||
| 21 | -done | ||
| 22 | -SAVED="`pwd`" | ||
| 23 | -cd "`dirname \"$PRG\"`/" >/dev/null | ||
| 24 | -APP_HOME="`pwd -P`" | ||
| 25 | -cd "$SAVED" >/dev/null | ||
| 26 | - | ||
| 27 | -APP_NAME="Gradle" | ||
| 28 | -APP_BASE_NAME=`basename "$0"` | ||
| 29 | - | ||
| 30 | -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
| 31 | -DEFAULT_JVM_OPTS="" | ||
| 32 | - | ||
| 33 | -# Use the maximum available, or set MAX_FD != -1 to use that value. | ||
| 34 | -MAX_FD="maximum" | ||
| 35 | - | ||
| 36 | -warn () { | ||
| 37 | - echo "$*" | ||
| 38 | -} | ||
| 39 | - | ||
| 40 | -die () { | ||
| 41 | - echo | ||
| 42 | - echo "$*" | ||
| 43 | - echo | ||
| 44 | - exit 1 | ||
| 45 | -} | ||
| 46 | - | ||
| 47 | -# OS specific support (must be 'true' or 'false'). | ||
| 48 | -cygwin=false | ||
| 49 | -msys=false | ||
| 50 | -darwin=false | ||
| 51 | -nonstop=false | ||
| 52 | -case "`uname`" in | ||
| 53 | - CYGWIN* ) | ||
| 54 | - cygwin=true | ||
| 55 | - ;; | ||
| 56 | - Darwin* ) | ||
| 57 | - darwin=true | ||
| 58 | - ;; | ||
| 59 | - MINGW* ) | ||
| 60 | - msys=true | ||
| 61 | - ;; | ||
| 62 | - NONSTOP* ) | ||
| 63 | - nonstop=true | ||
| 64 | - ;; | ||
| 65 | -esac | ||
| 66 | - | ||
| 67 | -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | ||
| 68 | - | ||
| 69 | -# Determine the Java command to use to start the JVM. | ||
| 70 | -if [ -n "$JAVA_HOME" ] ; then | ||
| 71 | - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | ||
| 72 | - # IBM's JDK on AIX uses strange locations for the executables | ||
| 73 | - JAVACMD="$JAVA_HOME/jre/sh/java" | ||
| 74 | - else | ||
| 75 | - JAVACMD="$JAVA_HOME/bin/java" | ||
| 76 | - fi | ||
| 77 | - if [ ! -x "$JAVACMD" ] ; then | ||
| 78 | - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | ||
| 79 | - | ||
| 80 | -Please set the JAVA_HOME variable in your environment to match the | ||
| 81 | -location of your Java installation." | ||
| 82 | - fi | ||
| 83 | -else | ||
| 84 | - JAVACMD="java" | ||
| 85 | - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
| 86 | - | ||
| 87 | -Please set the JAVA_HOME variable in your environment to match the | ||
| 88 | -location of your Java installation." | ||
| 89 | -fi | ||
| 90 | - | ||
| 91 | -# Increase the maximum file descriptors if we can. | ||
| 92 | -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | ||
| 93 | - MAX_FD_LIMIT=`ulimit -H -n` | ||
| 94 | - if [ $? -eq 0 ] ; then | ||
| 95 | - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | ||
| 96 | - MAX_FD="$MAX_FD_LIMIT" | ||
| 97 | - fi | ||
| 98 | - ulimit -n $MAX_FD | ||
| 99 | - if [ $? -ne 0 ] ; then | ||
| 100 | - warn "Could not set maximum file descriptor limit: $MAX_FD" | ||
| 101 | - fi | ||
| 102 | - else | ||
| 103 | - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | ||
| 104 | - fi | ||
| 105 | -fi | ||
| 106 | - | ||
| 107 | -# For Darwin, add options to specify how the application appears in the dock | ||
| 108 | -if $darwin; then | ||
| 109 | - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | ||
| 110 | -fi | ||
| 111 | - | ||
| 112 | -# For Cygwin, switch paths to Windows format before running java | ||
| 113 | -if $cygwin ; then | ||
| 114 | - APP_HOME=`cygpath --path --mixed "$APP_HOME"` | ||
| 115 | - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | ||
| 116 | - JAVACMD=`cygpath --unix "$JAVACMD"` | ||
| 117 | - | ||
| 118 | - # We build the pattern for arguments to be converted via cygpath | ||
| 119 | - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | ||
| 120 | - SEP="" | ||
| 121 | - for dir in $ROOTDIRSRAW ; do | ||
| 122 | - ROOTDIRS="$ROOTDIRS$SEP$dir" | ||
| 123 | - SEP="|" | ||
| 124 | - done | ||
| 125 | - OURCYGPATTERN="(^($ROOTDIRS))" | ||
| 126 | - # Add a user-defined pattern to the cygpath arguments | ||
| 127 | - if [ "$GRADLE_CYGPATTERN" != "" ] ; then | ||
| 128 | - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | ||
| 129 | - fi | ||
| 130 | - # Now convert the arguments - kludge to limit ourselves to /bin/sh | ||
| 131 | - i=0 | ||
| 132 | - for arg in "$@" ; do | ||
| 133 | - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | ||
| 134 | - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | ||
| 135 | - | ||
| 136 | - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | ||
| 137 | - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | ||
| 138 | - else | ||
| 139 | - eval `echo args$i`="\"$arg\"" | ||
| 140 | - fi | ||
| 141 | - i=$((i+1)) | ||
| 142 | - done | ||
| 143 | - case $i in | ||
| 144 | - (0) set -- ;; | ||
| 145 | - (1) set -- "$args0" ;; | ||
| 146 | - (2) set -- "$args0" "$args1" ;; | ||
| 147 | - (3) set -- "$args0" "$args1" "$args2" ;; | ||
| 148 | - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; | ||
| 149 | - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | ||
| 150 | - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | ||
| 151 | - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | ||
| 152 | - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | ||
| 153 | - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | ||
| 154 | - esac | ||
| 155 | -fi | ||
| 156 | - | ||
| 157 | -# Escape application args | ||
| 158 | -save () { | ||
| 159 | - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | ||
| 160 | - echo " " | ||
| 161 | -} | ||
| 162 | -APP_ARGS=$(save "$@") | ||
| 163 | - | ||
| 164 | -# Collect all arguments for the java command, following the shell quoting and substitution rules | ||
| 165 | -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" | ||
| 166 | - | ||
| 167 | -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong | ||
| 168 | -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then | ||
| 169 | - cd "$(dirname "$0")" | ||
| 170 | -fi | ||
| 171 | - | ||
| 172 | -exec "$JAVACMD" "$@" |
android/gradlew.bat
deleted
100644 → 0
| 1 | -@if "%DEBUG%" == "" @echo off | ||
| 2 | -@rem ########################################################################## | ||
| 3 | -@rem | ||
| 4 | -@rem Gradle startup script for Windows | ||
| 5 | -@rem | ||
| 6 | -@rem ########################################################################## | ||
| 7 | - | ||
| 8 | -@rem Set local scope for the variables with windows NT shell | ||
| 9 | -if "%OS%"=="Windows_NT" setlocal | ||
| 10 | - | ||
| 11 | -set DIRNAME=%~dp0 | ||
| 12 | -if "%DIRNAME%" == "" set DIRNAME=. | ||
| 13 | -set APP_BASE_NAME=%~n0 | ||
| 14 | -set APP_HOME=%DIRNAME% | ||
| 15 | - | ||
| 16 | -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
| 17 | -set DEFAULT_JVM_OPTS= | ||
| 18 | - | ||
| 19 | -@rem Find java.exe | ||
| 20 | -if defined JAVA_HOME goto findJavaFromJavaHome | ||
| 21 | - | ||
| 22 | -set JAVA_EXE=java.exe | ||
| 23 | -%JAVA_EXE% -version >NUL 2>&1 | ||
| 24 | -if "%ERRORLEVEL%" == "0" goto init | ||
| 25 | - | ||
| 26 | -echo. | ||
| 27 | -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
| 28 | -echo. | ||
| 29 | -echo Please set the JAVA_HOME variable in your environment to match the | ||
| 30 | -echo location of your Java installation. | ||
| 31 | - | ||
| 32 | -goto fail | ||
| 33 | - | ||
| 34 | -:findJavaFromJavaHome | ||
| 35 | -set JAVA_HOME=%JAVA_HOME:"=% | ||
| 36 | -set JAVA_EXE=%JAVA_HOME%/bin/java.exe | ||
| 37 | - | ||
| 38 | -if exist "%JAVA_EXE%" goto init | ||
| 39 | - | ||
| 40 | -echo. | ||
| 41 | -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | ||
| 42 | -echo. | ||
| 43 | -echo Please set the JAVA_HOME variable in your environment to match the | ||
| 44 | -echo location of your Java installation. | ||
| 45 | - | ||
| 46 | -goto fail | ||
| 47 | - | ||
| 48 | -:init | ||
| 49 | -@rem Get command-line arguments, handling Windows variants | ||
| 50 | - | ||
| 51 | -if not "%OS%" == "Windows_NT" goto win9xME_args | ||
| 52 | - | ||
| 53 | -:win9xME_args | ||
| 54 | -@rem Slurp the command line arguments. | ||
| 55 | -set CMD_LINE_ARGS= | ||
| 56 | -set _SKIP=2 | ||
| 57 | - | ||
| 58 | -:win9xME_args_slurp | ||
| 59 | -if "x%~1" == "x" goto execute | ||
| 60 | - | ||
| 61 | -set CMD_LINE_ARGS=%* | ||
| 62 | - | ||
| 63 | -:execute | ||
| 64 | -@rem Setup the command line | ||
| 65 | - | ||
| 66 | -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | ||
| 67 | - | ||
| 68 | -@rem Execute Gradle | ||
| 69 | -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% | ||
| 70 | - | ||
| 71 | -:end | ||
| 72 | -@rem End local scope for the variables with windows NT shell | ||
| 73 | -if "%ERRORLEVEL%"=="0" goto mainEnd | ||
| 74 | - | ||
| 75 | -:fail | ||
| 76 | -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | ||
| 77 | -rem the _cmd.exe /c_ return code! | ||
| 78 | -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 | ||
| 79 | -exit /b 1 | ||
| 80 | - | ||
| 81 | -:mainEnd | ||
| 82 | -if "%OS%"=="Windows_NT" endlocal | ||
| 83 | - | ||
| 84 | -:omega |
| 1 | -package wakelock.wakelock; | ||
| 2 | - | ||
| 3 | -import android.view.WindowManager; | ||
| 4 | - | ||
| 5 | -import io.flutter.plugin.common.MethodCall; | ||
| 6 | -import io.flutter.plugin.common.MethodChannel; | ||
| 7 | -import io.flutter.plugin.common.MethodChannel.MethodCallHandler; | ||
| 8 | -import io.flutter.plugin.common.MethodChannel.Result; | ||
| 9 | -import io.flutter.plugin.common.PluginRegistry.Registrar; | ||
| 10 | - | ||
| 11 | -public class WakelockPlugin implements MethodCallHandler { | ||
| 12 | - private Registrar registrar; | ||
| 13 | - | ||
| 14 | - private WakelockPlugin(Registrar registrar) { | ||
| 15 | - this.registrar = registrar; | ||
| 16 | - } | ||
| 17 | - | ||
| 18 | - public static void registerWith(Registrar registrar) { | ||
| 19 | - final MethodChannel channel = new MethodChannel(registrar.messenger(), "wakelock"); | ||
| 20 | - channel.setMethodCallHandler(new WakelockPlugin(registrar)); | ||
| 21 | - } | ||
| 22 | - | ||
| 23 | - private boolean isEnabled() { | ||
| 24 | - return (registrar.activity().getWindow().getAttributes().flags & | ||
| 25 | - WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) != 0; | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - @Override | ||
| 29 | - public void onMethodCall(MethodCall call, Result result) { | ||
| 30 | - if (call.method.equals("toggle")) { | ||
| 31 | - final boolean enable = call.argument("enable"), enabled = isEnabled(); | ||
| 32 | - if (enable) { | ||
| 33 | - if (!enabled) | ||
| 34 | - registrar.activity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); | ||
| 35 | - } else if (enabled) { | ||
| 36 | - registrar.activity().getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); | ||
| 37 | - } | ||
| 38 | - result.success(null); | ||
| 39 | - } else if (call.method.equals("isEnabled")) { | ||
| 40 | - result.success(isEnabled()); | ||
| 41 | - } else { | ||
| 42 | - result.notImplemented(); | ||
| 43 | - } | ||
| 44 | - } | ||
| 45 | -} |
| 1 | +package creativecreatorormaybenot.wakelock | ||
| 2 | + | ||
| 3 | +import android.app.Activity | ||
| 4 | +import android.view.WindowManager | ||
| 5 | +import io.flutter.plugin.common.MethodChannel | ||
| 6 | + | ||
| 7 | +internal class Wakelock { | ||
| 8 | + var activity: Activity? = null | ||
| 9 | + | ||
| 10 | + private val enabled | ||
| 11 | + get() = activity!!.window.attributes.flags and | ||
| 12 | + WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON != 0 | ||
| 13 | + | ||
| 14 | + fun toggle(enable: Boolean, result: MethodChannel.Result) { | ||
| 15 | + if (activity == null) { | ||
| 16 | + result.noActivity() | ||
| 17 | + return | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + val activity = this.activity!! | ||
| 21 | + val enabled = this.enabled | ||
| 22 | + | ||
| 23 | + if (enable) { | ||
| 24 | + if (!enabled) activity.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) | ||
| 25 | + } else if (enabled) { | ||
| 26 | + activity.window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + result.success(null) | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + fun isEnabled(result: MethodChannel.Result) { | ||
| 33 | + if (activity == null) { | ||
| 34 | + result.noActivity() | ||
| 35 | + return | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + result.success(enabled) | ||
| 39 | + } | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +fun MethodChannel.Result.noActivity() = error("no_activity", "wakelock requires a foreground activity", null) |
| 1 | +package creativecreatorormaybenot.wakelock | ||
| 2 | + | ||
| 3 | +import androidx.annotation.NonNull | ||
| 4 | +import io.flutter.embedding.engine.plugins.FlutterPlugin | ||
| 5 | +import io.flutter.embedding.engine.plugins.activity.ActivityAware | ||
| 6 | +import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding | ||
| 7 | +import io.flutter.plugin.common.MethodCall | ||
| 8 | +import io.flutter.plugin.common.MethodChannel | ||
| 9 | +import io.flutter.plugin.common.MethodChannel.MethodCallHandler | ||
| 10 | +import io.flutter.plugin.common.MethodChannel.Result | ||
| 11 | +import io.flutter.plugin.common.PluginRegistry.Registrar | ||
| 12 | + | ||
| 13 | +public class WakelockPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { | ||
| 14 | + private lateinit var channel: MethodChannel | ||
| 15 | + | ||
| 16 | + override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { | ||
| 17 | + channel = MethodChannel(flutterPluginBinding.binaryMessenger, "wakelock") | ||
| 18 | + channel.setMethodCallHandler(this) | ||
| 19 | + setup() | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + // This static function is optional and equivalent to onAttachedToEngine. It supports the old | ||
| 23 | + // pre-Flutter-1.12 Android projects. You are encouraged to continue supporting | ||
| 24 | + // plugin registration via this function while apps migrate to use the new Android APIs | ||
| 25 | + // post-flutter-1.12 via https://flutter.dev/go/android-project-migration. | ||
| 26 | + // | ||
| 27 | + // It is encouraged to share logic between onAttachedToEngine and registerWith to keep | ||
| 28 | + // them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called | ||
| 29 | + // depending on the user's project. onAttachedToEngine or registerWith must both be defined | ||
| 30 | + // in the same class. | ||
| 31 | + companion object { | ||
| 32 | + @JvmStatic | ||
| 33 | + fun registerWith(registrar: Registrar) { | ||
| 34 | + val channel = MethodChannel(registrar.messenger(), "wakelock") | ||
| 35 | + val plugin = WakelockPlugin() | ||
| 36 | + channel.setMethodCallHandler(plugin) | ||
| 37 | + plugin.setup() | ||
| 38 | + } | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + private var wakelock: Wakelock? = null | ||
| 42 | + | ||
| 43 | + private fun setup() { | ||
| 44 | + wakelock = Wakelock() | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { | ||
| 48 | + when (call.method) { | ||
| 49 | + "toggle" -> { | ||
| 50 | + wakelock?.toggle(call.argument<Boolean>("enable")!!, result) | ||
| 51 | + } | ||
| 52 | + "isEnabled" -> { | ||
| 53 | + wakelock?.isEnabled(result) | ||
| 54 | + } | ||
| 55 | + else -> { | ||
| 56 | + result.notImplemented() | ||
| 57 | + } | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { | ||
| 62 | + channel.setMethodCallHandler(null) | ||
| 63 | + wakelock = null | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + override fun onAttachedToActivity(binding: ActivityPluginBinding) { | ||
| 67 | + wakelock?.activity = binding.activity | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + override fun onDetachedFromActivity() { | ||
| 71 | + wakelock?.activity = null | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { | ||
| 75 | + onAttachedToActivity(binding) | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + override fun onDetachedFromActivityForConfigChanges() { | ||
| 79 | + onDetachedFromActivity() | ||
| 80 | + } | ||
| 81 | +} |
| 1 | +# Miscellaneous | ||
| 1 | *.class | 2 | *.class |
| 2 | *.log | 3 | *.log |
| 3 | *.pyc | 4 | *.pyc |
| @@ -7,54 +8,44 @@ | @@ -7,54 +8,44 @@ | ||
| 7 | .buildlog/ | 8 | .buildlog/ |
| 8 | .history | 9 | .history |
| 9 | .svn/ | 10 | .svn/ |
| 11 | + | ||
| 12 | +# IntelliJ related | ||
| 10 | *.iml | 13 | *.iml |
| 11 | *.ipr | 14 | *.ipr |
| 12 | *.iws | 15 | *.iws |
| 13 | .idea/ | 16 | .idea/ |
| 17 | + | ||
| 18 | +# The .vscode folder contains launch configuration and tasks you configure in | ||
| 19 | +# VS Code which you may wish to be included in version control, so this line | ||
| 20 | +# is commented out by default. | ||
| 21 | +#.vscode/ | ||
| 22 | + | ||
| 23 | +# Flutter/Dart/Pub related | ||
| 14 | **/doc/api/ | 24 | **/doc/api/ |
| 15 | .dart_tool/ | 25 | .dart_tool/ |
| 16 | .flutter-plugins | 26 | .flutter-plugins |
| 27 | +.flutter-plugins-dependencies | ||
| 17 | .packages | 28 | .packages |
| 18 | .pub-cache/ | 29 | .pub-cache/ |
| 19 | .pub/ | 30 | .pub/ |
| 20 | /build/ | 31 | /build/ |
| 21 | -**/android/**/gradle-wrapper.jar | ||
| 22 | -**/android/.gradle | ||
| 23 | -**/android/captures/ | ||
| 24 | -**/android/gradlew | ||
| 25 | -**/android/gradlew.bat | ||
| 26 | -**/android/local.properties | ||
| 27 | -**/android/**/GeneratedPluginRegistrant.java | ||
| 28 | -**/ios/**/*.mode1v3 | ||
| 29 | -**/ios/**/*.mode2v3 | ||
| 30 | -**/ios/**/*.moved-aside | ||
| 31 | -**/ios/**/*.pbxuser | ||
| 32 | -**/ios/**/*.perspectivev3 | ||
| 33 | -**/ios/**/*sync/ | ||
| 34 | -**/ios/**/.sconsign.dblite | ||
| 35 | -**/ios/**/.tags* | ||
| 36 | -**/ios/**/.vagrant/ | ||
| 37 | -**/ios/**/DerivedData/ | ||
| 38 | -**/ios/**/Icon? | ||
| 39 | -**/ios/**/Pods/ | ||
| 40 | -**/ios/**/.symlinks/ | ||
| 41 | -**/ios/**/profile | ||
| 42 | -**/ios/**/xcuserdata | ||
| 43 | -**/ios/.generated/ | ||
| 44 | -**/ios/Flutter/App.framework | ||
| 45 | -**/ios/Flutter/Flutter.framework | ||
| 46 | -**/ios/Flutter/Generated.xcconfig | ||
| 47 | -**/ios/Flutter/app.flx | ||
| 48 | -**/ios/Flutter/app.zip | ||
| 49 | -**/ios/Flutter/flutter_assets/ | ||
| 50 | -**/ios/ServiceDefinitions.json | ||
| 51 | -**/ios/Runner/GeneratedPluginRegistrant.* | ||
| 52 | -!**/ios/**/default.mode1v3 | ||
| 53 | -!**/ios/**/default.mode2v3 | ||
| 54 | -!**/ios/**/default.pbxuser | ||
| 55 | -!**/ios/**/default.perspectivev3 | 32 | + |
| 33 | +# Web related | ||
| 34 | +lib/generated_plugin_registrant.dart | ||
| 35 | + | ||
| 36 | +# Symbolication related | ||
| 37 | +app.*.symbols | ||
| 38 | + | ||
| 39 | +# Obfuscation related | ||
| 40 | +app.*.map.json | ||
| 41 | + | ||
| 42 | +# Exceptions to above rules. | ||
| 56 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages | 43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages |
| 57 | -wakelock_example.iml | ||
| 58 | -.idea | 44 | + |
| 45 | +# Cleanliness | ||
| 46 | +pubspec.lock | ||
| 59 | .metadata | 47 | .metadata |
| 60 | -pubspec.lock | ||
| 48 | +test | ||
| 49 | +ios | ||
| 50 | +android | ||
| 51 | +web |
| @@ -2,6 +2,8 @@ | @@ -2,6 +2,8 @@ | ||
| 2 | 2 | ||
| 3 | This is a basic example demonstrating the functionality of the wakelock plugin, including enabling & disabling the wakelock and also retrieving the current wakelock status using a `FutureBuilder`. | 3 | This is a basic example demonstrating the functionality of the wakelock plugin, including enabling & disabling the wakelock and also retrieving the current wakelock status using a `FutureBuilder`. |
| 4 | 4 | ||
| 5 | +If you want to run this example app, you need to run `flutter create .` in the `example` directory (`cd example` from the plugin directory) first. This is also necessary when running the Flutter Driver tests. | ||
| 6 | + | ||
| 5 | See [`example/lib/main.dart`](https://github.com/creativecreatorormaybenot/wakelock/blob/master/example/lib/main.dart). | 7 | See [`example/lib/main.dart`](https://github.com/creativecreatorormaybenot/wakelock/blob/master/example/lib/main.dart). |
| 6 | 8 | ||
| 7 | ## Integration testing | 9 | ## Integration testing |
example/android/app/build.gradle
deleted
100644 → 0
| 1 | -def localProperties = new Properties() | ||
| 2 | -def localPropertiesFile = rootProject.file('local.properties') | ||
| 3 | -if (localPropertiesFile.exists()) { | ||
| 4 | - localPropertiesFile.withReader('UTF-8') { reader -> | ||
| 5 | - localProperties.load(reader) | ||
| 6 | - } | ||
| 7 | -} | ||
| 8 | - | ||
| 9 | -def flutterRoot = localProperties.getProperty('flutter.sdk') | ||
| 10 | -if (flutterRoot == null) { | ||
| 11 | - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | ||
| 12 | -} | ||
| 13 | - | ||
| 14 | -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') | ||
| 15 | -if (flutterVersionCode == null) { | ||
| 16 | - flutterVersionCode = '1' | ||
| 17 | -} | ||
| 18 | - | ||
| 19 | -def flutterVersionName = localProperties.getProperty('flutter.versionName') | ||
| 20 | -if (flutterVersionName == null) { | ||
| 21 | - flutterVersionName = '1.0' | ||
| 22 | -} | ||
| 23 | - | ||
| 24 | -apply plugin: 'com.android.application' | ||
| 25 | -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" | ||
| 26 | - | ||
| 27 | -android { | ||
| 28 | - compileSdkVersion 28 | ||
| 29 | - | ||
| 30 | - lintOptions { | ||
| 31 | - disable 'InvalidPackage' | ||
| 32 | - } | ||
| 33 | - | ||
| 34 | - defaultConfig { | ||
| 35 | - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). | ||
| 36 | - applicationId "wakelock.wakelock_example" | ||
| 37 | - minSdkVersion 16 | ||
| 38 | - targetSdkVersion 28 | ||
| 39 | - versionCode flutterVersionCode.toInteger() | ||
| 40 | - versionName flutterVersionName | ||
| 41 | - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - buildTypes { | ||
| 45 | - release { | ||
| 46 | - // TODO: Add your own signing config for the release build. | ||
| 47 | - // Signing with the debug keys for now, so `flutter run --release` works. | ||
| 48 | - signingConfig signingConfigs.debug | ||
| 49 | - } | ||
| 50 | - } | ||
| 51 | -} | ||
| 52 | - | ||
| 53 | -flutter { | ||
| 54 | - source '../..' | ||
| 55 | -} | ||
| 56 | - | ||
| 57 | -dependencies { | ||
| 58 | - testImplementation 'junit:junit:4.12' | ||
| 59 | - androidTestImplementation 'androidx.test:runner:1.1.0' | ||
| 60 | - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' | ||
| 61 | -} |
| 1 | -<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 2 | - package="wakelock.wakelock_example"> | ||
| 3 | - <!-- Flutter needs it to communicate with the running application | ||
| 4 | - to allow setting breakpoints, to provide hot reload, etc. | ||
| 5 | - --> | ||
| 6 | - <uses-permission android:name="android.permission.INTERNET"/> | ||
| 7 | -</manifest> |
| 1 | -<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 2 | - package="wakelock.wakelock_example"> | ||
| 3 | - | ||
| 4 | - <!-- io.flutter.app.FlutterApplication is an android.app.Application that | ||
| 5 | - calls FlutterMain.startInitialization(this); in its onCreate method. | ||
| 6 | - In most cases you can leave this as-is, but you if you want to provide | ||
| 7 | - additional functionality it is fine to subclass or reimplement | ||
| 8 | - FlutterApplication and put your custom class here. --> | ||
| 9 | - <application | ||
| 10 | - android:name="io.flutter.app.FlutterApplication" | ||
| 11 | - android:label="wakelock_example" | ||
| 12 | - android:icon="@mipmap/ic_launcher"> | ||
| 13 | - <activity | ||
| 14 | - android:name=".MainActivity" | ||
| 15 | - android:launchMode="singleTop" | ||
| 16 | - android:theme="@style/LaunchTheme" | ||
| 17 | - android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | ||
| 18 | - android:hardwareAccelerated="true" | ||
| 19 | - android:windowSoftInputMode="adjustResize"> | ||
| 20 | - <!-- This keeps the window background of the activity showing | ||
| 21 | - until Flutter renders its first frame. It can be removed if | ||
| 22 | - there is no splash screen (such as the default splash screen | ||
| 23 | - defined in @style/LaunchTheme). --> | ||
| 24 | - <meta-data | ||
| 25 | - android:name="io.flutter.app.android.SplashScreenUntilFirstFrame" | ||
| 26 | - android:value="true" /> | ||
| 27 | - <intent-filter> | ||
| 28 | - <action android:name="android.intent.action.MAIN"/> | ||
| 29 | - <category android:name="android.intent.category.LAUNCHER"/> | ||
| 30 | - </intent-filter> | ||
| 31 | - </activity> | ||
| 32 | - </application> | ||
| 33 | -</manifest> |
| 1 | -package wakelock.wakelock_example; | ||
| 2 | - | ||
| 3 | -import android.os.Bundle; | ||
| 4 | -import io.flutter.app.FlutterActivity; | ||
| 5 | -import io.flutter.plugins.GeneratedPluginRegistrant; | ||
| 6 | - | ||
| 7 | -public class MainActivity extends FlutterActivity { | ||
| 8 | - @Override | ||
| 9 | - protected void onCreate(Bundle savedInstanceState) { | ||
| 10 | - super.onCreate(savedInstanceState); | ||
| 11 | - GeneratedPluginRegistrant.registerWith(this); | ||
| 12 | - } | ||
| 13 | -} |
| 1 | -<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | -<!-- Modify this file to customize your launch splash screen --> | ||
| 3 | -<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 4 | - <item android:drawable="@android:color/white" /> | ||
| 5 | - | ||
| 6 | - <!-- You can insert your own image assets here --> | ||
| 7 | - <!-- <item> | ||
| 8 | - <bitmap | ||
| 9 | - android:gravity="center" | ||
| 10 | - android:src="@mipmap/launch_image" /> | ||
| 11 | - </item> --> | ||
| 12 | -</layer-list> |
544 Bytes
442 Bytes
721 Bytes
1.01 KB
1.41 KB
| 1 | -<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | -<resources> | ||
| 3 | - <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
| 4 | - <!-- Show a splash screen on the activity. Automatically removed when | ||
| 5 | - Flutter draws its first frame --> | ||
| 6 | - <item name="android:windowBackground">@drawable/launch_background</item> | ||
| 7 | - </style> | ||
| 8 | -</resources> |
| 1 | -<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 2 | - package="wakelock.wakelock_example"> | ||
| 3 | - <!-- Flutter needs it to communicate with the running application | ||
| 4 | - to allow setting breakpoints, to provide hot reload, etc. | ||
| 5 | - --> | ||
| 6 | - <uses-permission android:name="android.permission.INTERNET"/> | ||
| 7 | -</manifest> |
example/android/build.gradle
deleted
100644 → 0
| 1 | -buildscript { | ||
| 2 | - repositories { | ||
| 3 | - google() | ||
| 4 | - jcenter() | ||
| 5 | - } | ||
| 6 | - | ||
| 7 | - dependencies { | ||
| 8 | - classpath 'com.android.tools.build:gradle:3.3.0' | ||
| 9 | - } | ||
| 10 | -} | ||
| 11 | - | ||
| 12 | -allprojects { | ||
| 13 | - repositories { | ||
| 14 | - google() | ||
| 15 | - jcenter() | ||
| 16 | - } | ||
| 17 | -} | ||
| 18 | - | ||
| 19 | -rootProject.buildDir = '../build' | ||
| 20 | -subprojects { | ||
| 21 | - project.buildDir = "${rootProject.buildDir}/${project.name}" | ||
| 22 | -} | ||
| 23 | -subprojects { | ||
| 24 | - project.evaluationDependsOn(':app') | ||
| 25 | -} | ||
| 26 | - | ||
| 27 | -task clean(type: Delete) { | ||
| 28 | - delete rootProject.buildDir | ||
| 29 | -} |
example/android/gradle.properties
deleted
100644 → 0
example/android/settings.gradle
deleted
100644 → 0
| 1 | -include ':app' | ||
| 2 | - | ||
| 3 | -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() | ||
| 4 | - | ||
| 5 | -def plugins = new Properties() | ||
| 6 | -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') | ||
| 7 | -if (pluginsFile.exists()) { | ||
| 8 | - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } | ||
| 9 | -} | ||
| 10 | - | ||
| 11 | -plugins.each { name, path -> | ||
| 12 | - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() | ||
| 13 | - include ":$name" | ||
| 14 | - project(":$name").projectDir = pluginDirectory | ||
| 15 | -} |
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | -<plist version="1.0"> | ||
| 4 | -<dict> | ||
| 5 | - <key>CFBundleDevelopmentRegion</key> | ||
| 6 | - <string>$(DEVELOPMENT_LANGUAGE)</string> | ||
| 7 | - <key>CFBundleExecutable</key> | ||
| 8 | - <string>App</string> | ||
| 9 | - <key>CFBundleIdentifier</key> | ||
| 10 | - <string>io.flutter.flutter.app</string> | ||
| 11 | - <key>CFBundleInfoDictionaryVersion</key> | ||
| 12 | - <string>6.0</string> | ||
| 13 | - <key>CFBundleName</key> | ||
| 14 | - <string>App</string> | ||
| 15 | - <key>CFBundlePackageType</key> | ||
| 16 | - <string>FMWK</string> | ||
| 17 | - <key>CFBundleShortVersionString</key> | ||
| 18 | - <string>1.0</string> | ||
| 19 | - <key>CFBundleSignature</key> | ||
| 20 | - <string>????</string> | ||
| 21 | - <key>CFBundleVersion</key> | ||
| 22 | - <string>1.0</string> | ||
| 23 | - <key>MinimumOSVersion</key> | ||
| 24 | - <string>8.0</string> | ||
| 25 | -</dict> | ||
| 26 | -</plist> |
example/ios/Flutter/Debug.xcconfig
deleted
100644 → 0
| 1 | -#include "Generated.xcconfig" |
example/ios/Flutter/Release.xcconfig
deleted
100644 → 0
| 1 | -#include "Generated.xcconfig" |
| 1 | -// !$*UTF8*$! | ||
| 2 | -{ | ||
| 3 | - archiveVersion = 1; | ||
| 4 | - classes = { | ||
| 5 | - }; | ||
| 6 | - objectVersion = 46; | ||
| 7 | - objects = { | ||
| 8 | - | ||
| 9 | -/* Begin PBXBuildFile section */ | ||
| 10 | - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; | ||
| 11 | - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; | ||
| 12 | - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; | ||
| 13 | - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; | ||
| 14 | - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; | ||
| 15 | - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; | ||
| 16 | - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; | ||
| 17 | - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; | ||
| 18 | - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; | ||
| 19 | - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; | ||
| 20 | - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; | ||
| 21 | - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; | ||
| 22 | -/* End PBXBuildFile section */ | ||
| 23 | - | ||
| 24 | -/* Begin PBXCopyFilesBuildPhase section */ | ||
| 25 | - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { | ||
| 26 | - isa = PBXCopyFilesBuildPhase; | ||
| 27 | - buildActionMask = 2147483647; | ||
| 28 | - dstPath = ""; | ||
| 29 | - dstSubfolderSpec = 10; | ||
| 30 | - files = ( | ||
| 31 | - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, | ||
| 32 | - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, | ||
| 33 | - ); | ||
| 34 | - name = "Embed Frameworks"; | ||
| 35 | - runOnlyForDeploymentPostprocessing = 0; | ||
| 36 | - }; | ||
| 37 | -/* End PBXCopyFilesBuildPhase section */ | ||
| 38 | - | ||
| 39 | -/* Begin PBXFileReference section */ | ||
| 40 | - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; | ||
| 41 | - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; | ||
| 42 | - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; | ||
| 43 | - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; }; | ||
| 44 | - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; | ||
| 45 | - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; | ||
| 46 | - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; | ||
| 47 | - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; }; | ||
| 48 | - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; }; | ||
| 49 | - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; }; | ||
| 50 | - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; | ||
| 51 | - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; | ||
| 52 | - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; | ||
| 53 | - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; | ||
| 54 | - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; | ||
| 55 | - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; | ||
| 56 | -/* End PBXFileReference section */ | ||
| 57 | - | ||
| 58 | -/* Begin PBXFrameworksBuildPhase section */ | ||
| 59 | - 97C146EB1CF9000F007C117D /* Frameworks */ = { | ||
| 60 | - isa = PBXFrameworksBuildPhase; | ||
| 61 | - buildActionMask = 2147483647; | ||
| 62 | - files = ( | ||
| 63 | - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, | ||
| 64 | - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, | ||
| 65 | - ); | ||
| 66 | - runOnlyForDeploymentPostprocessing = 0; | ||
| 67 | - }; | ||
| 68 | -/* End PBXFrameworksBuildPhase section */ | ||
| 69 | - | ||
| 70 | -/* Begin PBXGroup section */ | ||
| 71 | - 9740EEB11CF90186004384FC /* Flutter */ = { | ||
| 72 | - isa = PBXGroup; | ||
| 73 | - children = ( | ||
| 74 | - 3B80C3931E831B6300D905FE /* App.framework */, | ||
| 75 | - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, | ||
| 76 | - 9740EEBA1CF902C7004384FC /* Flutter.framework */, | ||
| 77 | - 9740EEB21CF90195004384FC /* Debug.xcconfig */, | ||
| 78 | - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, | ||
| 79 | - 9740EEB31CF90195004384FC /* Generated.xcconfig */, | ||
| 80 | - ); | ||
| 81 | - name = Flutter; | ||
| 82 | - sourceTree = "<group>"; | ||
| 83 | - }; | ||
| 84 | - 97C146E51CF9000F007C117D = { | ||
| 85 | - isa = PBXGroup; | ||
| 86 | - children = ( | ||
| 87 | - 9740EEB11CF90186004384FC /* Flutter */, | ||
| 88 | - 97C146F01CF9000F007C117D /* Runner */, | ||
| 89 | - 97C146EF1CF9000F007C117D /* Products */, | ||
| 90 | - CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, | ||
| 91 | - ); | ||
| 92 | - sourceTree = "<group>"; | ||
| 93 | - }; | ||
| 94 | - 97C146EF1CF9000F007C117D /* Products */ = { | ||
| 95 | - isa = PBXGroup; | ||
| 96 | - children = ( | ||
| 97 | - 97C146EE1CF9000F007C117D /* Runner.app */, | ||
| 98 | - ); | ||
| 99 | - name = Products; | ||
| 100 | - sourceTree = "<group>"; | ||
| 101 | - }; | ||
| 102 | - 97C146F01CF9000F007C117D /* Runner */ = { | ||
| 103 | - isa = PBXGroup; | ||
| 104 | - children = ( | ||
| 105 | - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, | ||
| 106 | - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, | ||
| 107 | - 97C146FA1CF9000F007C117D /* Main.storyboard */, | ||
| 108 | - 97C146FD1CF9000F007C117D /* Assets.xcassets */, | ||
| 109 | - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, | ||
| 110 | - 97C147021CF9000F007C117D /* Info.plist */, | ||
| 111 | - 97C146F11CF9000F007C117D /* Supporting Files */, | ||
| 112 | - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, | ||
| 113 | - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, | ||
| 114 | - ); | ||
| 115 | - path = Runner; | ||
| 116 | - sourceTree = "<group>"; | ||
| 117 | - }; | ||
| 118 | - 97C146F11CF9000F007C117D /* Supporting Files */ = { | ||
| 119 | - isa = PBXGroup; | ||
| 120 | - children = ( | ||
| 121 | - 97C146F21CF9000F007C117D /* main.m */, | ||
| 122 | - ); | ||
| 123 | - name = "Supporting Files"; | ||
| 124 | - sourceTree = "<group>"; | ||
| 125 | - }; | ||
| 126 | -/* End PBXGroup section */ | ||
| 127 | - | ||
| 128 | -/* Begin PBXNativeTarget section */ | ||
| 129 | - 97C146ED1CF9000F007C117D /* Runner */ = { | ||
| 130 | - isa = PBXNativeTarget; | ||
| 131 | - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; | ||
| 132 | - buildPhases = ( | ||
| 133 | - 9740EEB61CF901F6004384FC /* Run Script */, | ||
| 134 | - 97C146EA1CF9000F007C117D /* Sources */, | ||
| 135 | - 97C146EB1CF9000F007C117D /* Frameworks */, | ||
| 136 | - 97C146EC1CF9000F007C117D /* Resources */, | ||
| 137 | - 9705A1C41CF9048500538489 /* Embed Frameworks */, | ||
| 138 | - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, | ||
| 139 | - ); | ||
| 140 | - buildRules = ( | ||
| 141 | - ); | ||
| 142 | - dependencies = ( | ||
| 143 | - ); | ||
| 144 | - name = Runner; | ||
| 145 | - productName = Runner; | ||
| 146 | - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; | ||
| 147 | - productType = "com.apple.product-type.application"; | ||
| 148 | - }; | ||
| 149 | -/* End PBXNativeTarget section */ | ||
| 150 | - | ||
| 151 | -/* Begin PBXProject section */ | ||
| 152 | - 97C146E61CF9000F007C117D /* Project object */ = { | ||
| 153 | - isa = PBXProject; | ||
| 154 | - attributes = { | ||
| 155 | - LastUpgradeCheck = 1020; | ||
| 156 | - ORGANIZATIONNAME = "The Chromium Authors"; | ||
| 157 | - TargetAttributes = { | ||
| 158 | - 97C146ED1CF9000F007C117D = { | ||
| 159 | - CreatedOnToolsVersion = 7.3.1; | ||
| 160 | - }; | ||
| 161 | - }; | ||
| 162 | - }; | ||
| 163 | - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; | ||
| 164 | - compatibilityVersion = "Xcode 3.2"; | ||
| 165 | - developmentRegion = en; | ||
| 166 | - hasScannedForEncodings = 0; | ||
| 167 | - knownRegions = ( | ||
| 168 | - en, | ||
| 169 | - Base, | ||
| 170 | - ); | ||
| 171 | - mainGroup = 97C146E51CF9000F007C117D; | ||
| 172 | - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; | ||
| 173 | - projectDirPath = ""; | ||
| 174 | - projectRoot = ""; | ||
| 175 | - targets = ( | ||
| 176 | - 97C146ED1CF9000F007C117D /* Runner */, | ||
| 177 | - ); | ||
| 178 | - }; | ||
| 179 | -/* End PBXProject section */ | ||
| 180 | - | ||
| 181 | -/* Begin PBXResourcesBuildPhase section */ | ||
| 182 | - 97C146EC1CF9000F007C117D /* Resources */ = { | ||
| 183 | - isa = PBXResourcesBuildPhase; | ||
| 184 | - buildActionMask = 2147483647; | ||
| 185 | - files = ( | ||
| 186 | - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, | ||
| 187 | - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, | ||
| 188 | - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, | ||
| 189 | - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, | ||
| 190 | - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, | ||
| 191 | - ); | ||
| 192 | - runOnlyForDeploymentPostprocessing = 0; | ||
| 193 | - }; | ||
| 194 | -/* End PBXResourcesBuildPhase section */ | ||
| 195 | - | ||
| 196 | -/* Begin PBXShellScriptBuildPhase section */ | ||
| 197 | - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { | ||
| 198 | - isa = PBXShellScriptBuildPhase; | ||
| 199 | - buildActionMask = 2147483647; | ||
| 200 | - files = ( | ||
| 201 | - ); | ||
| 202 | - inputPaths = ( | ||
| 203 | - ); | ||
| 204 | - name = "Thin Binary"; | ||
| 205 | - outputPaths = ( | ||
| 206 | - ); | ||
| 207 | - runOnlyForDeploymentPostprocessing = 0; | ||
| 208 | - shellPath = /bin/sh; | ||
| 209 | - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; | ||
| 210 | - }; | ||
| 211 | - 9740EEB61CF901F6004384FC /* Run Script */ = { | ||
| 212 | - isa = PBXShellScriptBuildPhase; | ||
| 213 | - buildActionMask = 2147483647; | ||
| 214 | - files = ( | ||
| 215 | - ); | ||
| 216 | - inputPaths = ( | ||
| 217 | - ); | ||
| 218 | - name = "Run Script"; | ||
| 219 | - outputPaths = ( | ||
| 220 | - ); | ||
| 221 | - runOnlyForDeploymentPostprocessing = 0; | ||
| 222 | - shellPath = /bin/sh; | ||
| 223 | - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; | ||
| 224 | - }; | ||
| 225 | -/* End PBXShellScriptBuildPhase section */ | ||
| 226 | - | ||
| 227 | -/* Begin PBXSourcesBuildPhase section */ | ||
| 228 | - 97C146EA1CF9000F007C117D /* Sources */ = { | ||
| 229 | - isa = PBXSourcesBuildPhase; | ||
| 230 | - buildActionMask = 2147483647; | ||
| 231 | - files = ( | ||
| 232 | - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, | ||
| 233 | - 97C146F31CF9000F007C117D /* main.m in Sources */, | ||
| 234 | - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, | ||
| 235 | - ); | ||
| 236 | - runOnlyForDeploymentPostprocessing = 0; | ||
| 237 | - }; | ||
| 238 | -/* End PBXSourcesBuildPhase section */ | ||
| 239 | - | ||
| 240 | -/* Begin PBXVariantGroup section */ | ||
| 241 | - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { | ||
| 242 | - isa = PBXVariantGroup; | ||
| 243 | - children = ( | ||
| 244 | - 97C146FB1CF9000F007C117D /* Base */, | ||
| 245 | - ); | ||
| 246 | - name = Main.storyboard; | ||
| 247 | - sourceTree = "<group>"; | ||
| 248 | - }; | ||
| 249 | - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { | ||
| 250 | - isa = PBXVariantGroup; | ||
| 251 | - children = ( | ||
| 252 | - 97C147001CF9000F007C117D /* Base */, | ||
| 253 | - ); | ||
| 254 | - name = LaunchScreen.storyboard; | ||
| 255 | - sourceTree = "<group>"; | ||
| 256 | - }; | ||
| 257 | -/* End PBXVariantGroup section */ | ||
| 258 | - | ||
| 259 | -/* Begin XCBuildConfiguration section */ | ||
| 260 | - 249021D3217E4FDB00AE95B9 /* Profile */ = { | ||
| 261 | - isa = XCBuildConfiguration; | ||
| 262 | - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; | ||
| 263 | - buildSettings = { | ||
| 264 | - ALWAYS_SEARCH_USER_PATHS = NO; | ||
| 265 | - CLANG_ANALYZER_NONNULL = YES; | ||
| 266 | - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
| 267 | - CLANG_CXX_LIBRARY = "libc++"; | ||
| 268 | - CLANG_ENABLE_MODULES = YES; | ||
| 269 | - CLANG_ENABLE_OBJC_ARC = YES; | ||
| 270 | - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | ||
| 271 | - CLANG_WARN_BOOL_CONVERSION = YES; | ||
| 272 | - CLANG_WARN_COMMA = YES; | ||
| 273 | - CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
| 274 | - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | ||
| 275 | - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
| 276 | - CLANG_WARN_EMPTY_BODY = YES; | ||
| 277 | - CLANG_WARN_ENUM_CONVERSION = YES; | ||
| 278 | - CLANG_WARN_INFINITE_RECURSION = YES; | ||
| 279 | - CLANG_WARN_INT_CONVERSION = YES; | ||
| 280 | - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | ||
| 281 | - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | ||
| 282 | - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | ||
| 283 | - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
| 284 | - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | ||
| 285 | - CLANG_WARN_STRICT_PROTOTYPES = YES; | ||
| 286 | - CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
| 287 | - CLANG_WARN_UNREACHABLE_CODE = YES; | ||
| 288 | - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| 289 | - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
| 290 | - COPY_PHASE_STRIP = NO; | ||
| 291 | - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; | ||
| 292 | - ENABLE_NS_ASSERTIONS = NO; | ||
| 293 | - ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
| 294 | - GCC_C_LANGUAGE_STANDARD = gnu99; | ||
| 295 | - GCC_NO_COMMON_BLOCKS = YES; | ||
| 296 | - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
| 297 | - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
| 298 | - GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
| 299 | - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| 300 | - GCC_WARN_UNUSED_FUNCTION = YES; | ||
| 301 | - GCC_WARN_UNUSED_VARIABLE = YES; | ||
| 302 | - IPHONEOS_DEPLOYMENT_TARGET = 8.0; | ||
| 303 | - MTL_ENABLE_DEBUG_INFO = NO; | ||
| 304 | - SDKROOT = iphoneos; | ||
| 305 | - TARGETED_DEVICE_FAMILY = "1,2"; | ||
| 306 | - VALIDATE_PRODUCT = YES; | ||
| 307 | - }; | ||
| 308 | - name = Profile; | ||
| 309 | - }; | ||
| 310 | - 249021D4217E4FDB00AE95B9 /* Profile */ = { | ||
| 311 | - isa = XCBuildConfiguration; | ||
| 312 | - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; | ||
| 313 | - buildSettings = { | ||
| 314 | - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| 315 | - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | ||
| 316 | - DEVELOPMENT_TEAM = S8QB4VV633; | ||
| 317 | - ENABLE_BITCODE = NO; | ||
| 318 | - FRAMEWORK_SEARCH_PATHS = ( | ||
| 319 | - "$(inherited)", | ||
| 320 | - "$(PROJECT_DIR)/Flutter", | ||
| 321 | - ); | ||
| 322 | - INFOPLIST_FILE = Runner/Info.plist; | ||
| 323 | - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | ||
| 324 | - LIBRARY_SEARCH_PATHS = ( | ||
| 325 | - "$(inherited)", | ||
| 326 | - "$(PROJECT_DIR)/Flutter", | ||
| 327 | - ); | ||
| 328 | - PRODUCT_BUNDLE_IDENTIFIER = wakelock.wakelockExample; | ||
| 329 | - PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 330 | - VERSIONING_SYSTEM = "apple-generic"; | ||
| 331 | - }; | ||
| 332 | - name = Profile; | ||
| 333 | - }; | ||
| 334 | - 97C147031CF9000F007C117D /* Debug */ = { | ||
| 335 | - isa = XCBuildConfiguration; | ||
| 336 | - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; | ||
| 337 | - buildSettings = { | ||
| 338 | - ALWAYS_SEARCH_USER_PATHS = NO; | ||
| 339 | - CLANG_ANALYZER_NONNULL = YES; | ||
| 340 | - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
| 341 | - CLANG_CXX_LIBRARY = "libc++"; | ||
| 342 | - CLANG_ENABLE_MODULES = YES; | ||
| 343 | - CLANG_ENABLE_OBJC_ARC = YES; | ||
| 344 | - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | ||
| 345 | - CLANG_WARN_BOOL_CONVERSION = YES; | ||
| 346 | - CLANG_WARN_COMMA = YES; | ||
| 347 | - CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
| 348 | - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | ||
| 349 | - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
| 350 | - CLANG_WARN_EMPTY_BODY = YES; | ||
| 351 | - CLANG_WARN_ENUM_CONVERSION = YES; | ||
| 352 | - CLANG_WARN_INFINITE_RECURSION = YES; | ||
| 353 | - CLANG_WARN_INT_CONVERSION = YES; | ||
| 354 | - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | ||
| 355 | - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | ||
| 356 | - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | ||
| 357 | - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
| 358 | - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | ||
| 359 | - CLANG_WARN_STRICT_PROTOTYPES = YES; | ||
| 360 | - CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
| 361 | - CLANG_WARN_UNREACHABLE_CODE = YES; | ||
| 362 | - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| 363 | - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
| 364 | - COPY_PHASE_STRIP = NO; | ||
| 365 | - DEBUG_INFORMATION_FORMAT = dwarf; | ||
| 366 | - ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
| 367 | - ENABLE_TESTABILITY = YES; | ||
| 368 | - GCC_C_LANGUAGE_STANDARD = gnu99; | ||
| 369 | - GCC_DYNAMIC_NO_PIC = NO; | ||
| 370 | - GCC_NO_COMMON_BLOCKS = YES; | ||
| 371 | - GCC_OPTIMIZATION_LEVEL = 0; | ||
| 372 | - GCC_PREPROCESSOR_DEFINITIONS = ( | ||
| 373 | - "DEBUG=1", | ||
| 374 | - "$(inherited)", | ||
| 375 | - ); | ||
| 376 | - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
| 377 | - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
| 378 | - GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
| 379 | - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| 380 | - GCC_WARN_UNUSED_FUNCTION = YES; | ||
| 381 | - GCC_WARN_UNUSED_VARIABLE = YES; | ||
| 382 | - IPHONEOS_DEPLOYMENT_TARGET = 8.0; | ||
| 383 | - MTL_ENABLE_DEBUG_INFO = YES; | ||
| 384 | - ONLY_ACTIVE_ARCH = YES; | ||
| 385 | - SDKROOT = iphoneos; | ||
| 386 | - TARGETED_DEVICE_FAMILY = "1,2"; | ||
| 387 | - }; | ||
| 388 | - name = Debug; | ||
| 389 | - }; | ||
| 390 | - 97C147041CF9000F007C117D /* Release */ = { | ||
| 391 | - isa = XCBuildConfiguration; | ||
| 392 | - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; | ||
| 393 | - buildSettings = { | ||
| 394 | - ALWAYS_SEARCH_USER_PATHS = NO; | ||
| 395 | - CLANG_ANALYZER_NONNULL = YES; | ||
| 396 | - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; | ||
| 397 | - CLANG_CXX_LIBRARY = "libc++"; | ||
| 398 | - CLANG_ENABLE_MODULES = YES; | ||
| 399 | - CLANG_ENABLE_OBJC_ARC = YES; | ||
| 400 | - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; | ||
| 401 | - CLANG_WARN_BOOL_CONVERSION = YES; | ||
| 402 | - CLANG_WARN_COMMA = YES; | ||
| 403 | - CLANG_WARN_CONSTANT_CONVERSION = YES; | ||
| 404 | - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; | ||
| 405 | - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; | ||
| 406 | - CLANG_WARN_EMPTY_BODY = YES; | ||
| 407 | - CLANG_WARN_ENUM_CONVERSION = YES; | ||
| 408 | - CLANG_WARN_INFINITE_RECURSION = YES; | ||
| 409 | - CLANG_WARN_INT_CONVERSION = YES; | ||
| 410 | - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; | ||
| 411 | - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; | ||
| 412 | - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; | ||
| 413 | - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; | ||
| 414 | - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; | ||
| 415 | - CLANG_WARN_STRICT_PROTOTYPES = YES; | ||
| 416 | - CLANG_WARN_SUSPICIOUS_MOVE = YES; | ||
| 417 | - CLANG_WARN_UNREACHABLE_CODE = YES; | ||
| 418 | - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| 419 | - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; | ||
| 420 | - COPY_PHASE_STRIP = NO; | ||
| 421 | - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; | ||
| 422 | - ENABLE_NS_ASSERTIONS = NO; | ||
| 423 | - ENABLE_STRICT_OBJC_MSGSEND = YES; | ||
| 424 | - GCC_C_LANGUAGE_STANDARD = gnu99; | ||
| 425 | - GCC_NO_COMMON_BLOCKS = YES; | ||
| 426 | - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; | ||
| 427 | - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; | ||
| 428 | - GCC_WARN_UNDECLARED_SELECTOR = YES; | ||
| 429 | - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; | ||
| 430 | - GCC_WARN_UNUSED_FUNCTION = YES; | ||
| 431 | - GCC_WARN_UNUSED_VARIABLE = YES; | ||
| 432 | - IPHONEOS_DEPLOYMENT_TARGET = 8.0; | ||
| 433 | - MTL_ENABLE_DEBUG_INFO = NO; | ||
| 434 | - SDKROOT = iphoneos; | ||
| 435 | - TARGETED_DEVICE_FAMILY = "1,2"; | ||
| 436 | - VALIDATE_PRODUCT = YES; | ||
| 437 | - }; | ||
| 438 | - name = Release; | ||
| 439 | - }; | ||
| 440 | - 97C147061CF9000F007C117D /* Debug */ = { | ||
| 441 | - isa = XCBuildConfiguration; | ||
| 442 | - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; | ||
| 443 | - buildSettings = { | ||
| 444 | - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| 445 | - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | ||
| 446 | - ENABLE_BITCODE = NO; | ||
| 447 | - FRAMEWORK_SEARCH_PATHS = ( | ||
| 448 | - "$(inherited)", | ||
| 449 | - "$(PROJECT_DIR)/Flutter", | ||
| 450 | - ); | ||
| 451 | - INFOPLIST_FILE = Runner/Info.plist; | ||
| 452 | - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | ||
| 453 | - LIBRARY_SEARCH_PATHS = ( | ||
| 454 | - "$(inherited)", | ||
| 455 | - "$(PROJECT_DIR)/Flutter", | ||
| 456 | - ); | ||
| 457 | - PRODUCT_BUNDLE_IDENTIFIER = wakelock.wakelockExample; | ||
| 458 | - PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 459 | - VERSIONING_SYSTEM = "apple-generic"; | ||
| 460 | - }; | ||
| 461 | - name = Debug; | ||
| 462 | - }; | ||
| 463 | - 97C147071CF9000F007C117D /* Release */ = { | ||
| 464 | - isa = XCBuildConfiguration; | ||
| 465 | - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; | ||
| 466 | - buildSettings = { | ||
| 467 | - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| 468 | - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; | ||
| 469 | - ENABLE_BITCODE = NO; | ||
| 470 | - FRAMEWORK_SEARCH_PATHS = ( | ||
| 471 | - "$(inherited)", | ||
| 472 | - "$(PROJECT_DIR)/Flutter", | ||
| 473 | - ); | ||
| 474 | - INFOPLIST_FILE = Runner/Info.plist; | ||
| 475 | - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; | ||
| 476 | - LIBRARY_SEARCH_PATHS = ( | ||
| 477 | - "$(inherited)", | ||
| 478 | - "$(PROJECT_DIR)/Flutter", | ||
| 479 | - ); | ||
| 480 | - PRODUCT_BUNDLE_IDENTIFIER = wakelock.wakelockExample; | ||
| 481 | - PRODUCT_NAME = "$(TARGET_NAME)"; | ||
| 482 | - VERSIONING_SYSTEM = "apple-generic"; | ||
| 483 | - }; | ||
| 484 | - name = Release; | ||
| 485 | - }; | ||
| 486 | -/* End XCBuildConfiguration section */ | ||
| 487 | - | ||
| 488 | -/* Begin XCConfigurationList section */ | ||
| 489 | - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { | ||
| 490 | - isa = XCConfigurationList; | ||
| 491 | - buildConfigurations = ( | ||
| 492 | - 97C147031CF9000F007C117D /* Debug */, | ||
| 493 | - 97C147041CF9000F007C117D /* Release */, | ||
| 494 | - 249021D3217E4FDB00AE95B9 /* Profile */, | ||
| 495 | - ); | ||
| 496 | - defaultConfigurationIsVisible = 0; | ||
| 497 | - defaultConfigurationName = Release; | ||
| 498 | - }; | ||
| 499 | - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { | ||
| 500 | - isa = XCConfigurationList; | ||
| 501 | - buildConfigurations = ( | ||
| 502 | - 97C147061CF9000F007C117D /* Debug */, | ||
| 503 | - 97C147071CF9000F007C117D /* Release */, | ||
| 504 | - 249021D4217E4FDB00AE95B9 /* Profile */, | ||
| 505 | - ); | ||
| 506 | - defaultConfigurationIsVisible = 0; | ||
| 507 | - defaultConfigurationName = Release; | ||
| 508 | - }; | ||
| 509 | -/* End XCConfigurationList section */ | ||
| 510 | - }; | ||
| 511 | - rootObject = 97C146E61CF9000F007C117D /* Project object */; | ||
| 512 | -} |
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<Scheme | ||
| 3 | - LastUpgradeVersion = "1020" | ||
| 4 | - version = "1.3"> | ||
| 5 | - <BuildAction | ||
| 6 | - parallelizeBuildables = "YES" | ||
| 7 | - buildImplicitDependencies = "YES"> | ||
| 8 | - <BuildActionEntries> | ||
| 9 | - <BuildActionEntry | ||
| 10 | - buildForTesting = "YES" | ||
| 11 | - buildForRunning = "YES" | ||
| 12 | - buildForProfiling = "YES" | ||
| 13 | - buildForArchiving = "YES" | ||
| 14 | - buildForAnalyzing = "YES"> | ||
| 15 | - <BuildableReference | ||
| 16 | - BuildableIdentifier = "primary" | ||
| 17 | - BlueprintIdentifier = "97C146ED1CF9000F007C117D" | ||
| 18 | - BuildableName = "Runner.app" | ||
| 19 | - BlueprintName = "Runner" | ||
| 20 | - ReferencedContainer = "container:Runner.xcodeproj"> | ||
| 21 | - </BuildableReference> | ||
| 22 | - </BuildActionEntry> | ||
| 23 | - </BuildActionEntries> | ||
| 24 | - </BuildAction> | ||
| 25 | - <TestAction | ||
| 26 | - buildConfiguration = "Debug" | ||
| 27 | - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| 28 | - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| 29 | - shouldUseLaunchSchemeArgsEnv = "YES"> | ||
| 30 | - <Testables> | ||
| 31 | - </Testables> | ||
| 32 | - <MacroExpansion> | ||
| 33 | - <BuildableReference | ||
| 34 | - BuildableIdentifier = "primary" | ||
| 35 | - BlueprintIdentifier = "97C146ED1CF9000F007C117D" | ||
| 36 | - BuildableName = "Runner.app" | ||
| 37 | - BlueprintName = "Runner" | ||
| 38 | - ReferencedContainer = "container:Runner.xcodeproj"> | ||
| 39 | - </BuildableReference> | ||
| 40 | - </MacroExpansion> | ||
| 41 | - <AdditionalOptions> | ||
| 42 | - </AdditionalOptions> | ||
| 43 | - </TestAction> | ||
| 44 | - <LaunchAction | ||
| 45 | - buildConfiguration = "Debug" | ||
| 46 | - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
| 47 | - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
| 48 | - launchStyle = "0" | ||
| 49 | - useCustomWorkingDirectory = "NO" | ||
| 50 | - ignoresPersistentStateOnLaunch = "NO" | ||
| 51 | - debugDocumentVersioning = "YES" | ||
| 52 | - debugServiceExtension = "internal" | ||
| 53 | - allowLocationSimulation = "YES"> | ||
| 54 | - <BuildableProductRunnable | ||
| 55 | - runnableDebuggingMode = "0"> | ||
| 56 | - <BuildableReference | ||
| 57 | - BuildableIdentifier = "primary" | ||
| 58 | - BlueprintIdentifier = "97C146ED1CF9000F007C117D" | ||
| 59 | - BuildableName = "Runner.app" | ||
| 60 | - BlueprintName = "Runner" | ||
| 61 | - ReferencedContainer = "container:Runner.xcodeproj"> | ||
| 62 | - </BuildableReference> | ||
| 63 | - </BuildableProductRunnable> | ||
| 64 | - <AdditionalOptions> | ||
| 65 | - </AdditionalOptions> | ||
| 66 | - </LaunchAction> | ||
| 67 | - <ProfileAction | ||
| 68 | - buildConfiguration = "Profile" | ||
| 69 | - shouldUseLaunchSchemeArgsEnv = "YES" | ||
| 70 | - savedToolIdentifier = "" | ||
| 71 | - useCustomWorkingDirectory = "NO" | ||
| 72 | - debugDocumentVersioning = "YES"> | ||
| 73 | - <BuildableProductRunnable | ||
| 74 | - runnableDebuggingMode = "0"> | ||
| 75 | - <BuildableReference | ||
| 76 | - BuildableIdentifier = "primary" | ||
| 77 | - BlueprintIdentifier = "97C146ED1CF9000F007C117D" | ||
| 78 | - BuildableName = "Runner.app" | ||
| 79 | - BlueprintName = "Runner" | ||
| 80 | - ReferencedContainer = "container:Runner.xcodeproj"> | ||
| 81 | - </BuildableReference> | ||
| 82 | - </BuildableProductRunnable> | ||
| 83 | - </ProfileAction> | ||
| 84 | - <AnalyzeAction | ||
| 85 | - buildConfiguration = "Debug"> | ||
| 86 | - </AnalyzeAction> | ||
| 87 | - <ArchiveAction | ||
| 88 | - buildConfiguration = "Release" | ||
| 89 | - revealArchiveInOrganizer = "YES"> | ||
| 90 | - </ArchiveAction> | ||
| 91 | -</Scheme> |
example/ios/Runner/AppDelegate.h
deleted
100644 → 0
example/ios/Runner/AppDelegate.m
deleted
100644 → 0
| 1 | -#include "AppDelegate.h" | ||
| 2 | -#include "GeneratedPluginRegistrant.h" | ||
| 3 | - | ||
| 4 | -@implementation AppDelegate | ||
| 5 | - | ||
| 6 | -- (BOOL)application:(UIApplication *)application | ||
| 7 | - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | ||
| 8 | - [GeneratedPluginRegistrant registerWithRegistry:self]; | ||
| 9 | - // Override point for customization after application launch. | ||
| 10 | - return [super application:application didFinishLaunchingWithOptions:launchOptions]; | ||
| 11 | -} | ||
| 12 | - | ||
| 13 | -@end |
| 1 | -{ | ||
| 2 | - "images" : [ | ||
| 3 | - { | ||
| 4 | - "size" : "20x20", | ||
| 5 | - "idiom" : "iphone", | ||
| 6 | - "filename" : "Icon-App-20x20@2x.png", | ||
| 7 | - "scale" : "2x" | ||
| 8 | - }, | ||
| 9 | - { | ||
| 10 | - "size" : "20x20", | ||
| 11 | - "idiom" : "iphone", | ||
| 12 | - "filename" : "Icon-App-20x20@3x.png", | ||
| 13 | - "scale" : "3x" | ||
| 14 | - }, | ||
| 15 | - { | ||
| 16 | - "size" : "29x29", | ||
| 17 | - "idiom" : "iphone", | ||
| 18 | - "filename" : "Icon-App-29x29@1x.png", | ||
| 19 | - "scale" : "1x" | ||
| 20 | - }, | ||
| 21 | - { | ||
| 22 | - "size" : "29x29", | ||
| 23 | - "idiom" : "iphone", | ||
| 24 | - "filename" : "Icon-App-29x29@2x.png", | ||
| 25 | - "scale" : "2x" | ||
| 26 | - }, | ||
| 27 | - { | ||
| 28 | - "size" : "29x29", | ||
| 29 | - "idiom" : "iphone", | ||
| 30 | - "filename" : "Icon-App-29x29@3x.png", | ||
| 31 | - "scale" : "3x" | ||
| 32 | - }, | ||
| 33 | - { | ||
| 34 | - "size" : "40x40", | ||
| 35 | - "idiom" : "iphone", | ||
| 36 | - "filename" : "Icon-App-40x40@2x.png", | ||
| 37 | - "scale" : "2x" | ||
| 38 | - }, | ||
| 39 | - { | ||
| 40 | - "size" : "40x40", | ||
| 41 | - "idiom" : "iphone", | ||
| 42 | - "filename" : "Icon-App-40x40@3x.png", | ||
| 43 | - "scale" : "3x" | ||
| 44 | - }, | ||
| 45 | - { | ||
| 46 | - "size" : "60x60", | ||
| 47 | - "idiom" : "iphone", | ||
| 48 | - "filename" : "Icon-App-60x60@2x.png", | ||
| 49 | - "scale" : "2x" | ||
| 50 | - }, | ||
| 51 | - { | ||
| 52 | - "size" : "60x60", | ||
| 53 | - "idiom" : "iphone", | ||
| 54 | - "filename" : "Icon-App-60x60@3x.png", | ||
| 55 | - "scale" : "3x" | ||
| 56 | - }, | ||
| 57 | - { | ||
| 58 | - "size" : "20x20", | ||
| 59 | - "idiom" : "ipad", | ||
| 60 | - "filename" : "Icon-App-20x20@1x.png", | ||
| 61 | - "scale" : "1x" | ||
| 62 | - }, | ||
| 63 | - { | ||
| 64 | - "size" : "20x20", | ||
| 65 | - "idiom" : "ipad", | ||
| 66 | - "filename" : "Icon-App-20x20@2x.png", | ||
| 67 | - "scale" : "2x" | ||
| 68 | - }, | ||
| 69 | - { | ||
| 70 | - "size" : "29x29", | ||
| 71 | - "idiom" : "ipad", | ||
| 72 | - "filename" : "Icon-App-29x29@1x.png", | ||
| 73 | - "scale" : "1x" | ||
| 74 | - }, | ||
| 75 | - { | ||
| 76 | - "size" : "29x29", | ||
| 77 | - "idiom" : "ipad", | ||
| 78 | - "filename" : "Icon-App-29x29@2x.png", | ||
| 79 | - "scale" : "2x" | ||
| 80 | - }, | ||
| 81 | - { | ||
| 82 | - "size" : "40x40", | ||
| 83 | - "idiom" : "ipad", | ||
| 84 | - "filename" : "Icon-App-40x40@1x.png", | ||
| 85 | - "scale" : "1x" | ||
| 86 | - }, | ||
| 87 | - { | ||
| 88 | - "size" : "40x40", | ||
| 89 | - "idiom" : "ipad", | ||
| 90 | - "filename" : "Icon-App-40x40@2x.png", | ||
| 91 | - "scale" : "2x" | ||
| 92 | - }, | ||
| 93 | - { | ||
| 94 | - "size" : "76x76", | ||
| 95 | - "idiom" : "ipad", | ||
| 96 | - "filename" : "Icon-App-76x76@1x.png", | ||
| 97 | - "scale" : "1x" | ||
| 98 | - }, | ||
| 99 | - { | ||
| 100 | - "size" : "76x76", | ||
| 101 | - "idiom" : "ipad", | ||
| 102 | - "filename" : "Icon-App-76x76@2x.png", | ||
| 103 | - "scale" : "2x" | ||
| 104 | - }, | ||
| 105 | - { | ||
| 106 | - "size" : "83.5x83.5", | ||
| 107 | - "idiom" : "ipad", | ||
| 108 | - "filename" : "Icon-App-83.5x83.5@2x.png", | ||
| 109 | - "scale" : "2x" | ||
| 110 | - }, | ||
| 111 | - { | ||
| 112 | - "size" : "1024x1024", | ||
| 113 | - "idiom" : "ios-marketing", | ||
| 114 | - "filename" : "Icon-App-1024x1024@1x.png", | ||
| 115 | - "scale" : "1x" | ||
| 116 | - } | ||
| 117 | - ], | ||
| 118 | - "info" : { | ||
| 119 | - "version" : 1, | ||
| 120 | - "author" : "xcode" | ||
| 121 | - } | ||
| 122 | -} |
10.9 KB
564 Bytes
1.25 KB
1.55 KB
1.68 KB
1.88 KB
1.25 KB
1.85 KB
2.6 KB
2.6 KB
3.74 KB
1.84 KB
3.22 KB
3.53 KB
| 1 | -{ | ||
| 2 | - "images" : [ | ||
| 3 | - { | ||
| 4 | - "idiom" : "universal", | ||
| 5 | - "filename" : "LaunchImage.png", | ||
| 6 | - "scale" : "1x" | ||
| 7 | - }, | ||
| 8 | - { | ||
| 9 | - "idiom" : "universal", | ||
| 10 | - "filename" : "LaunchImage@2x.png", | ||
| 11 | - "scale" : "2x" | ||
| 12 | - }, | ||
| 13 | - { | ||
| 14 | - "idiom" : "universal", | ||
| 15 | - "filename" : "LaunchImage@3x.png", | ||
| 16 | - "scale" : "3x" | ||
| 17 | - } | ||
| 18 | - ], | ||
| 19 | - "info" : { | ||
| 20 | - "version" : 1, | ||
| 21 | - "author" : "xcode" | ||
| 22 | - } | ||
| 23 | -} |
68 Bytes
68 Bytes
68 Bytes
| 1 | -# Launch Screen Assets | ||
| 2 | - | ||
| 3 | -You can customize the launch screen with your own desired assets by replacing the image files in this directory. | ||
| 4 | - | ||
| 5 | -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. |
| 1 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | ||
| 3 | - <dependencies> | ||
| 4 | - <deployment identifier="iOS"/> | ||
| 5 | - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/> | ||
| 6 | - </dependencies> | ||
| 7 | - <scenes> | ||
| 8 | - <!--View Controller--> | ||
| 9 | - <scene sceneID="EHf-IW-A2E"> | ||
| 10 | - <objects> | ||
| 11 | - <viewController id="01J-lp-oVM" sceneMemberID="viewController"> | ||
| 12 | - <layoutGuides> | ||
| 13 | - <viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/> | ||
| 14 | - <viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/> | ||
| 15 | - </layoutGuides> | ||
| 16 | - <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | ||
| 17 | - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| 18 | - <subviews> | ||
| 19 | - <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4"> | ||
| 20 | - </imageView> | ||
| 21 | - </subviews> | ||
| 22 | - <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> | ||
| 23 | - <constraints> | ||
| 24 | - <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/> | ||
| 25 | - <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/> | ||
| 26 | - </constraints> | ||
| 27 | - </view> | ||
| 28 | - </viewController> | ||
| 29 | - <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
| 30 | - </objects> | ||
| 31 | - <point key="canvasLocation" x="53" y="375"/> | ||
| 32 | - </scene> | ||
| 33 | - </scenes> | ||
| 34 | - <resources> | ||
| 35 | - <image name="LaunchImage" width="168" height="185"/> | ||
| 36 | - </resources> | ||
| 37 | -</document> |
| 1 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> | ||
| 3 | - <dependencies> | ||
| 4 | - <deployment identifier="iOS"/> | ||
| 5 | - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> | ||
| 6 | - </dependencies> | ||
| 7 | - <scenes> | ||
| 8 | - <!--Flutter View Controller--> | ||
| 9 | - <scene sceneID="tne-QT-ifu"> | ||
| 10 | - <objects> | ||
| 11 | - <viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController"> | ||
| 12 | - <layoutGuides> | ||
| 13 | - <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> | ||
| 14 | - <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> | ||
| 15 | - </layoutGuides> | ||
| 16 | - <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> | ||
| 17 | - <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> | ||
| 18 | - <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
| 19 | - <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> | ||
| 20 | - </view> | ||
| 21 | - </viewController> | ||
| 22 | - <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> | ||
| 23 | - </objects> | ||
| 24 | - </scene> | ||
| 25 | - </scenes> | ||
| 26 | -</document> |
example/ios/Runner/Info.plist
deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | -<plist version="1.0"> | ||
| 4 | -<dict> | ||
| 5 | - <key>CFBundleDevelopmentRegion</key> | ||
| 6 | - <string>$(DEVELOPMENT_LANGUAGE)</string> | ||
| 7 | - <key>CFBundleExecutable</key> | ||
| 8 | - <string>$(EXECUTABLE_NAME)</string> | ||
| 9 | - <key>CFBundleIdentifier</key> | ||
| 10 | - <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
| 11 | - <key>CFBundleInfoDictionaryVersion</key> | ||
| 12 | - <string>6.0</string> | ||
| 13 | - <key>CFBundleName</key> | ||
| 14 | - <string>wakelock_example</string> | ||
| 15 | - <key>CFBundlePackageType</key> | ||
| 16 | - <string>APPL</string> | ||
| 17 | - <key>CFBundleShortVersionString</key> | ||
| 18 | - <string>$(FLUTTER_BUILD_NAME)</string> | ||
| 19 | - <key>CFBundleSignature</key> | ||
| 20 | - <string>????</string> | ||
| 21 | - <key>CFBundleVersion</key> | ||
| 22 | - <string>$(FLUTTER_BUILD_NUMBER)</string> | ||
| 23 | - <key>LSRequiresIPhoneOS</key> | ||
| 24 | - <true/> | ||
| 25 | - <key>UILaunchStoryboardName</key> | ||
| 26 | - <string>LaunchScreen</string> | ||
| 27 | - <key>UIMainStoryboardFile</key> | ||
| 28 | - <string>Main</string> | ||
| 29 | - <key>UISupportedInterfaceOrientations</key> | ||
| 30 | - <array> | ||
| 31 | - <string>UIInterfaceOrientationPortrait</string> | ||
| 32 | - <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| 33 | - <string>UIInterfaceOrientationLandscapeRight</string> | ||
| 34 | - </array> | ||
| 35 | - <key>UISupportedInterfaceOrientations~ipad</key> | ||
| 36 | - <array> | ||
| 37 | - <string>UIInterfaceOrientationPortrait</string> | ||
| 38 | - <string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
| 39 | - <string>UIInterfaceOrientationLandscapeLeft</string> | ||
| 40 | - <string>UIInterfaceOrientationLandscapeRight</string> | ||
| 41 | - </array> | ||
| 42 | - <key>UIViewControllerBasedStatusBarAppearance</key> | ||
| 43 | - <false/> | ||
| 44 | -</dict> | ||
| 45 | -</plist> |
example/ios/Runner/main.m
deleted
100644 → 0
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | import 'package:wakelock/wakelock.dart'; | 2 | import 'package:wakelock/wakelock.dart'; |
| 3 | 3 | ||
| 4 | -void main() => runApp(MyApp()); | 4 | +void main() { |
| 5 | + runApp(ExampleApp()); | ||
| 6 | +} | ||
| 5 | 7 | ||
| 6 | /// The wakelock implementation is located inside the [FlatButton.onPressed] functions and a [FutureBuilder]. | 8 | /// The wakelock implementation is located inside the [FlatButton.onPressed] functions and a [FutureBuilder]. |
| 7 | -/// The [FlatButton]'s and the [FutureBuilder] sit inside the [Column] that is a child of the [Scaffold] in [_MyAppState]. | ||
| 8 | -class MyApp extends StatefulWidget { | ||
| 9 | - const MyApp({Key key}) : super(key: key); | 9 | +/// The [FlatButton]'s and the [FutureBuilder] sit inside the [Column] that is a child of the [Scaffold] in [_ExampleAppState]. |
| 10 | +class ExampleApp extends StatefulWidget { | ||
| 11 | + const ExampleApp({Key key}) : super(key: key); | ||
| 10 | 12 | ||
| 11 | @override | 13 | @override |
| 12 | - _MyAppState createState() => _MyAppState(); | 14 | + _ExampleAppState createState() => _ExampleAppState(); |
| 13 | } | 15 | } |
| 14 | 16 | ||
| 15 | -class _MyAppState extends State<MyApp> { | 17 | +class _ExampleAppState extends State<ExampleApp> { |
| 16 | @override | 18 | @override |
| 17 | - Widget build(BuildContext context) => MaterialApp( | ||
| 18 | - home: Scaffold( | ||
| 19 | - body: Center( | ||
| 20 | - child: Column( | ||
| 21 | - mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
| 22 | - children: <Widget>[ | ||
| 23 | - FlatButton( | ||
| 24 | - child: const Text('enable wakelock'), | ||
| 25 | - onPressed: () { | ||
| 26 | - // The following code will enable the wakelock on Android or iOS using the wakelock plugin. | ||
| 27 | - setState(() { | ||
| 28 | - Wakelock.enable(); | ||
| 29 | - // You could also use Wakelock.toggle(on: true); | ||
| 30 | - }); | ||
| 31 | - }, | ||
| 32 | - ), | ||
| 33 | - FlatButton( | ||
| 34 | - child: const Text('disable wakelock'), | ||
| 35 | - onPressed: () { | ||
| 36 | - // The following code will disable the wakelock on Android or iOS using the wakelock plugin. | ||
| 37 | - setState(() { | ||
| 38 | - Wakelock.disable(); | ||
| 39 | - // You could also use Wakelock.toggle(on: false); | ||
| 40 | - }); | ||
| 41 | - }, | ||
| 42 | - ), | ||
| 43 | - FutureBuilder( | ||
| 44 | - future: Wakelock.isEnabled, | ||
| 45 | - builder: (context, AsyncSnapshot<bool> snapshot) { | ||
| 46 | - // The use of FutureBuilder is necessary here to await the bool value from isEnabled. | ||
| 47 | - if (!snapshot.hasData) | ||
| 48 | - return Container(); // The Future is retrieved so fast that you will not be able to see any loading indicator. | ||
| 49 | - return Text( | ||
| 50 | - 'wakelock is currently ${snapshot.data ? 'enabled' : 'disabled'}'); | ||
| 51 | - }, | ||
| 52 | - ) | ||
| 53 | - ])))); | 19 | + Widget build(BuildContext context) { |
| 20 | + return MaterialApp( | ||
| 21 | + home: Scaffold( | ||
| 22 | + body: Center( | ||
| 23 | + child: Column( | ||
| 24 | + mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
| 25 | + children: <Widget>[ | ||
| 26 | + FlatButton( | ||
| 27 | + onPressed: () { | ||
| 28 | + // The following code will enable the wakelock on Android or iOS using the wakelock plugin. | ||
| 29 | + setState(() { | ||
| 30 | + Wakelock.enable(); | ||
| 31 | + // You could also use Wakelock.toggle(on: true); | ||
| 32 | + }); | ||
| 33 | + }, | ||
| 34 | + child: const Text('enable wakelock'), | ||
| 35 | + ), | ||
| 36 | + FlatButton( | ||
| 37 | + onPressed: () { | ||
| 38 | + // The following code will disable the wakelock on Android or iOS using the wakelock plugin. | ||
| 39 | + setState(() { | ||
| 40 | + Wakelock.disable(); | ||
| 41 | + // You could also use Wakelock.toggle(on: false); | ||
| 42 | + }); | ||
| 43 | + }, | ||
| 44 | + child: const Text('disable wakelock'), | ||
| 45 | + ), | ||
| 46 | + FutureBuilder( | ||
| 47 | + future: Wakelock.isEnabled, | ||
| 48 | + builder: (context, AsyncSnapshot<bool> snapshot) { | ||
| 49 | + // The use of FutureBuilder is necessary here to await the bool value from isEnabled. | ||
| 50 | + if (!snapshot.hasData) | ||
| 51 | + return Container(); // The Future is retrieved so fast that you will not be able to see any loading indicator. | ||
| 52 | + return Text( | ||
| 53 | + 'wakelock is currently ${snapshot.data ? 'enabled' : 'disabled'}'); | ||
| 54 | + }, | ||
| 55 | + ), | ||
| 56 | + ], | ||
| 57 | + ), | ||
| 58 | + ), | ||
| 59 | + ), | ||
| 60 | + ); | ||
| 61 | + } | ||
| 54 | } | 62 | } |
| @@ -3,19 +3,21 @@ description: Demonstrates how to use the wakelock plugin and is used for integra | @@ -3,19 +3,21 @@ description: Demonstrates how to use the wakelock plugin and is used for integra | ||
| 3 | publish_to: 'none' | 3 | publish_to: 'none' |
| 4 | 4 | ||
| 5 | environment: | 5 | environment: |
| 6 | - sdk: ">=2.1.0 <3.0.0" | 6 | + sdk: ">=2.7.0 <3.0.0" |
| 7 | 7 | ||
| 8 | dependencies: | 8 | dependencies: |
| 9 | flutter: | 9 | flutter: |
| 10 | sdk: flutter | 10 | sdk: flutter |
| 11 | 11 | ||
| 12 | dev_dependencies: | 12 | dev_dependencies: |
| 13 | + pedantic: 1.9.0 | ||
| 14 | + | ||
| 13 | wakelock: | 15 | wakelock: |
| 14 | path: ../ | 16 | path: ../ |
| 15 | 17 | ||
| 16 | flutter_driver: | 18 | flutter_driver: |
| 17 | sdk: flutter | 19 | sdk: flutter |
| 18 | - test: | 20 | + test: # This is equivalent to any. |
| 19 | 21 | ||
| 20 | -flutter: | ||
| 21 | - uses-material-design: true | 22 | +dependency_overrides: |
| 23 | + pedantic: 1.9.0 |
| @@ -3,39 +3,36 @@ import 'dart:async'; | @@ -3,39 +3,36 @@ import 'dart:async'; | ||
| 3 | import 'package:flutter_driver/driver_extension.dart'; | 3 | import 'package:flutter_driver/driver_extension.dart'; |
| 4 | import 'package:test/test.dart'; | 4 | import 'package:test/test.dart'; |
| 5 | import 'package:wakelock/wakelock.dart'; | 5 | import 'package:wakelock/wakelock.dart'; |
| 6 | +import 'package:wakelock_example/main.dart' as example; | ||
| 6 | 7 | ||
| 7 | void main() { | 8 | void main() { |
| 8 | - final Completer<String> completer = Completer(); | ||
| 9 | - enableFlutterDriverExtension(handler: (_) => completer.future); | ||
| 10 | - tearDownAll(() => completer.complete(null)); | 9 | + final completer = Completer<String>(); |
| 10 | + enableFlutterDriverExtension(handler: (message) => completer.future); | ||
| 11 | + // The example app tests need this. | ||
| 12 | + example.main(); | ||
| 11 | 13 | ||
| 12 | - group('wakelock', () { | ||
| 13 | - test('is disabled at start', () async { | ||
| 14 | - expect(await Wakelock.isEnabled, false); | ||
| 15 | - }); | ||
| 16 | - | ||
| 17 | - test('enable', () async { | ||
| 18 | - await Wakelock.enable(); | 14 | + var result = 'success'; |
| 19 | 15 | ||
| 20 | - expect(await Wakelock.isEnabled, true); | ||
| 21 | - }); | 16 | + final _expect = (dynamic value, Matcher matcher) { |
| 17 | + if (!matcher.matches(value, null)) { | ||
| 18 | + result = 'failure'; | ||
| 19 | + } | ||
| 20 | + expect(value, matcher); | ||
| 21 | + }; | ||
| 22 | 22 | ||
| 23 | - test('disable', () async { | ||
| 24 | - await Wakelock.disable(); | ||
| 25 | - | ||
| 26 | - expect(await Wakelock.isEnabled, false); | ||
| 27 | - }); | 23 | + group('wakelock bare platform testing', () { |
| 24 | + tearDownAll(() => completer.complete(result)); | ||
| 28 | 25 | ||
| 29 | - test('enable with toggle', () async { | 26 | + test('toggle on', () async { |
| 30 | await Wakelock.toggle(on: true); | 27 | await Wakelock.toggle(on: true); |
| 31 | 28 | ||
| 32 | - expect(await Wakelock.isEnabled, true); | 29 | + _expect(await Wakelock.isEnabled, isTrue); |
| 33 | }); | 30 | }); |
| 34 | 31 | ||
| 35 | - test('disable with toggle', () async { | 32 | + test('toggle off', () async { |
| 36 | await Wakelock.toggle(on: false); | 33 | await Wakelock.toggle(on: false); |
| 37 | 34 | ||
| 38 | - expect(await Wakelock.isEnabled, false); | 35 | + _expect(await Wakelock.isEnabled, isFalse); |
| 39 | }); | 36 | }); |
| 40 | }); | 37 | }); |
| 41 | } | 38 | } |
| 1 | import 'package:flutter_driver/flutter_driver.dart'; | 1 | import 'package:flutter_driver/flutter_driver.dart'; |
| 2 | +import 'package:test/test.dart'; | ||
| 2 | 3 | ||
| 3 | void main() async { | 4 | void main() async { |
| 4 | - final FlutterDriver driver = await FlutterDriver.connect(); | ||
| 5 | - await driver.requestData(null, timeout: const Duration(minutes: 1)); | ||
| 6 | - driver.close(); | 5 | + FlutterDriver driver; |
| 6 | + String bareTestingResult; | ||
| 7 | + | ||
| 8 | + setUpAll(() async { | ||
| 9 | + driver = await FlutterDriver.connect(); | ||
| 10 | + bareTestingResult = | ||
| 11 | + await driver.requestData('', timeout: const Duration(minutes: 1)); | ||
| 12 | + }); | ||
| 13 | + | ||
| 14 | + tearDownAll(() => driver?.close()); | ||
| 15 | + | ||
| 16 | + group('example app', () { | ||
| 17 | + test('wakelock is disabled at start', () async { | ||
| 18 | + await driver._expectEnabled(isFalse); | ||
| 19 | + }); | ||
| 20 | + | ||
| 21 | + test('enable wakelock', () async { | ||
| 22 | + // Use the button in the example app instead of a direct plugin call. | ||
| 23 | + await driver.tap(find.text('enable wakelock')); | ||
| 24 | + | ||
| 25 | + await driver._expectEnabled(isTrue); | ||
| 26 | + }); | ||
| 27 | + | ||
| 28 | + test('disable wakelock', () async { | ||
| 29 | + // Use the button in the example app instead of a direct plugin call. | ||
| 30 | + await driver.tap(find.text('disable wakelock')); | ||
| 31 | + | ||
| 32 | + await driver._expectEnabled(isFalse); | ||
| 33 | + }); | ||
| 34 | + }); | ||
| 35 | + | ||
| 36 | + test('wakelock bare platform testing', () async { | ||
| 37 | + expect(bareTestingResult, equals('success')); | ||
| 38 | + }); | ||
| 39 | +} | ||
| 40 | + | ||
| 41 | +extension on FlutterDriver { | ||
| 42 | + Future<bool> _finds(SerializableFinder finder) async { | ||
| 43 | + try { | ||
| 44 | + await waitFor(finder, timeout: const Duration(milliseconds: 420)); | ||
| 45 | + return true; | ||
| 46 | + } catch (_) { | ||
| 47 | + return false; | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + Future<void> _expectEnabled(Matcher matcher) async { | ||
| 52 | + // Check the widget in the example app. | ||
| 53 | + final result = await _finds(find.text( | ||
| 54 | + 'wakelock is currently ${matcher == isTrue ? 'enabled' : 'disabled'}')); | ||
| 55 | + | ||
| 56 | + expect(result, isTrue); | ||
| 57 | + } | ||
| 7 | } | 58 | } |
| 1 | # | 1 | # |
| 2 | -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html | 2 | +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. |
| 3 | +# Run `pod lib lint wakelock.podspec' to validate before publishing. | ||
| 3 | # | 4 | # |
| 4 | Pod::Spec.new do |s| | 5 | Pod::Spec.new do |s| |
| 5 | s.name = 'wakelock' | 6 | s.name = 'wakelock' |
| 6 | s.version = '0.0.1' | 7 | s.version = '0.0.1' |
| 7 | - s.summary = 'A new flutter plugin project.' | 8 | + s.summary = 'A new Flutter plugin.' |
| 8 | s.description = <<-DESC | 9 | s.description = <<-DESC |
| 9 | -A new flutter plugin project. | 10 | +A new Flutter plugin. |
| 10 | DESC | 11 | DESC |
| 11 | s.homepage = 'http://example.com' | 12 | s.homepage = 'http://example.com' |
| 12 | s.license = { :file => '../LICENSE' } | 13 | s.license = { :file => '../LICENSE' } |
| 13 | s.author = { 'Your Company' => 'email@example.com' } | 14 | s.author = { 'Your Company' => 'email@example.com' } |
| 14 | s.source = { :path => '.' } | 15 | s.source = { :path => '.' } |
| 15 | s.source_files = 'Classes/**/*' | 16 | s.source_files = 'Classes/**/*' |
| 16 | - s.public_header_files = 'Classes/**/*.h' | ||
| 17 | s.dependency 'Flutter' | 17 | s.dependency 'Flutter' |
| 18 | s.platform = :ios, '8.0' | 18 | s.platform = :ios, '8.0' |
| 19 | + | ||
| 20 | + # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. | ||
| 19 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } | 21 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } |
| 20 | s.ios.deployment_target = '8.0' | 22 | s.ios.deployment_target = '8.0' |
| 21 | end | 23 | end |
| 22 | - |
| 1 | import 'dart:async'; | 1 | import 'dart:async'; |
| 2 | 2 | ||
| 3 | import 'package:flutter/services.dart'; | 3 | import 'package:flutter/services.dart'; |
| 4 | +import 'package:meta/meta.dart'; | ||
| 4 | 5 | ||
| 5 | /// To enable the wakelock, you can use [Wakelock.enable] and to disable it, | 6 | /// To enable the wakelock, you can use [Wakelock.enable] and to disable it, |
| 6 | /// you can call [Wakelock.disable]. | 7 | /// you can call [Wakelock.disable]. |
| @@ -26,6 +27,7 @@ class Wakelock { | @@ -26,6 +27,7 @@ class Wakelock { | ||
| 26 | _channel.invokeMethod('toggle', {'enable': false}); | 27 | _channel.invokeMethod('toggle', {'enable': false}); |
| 27 | 28 | ||
| 28 | /// You can simply use this function to toggle the wakelock using a [bool] value. | 29 | /// You can simply use this function to toggle the wakelock using a [bool] value. |
| 30 | + /// | ||
| 29 | /// ```dart | 31 | /// ```dart |
| 30 | /// // This line keeps the screen on. | 32 | /// // This line keeps the screen on. |
| 31 | /// Wakelock.toggle(on: true); | 33 | /// Wakelock.toggle(on: true); |
| @@ -34,9 +36,13 @@ class Wakelock { | @@ -34,9 +36,13 @@ class Wakelock { | ||
| 34 | /// // The following line disables the wakelock. | 36 | /// // The following line disables the wakelock. |
| 35 | /// Wakelock.toggle(on: turnOnWakelock); | 37 | /// Wakelock.toggle(on: turnOnWakelock); |
| 36 | /// ``` | 38 | /// ``` |
| 39 | + /// | ||
| 37 | /// You can await the [Future] to wait for the operation to complete. | 40 | /// You can await the [Future] to wait for the operation to complete. |
| 38 | - static Future<void> toggle({bool on}) => | ||
| 39 | - _channel.invokeMethod('toggle', {'enable': on}); | 41 | + static Future<void> toggle({@required bool on}) { |
| 42 | + assert(on != null, | ||
| 43 | + 'The [on] parameter cannot be null when toggling the wakelock.'); | ||
| 44 | + return _channel.invokeMethod('toggle', {'enable': on}); | ||
| 45 | + } | ||
| 40 | 46 | ||
| 41 | /// If you want to retrieve the current wakelock status, you will have to call [Wakelock.isEnabled] | 47 | /// If you want to retrieve the current wakelock status, you will have to call [Wakelock.isEnabled] |
| 42 | /// and await its result: `bool isEnabled = await Wakelock.isEnabled()` | 48 | /// and await its result: `bool isEnabled = await Wakelock.isEnabled()` |
| 1 | name: wakelock | 1 | name: wakelock |
| 2 | description: This plugin allows you to keep Android and iOS devices awake, i.e. prevent the screen from sleeping by toggling the wakelock of the device on or off. | 2 | description: This plugin allows you to keep Android and iOS devices awake, i.e. prevent the screen from sleeping by toggling the wakelock of the device on or off. |
| 3 | -version: 0.1.3+4 | 3 | +version: 0.1.4 |
| 4 | homepage: https://github.com/creativecreatorormaybenot/wakelock | 4 | homepage: https://github.com/creativecreatorormaybenot/wakelock |
| 5 | 5 | ||
| 6 | +environment: | ||
| 7 | + sdk: ">=2.7.0 <3.0.0" | ||
| 8 | + flutter: ">=1.12.13+hotfix.8 <2.0.0" | ||
| 9 | + | ||
| 10 | +dependencies: | ||
| 11 | + flutter: | ||
| 12 | + sdk: flutter | ||
| 13 | + | ||
| 14 | +dev_dependencies: | ||
| 15 | + pedantic: 1.9.0 | ||
| 16 | + | ||
| 17 | + flutter_test: | ||
| 18 | + sdk: flutter | ||
| 19 | + | ||
| 20 | +dependency_overrides: | ||
| 21 | + pedantic: 1.9.0 | ||
| 22 | + | ||
| 6 | flutter: | 23 | flutter: |
| 7 | plugin: | 24 | plugin: |
| 8 | platforms: | 25 | platforms: |
| 9 | android: | 26 | android: |
| 10 | - package: wakelock.wakelock | 27 | + package: creativecreatorormaybenot.wakelock |
| 11 | pluginClass: WakelockPlugin | 28 | pluginClass: WakelockPlugin |
| 12 | ios: | 29 | ios: |
| 13 | pluginClass: WakelockPlugin | 30 | pluginClass: WakelockPlugin |
| 14 | - | ||
| 15 | -dependencies: | ||
| 16 | - flutter: | ||
| 17 | - sdk: flutter | ||
| 18 | - | ||
| 19 | -environment: | ||
| 20 | - sdk: ">=2.1.0 <3.0.0" | ||
| 21 | - flutter: ">=1.10.0 <2.0.0" |
test/wakelock_test.dart
0 → 100644
| 1 | +import 'package:flutter/services.dart'; | ||
| 2 | +import 'package:flutter_test/flutter_test.dart'; | ||
| 3 | +import 'package:wakelock/wakelock.dart'; | ||
| 4 | + | ||
| 5 | +void main() { | ||
| 6 | + const MethodChannel channel = MethodChannel('wakelock'); | ||
| 7 | + | ||
| 8 | + TestWidgetsFlutterBinding.ensureInitialized(); | ||
| 9 | + | ||
| 10 | + setUp(() { | ||
| 11 | + var enabled = false; | ||
| 12 | + | ||
| 13 | + channel.setMockMethodCallHandler((MethodCall methodCall) async { | ||
| 14 | + switch (methodCall.method) { | ||
| 15 | + case 'toggle': | ||
| 16 | + enabled = methodCall.arguments['enable']; | ||
| 17 | + break; | ||
| 18 | + case 'enable': | ||
| 19 | + enabled = true; | ||
| 20 | + break; | ||
| 21 | + case 'disable': | ||
| 22 | + enabled = false; | ||
| 23 | + break; | ||
| 24 | + case 'isEnabled': | ||
| 25 | + return enabled; | ||
| 26 | + default: | ||
| 27 | + throw ArgumentError.value(methodCall.method); | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + return null; | ||
| 31 | + }); | ||
| 32 | + }); | ||
| 33 | + | ||
| 34 | + tearDown(() { | ||
| 35 | + channel.setMockMethodCallHandler(null); | ||
| 36 | + }); | ||
| 37 | + | ||
| 38 | + test('isEnabled', () async { | ||
| 39 | + expect(await Wakelock.isEnabled, isFalse); | ||
| 40 | + }); | ||
| 41 | + | ||
| 42 | + group('toggle', () { | ||
| 43 | + test('on', () async { | ||
| 44 | + await Wakelock.toggle(on: true); | ||
| 45 | + expect(await Wakelock.isEnabled, isTrue); | ||
| 46 | + }); | ||
| 47 | + | ||
| 48 | + test('off', () async { | ||
| 49 | + await Wakelock.toggle(on: false); | ||
| 50 | + expect(await Wakelock.isEnabled, isFalse); | ||
| 51 | + }); | ||
| 52 | + | ||
| 53 | + test('non-null assertion', () async { | ||
| 54 | + expect(() async => await Wakelock.toggle(on: null), throwsAssertionError); | ||
| 55 | + }); | ||
| 56 | + }); | ||
| 57 | + | ||
| 58 | + test('enable', () async { | ||
| 59 | + await Wakelock.enable(); | ||
| 60 | + expect(await Wakelock.isEnabled, isTrue); | ||
| 61 | + }); | ||
| 62 | + | ||
| 63 | + test('disable', () async { | ||
| 64 | + await Wakelock.disable(); | ||
| 65 | + expect(await Wakelock.isEnabled, isFalse); | ||
| 66 | + }); | ||
| 67 | +} |
-
Please register or login to post a comment