<?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: Luan Nico</title>
    <description>The latest articles on DEV Community by Luan Nico (@luanpotter).</description>
    <link>https://dev.to/luanpotter</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%2F458383%2Fb4b02526-c8d3-4776-84a7-0d1ff85eb034.png</url>
      <title>DEV Community: Luan Nico</title>
      <link>https://dev.to/luanpotter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luanpotter"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Luan Nico</dc:creator>
      <pubDate>Tue, 12 Aug 2025 14:33:14 +0000</pubDate>
      <link>https://dev.to/luanpotter/-38af</link>
      <guid>https://dev.to/luanpotter/-38af</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/blue-fire/how-to-avoid-ghost-lines-and-render-artifacts-in-flame-4hfg" class="crayons-story__hidden-navigation-link"&gt;How to avoid ghost lines and render artifacts in Flame&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;
          &lt;a class="crayons-logo crayons-logo--l" href="/blue-fire"&gt;
            &lt;img alt="Blue Fire logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F2967%2Fcd43a52f-0fc1-4a71-9404-04e9a2cffe26.png" class="crayons-logo__image"&gt;
          &lt;/a&gt;

          &lt;a href="/erickzanardo" class="crayons-avatar  crayons-avatar--s absolute -right-2 -bottom-2 border-solid border-2 border-base-inverted  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F462843%2Fcded7159-d866-46b3-9f84-7c4dd94a5ede.jpeg" alt="erickzanardo profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/erickzanardo" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Erick
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Erick
                
              
              &lt;div id="story-author-preview-content-2769849" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/erickzanardo" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F462843%2Fcded7159-d866-46b3-9f84-7c4dd94a5ede.jpeg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Erick&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;span&gt;
              &lt;span class="crayons-story__tertiary fw-normal"&gt; for &lt;/span&gt;&lt;a href="/blue-fire" class="crayons-story__secondary fw-medium"&gt;Blue Fire&lt;/a&gt;
            &lt;/span&gt;
          &lt;/div&gt;
          &lt;a href="https://dev.to/blue-fire/how-to-avoid-ghost-lines-and-render-artifacts-in-flame-4hfg" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Aug 12 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/blue-fire/how-to-avoid-ghost-lines-and-render-artifacts-in-flame-4hfg" id="article-link-2769849"&gt;
          How to avoid ghost lines and render artifacts in Flame
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/flutter"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;flutter&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/flame"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;flame&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/gamedev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;gamedev&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/blue-fire/how-to-avoid-ghost-lines-and-render-artifacts-in-flame-4hfg" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;3&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/blue-fire/how-to-avoid-ghost-lines-and-render-artifacts-in-flame-4hfg#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            5 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>flutter</category>
      <category>flame</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>Idiomatic Collections with Kotlin</title>
      <dc:creator>Luan Nico</dc:creator>
      <pubDate>Mon, 21 Nov 2022 18:21:53 +0000</pubDate>
      <link>https://dev.to/luanpotter/idiomatic-collections-with-kotlin-2ha0</link>
      <guid>https://dev.to/luanpotter/idiomatic-collections-with-kotlin-2ha0</guid>
      <description>&lt;p&gt;As I review many PRs in Kotlin, I've seen many ways people use to create collections (&lt;a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/" rel="noopener noreferrer"&gt;&lt;code&gt;Lists&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/" rel="noopener noreferrer"&gt;&lt;code&gt;Sets&lt;/code&gt;&lt;/a&gt;); and while they all work, I think the different ways have different pros and cons for what you are doing. So I decided to put together this article to better explain my very philosophical views on this matter.&lt;/p&gt;

&lt;p&gt;What do I mean by “creating collections”? Specifically in this article, I am referring to when you create a list/set given its size and a formula for its elements. So not things like &lt;code&gt;listOf&lt;/code&gt;, &lt;code&gt;setOfNotNull&lt;/code&gt;, or &lt;code&gt;buildList&lt;/code&gt; – which are all great for their own use cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  The &lt;code&gt;for&lt;/code&gt; loop
&lt;/h2&gt;

&lt;p&gt;The most basic way that comes to mind for solving this problem is using a simple &lt;code&gt;for&lt;/code&gt; loop.&lt;/p&gt;

&lt;p&gt;As an overarching example in this article, say we wanted to create a list of &lt;code&gt;n&lt;/code&gt; random Users to use in a test case. One could do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;users&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mutableListOf&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;()&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"John"&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;The problems (admittedly, “nits”) I see with this approach are as follows:&lt;/p&gt;

&lt;h3&gt;
  
  
  Using a mutable list
&lt;/h3&gt;

&lt;p&gt;While not necessarily bad, this is something we want to avoid when the list doesn't &lt;em&gt;need&lt;/em&gt; to be mutable. This is similar to using &lt;code&gt;val&lt;/code&gt; (instead of &lt;code&gt;var&lt;/code&gt;) when you are not modifying a reference. Reduce the cognitive load necessary to understand your code.&lt;/p&gt;

&lt;p&gt;While we could hide this mutability as an implementation detail into a &lt;code&gt;buildUserList&lt;/code&gt; function that returns a &lt;code&gt;List&lt;/code&gt;, and that would be perfectly valid, all the alternatives I will propose will bypass this problem entirely.&lt;/p&gt;

&lt;h3&gt;
  
  
  Non-functional style
&lt;/h3&gt;

&lt;p&gt;Using &lt;code&gt;for&lt;/code&gt; loops, while sometimes clearer (or unavoidable), often means we are writing "implementation details" rather than expressing what we want to happen -- especially if you are using manual indexing.&lt;/p&gt;

&lt;p&gt;More often than not, functional styles can be much more clear on the "intent", rather than on the "how".&lt;/p&gt;

&lt;p&gt;For example, compare a simple &lt;code&gt;map&lt;/code&gt; operation done with the &lt;code&gt;for&lt;/code&gt; loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;results&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mutableListOf&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;()&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;element&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;original&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;element&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;with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;results&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;original&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nf"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;it&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;Again, we are reducing the amount of information you need to parse the code - bit by bit.&lt;/p&gt;

&lt;h3&gt;
  
  
  We don't care about the &lt;code&gt;index&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Sometimes you might care about the index, sometimes you might not. We will explore solutions below for each. If you don't, the &lt;code&gt;for&lt;/code&gt; loop forces you to declare a new variable (the infamous &lt;code&gt;i&lt;/code&gt;) and, again, increase context with a meaningless variable.&lt;/p&gt;

&lt;p&gt;In all of the alternative proposals, you will be able to optionally access the index via &lt;code&gt;it&lt;/code&gt; -- while at the same time not having to declare it explicitly if you don't care about it.&lt;/p&gt;

&lt;h3&gt;
  
  
  We don't care about the range (specific start and end)
&lt;/h3&gt;

&lt;p&gt;We just set out to create &lt;code&gt;n&lt;/code&gt; users. Not only we don't care about the index; we don't care about the range. We just want the size to be &lt;code&gt;n&lt;/code&gt;, we don't care about the start value and end value.&lt;/p&gt;

&lt;p&gt;In fact, this can lead to quite the confusion. While the other points can be absolutely trivial in isolation and only matter when taken as a philosophy for the entire project, this one can actually lead to immediate bugs, due to the confusion between the inclusive and exclusive range operators.&lt;/p&gt;

&lt;p&gt;You can argue that they are clear and easy to distinguish, and, in fact, IJ will helpfully annotate them leaving no space for confusion:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F5t59h8wj7pithjrurljq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F5t59h8wj7pithjrurljq.png" alt="Example showcasing IntelliJ's helpful annotations on ranges" width="377" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But it can be something to be missed in a quick code review. In fact, as an example of that, did you notice that I intentionally mis-used them in this example? &lt;code&gt;0..n&lt;/code&gt; is the inclusive range. So this should be either &lt;code&gt;1..n&lt;/code&gt; or &lt;code&gt;0 until n&lt;/code&gt;. Easy mistake to not notice on a code review -- which doesn't mean we shouldn't use ranges, but definitely means there is no reason to introduce this complexity if we don't care about it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: I am aware that, in the time it took me to write this article, the gods of Kotlin went ahead and fixed the &lt;a href="https://kotlinlang.org/docs/whatsnew1720.html#preview-of-the-operator-for-creating-open-ended-ranges" rel="noopener noreferrer"&gt;non-intuitive ranges&lt;/a&gt; issue, but I believe my argument still stands that there is no reason to introduce a composite concept (range) if we only care about the size.&lt;/p&gt;

&lt;h2&gt;
  
  
  Alternatives
&lt;/h2&gt;

&lt;p&gt;While the &lt;code&gt;for&lt;/code&gt; loop is far from terrible, and the problems I pointed out are very small nits, Kotlin has such a range (pun definitely intended) of other options that can be much more suitable to you depending on the situation.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;repeat&lt;/code&gt; function
&lt;/h3&gt;

&lt;p&gt;The first (and by far simplest) alternative solution to consider is the repeat function.&lt;/p&gt;

&lt;p&gt;Use it if you don't care neither about the resulting list nor the range:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nf"&gt;repeat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nf"&gt;saveUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"John $it"&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;h3&gt;
  
  
  &lt;code&gt;List&lt;/code&gt; constructor
&lt;/h3&gt;

&lt;p&gt;Unknown to many people, but &lt;code&gt;List&lt;/code&gt; actually has a &lt;code&gt;List(size, factory)&lt;/code&gt; constructor! No need to do &lt;code&gt;map&lt;/code&gt; over a range if you don’t care about the range, but do care about the generated list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;users&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"John $it"&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;This is simple and clear and allows you to specify a size directly (which is what you care about here).&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;map&lt;/code&gt; over a range
&lt;/h3&gt;

&lt;p&gt;If you care about the resulting list, and also care about the range, that is the place you should really use one. But the cool trick is that you can &lt;code&gt;map&lt;/code&gt; the range directly into your result list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;users&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"John $it"&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;Here, &lt;code&gt;a..b&lt;/code&gt; is an example, but you can use &lt;code&gt;until&lt;/code&gt;, &lt;code&gt;downto&lt;/code&gt;, etc -- build the range you need.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;forEach&lt;/code&gt; over a range
&lt;/h3&gt;

&lt;p&gt;This is the final thing to callout: if you do not care about the generated collection, &lt;em&gt;do not use &lt;code&gt;map&lt;/code&gt;&lt;/em&gt;. I see this so often on PRs, and it is, semantically, completely wrong.&lt;/p&gt;

&lt;p&gt;Kotlin offers a perfect replacement already for &lt;code&gt;map&lt;/code&gt; when you don't care about the result: &lt;code&gt;forEach&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nf"&gt;saveUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"John $it"&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;Or, if you are using the index variable anyway, you can go even simpler, and just use the plain old &lt;code&gt;for&lt;/code&gt; loop, as, in this last scenario, it doesn't have any of the disadvantages mentioned in the previous section:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;..&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;saveUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"John $index"&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;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I hope this article illustrated my point about why each slightly different pattern is better for slightly different circumstances, and that you were able to learn the rationale behind each, so you can apply such reasoning on your own code (rather than memorize instructions).&lt;/p&gt;

&lt;p&gt;I know all of this might seem absolutely trivial. On every isolated example, reading the code is always super easy. However, when reading an entire function, every little bit contributes to the difference between an immediate understanding and a minute of thinking. When reading a code base, well, you see my point. These kinds of things littering a codebase add up to cause substantial cost.&lt;/p&gt;

&lt;p&gt;I strongly believe that, on huge projects, maintained by multiple people at the same time, keeping the code clean, even if by addressing such seemingly tiny nits, is paramount for velocity, maintainability, and developer happiness over the years.&lt;/p&gt;

&lt;p&gt;And finally, I encourage my fellow PR reviewers to refer to and share this article whenever you want to quickly express all these points but don't have the time to write an article-length comment on such philosophical matters.&lt;/p&gt;

</description>
      <category>kotlin</category>
      <category>programming</category>
    </item>
    <item>
      <title>Flame 1.0 is here!</title>
      <dc:creator>Luan Nico</dc:creator>
      <pubDate>Wed, 08 Dec 2021 18:56:50 +0000</pubDate>
      <link>https://dev.to/blue-fire/flame-10-is-here-430n</link>
      <guid>https://dev.to/blue-fire/flame-10-is-here-430n</guid>
      <description>&lt;p&gt;Hi there, folks! It's been a while since our last article, but if you are following &lt;a href="https://github.com/flame-engine/flame" rel="noopener noreferrer"&gt;Flame on GitHub&lt;/a&gt; or participating in our &lt;a href="https://discord.gg/pxrBmy4" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;, you know very well that we have not been idle. Far from it. In fact, you might have noticed more and more Release Candidates being put out regularly, mostly with some needed updates and cleanups, a few new core features, bug fixes, and incorporating valuable feedback from our amazing Game Jam. That is because both the team and the community have been working together, relentlessly, to make Flame the best it can be.&lt;/p&gt;

&lt;p&gt;And, first of all, I would like to make it very clear that we are not done with this goal, not even close -- the pile of things we know could be improved, extended or added is only shadowed by the mountain that we don't even know about yet. So the first thing I would like to reassure everyone, with this article, is that nothing really changes in that regard. We will still be putting out PRs, receiving invaluable help from the community, making improvements, new features, bug fixes. We will still be at discord, helping out new people, having deep, productive discussions with veterans, and collaborating together to keep growing and enhancing all Blue Fire's projects.&lt;/p&gt;

&lt;p&gt;That being said, we do have a key milestone to share. You might have already heard about it on the &lt;a href="https://medium.com/flutter/announcing-flutter-2-8-31d2cb7e19f5" rel="noopener noreferrer"&gt;Flutter 2.8 release article&lt;/a&gt;, or maybe got a sneak peek on pub; but, regardless, we wanted to double down and proudly announce we just released Flame 1.0.0. Yes, it's official, and finally here! What an end-of-year holiday gift to us to finally be able to say that, given all the work that has been put into it! We are very happy with the current state of our code and the capabilities provided, and we think it's time to make this commitment. Thank you so much for every single one of you, that contributed with PRs, discussions, questions (that led us to improve some docs or reconceptualize some API), monetary donations via our &lt;a href="https://www.patreon.com/bluefireoss" rel="noopener noreferrer"&gt;Patreon&lt;/a&gt;, or that used Flame, made something great, participated in any way, gave us a star on &lt;a href="https://github.com/flame-engine/flame" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, or just for reading and sharing this article. Thank you, from the bottom of our hearts.&lt;/p&gt;

&lt;p&gt;And let me reiterate; we are still going to keep improving, updating, fixing, enhancing Flame. In fact, I hope version 1.0.0 lives very briefly on pub, to be replaced with 1.0.1, 1.1.0, whichever comes first, very soon. This just means we believe the current API is stable, and we won't be making big, breaking changes that often, or without warning. Expect more structured, stable updates, especially new features. It also means we can focus our attention now to improving our docs, bridge packages, tooling, examples and tutorials to make sure this awesome ecosystem that came about works seamlessly and frictionlessly, and that people can easily welcome people to join and learn. We are also happy to have established and to carry on this partnership with the Flutter team to make sure we all pave a future together for Flame and our beloved community.&lt;/p&gt;

&lt;p&gt;And on that note, we ask you to update your dependency, head over to &lt;a href="https://discord.gg/pxrBmy4" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; to continue the discussion, and if you haven't, please check &lt;a href="https://medium.com/flutter/announcing-flutter-2-8-31d2cb7e19f5" rel="noopener noreferrer"&gt;Flutter's article&lt;/a&gt; about all the amazing things packed on Flutter 2.8, and let us know if you have any feedback! Thanks everyone again for everything, and have a great day!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Five features I wish Dart had</title>
      <dc:creator>Luan Nico</dc:creator>
      <pubDate>Mon, 29 Mar 2021 01:00:04 +0000</pubDate>
      <link>https://dev.to/luanpotter/five-features-i-wish-dart-had-58l7</link>
      <guid>https://dev.to/luanpotter/five-features-i-wish-dart-had-58l7</guid>
      <description>&lt;p&gt;The Dart programming language has recently undergone a major version update, 2.12, which brought sound null-safety to the ecosystem. With the recent announcement of Flutter 2.0, supporting web and desktop alongside mobile, this new version of the language has been gaining a lot of traction as project maintainers such as myself start or continue to migrate their packages to support it.&lt;/p&gt;

&lt;p&gt;And the first thing I have to say about it is that it's great. I already loved Dart before, and this was definitely one of the most important things on the roadmap. I particularly love typed languages; after many years working with Javascript, which I also really like, I came to the realization that the extra cost of typing pays off (and the recent popularity of Typescript helps to substantiate this point). And Dart has built-in type safety, which is great. But after a lot of time using Kotlin and Swift, that not only offer types but null-safe types, I realized, on the same vein, how important this feature is for writing great, resilient applications, help developers avoid mistakes, code quickly and safely.&lt;/p&gt;

&lt;p&gt;And I realize one big burden (on the other side) of types is the extra verbosity it inherently introduced. For example, whenever I coded in Java in the past I was very happy with the security and stableness types provided but it just felt like a lot of extra work compared to JS. But it doesn't have to be that much, and Kotlin, Swift, and the newer versions of Java showed me that, if you bring (1) yes, types but also (2) a lot of (sometimes small) language improvements, syntax sugars, helping features, you can get the benefits of types with very little overhead. And that is where I think they shine. Now, the same thing is true for null safety. Imagine if we didn't have the Elvis operator in Dart, for example. Would be much more painful to write proper null safe code, up to a point it starts to compete with the benefits in the first place. Granted the pros and cons are in different areas (ease of coding vs stability and fewer bugs), and that is why this is ultimately a matter of opinion. But the better the language is at providing the right features that allow developers to write pretty, understandable code easily and quickly (like by adding the Elvis/null aware operators), the more attractive it becomes to be on that side of the scale.&lt;/p&gt;

&lt;p&gt;And, again, I really like Dart and all it has to offer, and I am totally in favor of type and null safety being on the language. But having spent some time migrating packages and apps, I believe there are a few things that would make everyone life's much better. These are relatively small, non-disruptive, non-breaking, incremental changes that are not necessarily directly related to null safety but that, especially if you worked with languages like Kotlin and Swift before (my main sources of inspiration), you might miss when migrating code. The fact that null safety inevitably adds some extra level of boilerplate helped expose these needs more clearly to me, in a way that I hadn't necessarily craved them before.&lt;/p&gt;

&lt;p&gt;My goal with this article is far from bashing Dart (I think I made it more than clear how I feel about it!) or to mourn the unchangeable fate of the universe, or anything like that. In fact, I currently use Dart in my free time purely because I like it. But rather my goal is for this to be a proposal, both for the community and (hopefully!) for the Dart team, a set of ideas that can be picked from, studied, mix and matched. A showcase of, in my opinion, great things other languages have to offer (for those unfamiliar). A collection of wishes and anecdotes.&lt;/p&gt;

&lt;p&gt;And I should try to finally get to my clickbait-y title quickly because I've been vaguely rambling for a while putting a lot of trust in your patience with my digressions. And I swear it's coming and they are going to be very concrete, specific things (now I am just building anticipation). But the last thing I wanted to mention before getting right into it, and there is no way I can omit this reference, is the library &lt;a href="https://gitlab.com/wolfenrain/dartlin" rel="noopener noreferrer"&gt;Dartlin&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Full disclaimer, Dartlin was created by my friend &lt;a href="http://gitlab.com/wolfenrain" rel="noopener noreferrer"&gt;Jochum&lt;/a&gt;, and I have contributed to it after I learned of its existence (since, as you can imagine by this article, I loved the idea). It is basically a Kotlin inspired set of features, built in the library level (using for example things like Extension Functions) that aim to bring great features from Kotlin to Dart. I will mention on some of these features how the proposed effect could be accomplished with Dartlin. However, no matter how clever Jochum gets at the library level to replicate some features, it can never be as good, as simple, easy to use as a native feature. Also bear in mind adding extra functions, lambdas, et cetera to emulate non-native concepts has a performance overhead, so I definitely endorse Dartlin but I recommend making sure it's not causing an application critical bottleneck (and there could be a whole other article about what really matters for performance of a given app versus premature optimizations).&lt;/p&gt;

&lt;p&gt;Now, with all that out of the way, finally, here are 5 features I wish Dart had (natively), in no particular order:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Kotlin's &lt;code&gt;let&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;A very famous construct in Kotlin is the &lt;code&gt;let&lt;/code&gt; function. Basically, it is one of the more famous so-called Scope Functions. And it's particularly useful for null-safe code. The implementation is deceptively simple; it's an extension function on &lt;code&gt;Any&lt;/code&gt; that invokes a lambda where the first argument is this callee. Seems useless? Well, one simple use case where it has a small role could be this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;","&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;let&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Point&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;it&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="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&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;Instead of having to name a variable with a meaningless identifier, this one-liner is easy to read and a quite nice use of &lt;code&gt;let&lt;/code&gt;. But where it shines, as I mention, is in the NS world, when paired with &lt;code&gt;?.&lt;/code&gt;. But let's get there through an example. Imagine you are converting Dart function on the codebase to null-safe Dart:&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="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;addTwo&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;arg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg&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="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;arg&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&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;Seems like a totally reasonable function, but actually, in the null-safe world, it's a bad pattern. Because once you convert it:&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="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;addTwo&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;arg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg&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="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;arg&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&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;You see the issue. This function is a black hole! It's destroying information. Imagine you have a totally legit, verified, safe and sound int variable. Non-null certified.&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;final&lt;/span&gt; &lt;span class="n"&gt;totallySafe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;addTwo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;totallySafe&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// oops, result is `int?`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the argument is already a nullable variable there is no issue, but if your parameter is non-null, that precious information is lost forever. So normally, you should not take a nullable parameter in a function if (1) the output of a null parameter is always null and (2) the only case where null is returned is with the null parameter. You are much better off having:&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="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;addTwo&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;arg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;arg&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&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;And let the callee deal with its nulls. Witch is fine if the variable you have is non-null. But on the other hand,&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;final&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;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;maybeGetInt&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;final&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;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;addTwo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Is a bit of a mouthful. So imagine you could do:&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;final&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;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;maybeGetInt&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;final&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;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="na"&gt;let&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;addTwo&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cool huh? When you think about it it's an extension of &lt;code&gt;?.&lt;/code&gt;; where &lt;code&gt;?.&lt;/code&gt; allows you to optionally call a property of an object, &lt;code&gt;?.let&lt;/code&gt; allows you to optionally call a function with an object. You can also use it with a lambda:&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;final&lt;/span&gt; &lt;span class="n"&gt;bread&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;wheat&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="na"&gt;let&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;mill&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basically, you can look at it as a &lt;code&gt;map&lt;/code&gt; operation if you look at the optional as a monad. And &lt;code&gt;map&lt;/code&gt; could possibly be a better name in the Dart world, though it would conflict with the List.map.&lt;/p&gt;

&lt;p&gt;But the best part of this list item is that &lt;code&gt;let&lt;/code&gt;, as I first said, is just an extension function. So this is one case where &lt;a href="https://pub.dev/packages/dartlin" rel="noopener noreferrer"&gt;Dartlin&lt;/a&gt; is able to simply add it. No caveats, no hacks. It will work just like the examples! Just drop in the dependency on your &lt;code&gt;pubspec.yaml&lt;/code&gt; and import the control flow sub library.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Swift's &lt;code&gt;if let&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Dart (since the beginning) has had type promotion (also known as smart cast in other languages). In simple terms, if you assert a type to be of a more specific subtype, you don't need to cast it in that context. For example:&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;Animal&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getAnimal&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;animal&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;Dog&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;animal&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bark&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// smart cast to Dog&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which is great when you think about null-safety is just an extension on the type system. Dog? is just a supertype of Dog. So, similarly, when you do:&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;Dog&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;dog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;maybeGetDog&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dog&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="c1"&gt;// really this is just check for `dog is Dog`&lt;/span&gt;
    &lt;span class="n"&gt;dog&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bark&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// smart cast to Dog&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, you can't be too clever with it. Smart-cast only works for local variables and parameters. It just cannot work for fields, because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fields can be changed by other functions called in your context&lt;/li&gt;
&lt;li&gt;fields can potentially be changed by other threads (not currently a problem in Dart because it's single-threaded)&lt;/li&gt;
&lt;li&gt;fields can be functions with custom getters that can return arbitrary results&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are many threads and issues on GitHub about this, asking for smart cast to be, well, smarter. But there is no way to do it safely. It's just too complex for the compiler to check these things. Kotlin also does not provide smart cast for fields. And I don't think this feature is worth having an unsound type system (going back to my initial rambling). But we don't need to. Swift offers a very elegant solution to this problem, which I think is just cleaner than smart casting altogether: &lt;code&gt;if let&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In Swift you can do:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;dog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;Dog&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;dog&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bark&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;Alternatively, you can use the same variable name (for, say, a null check):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;animal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// short for `let animal = animal as Animal`&lt;/span&gt;
    &lt;span class="n"&gt;animal&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;live&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// animal is not nil here!&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basically, you don't need smart cast if you can easily declare a new local variable. Instead of doing:&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="c1"&gt;// field: var Animal animal;&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// I am just copying a field to a local variable&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;animal&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;Dog&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;animal&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bark&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 could do something like:&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="c1"&gt;// field: var Animal animal;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;dog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;Dog&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;dog&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bark&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;or&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="c1"&gt;// field: var Animal? animal;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// basically omitting the `as Animal` part for brevity since it's just a null check&lt;/span&gt;
    &lt;span class="n"&gt;animal&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bark&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;That is clear, concise, and doesn't do any magic; it's explicit that it's creating a copy because of the variable declaration syntax, which also can save on performance if it's an expensive getter. It is also perfectly clear the scope in which the copy lives. No need to jeopardize the type safety with clever heuristics that work 99% of the time to introduce smart cast to fields!&lt;/p&gt;

&lt;p&gt;Note as well that the &lt;code&gt;for&lt;/code&gt; statement already allows you to declare new variables that only exist within its block, so this is quite intuitive (despite uncommon in other languages). This doesn't introduce any new keywords, and it's just an extension to the capabilities of the &lt;code&gt;if&lt;/code&gt; statement.&lt;/p&gt;

&lt;p&gt;I'm not suggesting smart casting to be removed altogether by the way, of course it can be left as an even easier alternative for local variables and parameters only. In fact, let me abuse this list item to share a small nit that I have related to smart cast: for some reason, it doesn't work for &lt;code&gt;this&lt;/code&gt;. If you think about it, just like a local variable or parameter, &lt;code&gt;this&lt;/code&gt; can never change types during the execution of a method. You might be thinking that is useless because &lt;code&gt;this&lt;/code&gt; can never be null (it can, in a very specific scenario that I leave to you as a puzzle to figure out). But where this would really come in handy would be for mixins; imagine being able to do:&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="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;MixinA&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;doMixinAThing&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// glamorous!&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Of course the addition of &lt;code&gt;if let&lt;/code&gt; would mitigate this pain, but still it's just one tiny nit with the existing type promotion.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Kotlin's &lt;code&gt;?:&lt;/code&gt; hidden power
&lt;/h2&gt;

&lt;p&gt;The famous "Elvis" operator is present in many languages in several different forms, and nowadays it's basically an umbrella term for "null-aware operators using question marks". There is the almost omnipresent &lt;code&gt;?.&lt;/code&gt;, to optionally access properties, and many others, but one of the most iconic has to be the coalesce operator, that I like to read as "or else", which is &lt;code&gt;??&lt;/code&gt; on Dart and Swift and &lt;code&gt;?:&lt;/code&gt; on Kotlin. In very simple terms, it's equivalent to "left operand OR ELSE right operand (if left operand is null)". For example, in Dart:&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="kt"&gt;String&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;a&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="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s"&gt;"foo"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// will print foo, similar to (a != null ? a : "foo")&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simple and effective. However, in Kotlin, the &lt;code&gt;?:&lt;/code&gt; has a special feature that I think no other language has (that I know of). More eagle-eyed observers might have noticed that I didn't mentioned Swift's &lt;code&gt;guard let&lt;/code&gt; on the previous list item. That's because I believe Kotlin has it figured out. We don't need to introduce a new keyword &lt;code&gt;guard&lt;/code&gt; if we allow the right operand of &lt;code&gt;?:&lt;/code&gt; to throw or return. How does it work? You can do something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="c1"&gt;// assuming class Animal(val tail: Tail?)&lt;/span&gt;

&lt;span class="k"&gt;fun&lt;/span&gt; &lt;span class="nf"&gt;process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;animal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Animal&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nc"&gt;Bool&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;val&lt;/span&gt; &lt;span class="py"&gt;tail&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;animal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tail&lt;/span&gt; &lt;span class="o"&gt;?:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;

    &lt;span class="o"&gt;..&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;It's so sweet that if you know the regular &lt;code&gt;?:&lt;/code&gt;/&lt;code&gt;??&lt;/code&gt; operators you can figure out what it does. And you can &lt;code&gt;throw&lt;/code&gt; too! Imagine doing this on dart:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    var foo = parseFoo(arg) ?? throw 'Invalid foo $arg';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are so many possibilities! And this is just a small extension over the existing coalesce operator that is very intuitive if you already know its regular usage.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Null-safe methods on collections
&lt;/h2&gt;

&lt;p&gt;As I said I have been converting a lot of packages to null-safety recently, and this issue got me puzzled for a while; a package had the following non-safe code:&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;final&lt;/span&gt; &lt;span class="n"&gt;element&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;list&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;firstWhere&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;orElse:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Seems like a pretty reasonable code, regardless of safety. But it breaks down when you notice that the new null-safe signature of firstWhere returns &lt;code&gt;T&lt;/code&gt; (and not &lt;code&gt;T?&lt;/code&gt;). Which makes sense if you don't want to add a lot of &lt;code&gt;!&lt;/code&gt; to your code; sometimes you just know the element will be there, and otherwise throwing an error is ok. But sometimes you expect it might not be there. And I could not for the life of me find a simple small one-liner to do what I wanted in the first place!&lt;/p&gt;

&lt;p&gt;That is why, especially now with NS, we need new collection methods. If you look at Swift and Kotlin for inspiration, we can find some very useful additions (in particular in Kotlin).&lt;/p&gt;

&lt;p&gt;For this example, take a look at Swift's &lt;code&gt;first&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;Self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;Element&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;Bool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;Self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;Element&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It just returns &lt;code&gt;nil&lt;/code&gt; instead of throwing. If we had that on Dart, plus our improved &lt;code&gt;??&lt;/code&gt; operator, you could do:&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;list&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;firstWhere&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="n"&gt;orElse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;list&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;firstWhere&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="s"&gt;'error'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which just covers both use cases with a single function. But better not to change the definition and behavior of the existing Dart functions to avoid confusion. So we can look at Kotlin instead. &lt;code&gt;firstWhere&lt;/code&gt; is just called &lt;code&gt;first&lt;/code&gt; (with optional lambda) and it does throw. But there is a &lt;code&gt;firstOrNull&lt;/code&gt; version, that returns null if not find. We could have that with an optional lambda:&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;T&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;firstOrNull&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="kt"&gt;Function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;test&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have all 4 options! The existing &lt;code&gt;first&lt;/code&gt; and &lt;code&gt;firstWhere&lt;/code&gt;, and the proposed &lt;code&gt;firstOrNull&lt;/code&gt; to cover both other cases. Similarly, we could have a &lt;code&gt;singleOrNull&lt;/code&gt; function with optional test lambda, identical to Kotlin's.&lt;/p&gt;

&lt;p&gt;Another one that is extremely handy is &lt;code&gt;getOrNull&lt;/code&gt;: just takes an index and returns null if out-of-bounds (instead of throwing). Again, on the NS land, returning null, especially when you pair it with NS-operators, is a blessing.&lt;/p&gt;

&lt;p&gt;Swift's &lt;code&gt;maxBy/minBy&lt;/code&gt; can also be handy, as it's a bit more clearer and less verbose than trying to replicate with &lt;code&gt;reduce&lt;/code&gt;. And particularly useful for safety is the &lt;code&gt;compactMap&lt;/code&gt; (or &lt;code&gt;mapNotNull&lt;/code&gt; on Kotlin) that maps and filters null values in one batch, meaning that it can chain to &lt;code&gt;T&lt;/code&gt; instead of &lt;code&gt;T?&lt;/code&gt; (if you just do &lt;code&gt;filter((e) =&amp;gt; e != null)&lt;/code&gt; the compiler doesn't know the subsequent sequence/stream is NS).&lt;/p&gt;

&lt;p&gt;The great news about this one item list as well is that these are just proposals to add functions to the SDK, which, as we already learned, can be easily done with extension functions. That is where &lt;a href="https://pub.dev/packages/dartlin" rel="noopener noreferrer"&gt;Dartlin&lt;/a&gt; comes to rescue again, providing all the aforementioned functions (with the Kotlin nomenclature) and even more (like the handy &lt;code&gt;associate&lt;/code&gt; or &lt;code&gt;groupBy&lt;/code&gt;). Another useful bit of code can be found on my &lt;code&gt;ordered_set&lt;/code&gt; package's &lt;a href="https://github.com/luanpotter/ordered_set/blob/master/lib/comparing.dart" rel="noopener noreferrer"&gt;Comparing class&lt;/a&gt;, to be used alongside functions that take sorting orders. So you can get all these goodies right now, but would be even better to have them standardized into the SDK.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Statements as expressions
&lt;/h2&gt;

&lt;p&gt;This one is pretty straightforward. Unlike Swift, Dart, or JS, in a few languages, like Kotlin and Rust, &lt;code&gt;if&lt;/code&gt; and &lt;code&gt;switch&lt;/code&gt; statements are expressions. For me, that is just a bonus that brings no hindrance. It's like adding sauce to your pasta. And it's optional of course. Use it if you want.&lt;/p&gt;

&lt;p&gt;Now, you are definitely thinking right now, we have had the ternary operator (&lt;code&gt;a ? b : c&lt;/code&gt;) since the primeval C language. And yes, the reason why Kotlin's &lt;code&gt;if&lt;/code&gt; in particular is an expression is because Kotlin doesn't have the ternary operator. And they have their reasons, which you can read on the &lt;a href="https://discuss.kotlinlang.org/t/ternary-operator/2116/6" rel="noopener noreferrer"&gt;discussion thread&lt;/a&gt; about it. So that is it? List item 5 is a hoax? Not so fast.&lt;/p&gt;

&lt;p&gt;First of all, I like the ternary. I'm not saying, at all, to remove it from Dart. But it has a few small issues that could be complemented by having both. When starting with Kotlin most people miss the ternary, but once you realize the language has &lt;code&gt;if&lt;/code&gt; statements as expressions, you barely miss it anymore. What's the difference?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    final a = isConditionTrue ? 1 : 2;
    final a = if (isConditionTrue) 1 else 2;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In that case pretty much nothing (I don't think small preferences of expressiveness vs succinctness are enough to propose Dart to change). Where the &lt;code&gt;if&lt;/code&gt; gets the better of the regular ternary though, is when the expression is not so short. If it doesn't fit in a line. Imagine this code:&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="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isConditionTrue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// several lines&lt;/span&gt;
    &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// several lines&lt;/span&gt;
    &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;result&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;Because we don't have if-expressions, I am forced to declare that variable &lt;code&gt;i&lt;/code&gt; as &lt;code&gt;var&lt;/code&gt; instead of &lt;code&gt;final&lt;/code&gt;, even though I don't plan on modifying it. I could get all the benefits from the compiler by marking it as final if the compiler was able to understand this:&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;final&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isConditionTrue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And yes, that can be done with the ternary, but if the bodies of one or both of the paths are big, you can get multi-line (or worse, nested) ternaries, which are particularly hard to understand and format in a pretty way. You could extract the blocks to functions, but sometimes to do that you are forced to pick very long names because those blocks weren't easily describable (which is why they weren't functions, to begin with). And with long names on the 3 operators (plus the output variable name in this case), you can easily get past your preferred line length even with the succinct 2-character operator.&lt;/p&gt;

&lt;p&gt;And that is not the only reason Kotlin opted for statements-as-expressions instead of ternary; while the ternary can replace the if statement, Kotlin has an extremely powerful &lt;code&gt;when&lt;/code&gt; statement, similar to the famous &lt;code&gt;switch&lt;/code&gt;. And even though Dart's &lt;code&gt;switch&lt;/code&gt; is fairly inflexible, being able to do this:&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;final&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;switch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;enum&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;VALUE&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="n"&gt;VALUE&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
    &lt;span class="n"&gt;VALUE&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is a very type-safe and concise way of mapping values, which would be just terrible to write with nested ternaries (and not type-safe when using a &lt;code&gt;Map&lt;/code&gt;, because switches guarantee exhaustion).&lt;/p&gt;

&lt;p&gt;Now, I would love to see more options for Dart's &lt;code&gt;switch&lt;/code&gt;, so it could be as powerful as Kotlin's or even Haskell's &lt;code&gt;case&lt;/code&gt;. But that is a much bigger change, that would require a lot of thought and profound decisions, since other than enums, who would more benefit from compile-time guaranteed exhaustion and pattern matching could be things like sealed classes or union types. And I think that is definitely something worth exploring, but not in this article; I am focusing on small, (hopefully) not very controversial changes that are for the better, in my opinion.&lt;/p&gt;

&lt;p&gt;And finally the last statement that I would like to mention is the &lt;code&gt;try&lt;/code&gt;. Having &lt;code&gt;try&lt;/code&gt; as expressions is incredibly handy and cannot be replaced by any other feature Dart currently has. It leads to much cleaner and readable code, for example:&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;final&lt;/span&gt; &lt;span class="n"&gt;variable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;parseInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'Failed to parse input &lt;/span&gt;&lt;span class="si"&gt;$arg&lt;/span&gt;&lt;span class="s"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="n"&gt;getDefaultValue&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;Again, preventing you from having non-final variables that you then have to guess if they have been initialized or not -- have the compiler deal with that for you.&lt;/p&gt;

&lt;p&gt;This list item is a language-level proposal, not an API change, so you would think there would be no package dependency mention here. Well, turns out Dartlin provides &lt;code&gt;if&lt;/code&gt;, &lt;code&gt;when&lt;/code&gt;, and &lt;code&gt;try&lt;/code&gt; as expressions via functions. I won't delve much into how it works but if you are curious (I know you are), check out &lt;a href="https://gitlab.com/wolfenrain/dartlin" rel="noopener noreferrer"&gt;the readme&lt;/a&gt; for more details. This is also possibly the biggest change of the bunch because it introduces this concept of implicitly returning the last expression on the block of these statements, but I believe it's quite intuitive to pick up and would make a good addition as well.&lt;/p&gt;




&lt;p&gt;And with that, I conclude this article. I mentioned 5 (relatively) small and (hopefully) simple features that I wish Dart had. Features that are optional, backwards compatible, and, IMHO, don't stray too further from what Dart already has to offer. Some can be emulated with different levels of fidelity using external libraries, like Dartlin, or clever workarounds, but in general, I believe adding these (or a subset, at least) to the language should be seriously considered, especially in the new Null-Safe world. Finally, I would like to thank all the people on the Dart team that helped make NS a reality and all the awesome package maintainers and contributors that are tirelessly converting their and other people's code to make sure everyone in the community has an even better experience with this awesome language. And I hope you liked this short read and maybe even learned something new and cool about the sprawling, creative world of programming languages.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>kotlin</category>
      <category>swift</category>
    </item>
    <item>
      <title>Flame 1.0 on the horizons</title>
      <dc:creator>Luan Nico</dc:creator>
      <pubDate>Sat, 05 Sep 2020 19:18:03 +0000</pubDate>
      <link>https://dev.to/blue-fire/flame-1-0-on-the-horizons-h38</link>
      <guid>https://dev.to/blue-fire/flame-1-0-on-the-horizons-h38</guid>
      <description>&lt;p&gt;&lt;em&gt;There is a TL;DR at the end so at least you have to scroll and see what you are missing.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Hi there, folks! We have some exciting changes to talk about and some even bigger ones on the horizon, so I decided to write down this post to share what's been going on with Flame recently (with a big announcement in the end!).&lt;/p&gt;

&lt;p&gt;Some of you might have seen activity on GitHub, and a few of you have been actively helping, so I think it's no surprise we have plans of moving towards Flame 1.0 in the near future! It's been a long journey through these years since I created the Flame engine. Since then, a lot of amazing people from the community came forward to help us grow this platform so much, but we always kept it on v0 (&lt;code&gt;0.x&lt;/code&gt; versions). That allowed us to "move fast and break things", even though we actively avoided big breaking changes after the first few releases.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1kxddpiq33kzjq8ly1w8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1kxddpiq33kzjq8ly1w8.jpg" alt="When your change is only mostly backwards compatible" width="674" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But a major side-effect of such a broad, helpful and kind community was that we learned and discovered a lot about Flame, games in Flutter, and how to make our lives even easier. So we collected a lot of feedback and ideas and decided that it was time to go to v1. Finally launch Flame 1.0, a more established and robust API.&lt;/p&gt;

&lt;p&gt;What will change? We do not want to break everything for nothing. Also, we are still committed to our core values, the first words in this repo since day one: a simple, modular game engine. So nothing huge will change, actually. But we will break a few things. We are taking this opportunity to make a few changes we always wanted to do but didn't want to create confusion on people migrating from &lt;code&gt;0.x&lt;/code&gt; to &lt;code&gt;0.(x+1)&lt;/code&gt;. But this is 1.0, and we have allowed ourselves some changes.&lt;/p&gt;

&lt;p&gt;You can, of course, take a peek on those changes on &lt;a href="https://github.com/flame-engine/flame" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; -- I encourage you to do so, I am really excited about them. And we would like to take this opportunity to ask for other ideas. If you have something in mind that would be a breaking change but you think would be worth it to add to v1, please open an issue to discuss (just make sure it has not already been discussed or implemented).&lt;/p&gt;

&lt;p&gt;But I would like to talk about one change in particular here, one that we partially rolled out to some extent to 0.x and one that will definitely be the most glaring one. In the beginning, everything that we added to Flame was a necessary building block, in my view, to create games; from the most simple to the most advanced ones. As time progressed, though, we started to add some more edge case features. This is in line with our modular approach - we never made anything mandatory or "in the way". But for some stuff, we decided to make separated packages. For example, we had &lt;a href="https://github.com/flame-engine/flame_gamepad" rel="noopener noreferrer"&gt;flame_gamepad&lt;/a&gt; for gamepad support, but box2d support was "included" in the flame package. There was no particular rule that led us to that decision (we didn't want any native code on Flame itself but that never stopped Flame to depend on plugins with native code). Also, dart and pub have a very nice tree-shaking algorithm, so we thought it didn't really matter.&lt;/p&gt;

&lt;p&gt;Now, for 1.0, after a lot of discussions, we decided to move to a more package separated approach. We want everything that is not absolutely core to be its own package. That way, Flame will not have many (if at all) dependencies. It will never have any native code. And anything that is an integration with something else should all be separated plugins.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fr1ghqysnl5114vu43dmk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fr1ghqysnl5114vu43dmk.jpg" alt="Separate all the things" width="667" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These plugins will be called &lt;code&gt;flame_*&lt;/code&gt; and will live in our GitHub/pub organizations. They can still be built and maintained by us, but also there can be other new ones entirely by the community (like the awesome package &lt;a href="https://github.com/RafaelBarbosatec/bonfire" rel="noopener noreferrer"&gt;bonfire&lt;/a&gt;, for example, be sure to check it out).&lt;/p&gt;

&lt;p&gt;This will allow Flame to be simpler and leaner, have fewer dependencies (and therefore fewer breaking points). The packages we are planning on extracting are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;flame_audio&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;flame_flare&lt;/code&gt; (and &lt;code&gt;flame_rive&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;flame_box2d&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;flame_tiled&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These plugins will peer depend on flame and have the same nice helpers we are used to. For example, we also happen to maintain our fork of the &lt;a href="https://github.com/flame-engine/box2d.dart" rel="noopener noreferrer"&gt;box2d.dart&lt;/a&gt; package, which is a Flame-agnostic port of box2d to dart. Flame, likewise, will know nothing of box2d. And &lt;code&gt;flame_box2d&lt;/code&gt; will have all the binding code, the &lt;code&gt;Box2dComponent&lt;/code&gt;s, the connections, the helpers to make it all work. Similarly, &lt;code&gt;flame_audio&lt;/code&gt; will depend on &lt;a href="https://github.com/luanpotter/audioplayers" rel="noopener noreferrer"&gt;audioplayers&lt;/a&gt; (and possibly other audio libraries) and provide everything flame currently adds vis-à-vis sound (like &lt;code&gt;AudioPool&lt;/code&gt;). And so on.&lt;/p&gt;

&lt;p&gt;One reason we started doing this already is due to some technical difficulties, especially with the plugins that depend on others. For example, the tiled package was updated to use a new Flutter version, forcing Flame, which depends on it, to do so as well. With this change, &lt;a href="https://github.com/flame-engine/flame_tiled" rel="noopener noreferrer"&gt;flame_tiled&lt;/a&gt; will be solely responsible for updating tiled and keeping it compatible. No one that does not use tiled will have to care for this particular issue.&lt;/p&gt;

&lt;p&gt;In order to keep it all consistent, we will be creating a brand new &lt;code&gt;flame_example&lt;/code&gt;, that will contain all flame packages and use &lt;a href="https://github.com/erickzanardo/dashbook" rel="noopener noreferrer"&gt;Dashbook&lt;/a&gt; to provide all the examples we have now on &lt;code&gt;doc/examples&lt;/code&gt;, and many more, making sure they all work together nicely.&lt;/p&gt;

&lt;p&gt;We hope this change will make our life easier to maintain our packages and also make everyone's lives easier as well by making it simple to "pick and choose" the modules you need and not care about the others.&lt;/p&gt;

&lt;p&gt;Now, let's set all the 1.0 hype aside for a second, so we can get to the rest of the news, our second big announcement.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9wwv1c1shnbn5v0v47pb.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9wwv1c1shnbn5v0v47pb.jpeg" alt="Drum roll, please!" width="225" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are also thrilled to share that we will be holding a recurring online event focusing on the Flame community: &lt;strong&gt;FlameCon&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Our plan is to create a space for people to share the awesome things that they build with Flame, and it will be open to everyone that wants both to present, or just to watch.&lt;/p&gt;

&lt;p&gt;The first edition will be held on &lt;strong&gt;Sept 16, 2020&lt;/strong&gt; at &lt;strong&gt;20:00 UTC&lt;/strong&gt;, and will host two talks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Building RPG games with Bonfire&lt;/strong&gt;, in which Rafael Barbosa, the author of Bonfire will present about this awesome RPG engine built on top of Flame.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimizing sprite usage with Fire Atlas&lt;/strong&gt;, in which Erick Zanardo will show what this tool is and how it can help you optimize and organize the sprites on your Flame game.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To participate in the event, check our official page &lt;a href="https://flame-engine.org/flamecon" rel="noopener noreferrer"&gt;here&lt;/a&gt;, and be sure to join the out &lt;a href="https://www.meetup.com/pt-BR/FlameCon/" rel="noopener noreferrer"&gt;MeetUp group&lt;/a&gt;; all needed information will be provided on those links!&lt;/p&gt;

&lt;p&gt;That is it for now, everyone! We are really excited and working hard to bring v1.0 to fruition, and we are really, really excited to be hosting our first ever FlameCon!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: &lt;strong&gt;&lt;a href="https://github.com/flame-engine/flame/projects/1" rel="noopener noreferrer"&gt;Flame 1.0&lt;/a&gt;&lt;/strong&gt; is in the oven and first &lt;strong&gt;&lt;a href="https://flame-engine.org/flamecon" rel="noopener noreferrer"&gt;Flamecon&lt;/a&gt;&lt;/strong&gt; will be held on &lt;strong&gt;Sept 16&lt;/strong&gt; at &lt;strong&gt;20:00 UTC&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>gamedev</category>
      <category>flame</category>
      <category>techtalks</category>
    </item>
  </channel>
</rss>
