<?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: Breno Teodoro</title>
    <description>The latest articles on DEV Community by Breno Teodoro (@brenodt).</description>
    <link>https://dev.to/brenodt</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%2F418410%2F94a5b441-adbb-41db-a934-fe237cfdb823.jpeg</url>
      <title>DEV Community: Breno Teodoro</title>
      <link>https://dev.to/brenodt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/brenodt"/>
    <language>en</language>
    <item>
      <title>Animated Search Field with Flutter</title>
      <dc:creator>Breno Teodoro</dc:creator>
      <pubDate>Sat, 27 Jun 2020 21:34:46 +0000</pubDate>
      <link>https://dev.to/brenodt/animated-search-field-with-flutter-3gn2</link>
      <guid>https://dev.to/brenodt/animated-search-field-with-flutter-3gn2</guid>
      <description>&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/brenodt/embed/vYLxGwj?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Ever thought about how to make your default AppBar more dynamic? Here's an inspiration for you!&lt;/p&gt;

&lt;p&gt;The gist is pretty straight-forward:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;On your &lt;code&gt;AppBar&lt;/code&gt;, within your &lt;code&gt;Scaffold&lt;/code&gt;, add a &lt;em&gt;toggle&lt;/em&gt; button on the &lt;code&gt;actions&lt;/code&gt; parameter;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In my case, this is represented by an &lt;code&gt;IconButton&lt;/code&gt; with a &lt;em&gt;search&lt;/em&gt; Icon.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;title&lt;/code&gt; parameter can receive any Widget. I've used a &lt;code&gt;Stack&lt;/code&gt; to add the standard written title and a &lt;code&gt;TextField&lt;/code&gt; to that parameter;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Finally, I've created a stateful class to abstract the animation logic, which can be somewhat confusing at first, but it's very simple at the core:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I use a &lt;code&gt;SizeTransition&lt;/code&gt; to expand and contract the widgets in a given orientation&lt;/li&gt;
&lt;li&gt;I change this orientation to horizontal&lt;/li&gt;
&lt;li&gt;The axis alignment tells Flutter in which direction to animate&lt;/li&gt;
&lt;li&gt;Besides that, it's just a matter of declaring an &lt;code&gt;Animation&lt;/code&gt; and an &lt;code&gt;AnimationController&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;strong&gt;bool&lt;/strong&gt; used to control the animation is given inverted to each one of the Stack's children. This makes sure only one is visible at a time.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that's it! I hope this makes sense, if you have any questions I'm more than glad to help.&lt;/p&gt;

</description>
      <category>codepen</category>
      <category>flutter</category>
      <category>dart</category>
      <category>inspiration</category>
    </item>
  </channel>
</rss>
