Files
rog_app/ios_setup/services/motion_service.dart

22 lines
611 B
Dart
Raw Normal View History

2024-09-03 22:17:09 +09:00
import 'package:flutter/services.dart';
class MotionService {
static const MethodChannel _channel = MethodChannel('com.yourcompany.app/motion');
static Future<void> startMotionUpdates() async {
try {
await _channel.invokeMethod('startMotionUpdates');
} on PlatformException catch (e) {
print("Failed to start motion updates: '${e.message}'.");
}
}
static Future<void> stopMotionUpdates() async {
try {
await _channel.invokeMethod('stopMotionUpdates');
} on PlatformException catch (e) {
print("Failed to stop motion updates: '${e.message}'.");
}
}
}