Plugin that can listen to rotary events on Galaxy watch devices.
To use this plugin, add wearable_rotary as a dependency in your pubspec.yaml file:
dependencies:
wearable_rotary: ^1.0.1
// Import package.
import 'package:wearable_rotary/wearable_rotary.dart';
// Be informed when the event (RotaryEvent.clockwise, RotaryEvent.counterClockwise) occurs.
StreamSubscription<RotaryEvent> rotarySubscription =
rotaryEvents.listen((RotaryEvent event) {
if (event == RotaryEvent.clockwise) {
// Do something.
} else if (event == RotaryEvent.counterClockwise) {
// Do something.
}
});
// Be sure to cancel on dispose.
rotarySubscription.cancel();
This plugin is supported only on Galaxy watches.