<?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>Forem: Akhil George</title>
    <description>The latest articles on Forem by Akhil George (@akhilge0rge).</description>
    <link>https://forem.com/akhilge0rge</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%2F794336%2F09417a21-a9a0-49be-8395-6a92e9dae02b.png</url>
      <title>Forem: Akhil George</title>
      <link>https://forem.com/akhilge0rge</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/akhilge0rge"/>
    <language>en</language>
    <item>
      <title>How to create a Notched Bottom Navigation Bar Flutter</title>
      <dc:creator>Akhil George</dc:creator>
      <pubDate>Fri, 07 Apr 2023 07:06:12 +0000</pubDate>
      <link>https://forem.com/akhilge0rge/how-to-create-a-notched-bottom-navigation-bar-flutter-1fkc</link>
      <guid>https://forem.com/akhilge0rge/how-to-create-a-notched-bottom-navigation-bar-flutter-1fkc</guid>
      <description>&lt;p&gt;This guide will demonstrate how to add a notched floating action button to the bottom navigation app bar. The bottom bar’s notched floating action button enhances the aesthetics of your app’s user interface. For more information, see the code below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V3zqY6UP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zl51350wtxfqapp1va9d.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V3zqY6UP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zl51350wtxfqapp1va9d.jpg" alt="BottomAppBar with Center Notch" width="880" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s get started&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;&lt;em&gt;BottomAppBar&lt;/em&gt;&lt;/strong&gt;with the &lt;strong&gt;&lt;em&gt;FloatingActionButton&lt;/em&gt;&lt;/strong&gt; can be added to your app using the code below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Scaffold(
      floatingActionButton: FloatingActionButton(
        onPressed: () {},
        child: const Icon(Icons.add),
      ),
      bottomNavigationBar: BottomAppBar(
        padding: const EdgeInsets.symmetric(horizontal: 10),
        height: 60,
        color: Colors.cyan.shade400,
        notchMargin: 5,
        child: Row(
          mainAxisSize: MainAxisSize.max,
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: &amp;lt;Widget&amp;gt;[
            IconButton(
              icon: const Icon(
                Icons.menu,
                color: Colors.black,
              ),
              onPressed: () {},
            ),
            IconButton(
              icon: const Icon(
                Icons.search,
                color: Colors.black,
              ),
              onPressed: () {},
            ),
            IconButton(
              icon: const Icon(
                Icons.print,
                color: Colors.black,
              ),
              onPressed: () {},
            ),
            IconButton(
              icon: const Icon(
                Icons.people,
                color: Colors.black,
              ),
              onPressed: () {},
            ),
          ],
        ),
      ),
    );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code’s output is shown below, and when you run it, your app will have a &lt;strong&gt;&lt;em&gt;BottomAppBar&lt;/em&gt;&lt;/strong&gt;with a ready-to-use &lt;strong&gt;&lt;em&gt;FloatingActionButton&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eaSLEKpE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i2jh1m9lwenumgeutail.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eaSLEKpE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i2jh1m9lwenumgeutail.jpg" alt="BottomAppBar with FloatingActionButton" width="880" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To start, position the &lt;strong&gt;&lt;em&gt;FloatingActionButton&lt;/em&gt;&lt;/strong&gt;button using the Scaffold widget’s &lt;strong&gt;&lt;em&gt;floatingActionButtonLocation&lt;/em&gt;&lt;/strong&gt;attribute.&lt;br&gt;
We’ll use the centerDocked as shown below to position it in the center:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As shown below, apply the shape to the BottomAppBar.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;shape: const CircularNotchedRectangle()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Pgnwpayo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kydhm98za68ehuy3ck3x.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Pgnwpayo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kydhm98za68ehuy3ck3x.jpg" alt="Center Notched BottomAppBar" width="880" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;specifying &lt;strong&gt;&lt;em&gt;extendBody&lt;/em&gt;&lt;/strong&gt; : &lt;strong&gt;&lt;em&gt;true&lt;/em&gt;&lt;/strong&gt;ensures that the scaffold’s body will be visible through the bottom navigation bar’s notch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; extendBody: true,
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fhVtEDaP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r3n1tbrtr0bquh9v3nrr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fhVtEDaP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r3n1tbrtr0bquh9v3nrr.jpg" alt="BottomAppBar with Center Notch" width="880" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s it. 🎉🎉&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Full Code :&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return Scaffold(
      extendBody: true,
      floatingActionButton: FloatingActionButton(
        onPressed: () {},
        child: const Icon(Icons.add),
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      bottomNavigationBar: BottomAppBar(
        padding: const EdgeInsets.symmetric(horizontal: 10),
        height: 60,
        color: Colors.cyan.shade400,
        shape: const CircularNotchedRectangle(),
        notchMargin: 5,
        child: Row(
          mainAxisSize: MainAxisSize.max,
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: &amp;lt;Widget&amp;gt;[
            IconButton(
              icon: const Icon(
                Icons.menu,
                color: Colors.black,
              ),
              onPressed: () {},
            ),
            IconButton(
              icon: const Icon(
                Icons.search,
                color: Colors.black,
              ),
              onPressed: () {},
            ),
            IconButton(

              icon: const Icon(
                Icons.print,
                color: Colors.black,
              ),
              onPressed: () {},
            ),
            IconButton(
              icon: const Icon(
                Icons.people,
                color: Colors.black,
              ),
              onPressed: () {},
            ),
          ],
        ),
      ),

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

&lt;/div&gt;



&lt;p&gt;Thanks :)&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
