How to make a direct phone call in FlutterFlow?

Custom Code

I understand the FF doesn't provide the direct phone call action so I wrote a custom action using flutter_phone_direct_caller package. the code like below:

However the action seems not like what I expected. the app launched dialing screen and the number, rather than direct dialing. Anyone has the same issue?

What have you tried so far?
// Automatic FlutterFlow imports
import '/backend/schema/structs/index.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!

import 'package:flutter_phone_direct_caller/flutter_phone_direct_caller.dart';

Future directCall(String callNumber) async {
  // make a direct call
  try {
    await FlutterPhoneDirectCaller.callNumber(callNumber);
  } catch (e) {
    print(e);
  }
}
Did you check FlutterFlow's Documentation for this topic?
No
1
2 replies