monorepo/dialer/lib/services/call_service.dart
Florian Griffon 399870d218
Some checks failed
/ mirror (push) Successful in 4s
/ build (push) Failing after 5s
feat: trigger call from app (from composition page and contact modal) (#38)
Reviewed-on: #38
Co-authored-by: Florian Griffon <florian.griffon@epitech.eu>
Co-committed-by: Florian Griffon <florian.griffon@epitech.eu>
2025-02-19 13:52:43 +00: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;
}
}
}