Building a VOIP App with Flutter — Part 1

Chiziaruhoma Ogbonda
Jun 13 · 2 min read
Image for post
Image for post

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.

Image for post
Image for post
Project Structure

Setting up Firebase Login and Authentication:

Image for post
Image for post
Zchat will have this basic flow

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.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store