<?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 Rakibul Dev on Medium]]></title>
        <description><![CDATA[Stories by Rakibul Dev on Medium]]></description>
        <link>https://medium.com/@rakibul25.dev?source=rss-b04cf73f2848------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CQvFPHvUEF_0aqxLoMuQmA.png</url>
            <title>Stories by Rakibul Dev on Medium</title>
            <link>https://medium.com/@rakibul25.dev?source=rss-b04cf73f2848------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 07:13:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rakibul25.dev/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[I Built an Mobile App That Turns Your ClassNotes Into Quizzes!]]></title>
            <link>https://medium.com/@rakibul25.dev/i-built-an-mobile-app-that-turns-your-classnotes-into-quizzes-076bc519fc2e?source=rss-b04cf73f2848------2</link>
            <guid isPermaLink="false">https://medium.com/p/076bc519fc2e</guid>
            <category><![CDATA[education-technology]]></category>
            <category><![CDATA[study-tips]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[study-apps]]></category>
            <category><![CDATA[edtech]]></category>
            <dc:creator><![CDATA[Rakibul Dev]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 14:34:57 GMT</pubDate>
            <atom:updated>2026-09-23T14:34:57.690Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8f2-yvRx4kpVw_-wnJ_nXg.jpeg" /></figure><h3>I Built an AI App That Turns Your Notes Into Quizzes</h3><p>A few months ago, I started thinking about something that happens to almost every student.</p><p>You spend hours reading a chapter. You underline important parts, go through your notes again, maybe watch a few videos about the topic, and eventually close the book feeling like you understand everything.</p><p>Then someone asks you a simple question about what you just studied.</p><p>And suddenly, you realize you don’t remember nearly as much as you thought you did.</p><p>That made me think: <strong>what if our study material could quiz us instead of us simply reading it over and over again?</strong></p><p>So I decided to build something.</p><p>It’s called <a href="https://play.google.com/store/apps/details?id=app.jhalai.ai"><strong>jhalAI</strong></a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FTF1YDlBw0KI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DTF1YDlBw0KI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FTF1YDlBw0KI%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d86f32dc8d56ebbf63f4c9584d8cb7f/href">https://medium.com/media/0d86f32dc8d56ebbf63f4c9584d8cb7f/href</a></iframe><h3>From study notes to a quiz</h3><p>The idea behind jhalAI is pretty simple. You give it your study material, and AI turns that material into a quiz that you can actually take.</p><p>Instead of manually creating practice questions, a student can use their own notes as the source.</p><p>The concept sounds simple, but I found it surprisingly interesting to build because study material isn’t always a clean digital document.</p><p>Students use PDFs, textbooks, screenshots, scanned pages, and, very often, handwritten notebooks. A page might contain a mixture of handwriting, diagrams, Bangla and English, with important points underlined or circled.</p><p>That’s the kind of material I wanted jhalAI to eventually understand.</p><p>The goal isn’t to create another general-purpose AI chatbot where students have to figure out what prompt to write.</p><p>I wanted the experience to be closer to:</p><p><strong>Here are my notes. Test me.</strong></p><h3>Why quizzes?</h3><p>There are already countless apps that help people read, summarize, or explain things.</p><p>AI is particularly good at those tasks now.</p><p>But studying isn’t only about understanding something when you’re looking at it. It’s also about being able to remember it when the answer isn’t sitting in front of you.</p><p>That’s where quizzes become interesting.</p><p>A student can spend an hour studying a chapter and then spend a few minutes answering questions generated from that same material. The result can reveal something that simply rereading the chapter can’t: <strong>what they actually remember.</strong></p><p>That became the core idea behind jhalAI.</p><p>Not replacing books.</p><p>Not replacing teachers.</p><p>Not trying to become another ChatGPT.</p><p>Just making it easier to practice what you’ve studied.</p><h3>Building it for real students</h3><p>One of the things I wanted to avoid was building the entire product based on what I <em>thought</em> students needed.</p><p>So I started putting it in front of actual students.</p><p>Their feedback changed the app in small but meaningful ways.</p><p>For example, I hadn’t originally considered a quiz timer particularly important. Then a tester suggested it, and it immediately made sense. If you’re practicing for an exam, knowing whether you can recall an answer quickly can be useful too.</p><p>Bengali was another interesting challenge.</p><p>English content was generally easier to get right, but generating natural and useful Bengali questions required more testing and iteration. The questions needed to make sense in Bengali rather than simply looking like English sentences translated into Bengali.</p><p>Those experiments have probably taught me more about the product than the original idea did.</p><h3>I kept the first version small</h3><p>There was always a temptation to add more.</p><p>Accounts, Social features, Leaderboards, Subscriptions.</p><p>And a dozen other things that sound exciting when you’re building an app.</p><p>But I wanted to answer one question first:</p><p><strong>Is the core idea useful?</strong></p><p>So the initial version of jhalAI is intentionally focused.</p><p>Take your study material, generate a quiz, and practice.</p><p>That’s the part I want to get right before adding everything else.</p><h3>What I want jhalAI to become</h3><p>I don’t think AI will replace the traditional ways people learn.</p><p>A good teacher, a good book, and actually understanding a subject are still incredibly important.</p><p>But AI can make some parts of studying more accessible.</p><p>Imagine finishing a chapter and immediately having a personalized set of questions based on exactly what you studied.</p><p>Or having a stack of handwritten notes before an exam and turning them into something you can actively practice.</p><p>That’s the direction I’m exploring with jhalAI.</p><p>And honestly, I’m still figuring it out.</p><p>It’s an early product, and there are plenty of things I want to improve. Better handling of different types of notes, better question generation, more useful feedback, more study modes, and eventually a much more personalized learning experience.</p><p>But I think starting small is important.</p><p><strong>Google Play — </strong><a href="https://play.google.com/store/apps/details?id=app.jhalai.ai"><strong>jhalAI</strong></a></p><p>I’d genuinely love to hear what you think, especially if you’re a student or teacher using it.</p><p>I’m still building it.<br><a href="https://play.google.com/store/apps/details?id=app.jhalai.ai">https://play.google.com/store/apps/details?id=app.jhalai.ai</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=076bc519fc2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Say goodbye to redundant constructor boilerplate starting with Dart 3.12! ]]></title>
            <link>https://medium.com/@rakibul25.dev/say-goodbye-to-redundant-constructor-boilerplate-starting-with-dart-3-12-8c1cdcff9246?source=rss-b04cf73f2848------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c1cdcff9246</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Rakibul Dev]]></dc:creator>
            <pubDate>Fri, 18 Sep 2026 13:45:17 GMT</pubDate>
            <atom:updated>2026-09-18T13:45:17.138Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9BDDLiIb20bTBkBlHYqBzA.jpeg" /></figure><p>Are you guys not clear with the title? Ok!,making it easy.</p><p>If you write Dart, you’ve probably typed this.name, this.age many times. Dart 3.12 finally fixes that by bringing <strong>Primary Constructors</strong> and <strong>Private Named Parameters</strong>.</p><p>If you are coming from Kotlin, C#, or TypeScript, you might be thinking: <em>“Wait… it took them this long?”</em> Yes. Yes, it did. But let’s see what actually changed.</p><h3>What it was vs. What it is now</h3><h4>1. Primary Constructors (No more repeating fields)</h4><ul><li><strong>What it was:</strong> You declare fields at the top, then repeat them inside the constructor.</li></ul><pre>class Dog {<br>  final String name;<br>  int age;<br><br>  Dog(this.name, this.age);<br>}</pre><ul><li><strong>What it is now:</strong> Put fields right in the class header with final or var, and delete the duplicate body.</li></ul><pre>class Dog(final String name, int age);</pre><h4>2. Private Named Parameters (No more mapping workarounds)</h4><ul><li><strong>What it was:</strong> You couldn’t directly initialize private named parameters like _pin from outside easily without manual redirection.</li></ul><pre>class Vault {<br>  final int _pin;<br>  Vault({int pin = 0}) : _pin = pin;<br>}</pre><ul><li><strong>What it is now:</strong> Put _ right inside the named parameter.</li></ul><pre>class Vault {<br>  Vault({final int _pin = 0});<br>}</pre><h3>If you’re from a Kotlin background…</h3><p>Kotlin’s primary constructors look like</p><p>class Dog(val name: String, var age: Int). Dart just adopted its own flavor of this convenience. You didn&#39;t miss anything groundbreaking; Dart just caught up to standard modern language ergonomics.</p><h3>Why did Dart follow this conservative approach till now?</h3><p>Three big reasons I think:</p><ol><li><strong>Flutter UI Trees:</strong> Dart is heavily tied to Flutter, where named arguments rule widget hierarchies (MyWidget({required this.child, super.key})). Designing a primary constructor syntax that doesn&#39;t break named arguments, positional/optional mixing, and defaults required careful thought.</li><li><strong>Factory Constructors &amp; Initializers:</strong> Dart classes often have named constructors, factory constructors, and _field = value initialization lists. Fitting primary constructors cleanly into that complex zoo without breaking existing rules is hard.</li><li><strong>Dart’s Philosophy:</strong> Dart traditionally favors explicit readability over magic shorthand, waiting until community pain points become overwhelming before adding syntactic sugar.</li></ol><p>Better late than boilerplate-free! Are you converting your old Flutter models to this yet, or keeping it classic?</p><p>#flutter #dart #mobiledevelopment #programming #SoftwareEngineering</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c1cdcff9246" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built a Flutter Package So Users Never Have to Re-Type Form Data Again!]]></title>
            <link>https://medium.com/@rakibul25.dev/i-built-a-flutter-package-so-users-never-have-to-re-type-form-data-again-a2cf35e8c117?source=rss-b04cf73f2848------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2cf35e8c117</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <dc:creator><![CDATA[Rakibul Dev]]></dc:creator>
            <pubDate>Wed, 08 Apr 2026 17:21:58 GMT</pubDate>
            <atom:updated>2026-04-08T17:21:58.557Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hydCHGqKAgSuHRcsPInHAA.png" /></figure><p>You’re building a courier app. The delivery person opens a form, types a customer’s phone number, and manually fills in the name, address, floor, and special instructions.</p><p><strong>Next delivery? Same customer. Same phone number. And they’re typing it all again.</strong></p><p>I watched this happen in a real app last month. <strong>45 seconds wasted</strong> on data the app should have remembered. It wasn’t just one user — every delivery person faced the same frustration dozens of times a day.</p><p>That’s when I realized: <strong>Flutter needed a better solution for multi-record forms.</strong></p><h3>Why OS Autofill isn’t Enough?</h3><p>OS autofill is designed around one person’s identity. <br>Many apps work with many records:</p><ul><li>Customers</li><li>Patients</li><li>Orders</li><li>Vehicles</li><li>Addresses</li></ul><p>These apps need form memory by record ID, not just by device owner.</p><p><a href="https://pub.dev/packages/smart_form_memory">smart_form_memory</a> saves complete form data using a unique key you control ( phone, email, customer_id, etc.). <br>When that key appears again, the form can suggest and autofill previous data.</p><blockquote>No manual controller map. <br>No custom JSON plumbing. <br>No repeated typing.</blockquote><h3>What This Package Does</h3><p>Here’s what it gives you:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0WOyelCt-auNFsH-u4CqEQ.jpeg" /></figure><h3>How Autofill Works (Visual Flow)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iB3Ohk3vSG5MfzEbNdZozw.jpeg" /></figure><h3>Simple Example (Looks Like Normal Flutter Code)</h3><pre>SmartForm(<br>  uniqueFieldKey: &#39;phone_number&#39;,<br>  child: Column(<br>    children: [<br>      const SmartFormTextField(<br>        fieldKey: &#39;phone_number&#39;,<br>        decoration: InputDecoration(labelText: &#39;Phone Number&#39;),<br>        keyboardType: TextInputType.phone,<br>      ),<br><br>     //If you are using Form + validator, use SmartFormTextFormField.<br><br>      const SmartFormTextFormField(<br>          fieldKey: &#39;phone_number&#39;,<br>          decoration: const InputDecoration(labelText: &#39;Phone Number&#39;),<br>          validator: (value) {<br>            if (value == null || value.isEmpty) return &#39;Phone is required&#39;;<br>            return null;<br>          },<br>        ),<br><br>      const SmartFormTextField(<br>        fieldKey: &#39;full_name&#39;,<br>        decoration: InputDecoration(labelText: &#39;Full Name&#39;),<br>      ),<br><br>      const SmartFormRadio(<br>        fieldKey: &#39;address_type&#39;,<br>        label: &#39;Location Type&#39;,<br>        options: [&#39;Home&#39;, &#39;Office&#39;, &#39;Other&#39;],<br>      ),<br><br>      const SmartFormDropdown(<br>        fieldKey: &#39;delivery_slot&#39;,<br>        label: &#39;Delivery Slot&#39;,<br>        items: [&#39;Morning&#39;, &#39;Afternoon&#39;, &#39;Evening&#39;],<br>      ),<br><br>      const SmartFormTagField(<br>        fieldKey: &#39;tags&#39;,<br>        label: &#39;Package Tags&#39;,<br>        tags: [&#39;Fragile&#39;, &#39;Keep Upright&#39;, &#39;Leave at Door&#39;],<br>      ),<br>    ],<br>  ),<br>)</pre><h3>You Still Control Your UI</h3><p>This package does <strong>not</strong> lock you into any UI style.</p><p>All fields are Flutter widgets, so you can use:</p><ul><li>Your own colors and text styles</li><li>Custom InputDecoration</li><li>Icons, padding, themes</li><li>Material or Cupertino</li></ul><pre>const SmartFormTextField(<br>  fieldKey: &#39;full_name&#39;,<br>  decoration: InputDecoration(<br>    labelText: &#39;Full Name&#39;,<br>    prefixIcon: Icon(Icons.person),<br>    border: OutlineInputBorder(),<br>  ),<br>)</pre><h3>Save, Reset, or Clear — You Decide</h3><p>Save the form:</p><pre>await SmartForm.of(context)?.save();</pre><p>Clear only the form UI:</p><pre>SmartForm.of(context)?.resetForm();</pre><p>Clear all saved records:</p><pre>const storage = SharedPrefsSmartFormStorage();<br>await storage.clearAll();<br>await SmartForm.of(context)?.refreshIds();</pre><h3>Use Your Own Storage (Hive, Secure, etc.)</h3><p>If you want full control, just implement this:</p><pre>class MySecureStorage implements SmartFormStorage {<br>  @override<br>  Future&lt;void&gt; write(String id, Map&lt;String, dynamic&gt; data) async {}<br><br>  @override<br>  Future&lt;Map&lt;String, dynamic&gt;?&gt; read(String id) async =&gt; null;<br><br>  @override<br>  Future&lt;List&lt;String&gt;&gt; getAllKeys() async =&gt; [];<br><br>  @override<br>  Future&lt;void&gt; clearAll() async {}<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pfzi09hsPTh2WZSUawFNjg.png" /></figure><h3>Get Started</h3><p>Add it to your pubspec.yaml:</p><pre>dependencies:<br>  smart_form_memory: ^0.0.4</pre><blockquote>Or</blockquote><pre>flutter pub add smart_form_memory</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2cf35e8c117" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Revolution in Memory: Why 16KB Pages in Android 15 Are a Bigger Deal Than You Think]]></title>
            <link>https://medium.com/@rakibul25.dev/a-revolution-in-memory-why-16kb-pages-in-android-15-are-a-bigger-deal-than-you-think-bf6ad28723fd?source=rss-b04cf73f2848------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf6ad28723fd</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[16-kb]]></category>
            <category><![CDATA[android-architecture]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Rakibul Dev]]></dc:creator>
            <pubDate>Tue, 02 Sep 2025 20:01:33 GMT</pubDate>
            <atom:updated>2025-09-03T15:04:51.401Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Smv9YYel5Mb9Lqfb6hXbPw.png" /></figure><p>Everyone’s talking about November 1: developers need to start updating their apps to support 16 KB pages on Android 15. But this isn’t just another update — it marks the quiet beginning of a revolution in how Android handles memory, promising to unlock the raw performance devices have been waiting for.</p><p>Most people don’t know the real story behind this change, why Google made this move, how it fundamentally changes memory management, and why it will make your phone feel faster and smoother without you even knowing why.</p><p>Let’s break down this powerful under-the-hood upgrade.</p><h3>How Android Managed Memory Before (The Linux Way)</h3><p>At its core, Android is built on Linux, and for decades, Linux has used a clever method to manage memory. Instead of giving apps one continuous block of memory, it breaks it down into small, manageable chunks called <strong>pages</strong>.</p><p>Traditionally, on Android and most other Linux-based systems, these pages were <strong>4KB</strong> in size.</p><p>Think of it like this: If your app needs a lot of memory, the system doesn’t hand it one giant blank sheet of paper. Instead, it hands over thousands of tiny 4KB pages and keeps a detailed map of where each one is located.</p><p>This worked well for years, but there’s a catch: managing millions of tiny 4KB pages creates a lot of extra work for the CPU. Every single page needs an entry in the system’s memory map, or <strong>Page Table</strong>. The more pages an app needs, the more pressure it puts on the CPU. The more pages an app uses, the more pressure it puts on the CPU and the <strong>Translation Lookaside Buffer (TLB)</strong>, the CPU’s quick reference for actively used memory pages. The more pages an app needs to track, the faster its quick-access cache (the TLB) fills up. When the cache is full, the CPU is forced to constantly check the main memory’s much larger, as result slower Page Table, which creates extra work and slows everything down.</p><p>Starting with Android 15, new devices are adopting 16KB pages instead of the long-standing 4KB ones.</p><p>What does this mean for your device?</p><ul><li>Instead of 4KB chunks, memory is now divided into <strong>16KB chunks</strong>.</li><li>This means the system has <strong>fewer chunks to manage</strong>, which translates to <strong>fewer entries in the page table</strong>.</li><li>This significantly reduces the CPU overhead required to track memory.</li></ul><p>To go back to our analogy, the system isn’t handing out four-page booklets anymore , it’s handing out sixteen-page booklets at a time. The content is the same, but the librarian has way less back-and-forth work to do.</p><h3>A Real-World Example: Why This Matters</h3><p>Let’s say a modern app or game needs 64MB of memory.</p><ul><li><strong>With 4KB pages:</strong> The system needs to manage 16,384 pages (64MB / 4KB). The CPU must track over 16,000 entries in its memory map.</li><li><strong>With 16KB pages:</strong> The system only needs to manage 4,096 pages (64MB / 16KB). The CPU now has to track just one-fourth the number of entries.</li></ul><p>That’s a <strong>75% reduction in overhead</strong> for just one app! Imagine this speed-up multiplied across every app, process, and background service running on your phone.</p><h3>Why Now? A New Generation of Chips!</h3><p>If this change is so good, why didn’t Android do it sooner? The simple answer is that older processors couldn’t handle it efficiently. For years, ARM chips and memory controllers were optimized around the 4KB page size. Switching earlier would have caused more problems than it solved.</p><p>But today’s smartphones are completely different. Modern processors from Snapdragon, Tensor, Exynos, and Dimensity are powerful enough to handle 16KB pages with ease. The hardware finally has the power to take advantage of this new memory model.</p><h3>The Silent Revolution: Less Work, More Speed</h3><p>This shift is truly revolutionary for Android. While devices configured with 16 KB page sizes may use slightly more memory on average, they gain significant performance improvements for both the system and apps.</p><p>According to Google:</p><blockquote>Here’s a look at the gains from initial testing:</blockquote><blockquote><strong>Faster App Launches:</strong> App launch times are <strong>3.16% lower on average</strong>, with some apps we tested seeing improvements of up to <strong>30%</strong>.</blockquote><blockquote><strong>Reduced Power Draw:</strong> Devices show a <strong>4.56% reduction in power draw</strong> during app launch.</blockquote><blockquote><strong>Improved Camera Performance:</strong> Camera launches are <strong>4.48% faster</strong> (hot starts) and <strong>6.60% faster</strong> (cold starts) on average.</blockquote><blockquote><strong>Quicker System Boot:</strong> The system boot time is improved by <strong>8% (approximately 950 milliseconds)</strong> on average.</blockquote><p>While these results will vary across devices, the message is clear: the benefits are real and impactful. This one change fundamentally transforms how the entire ecosystem performs. The apps you use, the games you play, and even the battery life you get will all quietly benefit from this one powerful change.</p><p>While everyone is focused on the November 1, the real story is this quiet paradigm shift. Android 15’s move to 16KB memory pages is the kind of technical improvement that doesn’t make flashy headlines but fundamentally changes how the entire ecosystem performs. The apps you use, the games you play, and even the battery life you get will all quietly benefit from this one powerful change.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf6ad28723fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Foundation of Flutter State Management: InheritedWidget & InheritedModel!]]></title>
            <link>https://medium.com/@rakibul25.dev/understanding-the-foundation-of-flutter-state-management-inheritedwidget-inheritedmodel-79f3ab94da09?source=rss-b04cf73f2848------2</link>
            <guid isPermaLink="false">https://medium.com/p/79f3ab94da09</guid>
            <category><![CDATA[provider]]></category>
            <category><![CDATA[inheritedwidget]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[inheritedmodel]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Rakibul Dev]]></dc:creator>
            <pubDate>Sat, 30 Aug 2025 20:16:12 GMT</pubDate>
            <atom:updated>2025-08-30T20:22:07.038Z</atom:updated>
            <content:encoded><![CDATA[<p>When we talk about Flutter state management, we hear names like <strong>Provider</strong>, <strong>Riverpod</strong>, or <strong>Bloc</strong>. These tools make our life easier, but have you ever wondered what’s really happening behind the scenes?</p><p>The truth is: <strong>InheritedWidget</strong> (and its big brother <strong>InheritedModel</strong>) are the real heroes. Every state management solution in Flutter is secretly built on top of them.</p><p>Let’s break it down in simple words.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fz-8Dibdcnlhct7SNsVHbA.jpeg" /></figure><h3>What is InheritedWidget?</h3><p>Think of InheritedWidget like a <strong>magic pipeline</strong> that carries data down your widget tree.</p><p>Normally, if you want to pass data from the top of your app to a widget deep inside, you would have to keep sending it through constructors:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QuRM8JLx3CXV9j-vBPKvVw.png" /></figure><p>That’s boring and messy right? 😩</p><p>With <strong>InheritedWidget</strong>, the child widget can directly grab the data it needs, without bothering everyone in between.</p><h3># A Simple Example</h3><pre>class CounterProvider extends InheritedWidget {<br>  final int counter;<br>  CounterProvider({<br>    required this.counter,<br>    required Widget child,<br>  }) : super(child: child);<br><br>  static CounterProvider? of(BuildContext context) {<br>    return context.dependOnInheritedWidgetOfExactType&lt;CounterProvider&gt;();<br>  }<br><br>  //If the counter value changes, boom! Widgets depending on it get rebuilt.  <br>  @override<br>  bool updateShouldNotify(CounterProvider oldWidget) {<br>    return oldWidget.counter != counter;<br>  }<br>}</pre><p>And you use it like this:</p><pre>// Somewhere deep in the tree<br>final counter = CounterProvider.of(context)!.counter;<br>Text(&quot;Counter: $counter&quot;);</pre><p># Here’s the magic:</p><ul><li>Widgets that call CounterProvider.of(context) automatically rebuild when the counter changes.</li><li>No need to pass data manually through every widget.</li></ul><h3># Why is this so powerful?</h3><p>The method dependOnInheritedWidgetOfExactType is the real trick here.</p><p>When a widget decalres that it depends on anInheritedWidget, Flutter keep track of that.<br> So when the data changes, Flutter knows exactly which widgets need to rebuild.</p><p>That’s why <strong>Provider</strong> is just a fancy wrapper around InheritedWidget. It doesn’t reinvent, it just makes the process easier to use.</p><h3>#But wait! what about InheritedModel?</h3><p>There’s a small problem with InheritedWidget:<br> Did you notice that if <em>any</em> value changes, <strong>all the dependent widgets rebuild</strong>, even if they don’t care about that value?</p><p>Example: imagine a User object with user name and avatar.</p><ul><li>If only the avatar changes, you don’t really need to rebuild the widget that shows the name.</li><li>But with InheritedWidget, both would rebuild. The avatar section and name.</li></ul><p>That’s a bit wasteful. 😬</p><p>And this is exactly the problem <strong>InheritedModel</strong> solves.</p><h3># How InheritedModel Fixes It?</h3><p>InheritedModel lets widgets say:<br> <em>“I only care about the name”</em> or <em>“I only care about the avatar”</em>.</p><p>So only the widgets that care about the changed value will rebuild.</p><pre>class UserModel extends InheritedModel&lt;String&gt; {<br>  final String name;<br>  final String avatar;<br>  const UserModel({<br>    required this.name,<br>    required this.avatar,<br>    required Widget child,<br>  }) : super(child: child);<br><br>  static UserModel? of(BuildContext context, {String? aspect}) {<br>    return InheritedModel.inheritFrom&lt;UserModel&gt;(context, aspect: aspect);<br>  }<br><br>  @override<br>  bool updateShouldNotify(UserModel oldWidget) {<br>    return name != oldWidget.name || avatar != oldWidget.avatar;<br>  }<br><br>  @override<br>  bool updateShouldNotifyDependent(UserModel oldWidget, Set&lt;String&gt; aspects) {<br>    if (aspects.contains(&quot;name&quot;) &amp;&amp; name != oldWidget.name) return true;<br>    if (aspects.contains(&quot;avatar&quot;) &amp;&amp; avatar != oldWidget.avatar) return true;<br>    return false;<br>  }<br>}</pre><p>Usage:</p><pre>// Only cares about name<br>Text(UserModel.of(context, aspect: &quot;name&quot;)!.name);<br>// Only cares about avatar<br>CircleAvatar(<br>  backgroundImage: NetworkImage(UserModel.of(context, aspect: &quot;avatar&quot;)!.avatar),<br>);</pre><p>Now if just the avatar changes → only the avatar widget rebuilds. ✅</p><h3># What It All Comes Down To?</h3><p>At the end of the day, almost every state management solution in Flutter is standing on the same foundation: InheritedWidget.</p><ul><li><strong>Provider</strong> → just a convenient wrapper around InheritedWidget.</li><li><strong>Riverpod</strong> → a smarter, safer Provider, but still the same idea underneath.</li><li><strong>Bloc / Cubit</strong> → built on streams, but they also rely on InheritedWidget to get data down the tree.</li><li>Even <strong>GetX, MobX</strong>, and others → all end up leaning on this same mechanism.</li></ul><p>So the final thing is:<br> 👉 If you understand InheritedWidget (and InheritedModel), you already understand the core principle behind <em>all</em> Flutter state management libraries.</p><p>No matter which package you use, behind the curtain, it’s really just InheritedWidget doing the heavy lifting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79f3ab94da09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Don’t Panic Over Lint Errors in Flutter Plugins: A Scalable Solution Explained]]></title>
            <link>https://medium.com/@rakibul25.dev/dont-panic-over-lint-errors-in-flutter-plugins-a-scalable-solution-explained-d0cdf135dd48?source=rss-b04cf73f2848------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0cdf135dd48</guid>
            <category><![CDATA[flutter-plugin]]></category>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[lint]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Rakibul Dev]]></dc:creator>
            <pubDate>Mon, 28 Jul 2025 13:31:01 GMT</pubDate>
            <atom:updated>2025-07-28T13:31:01.709Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w5Rku5DdMSY8tYRxNuGXKw.png" /></figure><p>If you’ve recently upgraded some of your Flutter plugins and run into Android Lint warnings or build failures like this:</p><pre>Missing permissions required by NotificationManagerCompat.notify</pre><p>Many developers hit the panic button here, but take a deep breath. This isn’t always a problem with <em>your</em> code.</p><h4>🔍 Why This Happens</h4><p>Let’s look at a real-world example with the Geolocator plugin. You see the warning:</p><p>⁣Missing permissions required by NotificationManagerCompat.notify</p><p>But here’s the kicker: the plugin <em>intentionally</em> doesn’t include this permission in its AndroidManifest.xml. Why? Because Android cleverly <strong>merges plugin-level manifests</strong> into your final app manifest. If a plugin like geolocator_android added POST_NOTIFICATIONS, <em>every</em> app using it would end up with that permission—even if they never touch notifications!</p><p>Plugin maintainers often say, “This should be an explicit choice of the app developer, and therefore the developer should manually add the permission.” This is totally valid and aligns with best practices. However, for app developers who <em>aren’t</em> using that specific feature, it just creates unwanted Lint noise.</p><h4>✅ Your Options</h4><p>So, what can you do?</p><h4>Option 1: Explicit Permission (when you actually use the feature)</h4><p>If your app genuinely uses the feature that requires the missing permission (like notifications in this example), the solution is straightforward: Add the permission directly to your app level:AndroidManifest.xml</p><pre>&lt;uses-permission android:name=&quot;android.permission.POST_NOTIFICATIONS&quot;/&gt;</pre><h4>✅ Best Approach: Scalable Lint Handling via Gradle</h4><p>What if you <em>don’t</em> use the feature, and adding a permission just to silence a Lint error feels wrong? This is where a scalable Gradle-based solution comes in, helping you avoid that panic.</p><p>This snippet goes into your <strong>project-level </strong><strong>android/build.gradlefile:</strong></p><pre>subprojects {<br>    afterEvaluate { project -&gt;<br>        if (project.hasProperty(&quot;android&quot;)) {<br>            project.android {<br>                lintOptions {<br>                    checkReleaseBuilds false<br>                    abortOnError false<br>                }<br>            }<br>        }<br>    }<br>    project.buildDir = &quot;${rootProject.buildDir}/${project.name}&quot;<br>}</pre><blockquote>But be careful, disabling lint globally is not a good practice</blockquote><p>Turning off lint checks for <em>all</em> Android projects might seem like a quick fix, but it hides potential issues in your app or libraries.</p><p>A better way is to <strong>target lint disabling selectively</strong>, for example:</p><h4>Disable lint only for a specific plugin or module</h4><p>If you want to silence lint errors for just one plugin (say flutter_downloader), you can do:</p><pre>subprojects {<br>    afterEvaluate { project -&gt;<br>        if (project.name.contains(&quot;flutter_downloader&quot;) &amp;&amp; project.hasProperty(&quot;android&quot;)) {<br>            project.android {<br>                lintOptions {<br>                    checkReleaseBuilds false<br>                    abortOnError false<br>                }<br>            }<br>        }<br>    }<br>}</pre><p>This way, only the flutter_downloader module has relaxed lint rules, while other modules remain strict.</p><h4>Disable lint or specific lint tasks by language (e.g., Kotlin)</h4><p>Sometimes you want to disable Kotlin linting tasks (ktlint) for certain modules without affecting Java or other languages:</p><pre>subprojects {<br>    afterEvaluate { project -&gt;<br>        if (project.name.contains(&quot;flutter_downloader&quot;)) {<br>            project.tasks.matching { it.name.contains(&quot;ktlint&quot;) }.all {<br>                it.enabled = false<br>            }<br>        }<br>    }<br>}</pre><p>This disables only the Kotlin lint tasks for flutter_downloader, keeping lint intact elsewhere.</p><h4>Why This Is Better Than Traditional Lint Bypass</h4><p>Compare that with the more common snippet:</p><p>✅ <strong>Scalability</strong>: My version not only disables error abortion but also organizes the build folders. This avoids clutter and centralizes your build artifacts.</p><p>✅ <strong>Better Debugging</strong>: By setting checkReleaseBuilds to false, we avoid surprises during production builds while still being able to lint during development.</p><p>✅ <strong>Customizability</strong>: You can fine-tune this per project if needed by modifying project.name.</p><h4>🔚 Final Thoughts</h4><p>Not every warning is a deal-breaker, especially in a fast-evolving ecosystem like Flutter. Sometimes, packages trigger errors that simply aren’t relevant to your current use case. When you encounter these:</p><ol><li><strong>Understand why</strong> the error is appearing.</li><li><strong>Decide if you truly need</strong> the permission or feature it’s complaining about.</li><li><strong>Choose a scalable way</strong> to suppress or resolve the error.</li></ol><p>So, next time a Lint warning pops up, breathe. Think. And perhaps, instead of panicking, just drop in that handy Gradle snippet.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0cdf135dd48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parallel API Requests Breaking in Flutter? Don’t Close Your HTTP Client—Here’s Why]]></title>
            <link>https://medium.com/@rakibul25.dev/parallel-api-requests-breaking-in-flutter-dont-close-your-http-client-here-s-why-1f8ff79b5832?source=rss-b04cf73f2848------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f8ff79b5832</guid>
            <category><![CDATA[bug-fixes]]></category>
            <category><![CDATA[api-integration]]></category>
            <category><![CDATA[networking-in-flutter]]></category>
            <category><![CDATA[http-client]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Rakibul Dev]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 18:59:04 GMT</pubDate>
            <atom:updated>2025-07-01T18:59:04.556Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zW_Q4omDTw0CiofCGNePWw.png" /></figure><p>If you’ve ever experienced your Flutter app throwing a SocketException or showing a “No Internet” error when triggering multiple API calls, you’re not alone. This is a common pitfall many developers encounter when managing HTTP clients improperly.</p><p>Recently, during one of our projects, we ran into this exact problem. After some debugging, we found that the issue was inside our API client’s management of the HTTP client lifecycle.</p><p><strong>In this post, you’ll learn:</strong></p><ul><li>🎯 How to properly structure your ApiClientusing a shared, long-lived client.</li><li>🧠 Clean architecture principles: separating networking from user interaction logic.</li></ul><h4><strong>The Root Cause: Closing the </strong><strong>http.Client Too Early</strong></h4><p>When working with Dart’s httppackage, the http.Clientinstance is responsible for managing all HTTP connections, including maintaining sockets and handling connections under the hood.</p><p>In our initial API client implementation, we had a pattern like this for POST requests:</p><pre>client.close();<br>client = http.Client();<br>response = await client.post(Uri.parse(url), headers: headers, body: body);</pre><p>Our intention was to refresh the client for every request to ensure a clean connection. However, this caused unexpected issues.</p><p>The method client.close()<strong>closes all active HTTP connections immediately</strong>. That means</p><ul><li>If you call client.close()while another request is still in progress, that in-progress request is terminated all of a sudden.</li><li>Any following requests using the newly created client can only start new connections.</li><li>The terminated requests throw SocketExceptionerrors since their underlying connections were killed.</li></ul><p>Now imagine you make two API calls back-to-back before the first one finishes. When the second call executesclient.close(), the first request is turned off mid-flight, causing your app to receive a connection error.</p><p>This is why you see “No Internet” errors during rapid API requests, even though your network is fine.</p><h4><strong>How We Fixed It: Use One Long-Lived Shared Client</strong></h4><p>The solution is simple but critical: <strong>do not close the </strong><strong>http.Client after each request. Instead, create a single shared client instance and reuse it for all HTTP requests.</strong></p><p>Here’s the pattern we did:</p><pre>class ApiClient {<br>  final http.Client client = http.Client();  // shared, long-lived client<br><br>  Future&lt;http.Response&gt; request({<br>    required String url,<br>    required Method method,<br>    Map&lt;String, String&gt;? headers,<br>    dynamic body,<br>  }) async {<br>    switch (method) {<br>      case Method.POST:<br>        return await client.post(Uri.parse(url), headers: headers, body: body);<br>      case Method.GET:<br>        return await client.get(Uri.parse(url), headers: headers);<br>      // Add other HTTP methods as needed<br>      default:<br>        throw UnsupportedError(&#39;HTTP method not supported&#39;);<br>    }<br>  }<br><br>  void dispose() {<br>    client.close(); // Only close when the app or API client disposes<br>  }<br>}</pre><p>By keeping one http.Clientalive throughout the app’s lifecycle (or the lifetime of the API client), all requests get to complete without being interrupted. This eliminates unexpected connection errors caused by prematurely closing the client.</p><h4>What About Parallel API Calls? Should We Block Them in ApiClient?</h4><p>If your app needs to <strong>prevent parallel API requests, </strong>for example, to avoid sending the same request twice when a user taps a button rapidly, this control <strong>should not be done inside the API client</strong>.</p><h4>Why? Because:</h4><ul><li>The API client’s job is to <strong>send HTTP requests</strong> and handle responses.</li><li>It should remain <strong>stateless</strong> and not care about how many times or when it’s called.</li><li>Managing request frequency or blocking duplicates is a <strong>UI/UX concern</strong>, best handled in the UI layer.</li></ul><h4><strong>Why This Separation of Concerns Matters</strong></h4><ul><li><strong>API Client:</strong> Focused on networking, sending requests, handling errors, and parsing responses.</li><li><strong>UI/State Layer:</strong> Focused on user interactions, loading states, debouncing, throttling, and preventing duplicate calls.</li></ul><p>That’s the story of how a small line of code silently broke our parallel API calls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*qlAA6iTvB47PCXtvymT54g.gif" /></figure><p>If you found this helpful, learned something new, or caught yourself making a similar mistake, drop your favorite debugging emoji:<strong> 🐞🔥🧠⚡️</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f8ff79b5832" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Your First Responsive Flutter App: A Clean Architecture Approach.]]></title>
            <link>https://medium.com/@rakibul25.dev/build-your-first-responsive-flutter-app-a-clean-architecture-approach-cf1144ebac6d?source=rss-b04cf73f2848------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf1144ebac6d</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter-responsive-design]]></category>
            <category><![CDATA[flutter-responsive]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-clean-code]]></category>
            <dc:creator><![CDATA[Rakibul Dev]]></dc:creator>
            <pubDate>Sun, 22 Jun 2025 18:18:19 GMT</pubDate>
            <atom:updated>2025-06-22T18:18:19.249Z</atom:updated>
            <content:encoded><![CDATA[<p>These days, in the app development world, responsive design isn’t just a nice-to-have or just an extra feature; it’s essential to delivering a great user experience. Your app needs to run seamlessly across different devices, from compact smartphones to larger tabs, even desktops. In this article I’ll write about how to implement your first responsive design in Flutter, the right way, using a clean folder structure that keeps your codebase organized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3WPkPYUgQgWKy1QaVdAkg.png" /></figure><p><strong>The Foundation: Clean Project Architecture</strong></p><p>A well-organized codebase is always the backbone of any scalable and maintainable project. Let&#39;s explore a clean folder structure that makes your responsive logic clear and separates responsibility.</p><p>My suggestion is to structure your folders like this:</p><pre>lib<br>├── app<br>│   └── my_app.dart               // Your root application widget<br>├── core<br>│   ├── constants<br>│   │   └── app_breakpoints.dart  // Defines screen width breakpoints<br>│   ├── enums<br>│   │   └── device_screen_type.dart // Enum for device types (mobile, tablet, desktop)<br>│   ├── extensions<br>│   │   └── box_constraints_ext.dart // Extension to determine screen type from BoxConstraints<br>│   └── responsive<br>│       └── responsive_builder.dart  // Reusable widget to build UI based on screen type<br>└── ui<br>    └── views<br>        └── home<br>            ├── home.dart          // The main responsive view for Home<br>            ├── home_desktop.dart  // Desktop-specific Home layout<br>            ├── home_mobile.dart   // Mobile-specific Home layout<br>            └── home_tablet.dart   // Tablet-specific Home layout</pre><p><strong>Step-by-step implementation:</strong></p><p>Let&#39;s describe the code for each part of this structure.</p><p><strong>1. Defining Your Breakpoints</strong> (core/constants/app_breakpoints.dart)</p><pre>class AppBreakpoints {<br>  static const double mobile = 600;<br>  static const double tablet = 950;<br>  static const double desktop = 1200;<br>}</pre><p>First, define the screen size or breakpoints for mobile, tab and desktop.</p><p><strong>2. Enumerating Device Screen Types</strong> (core/enums/device_screen_type.dart)</p><pre>enum DeviceScreenType {<br>  mobile,<br>  tablet,<br>  desktop,<br>}</pre><p>To keep things clear and easy to manage, define device types in an enum.</p><p><strong>3. The BoxConstraints Extension</strong> (core/extensions/box_constraints_ext.dart)</p><pre>extension DeviceScreenTypeExtension on BoxConstraints {<br>  DeviceScreenType get screenType {<br>    final width = maxWidth;<br>    if (width &gt;= AppBreakpoints.desktop) return DeviceScreenType.desktop;<br>    if (width &gt;= AppBreakpoints.tablet) return DeviceScreenType.tablet;<br>    return DeviceScreenType.mobile;<br>  }<br>}</pre><p>We centralize the screen type detection logic by extending BoxConstraints with a getter screenType. Which returns a DeviceScreenType(enum). This uses maxWidth, a built-in property of BoxConstraints that represents the maximum width available to the widget on the current device. Based on this width, we determine whether the screen should be treated as mobile, tablet, or desktop.</p><p><strong>4. The ResponsiveBuilder Widget</strong> (core/responsive/responsive_builder.dart)</p><pre>class ResponsiveBuilder extends StatelessWidget {<br>  final Widget Function(BuildContext, DeviceScreenType) builder;<br><br>  const ResponsiveBuilder({super.key, required this.builder});<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return LayoutBuilder(<br>      builder: (context, constraints) {<br>        final screenType = constraints.screenType;<br>        return builder(context, screenType);<br>      },<br>    );<br>  }<br>}</pre><p>The ResponsiveBuilder will simplify responsive UI building with LayoutBuilder. Using LayoutBuilder, we can easily access BoxConstraints. We extended BoxConstraints with screenType getter; we can determine the current device type with it. Since there’s no need to manage state or update any data, we keep it stateless, making it simple, efficient, and lightweight.</p><p><strong>5. Implementing Responsive Views</strong> (ui/views/home/home.dart)</p><pre>class HomeView extends StatelessWidget {<br>  const HomeView({super.key});<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return  ResponsiveBuilder(<br>      builder: (context, screenType) {<br>        switch (screenType) {<br>          case DeviceScreenType.tablet:<br>            return const HomeTablet();<br>          case DeviceScreenType.desktop:<br>            return const HomeDesktop();<br>          default:<br>            return const HomeMobile();<br>        }<br>      },<br>    );<br>  }<br>}</pre><p>Now finally, the magic time! Like here, using ResponsiveBuilder we can get the device type and render a dedicated layout for each screen type: mobile, tab, and desktop.</p><p><strong>Pro Tip: Testing with Device Preview</strong></p><p><strong>Congratulations, you did it!</strong> 🎉 Now here is another challenge. Do you need to buy all those devices to test your app? Well, if you’re earning enough, sure… just kidding! 😄</p><p><strong>You don’t need to buy anything.</strong> There are many ways to view your UI on different screen sizes, but my favorite and time-saving tool is <a href="https://pub.dev/packages/device_preview">device_preview</a> package. It simulates your app on multiple devices inside your device or emulator.</p><pre>void main() {<br>  runApp(<br>    DevicePreview(<br>      enabled: true,<br>      builder: (context) =&gt; const MyApp(),<br>    ),<br>  );<br>}</pre><p>Just wrap your app with DevicePreview, you will get many device options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fg9sMKUyTjTHJYnXB7Ca5g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H6AGLEOHRPLDaAByANFaeQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GdIVvMP03l7DPk3HrzDzeA.jpeg" /></figure><p>If you have any questions or need help, feel free to reach out. The repo is linked below. Happy coding! Start building your responsive designs today, explore with confidence, and become an expert.</p><p>Check out the full source code on <a href="https://github.com/Rakibul25/flutter_responsive_example">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf1144ebac6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Numeric Data Types in Dart: int, double, and num!]]></title>
            <link>https://medium.com/@rakibul25.dev/numeric-data-types-in-dart-int-double-and-num-d9b9e7ecd091?source=rss-b04cf73f2848------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9b9e7ecd091</guid>
            <dc:creator><![CDATA[Rakibul Dev]]></dc:creator>
            <pubDate>Sun, 16 Jun 2024 11:51:16 GMT</pubDate>
            <atom:updated>2024-06-16T11:51:16.200Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S8hUV2okVhrBboYVj9xJ4A.png" /></figure><p>Dart is a versatile language that provides robust support for different types of data. In this article, we’ll explore int, double, and num in Dart, their uses, and how to handle scenarios involving these types.</p><h4>int (Integer)</h4><p>Numeric data can be stored using either int or double. int is used to save whole numbers, it can’t save fractional or decimal values.</p><pre>int myInteger = 10;</pre><p><strong>Example</strong> of valid int values: 0, 1, -5, 100000.</p><h4>double (Double)</h4><p>Double is used to save numbers that have fractional parts or decimal values.</p><pre>double myDouble = 10.0;</pre><p><strong>Example</strong> of valid double values: 0.0, 7.67, -0.14, 1234.567.</p><h4><strong>The Numbers Game: Why You Can’t Mix int and double</strong></h4><p>Dart enforces type safety to ensure your code runs smoothly, meaning you can’t directly assign a double to an int or vice versa without explicit conversion, even though both are numeric types.</p><p>Assigning a double to an int or vice versa results error.</p><pre>int b = 10; <br>double c = 10.5;<br>c = b; // Error<br>b = c; // Error</pre><p>This strict type enforcement for assigning double to int helps prevent unexpected behaviors and ensures that your numerical calculations are precise and reliable. By understanding these rules, you can write more robust and error-free Dart code.</p><h4>Handling Mixed Types with num</h4><p>When you need to store a number that could be either an integer or a floating-point value. On that case you can use num.</p><pre>num myNumber = 10;    // Initially an int<br>myNumber = 10.5;      // Now a double</pre><p>Using num, you can store both int and double values in the same variable, which is particularly useful for functions or variables that need to handle multiple numeric types.</p><p>For a more detailed explanation and practical examples, check out the video tutorial. It provides a step-by-step guide to using these numeric types in Dart, complete with code demonstrations and additional tips.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHkvfsJL0qLw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHkvfsJL0qLw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FHkvfsJL0qLw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/061f61f570f9608dec85e18742811d4f/href">https://medium.com/media/061f61f570f9608dec85e18742811d4f/href</a></iframe><p>#dart #numeric #flutter #flutterwav #fluttercommunity</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9b9e7ecd091" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dart Null Safety: Non-Nullable vs. Nullable Variables Explained!]]></title>
            <link>https://medium.com/@rakibul25.dev/dart-null-safety-non-nullable-vs-nullable-variables-explained-f90f31b97348?source=rss-b04cf73f2848------2</link>
            <guid isPermaLink="false">https://medium.com/p/f90f31b97348</guid>
            <category><![CDATA[null-safety]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[multi-platform-app]]></category>
            <dc:creator><![CDATA[Rakibul Dev]]></dc:creator>
            <pubDate>Mon, 03 Jun 2024 18:53:59 GMT</pubDate>
            <atom:updated>2024-06-04T01:43:41.948Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>T</strong>his article will explain what null safety is in Dart, why it’s important, and how to utilize it efficiently in Dart. Along with learning the fundamentals of the null assertion operator (!) and null-aware operator (??), we’ll also discuss the distinction between nullable and non-nullable types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X_f5Lq0EHZqkk2KH1lUQMA.jpeg" /></figure><p><strong>In Dart</strong>, variables are non-nullable by default. If you declare a variable and try to use it without initializing, it will give a compile-time error.</p><pre>void main() {<br>  int a; // non-nullable<br>  print(a); // This will cause a compile-time error<br>}</pre><p>Even you can’t assign a null to it.</p><pre>void main() {<br>  int a;<br>  a = null; // This will cause a compile-time error<br>}</pre><p><strong>How can you make a variable nullable?</strong> Simply add the nullable sign ‘?’ just after the variable type.</p><pre>void main() {<br>  int? a;<br>  a = null; // This is allowed<br>  print(a); // This will print null<br>  a = 5;<br>  print(a); // This will print 5<br>}</pre><p>If you make a variable nullable, it means you are telling the compiler that this variable can be null. Then it can hold null or other values, based on type.</p><p><strong>If you assign a nullable variable</strong> to a non-nullable variable, it will give a compile-time error.</p><pre>void main() {<br>  int? a; // nullable<br>  int b; // non-nullable<br>  b = a; // This will cause compile-time error<br>}</pre><p>You can solve this in two ways:</p><ol><li><strong>Use the (!) null assertion operator.</strong></li></ol><pre>void main() {<br>  int? a; // nullable<br>  int b; // non-nullable<br>  b = a!; // This is allowed<br>}</pre><p>What does it mean? It means you are telling the compiler that you are sure that this variable will never be null. There will be no compile-time error. However, you have used the null check operator on a null value, so if it’s null at runtime, there will be an error.</p><ol><li><strong>Use the (??) null-aware operator.</strong></li></ol><pre>void main() {<br>  int? a; // nullable<br>  int b; // non-nullable<br>  b = a ?? 0; <br>  print(b); // This will print 0<br>}</pre><p>What does it mean? It means if the ‘a’ variable is null, then this will set an alternative value of 0 (the right side value). And if it’s not null, it will assign that—in this case, 5.</p><pre>void main() {<br>  int? a; // nullable<br>  int b; // non-nullable<br>  a = 5;<br>  b = a ?? 0;<br>  print(b); // This will print 5<br>}</pre><p>In Dart, null safety is a powerful feature. By understanding it, you can avoid common error cases for null values in your applications. You can also check out the video below if you are comfortable with that.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FcSyboUDOfFg%3Fstart%3D11%26feature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DcSyboUDOfFg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FcSyboUDOfFg%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/18ba1afeb03f55aca41fe932cb0919ba/href">https://medium.com/media/18ba1afeb03f55aca41fe932cb0919ba/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f90f31b97348" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>