Building a VOIP App with Flutter — Part 1
Building a VOIP (Video + Voice) app could be a very tasking experience for a junior to mid-level flutter developer. From complex plugin setup to the writing platform-specific code on both Android and iOS. Well, let’s see how well this series can help simplify it.
The two best options you have if you want to build a VOIP app are WebRTC and Agora SDK. I'll be using Agora and Firebase though because its easier to set up with fewer bugs. Here are the stages we would be breaking the project into.
Building ZChat
• Project Setup: Includes addition of cloud_firestore
and firebase_auth
packages. I’d be skipping this part in this tutorial the respective docs can guide you on properly integrating firebase with flutter. I will be using Provider for state management hence my default MVVM structure, I use it in all my projects even though there might be some slight modifications or rearrangement.
Setting up Firebase Login and Authentication:
Creating a UserModel
Our user model will house basic information about the user.
Firebase Auth Handler:
This is a singleton class to handle everything from login, signup, and reset-password functionalities.
Provider Setup
My provider setup is pretty easy. Create a MultiProvider
above the MaterialApp
widget. Then create and register individual ChangeNotifiers
that would act as ViewModels.
As much as id love to display the rest of code here but its too long. All that's left is building the UI and making the calls to firebase for login and signup. For the complete code check the repository on github. The next part would be more detailed explaining how to configure the Agora SDK and various additional plugins.