Search code examples
flutterflutter-dependenciesphone-call

I have implemented a calling app in flutter. How to push a receiving screen when someone calls?


I want to implement the "Incoming Call" screen. I have tried using stream builder but it does not work when the app is closed.

return (userProvider != null && userProvider.getUSer != null)
        ? StreamBuilder<DocumentSnapshot>(
            stream: callMethods.callStream(uid: userProvider.getUSer.uid),
            builder: (context, snapshot) {
              if (snapshot.hasData && snapshot.data.data() != null) {
                print("not null");
                Call call = Call.fromMap(snapshot.data.data());
                if (!call.hasDialed) {
                  return PickupScreen(call: call);
                } else {
                  return scaffold;
                }
              }
              return scaffold;
            },
          )
        : Scaffold(
            body: Center(
              child: CircularProgressIndicator(),
            ),
          );

Solution

  • you can use native calling screen CallKit from iOS/ConnectionService from android for terminated app, use this package callkeep