<?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 Md. Al-Amin on Medium]]></title>
        <description><![CDATA[Stories by Md. Al-Amin on Medium]]></description>
        <link>https://medium.com/@alaminkarno?source=rss-3a122e149eeb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZJwvj6PTPFJriIq9MKnnCA.png</url>
            <title>Stories by Md. Al-Amin on Medium</title>
            <link>https://medium.com/@alaminkarno?source=rss-3a122e149eeb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 12:31:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alaminkarno/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[Flutter Promised “Write Once, Run Anywhere.” My Plugin Didn’t, Until Now.]]></title>
            <link>https://alaminkarno.medium.com/flutter-promised-write-once-run-anywhere-my-plugin-didnt-until-now-b18ebf709f87?source=rss-3a122e149eeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/b18ebf709f87</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[multiplatform]]></category>
            <category><![CDATA[crispchat]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[plugins]]></category>
            <dc:creator><![CDATA[Md. Al-Amin]]></dc:creator>
            <pubDate>Sun, 31 May 2026 20:13:26 GMT</pubDate>
            <atom:updated>2026-05-31T20:13:26.569Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ANTPYgFLT07_g97bwLpoGg.png" /><figcaption>Flutter Crisp Chat — Support All Platform</figcaption></figure><p>When I started building flutter-crisp-chat, I had one clear goal.</p><p>Bring <a href="https://crisp.chat/">Crisp</a> live chat into Flutter apps the way mobile developers expect it native UI on Android and iOS, one package, one API, no painful platform channels for every small thing.</p><p>And for a long time, that worked.</p><p>Apps shipped. Issues came in. PRs got merged. Releases went to pub.dev.</p><p>But every time someone ran:</p><pre>flutter devices</pre><p>and saw more than just iPhone and Android, a quiet question followed:</p><blockquote>“Does this work on Web?”<br>“What about macOS?”<br>“We’re Flutter everywhere — except support chat.”</blockquote><p>That question sat in the back of my mind longer than I want to admit.</p><p>Because Flutter’s whole pitch is not “write twice, hope for the best.”</p><p>It is write once, run anywhere.</p><p>My plugin was honest on two platforms.</p><p>Not on six.</p><p>Until <strong>crisp_chat 2.5.0</strong></p><h3>The Moment I Couldn’t Hand-Wave Anymore</h3><p>It started like most real open-source work.</p><p>Not with a roadmap.</p><p>With an issue.</p><p>Someone opened <a href="https://github.com/alamin-karno/flutter-crisp-chat/issues/81">#81</a> and asked something simple:</p><p><em>Can we support Mac, Windows, and Linux?</em></p><p>On the surface, it sounds like a feature request.</p><p>Underneath, it was bigger.</p><p>They were not asking for a experiment branch.</p><p>They were saying:</p><p>“We already chose Flutter so we do not maintain separate apps. Why is chat the one feature that breaks that rule?”</p><p>And they were right.</p><p>If your product is a Flutter app on phone and a Flutter app on desktop and maybe a Flutter web dashboard, you do not want three different Crisp integrations in your head.</p><p>You want one.</p><p>That issue was the line in the sand for me.</p><p>Either crisp_chat grows up with Flutter, or it stays a mobile plugin forever.</p><p>I chose the first.</p><h3>What “All Platforms” Actually Meant</h3><p>Before writing code, I had to be honest about what Crisp offers.</p><p>On <strong>Android</strong> and <strong>iOS</strong>, Crisp ships <strong>native SDKs</strong> — real chat UI, the mobile experience people know.</p><p>On <strong>Web</strong> and <strong>desktop</strong>, there is no parallel “Crisp desktop SDK” in the same shape.</p><p>Crisp’s answer there is the <strong>Web Chat SDK </strong>— load client.crisp.chat, configure the widget, open the chatbox.</p><p>So “all platforms” did not mean “copy-paste the Android folder six times.”</p><p>It meant:</p><ul><li><strong>Mobile</strong> → native SDKs (unchanged strength)</li><li><strong>Web + desktop</strong> → same web client, hosted the Flutter way</li></ul><p>One Dart API on top.</p><p>FlutterCrispChat.openCrispChat(config: …) should mean something on every target.</p><p>That was the bar.</p><h3>Web — The First Time the Plugin Felt “Flutter”</h3><p>Web was the unlock.</p><p>Flutter already has a path for federated plugins.</p><p>No giant method channel on Chrome.</p><p>Instead: Dart talks to JavaScript, JavaScript talks to Crisp.</p><p>The Crisp script loads from <a href="https://client.crisp.chat/l.js.">https://client.crisp.chat/l.js.</a></p><p>Your CrispConfig — website ID, user email, segments — still maps to the same ideas you use on mobile.</p><p>From the app’s point of view, it still feels like:</p><pre>await FlutterCrispChat.openCrispChat(config: config);</pre><p>That mattered more than any internal file name.</p><p>Because the worst multi-platform story is not “hard to implement.”</p><p>It is “hard to explain.”</p><p>If Web needs a completely different package, Flutter’s promise is already broken before you ship.</p><h3>Desktop — Where “Run Anywhere” Meets Real Machines</h3><p>Desktop was the part that made 2.5.0 feel real.</p><p><strong>macOS. Windows. Linux</strong>.</p><p>For each, the plugin opens a window with the same Crisp web experience inside — using <a href="https://pub.dev/packages/desktop_webview_window">desktop_webview_window</a>.</p><p>If the system WebView is missing or broken, it falls back to the browser.</p><p>Not the prettiest path.</p><p>But a honest one.</p><p>Desktop taught me things mobile never did:</p><ul><li>macOS sandbox without network entitlement → blank WebView, no error drama, just white screen</li><li>WKWebView refusing external scripts on data: URLs → embed HTML from file:// instead</li><li>“Works on my Mac” is not a release strategy → the <strong>example app</strong> got linux, macos, and windows runners so I could actually run what I ship</li></ul><p>None of that is in the tagline “write once, run anywhere.”</p><p>But it is in the work of making it true.</p><h3>One API, Six Targets</h3><p>This is what 2.5.0 means in practice:</p><p>Android — Native Crisp Android SDK</p><p>iOS — Native Crisp iOS SDK</p><p>Web — Crisp Web Chat SDK</p><p>macOS — Web SDK in a desktop WebView</p><p>Windows — Web SDK in a desktop WebView</p><p>Linux — Web SDK in a desktop WebView</p><p>Six targets.</p><p>One package:</p><pre>dependencies:<br>  crisp_chat: ^2.5.0</pre><p>Same import.</p><p>Same CrispConfig.</p><p>Same “open chat” moment in your app — whether your user is on a phone, a browser tab, or a desktop window.</p><p>That is what I wanted when I said yes to issue #81.</p><p>Not a checkbox.</p><p>A <strong>Flutter-shaped</strong> integration.</p><h3>The Trade-Off I Won’t Hide</h3><p>Going everywhere has a cost.</p><p><strong>Flutter 3.24+</strong> and <strong>Dart 3.5+</strong> for Web and desktop (desktop WebView dependency).</p><p>New packages: desktop_webview_window, http, url_launcher, web.</p><p>Push notification helpers are <strong>mobile</strong> — on Web and desktop they are no-ops, because that is the truth, not a missing TODO.</p><p>If you are mobile-only on an older SDK, <strong>2.4.8</strong> is still there.</p><p>I would rather say that in a blog post than in a GitHub issue six months later.</p><h3>What Changed for Me as a Maintainer</h3><p>Before 2.5.0, I described crisp_chat as a <strong>mobile Crisp plugin</strong>.</p><p>After 2.5.0, I describe it as a <strong>Flutter Crisp plugin</strong>.</p><p>Small words.</p><p>Big shift.</p><p>The example app is not just “the Android demo” anymore.</p><p>You can run:</p><pre>flutter run -d chrome - dart-define=websiteId=YOUR_WEBSITE_ID</pre><pre>flutter run -d macos - dart-define=websiteId=YOUR_WEBSITE_ID</pre><p>CI runs analyze and tests on every push.</p><p>The docs have a <a href="https://alamin-karno.github.io/flutter-crisp-chat/getting_started/supported_platforms.html">supported platforms</a> page that reads like a contract, not a wish list.</p><p>That is what “until now” means in the title.</p><p>Not perfection on day one.</p><p><strong>Parity with Flutter’s platform list</strong> — finally.</p><h3>What I’d Tell Past Me</h3><p>If you maintain a Flutter plugin today:</p><ol><li><strong>Listen for “what about X?”</strong> — that is often your real roadmap.</li><li><strong>Do not fake native on Web</strong> — use the platform’s real client (for Crisp, that is the web SDK).</li><li><strong>Ship an example that runs where you claim support</strong> — folders are documentation.</li><li><strong>Keep one Dart surface</strong> — multi-platform dies the moment you need if (kIsWeb) use_other_package.</li></ol><p>Flutter promised write once, run anywhere.</p><p>Plugins either help that promise, or quietly break it.</p><p>For a long time, mine broke it.</p><p><strong>2.5.0 is my attempt to keep the promise.</strong></p><h3>Try It</h3><p><strong>pub.dev</strong>: <a href="https://pub.dev/packages/crisp_chat">https://pub.dev/packages/crisp_chat</a></p><p><strong>Platform guide</strong>: <a href="https://alamin-karno.github.io/flutter-crisp-chat/getting_started/supported_platforms.html">https://alamin-karno.github.io/flutter-crisp-chat/getting_started/supported_platforms.html</a></p><pre>dependencies:<br>  crisp_chat: ^2.5.0</pre><p><strong>Open an issue</strong> if a platform still feels left out.</p><p>The best plugins are not finished.</p><p>They just stop pretending the world is only two app stores.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b18ebf709f87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swift Package Manager and Flutter iOS Plugins: The crisp_chat 2.4.8 Fix Story]]></title>
            <link>https://alaminkarno.medium.com/swift-package-manager-and-flutter-ios-plugins-the-crisp-chat-2-4-8-fix-story-490316b3089c?source=rss-3a122e149eeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/490316b3089c</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[flutter-plugin]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[swift-package-manager]]></category>
            <dc:creator><![CDATA[Md. Al-Amin]]></dc:creator>
            <pubDate>Sun, 24 May 2026 20:42:32 GMT</pubDate>
            <atom:updated>2026-05-24T20:42:32.508Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FYp66Xb13lkpv2BIKce6cg.png" /><figcaption>Crisp Chat v2.4.8</figcaption></figure><p>Flutter 3.44 introduced a major shift for iOS and macOS development:</p><blockquote><em>Swift Package Manager (SPM) is now the default dependency system.</em></blockquote><p>For Flutter app developers, that sounds great.<br>Less CocoaPods pain.<br>Cleaner onboarding.<br>Native Xcode integration.</p><p>But for Flutter plugin maintainers, this change exposed a completely new class of problems.</p><p>Recently, while working on crisp_chat, I learned that supporting Swift Package Manager properly is much more than simply adding a Package.swift file.</p><p>What started as a “small compatibility update” became a deep dive into:</p><ul><li>SwiftPM package rules</li><li>Flutter tooling internals</li><li>Package product naming</li><li>Objective-C interoperability</li><li>Xcode dependency resolution</li><li>Flutter-generated SPM registrants</li></ul><p>And interestingly, the entire debugging journey started because of a GitHub issue and PR from a community contributor.</p><h3>The Issue That Started Everything</h3><p>After releasing SPM support in crisp_chat 2.4.7, I received a report from GitHub contributor:</p><ul><li>GitHub: coolswood</li><li>LinkedIn: <a href="https://www.linkedin.com/in/daniel-sugonyaev/?utm_source=chatgpt.com">Daniel Sugonyaev</a></li></ul><p>He opened this PR:</p><ul><li><a href="https://github.com/alamin-karno/flutter-crisp-chat/pull/143?utm_source=chatgpt.com">Fix iOS Swift Package Manager support — PR #143</a></li></ul><p>The issue looked simple at first:</p><pre>xcodebuild: error: Could not resolve package dependencies:<br>target &#39;crisp_chat&#39; in package &#39;crisp_chat&#39; is outside the package root</pre><p>Initially, I assumed it was probably a small path issue or an Xcode cache problem.</p><p>It wasn’t.</p><p>The deeper I investigated, the more I realized Flutter’s SPM integration has several hidden expectations that are easy to miss if you come from years of CocoaPods-based plugin development.</p><p>Daniel’s report was the trigger that made me fully rethink the plugin structure and eventually redesign the iOS package layout properly.</p><h3>What Flutter 3.44 Changed</h3><p>Historically, Flutter iOS plugins relied almost entirely on CocoaPods.</p><p>Typical plugin structure:</p><pre>ios/<br>  Classes/<br>  my_plugin.podspec</pre><p>Everything revolved around:</p><pre>pod install</pre><p>But Flutter 3.44 changed the default workflow.</p><p>Now Flutter generates Swift Package dependencies automatically when SPM is enabled.</p><p>That means Flutter plugins now need to work in two ecosystems:</p><ol><li>Swift Package Manager — Default</li><li>CocoaPods — Fallback compatibility</li></ol><p>This matters because many native iOS SDKs — including Crisp’s own SDK — are moving toward SPM-first distribution.</p><h3>The Original Setup That Looked Correct</h3><p>The original SPM integration in crisp_chat 2.4.7 looked reasonable:</p><pre>ios/<br>  Classes/<br>  crisp_chat/<br>    Package.swift</pre><p>And the package target reused existing CocoaPods sources:</p><pre>.target(<br>    name: &quot;crisp_chat&quot;,<br>    path: &quot;../Classes&quot;<br>)</pre><p>From a CocoaPods mindset, this felt efficient:</p><ul><li>Reuse existing files</li><li>No duplication</li><li>Minimal migration effort</li></ul><p>But Swift Package Manager has a strict rule:</p><blockquote><em>Target sources cannot live outside the package root.</em></blockquote><p>And that single detail broke the entire integration.</p><h3>The Real Root Cause</h3><p>Flutter generates the plugin dependency using this package root:</p><pre>ios/crisp_chat</pre><p>But the target sources were located here:</p><pre>ios/Classes</pre><p>Which is outside the package root.</p><p>SwiftPM immediately rejects this during dependency resolution.</p><p>That’s why Xcode failed before even building the app.</p><p>The fix required restructuring the package properly:</p><pre>ios/crisp_chat/<br>  Package.swift<br>  Sources/<br>    crisp_chat/<br>      FlutterCrispChatPlugin.swift<br>      CrispConfig.swift</pre><p>And updating the target:</p><pre>.target(<br>    name: &quot;crisp_chat&quot;,<br>    path: &quot;Sources/crisp_chat&quot;<br>)</pre><h3>Then More Problems Appeared</h3><p>After moving the sources into the package root, two more hidden issues surfaced immediately.</p><h3>1. SwiftPM Rejected Mixed Swift + Objective-C Targets</h3><p>The plugin originally used:</p><pre>FlutterCrispChatPlugin.h<br>FlutterCrispChatPlugin.m<br>SwiftFlutterCrispChatPlugin.swift</pre><p>This is a very common CocoaPods-era Flutter plugin structure.</p><p>But SwiftPM is stricter about mixed-language targets in this setup.</p><p>The solution became:</p><ul><li>Make the SwiftPM target Swift-only</li><li>Expose FlutterCrispChatPlugin directly from Swift</li><li>Match Flutter’s pluginClass</li></ul><pre>pluginClass: FlutterCrispChatPlugin</pre><p>That alignment is important because Flutter’s generated Swift package registrant searches for that exact class.</p><h3>The Most Subtle Bug: crisp_chat vs crisp-chat</h3><p>This was probably the most interesting part of the entire debugging process.</p><p>The package originally exported:</p><pre>.library(<br>    name: &quot;crisp_chat&quot;,<br>    targets: [&quot;crisp_chat&quot;]<br>)</pre><p>But Flutter internally transforms plugin names like this:</p><pre>replaceAll(&#39;_&#39;, &#39;-&#39;)</pre><p>Meaning Flutter actually expected:</p><pre>crisp-chat</pre><p>— not —</p><pre>crisp_chat</pre><p>The fix:</p><pre>products: [<br>    .library(<br>        name: &quot;crisp-chat&quot;,<br>        targets: [&quot;crisp_chat&quot;]<br>    )<br>]</pre><p>This small naming mismatch alone prevents proper package resolution.</p><h3>Rethinking the Plugin Architecture</h3><p>At that point, I realized this was no longer just a “bug fix.”</p><p>The plugin structure itself needed rethinking.</p><p>The final 2.4.8 release focused on creating a proper dual-system architecture where:</p><ul><li>SwiftPM works correctly</li><li>CocoaPods still works</li><li>Flutter tooling expectations are respected</li><li>Existing users don’t break</li></ul><p>The final implementation included:</p><h3>SwiftPM Sources</h3><pre>ios/crisp_chat/Sources/crisp_chat</pre><h3>Correct Package.swift</h3><ul><li>Product name: crisp-chat</li><li>Target path: Sources/crisp_chat</li></ul><h3>Swift-only SPM Target</h3><p>FlutterCrispChatPlugin is now exposed directly from Swift.</p><h3>CocoaPods Compatibility</h3><p>Existing CocoaPods sources in:</p><pre>ios/Classes</pre><p>were preserved so existing podspec behavior remained stable.</p><h3>UIKit Import Fix</h3><p>Added proper UIKit imports where UIModalPresentationStyle is used.</p><h3>One Important Lesson</h3><p>One thing this experience reminded me:</p><blockquote><em>CocoaPods flexibility can hide architectural problems that SwiftPM immediately exposes.</em></blockquote><p>CocoaPods allows very loose source organization.</p><p>SwiftPM forces structure discipline.</p><p>That discipline is frustrating at first — but honestly, it also results in cleaner package architecture once everything is organized correctly.</p><h3>What crisp_chat 2.4.8 Finally Solved</h3><p>The release ultimately fixed:</p><ul><li>Swift Package Manager resolution failures</li><li>Invalid package root structure</li><li>Mixed Swift/Objective-C target issues</li><li>Incorrect SPM product naming</li><li>Flutter-generated package compatibility</li><li>UIKit import issues</li><li>Better plugin registration alignment</li><li>Stable CocoaPods fallback support</li></ul><p>And most importantly:</p><p>Flutter apps using SPM can now successfully resolve and build the plugin.</p><h3>Credit Where It’s Due</h3><p>A huge thanks to:</p><ul><li>GitHub contributor coolswood</li><li><a href="https://www.linkedin.com/in/daniel-sugonyaev/?utm_source=chatgpt.com">Daniel Sugonyaev on LinkedIn</a></li></ul><p>for identifying the package root issue and opening the original PR/report that started the investigation.</p><p>Community contributions like this genuinely help open-source projects evolve in the right direction.</p><h3>Final Thoughts</h3><p>Swift Package Manager support for Flutter plugins is still new territory for many plugin maintainers.</p><p>And the migration is definitely not:</p><blockquote><em>“Just add Package.swift.”</em></blockquote><p>It affects:</p><ul><li>Source structure</li><li>Package naming</li><li>Plugin registration</li><li>Language interoperability</li><li>Flutter-generated tooling behavior</li><li>Xcode package resolution</li></ul><p>The biggest lessons from this migration:</p><ul><li>Keep SwiftPM sources inside the package root</li><li>Use hyphenated product names</li><li>Prefer Swift-only SPM targets</li><li>Align pluginClass correctly</li><li>Preserve CocoaPods compatibility during transition</li><li>Test both SPM and CocoaPods flows separately</li></ul><p>Flutter’s iOS ecosystem is clearly moving toward SPM-first development.</p><p>Getting ahead of that transition now will save plugin maintainers a lot of painful debugging later.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=490316b3089c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Went to Flutter Guild Day 2026 for Flutter, But Came Back With Something More]]></title>
            <link>https://alaminkarno.medium.com/i-went-to-flutter-guild-day-2026-for-flutter-but-came-back-with-something-more-e3df09626522?source=rss-3a122e149eeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3df09626522</guid>
            <category><![CDATA[flutterguildbd]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[bangladesh]]></category>
            <category><![CDATA[community]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Md. Al-Amin]]></dc:creator>
            <pubDate>Sat, 09 May 2026 17:33:00 GMT</pubDate>
            <atom:updated>2026-05-09T17:33:00.093Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XhY5937vhhezduoVIKsTsQ.png" /><figcaption>Flutter Guild Day 2026</figcaption></figure><p>Today I joined <strong>Flutter Guild Day 2026</strong>, and I spent almost my full day there, from <strong>9 AM to 5 PM</strong>. When I first planned to attend the event, I thought it would be mainly about Flutter. I expected some technical sessions, some useful talks, and maybe a few good conversations with other developers.</p><p>But after spending the whole day there, I felt something different.</p><p>It was not just a Flutter event for me. It became a day full of community, learning, real stories, and motivation. I went there to learn from seniors and understand more about Flutter, but I came back thinking about my own journey as a developer.</p><p>Sometimes a tech event gives you knowledge. Sometimes it gives you motivation. And sometimes it gives you a reminder that you really needed. For me, Flutter Guild Day 2026 became that kind of day.</p><h3>The Community Feeling Was the Best Part</h3><p>The thing I enjoyed the most was the community. Being around people who are also learning, building, failing, trying again, and growing gives a different kind of energy.</p><p>As developers, we spend a lot of time alone with our laptop, code editor, bugs, and deadlines. Sometimes we feel like we are the only one struggling. But when we sit in a room full of developers, listen to their questions, hear their experiences, and see their excitement, it feels different.</p><p>It reminds us that we are not alone in this journey.</p><p>Some people were already senior. Some were still growing. Some were maybe just starting. But everyone had one common thing: they were there to learn.</p><p>That community feeling made the whole event special for me. I got to connect with seniors, listen to their thoughts, and understand how they see problems. This kind of learning is different from watching tutorials. Tutorials teach us how to do something, but real people teach us how they think, how they made mistakes, and how they grew from those mistakes.</p><p>That is something I really value.</p><h3>The Sessions Were Useful and Practical</h3><p>The event had some really good sessions throughout the day. Each session touched a different side of modern software development.</p><p>One session was about <strong>Flutter DevTools</strong> and performance. It covered things like Timeline, CPU Profiler, and Memory views. This session reminded me that building a Flutter app is not only about making the UI look good. A good app should also feel smooth, fast, and reliable. If we do not understand what is happening under the hood, it becomes hard to improve the real experience of users.</p><p>Another session was about <strong>Agentic AI</strong> and the modern development skillset. AI is now becoming a part of how developers work every day. It is changing how we write code, solve problems, debug, and even think about software. This session felt very timely because every developer now needs to understand how to work with AI instead of ignoring it.</p><p>There was also a session about <strong>offline sync</strong>, which I found very practical. In real life, users do not always have a stable internet connection. Sometimes the network fails exactly when something important is happening. So designing proper sync, retry, ordering, and failure experience is not just a technical topic. It is about building trust with users.</p><p>Another session was about <strong>building and deploying Dart backends using containers</strong>. As Flutter developers, we usually think about Dart mostly for mobile apps, but this session showed another side of Dart. It was interesting to see how Dart can be used for backend development and deployment.</p><p>There was also an <strong>Antigravity showcasing</strong> and a <strong>quiz session</strong>, which made the event more fun and interactive.</p><p>All the sessions were useful, but still, the part that stayed with me the most was the panel discussion.</p><h3>The Panel Discussion Hit Differently</h3><p>The panel discussion started with topics around the current job market and the future of software engineering in the age of AI. These are questions many of us think about now.</p><p>What will happen to developers because of AI? Is problem solving still important when AI can write code? How should we train ourselves in this new era? What skills should we focus on for the future?</p><p>These questions are very real, especially for developers who are still growing in their careers. Sometimes when we see AI tools doing so many things, we start asking ourselves if our learning is still enough or if the path has changed completely.</p><p>From the discussion, one thing became clear to me: <strong>AI will change the way we work, but it does not remove the need to think.</strong></p><p>AI can help us write code faster. It can explain things. It can suggest solutions. But we still need to understand the problem. We still need to know what to ask. We still need to judge if the answer is right or wrong. We still need to make decisions.</p><p>So yes, problem solving still matters. Maybe it matters even more now.</p><p>Because in the age of AI, developers who only copy and paste may struggle. But developers who can think clearly, understand fundamentals, ask better questions, and use AI as a tool will grow faster.</p><p>That part was a strong reminder for me.</p><h3>Learning in the AI Era</h3><p>One thing I kept thinking about during the panel was how we should train ourselves now.</p><p>AI can make learning easier, but it can also make us lazy if we are not careful. It is very easy to ask AI for a solution and use it without understanding. Maybe the task will be done, but we may not actually grow from it.</p><p>That is why balance is important.</p><p>We should use AI, but we should not stop thinking. We should take help from tools, but we should not skip the learning part. We should read the code, understand the reason behind it, question the solution, and try to improve it.</p><p>Finishing a task and becoming better are not always the same thing.</p><p>Sometimes we need to struggle with a problem. Sometimes we need to debug for hours. Sometimes we need to read documentation and feel confused. These things are not always comfortable, but they teach us.</p><p>AI can help us, but our growth still depends on how honestly we learn.</p><h3>Then the Discussion Became Personal</h3><p>After the discussion about job market, AI, problem solving, and learning, the panel slowly became more personal.</p><p>And honestly, this was my favorite part of the whole event.</p><p>The speakers started sharing their own life stories. They talked about mistakes they made, failures they faced, and how they learned from those moments. At that point, the discussion felt very real.</p><p>Before that, they were senior engineers sitting on a stage. People with experience, confidence, and strong careers. But when they started sharing their failure stories, they felt more human.</p><p>They also had confusion.</p><p>They also made mistakes.</p><p>They also failed.</p><p>They also had moments where things were not easy.</p><p>But they kept learning.</p><p>That part gave me goosebumps.</p><p>Because most of the time, we only see the final version of people. We see their job title, their confidence, their LinkedIn profile, or their ability to speak on stage. But we do not see the years behind that. We do not see the pressure, wrong decisions, failed attempts, and silent struggles.</p><p>Listening to those stories reminded me that every senior developer was once a beginner too.</p><p>No one becomes good in one day.</p><h3>We See Success, But Not the Full Journey</h3><p>As developers, we often compare ourselves with others. We feel like someone is ahead of us. Someone knows more. Someone has a better job. Someone is growing faster. Someone is already doing things we are still trying to understand.</p><p>But the truth is, we usually compare our current chapter with someone else’s later chapter.</p><p>We do not know their full story.</p><p>Today, hearing those personal stories from seniors made me think differently. Everyone has their own timeline. Some people grow fast. Some people take more time. Some people learn from projects. Some people learn from failure. Some people get support from mentors. Some people figure things out alone.</p><p>The path is different for everyone.</p><p>What matters is not having a perfect journey. What matters is continuing the journey.</p><p>Failure is not always the end. Sometimes it is part of learning. Mistakes are painful, but they can teach us something that success cannot.</p><p>That was one of the biggest lessons I took from the day.</p><h3>What I Took Home From Flutter Guild Day 2026</h3><p>By the end of the event, I realized I learned both technical and personal lessons.</p><p>I learned that performance matters. A Flutter app should not only work; it should feel good to use.</p><p>I learned that AI is changing development, and we need to prepare ourselves for that change.</p><p>I learned that offline sync is not only about data, it is also about user trust.</p><p>I learned that Dart has more possibilities beyond mobile apps.</p><p>But more than all of that, I learned that growth takes time.</p><p>Everyone makes mistakes. Everyone fails at some point. Everyone feels confused sometimes. But the people who grow are the people who keep learning after those moments.</p><p>That thought stayed with me.</p><h3>Final Thoughts</h3><p>Flutter Guild Day 2026 was not just a tech event for me. It was a reminder.</p><p>A reminder that community matters. A reminder that learning never stops. A reminder that failure is part of the journey. A reminder that AI may change our tools, but it should not stop us from building our thinking ability.</p><p>I went there to learn more about Flutter, and yes, I did learn about Flutter. But I also came back with something deeper.</p><p>I came back with motivation to keep learning, keep building, keep asking questions, and keep improving.</p><p>The technical sessions were valuable, but the real stories from the panel stayed with me the most. Because perfect stories are nice, but real stories are powerful.</p><p>Flutter brought me to the event.</p><p>But the community, the people, and the stories made the day special.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3df09626522" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From a Simple Flutter Task to My First Open Source Sponsorship: Crisp Chat Journey]]></title>
            <link>https://alaminkarno.medium.com/from-a-simple-flutter-task-to-my-first-open-source-sponsorship-my-crisp-chat-journey-f2c6049e4e36?source=rss-3a122e149eeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2c6049e4e36</guid>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Md. Al-Amin]]></dc:creator>
            <pubDate>Wed, 29 Apr 2026 18:13:39 GMT</pubDate>
            <atom:updated>2026-04-29T18:21:15.869Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="From a Simple Flutter Task to My First Open Source Sponsorship" src="https://cdn-images-1.medium.com/max/1024/1*lQPebmCYofiVMwxpdial-Q.png" /></figure><p>Sometimes, the smallest tasks change your life.</p><p>Not instantly.<br>Not dramatically.</p><p>But slowly… step by step.</p><p>Today, I received my <strong>first sponsorship from Crisp</strong> for my open source project — <em>Flutter Crisp Chat</em>.</p><p>And honestly, it feels unreal.</p><p>Because a few years ago, I was just a junior Flutter developer trying to solve a problem.</p><p>This is that story.</p><h3>It Started With a Task (2022)</h3><p>Back in 2022, while working at <strong>Rokomari</strong>, I was given a task:</p><blockquote><em>“Add a customer support chat system to the app.”</em></blockquote><p>The tool was <strong>Crisp Chat</strong>.</p><p>At that time, I had around <strong>6–7 months of Flutter experience</strong>. I was still learning, still figuring things out.</p><p>So I did what every developer does:</p><ul><li>Looked for documentation</li><li>Searched for a Flutter SDK</li><li>Checked Pub.dev</li></ul><p>And then I realized…</p><p>There was <strong>no official Flutter plugin</strong>.</p><p>Crisp only provided <strong>native SDKs for Android and iOS</strong>.</p><h3>The First Problem</h3><p>I did find one package on Pub.dev.</p><p>But it was based on <strong>WebView</strong>, loading Crisp’s web version.</p><p>And it had issues:</p><ul><li>Not responsive</li><li>Sometimes didn’t load</li><li>Unstable for production</li></ul><p>I couldn’t use it confidently.</p><p>So I had two options:</p><ol><li>Use a broken solution</li><li>Or build my own</li></ol><p>I chose to build.</p><h3>Discovering Method Channels</h3><p>That’s when I learned something new:</p><p><strong>Flutter Method Channels</strong></p><p>For the first time, I understood how Flutter talks to native code:</p><ul><li>Flutter ↔ Android (Kotlin/Java)</li><li>Flutter ↔ iOS (Swift/Objective-C)</li></ul><p>It wasn’t easy.</p><p>I struggled.<br>I failed.<br>I retried.</p><p>But eventually…</p><p>I made Crisp Chat work natively in Flutter.</p><h3>The Idea That Changed Everything</h3><p>After some time, Crisp released updates in their native SDK.</p><p>That meant:</p><ul><li>I had to manually update native code</li><li>Reconfigure everything</li><li>Test again</li></ul><p>Then I thought:</p><blockquote><em>“If I’m facing this problem… others probably are too.”</em></blockquote><p>And that’s when the idea came:</p><p><em>What if I build a Flutter plugin and share it?</em></p><h3>I Didn’t Know How to Build a Plugin</h3><p>At that time, I knew what a plugin was.</p><p>But I had <strong>no idea how to create one</strong>.</p><p>So I started learning:</p><ul><li>YouTube tutorials</li><li>Flutter documentation</li><li>Trial and error</li></ul><p>After many attempts…</p><p>I built and published my first plugin:</p><p><a href="https://pub.dev/packages/crisp_chat">https://pub.dev/packages/crisp_chat</a></p><h3>The Real Journey Began After Publishing</h3><p>Publishing was not the end.</p><p>It was the beginning.</p><p>Slowly:</p><ul><li>Developers started using it</li><li>Issues started coming in</li><li>Feature requests appeared</li><li>People from different countries reached out</li></ul><p>And something amazing happened:</p><p>I became part of a global developer community.</p><p>I wasn’t just coding anymore.</p><p>I was <strong>contributing</strong>.</p><h3>Learning Through Contribution</h3><p>I kept improving the plugin in my free time:</p><ul><li>Fixing bugs</li><li>Adding features</li><li>Helping developers</li><li>Responding to issues</li></ul><p>I also started sharing what I learned:</p><ul><li><a href="https://alaminkarno.medium.com/introducing-crisp-chat-enhance-your-flutter-apps-with-real-time-customer-support-80f0e36b3ed5">Introducing Crisp Chat in Flutter</a></li><li><a href="https://alaminkarno.medium.com/taking-back-control-how-i-fixed-crisp-fcm-notifications-in-a-flutter-plugin-d93f4264828f">Fixing FCM Notifications</a></li><li><a href="https://alaminkarno.medium.com/how-a-bug-report-led-me-to-give-flutter-developers-full-control-of-crisp-chat-modals-on-ios-da13fa0fa2db">Controlling iOS Modals</a></li></ul><p>Each problem taught me something new.</p><p>Each solution made the project better.</p><h3>When Crisp Noticed</h3><p>One day, something unexpected happened.</p><p>The <strong>Crisp team discovered my work</strong>.</p><p>They appreciated it.<br>They reached out.</p><p>And even sent me <strong>swag from France 🇫🇷</strong>.</p><p>I even shared the unboxing here: <a href="https://www.facebook.com/share/v/17ftxqnaU5/">https://www.facebook.com/share/v/17ftxqnaU5/</a></p><p>That moment was special.</p><p>Not because of the gifts.</p><p>But because someone noticed my effort.</p><h3>The Moment I Never Expected</h3><p>Recently, something even bigger happened.</p><p>I received a <strong>pull request from the CEO of Crisp</strong>.</p><p>Yes… the CEO.</p><p>He loved the project.</p><p>And then:</p><p><strong>Crisp decided to sponsor my open source work.</strong></p><h3>It’s Not Just About the Money</h3><p>Yes, getting sponsored feels amazing.</p><p>But honestly?</p><p>What matters more is:</p><ul><li>The community I built</li><li>The people I connected with</li><li>The global exposure</li><li>The learning journey</li></ul><p>I talked to developers from different countries.<br>Learned how they work.<br>Understood different cultures.</p><p>Open source changed my perspective.</p><h3>What I’m Building Next</h3><p>I want to use this support to make the project better:</p><ul><li>Improve developer experience</li><li>Create better documentation</li><li>Make integration easier</li></ul><p>I already built a documentation site:</p><p><a href="https://alamin-karno.github.io/flutter-crisp-chat/">https://alamin-karno.github.io/flutter-crisp-chat/</a></p><p>Next steps:</p><ul><li>Buy a proper domain</li><li>Improve hosting</li><li>Create better guides</li></ul><p>This sponsorship will go back into <strong>learning and improving the project</strong>.</p><h3>My Message to You</h3><p>If you are a developer:</p><ul><li>Learning</li><li>Building</li><li>Struggling</li></ul><p>Don’t stop.</p><p>Your small project today can become:</p><ul><li>A tool others use</li><li>A community</li><li>Or even your first sponsorship</li></ul><p>You don’t need to be an expert.</p><p>I wasn’t.</p><p>I just:</p><ul><li>Faced a problem</li><li>Tried to solve it</li><li>Shared it with others</li></ul><h3>Final Thoughts</h3><p>This journey started with a simple task.</p><p>Today, it’s an open source project used by developers worldwide.</p><p>And now…</p><p>It’s supported by the very company behind it.</p><p>That’s the power of:</p><p>Learning<br>Building<br>Sharing</p><h3>Explore the Project</h3><ul><li>Pub.dev: <a href="https://pub.dev/packages/crisp_chat">https://pub.dev/packages/crisp_chat</a></li><li>Docs: <a href="https://alamin-karno.github.io/flutter-crisp-chat/">https://alamin-karno.github.io/flutter-crisp-chat/</a></li></ul><p>If this story inspires even one developer to start something…</p><p>Then it was worth sharing ❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2c6049e4e36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How a Bug Report Led Me to Give Flutter Developers Full Control of Crisp Chat Modals on iOS]]></title>
            <link>https://alaminkarno.medium.com/how-a-bug-report-led-me-to-give-flutter-developers-full-control-of-crisp-chat-modals-on-ios-da13fa0fa2db?source=rss-3a122e149eeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/da13fa0fa2db</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[crispchat]]></category>
            <category><![CDATA[package]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[plugins]]></category>
            <dc:creator><![CDATA[Md. Al-Amin]]></dc:creator>
            <pubDate>Thu, 12 Mar 2026 21:27:44 GMT</pubDate>
            <atom:updated>2026-03-12T22:04:47.213Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JD6aD6abpvP4UPaqk7EKdA.png" /></figure><p>One of the things I enjoy most about maintaining open-source software is that sometimes the best improvements start with something very small.</p><p>A simple bug report.<br>A curious investigation.<br>And sometimes… a new feature idea.</p><p>This story started exactly like that.</p><h3>The Bug Report That Started Everything</h3><p>While reviewing issues for the Flutter Crisp Chat plugin, I noticed a <a href="https://github.com/alamin-karno/flutter-crisp-chat/issues/123">report</a> opened by <strong>Nikita Alexeev</strong>.</p><p>The title immediately caught my attention:</p><blockquote><strong><em>“Taps pass through chat modal to underlying UI on iOS 13+.”</em></strong></blockquote><p>That sounded strange.</p><p>A modal should block interactions with the UI behind it. So how could taps reach the Flutter app underneath?</p><p>I opened the issue and read the details carefully.</p><p>The behavior was simple but frustrating:</p><ol><li>Open the Crisp chat on an iPhone</li><li>Tap near the top area of the chat</li><li>Suddenly the Flutter UI behind it reacts</li></ol><p>Buttons could be pressed. Navigation could trigger. All while the chat was still visible.</p><p>That’s definitely not the experience anyone wants when they open a support chat.</p><p>So I started digging.</p><h3>Learning Something Interesting About iOS</h3><p>While reading the issue discussion and the explanation from <strong>Nikita Alexeev</strong>, I discovered something interesting about iOS.</p><p>Starting with <strong>iOS 13</strong>, Apple changed how modal presentations behave by default.</p><p>Before iOS 13, most modals were presented using:</p><pre>.fullScreen</pre><p>Which means the modal covers the entire screen. Nothing behind it is visible, and more importantly, nothing behind it can receive touches.</p><p>But iOS 13 introduced a new default style:</p><pre>.pageSheet</pre><p>This creates the modern sheet-style UI where the modal slides up from the bottom and leaves part of the background visible.</p><p>It looks elegant and more native to modern iOS design.</p><p>But there was a catch.</p><p>In this case, the dimmed background area was still allowing touch events to reach the Flutter UI underneath.</p><p>That explained exactly why users were accidentally triggering buttons behind the chat window.</p><p>Suddenly the bug made perfect sense.</p><h3>The Pull Request That Fixed It</h3><p>Soon after reporting the issue, <strong>Nikita Alexeev</strong> submitted a <a href="https://github.com/alamin-karno/flutter-crisp-chat/pull/124">pull request</a> with a very straightforward fix.</p><p>Instead of relying on the default modal style, he forced the chat view controller to use full screen presentation.</p><p>The change looked like this:</p><pre>let chatVC = ChatViewController()<br>chatVC.modalPresentationStyle = .fullScreen<br>viewController.present(chatVC, animated: true)</pre><p>It was a very small change, but it solved the problem completely.</p><p>By forcing .fullScreen, the chat now covered the entire screen again, which meant no touches could leak through to the Flutter UI behind it.</p><p>The issue was fixed.</p><p>But while reviewing the pull request, a new idea came to my mind.</p><h3>The Moment the Idea Appeared</h3><p>Yes, .fullScreen solved the issue.</p><p>But iOS actually supports several modal presentation styles.</p><p>For example:</p><ul><li>.fullScreen</li><li>.pageSheet</li><li>.formSheet</li><li>.overFullScreen</li><li>.overCurrentContext</li><li>.popover</li></ul><p>Different apps use different modal styles depending on their design.</p><p>Some apps prefer full screen.</p><p>Some prefer sheet-style modals.</p><p>Some prefer overlays.</p><p>So instead of hardcoding .fullScreen, I thought:</p><p><strong>What if Flutter developers could choose the modal style themselves?</strong></p><p>That way:</p><ul><li>The touch-through bug stays fixed</li><li>Developers get flexibility</li><li>The plugin becomes more powerful</li></ul><p>That’s when the idea shifted from a <strong>bug fix</strong> to a <strong>developer-focused feature</strong>.</p><h3>Turning the Idea into a Feature</h3><p>To make this possible, I needed to expose the modal presentation style all the way from Flutter to the native iOS implementation.</p><p>So I started with the Flutter configuration.</p><h3>Step 1 — Extending the Flutter Configuration</h3><p>First, I added a new enum to represent the iOS modal styles.</p><pre>enum ModalPresentationStyle {<br>  fullScreen,<br>  pageSheet,<br>  formSheet,<br>  overFullScreen,<br>  overCurrentContext,<br>  popover,<br>}</pre><p>Then I added it to the CrispConfig class.</p><pre>class CrispConfig {<br>  final String websiteID;<br>  final String? tokenId;<br>  final ModalPresentationStyle? modalPresentationStyle;<br><br>  CrispConfig({<br>    required this.websiteID,<br>    this.tokenId,<br>    this.modalPresentationStyle,<br>  });<br>}</pre><p>Now Flutter developers could specify how the chat modal should appear.</p><h3>Step 2 — Bridging the Setting to iOS</h3><p>Next, I needed to convert that Flutter value into a native iOS presentation style.</p><p>Inside the Swift plugin code, I mapped the configuration to UIModalPresentationStyle.</p><pre>switch modalPresentationStyleString {<br>case &quot;fullScreen&quot;:<br>    modalPresentationStyle = .fullScreen<br>case &quot;pageSheet&quot;:<br>    modalPresentationStyle = .pageSheet<br>case &quot;formSheet&quot;:<br>    modalPresentationStyle = .formSheet<br>case &quot;overFullScreen&quot;:<br>    modalPresentationStyle = .overFullScreen<br>case &quot;overCurrentContext&quot;:<br>    modalPresentationStyle = .overCurrentContext<br>case &quot;popover&quot;:<br>    modalPresentationStyle = .popover<br>default:<br>    modalPresentationStyle = .fullScreen<br>}</pre><p>This ensured a safe default while still allowing flexibility.</p><h3>Step 3 — Applying the Configuration</h3><p>Finally, instead of hardcoding .fullScreen, the plugin now uses the configured style.</p><pre>let chatVC = ChatViewController()<br>chatVC.modalPresentationStyle = crispConfig.modalPresentationStyle<br><br>viewController.present(chatVC, animated: true)</pre><p>Now Flutter developers have full control over the presentation style.</p><h3>Making the Feature Easy to Discover</h3><p>After implementing the improvements, I wanted to make sure developers could easily explore and understand them.</p><p>So I also improved the developer experience around the plugin.</p><p>I added an <strong>interactive demo inside the example app</strong> where developers can test different iOS modal styles.</p><p>There’s a button called <strong>“iOS Modal Style Demo”</strong> that opens the chat using different presentation styles so developers can see how each one behaves.</p><p>I also updated the documentation to clearly explain:</p><ul><li>How iOS modal presentation works</li><li>Why .fullScreen fixes the touch-through issue</li><li>How to configure the modal style in Flutter</li></ul><h3>What Developers Gain From This</h3><p>What started as a small bug report now gives Flutter developers several benefits.</p><p><strong>Better User Experience</strong></p><p>No more accidental taps on the UI behind the chat.</p><p><strong>Flexible Modal Presentation</strong></p><p>Developers can choose the modal style that fits their app design.</p><p><strong>Platform Awareness</strong></p><p>These changes only affect iOS behavior, while Android remains unchanged.</p><h3>What I Love About Open Source</h3><p>This experience reminded me why I enjoy maintaining open-source projects.</p><p>Sometimes improvements don’t start with big feature ideas.</p><p>They start with a simple issue report.</p><p>A developer noticing something strange.</p><p>A pull request proposing a fix.</p><p>And a moment of curiosity that turns a bug fix into something better.</p><p>So huge thanks to <a href="https://github.com/aspid168"><strong>Nikita Alexeev</strong></a> for reporting the issue and submitting the original fix that inspired this improvement.</p><h3>Try It Yourself</h3><p>If you’re using the <a href="https://pub.dev/packages/crisp_chat">Flutter Crisp Chat</a> plugin, you can try the new configuration like this:</p><pre>final config = CrispConfig(<br>  websiteID: &#39;YOUR_WEBSITE_ID&#39;,<br>  modalPresentationStyle: ModalPresentationStyle.pageSheet,<br>  enableNotifications: false,<br>);</pre><p>And if you’re curious to see how each modal style behaves, check out the <a href="https://github.com/alamin-karno/flutter-crisp-chat">example</a> app in the repository.</p><p>Sometimes the best features don’t start with a roadmap.</p><p>They start with a bug report…<br>and a little curiosity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da13fa0fa2db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taking Back Control: How I Fixed Crisp FCM Notifications in a Flutter Plugin]]></title>
            <link>https://alaminkarno.medium.com/taking-back-control-how-i-fixed-crisp-fcm-notifications-in-a-flutter-plugin-d93f4264828f?source=rss-3a122e149eeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/d93f4264828f</guid>
            <category><![CDATA[package]]></category>
            <category><![CDATA[push-notification]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-plugin]]></category>
            <category><![CDATA[fcm]]></category>
            <dc:creator><![CDATA[Md. Al-Amin]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 18:09:17 GMT</pubDate>
            <atom:updated>2026-02-06T18:09:17.189Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XdJWVsqPE7iZq04AsmUPSw.png" /><figcaption>Genereted by — Google Nano Banana</figcaption></figure><p>If you’ve ever integrated <strong>Crisp Chat</strong> into a Flutter app, chances are you loved how easy it was to get real-time support chat up and running.</p><p>Until push notifications entered the picture.</p><p>For several developers using the crisp_chat Flutter plugin, the experience broke down in a very specific and very frustrating way:</p><blockquote><strong><em>Tapping a Crisp push notification while the app is terminated opens the Crisp ChatActivity directly, completely bypassing the app’s main screen.</em></strong></blockquote><p>No splash screen.<br>No routing logic.<br>No chance to prepare state.</p><p>Just <em>boom</em> — straight into chat.</p><p>This wasn’t just a personal frustration. It surfaced publicly as<br><a href="https://github.com/alamin-karno/flutter-crisp-chat/issues/79"><strong>Issue #79</strong></a><br>and multiple developers asked the same question:</p><blockquote><em>“Can we open the app first… and then decide whether to open the chat?”</em></blockquote><p>At first glance, this looked like a limitation of the Crisp SDK itself. But after digging deeper, I realized something important:</p><p><strong>This wasn’t a Flutter problem.<br>This wasn’t even really a Crisp problem.<br>It was a notification ownership problem.</strong></p><h3>Understanding the Root Cause</h3><p>On Android, Crisp handles push notifications via its own FirebaseMessagingService:</p><pre>CrispNotificationClient.handleNotification(context, message, true);</pre><p>That last parameter — true — is the key.</p><p>It tells Crisp:</p><blockquote><em>“When the user taps this notification, automatically open </em><em>ChatActivity.”</em></blockquote><p>That behavior is perfectly reasonable for many apps.<br>But for others especially apps with authentication, routing, or deep navigation logic it’s too aggressive.</p><p>And here’s the real issue:</p><p><strong>Flutter never gets a chance to intervene.</strong></p><p>Once the intent launches ChatActivity, your app flow is already bypassed.</p><h3>The Design Goal</h3><p>Rather than forcing <em>one</em> behavior on everyone, I wanted something better:</p><h3>Developers should be able to choose:</h3><ul><li><strong>Crisp default behavior</strong> (auto-open chat)</li><li><strong>App-first behavior</strong> (open app → decide later)</li></ul><p>And ideally…</p><p>✔ No breaking changes<br>✔ No hacks<br>✔ No forks of the Crisp SDK<br>✔ Minimal configuration</p><h3>The Solution: Two Explicit Notification Strategies</h3><p>Instead of replacing Crisp’s behavior, I <strong>added an alternative path</strong>.</p><h3>Option A: Crisp Default (Zero Code)</h3><p>This keeps Crisp’s original behavior untouched.</p><pre>&lt;service<br>    android:name=&quot;im.crisp.client.external.notification.CrispNotificationService&quot;<br>    android:exported=&quot;false&quot;&gt;<br>    &lt;intent-filter&gt;<br>        &lt;action android:name=&quot;com.google.firebase.MESSAGING_EVENT&quot; /&gt;<br>    &lt;/intent-filter&gt;<br>&lt;/service&gt;</pre><ul><li>Notification tap → Chat opens directly</li><li>No Flutter involvement</li><li>Works exactly like before</li></ul><h3>Option B: App-First Flow (Custom Handling)</h3><p>This option hands control back to the app.</p><pre>&lt;service<br>    android:name=&quot;com.alaminkarno.flutter_crisp_chat.CrispChatNotificationService&quot;<br>    android:exported=&quot;false&quot;&gt;<br>    &lt;intent-filter&gt;<br>        &lt;action android:name=&quot;com.google.firebase.MESSAGING_EVENT&quot; /&gt;<br>    &lt;/intent-filter&gt;<br>&lt;/service&gt;</pre><p>With this single change:</p><ul><li>Notification tap opens <strong>your app</strong></li><li>Flutter decides <em>if and when</em> to open the chat</li></ul><p>No runtime flags.<br>No complex setup.<br>Just one manifest swap.</p><h3>How the Custom Flow Works (High Level)</h3><h3>1) Intercept the Notification (Android)</h3><p>I introduced a custom FirebaseMessagingService:</p><pre>if (CrispNotificationClient.isCrispNotification(message)) {<br>    CrispNotificationClient.handleNotification(this, message, false);<br>}</pre><p>That false is crucial.</p><p>It still:</p><ul><li>Displays the notification</li><li>Preserves all Crisp payload data</li></ul><p>But it <strong>does not auto-launch ChatActivity</strong>.</p><p>Now, tapping the notification simply launches MainActivity.</p><h3>2) Detect the Notification Tap</h3><p>When a notification is tapped, Android delivers a new Intent.</p><p>Inside the plugin, I listen for it:</p><pre>channel.invokeMethod(&quot;onCrispNotificationTapped&quot;, null);</pre><p>This bridges the event from <strong>native → Flutter</strong>.</p><h3>3) Let Flutter Decide</h3><p>From Dart, developers get two simple tools:</p><pre>FlutterCrispChat.setOnNotificationTappedCallback(() {<br>  FlutterCrispChat.openChatboxFromNotification();<br>});</pre><p>And for terminated state:</p><pre>FlutterCrispChat.openChatboxFromNotification();</pre><p>That’s it.</p><p>No platform checks.<br>No intent parsing.<br>No native code in the app.</p><h3>The Real Challenges (and Lessons Learned)</h3><h3>Firebase as a Compile-Time Dependency</h3><p>Because the plugin extends FirebaseMessagingService, but doesn’t own Firebase itself, builds initially failed.</p><p>The fix was subtle but important:</p><pre>compileOnly &#39;com.google.firebase:firebase-messaging:24.1.0&#39;</pre><p>This keeps the plugin lightweight and avoids version conflicts a pattern I now strongly recommend for Flutter plugins.</p><h3>MethodChannel Timing Pitfall</h3><p>Registering a method channel handler too early caused crashes in tests.</p><p>The solution?<br><strong>Lazy initialization.</strong></p><p>Only register the handler when it’s actually needed once Flutter bindings are guaranteed to exist.</p><p>A small change, but a big stability win.</p><h3>iOS Compatibility (Without Extra Burden)</h3><p>This feature is Android-only by nature.<br>But from Dart, the API remains cross-platform.</p><p>On iOS, the method simply returns false.</p><p>No crashes.<br>No Platform.isAndroid checks.<br>No special handling required by app developers.</p><h3>The End Result</h3><ul><li>Scenario <strong>→ </strong>Default Crisp <strong>→ </strong>App-First Flow</li><li>App terminated <strong>→ </strong>Opens chat directly <strong>→ </strong>Opens app first</li><li>App background <strong>→ </strong>Opens chat directly <strong>→ </strong>Flutter callback</li><li>Flutter control <strong>→ </strong>❌ None <strong>→ </strong>✅ Full</li><li>Setup cost <strong>→ </strong>Zero <strong>→ </strong>Minimal</li></ul><p>The best part?</p><p><strong>Existing users don’t have to change anything.</strong><br><strong>Advanced users finally get control.</strong></p><h3>Final Thoughts</h3><p>This wasn’t just about fixing a notification bug.</p><p>It was about:</p><ul><li>Respecting app architecture</li><li>Giving developers choice</li><li>Designing plugin APIs that scale beyond “happy paths”</li></ul><p>Sometimes, the most impactful improvements come from <strong>not forcing a solution</strong>, but making space for multiple workflows.</p><p>If you’re using crisp_chat, the feature is already available.<br>And if you’re building Flutter plugins yourself I hope this story saves you a few late nights.</p><p>📦 <strong>Package:</strong> <a href="https://pub.dev/packages/crisp_chat">crisp_chat</a><br>🐛 <strong>Fixes:</strong> <a href="https://github.com/alamin-karno/flutter-crisp-chat/issues/79">Issue #79</a></p><p>Happy coding 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d93f4264828f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hidden Magic Behind Android’s Share Button]]></title>
            <link>https://alaminkarno.medium.com/the-hidden-magic-behind-androids-share-button-05b32b37c57e?source=rss-3a122e149eeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/05b32b37c57e</guid>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[android-intents]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[programming-tips]]></category>
            <dc:creator><![CDATA[Md. Al-Amin]]></dc:creator>
            <pubDate>Tue, 27 Jan 2026 04:02:05 GMT</pubDate>
            <atom:updated>2026-01-27T04:02:05.358Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kp1W_AJqqittobw1FVy4bA.png" /><figcaption>Flow of Implicit Intent — Generated by Google Nano Banana</figcaption></figure><p>Have you ever hit the <strong>Share</strong> button in your app — maybe to send a funny meme, a link, or a photo — and seen that neat list of apps pop up?</p><p>As a mobile developer, I always thought it was just… <em>magic</em>. Call an Intent, Android shows a list, job done.</p><p>But one day, while debugging a crash on ActivityNotFoundException, I paused and asked myself:</p><p><em>“Wait… how does Android actually know which apps to show? How does it know WhatsApp, Gmail, or Drive can handle my data?”</em></p><p>That question sent me down a rabbit hole that changed how I think about app interactions forever.</p><h3>Step 1: Understanding the Intent</h3><p>I started with the basics. An <strong>Intent</strong> is like a messenger in Android. It carries a message from one part of the system — or even one app — to another.</p><p>There are <strong>two types of Intents</strong>:</p><ul><li><strong>Explicit Intents:</strong> You know exactly which component should handle your request. Example: opening your own ProfileActivity.</li><li><strong>Implicit Intents:</strong> You only describe <strong>what you want done</strong>, not who should do it. Example: sharing an image, sending an email, or opening a PDF. Android figures out the rest.</li></ul><h3>Step 2: Breaking Down the Implicit Intent</h3><p>I wrote a tiny snippet in my app:</p><pre>val shareIntent = Intent().apply {<br>    action = Intent.ACTION_SEND<br>    putExtra(Intent.EXTRA_TEXT, &quot;Check out this cool blog!&quot;)<br>    type = &quot;text/plain&quot;<br>}<br>startActivity(Intent.createChooser(shareIntent, &quot;Share via&quot;))</pre><p>At first glance, it seems simple. But internally, it’s a beautifully orchestrated dance. Here’s what I realized:</p><p>An Implicit Intent has <strong>three main parts</strong>:</p><ol><li><strong>Action:</strong> What you want to do (ACTION_SEND = send something).</li><li><strong>Category:</strong> The general type of action (CATEGORY_DEFAULT = standard).</li><li><strong>MIME Type:</strong> What type of data you’re sending (text/plain, image/jpeg, etc.).</li></ol><p>These three pieces of info act like a search query to find the right apps.</p><h3>Step 3: The Journey of an Intent</h3><p>I wanted to visualize the flow. When I tap <strong>Share</strong>, this is what happens behind the scenes:</p><ol><li><strong>The Intent hits the Activity Manager Service (AMS)</strong><br> Think of AMS as Android’s traffic controller. It decides: “Where should this message go?”</li><li><strong>AMS asks the Package Manager Service (PMS) for matches</strong><br> PMS is a database of all installed apps and their capabilities (declared via &lt;intent-filter&gt; in AndroidManifest.xml).</li><li><strong>PMS matches the Intent to apps</strong><br> It checks the action, category, and MIME type against every app’s intent filters. All matching apps go into a <strong>resolve list</strong>.</li><li><strong>AMS decides what to do next</strong></li></ol><ul><li><strong>No matches?</strong> Throws ActivityNotFoundException.</li><li><strong>One match?</strong> Launches it directly.</li><li><strong>Multiple matches?</strong> Shows a <strong>chooser dialog</strong> (the familiar share sheet).</li></ul><blockquote><em>At this moment, it hit me: the share sheet is not a UI trick. It’s AMS + PMS doing intelligent matching under the hood. Mind blown.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8m-vo96kLzP0ynvg4_xU4Q.png" /><figcaption>FlowChat — Implicit Intents</figcaption></figure><h3>Step 4: A Real Example — Sharing an Image</h3><p>I tested sharing a photo:</p><pre>val imageUri: Uri = getImageUri()<br>val shareIntent = Intent().apply {<br>    action = Intent.ACTION_SEND<br>    putExtra(Intent.EXTRA_STREAM, imageUri)<br>    type = &quot;image/jpeg&quot;<br>}<br>startActivity(Intent.createChooser(shareIntent, &quot;Share Image via&quot;))</pre><p>Here’s what happens:</p><ul><li>ACTION_SEND → I want to send something.</li><li>EXTRA_STREAM → My image URI.</li><li>type = &quot;image/jpeg&quot; → Only apps that can handle JPEG images appear.</li></ul><p>The resolve list might include WhatsApp, Gmail, Drive, etc. Android doesn’t hardcode these — it <strong>calculates dynamically</strong> based on my device’s installed apps and their intent-filters.</p><h3>Step 5: How Receiving Apps Register</h3><p>For apps to show in the share sheet, they declare intent-filters:</p><pre>&lt;intent-filter&gt;<br>    &lt;action android:name=&quot;android.intent.action.SEND&quot; /&gt;<br>    &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;<br>    &lt;data android:mimeType=&quot;image/*&quot; /&gt;<br>&lt;/intent-filter&gt;</pre><ul><li>Action → Can handle SEND</li><li>Category → Default</li><li>Data → Any image</li></ul><p>Android matches my Intent against this, adds it to the resolve list, and the app appears as an option. Simple in theory, elegant in execution.</p><h3>Step 6: Why It Matters for Developers</h3><p>This little deep dive changed how I design apps:</p><ol><li><strong>Better UX:</strong> I can control which apps appear by tweaking MIME types.</li><li><strong>Graceful error handling:</strong> I now check for ActivityNotFoundException.</li><li><strong>Powerful cross-app features:</strong> I can build apps that communicate seamlessly without hardcoding app dependencies.</li></ol><p>It also taught me to <strong>think like Android</strong>. Every tap, every Intent, every share sheet is a tiny example of Android’s architecture at work.</p><h3>Step 7: The Takeaway</h3><p>Next time you tap <strong>Share</strong>, imagine the journey:</p><p><strong>Your Intent → AMS → PMS → Resolve List → Share Sheet → Chosen App</strong></p><p>Understanding this makes you not just a developer who “makes things work,” but a developer who <strong>understands why things work</strong>. And that perspective is invaluable.</p><h3>Developer Challenge</h3><p>Open your favorite app and tap <strong>Share</strong>. Ask yourself:</p><ul><li>How is Android deciding which apps to show?</li><li>What happens if no app can handle my Intent?</li><li>How could I design my app to only show relevant options?</li></ul><p>Curiosity leads to mastery. Start small, like I did with ACTION_SEND, and you’ll soon be exploring more complex flows like ACTION_VIEW, ACTION_PICK, and custom deep links.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05b32b37c57e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your App Worked Perfectly… Until the OS Killed It]]></title>
            <link>https://alaminkarno.medium.com/your-app-worked-perfectly-until-the-os-killed-it-ac8d63d24f21?source=rss-3a122e149eeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac8d63d24f21</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[bugs]]></category>
            <dc:creator><![CDATA[Md. Al-Amin]]></dc:creator>
            <pubDate>Fri, 23 Jan 2026 19:43:34 GMT</pubDate>
            <atom:updated>2026-01-23T19:47:59.271Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*up5u-fyoZYJvlOnKALrzxQ.png" /><figcaption>Thambnail — Generated by Google Gemini (Nano Banana)</figcaption></figure><p><em>A production story from real apps. </em>For a long time, I thought process death was an edge case. Something you read about in docs. Something that <em>might</em> happen, but not in real life. After all, my apps worked fine. QA was happy. Users were using them.</p><p>Then production taught me otherwise.</p><h3>It Started With Autonemo</h3><p>While working on <a href="https://play.google.com/store/apps/details?id=com.autonemovtsgpswox.track&amp;hl=en-US"><strong>Autonemo</strong></a>, a vehicle tracking app, everything looked solid:</p><ul><li>Live vehicle tracking</li><li>Trip status</li><li>Ongoing routes</li><li>Driver activity</li></ul><p>You open the app → tracking works.<br>You background it → come back → still works.</p><p>Until users started reporting something strange:</p><blockquote><em>“Sometimes when I come back to the app, tracking is gone.”<br> “The trip looks like it never started.”</em></blockquote><p>No crashes.<br> No ANRs.<br> No error logs.</p><p>Just… wrong state.</p><h3>The Bug I Couldn’t Reproduce</h3><p>On my phone:</p><ul><li>High RAM</li><li>Latest Android</li><li>No aggressive background killing</li></ul><p>I could switch apps, come back, and everything was fine.</p><p>But real users?</p><ul><li>Budget devices</li><li>Old OS versions</li><li>Heavy multitasking</li></ul><p>That’s when I realized:</p><blockquote><strong><em>The OS was killing the app in the background.</em></strong></blockquote><p>Not pausing it. Not stopping it nicely.<br><strong>Killing the process.</strong></p><h3>The Mistake (Flutter)</h3><p>At that time, critical tracking state lived only in memory:</p><pre>class TrackingState {<br>  bool isTripActive = false;<br>  String? vehicleId;<br>}</pre><p>As long as the app was alive:</p><ul><li>UI was correct</li><li>Tracking looked accurate</li></ul><p>But once the OS killed the process:</p><ul><li>Memory was wiped</li><li>State reset</li><li>App restarted as if nothing was happening</li></ul><p>No crash = no alert.<br>Just broken logic.</p><h3>“Okay, Fixed” — Then VivaUtilities Happened</h3><p>Later, while working on <strong>VivaUtilities</strong>, a Flutter app for <strong>meal and leave management</strong>, I saw the same issue — but this time in a different form.</p><p>Users would:</p><ul><li>Start applying for leave</li><li>Fill half the form</li><li>Switch apps (email, calendar, messages)</li><li>Come back…</li></ul><p>And the form was empty.</p><p>Again:</p><ul><li>No crash</li><li>No error</li><li>Just lost progress</li></ul><p>And again, QA couldn’t reproduce it consistently.</p><h3>The Common Pattern I Missed</h3><p>I finally stopped looking at features and started looking at <strong>lifecycle</strong>.</p><p>Both apps had the same assumption:</p><blockquote><em>“If the app goes to background, my state is still there.”</em></blockquote><p>That assumption is wrong.</p><p>On Flutter:</p><ul><li>Widgets rebuild</li><li>Controllers recreate</li><li>Providers restart</li></ul><p>If the process is dead, <strong>everything in memory is gone</strong>.</p><h3>The Flutter Fix: Persist What Matters</h3><p>I changed how I decided what to persist.</p><p>Not everything. Only what would hurt to lose.</p><pre>await prefs.setBool(&#39;is_trip_active&#39;, true);<br>await prefs.setString(&#39;vehicle_id&#39;, vehicleId);</pre><p>Then restored it <strong>on app start</strong>, not later.</p><p>For UI-related state, I also started using <strong>state restoration</strong> (which I had ignored before):</p><pre>class LeaveFormScreen extends StatefulWidget {<br>  const LeaveFormScreen({super.key});<br><br>  @override<br>  State&lt;LeaveFormScreen&gt; createState() =&gt; _LeaveFormScreenState();<br>}<br><br>class _LeaveFormScreenState extends State&lt;LeaveFormScreen&gt;<br>    with RestorationMixin {<br><br>  final RestorableString reason = RestorableString(&#39;&#39;);<br><br>  @override<br>  String get restorationId =&gt; &#39;leave_form&#39;;<br><br>  @override<br>  void restoreState(RestorationBucket? oldBucket, bool initialRestore) {<br>    registerForRestoration(reason, &#39;leave_reason&#39;);<br>  }<br>}</pre><p>This alone prevented a whole class of “random reset” complaints.</p><h3>Then Native Android Taught Me the Same Lesson (VivaCash)</h3><p>I thought this was a Flutter-specific problem.</p><p>Then <strong>VivaCash</strong> proved me wrong.</p><p>VivaCash is a <strong>native Android app written in Java</strong>, handling sensitive MFS flows:</p><ul><li>Amount input</li><li>Transaction steps</li><li>OTP flows</li><li>App switching (SMS, banking apps)</li></ul><p>Users reported:</p><blockquote><em>“I went to check OTP and came back — transaction restarted.”</em></blockquote><p>Again:</p><ul><li>No crash</li><li>No exception</li><li>Just lost state</li></ul><h3>The Java Trap: Trusting Memory Too Much</h3><p>The code looked innocent:</p><pre>public class PaymentViewModel extends ViewModel {<br>    public double amount = 0.0;<br>}</pre><p>I assumed:</p><blockquote><em>“ViewModel survives rotation, so I’m safe.”</em></blockquote><p>But ViewModel does <strong>not</strong> survive process death.</p><p>When the OS killed the app:</p><ul><li>ViewModel was recreated</li><li>Amount reset</li><li>Flow broken</li></ul><h3>The Real Fix on Android: SavedStateHandle</h3><p>Once we moved critical state into SavedStateHandle, the issue disappeared:</p><pre>public class PaymentViewModel extends ViewModel {<br><br>    private SavedStateHandle handle;<br><br>    public PaymentViewModel(SavedStateHandle handle) {<br>        this.handle = handle;<br>    }<br><br>    public void setAmount(double amount) {<br>        handle.set(&quot;amount&quot;, amount);<br>    }<br><br>    public double getAmount() {<br>        Double value = handle.get(&quot;amount&quot;);<br>        return value != null ? value : 0.0;<br>    }<br>}</pre><p>Now:</p><ul><li>Rotation → safe</li><li>Background kill → safe</li><li>Process recreation → safe</li></ul><h3>The Rule I Ship Apps With Now</h3><p>After <a href="https://apps.apple.com/us/app/autonemo-vehicle-tracking/id6453320203">Autonemo</a>. After VivaUtilities. After VivaCash.</p><p>This is the rule I never break:</p><blockquote><strong><em>If losing it would confuse or frustrate the user, it does not belong only in memory.</em></strong></blockquote><p>Memory is temporary. The OS is ruthless. Users don’t care why it happened.</p><h3>Why This Bug Is So Dangerous</h3><ul><li>It passes QA</li><li>It doesn’t crash</li><li>It only happens on real devices</li><li>It slowly destroys trust</li></ul><p>And users don’t complain loudly. They just stop using your app.</p><h3>Final Thought</h3><p>Your app doesn’t fail when it crashes.</p><p>It fails when the OS kills it — and your app pretends nothing important was happening.</p><p>That’s a silent failure. And those are the worst ones.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac8d63d24f21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[That One Share Button That Broke on iOS 26 and How I Fixed It]]></title>
            <link>https://alaminkarno.medium.com/that-one-share-button-that-broke-on-ios-26-and-how-i-fixed-it-24e3f96f97f1?source=rss-3a122e149eeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/24e3f96f97f1</guid>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[dependencies]]></category>
            <category><![CDATA[error-handling]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Md. Al-Amin]]></dc:creator>
            <pubDate>Wed, 17 Dec 2025 20:35:03 GMT</pubDate>
            <atom:updated>2025-12-17T20:35:03.712Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qFhCHqubPXwqdcxmLLRnnQ.png" /><figcaption>Runtime Exception: Unhandled Events</figcaption></figure><p>A few weeks ago, during my holiday break, I decided to revisit one of my old pet projects <a href="https://github.com/alamin-karno/wallpaper_hub"><strong>WallpaperHub</strong></a>. It’s a simple Flutter app where users can browse wallpapers and share them with friends.</p><p>Nothing fancy.<br>Nothing experimental.</p><p>Or at least… that’s what I thought.</p><h3>The Calm Before the Crash</h3><p>The app had been running perfectly for a long time.</p><ul><li>Flutter app ✅</li><li>share_plus plugin ✅</li><li>Tested on iOS 17 ✅</li><li>Tested on Android ✅</li></ul><p>I recently updated my system and got access to an <strong>iOS 26 device</strong>.<br>Naturally, I wanted to run the app and see how it behaves on the latest iOS.</p><p>The app launched.<br>The UI looked fine.<br>Scrolling was smooth.</p><p>Then I tapped the <strong>Share</strong> button.</p><p>💥 <strong>Boom. Runtime exception.</strong></p><h3>“Wait… This Worked Yesterday”</h3><p>The crash happened <strong>only when triggering the share action</strong>.</p><p>What confused me even more:</p><ul><li>Same code</li><li>Same plugin version</li><li>Same app</li><li>Worked perfectly on iOS 17</li></ul><p>But on <strong>iOS 26</strong>, the app crashed immediately.</p><p>At first, I assumed:</p><ul><li>Maybe Xcode issue</li><li>Maybe simulator bug</li><li>Maybe iOS beta instability</li></ul><p>But no, this was a <strong>real breaking change</strong>.</p><h3>The Error That Gave It Away</h3><p>After carefully reading the logs, the issue pointed toward the <strong>share sheet presentation</strong> on iOS.</p><p>That’s when I remembered something important:</p><blockquote><em>On iOS, sharing content requires a valid </em><strong><em>source rectangle</em></strong><em> for popover presentation.</em></blockquote><p>Older iOS versions were more forgiving.<br> iOS 26? <strong>Not anymore.</strong></p><h3>The Root Cause (Why This Happens)</h3><p>If you’re using <strong>share_plus version 11 or below</strong>, the plugin internally relied on <strong>deprecated behavior</strong> when presenting the iOS share sheet.</p><p>Specifically:</p><ul><li>iOS now <strong>strictly requires</strong> a valid sharePositionOrigin</li><li>Without it, the app crashes at runtime</li><li>Older iOS versions silently ignored this</li></ul><p>So, upgrading iOS exposed an <strong>incompatibility in older plugin versions</strong>.</p><p>This wasn’t a Flutter issue.<br>This wasn’t my code logic issue.</p><p>It was an <strong>outdated dependency</strong>.</p><h3>The Quick Fix (Two Ways)</h3><h3>Recommended Solution: Upgrade share_plus</h3><p>The easiest and safest solution is:</p><pre>dependencies:<br>  share_plus: ^latest</pre><p>The newer versions properly handle iOS share sheet requirements.</p><h3>Still Using Deprecated Code? It Won’t Break (Yet)</h3><p>Interestingly, even in the latest versions, <strong>deprecated APIs still work</strong>, as long as you explicitly provide the required positioning.</p><p>Here’s the <strong>updated code</strong> I used in my app:</p><pre>final box = context.findRenderObject() as RenderBox?;<br><br>return SharePlus.instance.share(<br>  ShareParams(<br>    text: text,<br>    title: title,<br>    subject: subject,<br>    sharePositionOrigin:<br>        box!.localToGlobal(Offset.zero) &amp; box.size, // REQUIRED for iOS<br>  ),<br>);</pre><p>This single line is the key</p><pre>box!.localToGlobal(Offset.zero) &amp; box.size</pre><p>It tells iOS:</p><blockquote><em>“Here’s where the share sheet should originate from.”</em></blockquote><p>Without it, 💥 crash.</p><h3>Real Example From My Project</h3><p>This wasn’t a demo fix.<br> This is exactly what I did in my real project <strong>WallpaperHub</strong>.</p><ul><li><strong>GitHub repo:</strong><br> 👉 <a href="https://github.com/alamin-karno/wallpaper_hub">https://github.com/alamin-karno/wallpaper_hub</a></li><li><strong>Exact file where the fix lives:</strong><br> 👉 <a href="https://raw.githubusercontent.com/alamin-karno/wallpaper_hub/refs/heads/master/lib/core/helper/app_helper.dart">https://raw.githubusercontent.com/alamin-karno/wallpaper_hub/refs/heads/master/lib/core/helper/app_helper.dart</a></li></ul><p>If you open that file, you’ll see how the helper method safely handles sharing across platforms including iOS 26.</p><h3>Why iOS 26 Made This Visible</h3><p>This is the important takeaway</p><blockquote><em>iOS 26 didn’t </em>break<em> your app.<br>It </em>stopped tolerating unsafe behavior<em>.</em></blockquote><p>Older iOS versions:</p><ul><li>Allowed missing share origin</li><li>Failed silently</li></ul><p>iOS 26:</p><ul><li>Enforces correct popover positioning</li><li>Crashes if you don’t provide it</li></ul><p>This is actually a <strong>good thing</strong> but only if your dependencies are up to date.</p><h3>Lessons Learned (So You Don’t Suffer Like I Did)</h3><ol><li><strong>Always test your Flutter apps on the latest iOS</strong></li><li><strong>Old plugins can break even if your code hasn’t changed</strong></li><li><strong>iOS is less forgiving with UI presentation rules</strong></li><li><strong>Reading logs carefully saves hours</strong></li><li><strong>Sometimes… AI really does help</strong></li></ol><h3>Final Thoughts</h3><p>This bug cost me a few hours of digging, log reading, and head scratching all from tapping a single Share button.</p><p>But that’s Flutter life:</p><ul><li>One OS update</li><li>One outdated plugin</li><li>One runtime crash</li></ul><p>Hopefully, this story saves you that time.</p><p>If your Flutter app crashes on <strong>iOS 26 when sharing</strong>, now you know exactly <strong>why </strong>and <strong>how to fix it</strong>.</p><p>Happy coding 🚀 And keep your dependencies fresh.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24e3f96f97f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clean Architecture in Flutter: Where Does BLoC (and MVVM) Fit In?]]></title>
            <link>https://alaminkarno.medium.com/clean-architecture-in-flutter-where-does-bloc-and-mvvm-fit-in-1eaf4953ee70?source=rss-3a122e149eeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/1eaf4953ee70</guid>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[flutter-bloc-pattern]]></category>
            <category><![CDATA[mvvm]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[state-management]]></category>
            <dc:creator><![CDATA[Md. Al-Amin]]></dc:creator>
            <pubDate>Fri, 22 Aug 2025 18:23:28 GMT</pubDate>
            <atom:updated>2025-08-22T18:23:28.745Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IUEzDf3dQmks67sCINuvmg.png" /><figcaption>A Story from My Interview</figcaption></figure><p>Not long ago, during an interview, I was explaining one of my Flutter projects. I mentioned that I had used <strong>Dio for networking, BLoC for state management, Clean Code principles, and by mistake MVVM.</strong></p><p>The interviewer immediately caught it:</p><ul><li><em>“Wait, how do you combine Clean Code, BLoC, and MVVM together?”</em></li><li><em>“If Flutter already has Streams, why do you even need BLoC?”</em></li><li><em>“What exactly does BLoC give you?”</em></li></ul><p>That moment taught me something important: many Flutter developers (including myself at the time) <strong>mix up architecture, patterns, and state management tools.</strong> In this post, I want to clear up these confusions so the next time you’re building or interviewing, you can confidently explain how these pieces fit together.</p><h3>Clean Architecture, MVVM, and BLoC Untangling the Terms</h3><p>Before we connect them, let’s first define each piece:</p><h3>1. Clean Architecture (a principle)</h3><ul><li>Coined by Uncle Bob.</li><li>It’s not a framework; it’s a <strong>set of principles</strong>:</li><li><strong>Separation of Concerns</strong> → UI shouldn’t know about data sources.</li><li><strong>Dependency Inversion</strong> → higher layers shouldn’t depend on lower layers.</li><li><strong>Testability</strong> → every layer should be independently testable.</li></ul><p>In Flutter, we usually break it down into:</p><ul><li><strong>Domain layer</strong> → business logic, use cases.</li><li><strong>Data layer</strong> → repositories, APIs, local storage.</li><li><strong>Presentation layer</strong> → BLoC, Cubit, or any state management that connects data to UI.</li><li><strong>UI layer</strong> → Flutter widgets.</li></ul><h3>2. MVVM (an architectural pattern)</h3><ul><li>Stands for <strong>Model–View–ViewModel</strong>.</li><li>Common in Android/iOS dev.</li><li>The <strong>ViewModel</strong> acts as a middleman between the UI (View) and the data (Model).</li><li>In Flutter, the “ViewModel” role is often taken by <strong>BLoC or Cubit</strong>.</li></ul><h3>3. BLoC (a state management pattern)</h3><ul><li>Stands for <strong>Business Logic Component</strong>.</li><li>Built on top of <strong>Streams</strong>, but with structure:</li></ul><ol><li>You send an <strong>Event</strong>.</li><li>BLoC processes it and emits a <strong>State</strong>.</li><li>The UI rebuilds automatically on state change.</li></ol><ul><li>Benefits:</li></ul><ol><li>Predictable state transitions.</li><li>Easy to test.</li><li>Works beautifully with Clean Architecture (fits in the presentation layer).</li></ol><h3>Streams vs BLoC: Why Not Just Streams?</h3><p>Good question Flutter already has Streams. So why do we need BLoC?</p><p><strong>Streams</strong> give us data flow, but nothing more. You’re on your own to:</p><ul><li>Define how events are triggered.</li><li>Manage multiple listeners.</li><li>Ensure state consistency.</li><li>Avoid spaghetti code when things get complex.</li></ul><p><strong>BLoC</strong>, on the other hand, provides:</p><ul><li>A structured <strong>event → state → transition</strong> cycle.</li><li>Separation of concerns (UI just listens, doesn’t process logic).</li><li>Built-in testability.</li><li>A standard pattern that teams can adopt consistently.</li></ul><p>In other words: <strong>Streams are raw power; BLoC is structured discipline.</strong></p><h3>Putting It All Together: Clean Code + BLoC (+ MVVM)</h3><p>Here’s how these concepts actually work in practice:</p><h3>Layered Breakdown</h3><pre>UI (Widgets) <br>   ↓<br>Presentation Layer → BLoC (acts like ViewModel)<br>   ↓<br>Domain Layer → Use Cases (business rules)<br>   ↓<br>Data Layer → Repository (calls Dio, APIs, Database)</pre><ul><li><strong>UI Layer</strong>: Displays widgets, listens to state.</li><li><strong>Presentation Layer</strong>: BLoC handles user events, converts them to states.</li><li><strong>Domain Layer</strong>: Encapsulates business rules (e.g., “validate login credentials”).</li><li><strong>Data Layer</strong>: Uses Dio or database to fetch data.</li></ul><p>In this setup, you can even say: <em>“My BLoC works like a ViewModel (MVVM), but within Clean Architecture boundaries.”</em></p><h3>Example: Login Flow with Dio + BLoC + Clean Architecture</h3><p>Let’s say a user taps <strong>Login</strong>:</p><ol><li><strong>UI Layer</strong></li></ol><pre>BlocProvider(<br>  create: (_) =&gt; LoginBloc(),<br>  child: LoginScreen(),<br>);</pre><p><strong>2. Event Triggered</strong></p><pre>// User taps login button<br>context.read&lt;LoginBloc&gt;().add(LoginButtonPressed(username, password));</pre><p><strong>3. BLoC Handles It</strong></p><pre>on&lt;LoginButtonPressed&gt;((event, emit) async {<br>  emit(LoginLoading());<br>  final result = await loginUseCase(event.username, event.password);<br>  <br>  result.fold(<br>    (failure) =&gt; emit(LoginFailure(failure.message)),<br>    (user) =&gt; emit(LoginSuccess(user)),<br>  );<br>});</pre><p><strong>4. Domain Layer (Use Case)</strong></p><pre>class LoginUseCase {<br>  final AuthRepository repository;<br>  LoginUseCase(this.repository);<br><br>  Future&lt;Either&lt;Failure, User&gt;&gt; call(String username, String password) {<br>    return repository.login(username, password);<br>  }<br>}</pre><p><strong>5. Data Layer (Repository + Dio)</strong></p><pre>class AuthRepositoryImpl implements AuthRepository {<br>  final Dio dio;<br>  AuthRepositoryImpl(this.dio);<br><br>  @override<br>  Future&lt;Either&lt;Failure, User&gt;&gt; login(String username, String password) async {<br>    try {<br>      final response = await dio.post(&#39;/login&#39;, data: {<br>        &#39;username&#39;: username,<br>        &#39;password&#39;: password,<br>      });<br>      return Right(User.fromJson(response.data));<br>    } catch (e) {<br>      return Left(Failure(&#39;Login failed&#39;));<br>    }<br>  }<br>}</pre><p><strong>6. UI Reacts to State</strong></p><pre>BlocBuilder&lt;LoginBloc, LoginState&gt;(<br>  builder: (context, state) {<br>    if (state is LoginLoading) return CircularProgressIndicator();<br>    if (state is LoginFailure) return Text(state.message);<br>    if (state is LoginSuccess) return Text(&#39;Welcome, ${state.user.name}&#39;);<br>    return LoginForm();<br>  },<br>);</pre><h3>Lessons Learned</h3><ul><li><strong>Clean Architecture</strong> is the big picture → separates layers and dependencies.</li><li><strong>BLoC</strong> lives in the presentation layer → acts like the “ViewModel” in MVVM.</li><li><strong>Streams</strong> are low-level → BLoC provides structure and predictability.</li><li>Combining them gives you: testability, scalability, and clarity.</li></ul><h3>Conclusion</h3><p>When I got asked in the interview <em>“How do you put Clean Code, BLoC, and MVVM together?” </em>I initially froze. But after revisiting the concepts, the answer became clear:</p><ul><li>Clean Architecture = the overall structure.</li><li>BLoC = state management for the presentation layer.</li><li>MVVM = a pattern you can “approximate” where BLoC acts like the ViewModel.</li></ul><p>The real lesson? <strong>Architecture in Flutter isn’t about buzzwords it’s about clarity, consistency, and communication with your team.</strong></p><p>So next time someone asks you:</p><ul><li><em>“Why BLoC when we already have Streams?”</em> → Because it enforces structure, consistency, and testability.</li><li><em>“How do you combine Clean Code, BLoC, and MVVM?”</em> → By making BLoC your ViewModel inside Clean Architecture.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1eaf4953ee70" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>