Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/sensors_plus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.0

- Renamed Method Channel

## 0.5.0

- Transfer to plus-plugins monorepo
Expand Down
2 changes: 1 addition & 1 deletion packages/sensors_plus/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.flutter.plugins.sensors">
package="dev.fluttercommunity.plus.sensors">
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.sensors;
package dev.fluttercommunity.plus.sensors;

import android.content.Context;
import android.hardware.Sensor;
Expand All @@ -15,10 +15,11 @@
/** SensorsPlugin */
public class SensorsPlugin implements FlutterPlugin {
private static final String ACCELEROMETER_CHANNEL_NAME =
"plugins.flutter.io/sensors/accelerometer";
private static final String GYROSCOPE_CHANNEL_NAME = "plugins.flutter.io/sensors/gyroscope";
"dev.fluttercommunity.plus/sensors/accelerometer";
private static final String GYROSCOPE_CHANNEL_NAME =
"dev.fluttercommunity.plus/sensors/gyroscope";
private static final String USER_ACCELEROMETER_CHANNEL_NAME =
"plugins.flutter.io/sensors/user_accel";
"dev.fluttercommunity.plus/sensors/user_accel";

private EventChannel accelerometerChannel;
private EventChannel userAccelChannel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.sensors;
package dev.fluttercommunity.plus.sensors;

import android.hardware.Sensor;
import android.hardware.SensorEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

import android.os.Bundle;
import dev.flutter.plugins.integration_test.IntegrationTestPlugin;
import dev.fluttercommunity.plus.sensors.SensorsPlugin;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.sensors.SensorsPlugin;

public class EmbeddingV1Activity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
IntegrationTestPlugin.registerWith(
registrarFor("dev.flutter.plugins.integration_test.IntegrationTestPlugin"));
SensorsPlugin.registerWith(registrarFor("io.flutter.plugins.sensors.SensorsPlugin"));
SensorsPlugin.registerWith(registrarFor("dev.fluttercommunty.plus.sensors.SensorsPlugin"));
}
}
1 change: 1 addition & 0 deletions packages/sensors_plus/example/ios/Flutter/.last_build_id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22217502d78c84badc56f9a54d0bdd3c
18 changes: 18 additions & 0 deletions packages/sensors_plus/example/ios/Flutter/Flutter.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# NOTE: This podspec is NOT to be published. It is only used as a local source!
#

Pod::Spec.new do |s|
s.name = 'Flutter'
s.version = '1.0.0'
s.summary = 'High-performance, high-fidelity mobile apps.'
s.description = <<-DESC
Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS.
DESC
s.homepage = 'https://flutter.io'
s.license = { :type => 'MIT' }
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.vendored_frameworks = 'Flutter.framework'
end
19 changes: 4 additions & 15 deletions packages/sensors_plus/example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
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, ); }; };
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, ); }; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
Expand All @@ -28,8 +24,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -40,15 +34,13 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
518BFCF6A33590E963FE1FA9 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
65D7779632A59CFED1723B85 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
Expand All @@ -63,8 +55,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
A5B646543530B300A487D9B1 /* libPods-Runner.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -84,9 +74,7 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
Expand Down Expand Up @@ -223,9 +211,12 @@
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/Flutter.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand All @@ -244,7 +235,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";
};
7B77DB2BA78582CC43C8E79F /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -315,7 +306,6 @@
/* Begin XCBuildConfiguration section */
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
Expand Down Expand Up @@ -372,7 +362,6 @@
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
Expand Down
17 changes: 0 additions & 17 deletions packages/sensors_plus/ios/Classes/FLTSensorsPlugin.h

This file was deleted.

17 changes: 17 additions & 0 deletions packages/sensors_plus/ios/Classes/FLTSensorsPlusPlugin.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import <Flutter/Flutter.h>

@interface FLTSensorsPlusPlugin : NSObject <FlutterPlugin>
@end

@interface FLTUserAccelStreamHandlerPlus : NSObject <FlutterStreamHandler>
@end

@interface FLTAccelerometerStreamHandlerPlus : NSObject <FlutterStreamHandler>
@end

@interface FLTGyroscopeStreamHandlerPlus : NSObject <FlutterStreamHandler>
@end
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "FLTSensorsPlugin.h"
#import "FLTSensorsPlusPlugin.h"
#import <CoreMotion/CoreMotion.h>

@implementation FLTSensorsPlugin
@implementation FLTSensorsPlusPlugin

+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
FLTAccelerometerStreamHandler* accelerometerStreamHandler =
[[FLTAccelerometerStreamHandler alloc] init];
FLTAccelerometerStreamHandlerPlus* accelerometerStreamHandler =
[[FLTAccelerometerStreamHandlerPlus alloc] init];
FlutterEventChannel* accelerometerChannel =
[FlutterEventChannel eventChannelWithName:@"plugins.flutter.io/sensors/accelerometer"
[FlutterEventChannel eventChannelWithName:@"dev.fluttercommunity.plus/sensors/accelerometer"
binaryMessenger:[registrar messenger]];
[accelerometerChannel setStreamHandler:accelerometerStreamHandler];

FLTUserAccelStreamHandler* userAccelerometerStreamHandler =
[[FLTUserAccelStreamHandler alloc] init];
FLTUserAccelStreamHandlerPlus* userAccelerometerStreamHandler =
[[FLTUserAccelStreamHandlerPlus alloc] init];
FlutterEventChannel* userAccelerometerChannel =
[FlutterEventChannel eventChannelWithName:@"plugins.flutter.io/sensors/user_accel"
[FlutterEventChannel eventChannelWithName:@"dev.fluttercommunity.plus/sensors/user_accel"
binaryMessenger:[registrar messenger]];
[userAccelerometerChannel setStreamHandler:userAccelerometerStreamHandler];

FLTGyroscopeStreamHandler* gyroscopeStreamHandler = [[FLTGyroscopeStreamHandler alloc] init];
FLTGyroscopeStreamHandlerPlus* gyroscopeStreamHandler =
[[FLTGyroscopeStreamHandlerPlus alloc] init];
FlutterEventChannel* gyroscopeChannel =
[FlutterEventChannel eventChannelWithName:@"plugins.flutter.io/sensors/gyroscope"
[FlutterEventChannel eventChannelWithName:@"dev.fluttercommunity.plus/sensors/gyroscope"
binaryMessenger:[registrar messenger]];
[gyroscopeChannel setStreamHandler:gyroscopeStreamHandler];
}
Expand All @@ -48,7 +49,7 @@ static void sendTriplet(Float64 x, Float64 y, Float64 z, FlutterEventSink sink)
sink([FlutterStandardTypedData typedDataWithFloat64:event]);
}

@implementation FLTAccelerometerStreamHandler
@implementation FLTAccelerometerStreamHandlerPlus

- (FlutterError*)onListenWithArguments:(id)arguments eventSink:(FlutterEventSink)eventSink {
_initMotionManager();
Expand All @@ -71,7 +72,7 @@ - (FlutterError*)onCancelWithArguments:(id)arguments {

@end

@implementation FLTUserAccelStreamHandler
@implementation FLTUserAccelStreamHandlerPlus

- (FlutterError*)onListenWithArguments:(id)arguments eventSink:(FlutterEventSink)eventSink {
_initMotionManager();
Expand All @@ -93,7 +94,7 @@ - (FlutterError*)onCancelWithArguments:(id)arguments {

@end

@implementation FLTGyroscopeStreamHandler
@implementation FLTGyroscopeStreamHandlerPlus

- (FlutterError*)onListenWithArguments:(id)arguments eventSink:(FlutterEventSink)eventSink {
_initMotionManager();
Expand Down
10 changes: 5 additions & 5 deletions packages/sensors_plus/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: sensors_plus
description: Flutter plugin for accessing accelerometer and gyroscope sensors.
version: 0.5.0
version: 0.6.0
homepage: https://plus.fluttercommunity.dev/
repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/

flutter:
plugin:
platforms:
android:
package: io.flutter.plugins.sensors
package: dev.fluttercommunity.plus.sensors
pluginClass: SensorsPlugin
ios:
pluginClass: FLTSensorsPlugin
pluginClass: FLTSensorsPlusPlugin
web:
default_package: sensors_plus_web

dependencies:
flutter:
sdk: flutter
sensors_plus_web: ^0.1.0
sensors_plus_platform_interface: ^0.1.0
sensors_plus_web: ^0.2.0
sensors_plus_platform_interface: ^0.2.0

dev_dependencies:
test: ^1.3.0
Expand Down
7 changes: 4 additions & 3 deletions packages/sensors_plus/test/sensors_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ void main() {
TestWidgetsFlutterBinding.ensureInitialized();

test('$accelerometerEvents are streamed', () async {
const String channelName = 'plugins.flutter.io/sensors/accelerometer';
const String channelName =
'dev.fluttercommunity.plus/sensors/accelerometer';
const List<double> sensorData = <double>[1.0, 2.0, 3.0];
_initializeFakeSensorChannel(channelName, sensorData);

Expand All @@ -25,7 +26,7 @@ void main() {
});

test('$gyroscopeEvents are streamed', () async {
const String channelName = 'plugins.flutter.io/sensors/gyroscope';
const String channelName = 'dev.fluttercommunity.plus/sensors/gyroscope';
const List<double> sensorData = <double>[3.0, 4.0, 5.0];
_initializeFakeSensorChannel(channelName, sensorData);

Expand All @@ -37,7 +38,7 @@ void main() {
});

test('$userAccelerometerEvents are streamed', () async {
const String channelName = 'plugins.flutter.io/sensors/user_accel';
const String channelName = 'dev.fluttercommunity.plus/sensors/user_accel';
const List<double> sensorData = <double>[6.0, 7.0, 8.0];
_initializeFakeSensorChannel(channelName, sensorData);

Expand Down
4 changes: 4 additions & 0 deletions packages/sensors_plus_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.0

- Renamed Method Channel

## 0.1.0

- Transfer to plus-plugins monorepo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import 'package:sensors_plus_platform_interface/sensors_plus_platform_interface.
/// A method channel -based implementation of the SensorsPlatform interface.
class MethodChannelSensors extends SensorsPlatform {
static const EventChannel _accelerometerEventChannel =
EventChannel('plugins.flutter.io/sensors/accelerometer');
EventChannel('dev.fluttercommunity.plus/sensors/accelerometer');

static const EventChannel _userAccelerometerEventChannel =
EventChannel('plugins.flutter.io/sensors/user_accel');
EventChannel('dev.fluttercommunity.plus/sensors/user_accel');

static const EventChannel _gyroscopeEventChannel =
EventChannel('plugins.flutter.io/sensors/gyroscope');
EventChannel('dev.fluttercommunity.plus/sensors/gyroscope');

Stream<AccelerometerEvent> _accelerometerEvents;
Stream<GyroscopeEvent> _gyroscopeEvents;
Expand Down
2 changes: 1 addition & 1 deletion packages/sensors_plus_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sensors_plus_platform_interface
description: A common platform interface for the sensors_plus plugin.
version: 0.1.0
version: 0.2.0
homepage: https://plus.fluttercommunity.dev/
repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/

Expand Down
Loading