<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hadi Abdulla N on Medium]]></title>
        <description><![CDATA[Stories by Hadi Abdulla N on Medium]]></description>
        <link>https://medium.com/@mhadi97?source=rss-3dad0515c1d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VbRnoeVJl7IcJUm3cZ6pHw.jpeg</url>
            <title>Stories by Hadi Abdulla N on Medium</title>
            <link>https://medium.com/@mhadi97?source=rss-3dad0515c1d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 12:23:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mhadi97/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Bringing Modern Library Management to My Hometown: The Story of Libre App]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@mhadi97/bringing-modern-library-management-to-my-hometown-the-story-of-libre-app-977b68b0c243?source=rss-3dad0515c1d------2"><img src="https://cdn-images-1.medium.com/max/2048/1*XpzfejVctC8bl4pooyqtMg.png" width="2048"></a></p><p class="medium-feed-snippet">A journey into Flutter, Clean Architecture, and the magic of Supabase for a local organization.</p><p class="medium-feed-link"><a href="https://medium.com/@mhadi97/bringing-modern-library-management-to-my-hometown-the-story-of-libre-app-977b68b0c243?source=rss-3dad0515c1d------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@mhadi97/bringing-modern-library-management-to-my-hometown-the-story-of-libre-app-977b68b0c243?source=rss-3dad0515c1d------2</link>
            <guid isPermaLink="false">https://medium.com/p/977b68b0c243</guid>
            <category><![CDATA[library-design]]></category>
            <category><![CDATA[supabase]]></category>
            <category><![CDATA[community-project]]></category>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Hadi Abdulla N]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 19:04:02 GMT</pubDate>
            <atom:updated>2025-07-10T19:04:02.476Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Dart 3.8 Null-Aware Elements: Cleaner Collections ✨]]></title>
            <link>https://medium.com/@mhadi97/dart-3-8-null-aware-elements-cleaner-collections-cd74123199b2?source=rss-3dad0515c1d------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd74123199b2</guid>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[null]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Hadi Abdulla N]]></dc:creator>
            <pubDate>Sun, 01 Jun 2025 03:53:24 GMT</pubDate>
            <atom:updated>2025-06-01T03:53:24.960Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dart 3.8 Null-Aware Elements: Cleaner Collections✨</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*Xgf7ecKOqiAs4igbhxYXpQ.jpeg" /><figcaption>Dart 3.8</figcaption></figure><p>Flutter Fam, gather ‘round! Have you ever felt that little pang of annoyance, that slight itch in your coding fingers, when you’re building a list or a map, and you have to sprinkle if (someVariable != null) checks just to conditionally include an element?</p><p>We’ve all been there: constructing a dynamic UI, assembling a list of user preferences, or building a JSON payload. The dance of if statements around potentially null values was a necessary evil, a slight speed bump on our road to beautiful, functional apps.</p><p>But hold onto your hot reload buttons, because Dart 3.8 has just dropped a silent, yet incredibly powerful, bomb that’s going to declutter your collection literals and make your code sing! Introducing <strong>Null-Aware Elements</strong>.</p><p>This isn’t about the ?. (null-aware access) or ?? (null-coalescing) operators we&#39;ve come to know and love. Those are fantastic for <em>using</em> a null-aware value. This new kid on the block is about <em>conditionally adding</em> an element to a collection, and it&#39;s ridiculously elegant.</p><p><strong>The Old Way: A Gauntlet of </strong><strong>if Statements 🤦‍♀️</strong></p><p>Imagine you have a few nullable values, and you want to add them to a list, but only if they actually exist (i.e., are not null). Before Dart 3.8, your code might have looked something like this:</p><pre>String? profileDescription;<br>String? userTagline = &#39;Building awesome apps!&#39;;<br>int? favoriteNumber = 42;<br>String? nullableFeatureFlag;<br> <br>// You want to build a list of user info, but only include existing values.<br>var userInfoList = &lt;String&gt;[];<br> <br>if (profileDescription != null) {<br>  userInfoList.add(profileDescription);<br>}<br>if (userTagline != null) {<br>  userInfoList.add(userTagline);<br>}<br>if (favoriteNumber != null) {<br>  userInfoList.add(favoriteNumber.toString()); // Convert int to String for the list<br>}<br>if (nullableFeatureFlag != null) {<br>  userInfoList.add(nullableFeatureFlag);<br>}<br> <br>print(userInfoList); // Might print: [Building awesome apps!, 42]</pre><p>Or, if you were feeling fancy with collection if (which is still great for larger blocks):</p><pre>var userInfoListWithIf = &lt;String&gt;[<br>  if (profileDescription != null) profileDescription,<br>  if (userTagline != null) userTagline,<br>  if (favoriteNumber != null) favoriteNumber.toString(),<br>  if (nullableFeatureFlag != null) nullableFeatureFlag,<br>];<br> <br>print(userInfoListWithIf);</pre><p>While functional, it still feels a bit… wordy, doesn’t it? Especially when you’re dealing with just a single element and its nullability.</p><p><strong>The New Dawn: Null-Aware Elements with </strong><strong>? (Dart 3.8) ✨</strong></p><p>Enter Dart 3.8’s genius. Now, to conditionally include an element if it’s not null, you simply prefix it with a ? inside your collection literal. That&#39;s it!</p><p>Let’s rewrite our userInfoList example:</p><pre>String? profileDescription; // Still null<br>String? userTagline = &#39;Building awesome apps!&#39;;<br>int? favoriteNumber = 42;<br>String? nullableFeatureFlag; // Still null<br> <br>var userInfoListMagic = &lt;String&gt;[<br>  ?profileDescription,           // Added only if not null<br>  ?userTagline,                  // Added only if not null<br>  ?favoriteNumber?.toString(),   // Access and then add if not null (combining with ?. for safety!)<br>  ?nullableFeatureFlag,          // Added only if not null<br>];<br> <br>print(userInfoListMagic); // Output: [Building awesome apps!, 42]</pre><p><strong>Isn’t that absolutely beautiful?!</strong></p><p>The ? in front of profileDescription (and the others) acts as a &quot;null-aware element&quot; operator. If profileDescriptionis null, it&#39;s simply <em>skipped</em> and not added to the list. If it has a value, it&#39;s included.</p><p>Notice how I combined it with ?.toString() for favoriteNumber. This demonstrates how beautifully the new null-aware elements play with our existing null-aware operators. ?favoriteNumber?.toString() means: &quot;If favoriteNumberis not null, then convert it to a string, and then <em>include that string in the list only if it&#39;s not null</em>.&quot; In this case, toString()will never return null for an int, so it effectively just adds the string representation if favoriteNumber exists.</p><p>This same magic applies to maps and sets as well!</p><p><strong>For Maps:</strong></p><pre>String? email = &#39;dev@example.com&#39;;<br>String? phoneNumber;<br> <br>var contactInfo = {<br>  &#39;name&#39;: &#39;Alice&#39;,<br>  ?if (email != null) &#39;email&#39;: email, // Old way with &#39;if&#39;<br>  ?&#39;phone&#39;: phoneNumber,             // NEW Null-aware element!<br>};<br> <br>print(contactInfo); // Output: {name: Alice, email: dev@example.com}</pre><p>In the map example, ?&#39;phone&#39;: phoneNumber will only add the &#39;phone&#39; key-value pair to the map if phoneNumber is not null.</p><p><strong>Why This is a Game-Changer 🚀</strong></p><ul><li><strong>Unprecedented Readability:</strong> Your collection literals become incredibly clean and concise. No more visual noise from repeated if statements.</li><li><strong>Reduced Boilerplate:</strong> Less code to write means less code to maintain and fewer opportunities for subtle bugs.</li><li><strong>Intuitive Syntax:</strong> The ? prefix clearly communicates the intent: &quot;include this <em>if it&#39;s not null</em>.&quot; It&#39;s an immediate visual cue for conditional inclusion.</li><li><strong>Seamless Integration:</strong> It slots perfectly into Dart’s existing null-safety features, making the language even more expressive and safe.</li></ul><p><strong>How to Get Your Hands On It</strong></p><p>This fantastic feature is part of <strong>Dart 3.8</strong>. To use it, simply ensure your Flutter project is running on a Dart SDK version that is 3.8 or higher. You’ll typically get this by updating your Flutter SDK to the latest stable channel (flutter upgrade).</p><p><strong>Final Thoughts: Dart Continues to Delight!</strong></p><p>The Dart team consistently delivers features that genuinely improve the developer experience, and null-aware elements in collection literals are a prime example. They address a common pain point with an elegant, idiomatic solution.</p><p>So, the next time you’re crafting a list, a set, or a map in Flutter, remember the power of the simple ? before an element. Your code will thank you, your future self will thank you, and your users will benefit from cleaner, more robust applications.</p><p>Go forth and embrace the new null-aware elegance!</p><p>What are your initial thoughts on this new feature? Drop a comment below! Happy coding! ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd74123199b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>