<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Souhaib Afouallah</title>
    <description>The latest articles on DEV Community by Souhaib Afouallah (@souhaibafouallah).</description>
    <link>https://dev.to/souhaibafouallah</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F834057%2F42395b8c-de16-4ddd-aa47-5b8eb2fe5f8c.jpeg</url>
      <title>DEV Community: Souhaib Afouallah</title>
      <link>https://dev.to/souhaibafouallah</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/souhaibafouallah"/>
    <language>en</language>
    <item>
      <title>Keeping It Simple: Integrate Firebase and Agora.io in your Flutter Projects (Part 3)</title>
      <dc:creator>Souhaib Afouallah</dc:creator>
      <pubDate>Wed, 30 Mar 2022 09:46:39 +0000</pubDate>
      <link>https://dev.to/souhaibafouallah/keeping-it-simple-integrate-firebase-and-agoraio-in-your-flutter-projects-part-3-4a7n</link>
      <guid>https://dev.to/souhaibafouallah/keeping-it-simple-integrate-firebase-and-agoraio-in-your-flutter-projects-part-3-4a7n</guid>
      <description>&lt;p&gt;This post is the last part of the three-part article on integrating Firebase and Agora.io in a Flutter Project. In the first part, we’ve specified what Flutter is and how to create and run the project. In the second part, we’ve integrated Firebase for persisting data. &lt;br&gt;
In this part, we’ll be integrating Agora.io for our Real-Time communication needs, like Audio and Video calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Ever wondered how video and audio calls work? Ever thought of creating a chat application or just integrating it with an application?&lt;br&gt;
Then I can confidently say that all of the above can easily be implemented. Moreover, all of this can be done by any beginner without making them lose their mind.&lt;br&gt;
Yes, you've got it right. Whether you are a beginner or a pro developer with years of experience, this here is the perfect solution for you! &lt;br&gt;
Look at it like this, if there is a pre-built and perfectly working solution in front of you, would you try to create another solution that could potentially fail? Absolutely not! There's a lot on offer, pre-built and ready to use. It's all about having to find which one matches with the use case. &lt;br&gt;
So what next? Imagine we need to implement video and voice call functionality in our chat application, and we do not have the time and resources to start from scratch. As I already mentioned, there is a lot on offer, but obviously the patience to try each one of them is non-existent. This is where I introduce you to one of the easiest and powerful API’s by Agora.io .&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Agora.io?
&lt;/h2&gt;

&lt;p&gt;Agora.io is the leading video, voice and live interactive streaming platform, helping developers deliver rich in-app experiences—including embedded voice and video chat, real-time recording, interactive livestreaming, and real-time messaging.&lt;/p&gt;

&lt;p&gt;Agora.io provides building blocks that allow the addition of real-time voice and video communications through a simple and powerful SDK. This SDK can be integrated in an existing project to quickly enable real-time communications. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb9ak64gvh8g2gp96hdqa.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb9ak64gvh8g2gp96hdqa.jpg" alt="Agora Banner"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Agora’s Software-Defined Real-Time Network™ (SD-RTN™) is the world’s most widely used and intelligent RTE network. All audio and video services provided by the Agora SDK are deployed and transmitted through the Agora SD-RTN™.&lt;br&gt;
In a single line, Agora.io can offer a single solution for all your Real-Time Communication needs!&lt;/p&gt;

&lt;h3&gt;
  
  
  Why I opted for Agora.io?
&lt;/h3&gt;

&lt;p&gt;There are lots of reasons and features why I opted for Agora.io, some of which are: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;10,000 minutes FREE each month&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Good documentation, complemented by examples and sample code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easy to Implement&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Highly customizable. Pick and choose the calling or interactive broadcast features  needed.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What does Agora.io provide?
&lt;/h3&gt;

&lt;p&gt;After integrating the Agora SDK, you can call different sets of APIs to implement voice/video communications in different scenarios.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Voice SDK &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Video SDK&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Real-Time Messaging (RTM) SDK&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cloud Recording Add-on&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Want to learn more about the above? Then head on &lt;a href="https://docs.agora.io/en/Agora%20Platform/agora_platform?platform=All%20Platforms" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to implement Video and Voice calls in your project with Agora.io?
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;To start implementing Agora.io, you will need a &lt;a href="https://docs.agora.io/en/Agora%20Platform/sign_in_and_sign_up" rel="noopener noreferrer"&gt;valid Agora account&lt;/a&gt; . For the other prerequisites, please check &lt;a href="https://docs.agora.io/en/Voice/run_demo_voice_call_android?platform=Android#prerequisites" rel="noopener noreferrer"&gt;the Agora website&lt;/a&gt;. &lt;/p&gt;

&lt;h3&gt;
  
  
  Create an Agora project
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Enter the &lt;a href="https://console.agora.io/projects" rel="noopener noreferrer"&gt;Project Management&lt;/a&gt; page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Follow the on-screen instructions to enter a project name and use case, and check &lt;strong&gt;Secured mode: APP ID + Token (Recommended)&lt;/strong&gt; as the authentication mechanism.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Submit&lt;/strong&gt;. You can now see the project on the &lt;strong&gt;Project Management&lt;/strong&gt; page.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmvjflim4khhemtxiihcz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmvjflim4khhemtxiihcz.png" alt="Agora Dev Console"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally! Your first project in agora.io is created! Now what?&lt;/p&gt;

&lt;h4&gt;
  
  
  Get the App ID
&lt;/h4&gt;

&lt;p&gt;Agora automatically assigns each project an App ID as a unique identifier.&lt;br&gt;
To copy this App ID, find your project on the Project Management page in Agora Console, and copy the value in the App ID column.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30lbsclcj2p3f3m1eko2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30lbsclcj2p3f3m1eko2.png" alt="Instruction one"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Generate a temporary token
&lt;/h4&gt;

&lt;p&gt;To ensure communication security, Agora recommends using tokens to authenticate users joining a channel.&lt;br&gt;
For testing purposes, Agora Console supports generating RTC temporary tokens. To generate an RTC temporary token:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On the Project Management page, find your project and click &lt;strong&gt;Config&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5nycrkb1xpl4qrhlf2kt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5nycrkb1xpl4qrhlf2kt.png" alt="Instruction Two"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Generate temp RTC token&lt;/strong&gt; under Primary Certificate, which leads to the &lt;strong&gt;Token&lt;/strong&gt; page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft0cl0szhpej5r03wvarj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft0cl0szhpej5r03wvarj.png" alt="Instruction Three"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On the &lt;strong&gt;Token page&lt;/strong&gt;, enter the &lt;strong&gt;name of the channel&lt;/strong&gt; that you want to join, and click &lt;strong&gt;Generate Temp Token&lt;/strong&gt;. When joining the channel later, ensure that the channel name is the same with the one that you use to generate this temporary token.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Temporary tokens are for &lt;strong&gt;demonstration and testing purposes only&lt;/strong&gt;, and remain &lt;strong&gt;valid for 24 hours&lt;/strong&gt;. In a production environment, you need to deploy your own server for generating tokens. For more information, see &lt;strong&gt;Authenticate Your Users with Tokens&lt;/strong&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Integrate the Agora SDK&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now that everything is prepared, we can start integrating Agora in a project.&lt;br&gt;
Let’s begin:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download the &lt;a href="https://pub.dev/packages/agora_rtc_engine" rel="noopener noreferrer"&gt;Agora RTC engine&lt;/a&gt; Flutter packages and add it to the projects &lt;strong&gt;pubspec.yaml&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;

&lt;span class="nl"&gt;dependencies:&lt;/span&gt;
  &lt;span class="nl"&gt;flutter:&lt;/span&gt;
    &lt;span class="nl"&gt;sdk:&lt;/span&gt; &lt;span class="n"&gt;flutter&lt;/span&gt;
  &lt;span class="nl"&gt;agora_rtc_engine:&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mf"&gt;5.0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Keep your &lt;strong&gt;App ID&lt;/strong&gt;, &lt;strong&gt;channel name&lt;/strong&gt; and &lt;strong&gt;generated temp token&lt;/strong&gt; by hand, it will be used in the next step. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First of all, the connection with Agora needs to be initialized. Define an asynchronous function that will handle the initialization and call this function in the initState() function. &lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;appId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;YOUR&lt;/span&gt; &lt;span class="n"&gt;APP&lt;/span&gt; &lt;span class="n"&gt;ID&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;channelName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;YOUR&lt;/span&gt; &lt;span class="n"&gt;CHANNEL&lt;/span&gt; &lt;span class="n"&gt;NAME&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;tempToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;YOUR&lt;/span&gt; &lt;span class="n"&gt;GENERATED&lt;/span&gt; &lt;span class="n"&gt;TEMP&lt;/span&gt; &lt;span class="n"&gt;TOKEN&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;_remoteUid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;late&lt;/span&gt; &lt;span class="n"&gt;RtcEngine&lt;/span&gt; &lt;span class="n"&gt;_engine&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@override&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;initState&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;initState&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
   &lt;span class="n"&gt;initAgora&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;Future&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;initAgora&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kd"&gt;async&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="c1"&gt;// retrieve permissions using permission_handler package&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Permission&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;microphone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Permission&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;camera&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;request&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="c1"&gt;// create the Real Time Communication (RTC) engine&lt;/span&gt;
  &lt;span class="n"&gt;_engine&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;RtcEngine&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;RtcEngineConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;appId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Enable Video calls&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_engine&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;enableVideo&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="c1"&gt;// Or enable Audio calls&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_engine&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;enableAudio&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="c1"&gt;// The most important part of the _engine is event handling&lt;/span&gt;
  &lt;span class="c1"&gt;// Define what the _engine should do if an event occurs&lt;/span&gt;

  &lt;span class="n"&gt;_engine&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setEventHandler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="n"&gt;RtcEngineEventHandler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nl"&gt;joinChannelSuccess:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;channel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;elapsed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"local user &lt;/span&gt;&lt;span class="si"&gt;$uid&lt;/span&gt;&lt;span class="s"&gt; joined"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="nl"&gt;userJoined:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;elapsed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"remote user &lt;/span&gt;&lt;span class="si"&gt;$uid&lt;/span&gt;&lt;span class="s"&gt; joined"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
          &lt;span class="n"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;_remoteUid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="nl"&gt;userOffline:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;UserOfflineReason&lt;/span&gt; &lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"remote user &lt;/span&gt;&lt;span class="si"&gt;$uid&lt;/span&gt;&lt;span class="s"&gt; left channel"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
          &lt;span class="n"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;_remoteUid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
          &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_engine&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;joinChannel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;channelName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We’re almost there. Now that the engine is initialized, the UI is next on the list. At this stage, let your imagination run wild whilst creating a stunning UI for either the Audio or Video Call screens. &lt;/p&gt;

&lt;p&gt;For the other parts of this article, please visit following links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/souhaibafouallah/keeping-it-simple-integrate-firebase-and-agoraio-in-your-flutter-projects-part-1-1md"&gt;Part 1: What is Flutter and How to start? &lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/souhaibafouallah/keeping-it-simple-integrate-firebase-and-agoraio-in-your-flutter-projects-part-2-13gi"&gt;Part 2: Integrating Firebase for the Backend of the application.&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>firebase</category>
      <category>flutter</category>
      <category>mobile</category>
      <category>agoraio</category>
    </item>
    <item>
      <title>Keeping It Simple: Integrate Firebase and Agora.io in your Flutter Projects (Part 2)</title>
      <dc:creator>Souhaib Afouallah</dc:creator>
      <pubDate>Wed, 30 Mar 2022 09:46:35 +0000</pubDate>
      <link>https://dev.to/souhaibafouallah/keeping-it-simple-integrate-firebase-and-agoraio-in-your-flutter-projects-part-2-13gi</link>
      <guid>https://dev.to/souhaibafouallah/keeping-it-simple-integrate-firebase-and-agoraio-in-your-flutter-projects-part-2-13gi</guid>
      <description>&lt;p&gt;This post is the second part of the three-part article on integrating Firebase and Agora.io in a Flutter Project. In the first part, we’ve specified what Flutter is and how to create and run the project. &lt;br&gt;
In this part, we’ll be integrating Firebase and persist user data.&lt;/p&gt;
&lt;h2&gt;
  
  
  Backend as a Service (BaaS)
&lt;/h2&gt;

&lt;p&gt;As the backend for Flutter, we decided to use Firebase. Firebase is a Backend-as-a-Service platform from Google. &lt;/p&gt;

&lt;p&gt;Firebase provides a variety of services, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Real-time database: This is a cloud-hosted NoSQL database that gives the developer the ability to store data and sync it between users in real time. If the app goes offline, the data is still available.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Authentication: Firebase Authentication makes sure that the app can be built with secure authentication systems and enhances the login experience. Not only can you use your ‘local’ login credentials but Google, Facebook, GitHub and much more services can be used to log in.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reporting and Monitoring: The reporting and monitoring tools that Firebase provides are impressive. It connects to Google Analytics to provide free, unlimited reports about user behaviors, which gives the developer the ability to have better decision-making performance. Besides reporting, Firebase Performance Monitoring service allows you to have an insight into the performance characteristics of your app. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7rXqA_YW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1q6ikgkb9o8nj9er63f3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7rXqA_YW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1q6ikgkb9o8nj9er63f3.png" alt="Firebase Console" width="880" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Impressive right? Let’s take a look at how we used it in our app.&lt;/p&gt;

&lt;p&gt;First, we need to understand how we need to connect our Flutter app to the Firebase service. Take a look at &lt;a href="https://firebase.google.com/docs/flutter/setup?platform=ios"&gt;How to set up Firebase.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now everything is set up, let’s start to use the real-time database. In this small tutorial, we are going to tackle how we can save to and read from the database. &lt;/p&gt;

&lt;p&gt;In Firebase, we’re going to make our first collection named ‘notes’.&lt;br&gt;
In the screenshot below, you’ll see a few more as an example.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4whqj5Yb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ru3hct3dwi689kx0z7ef.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4whqj5Yb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ru3hct3dwi689kx0z7ef.png" alt="Database Collection" width="512" height="176"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are going to add the firebase packages to our &lt;strong&gt;pubspec.yaml&lt;/strong&gt; file. Let’s also add the authentication package. &lt;/p&gt;

&lt;p&gt;Always search for the latest version of the packages on &lt;a href="https://pub.dev/"&gt;https://pub.dev/&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="nl"&gt;dependencies:&lt;/span&gt;
 &lt;span class="nl"&gt;flutter:&lt;/span&gt;
   &lt;span class="nl"&gt;sdk:&lt;/span&gt; &lt;span class="n"&gt;flutter&lt;/span&gt;
 &lt;span class="nl"&gt;firebase_core:&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mf"&gt;1.12&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
 &lt;span class="nl"&gt;firebase_auth:&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mf"&gt;3.3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To use the package we’re going to import it into our dart file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:cloud_firestore/cloud_firestore.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:firebase_auth/firebase_auth.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the code below you see how we can reference our notes collection and add a new item. It’s that simple.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;CollectionReference&lt;/span&gt; &lt;span class="n"&gt;ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;     &lt;span class="n"&gt;FirebaseFirestore&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;instance&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;collection&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'notes'&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FirebaseAuth&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;instance&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;currentUser&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;doc&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="na"&gt;uid&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
   &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;collection&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'notes'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
   &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;({&lt;/span&gt;
 &lt;span class="s"&gt;'title'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s"&gt;'Flutter Demo'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
 &lt;span class="s"&gt;'content'&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s"&gt;'First Note'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
 &lt;span class="s"&gt;'owner'&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="na"&gt;uid&lt;/span&gt;
&lt;span class="o"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more advanced usage of realtime databases check&lt;a href="https://firebase.flutter.dev/docs/database/overview"&gt; Realtime Database: Overview.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why did we choose Firebase?
&lt;/h2&gt;

&lt;p&gt;Well, both Flutter and Firebase are Google products. This makes it convenient for the developer, connections are easily programmed (as you saw in the tutorial!). Firebase SDK and UI libraries are instant and also quite stable.&lt;/p&gt;

&lt;p&gt;It gives the developer the experience of an easy and fast development and the user a smooth usage of the app.&lt;/p&gt;

&lt;p&gt;What’s next?&lt;/p&gt;

&lt;p&gt;We’re almost there. There is only one important thing on our TODO list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Integrate Agora.io for our Real-Time Communication Needs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://dev.to/souhaibafouallah/keeping-it-simple-integrate-firebase-and-agoraio-in-your-flutter-projects-part-3-4a7n"&gt;In part 3 we’ll be integrating Agora.io in our project.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>firebase</category>
      <category>agoraio</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Keeping It Simple: Integrate Firebase and Agora.io in your Flutter Projects (Part 1)</title>
      <dc:creator>Souhaib Afouallah</dc:creator>
      <pubDate>Wed, 30 Mar 2022 09:46:28 +0000</pubDate>
      <link>https://dev.to/souhaibafouallah/keeping-it-simple-integrate-firebase-and-agoraio-in-your-flutter-projects-part-1-1md</link>
      <guid>https://dev.to/souhaibafouallah/keeping-it-simple-integrate-firebase-and-agoraio-in-your-flutter-projects-part-1-1md</guid>
      <description>&lt;p&gt;Since its much-awaited launch, Flutter has caught a lot of attention, and we're excited about it too! It has been growing in popularity over the past few years because of the ease of use and the ability to develop for multiple platforms with a single code base. &lt;br&gt;
In this article, we will show you how to create your own Flutter Mobile Messaging Application in combination with Firebase and Agora.io . &lt;/p&gt;
&lt;h2&gt;
  
  
  What we’re about to do and Why we’re doing it
&lt;/h2&gt;

&lt;p&gt;Due to the recent scandal(s) of Meta - WhatsApp, my team and I have chosen to take the Signal route and build our own Mobile Chat Application. By doing so, we show that System and Network Engineers are certainly versatile, full-fledged Computer Scientists. For this project, our main focus shifted mostly towards UI and UX. The technologies we dove into are Figma, Flutter, Firebase and Agora.io .&lt;/p&gt;

&lt;p&gt;To bring these together, a Mobile Messaging Application was developed to allow people to securely connect with each other . This was completely written using Flutter, a UI framework by Google. It enables us to develop an application with only one code base that can run on Android, IOS and Web. Desktop was recently added too. On top of that, the project was built on top of Firebase, a Backend as a Service (BaaS) by Google. In addition, Agora.io is used to make video/voice calls possible.&lt;/p&gt;
&lt;h2&gt;
  
  
  Flutter: What, How, … ?
&lt;/h2&gt;

&lt;p&gt;What is Flutter, and how is it different? Flutter is designed to run on every device, so it works with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;iOS and Android&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Web and Desktop (Mac, Windows, and Ubuntu) - Even support PWA&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Auto &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Raspberry Pi (POC stage)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check out this video from Google, they give a great comparison between Native Development, Hybrid App Development, React Native Development, and Flutter App Development.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/l-YO9CmaSUM"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Let’s get started!
&lt;/h2&gt;

&lt;p&gt;First of all we will start with setting up flutter, it is relatively straightforward to set up. Just follow the steps in the link below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://flutter.dev/docs/get-started/install"&gt;https://flutter.dev/docs/get-started/install&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The flutter package also comes with Dart preinstalled which is the language used to build apps. Dart is an object-oriented, class-based, garbage-collected language with C-style syntax.&lt;/p&gt;

&lt;p&gt;If you would like to develop apps for mobile as well you should definitely follow the steps to install Android Studio and configure it. After the installation, you will have to create an Android Emulator. The following link may help:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.android.com/studio/run/managing-avds"&gt;https://developer.android.com/studio/run/managing-avds&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you are done with following the instructions on the website of flutter we can continue with creating a first project!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;flutter&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="n"&gt;new_project&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will create the basics of a new flutter project and a demo app with simple functionality in a folder named new_project. Open this folder in Android Studio or Visual Studio Code to start your journey.&lt;/p&gt;

&lt;p&gt;If you are using Visual Studio Code, you will need to install some additional extensions.&lt;/p&gt;

&lt;p&gt;Visual Studio Code will most likely notify you automatically that the &lt;a href="https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter"&gt;Flutter &lt;/a&gt;and &lt;a href="https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code"&gt;Dart&lt;/a&gt; extensions are required (Because who would want to program without some form of IntelliSense or debugging info).&lt;/p&gt;

&lt;p&gt;We can now run our app for the first time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Hqa8D2mS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c8w8bwawxxh9v3fe9y9t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Hqa8D2mS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c8w8bwawxxh9v3fe9y9t.png" alt="Emulator" width="402" height="846"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations, you have your first app! When you press the button, the counter goes up… That’s it! Kind of disappointing, is it not? Time to change that, but first…&lt;/p&gt;

&lt;p&gt;“How does this all work? What are all these files? I’m confused!”&lt;br&gt;
No worries, we got you!&lt;/p&gt;

&lt;p&gt;The most important file is in the lib folder, the main.dart file. This file is the start of everything and where you will expand upon.&lt;/p&gt;

&lt;p&gt;Flutter uses widgets. To fully understand what they are and how to use them, following link may be of use: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.flutter.dev/resources/architectural-overview"&gt;https://docs.flutter.dev/resources/architectural-overview&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In short, widgets are the building blocks of Flutter, almost everything is a widget. They are mainly divided into two types, namely stateless and stateful widgets. &lt;br&gt;
Stateless Widgets are widgets whose state doesn't change, like a button or an image. This means that it doesn't change its state when an action is performed. And you guessed it, stateful widgets can keep a state, for example the currently selected tab of your navigation. &lt;/p&gt;

&lt;p&gt;We can change this state by calling a function setState(), this function is also present in the Flutter demo project with some default explanation. You can find it in the main.dart file on line 54.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;setState&lt;/span&gt;&lt;span class="o"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// This call to setState tells the Flutter framework that something has&lt;/span&gt;
      &lt;span class="c1"&gt;// changed in this State, which causes it to rerun the build method below&lt;/span&gt;
      &lt;span class="c1"&gt;// so that the display can reflect the updated values. If we changed&lt;/span&gt;
      &lt;span class="c1"&gt;// _counter without calling setState(), then the build method would not be&lt;/span&gt;
      &lt;span class="c1"&gt;// called again, and so nothing would appear to happen.&lt;/span&gt;
      &lt;span class="n"&gt;_counter&lt;/span&gt;&lt;span class="o"&gt;++;&lt;/span&gt;
    &lt;span class="o"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(P.S.: While you are there, it might be useful to read all the comments, it will help you greatly.)&lt;/p&gt;

&lt;p&gt;Now we can divide the widgets again into visible and invisible widgets. The invisible widgets are used for layout, like a column and a row, a grid layout… and many more. These widgets define the location of the visible widgets like an image, text, buttons… &lt;/p&gt;

&lt;p&gt;Following example will illustrate this further.&lt;br&gt;
For example, we want to make a bar with a total of 3 icons and text underneath them to make it clear what they all are. Something like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1TaDRIJR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9y93orrc2k0p20zhy85z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1TaDRIJR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9y93orrc2k0p20zhy85z.png" alt="NavBar" width="400" height="46"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How do we go about this… To make it easier to explain we will start with a diagram visualization of the concept.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4sdeQJP6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dnbwpytpwgfbl331y2ui.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4sdeQJP6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dnbwpytpwgfbl331y2ui.png" alt="Widget Hierarchy" width="600" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will start with a container (an invisible widget to define layout) and place a row in it. In this row we will create a total of 3 columns, a widget in a widget is defined as a child. If the widget supports more than 1 it will be a list of children. The list of children will be rendered following the order you put them in. So in our example we have to put the icon and then the text because we want the text to be underneath the icon.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;Container&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
        &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Row&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
          &lt;span class="nl"&gt;children:&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;
            &lt;span class="n"&gt;Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
              &lt;span class="nl"&gt;children:&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;
                &lt;span class="n"&gt;Icon&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Icons&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;call&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
                &lt;span class="n"&gt;Container&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
                  &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Text&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'CALL'&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
                &lt;span class="o"&gt;)&lt;/span&gt;
              &lt;span class="o"&gt;],&lt;/span&gt;
            &lt;span class="o"&gt;),&lt;/span&gt;
            &lt;span class="n"&gt;Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
              &lt;span class="nl"&gt;children:&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;
                &lt;span class="n"&gt;Icon&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Icons&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;near_me&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
                &lt;span class="n"&gt;Container&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
                  &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Text&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'ROUTE'&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
                &lt;span class="o"&gt;)&lt;/span&gt;
              &lt;span class="o"&gt;],&lt;/span&gt;
            &lt;span class="o"&gt;),&lt;/span&gt;
            &lt;span class="n"&gt;Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
              &lt;span class="nl"&gt;children:&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;
                &lt;span class="n"&gt;Icon&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Icons&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;share&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
                &lt;span class="n"&gt;Container&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
                  &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Text&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'SHARE'&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
                &lt;span class="o"&gt;)&lt;/span&gt;
              &lt;span class="o"&gt;],&lt;/span&gt;
            &lt;span class="o"&gt;)&lt;/span&gt;
          &lt;span class="o"&gt;],&lt;/span&gt;
        &lt;span class="o"&gt;),&lt;/span&gt;
      &lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to dive deeper into this you can follow this basic tutorial &lt;a href="https://docs.flutter.dev/development/ui/layout"&gt;https://docs.flutter.dev/development/ui/layout&lt;/a&gt; .&lt;/p&gt;

&lt;p&gt;And voilà, you have made your own bar with 3 icons. We can expand on this by for example changing the Icon widgets to IconButton widgets to add functionality to them when pressed. Every widget is self-explanatory and well documented, you just have to find the right combinations to make your own app.&lt;/p&gt;

&lt;p&gt;What’s next?&lt;/p&gt;

&lt;p&gt;We’re not quite finished. There are two important things on our TODO list:&lt;br&gt;
Integrate Firebase for user authentication and database storage.&lt;br&gt;
Integrate Agora.io for our Real-Time Communication Needs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/souhaibafouallah/keeping-it-simple-integrate-firebase-and-agoraio-in-your-flutter-projects-part-2-13gi"&gt;In part 2 we’ll be integrating Firebase for the Backend of the application. &lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>firebase</category>
      <category>agoraio</category>
      <category>mobile</category>
    </item>
  </channel>
</rss>
