Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
[sensors_plus] renamed method channel
  • Loading branch information
miquelbeltran committed Dec 12, 2020
commit 16d872becc9c6b0b78565822698da4a6735d39bf
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
/** 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
6 changes: 3 additions & 3 deletions packages/sensors_plus/ios/Classes/FLTSensorsPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
FLTAccelerometerStreamHandler* accelerometerStreamHandler =
[[FLTAccelerometerStreamHandler 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];
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];
FlutterEventChannel* gyroscopeChannel =
[FlutterEventChannel eventChannelWithName:@"plugins.flutter.io/sensors/gyroscope"
[FlutterEventChannel eventChannelWithName:@"dev.fluttercommunity.plus/sensors/gyroscope"
binaryMessenger:[registrar messenger]];
[gyroscopeChannel setStreamHandler:gyroscopeStreamHandler];
}
Expand Down
6 changes: 3 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,7 @@ 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 +25,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 +37,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
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ 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 @@ -43,7 +43,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 @@ -55,7 +55,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