monorepo/dialer/lib/services/call_service.dart
Florian Griffon ae56fc876f
All checks were successful
/ mirror (push) Successful in 4s
feat: trigger call from app
2025-02-19 15:47:22 +02:00

27 lines
662 B
Dart

import 'package:flutter/services.dart';
// Service to manage call-related operations
class CallService {
static const MethodChannel _channel = MethodChannel('call_service');
// Function to make a GSM call
Future<void> makeGsmCall(String phoneNumber) async {
try {
await _channel.invokeMethod('makeGsmCall', {"phoneNumber": phoneNumber});
} catch (e) {
print("Error making call: $e");
rethrow;
}
}
// Function to hang up the current call
Future<void> hangUpCall() async {
try {
await _channel.invokeMethod('hangUpCall');
} catch (e) {
print("Error hanging up call: $e");
rethrow;
}
}
}