Skip to content

Instantly share code, notes, and snippets.

@Ayush783
Created March 7, 2024 11:40
Show Gist options
  • Save Ayush783/0171770941937a6c142a56eda1d5e159 to your computer and use it in GitHub Desktop.
Save Ayush783/0171770941937a6c142a56eda1d5e159 to your computer and use it in GitHub Desktop.
Service class for FlutterCallingKit
class CallingKitService {
static final CallingKitService _instance = CallingKitService._internal();
factory CallingKitService() {
return _instance;
}
CallingKitService._internal() {
MethodChannel('YOUR_CHANNEL_NAME').setMethodCallHandler(
(call) async {
if (call.method == 'CALL_ACCEPTED_INTENT') {
final data = call.arguments;
if (data != null) {
// Handle data found
} else {
// Handle no data found
}
}
},
);
}
static void showCallkitIncoming(...) async {
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment