<?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: Ivan</title>
    <description>The latest articles on DEV Community by Ivan (@ivan015).</description>
    <link>https://dev.to/ivan015</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%2F436753%2Fee1754fe-9d23-489f-b443-2695f8babfae.jpeg</url>
      <title>DEV Community: Ivan</title>
      <link>https://dev.to/ivan015</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ivan015"/>
    <language>en</language>
    <item>
      <title>Tips and tricks to make Flutter development easier with Parabeac</title>
      <dc:creator>Ivan</dc:creator>
      <pubDate>Mon, 26 Sep 2022 22:41:10 +0000</pubDate>
      <link>https://dev.to/parabeac/tips-and-tricks-to-make-flutter-development-easier-with-parabeac-npb</link>
      <guid>https://dev.to/parabeac/tips-and-tricks-to-make-flutter-development-easier-with-parabeac-npb</guid>
      <description>&lt;p&gt;Recently Parabeac introduced &lt;em&gt;Parabeac Themes&lt;/em&gt;, a super-simple, super-easy, and super-affordable version of our tool where developers can choose to export simple styling and theming elements. &lt;/p&gt;

&lt;p&gt;Parabeac tools quickly and precisely convert Figma application mock-ups to Flutter code, speeding the process of implementing UI designs. The good news is that developers retain full control over how the converted code is implemented and can make continuous design updates -- any future changes made in the Figma files can generate a new pull request without disrupting any previously manually written logic.&lt;/p&gt;

&lt;p&gt;But any tool is even more valuable with some user-driven “tips”. Here are some helpful ones to make Parabeac even easier:&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Tips and Tricks&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Tip #1&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;In Parabeac Themes, instead of creating a new Figma File containing a color palette for light/dark themes from scratch, copy the existing Parabeac file to your own drafts and edit the colors! You’ll already have all the color names, and won’t have to spend time creating light/dark categories.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ih9T_6kn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e58vgue115cy5iorhuyc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ih9T_6kn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e58vgue115cy5iorhuyc.png" alt="Light and dark colors example" width="880" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Tip #2&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;You don’t have to use every single pre-named color in a color scheme (i.e. “shadow” in a “light” scheme). Just use whichever colors are relevant to you!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Tip #3&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;If you want to have your app dynamically change between light and dark mode, create the light/dark ColorSchemes and ThemeDatas via Tip #1. Then, in your main.dart file, use the generated light and dark ThemeData classes to place them in the &lt;code&gt;theme&lt;/code&gt; and &lt;code&gt;darkTheme&lt;/code&gt; attributes respectively. Now, Flutter will detect whether the device is in light/dark mode and adjust many widgets according to your color palettes. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nMhuD4l---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s6kp8j338a4o0ulb8fdc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nMhuD4l---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s6kp8j338a4o0ulb8fdc.png" alt="Using your themes in your app" width="501" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Tip #4&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;For developers who use Parabeac for screens: when selecting a screen size in Figma, make sure to select the smallest screen size out of all devices you wish your app to be compatible with. Adding more screen real estate will add more padding around your design elements depending on how they’re anchored (ie. to the right/left side of the screen or centered, or to another element)&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;BONUS TIP&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;If you’re willing to reach out to give us feedback or request features, we will reward you with a 1-month free subscription to our Pro pricing plan! Contact us at &lt;a href="mailto:support@parabeac.com"&gt;support@parabeac.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>programming</category>
      <category>productivity</category>
      <category>uiweekly</category>
    </item>
    <item>
      <title>How I added animation to my generated Flutter website using Parabeac</title>
      <dc:creator>Ivan</dc:creator>
      <pubDate>Tue, 29 Mar 2022 22:09:27 +0000</pubDate>
      <link>https://dev.to/parabeac/how-i-added-animation-to-my-website-using-parabeac-kbn</link>
      <guid>https://dev.to/parabeac/how-i-added-animation-to-my-website-using-parabeac-kbn</guid>
      <description>&lt;p&gt;While making a personal website, I wanted to add a &lt;code&gt;Down Arrow&lt;/code&gt; that moves up and down infinitely, to indicate to the user to scroll down.&lt;/p&gt;

&lt;p&gt;This can be easily done in Flutter by using the  &lt;code&gt;AnimatedPositioned&lt;/code&gt; widget. In this post, I’ll go over how to achieve this effect using Parabeac.&lt;/p&gt;

&lt;p&gt;The UI mockup of my site, created in Figma:&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Preparing your Figma file
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Custom Tags
&lt;/h3&gt;

&lt;p&gt;The first step to creating the animation was to name the element I wanted to convert with a &lt;code&gt;&amp;lt;custom&amp;gt;&lt;/code&gt; tag as seen in the image below: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PErCQQVY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4duqqohwdfh50fqdmlly.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PErCQQVY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4duqqohwdfh50fqdmlly.png" alt="Figma Custom Tag" width="484" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Doing this allowed me to customize the logic attached to the UI element without having to modify the UI itself once I generated the Flutter code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Editing the Dimensions of the Figma Element
&lt;/h3&gt;

&lt;p&gt;Secondly, because Parabeac takes the dimensions given in Figma and translates them to Flutter, I needed to resize the Figma element boundary to take up roughly as much space as I wanted the animation to take up. See below:&lt;/p&gt;

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

&lt;p&gt;As seen in the image, I increased the height of the element in order for it to be able to freely move up and down in the code itself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Editing Position Constraints
&lt;/h3&gt;

&lt;p&gt;In my case, I wanted the arrow to stick to the bottom-center of the screen as it resizes. To translate this into Flutter, I specified these constraints as seen on the right-bar of the image below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AO-DKfho--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a300zmudn64zid66lbt4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AO-DKfho--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a300zmudn64zid66lbt4.png" alt="Figma Constraints" width="880" height="490"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Generating the code
&lt;/h2&gt;

&lt;p&gt;Once my Figma file was ready to go, I went to &lt;a href="http://app.parabeac.com"&gt;app.parabeac.com&lt;/a&gt; to generate my code. Next, I  created a Pull Request (PR) into my GitHub repo. If you want more details on how to do this, check out:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/shorts/PCUN3OcPAKs"&gt;https://www.youtube.com/shorts/PCUN3OcPAKs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the PR was successful, I pulled the parabeac-generated branch in VSCode and was ready to add my logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding logic
&lt;/h2&gt;

&lt;p&gt;Since I tagged the &lt;code&gt;Down Arrow&lt;/code&gt; in Figma with &lt;code&gt;&amp;lt;custom&amp;gt;&lt;/code&gt;, Parabeac created a file inside the &lt;code&gt;controllers&lt;/code&gt; directory of my Flutter project named &lt;code&gt;down_arrow_custom.dart&lt;/code&gt;. This file wraps the arrow’s UI and allows for logic to be injected. The generated file looked as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VBk2syll--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9d0tjkwrof5elj9maorn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VBk2syll--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9d0tjkwrof5elj9maorn.png" alt="Custom File Boilerplate" width="535" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;widget.child&lt;/code&gt; item is the UI of the arrow. Initially, by default, the custom tags will return the UI with no logic. &lt;/p&gt;

&lt;p&gt;The &lt;code&gt;DownArrowCustom&lt;/code&gt; class is what allows me to add logic to the UI, or to completely override it. In my case, all I wanted to do was to wrap &lt;code&gt;widget.child&lt;/code&gt; with an &lt;code&gt;AnimatedPositioned&lt;/code&gt; widget that infinitely moves up and down. &lt;/p&gt;

&lt;h3&gt;
  
  
  Initializing animation variables
&lt;/h3&gt;

&lt;p&gt;In order to pull off this animation, I need a couple of things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Timer that triggers a change every X milliseconds&lt;/li&gt;
&lt;li&gt;AnimatedPositioned widget that wraps &lt;code&gt;widget.child&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;A boolean variable to tell the &lt;code&gt;AnimatedPositioned&lt;/code&gt; widget when to change positions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Timer and Duration
&lt;/h3&gt;

&lt;p&gt;For my down-arrow, I needed the timer to start as soon as the state was initialized in order to trigger the animation right when the page loads. Therefore, I defined the duration as a constant variable, and defined a &lt;code&gt;late&lt;/code&gt; &lt;code&gt;Timer&lt;/code&gt; that would be initialized on &lt;code&gt;initState&lt;/code&gt;. In addition, I had to &lt;code&gt;cancel()&lt;/code&gt; the timer inside the &lt;code&gt;dispose&lt;/code&gt; method to avoid errors and unwanted behavior when the screen is no longer being rendered.&lt;/p&gt;

&lt;p&gt;See below how I set up my timer:&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="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;_DownArrowCustomState&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;State&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;DownArrowCustom&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;late&lt;/span&gt; &lt;span class="n"&gt;Timer&lt;/span&gt; &lt;span class="n"&gt;_timer&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;/// Duration of the animation and how often it should&lt;/span&gt;
  &lt;span class="c1"&gt;///change positions.&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;_duration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;Duration&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;milliseconds:&lt;/span&gt; &lt;span class="mi"&gt;700&lt;/span&gt;&lt;span class="o"&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="n"&gt;initState&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;/// Timer that triggers the callback&lt;/span&gt;
    &lt;span class="c1"&gt;/// function every 700 seconds. &lt;/span&gt;
    &lt;span class="n"&gt;_timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Timer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;periodic&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
      &lt;span class="n"&gt;_duration&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
      &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;/// Temporary print call for illustration purposes&lt;/span&gt;
        &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'callback!'&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="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="o"&gt;();&lt;/span&gt;
  &lt;span class="o"&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="n"&gt;dispose&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;/// Make sure to properly dispose of _timer!&lt;/span&gt;
    &lt;span class="n"&gt;_timer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;cancel&lt;/span&gt;&lt;span class="o"&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;dispose&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;

  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="n"&gt;Widget&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;widget&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;child&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;h3&gt;
  
  
  AnimatedPositioned
&lt;/h3&gt;

&lt;p&gt;Next, I set up an &lt;code&gt;AnimatedPositioned&lt;/code&gt; widget that wraps &lt;code&gt;widget.child&lt;/code&gt; as follows:&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="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;_DownArrowCustomState&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;State&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;DownArrowCustom&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;late&lt;/span&gt; &lt;span class="n"&gt;Timer&lt;/span&gt; &lt;span class="n"&gt;_timer&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;/// Duration of the animation and how often it should&lt;/span&gt;
  &lt;span class="c1"&gt;///change positions.&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;_duration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;Duration&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;milliseconds:&lt;/span&gt; &lt;span class="mi"&gt;700&lt;/span&gt;&lt;span class="o"&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="n"&gt;initState&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="nd"&gt;@override&lt;/span&gt;
  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;dispose&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="nd"&gt;@override&lt;/span&gt;
  &lt;span class="n"&gt;Widget&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Stack&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;AnimatedPositioned&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
          &lt;span class="nl"&gt;width:&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;height:&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;bottom:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;/// Need to update this value every time Timer triggers callback&lt;/span&gt;
          &lt;span class="nl"&gt;left:&lt;/span&gt; &lt;span class="mi"&gt;0&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;widget&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;child&lt;/span&gt;&lt;span class="o"&gt;!,&lt;/span&gt;
          &lt;span class="nl"&gt;duration:&lt;/span&gt; &lt;span class="n"&gt;_duration&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;As seen above, I created a &lt;code&gt;Stack&lt;/code&gt; that will be constrained automatically by the parent  &lt;code&gt;.g.dart&lt;/code&gt; file based on the Figma constraints I provided. I then wrapped &lt;code&gt;widget.child&lt;/code&gt; (the UI of the arrow) with an &lt;code&gt;AnimatedPositioned&lt;/code&gt; widget.&lt;/p&gt;

&lt;p&gt;Notice that the duration of the animation and how often the timer triggers the callback is the same. This is to ensure that the arrow changes positions at the same time the animation is finished (i.e. there is continuous movement, no pauses).&lt;/p&gt;

&lt;p&gt;However, the position won’t change yet because there is no trigger that will change the &lt;code&gt;bottom&lt;/code&gt; value of the &lt;code&gt;AnimatedPositioned&lt;/code&gt;. To achieve this, I need to add a boolean variable that tells the &lt;code&gt;AnimatedPositioned&lt;/code&gt; widget when to update.&lt;/p&gt;

&lt;h3&gt;
  
  
  Boolean Update Variable
&lt;/h3&gt;

&lt;p&gt;I then added a boolean, class variable named &lt;code&gt;_update&lt;/code&gt; that changes value every time the &lt;code&gt;_timer&lt;/code&gt; calls the callback method. See below for the final result:&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="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;_DownArrowCustomState&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;State&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;DownArrowCustom&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;_update&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;late&lt;/span&gt; &lt;span class="n"&gt;Timer&lt;/span&gt; &lt;span class="n"&gt;_timer&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;/// Duration of the animation and how often it should&lt;/span&gt;
  &lt;span class="c1"&gt;///change positions.&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;_duration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;Duration&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;milliseconds:&lt;/span&gt; &lt;span class="mi"&gt;700&lt;/span&gt;&lt;span class="o"&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="n"&gt;initState&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;_timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Timer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;periodic&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
      &lt;span class="n"&gt;_duration&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
      &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;/// Set state and change the boolean so the &lt;/span&gt;
        &lt;span class="c1"&gt;///position changes.&lt;/span&gt;
        &lt;span class="n"&gt;setState&lt;/span&gt;&lt;span class="o"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_update&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;_update&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="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="o"&gt;();&lt;/span&gt;
  &lt;span class="o"&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="n"&gt;dispose&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;_timer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;cancel&lt;/span&gt;&lt;span class="o"&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;dispose&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;

  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="n"&gt;Widget&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Stack&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;AnimatedPositioned&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
          &lt;span class="nl"&gt;width:&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;height:&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;bottom:&lt;/span&gt; &lt;span class="n"&gt;_update&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;/// Push arrow 25 pixels up/down depending on state.&lt;/span&gt;
          &lt;span class="nl"&gt;left:&lt;/span&gt; &lt;span class="mi"&gt;0&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;widget&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;child&lt;/span&gt;&lt;span class="o"&gt;!,&lt;/span&gt;
          &lt;span class="nl"&gt;duration:&lt;/span&gt; &lt;span class="n"&gt;_duration&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;h2&gt;
  
  
  Final result
&lt;/h2&gt;

&lt;p&gt;After updating the custom file, this was the final result when running my Flutter project:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5EojMCLa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kcc02s5odfn4wvx3u2ib.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5EojMCLa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kcc02s5odfn4wvx3u2ib.gif" alt="Final Result GIF" width="880" height="704"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Github repo: &lt;a href="https://github.com/ivan-015/flutter-portfolio-site"&gt;https://github.com/ivan-015/flutter-portfolio-site&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Deployed website (needs a sec. to load, currently in development👷🏾‍♂️😅): &lt;a href="https://y.at/%F0%9F%91%81%EF%B8%8F%F0%9F%9A%9A%E2%9D%A4%EF%B8%8F%F0%9F%92%BB"&gt;https://y.at/👁️🚚❤️💻&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>opensource</category>
      <category>flutter</category>
    </item>
    <item>
      <title>How I generated my personal landing page with Figma &amp; Flutter using Parabeac</title>
      <dc:creator>Ivan</dc:creator>
      <pubDate>Thu, 24 Mar 2022 20:07:08 +0000</pubDate>
      <link>https://dev.to/parabeac/how-i-generated-my-personal-landing-page-with-figma-flutter-using-parabeac-188j</link>
      <guid>https://dev.to/parabeac/how-i-generated-my-personal-landing-page-with-figma-flutter-using-parabeac-188j</guid>
      <description>&lt;p&gt;In this post, I’ll share how I used Parabeac to create my portfolio website by converting my Figma design file to Flutter code and deploying the project using GitHub Pages.&lt;/p&gt;

&lt;p&gt;When working on a product, it’s easy to get lost in the myriad of features, bugs, and refactors to implement. Getting tunnel vision means you lose sight of what is useful to the user and what is not. Because of this, I decided to put myself in our users’ shoes and try to build my portfolio website using Parabeac. &lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up design file
&lt;/h2&gt;

&lt;p&gt;I created a new Figma Project and decided to start with the Landing Page. I knew my website was going to have a minimalist, terminal style with dark colors accentuated by bright greens. Then, I re-watched The Matrix to inspire my design (and because I love the movie). Finally, after looking at a few websites, I started designing and (tried 😅) using Figma best practices to design the page:&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%2Fwh1yxm5zuto5pcdx4000.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%2Fwh1yxm5zuto5pcdx4000.png" alt="Figma Design"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Although the design was to my liking, I did not want the UI to be static. Rather, I wanted the green text that says &lt;code&gt;Software Developer&lt;/code&gt; to change to some hobbies: &lt;code&gt;Movie Enthusiast&lt;/code&gt;, and &lt;code&gt;Gamer 😎&lt;/code&gt;. The logic of animating and changing text cannot be generated by Parabeac, so I labeled the text with &lt;code&gt;&amp;lt;custom&amp;gt;&lt;/code&gt; in Figma as follows:&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%2Fo943wcis24llw5tfbgxh.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%2Fo943wcis24llw5tfbgxh.png" alt="Custom Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By doing this, Parabeac will create a file where I can add logic and change the text dynamically once the code is generated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generating the Code Using Parabeac Nest
&lt;/h2&gt;

&lt;p&gt;Once my Figma file was ready to generate, I went to Github, created a new repo, and initialized it with a &lt;code&gt;main&lt;/code&gt; branch. Then, I went to &lt;a href="http://app.parabeac.com" rel="noopener noreferrer"&gt;app.parabeac.com&lt;/a&gt; to start my new project. I followed the prompts, crossed my fingers, and began the conversion. After a few minutes, I got the success message:&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%2Fqnbwnl99fatf03bh64bd.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%2Fqnbwnl99fatf03bh64bd.png" alt="PR Success"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After I saw this success message, I immediately cloned the Git Repo, checked out the generated branch, and opened it in VSCode:&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%2F872j2vsv1y9mbnritct5.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%2F872j2vsv1y9mbnritct5.png" alt="VSCode Project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I modified the &lt;code&gt;main.dart&lt;/code&gt; file to open the &lt;code&gt;Landing&lt;/code&gt; page (as seen above), and ran it with the following result:&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%2F7vtvv36j5l62a5sehpml.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%2F7vtvv36j5l62a5sehpml.png" alt="First Conversion"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not bad! Next, let’s make the text dynamic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customizing logic
&lt;/h2&gt;

&lt;p&gt;The first thing I do when I want to add some logic to my Flutter UI code is look it up on YouTube and hope there’s a Widget of the Week video on it. I searched “flutter animated text”, crossed my fingers once again, and hit the jackpot. This was the first video in the search: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=foQTKCQqVWk" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=foQTKCQqVWk&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After reading the &lt;a href="https://pub.dev/packages/animated_text_kit" rel="noopener noreferrer"&gt;docs&lt;/a&gt;, I decided this was exactly what I wanted, so I went to my terminal and ran &lt;code&gt;flutter pub add animated_text_kit&lt;/code&gt; on my project. Then, I went to the file &lt;code&gt;software_developer_custom.dart&lt;/code&gt;, named after the text element in Figma, which had this boilerplate: &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%2Fo5gpqru9s6ar901hvzqn.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%2Fo5gpqru9s6ar901hvzqn.png" alt="Custom File Boilerplate"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rather than returning &lt;code&gt;widget.child&lt;/code&gt;, which is the static text that displays &lt;code&gt;Software Developer&lt;/code&gt;, I want to use the package I just installed to make the text dynamic. I replaced the build method as follows:&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%2Fv1ydsq546s3vccj1mwmd.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%2Fv1ydsq546s3vccj1mwmd.png" alt="Adding Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, I added the &lt;code&gt;AnimatedTextKit&lt;/code&gt; widget, which will animate the texts I provided in a loop. Here’s the final result:&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%2Fi0w5y2io7924gvhyb9sw.gif" 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%2Fi0w5y2io7924gvhyb9sw.gif" alt="Website Gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there it is! My landing page is mostly ready. There are still some easter eggs I want to implement, but I first need to design the rest of the website. &lt;/p&gt;

&lt;p&gt;As a final touch, I set up GitHub pages and deployed the site. Click &lt;a href="https://github.com/ivan-015/flutter-portfolio-site" rel="noopener noreferrer"&gt;here&lt;/a&gt; to see the Github repo and source code, and &lt;a href="https://ivan-015.github.io/flutter-portfolio-site/#/" rel="noopener noreferrer"&gt;here&lt;/a&gt; to see the website. &lt;/p&gt;

&lt;p&gt;DISCLAIMER: no &lt;code&gt;.g.dart&lt;/code&gt; files were modified during the making of this article.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>showdev</category>
      <category>productivity</category>
      <category>startup</category>
    </item>
  </channel>
</rss>
