diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 0000000..1c693cc
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,30 @@
+name: github pages
+
+on:
+ push:
+ branches:
+ - master
+
+jobs:
+ deploy:
+ runs-on: ubuntu-18.04
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Setup Flutter
+ uses: subosito/flutter-action@v1
+ with:
+ channel: 'dev'
+
+ - name: Install
+ run: |
+ flutter config --enable-web
+ flutter pub get
+ - name: Build
+ run: cd example && flutter build web
+
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@v3
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: ./example/build/web
diff --git a/.gitignore b/.gitignore
index 7ecebb4..02d7df3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,10 @@
.DS_Store
.dart_tool/
+.idea/
.packages
.pub/
pubspec.lock
build/
+*.iml
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
deleted file mode 100644
index 30aa626..0000000
--- a/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml
deleted file mode 100644
index df0a084..0000000
--- a/.idea/libraries/Dart_SDK.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/Flutter_Plugins.xml b/.idea/libraries/Flutter_Plugins.xml
deleted file mode 100644
index 53449da..0000000
--- a/.idea/libraries/Flutter_Plugins.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/Flutter_for_Android.xml b/.idea/libraries/Flutter_for_Android.xml
deleted file mode 100644
index 4e96414..0000000
--- a/.idea/libraries/Flutter_for_Android.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 3268472..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 84d3dcb..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/.idea/runConfigurations/example_lib_main_dart.xml b/.idea/runConfigurations/example_lib_main_dart.xml
deleted file mode 100644
index 5fd9159..0000000
--- a/.idea/runConfigurations/example_lib_main_dart.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
deleted file mode 100644
index f3fbfec..0000000
--- a/.idea/workspace.xml
+++ /dev/null
@@ -1,709 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1531164903114
-
-
- 1531164903114
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 27f2c4a..44a91a5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,23 @@
+## 1.3.0
+
+* Fixing swift version
+
+## 1.2.0
+
+* Upgrade to Android v2 embedding
+
+## 1.1.0
+
+* Merging changes and fixing lint errors
+
+## 1.0.0
+
+* Changing Name
+
+## 0.0.5
+
+* Fix Gradle version in gradle-wrapper.properties
+
## [0.0.4] - August 22nd, 2018
* add compatibility for Dart 2 sdk in pubspec.yaml
diff --git a/README.md b/README.md
index 5576bf5..65d8fb2 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,18 @@
+[](https://www.buymeacoffee.com/rodydavis)
+[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WSH3GVC49GNNJ)
+
+[](https://github.com/rodydavis/flutter_vibrate)
+[](https://pub.dev/packages/flutter_vibrate)
+
# Vibrate
-[](https://pub.dartlang.org/packages/vibrate)
A Flutter plugin to vibrate the device.
This uses all the current Haptic Feedback APIs from Apple and provides similar feedback on Android.
-## Usage
-To use this plugin, add `vibrate` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
+> [!WARNING]
+> This project has moved here: https://github.com/rodydavis/packages.dart
+
+## Getting Started
Make sure you add the following permissions to your Android Manifest
``` xml
@@ -14,7 +21,7 @@ Make sure you add the following permissions to your Android Manifest
## Usage
``` dart
// Import package
-import 'package:vibrate/vibrate.dart';
+import 'package:flutter_vibrate/flutter_vibrate.dart';
```
### Vibration
diff --git a/analysis_options.yaml b/analysis_options.yaml
new file mode 100644
index 0000000..f9b3034
--- /dev/null
+++ b/analysis_options.yaml
@@ -0,0 +1 @@
+include: package:flutter_lints/flutter.yaml
diff --git a/android/build.gradle b/android/build.gradle
index cd5c61d..2dbd11a 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -3,35 +3,31 @@ version '1.0-SNAPSHOT'
buildscript {
repositories {
- jcenter()
- maven {
- url "https://maven.google.com"
- }
+ google()
+ mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.3.3'
+ classpath 'com.android.tools.build:gradle:7.0.2'
}
}
rootProject.allprojects {
repositories {
- jcenter()
- maven {
- url "https://maven.google.com"
- }
+ google()
+ mavenCentral()
}
}
apply plugin: 'com.android.library'
android {
- compileSdkVersion 25
- buildToolsVersion '25.0.3'
+ namespace "flutter.plugins.vibrate"
+ compileSdkVersion 30
defaultConfig {
minSdkVersion 16
- targetSdkVersion 25
+ targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -39,4 +35,9 @@ android {
lintOptions {
disable 'InvalidPackage'
}
+
+ if (project.android.hasProperty("namespace")) {
+ namespace 'flutter.plugins.vibrate'
+ }
+
}
diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..13372ae
Binary files /dev/null and b/android/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..77e79b8
--- /dev/null
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Jun 23 08:50:38 CEST 2017
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml
index d2e7996..a2f47b6 100644
--- a/android/src/main/AndroidManifest.xml
+++ b/android/src/main/AndroidManifest.xml
@@ -1,3 +1,2 @@
-
+
diff --git a/android/src/main/java/flutter/plugins/vibrate/VibrateMethodCallHandler.java b/android/src/main/java/flutter/plugins/vibrate/VibrateMethodCallHandler.java
new file mode 100644
index 0000000..4a47284
--- /dev/null
+++ b/android/src/main/java/flutter/plugins/vibrate/VibrateMethodCallHandler.java
@@ -0,0 +1,83 @@
+package flutter.plugins.vibrate;
+
+import android.os.Build;
+import android.os.Vibrator;
+import android.os.VibrationEffect;
+import android.view.HapticFeedbackConstants;
+
+import io.flutter.plugin.common.MethodCall;
+import io.flutter.plugin.common.MethodChannel;
+
+class VibrateMethodCallHandler implements MethodChannel.MethodCallHandler {
+ private final Vibrator vibrator;
+ private final boolean hasVibrator;
+ private final boolean legacyVibrator;
+
+ VibrateMethodCallHandler(Vibrator vibrator) {
+ assert (vibrator != null);
+ this.vibrator = vibrator;
+ this.hasVibrator = vibrator.hasVibrator();
+ this.legacyVibrator = Build.VERSION.SDK_INT < 26;
+ }
+
+ @SuppressWarnings("deprecation")
+ private void vibrate(int duration) {
+ if (hasVibrator) {
+ if (legacyVibrator) {
+ vibrator.vibrate(duration);
+ } else {
+ vibrator.vibrate(VibrationEffect.createOneShot(duration, VibrationEffect.DEFAULT_AMPLITUDE));
+ }
+ }
+ }
+
+ @Override
+ public void onMethodCall(MethodCall call, MethodChannel.Result result) {
+ switch (call.method) {
+ case "canVibrate":
+ result.success(hasVibrator);
+ break;
+ case "vibrate":
+ final int duration = call.argument("duration");
+ vibrate(duration);
+ result.success(null);
+ break;
+ case "impact":
+ vibrate(HapticFeedbackConstants.VIRTUAL_KEY);
+ result.success(null);
+ break;
+ case "selection":
+ vibrate(HapticFeedbackConstants.KEYBOARD_TAP);
+ result.success(null);
+ break;
+ case "success":
+ vibrate(50);
+ result.success(null);
+ break;
+ case "warning":
+ vibrate(250);
+ result.success(null);
+ break;
+ case "error":
+ vibrate(500);
+ result.success(null);
+ break;
+ case "heavy":
+ vibrate(100);
+ result.success(null);
+ break;
+ case "medium":
+ vibrate(40);
+ result.success(null);
+ break;
+ case "light":
+ vibrate(10);
+ result.success(null);
+ break;
+ default:
+ result.notImplemented();
+ break;
+ }
+
+ }
+}
diff --git a/android/src/main/java/flutter/plugins/vibrate/VibratePlugin.java b/android/src/main/java/flutter/plugins/vibrate/VibratePlugin.java
index 4b0feb2..d5080bf 100644
--- a/android/src/main/java/flutter/plugins/vibrate/VibratePlugin.java
+++ b/android/src/main/java/flutter/plugins/vibrate/VibratePlugin.java
@@ -1,100 +1,29 @@
package flutter.plugins.vibrate;
import android.content.Context;
-import android.os.Build;
import android.os.Vibrator;
-import android.view.HapticFeedbackConstants;
+import io.flutter.embedding.engine.plugins.FlutterPlugin;
+import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MethodChannel;
-import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
-import io.flutter.plugin.common.MethodChannel.Result;
-import io.flutter.plugin.common.MethodCall;
-import io.flutter.plugin.common.PluginRegistry.Registrar;
-/**
- * VibratePlugin
- */
-public class VibratePlugin implements MethodCallHandler {
+public class VibratePlugin implements FlutterPlugin {
+ private MethodChannel methodChannel;
- private VibratePlugin(Registrar registrar){
- this._vibrator = (Vibrator)registrar.context().getSystemService(Context.VIBRATOR_SERVICE);
- }
+ @Override
+ public void onAttachedToEngine(FlutterPluginBinding binding) {
+ final Context context = binding.getApplicationContext();
+ final BinaryMessenger messenger = binding.getBinaryMessenger();
+ final Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
+ final VibrateMethodCallHandler methodCallHandler = new VibrateMethodCallHandler(vibrator);
- private Vibrator _vibrator;
-
- public static void registerWith(Registrar registrar) {
- final MethodChannel channel = new MethodChannel(registrar.messenger(), "vibrate");
- channel.setMethodCallHandler(new VibratePlugin(registrar));
- }
-
- @Override
- public void onMethodCall(MethodCall call, Result result) {
- if (call.method.equals("vibrate")) {
- if(_vibrator.hasVibrator()){
- int duration = call.argument("duration");
- _vibrator.vibrate(duration);
- }
- result.success(null);
- }
- else if(call.method.equals("canVibrate")){
- result.success(_vibrator.hasVibrator());
- } //Feedback
- else if(call.method.equals("impact")){
- if(_vibrator.hasVibrator()){
- _vibrator.vibrate(HapticFeedbackConstants.VIRTUAL_KEY);
- }
- result.success(null);
- }
- else if(call.method.equals("selection")){
- if(_vibrator.hasVibrator()){
- _vibrator.vibrate(HapticFeedbackConstants.KEYBOARD_TAP);
- }
- result.success(null);
- }
- else if(call.method.equals("success")){
- if(_vibrator.hasVibrator()){
- int duration = 50;
- _vibrator.vibrate(duration);
- }
- result.success(null);
- }
- else if(call.method.equals("warning")){
- if(_vibrator.hasVibrator()){
- int duration = 250;
- _vibrator.vibrate(duration);
- }
- result.success(null);
+ this.methodChannel = new MethodChannel(messenger, "vibrate");
+ this.methodChannel.setMethodCallHandler(methodCallHandler);
}
- else if(call.method.equals("error")){
- if(_vibrator.hasVibrator()){
- int duration = 500;
- _vibrator.vibrate(duration);
- }
- result.success(null);
- }
- else if(call.method.equals("heavy")){
- if(_vibrator.hasVibrator()){
- int duration = 100;
- _vibrator.vibrate(duration);
- }
- result.success(null);
- }
- else if(call.method.equals("medium")){
- if(_vibrator.hasVibrator()){
- int duration = 40;
- _vibrator.vibrate(duration);
- }
- result.success(null);
- }
- else if(call.method.equals("light")){
- if(_vibrator.hasVibrator()){
- int duration = 10;
- _vibrator.vibrate(duration);
- }
- result.success(null);
- }
- else {
- result.notImplemented();
+
+ @Override
+ public void onDetachedFromEngine(FlutterPluginBinding binding) {
+ this.methodChannel.setMethodCallHandler(null);
+ this.methodChannel = null;
}
- }
}
diff --git a/example/.gitignore b/example/.gitignore
index dee655c..ae1f183 100644
--- a/example/.gitignore
+++ b/example/.gitignore
@@ -1,9 +1,37 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
.DS_Store
-.dart_tool/
+.atom/
+.buildlog/
+.history
+.svn/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+# Flutter/Dart/Pub related
+**/doc/api/
+.dart_tool/
+.flutter-plugins
+.flutter-plugins-dependencies
.packages
+.pub-cache/
.pub/
+/build/
-build/
+# Web related
+lib/generated_plugin_registrant.dart
-.flutter-plugins
+# Exceptions to above rules.
+!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
diff --git a/example/.idea/libraries/Dart_SDK.xml b/example/.idea/libraries/Dart_SDK.xml
deleted file mode 100644
index df0a084..0000000
--- a/example/.idea/libraries/Dart_SDK.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/example/.idea/libraries/Flutter_for_Android.xml b/example/.idea/libraries/Flutter_for_Android.xml
deleted file mode 100644
index 4e96414..0000000
--- a/example/.idea/libraries/Flutter_for_Android.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/example/.idea/modules.xml b/example/.idea/modules.xml
deleted file mode 100644
index a6b6d58..0000000
--- a/example/.idea/modules.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/example/.idea/runConfigurations/main_dart.xml b/example/.idea/runConfigurations/main_dart.xml
deleted file mode 100644
index aab7b5c..0000000
--- a/example/.idea/runConfigurations/main_dart.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/example/.idea/workspace.xml b/example/.idea/workspace.xml
deleted file mode 100644
index 5b3388c..0000000
--- a/example/.idea/workspace.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/example/.metadata b/example/.metadata
index 82403ed..1b5cec0 100644
--- a/example/.metadata
+++ b/example/.metadata
@@ -4,5 +4,7 @@
# This file should be version controlled and should not be manually edited.
version:
- revision: c7ea3ca377e909469c68f2ab878a5bc53d3cf66b
- channel: beta
+ revision: 27321ebbad34b0a3fafe99fac037102196d655ff
+ channel: stable
+
+project_type: app
diff --git a/example/README.md b/example/README.md
index 8cd2050..a135626 100644
--- a/example/README.md
+++ b/example/README.md
@@ -1,8 +1,16 @@
-# vibrate_example
+# example
-Demonstrates how to use the vibrate plugin.
+A new Flutter project.
## Getting Started
-For help getting started with Flutter, view our online
-[documentation](https://flutter.io/).
+This project is a starting point for a Flutter application.
+
+A few resources to get you started if this is your first Flutter project:
+
+- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
+- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
+
+For help getting started with Flutter, view our
+[online documentation](https://flutter.dev/docs), which offers tutorials,
+samples, guidance on mobile development, and a full API reference.
diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml
new file mode 100644
index 0000000..f9b3034
--- /dev/null
+++ b/example/analysis_options.yaml
@@ -0,0 +1 @@
+include: package:flutter_lints/flutter.yaml
diff --git a/example/android/.gitignore b/example/android/.gitignore
index 65b7315..bc2100d 100644
--- a/example/android/.gitignore
+++ b/example/android/.gitignore
@@ -1,10 +1,7 @@
-*.iml
-*.class
-.gradle
+gradle-wrapper.jar
+/.gradle
+/captures/
+/gradlew
+/gradlew.bat
/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-/build
-/captures
GeneratedPluginRegistrant.java
diff --git a/example/android/.project b/example/android/.project
deleted file mode 100644
index 3964dd3..0000000
--- a/example/android/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- android
- Project android created by Buildship.
-
-
-
-
- org.eclipse.buildship.core.gradleprojectbuilder
-
-
-
-
-
- org.eclipse.buildship.core.gradleprojectnature
-
-
diff --git a/example/android/.settings/org.eclipse.buildship.core.prefs b/example/android/.settings/org.eclipse.buildship.core.prefs
deleted file mode 100644
index e889521..0000000
--- a/example/android/.settings/org.eclipse.buildship.core.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-connection.project.dir=
-eclipse.preferences.version=1
diff --git a/example/android/app/.classpath b/example/android/app/.classpath
deleted file mode 100644
index 8d8d85f..0000000
--- a/example/android/app/.classpath
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
diff --git a/example/android/app/.project b/example/android/app/.project
deleted file mode 100644
index ac485d7..0000000
--- a/example/android/app/.project
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- app
- Project app created by Buildship.
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- org.eclipse.buildship.core.gradleprojectbuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
- org.eclipse.buildship.core.gradleprojectnature
-
-
diff --git a/example/android/app/.settings/org.eclipse.buildship.core.prefs b/example/android/app/.settings/org.eclipse.buildship.core.prefs
deleted file mode 100644
index b1886ad..0000000
--- a/example/android/app/.settings/org.eclipse.buildship.core.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-connection.project.dir=..
-eclipse.preferences.version=1
diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
index aab2938..ee1a6d0 100644
--- a/example/android/app/build.gradle
+++ b/example/android/app/build.gradle
@@ -11,11 +11,21 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
+def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
+if (flutterVersionCode == null) {
+ flutterVersionCode = '1'
+}
+
+def flutterVersionName = localProperties.getProperty('flutter.versionName')
+if (flutterVersionName == null) {
+ flutterVersionName = '1.0'
+}
+
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
- compileSdkVersion 27
+ compileSdkVersion 30
lintOptions {
disable 'InvalidPackage'
@@ -23,12 +33,12 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "com.appleeducate.vibrateexample"
+ applicationId "com.example.example"
minSdkVersion 16
- targetSdkVersion 27
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ targetSdkVersion 30
+ versionCode flutterVersionCode.toInteger()
+ versionName flutterVersionName
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
@@ -45,7 +55,7 @@ flutter {
}
dependencies {
- testImplementation 'junit:junit:4.12'
- androidTestImplementation 'com.android.support.test:runner:1.0.1'
- androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+ testImplementation 'junit:junit:4.13.2'
+ androidTestImplementation 'androidx.test:runner:1.4.0'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml
new file mode 100644
index 0000000..c208884
--- /dev/null
+++ b/example/android/app/src/debug/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml
index 88a440b..818ddd4 100644
--- a/example/android/app/src/main/AndroidManifest.xml
+++ b/example/android/app/src/main/AndroidManifest.xml
@@ -1,13 +1,8 @@
+ package="com.example.example">
-
-
+
-
-
-
+
+
diff --git a/example/android/app/src/main/java/com/appleeducate/vibrateexample/MainActivity.java b/example/android/app/src/main/java/com/appleeducate/vibrateexample/MainActivity.java
deleted file mode 100644
index 3bd0cd5..0000000
--- a/example/android/app/src/main/java/com/appleeducate/vibrateexample/MainActivity.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.appleeducate.vibrateexample;
-
-import android.os.Bundle;
-import io.flutter.app.FlutterActivity;
-import io.flutter.plugins.GeneratedPluginRegistrant;
-
-public class MainActivity extends FlutterActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- GeneratedPluginRegistrant.registerWith(this);
- }
-}
diff --git a/example/android/app/src/main/java/com/example/example/MainActivity.java b/example/android/app/src/main/java/com/example/example/MainActivity.java
new file mode 100644
index 0000000..ae0a572
--- /dev/null
+++ b/example/android/app/src/main/java/com/example/example/MainActivity.java
@@ -0,0 +1,13 @@
+package com.example.example;
+
+import androidx.annotation.NonNull;
+import io.flutter.embedding.android.FlutterActivity;
+import io.flutter.embedding.engine.FlutterEngine;
+import io.flutter.plugins.GeneratedPluginRegistrant;
+
+public class MainActivity extends FlutterActivity {
+ @Override
+ public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
+ GeneratedPluginRegistrant.registerWith(flutterEngine);
+ }
+}
diff --git a/example/android/app/src/profile/AndroidManifest.xml b/example/android/app/src/profile/AndroidManifest.xml
new file mode 100644
index 0000000..c208884
--- /dev/null
+++ b/example/android/app/src/profile/AndroidManifest.xml
@@ -0,0 +1,7 @@
+
+
+
+
diff --git a/example/android/build.gradle b/example/android/build.gradle
index 4476887..9971094 100644
--- a/example/android/build.gradle
+++ b/example/android/build.gradle
@@ -1,18 +1,18 @@
buildscript {
repositories {
google()
- jcenter()
+ mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.0.1'
+ classpath 'com.android.tools.build:gradle:7.0.2'
}
}
allprojects {
repositories {
google()
- jcenter()
+ mavenCentral()
}
}
diff --git a/example/android/gradle.properties b/example/android/gradle.properties
index 8bd86f6..38c8d45 100644
--- a/example/android/gradle.properties
+++ b/example/android/gradle.properties
@@ -1 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
+android.enableR8=true
+android.useAndroidX=true
+android.enableJetifier=true
diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties
index aa901e1..5917028 100644
--- a/example/android/gradle/wrapper/gradle-wrapper.properties
+++ b/example/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Fri Jun 23 08:50:38 CEST 2017
+#Mon Sep 20 09:29:17 CEST 2021
distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
+zipStoreBase=GRADLE_USER_HOME
diff --git a/example/ios/.gitignore b/example/ios/.gitignore
index 79cc4da..e96ef60 100644
--- a/example/ios/.gitignore
+++ b/example/ios/.gitignore
@@ -1,45 +1,32 @@
-.idea/
-.vagrant/
-.sconsign.dblite
-.svn/
-
-.DS_Store
-*.swp
-profile
-
-DerivedData/
-build/
-GeneratedPluginRegistrant.h
-GeneratedPluginRegistrant.m
-
-.generated/
-
-*.pbxuser
*.mode1v3
*.mode2v3
+*.moved-aside
+*.pbxuser
*.perspectivev3
-
-!default.pbxuser
+**/*sync/
+.sconsign.dblite
+.tags*
+**/.vagrant/
+**/DerivedData/
+Icon?
+**/Pods/
+**/.symlinks/
+profile
+xcuserdata
+**/.generated/
+Flutter/App.framework
+Flutter/Flutter.framework
+Flutter/Flutter.podspec
+Flutter/Generated.xcconfig
+Flutter/app.flx
+Flutter/app.zip
+Flutter/flutter_assets/
+Flutter/flutter_export_environment.sh
+ServiceDefinitions.json
+Runner/GeneratedPluginRegistrant.*
+
+# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
+!default.pbxuser
!default.perspectivev3
-
-xcuserdata
-
-*.moved-aside
-
-*.pyc
-*sync/
-Icon?
-.tags*
-
-/Flutter/app.flx
-/Flutter/app.zip
-/Flutter/flutter_assets/
-/Flutter/App.framework
-/Flutter/Flutter.framework
-/Flutter/Generated.xcconfig
-/ServiceDefinitions.json
-
-Pods/
-.symlinks/
diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist
index 9367d48..f2872cf 100644
--- a/example/ios/Flutter/AppFrameworkInfo.plist
+++ b/example/ios/Flutter/AppFrameworkInfo.plist
@@ -3,7 +3,7 @@
CFBundleDevelopmentRegion
- en
+ $(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
App
CFBundleIdentifier
@@ -21,6 +21,6 @@
CFBundleVersion
1.0
MinimumOSVersion
- 8.0
+ 9.0
diff --git a/example/ios/Podfile b/example/ios/Podfile
index e942fce..1e8c3c9 100644
--- a/example/ios/Podfile
+++ b/example/ios/Podfile
@@ -4,66 +4,38 @@
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
-def parse_KV_file(file, separator='=')
- file_abs_path = File.expand_path(file)
- if !File.exists? file_abs_path
- return [];
+project 'Runner', {
+ 'Debug' => :debug,
+ 'Profile' => :release,
+ 'Release' => :release,
+}
+
+def flutter_root
+ generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
+ unless File.exist?(generated_xcode_build_settings_path)
+ raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
+ end
+
+ File.foreach(generated_xcode_build_settings_path) do |line|
+ matches = line.match(/FLUTTER_ROOT\=(.*)/)
+ return matches[1].strip if matches
end
- pods_ary = []
- skip_line_start_symbols = ["#", "/"]
- File.foreach(file_abs_path) { |line|
- next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
- plugin = line.split(pattern=separator)
- if plugin.length == 2
- podname = plugin[0].strip()
- path = plugin[1].strip()
- podpath = File.expand_path("#{path}", file_abs_path)
- pods_ary.push({:name => podname, :path => podpath});
- else
- puts "Invalid plugin specification: #{line}"
- end
- }
- return pods_ary
+ raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
-target 'Runner' do
- use_frameworks!
+require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
- # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
- # referring to absolute paths on developers' machines.
- system('rm -rf .symlinks')
- system('mkdir -p .symlinks/plugins')
+flutter_ios_podfile_setup
- # Flutter Pods
- generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
- if generated_xcode_build_settings.empty?
- puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
- end
- generated_xcode_build_settings.map { |p|
- if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
- symlink = File.join('.symlinks', 'flutter')
- File.symlink(File.dirname(p[:path]), symlink)
- pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
- end
- }
+target 'Runner' do
+ use_frameworks!
+ use_modular_headers!
- # Plugin Pods
- plugin_pods = parse_KV_file('../.flutter-plugins')
- plugin_pods.map { |p|
- symlink = File.join('.symlinks', 'plugins', p[:name])
- File.symlink(p[:path], symlink)
- pod p[:name], :path => File.join(symlink, 'ios')
- }
+ flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
- target.build_configurations.each do |config|
- config.build_settings['ENABLE_BITCODE'] = 'NO'
- end
- # workaround for https://github.com/CocoaPods/CocoaPods/issues/7463
- target.headers_build_phase.files.each do |file|
- file.settings = { 'ATTRIBUTES' => ['Public'] }
- end
+ flutter_additional_ios_build_settings(target)
end
end
diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock
index ab0bf76..fcf6bdc 100644
--- a/example/ios/Podfile.lock
+++ b/example/ios/Podfile.lock
@@ -1,22 +1,22 @@
PODS:
- Flutter (1.0.0)
- - vibrate (0.0.1):
+ - flutter_vibrate (0.0.1):
- Flutter
DEPENDENCIES:
- - Flutter (from `.symlinks/flutter/ios`)
- - vibrate (from `.symlinks/plugins/vibrate/ios`)
+ - Flutter (from `Flutter`)
+ - flutter_vibrate (from `.symlinks/plugins/flutter_vibrate/ios`)
EXTERNAL SOURCES:
Flutter:
- :path: .symlinks/flutter/ios
- vibrate:
- :path: .symlinks/plugins/vibrate/ios
+ :path: Flutter
+ flutter_vibrate:
+ :path: ".symlinks/plugins/flutter_vibrate/ios"
SPEC CHECKSUMS:
- Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296
- vibrate: 8d9cb77859e02b88730c44a9907f561ddca25ca1
+ Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
+ flutter_vibrate: c0ca4ac994ff97c3f147f69865458bbc0cc3508b
-PODFILE CHECKSUM: eebe7f405ca85683d9f060410d4211e286a2556f
+PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
-COCOAPODS: 1.4.0
+COCOAPODS: 1.10.1
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index d7231df..d43db09 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -8,19 +8,12 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
- 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
+ 22FFFBD0F8E74FB73DC242DD /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA46F60EE46B5998BF307D72 /* Pods_Runner.framework */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
- 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
- 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
- 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
- 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
- 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
- 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
- CA21753ABCE1143CA24DDDDE /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 373F4AC62667D2B037B7F083 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -30,8 +23,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
- 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
- 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
@@ -41,21 +32,21 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
- 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
- 373F4AC62667D2B037B7F083 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1781E372D42A3350B69093C0 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
- 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
+ 4BC2C61693CDFA297634104F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
+ 7C28F0C6F036694B70324616 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
- 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ DA46F60EE46B5998BF307D72 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -63,22 +54,36 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
- 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
- CA21753ABCE1143CA24DDDDE /* Pods_Runner.framework in Frameworks */,
+ 22FFFBD0F8E74FB73DC242DD /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
+ 2723E2A00764DF74F4431D32 /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ 4BC2C61693CDFA297634104F /* Pods-Runner.debug.xcconfig */,
+ 7C28F0C6F036694B70324616 /* Pods-Runner.release.xcconfig */,
+ 1781E372D42A3350B69093C0 /* Pods-Runner.profile.xcconfig */,
+ );
+ name = Pods;
+ path = Pods;
+ sourceTree = "";
+ };
+ 6A5934F9A8576787A4C7ED2D /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ DA46F60EE46B5998BF307D72 /* Pods_Runner.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
- 2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
- 3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
- 9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
@@ -92,8 +97,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
- FC2ABF90086FF27CEEEE33F9 /* Pods */,
- B18A992BE514FD1BAA38195C /* Frameworks */,
+ 2723E2A00764DF74F4431D32 /* Pods */,
+ 6A5934F9A8576787A4C7ED2D /* Frameworks */,
);
sourceTree = "";
};
@@ -128,21 +133,6 @@
name = "Supporting Files";
sourceTree = "";
};
- B18A992BE514FD1BAA38195C /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 373F4AC62667D2B037B7F083 /* Pods_Runner.framework */,
- );
- name = Frameworks;
- sourceTree = "";
- };
- FC2ABF90086FF27CEEEE33F9 /* Pods */ = {
- isa = PBXGroup;
- children = (
- );
- name = Pods;
- sourceTree = "";
- };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -150,15 +140,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
- D133E687A78B141BBEC6300E /* [CP] Check Pods Manifest.lock */,
+ 9D5D0A6B2BA6FAD51FD140BE /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
- 1F5C5201292CA449C34C83C4 /* [CP] Embed Pods Frameworks */,
- B800F6442D5424A14B3FE53C /* [CP] Copy Pods Resources */,
+ 12298C3401E394B168BC3D03 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -175,18 +164,18 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0910;
+ LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
- LastSwiftMigration = 0910;
+ LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
+ developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -208,11 +197,8 @@
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
- 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
- 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
- 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -220,24 +206,22 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
- 1F5C5201292CA449C34C83C4 /* [CP] Embed Pods Frameworks */ = {
+ 12298C3401E394B168BC3D03 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
- "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
- "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
- "${BUILT_PRODUCTS_DIR}/vibrate/vibrate.framework",
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
+ "${BUILT_PRODUCTS_DIR}/flutter_vibrate/flutter_vibrate.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/vibrate.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_vibrate.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
@@ -252,7 +236,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
+ shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
@@ -268,31 +252,20 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
- B800F6442D5424A14B3FE53C /* [CP] Copy Pods Resources */ = {
+ 9D5D0A6B2BA6FAD51FD140BE /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
- inputPaths = (
- );
- name = "[CP] Copy Pods Resources";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
- showEnvVarsInLog = 0;
- };
- D133E687A78B141BBEC6300E /* [CP] Check Pods Manifest.lock */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
+ inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
@@ -335,9 +308,84 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
+ 249021D3217E4FDB00AE95B9 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Profile;
+ };
+ 249021D4217E4FDB00AE95B9 /* Profile */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CLANG_ENABLE_MODULES = YES;
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
+ ENABLE_BITCODE = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/Flutter",
+ );
+ INFOPLIST_FILE = Runner/Info.plist;
+ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(PROJECT_DIR)/Flutter",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ VERSIONING_SYSTEM = "apple-generic";
+ };
+ name = Profile;
+ };
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@@ -349,12 +397,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -381,7 +431,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -391,7 +441,6 @@
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
- baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@@ -403,12 +452,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -429,9 +480,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
+ SUPPORTED_PLATFORMS = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
@@ -444,8 +496,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
- CURRENT_PROJECT_VERSION = 1;
- DEVELOPMENT_TEAM = "";
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -457,12 +508,11 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- PRODUCT_BUNDLE_IDENTIFIER = flutter.plugins.vibrateExample;
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_SWIFT3_OBJC_INFERENCE = On;
- SWIFT_VERSION = 4.0;
+ SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
@@ -473,8 +523,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
- CURRENT_PROJECT_VERSION = 1;
- DEVELOPMENT_TEAM = "";
+ CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -486,11 +535,10 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- PRODUCT_BUNDLE_IDENTIFIER = flutter.plugins.vibrateExample;
+ PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
- SWIFT_SWIFT3_OBJC_INFERENCE = On;
- SWIFT_VERSION = 4.0;
+ SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
@@ -503,6 +551,7 @@
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
+ 249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
@@ -512,6 +561,7 @@
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
+ 249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
index 1d526a1..919434a 100644
--- a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -2,6 +2,6 @@
+ location = "self:">
diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index 1263ac8..a28140c 100644
--- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -1,6 +1,6 @@
@@ -46,7 +45,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -67,7 +65,7 @@
-
-
-
- IDEDidComputeMac32BitWarning
-
-
-
diff --git a/example/ios/Runner/AppDelegate.swift b/example/ios/Runner/AppDelegate.swift
index 71cc41e..70693e4 100644
--- a/example/ios/Runner/AppDelegate.swift
+++ b/example/ios/Runner/AppDelegate.swift
@@ -5,7 +5,7 @@ import Flutter
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
- didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
index 3d43d11..dc9ada4 100644
Binary files a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and b/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ
diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist
index 836e0a1..a060db6 100644
--- a/example/ios/Runner/Info.plist
+++ b/example/ios/Runner/Info.plist
@@ -3,7 +3,7 @@
CFBundleDevelopmentRegion
- en
+ $(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
@@ -11,15 +11,15 @@
CFBundleInfoDictionaryVersion
6.0
CFBundleName
- vibrate_example
+ example
CFBundlePackageType
APPL
CFBundleShortVersionString
- 1.0
+ $(FLUTTER_BUILD_NAME)
CFBundleSignature
????
CFBundleVersion
- 1
+ $(FLUTTER_BUILD_NUMBER)
LSRequiresIPhoneOS
UILaunchStoryboardName
diff --git a/example/lib/main.dart b/example/lib/main.dart
index cbdad4d..d26268c 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -1,11 +1,13 @@
import 'package:flutter/material.dart';
-import 'package:vibrate/vibrate.dart';
+import 'package:flutter_vibrate/flutter_vibrate.dart';
-void main() => runApp(new MyApp());
+void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
+ const MyApp({Key? key}) : super(key: key);
+
@override
- _MyAppState createState() => new _MyAppState();
+ _MyAppState createState() => _MyAppState();
}
class _MyAppState extends State {
@@ -17,122 +19,120 @@ class _MyAppState extends State {
];
@override
- initState() {
+ void initState() {
super.initState();
- init();
+ _init();
}
- init() async {
+ Future _init() async {
bool canVibrate = await Vibrate.canVibrate;
setState(() {
_canVibrate = canVibrate;
_canVibrate
- ? print("This device can vibrate")
- : print("This device cannot vibrate");
+ ? debugPrint('This device can vibrate')
+ : debugPrint('This device cannot vibrate');
});
}
@override
Widget build(BuildContext context) {
- return new MaterialApp(
- home: new Scaffold(
- appBar: new AppBar(title: new Text('Haptic Feedback Example')),
- body: new Center(
- child: new Column(children: [
- new ListTile(
- title: new Text("Vibrate"),
- leading: new Icon(Icons.vibration, color: Colors.teal),
- onTap: !_canVibrate
- ? null
- : () {
- Vibrate.vibrate();
- },
+ return MaterialApp(
+ home: Scaffold(
+ appBar: AppBar(title: const Text('Haptic Feedback Example')),
+ body: Center(
+ child: ListView(children: [
+ ListTile(
+ title: const Text('Vibrate'),
+ leading: const Icon(Icons.vibration, color: Colors.teal),
+ onTap: () {
+ if (_canVibrate) Vibrate.vibrate;
+ },
),
- new ListTile(
- title: new Text("Vibrate with Pauses"),
- leading: new Icon(Icons.vibration, color: Colors.brown),
- onTap: !_canVibrate
- ? null
- : () {
- Vibrate.vibrateWithPauses(pauses);
- },
+ ListTile(
+ title: const Text('Vibrate with Pauses'),
+ leading: const Icon(Icons.vibration, color: Colors.brown),
+ onTap: () {
+ if (_canVibrate) {
+ Vibrate.vibrateWithPauses(pauses);
+ }
+ },
),
- new Divider(height: 1.0),
- new ListTile(
- title: new Text("Impact"),
- leading: new Icon(Icons.tap_and_play, color: Colors.orange),
- onTap: !_canVibrate
- ? null
- : () {
- Vibrate.feedback(FeedbackType.impact);
- },
+ const Divider(height: 1),
+ ListTile(
+ title: const Text('Impact'),
+ leading: const Icon(Icons.tap_and_play, color: Colors.orange),
+ onTap: () {
+ if (_canVibrate) {
+ Vibrate.feedback(FeedbackType.impact);
+ }
+ },
),
- new ListTile(
- title: new Text("Selection"),
- leading: new Icon(Icons.select_all, color: Colors.blue),
- onTap: !_canVibrate
- ? null
- : () {
- Vibrate.feedback(FeedbackType.selection);
- },
+ ListTile(
+ title: const Text('Selection'),
+ leading: const Icon(Icons.select_all, color: Colors.blue),
+ onTap: () {
+ if (_canVibrate) {
+ Vibrate.feedback(FeedbackType.selection);
+ }
+ },
),
- new ListTile(
- title: new Text("Success"),
- leading: new Icon(Icons.check, color: Colors.green),
- onTap: !_canVibrate
- ? null
- : () {
- Vibrate.feedback(FeedbackType.success);
- },
+ ListTile(
+ title: const Text('Success'),
+ leading: const Icon(Icons.check, color: Colors.green),
+ onTap: () {
+ if (_canVibrate) {
+ Vibrate.feedback(FeedbackType.success);
+ }
+ },
),
- new ListTile(
- title: new Text("Warning"),
- leading: new Icon(Icons.warning, color: Colors.red),
- onTap: !_canVibrate
- ? null
- : () {
- Vibrate.feedback(FeedbackType.warning);
- },
+ ListTile(
+ title: const Text('Warning'),
+ leading: const Icon(Icons.warning, color: Colors.red),
+ onTap: () {
+ if (_canVibrate) {
+ Vibrate.feedback(FeedbackType.warning);
+ }
+ },
),
- new ListTile(
- title: new Text("Error"),
- leading: new Icon(Icons.error, color: Colors.red),
- onTap: !_canVibrate
- ? null
- : () {
- Vibrate.feedback(FeedbackType.error);
- },
+ ListTile(
+ title: const Text('Error'),
+ leading: const Icon(Icons.error, color: Colors.red),
+ onTap: () {
+ if (_canVibrate) {
+ Vibrate.feedback(FeedbackType.error);
+ }
+ },
),
- new Divider(height: 1.0),
- new ListTile(
- title: new Text("Heavy"),
+ const Divider(height: 1),
+ ListTile(
+ title: const Text('Heavy'),
leading:
- new Icon(Icons.notification_important, color: Colors.red),
- onTap: !_canVibrate
- ? null
- : () {
- Vibrate.feedback(FeedbackType.heavy);
- },
+ const Icon(Icons.notification_important, color: Colors.red),
+ onTap: () {
+ if (_canVibrate) {
+ Vibrate.feedback(FeedbackType.heavy);
+ }
+ },
),
- new ListTile(
- title: new Text("Medium"),
+ ListTile(
+ title: const Text('Medium'),
leading:
- new Icon(Icons.notification_important, color: Colors.green),
- onTap: !_canVibrate
- ? null
- : () {
- Vibrate.feedback(FeedbackType.medium);
- },
+ const Icon(Icons.notification_important, color: Colors.green),
+ onTap: () {
+ if (_canVibrate) {
+ Vibrate.feedback(FeedbackType.medium);
+ }
+ },
),
- new ListTile(
- title: new Text("Light"),
- leading: new Icon(Icons.notification_important,
- color: Colors.yellow[700]),
- onTap: !_canVibrate
- ? null
- : () {
- Vibrate.feedback(FeedbackType.light);
- },
+ ListTile(
+ title: const Text('Light'),
+ leading:
+ Icon(Icons.notification_important, color: Colors.yellow[700]),
+ onTap: () {
+ if (_canVibrate) {
+ Vibrate.feedback(FeedbackType.light);
+ }
+ },
),
]),
),
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
index 73093f0..40e8e93 100644
--- a/example/pubspec.yaml
+++ b/example/pubspec.yaml
@@ -1,59 +1,21 @@
name: vibrate_example
description: Demonstrates how to use the vibrate plugin.
+publish_to: none
+version: 1.0.0+1
+
+environment:
+ sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
-
- # The following adds the Cupertino Icons font to your application.
- # Use with the CupertinoIcons class for iOS style icons.
- cupertino_icons: ^0.1.2
+ flutter_vibrate:
+ path: ../
dev_dependencies:
flutter_test:
sdk: flutter
+ flutter_lints: ^1.0.4
- vibrate:
- path: ../
-
-# For information on the generic Dart part of this file, see the
-# following page: https://www.dartlang.org/tools/pub/pubspec
-
-# The following section is specific to Flutter.
flutter:
-
- # The following line ensures that the Material Icons font is
- # included with your application, so that you can use the icons in
- # the material Icons class.
uses-material-design: true
-
- # To add assets to your application, add an assets section, like this:
- # assets:
- # - images/a_dot_burr.jpeg
- # - images/a_dot_ham.jpeg
-
- # An image asset can refer to one or more resolution-specific "variants", see
- # https://flutter.io/assets-and-images/#resolution-aware.
-
- # For details regarding adding assets from package dependencies, see
- # https://flutter.io/assets-and-images/#from-packages
-
- # To add custom fonts to your application, add a fonts section here,
- # in this "flutter" section. Each entry in this list should have a
- # "family" key with the font family name, and a "fonts" key with a
- # list giving the asset and other descriptors for the font. For
- # example:
- # fonts:
- # - family: Schyler
- # fonts:
- # - asset: fonts/Schyler-Regular.ttf
- # - asset: fonts/Schyler-Italic.ttf
- # style: italic
- # - family: Trajan Pro
- # fonts:
- # - asset: fonts/TrajanPro.ttf
- # - asset: fonts/TrajanPro_Bold.ttf
- # weight: 700
- #
- # For details regarding fonts from package dependencies,
- # see https://flutter.io/custom-fonts/#from-packages
diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart
deleted file mode 100644
index 95a3ec1..0000000
--- a/example/test/widget_test.dart
+++ /dev/null
@@ -1,25 +0,0 @@
-// This is a basic Flutter widget test.
-// To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
-// provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
-// find child widgets in the widget tree, read text, and verify that the values of widget properties
-// are correct.
-
-import 'package:flutter/material.dart';
-import 'package:flutter_test/flutter_test.dart';
-
-import 'package:vibrate_example/main.dart';
-
-void main() {
- testWidgets('Verify Platform version', (WidgetTester tester) async {
- // Build our app and trigger a frame.
- await tester.pumpWidget(new MyApp());
-
- // Verify that platform version is retrieved.
- expect(
- find.byWidgetPredicate(
- (Widget widget) =>
- widget is Text && widget.data.startsWith('Running on:'),
- ),
- findsOneWidget);
- });
-}
diff --git a/example/vibrate_example.iml b/example/vibrate_example.iml
deleted file mode 100644
index e5c8371..0000000
--- a/example/vibrate_example.iml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/example/vibrate_example_android.iml b/example/vibrate_example_android.iml
deleted file mode 100644
index b050030..0000000
--- a/example/vibrate_example_android.iml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ios/Classes/VibratePlugin.m b/ios/Classes/VibratePlugin.m
index 2c0470d..a7dffaa 100644
--- a/ios/Classes/VibratePlugin.m
+++ b/ios/Classes/VibratePlugin.m
@@ -1,5 +1,5 @@
#import "VibratePlugin.h"
-#import
+#import
@implementation VibratePlugin
+ (void)registerWithRegistrar:(NSObject*)registrar {
diff --git a/ios/vibrate.podspec b/ios/flutter_vibrate.podspec
similarity index 90%
rename from ios/vibrate.podspec
rename to ios/flutter_vibrate.podspec
index b3af798..31b5382 100644
--- a/ios/vibrate.podspec
+++ b/ios/flutter_vibrate.podspec
@@ -2,7 +2,7 @@
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
- s.name = 'vibrate'
+ s.name = 'flutter_vibrate'
s.version = '0.0.1'
s.summary = 'A new Flutter plugin.'
s.description = <<-DESC
@@ -15,7 +15,7 @@ A new Flutter plugin.
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
-
+ s.swift_version = '5.0'
s.ios.deployment_target = '8.0'
end
diff --git a/lib/vibrate.dart b/lib/flutter_vibrate.dart
similarity index 80%
rename from lib/vibrate.dart
rename to lib/flutter_vibrate.dart
index a8e9b25..a160bf4 100644
--- a/lib/vibrate.dart
+++ b/lib/flutter_vibrate.dart
@@ -14,13 +14,14 @@ enum FeedbackType {
}
class Vibrate {
- static const MethodChannel _channel = const MethodChannel('vibrate');
- static const Duration _DEFAULT_VIBRATION_DURATION =
- const Duration(milliseconds: 500);
+ static const MethodChannel _channel = MethodChannel('vibrate');
+ static const Duration defaultVibrationDuration = Duration(milliseconds: 500);
/// Vibrate for 500ms on Android, and for the default time on iOS (about 500ms as well)
static Future vibrate() => _channel.invokeMethod(
- 'vibrate', {"duration": _DEFAULT_VIBRATION_DURATION.inMilliseconds});
+ 'vibrate',
+ {'duration': defaultVibrationDuration.inMilliseconds},
+ );
/// Whether the device can actually vibrate or not
static Future get canVibrate async {
@@ -63,13 +64,13 @@ class Vibrate {
/// and once after the last pause
static Future vibrateWithPauses(Iterable pauses) async {
- for (Duration d in pauses) {
- vibrate();
+ for (final Duration d in pauses) {
+ await vibrate();
//Because the native vibration is not awaited, we need to wait for
//the vibration to end before launching another one
- await new Future.delayed(_DEFAULT_VIBRATION_DURATION);
- await new Future.delayed(d);
+ await Future.delayed(defaultVibrationDuration);
+ await Future.delayed(d);
}
- vibrate();
+ await vibrate();
}
}
diff --git a/pubspec.yaml b/pubspec.yaml
index b0b8e98..a9a1a22 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,54 +1,25 @@
-name: vibrate
+name: flutter_vibrate
description: A Haptic Feedback plugin.
-version: 0.0.4
-authors:
- - Clovis Nicolas
- - Rhodes Davis Jr.
-homepage: https://github.com/appleeducate/flutter_vibrate
-
+version: 1.3.0
environment:
- sdk: '>=2.0.0 <3.0.0'
+ sdk: '>=2.12.0 <3.0.0'
+ flutter: ^1.10.0
+maintainer: Rody Davis (@rodydavis)
+homepage: https://github.com/rodydavis/plugins
+repository: https://github.com/rodydavis/flutter_vibrate
dependencies:
flutter:
sdk: flutter
-# For information on the generic Dart part of this file, see the
-# following page: https://www.dartlang.org/tools/pub/pubspec
+dev_dependencies:
+ flutter_lints: ^1.0.4
-# The following section is specific to Flutter.
flutter:
plugin:
- androidPackage: flutter.plugins.vibrate
- pluginClass: VibratePlugin
-
- # To add assets to your plugin package, add an assets section, like this:
- # assets:
- # - images/a_dot_burr.jpeg
- # - images/a_dot_ham.jpeg
- #
- # For details regarding assets in packages, see
- # https://flutter.io/assets-and-images/#from-packages
- #
- # An image asset can refer to one or more resolution-specific "variants", see
- # https://flutter.io/assets-and-images/#resolution-aware.
-
- # To add custom fonts to your plugin package, add a fonts section here,
- # in this "flutter" section. Each entry in this list should have a
- # "family" key with the font family name, and a "fonts" key with a
- # list giving the asset and other descriptors for the font. For
- # example:
- # fonts:
- # - family: Schyler
- # fonts:
- # - asset: fonts/Schyler-Regular.ttf
- # - asset: fonts/Schyler-Italic.ttf
- # style: italic
- # - family: Trajan Pro
- # fonts:
- # - asset: fonts/TrajanPro.ttf
- # - asset: fonts/TrajanPro_Bold.ttf
- # weight: 700
- #
- # For details regarding fonts in packages, see
- # https://flutter.io/custom-fonts/#from-packages
+ platforms:
+ android:
+ package: flutter.plugins.vibrate
+ pluginClass: VibratePlugin
+ ios:
+ pluginClass: VibratePlugin
diff --git a/vibrate.iml b/vibrate.iml
deleted file mode 100644
index 73e7ebd..0000000
--- a/vibrate.iml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vibrate_android.iml b/vibrate_android.iml
deleted file mode 100644
index ac5d744..0000000
--- a/vibrate_android.iml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-