<?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 Vedran Balagovic on Medium]]></title>
        <description><![CDATA[Stories by Vedran Balagovic on Medium]]></description>
        <link>https://medium.com/@vedran.balagovic?source=rss-51e16679109e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7YZybNpF843O2o61</url>
            <title>Stories by Vedran Balagovic on Medium</title>
            <link>https://medium.com/@vedran.balagovic?source=rss-51e16679109e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 08:40:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vedran.balagovic/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[How I almost killed my SaaS, and what made me pivot it instead]]></title>
            <link>https://itnext.io/how-i-almost-killed-my-saas-and-what-made-me-pivot-it-instead-e02aa6fb3c2f?source=rss-51e16679109e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e02aa6fb3c2f</guid>
            <category><![CDATA[neural-draft]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mcp-server]]></category>
            <dc:creator><![CDATA[Vedran Balagovic]]></dc:creator>
            <pubDate>Mon, 11 May 2026 04:37:48 GMT</pubDate>
            <atom:updated>2026-05-11T07:14:51.578Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ZRR7AWWBKOCtIH_yEaZGw.png" /></figure><p><em>Or: how Claude Code, Lovable and v0 changed what I was actually selling.</em></p><p>A year ago, I started Neural Draft. The idea was a quick, AI-powered all in one for small businesses. You sign up, you get a website, you get content, you get SEO, you get a way to push to your socials. One subscription, no integration headaches.</p><p>I built it. People paid me for it. It worked.</p><p>Then around six months ago I had a side project I wanted to ship a landing page for. I tried Claude Code first. Twenty minutes later I had the page. It looked better than what my own product would have generated.</p><p>Then I tried Lovable. Then v0. Then Bolt. Each one was good. A couple of them were better than the website generation feature I’d spent a year polishing.</p><p>I knew right then I was in trouble. I just didn’t admit it yet.</p><h3>The slow part of figuring out you have a problem</h3><p>For a few weeks, I told myself this didn’t matter. My product had content, SEO, social, all bundled. The Lovable and v0 and Bolt crowd didn’t.</p><p>But the more I watched my own users, the harder that argument got. The website was supposed to be the front door to all the other stuff. In reality it was the thing they replaced first.</p><p>People would sign up, look at the site I generated for them, and then go build a real one in Lovable or in Claude Code and just paste the link. The content and SEO and social tools they’d come for, sure, they used. But the website itself was decoration.</p><p>The harder pill: I was doing the same thing. For my own side projects I stopped using Neural Draft’s website generation. I just used Claude.</p><p>If I don’t trust my own product for the thing it does, why should anyone else?</p><h3>The moment I knew</h3><p>The real breaking point was Claude Design. I sat down to ship one of my apps’ landing pages. I used Claude. The output was clean, on-brand, mobile-responsive, and built in under half an hour. With the kind of design care I would have charged a freelancer real money for.</p><p>I closed the tab and just stared at the wall for a bit.</p><p>That was it. The website generation part of Neural Draft, the part I’d been polishing for a year, was no longer a thing I was going to keep selling. Not because the product was bad. Because the world moved.</p><h3>The “should I sunset this whole thing” phase</h3><p>I’m going to be honest, I spent about a week thinking about killing the product entirely.</p><p>Sunsetting is its own kind of work. Refunding people who’d paid. Letting customers down. Telling myself I’d just gone the wrong direction for a year. Not a great week.</p><p>The other option I kept circling on was “become a pure API for blogs.” That felt worse somehow. Boring. I didn’t want to compete in a category that already had ten companies doing the exact same thing.</p><p>So I sat with it for a few more days.</p><h3>What changed</h3><p>I was, at the same time, building three separate web apps in Claude Code for myself. A consulting site, a side product, a small thing for my partner’s business. Each one was nice to ship in Claude. Each one was fast.</p><p>But for each one, I kept hitting the same five problems:</p><ol><li>The blog. I wanted SEO content. Setting up a CMS for each app was insane.</li><li>Text and image edits. Once a non-developer needed to change something, I didn’t want to redeploy. I needed a real backend with a real admin.</li><li>Forms. Every form needed a place to go. Every form needed to send an email to me or my client. None of that is hard, all of it is annoying to wire up six times.</li><li>Multilingual. I’m based in Croatia. Half my projects need Croatian and English minimum. Sometimes German or Italian. That’s a translations layer in every project.</li><li>Bookings and e-commerce. Some apps needed appointments. Some needed Stripe. Every time I had to integrate Calendly or roll my own. Or wire up Stripe Connect for a marketplace use case.</li></ol><p>And I realized: I already had all of this. Built. Battle-tested. Inside Neural Draft.</p><p>I’d built the wrong product.</p><p>The website generation was the marketing wrapper. The actual valuable thing I’d built was the backend.</p><h3>The pivot</h3><p>So I pivoted. Hard. Three weeks of evenings rebuilding the surface.</p><p>Neural Draft is now the backend for websites you build anywhere else. You bring the frontend, whatever you like, Claude Code, Next.js, vanilla HTML, doesn’t matter. We do the rest.</p><p>CMS for content. Translations layer for multilingual. Pages with per-page SEO meta. A blog with AI generation and SEO scheduling. Forms with email delivery. Booking with a real calendar widget. E-commerce with Stripe Connect for marketplace flows. Social management for cross-posting.</p><p>One API. One MCP server.</p><p>The MCP part is the bit I’m most proud of. You install it once:</p><pre>npm i -g @neuraldraft/mcp</pre><p>And Claude can now read and write your CMS while you’re coding. You don’t switch tabs. You don’t open my dashboard. You’re in Claude Code working on your Next.js app and you say “add a hero subtitle in Croatian for the homepage” and Claude does it via the MCP. The next time the page renders, the new content is there.</p><p>The same backend serves every project I run. Every customer site. Every demo. Same database, same API, same admin, just scoped per project.</p><h3>What it looks like now</h3><p>To prove the new model end-to-end for the announcement, I shipped three reference demos in Claude Code in a day each. A coffee shop with real product catalog and Stripe checkout. A hair studio with a real booking calendar. My own IT consulting company’s site rebuilt as a Neural Draft customer. All three are on Firebase Hosting and call back to Neural Draft for everything beyond HTML.</p><h3>What I learned</h3><p>A few things, in no particular order.</p><p>You can’t be the thing if the thing keeps changing. Landing-page generation is going to be commoditized to zero. So will image generation. So will most generation features. The platforms doing those will get faster and cheaper. If you’re building generation, you’re competing with companies that have a hundred times your runway.</p><p>Build the plumbing instead. Auth. Billing. Content. Translations. Bookings. Forms with email. The integrations between the integrations. That stuff doesn’t get reinvented every six months because there’s no demo virality in it.</p><p>It’s okay to admit your product was wrong. I lost three weeks rebuilding. I lost some pride. I didn’t lose customers. Most of them never noticed the pivot because their experience didn’t change, the admin still works, the blog still publishes, their forms still come into their inbox.</p><p>Solo founders should pivot fast. The longer I’d sat on this, the more painful it would have been. Three weeks of evenings is nothing. Nine months of “let me just polish the website generation more” would have been catastrophic.</p><p>Dogfooding works. I only saw the real pivot when I started using my own product the way a customer would. Five different apps later, the gap was obvious.</p><h3>What I’d say to other AI-product founders</h3><p>The mistake I almost made was trying to compete on the demo layer. Don’t.</p><p>Claude is going to be better at design than your product. v0 is going to be better at landing pages than your product. Lovable is going to be better at app generation than your product. They’re all going to get better faster than you can.</p><p>The good news is, they don’t care about the boring stuff. They’re not racing to integrate Stripe Connect for marketplace use cases. They’re not racing to build a translations layer. They’re not building a blog scheduler. They’re racing to win the demo, because the demo is what makes their next funding round.</p><p>Build the boring stuff. Be the plumbing. The plumbing doesn’t get reinvented every six months. Demos do.</p><h3>What’s next for Neural Draft</h3><p>We’re shipping faster than ever, mostly because the surface area is smaller now. The whole thing is one API, one MCP server, one admin. No more “should we add a website builder feature” decisions because that’s not the product anymore.</p><p>In the next few weeks I’m adding deeper Stripe Connect support for marketplaces, a webhook system, more language support in the AI translation layer, and a self-host option for tenants who want to keep their data in their own infra.</p><p>If you’re building something and you’re tired of wiring up a CMS plus a blog plus forms plus Stripe plus a translations layer for every project, give us a look. The SDK is @neuraldraft/sdk. The MCP is @neuraldraft/mcp. The site is <a href="https://neuraldraft.io/">neuraldraft.io</a>.</p><p>If you’re another founder navigating “wait, did Claude just eat my product?”, I’m happy to talk. Drop me a line on <a href="https://www.linkedin.com/in/vedran-balagovic/">LinkedIn</a> or <a href="https://x.com/dr_terapeut">X</a>. I’ve been through it. It’s survivable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e02aa6fb3c2f" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/how-i-almost-killed-my-saas-and-what-made-me-pivot-it-instead-e02aa6fb3c2f">How I almost killed my SaaS, and what made me pivot it instead</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built an AI Engine That Turns Text Prompts Into Production-Ready Animated Characters — Here’s How]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://itnext.io/i-built-an-ai-engine-that-turns-text-prompts-into-production-ready-animated-characters-heres-how-5d3b1031e55a?source=rss-51e16679109e------2"><img src="https://cdn-images-1.medium.com/max/2190/1*htMeYctLQ4MhQgyG0H1Bsw.png" width="2190"></a></p><p class="medium-feed-link"><a href="https://itnext.io/i-built-an-ai-engine-that-turns-text-prompts-into-production-ready-animated-characters-heres-how-5d3b1031e55a?source=rss-51e16679109e------2">Continue reading on ITNEXT »</a></p></div>]]></description>
            <link>https://itnext.io/i-built-an-ai-engine-that-turns-text-prompts-into-production-ready-animated-characters-heres-how-5d3b1031e55a?source=rss-51e16679109e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d3b1031e55a</guid>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[lottie]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[character-animation]]></category>
            <dc:creator><![CDATA[Vedran Balagovic]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 10:51:36 GMT</pubDate>
            <atom:updated>2026-03-06T09:45:47.305Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Building Neural Draft: A Deep Dive into Multi-AI Content Generation Architecture]]></title>
            <link>https://itnext.io/building-neural-draft-a-deep-dive-into-multi-ai-content-generation-architecture-baae918535b8?source=rss-51e16679109e------2</link>
            <guid isPermaLink="false">https://medium.com/p/baae918535b8</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[ai-automation]]></category>
            <category><![CDATA[neural-draft]]></category>
            <dc:creator><![CDATA[Vedran Balagovic]]></dc:creator>
            <pubDate>Tue, 30 Dec 2025 16:02:09 GMT</pubDate>
            <atom:updated>2025-12-30T17:51:47.485Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zuiMdWF5xz9txfU7QPY2zw.png" /></figure><p><em>How I built a SaaS platform that orchestrates multiple AI providers, generates undetectable content, and scales to thousands of tenants</em></p><h3>Introduction</h3><p>When I set out to build Neural Draft, I had a simple goal: create a platform where businesses could generate high-quality content without the typical “AI smell” that plagues most AI-generated text. What started as a weekend project evolved into a complex multi-tenant SaaS platform integrating six AI providers, four video generation models, and a sophisticated content humanization pipeline.</p><p>In this post, I’ll walk you through the most interesting technical challenges I faced and the architectural decisions that made Neural Draft possible. Whether you’re building your own AI-powered SaaS or just curious about modern Laravel architecture, there’s something here for you.</p><h3>The Architecture Overview</h3><p>Before diving into specifics, here’s what Neural Draft does:</p><ul><li><strong>AI Content Generation</strong>: Blog posts, social media content, and SEO metadata</li><li><strong>Video Generation</strong>: AI-powered video creation for social media</li><li><strong>Multi-Language Support</strong>: Automatic translation to 50+ languages</li><li><strong>Social Media Automation</strong>: Direct publishing to Facebook, Instagram, Twitter, and TikTok</li><li><strong>Multi-Tenant SaaS</strong>: Each customer gets their own isolated database and subdomain</li></ul><p>The tech stack:</p><ul><li><strong>Backend</strong>: Laravel 12 with PHP 8.3</li><li><strong>Admin Panel</strong>: Filament 3.2</li><li><strong>Multi-tenancy</strong>: Spatie Laravel Multitenancy</li><li><strong>AI Providers</strong>: OpenAI, Claude, Gemini, Replicate</li><li><strong>Database</strong>: PostgreSQL (database-per-tenant)</li><li><strong>Queue System</strong>: Laravel Horizon with Redis</li></ul><h3>Part 1: The Multi-AI Provider Factory Pattern</h3><p>One of the first challenges was supporting multiple AI providers. Users should be able to choose their preferred model (GPT-4, Claude Sonnet, Gemini Pro) without the application caring about the underlying implementation.</p><h3>The Problem</h3><p>Each AI provider has different:</p><ul><li>API structures and authentication</li><li>Response formats</li><li>Token limits and pricing</li><li>Capabilities (some generate images, some don’t)</li></ul><h3>The Solution: AIServiceFactory</h3><p>I implemented a factory pattern that abstracts away provider differences:</p><pre>class AIServiceFactory<br>{<br>    protected OpenAIService $openAIService;<br>    protected ClaudeService $claudeService;<br>    protected GeminiService $geminiService;<br><br>    public function getContentService(): OpenAIService|ClaudeService|GeminiService<br>    {<br>        model = this-&gt;getContentModel();<br><br>        if (str_contains($model, &#39;claude&#39;)) {<br>            return $this-&gt;claudeService;<br>        }<br><br>        if (str_contains($model, &#39;gemini&#39;)) {<br>            return $this-&gt;geminiService;<br>        }<br><br>        return $this-&gt;openAIService;<br>    }<br><br>    private function getContentModel(): string<br>    {<br>        $tenant = Tenant::current();<br>        if ($tenant) {<br>            settings = tenant-&gt;getCurrentAISettings();<br>            if (settings &amp;&amp; $settings-&gt;is_active &amp;&amp; settings-&gt;content_model) {<br>                return $settings-&gt;content_model;<br>            }<br>        }<br>        return &#39;gpt-4o-mini&#39;; // Default fallback<br>    }<br>}<br></pre><h3>The Interesting Part: Cross-Provider Feature Bridging</h3><p>Here’s where it gets interesting. Claude doesn’t generate images, but OpenAI does. When a user chooses Claude for content but needs a featured image, the factory handles this transparently:</p><pre>public function generatePostContent(array params, bool humanize = true): array<br>{<br>    service = this-&gt;getContentService();<br><br>    if ($service instanceof ClaudeService) {<br>        content = $service-&gt;generatePostContent($params, humanize);<br><br>        // Claude doesn&#39;t generate images, so we use OpenAI for that<br>        img = $this-&gt;openAIService-&gt;generateBasicImage(params[&#39;topic&#39;] ?? &#39;Blog Post&#39;);<br><br>        return [<br>            &#39;title&#39; =&gt; $content[&#39;title&#39;],<br>            &#39;content&#39; =&gt; $content[&#39;content&#39;],<br>            &#39;featured_image&#39; =&gt; $img,<br>            // ... other fields<br>        ];<br>    }<br><br>    return service-&gt;generatePostContent($params, humanize);<br>}</pre><p>This pattern lets users get the best of both worlds — Claude’s superior writing with OpenAI’s image generation — without knowing or caring about the underlying complexity.</p><h3>Part 2: The Content Humanization Pipeline</h3><p>This is probably the most technically interesting part of Neural Draft. AI-generated content has a distinctive “smell” — predictable sentence structures, overuse of certain phrases, and unnaturally perfect grammar. AI detectors can spot this easily.</p><h3>The Challenge</h3><p>Make AI-generated content indistinguishable from human-written content while maintaining quality and SEO optimization.</p><h3>The Solution: 6-Iteration Humanization Pipeline</h3><p>I built a multi-pass humanization system that iteratively transforms content until it passes detection thresholds:</p><pre>public function humanizeContent(array params, string imageUrl): array<br>{<br>    $maxIterations = 6;<br>    $targetHumanScore = 95; // Must score 95%+ human<br><br>    // Stage 1: Generate initial humanized content<br>    content = $this-&gt;generateHumanizedContent($params, imageUrl);<br><br>    // Stage 2: Multi-pass humanization<br>    for (i = 0; $i &lt; $maxIterations; i++) {<br>        detection = $this-&gt;detectionService-&gt;detect(content[&#39;content&#39;]);<br><br>        if ($detection[&#39;ai_probability&#39;] &lt; 0.05) { // Less than 5% AI probability<br>            break;<br>        }<br><br>        content[&#39;content&#39;] = $this-&gt;enhancedHumanizationPass($content[&#39;content&#39;], i + 1);<br>    }<br><br>    // Stage 3-6: Final polish, formatting, and field humanization<br>    content[&#39;content&#39;] = $this-&gt;aggressiveFinalPolish(content[&#39;content&#39;]);<br><br>    return $content;<br>}</pre><h3>The Six Humanization Techniques</h3><p>Each iteration applies a different technique:</p><p><strong>private</strong> <strong>function</strong> enhancedHumanizationPass(string content, int passNumber): string</p><pre>private function enhancedHumanizationPass(string content, int passNumber): string<br>{<br>    $techniques = [<br>        1 =&gt; &#39;aggressive_structural&#39;,      // Break AI structural patterns<br>        2 =&gt; &#39;personality_injection&#39;,      // Add personal anecdotes<br>        3 =&gt; &#39;conversational_rewrite&#39;,     // Make it sound like speech<br>        4 =&gt; &#39;authenticity_boost&#39;,         // Add specific details<br>        5 =&gt; &#39;ultra_casual_rewrite&#39;,       // Blog/social media style<br>        6 =&gt; &#39;final_human_polish&#39;          // Remove remaining AI patterns<br>    ];<br><br>    return this-&gt;applyHumanizationTechnique($content, $techniques[passNumber]);<br>}</pre><p>Example: The Ultra-Casual Rewrite Prompt</p><p>This is one of my favorite prompts — it transforms formal AI content into something that sounds like a real person wrote it:</p><pre>private function ultraCasualRewrite(string $content): string<br>{<br>    $prompt = &lt;&lt;&lt;EOT<br>REWRITE THIS CONTENT TO SOUND ULTRA CASUAL - Like a blog post from a real person.<br><br>REQUIREMENTS:<br>1. Start sentences with &quot;So,&quot; &quot;Okay so,&quot; &quot;Look,&quot; &quot;Honestly,&quot; &quot;Real talk -&quot;<br>2. Use em dashes – like this – for natural pauses<br>3. Add ellipses for trailing thoughts...<br>4. Include casual expressions: &quot;tbh,&quot; &quot;lowkey,&quot; &quot;kinda,&quot; &quot;ngl&quot;<br>5. Use sentence fragments. Like this. For emphasis.<br>6. Add reactions in parentheses (which honestly drives me crazy sometimes)<br>7. Include self-deprecating humor or admissions of mistakes<br>8. Write like you&#39;re texting a friend who asked for advice<br><br>ABSOLUTELY AVOID:<br>- Perfect grammar and structure<br>- Formal vocabulary<br>- Any AI-sounding phrases<br><br>Content to transform:<br>{$content}<br>EOT;<br><br>    return this-&gt;callAIService(prompt, 0.96); // High temperature for creativity<br>}</pre><h3>Pattern Removal</h3><p>The final polish removes telltale AI phrases:</p><pre>private function removeAIPatterns(string $content): string<br>{<br>    $aiPatterns = [<br>        &#39;/\bFurthermore,\s*/i&#39; =&gt; &#39;&#39;,<br>        &#39;/\bMoreover,\s*/i&#39; =&gt; &#39;&#39;,<br>        &#39;/It\&#39;s worth noting that/i&#39; =&gt; &#39;Note:&#39;,<br>        &#39;/It should be mentioned that/i&#39; =&gt; &#39;&#39;,<br>        &#39;/comprehensive/i&#39; =&gt; &#39;detailed&#39;,<br>        &#39;/leverage/i&#39; =&gt; &#39;use&#39;,<br>        &#39;/optimize/i&#39; =&gt; &#39;improve&#39;,<br>        &#39;/facilitate/i&#39; =&gt; &#39;help with&#39;,<br>    ];<br><br>    foreach (aiPatterns as $pattern =&gt; replacement) {<br>        content = preg_replace($pattern, $replacement, content);<br>    }<br><br>    return $content;<br>}</pre><h3>Part 3: Multi-Tenant Architecture with Database Isolation</h3><p>Neural Draft uses a database-per-tenant architecture. Each customer gets their own PostgreSQL database, providing complete data isolation.</p><h3>Why Database-Per-Tenant?</h3><ol><li><strong>Security</strong>: Customer data is physically separated</li><li><strong>Compliance</strong>: Easier to meet GDPR and data residency requirements</li><li><strong>Performance</strong>: No noisy neighbor problems</li><li><strong>Backup/Restore</strong>: Individual tenant backup and restore</li><li><strong>Customization</strong>: Per-tenant schema modifications if needed</li></ol><h3>Implementation with Spatie Multitenancy</h3><pre>// config/multitenancy.php<br>return [<br>    &#39;tenant_finder&#39; =&gt; \App\Multitenancy\CustomDomainTenantFinder::class,<br><br>    &#39;switch_tenant_tasks&#39; =&gt; [<br>        \Spatie\Multitenancy\Tasks\SwitchTenantDatabaseTask::class,<br>        \Spatie\Multitenancy\Tasks\PrefixCacheTask::class,<br>    ],<br><br>    &#39;tenant_model&#39; =&gt; Tenant::class,<br>    &#39;queues_are_tenant_aware_by_default&#39; =&gt; true,<br>    &#39;tenant_database_connection_name&#39; =&gt; &#39;tenant&#39;,<br>    &#39;landlord_database_connection_name&#39; =&gt; &#39;landlord&#39;,<br>];</pre><h3>Custom Domain Tenant Finder</h3><p>Users can have custom domains (e.g., blog.mycompany.com), so I built a custom tenant finder:</p><pre>class CustomDomainTenantFinder extends TenantFinder<br>{<br>    public function findForRequest(Request $request): ?Tenant<br>    {<br>        host = request-&gt;getHost();<br><br>        // Check for custom domain first<br>        tenant = Tenant::where(&#39;custom_domain&#39;, host)-&gt;first();<br><br>        if ($tenant) {<br>            return $tenant;<br>        }<br><br>        // Fall back to subdomain matching<br>        subdomain = explode(&#39;.&#39;, host)[0];<br>        return Tenant::where(&#39;subdomain&#39;, $subdomain)-&gt;first();<br>    }<br>}</pre><h3>Queue Tenant Awareness</h3><p>One tricky aspect is making background jobs tenant-aware. When a job is dispatched, it needs to remember which tenant it belongs to:</p><pre>// Jobs automatically capture tenant context<br>class GenerateVideoJob implements ShouldQueue<br>{<br>    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;<br><br>    public function __construct(<br>        public VideoProject $videoProject,<br>        public string $scenario,<br>        public int $sceneIndex<br>    ) {}<br><br>    public function handle(): void<br>    {<br>        // Tenant context is automatically restored by Spatie<br>        $videoService = VideoServiceFactory::getVideoService();<br>        videoService-&gt;generateVideo(this-&gt;scenario);<br>    }<br>}</pre><h3>Part 4: Video Generation Pipeline</h3><p>Neural Draft generates AI videos for social media using multiple video generation models. This required building a sophisticated job orchestration system.</p><h3>The Video Generation Flow</h3><pre>User Request → VideoProject Created → GenerateVideoJob (x3 scenes)<br>                                              ↓<br>                                    Replicate API (async)<br>                                              ↓<br>                                    MergeVideosJob<br>                                              ↓<br>                                    AddMusicJob<br>                                              ↓<br>                                    AddTextJob (subtitles)<br>                                              ↓<br>                                    Final Video Ready</pre><h3>The VideoServiceFactory</h3><p>Similar to the AI service factory, video generation supports multiple models:</p><pre>class VideoServiceFactory<br>{<br>    public static function getVideoService(?Tenant $tenant = null)<br>    {<br>        tenant = tenant ?? Tenant::current();<br>        settings = tenant-&gt;getCurrentAISettings();<br><br>        videoModel = settings?-&gt;video_model ?? &#39;minimax/video-01&#39;;<br><br>        // All models are handled by a unified service that configures itself<br>        return app(ReplicateSeedanceVideoService::class);<br>    }<br>}</pre><h3>The Video Generation Handler</h3><pre>class VideoGenerationHandler implements AIGenerationHandler<br>{<br>    public function process(AIGenerationTask $task): array<br>    {<br>        videoProject = VideoProject::find(task-&gt;metadata[&#39;video_project_id&#39;]);<br>        prompts = videoProject-&gt;prompts;<br><br>        // Limit to 3 prompts for 15-second video (3 x 5 seconds each)<br>        if (count($prompts) &gt; 3) {<br>            prompts = array_slice(prompts, 0, 3);<br>        }<br><br>        // Dispatch parallel video generation jobs<br>        foreach (prompts as $index =&gt; scene) {<br>            GenerateVideoJob::dispatch(<br>                $videoProject,<br>                $scene[&#39;scenario&#39;],<br>                $index,<br>                $videoProject-&gt;title,<br>                $videoProject-&gt;image_path<br>            );<br>        }<br><br>        return [<br>            &#39;success&#39; =&gt; true,<br>            &#39;status&#39; =&gt; &#39;jobs_dispatched&#39;,<br>            &#39;video_project_id&#39; =&gt; $videoProject-&gt;id,<br>        ];<br>    }<br>}</pre><h3>Part 5: N8N Workflow Integration</h3><p>For complex operations like generating entire websites, I use N8N (a workflow automation tool) to orchestrate multi-step processes.</p><h3>Why N8N?</h3><ol><li><strong>Visual Workflow Design</strong>: Complex flows are easier to understand</li><li><strong>Retry Logic</strong>: Built-in error handling and retries</li><li><strong>Parallel Execution</strong>: Run multiple AI calls simultaneously</li><li><strong>Webhook Integration</strong>: Easy callback handling</li></ol><h3>The Webhook Service</h3><pre>class N8nWebhookService<br>{<br>    public function triggerLandingPageGeneration(array data, string $tenantId, int userId): array<br>    {<br>        $callbackUrl = config(&#39;app.url&#39;) . &#39;/api/webhooks/n8n/landing-page/callback&#39;;<br><br>        $payload = [<br>            &#39;business_name&#39; =&gt; $data[&#39;business_name&#39;],<br>            &#39;industry&#39; =&gt; $data[&#39;industry&#39;],<br>            &#39;about_company&#39; =&gt; $data[&#39;about_company&#39;],<br>            &#39;logo_url&#39; =&gt; $data[&#39;logo_url&#39;],<br>            &#39;callback_url&#39; =&gt; $callbackUrl,<br>            &#39;tenant_id&#39; =&gt; $tenantId,<br>            &#39;user_id&#39; =&gt; $userId,<br>        ];<br><br>        webhookUrl = $this-&gt;getLandingPageWebhook(tenantId);<br><br>        $response = Http::timeout(10)<br>            -&gt;post(webhookUrl, payload);<br><br>        return [&#39;success&#39; =&gt; true, &#39;message&#39; =&gt; &#39;Generation started&#39;];<br>    }<br>}<br><br></pre><p>Environment-Aware Webhooks</p><p>Different webhooks for local development vs production:</p><pre>private function getLandingPageWebhook(?string $tenantId = null): string<br>{<br>    // Check for tenant-specific webhook<br>    if ($tenantId) {<br>        tenant = Tenant::find(tenantId);<br>        if ($tenant?-&gt;custom_n8n_landing_page_webhook_url) {<br>            return $tenant-&gt;custom_n8n_landing_page_webhook_url;<br>        }<br>    }<br><br>    // Environment-based fallback<br>    return $this-&gt;isLocalEnvironment()<br>        ? config(&#39;services.n8n.webhook_landing_page_local&#39;)<br>        : config(&#39;services.n8n.webhook_landing_page&#39;);<br>}</pre><h3>Part 6: Real-Time Progress Updates</h3><p>Users need to see progress when generating content (which can take 30+ seconds). I use Laravel Reverb for WebSocket communication.</p><h3>Broadcasting Progress Updates</h3><pre>class AIGenerationService<br>{<br>    public function updateTaskProgress(AIGenerationTask task, int $progress, string message): void<br>    {<br>        $task-&gt;update([<br>            &#39;progress&#39; =&gt; $progress,<br>            &#39;status_message&#39; =&gt; $message,<br>        ]);<br><br>        broadcast(new AIGenerationProgress(<br>            $task-&gt;id,<br>            $progress,<br>            $message,<br>            $task-&gt;metadata[&#39;steps&#39;] ?? []<br>        ))-&gt;toOthers();<br>    }<br>}</pre><h3>Frontend Integration (Vue.js)</h3><pre>// Listening for progress updates<br>Echo.private(`ai-generation.${taskId}`)<br>    .listen(&#39;AIGenerationProgress&#39;, (e) =&gt; {<br>        this.progress = e.progress;<br>        this.statusMessage = e.message;<br>        this.steps = e.steps;<br>    });<br><br></pre><h3>Lessons Learned</h3><h3>1. AI Provider Abstraction is Essential</h3><p>Don’t couple your code to a single AI provider. The landscape changes rapidly — new models launch monthly. The factory pattern saved me countless hours when adding Gemini support.</p><h3>2. Content Humanization is an Arms Race</h3><p>AI detectors improve constantly. The 6-iteration pipeline was overkill initially, but now it’s necessary. Build your humanization system to be extensible.</p><h3>3. Database-Per-Tenant Has Trade-offs</h3><p>Pros: Security, isolation, compliance</p><p>Cons: Migration complexity, connection management, higher infrastructure costs</p><p>For Neural Draft, the security benefits outweighed the operational complexity.</p><h3>4. Async Everything</h3><p>AI operations are slow. Never make users wait synchronously. Queue everything and provide real-time progress updates.</p><h3>5. Test with Real AI Calls</h3><p>Mocking AI responses doesn’t catch the weird edge cases. Budget for real API calls in your testing pipeline.</p><h3>What’s Next?</h3><p>Neural Draft continues to evolve. Current focus areas:</p><ol><li><strong>Agent-based content planning</strong>: AI agents that plan content calendars</li><li><strong>Multi-modal generation</strong>: Combining text, image, and video in single workflows</li><li><strong>Fine-tuned models</strong>: Training custom models on successful content</li><li><strong>Predictive analytics</strong>: AI-powered content performance prediction</li></ol><h3>Conclusion</h3><p>Building Neural Draft taught me that modern AI-powered SaaS requires thinking in systems, not features. The factory patterns, multi-tenant architecture, and humanization pipeline all work together to create something greater than the sum of its parts.</p><p>If you’re building something similar, I hope this deep dive helps you avoid some of the pitfalls I encountered. The code examples are simplified from the actual implementation, but the patterns are real and battle-tested.</p><p>Feel free to reach out if you have questions or want to discuss any of these patterns in more detail.</p><p><a href="https://neuraldraft.io/"><em>Neural Draft </em></a><em>is a multi-tenant SaaS platform for AI-powered content generation. Built with Laravel, Filament, and a lot of coffee.</em></p><p><a href="https://neuraldraft.io/">https://neuraldraft.io</a></p><p>#Laravel #AI #SaaS #MultiTenancy #OpenAI #Claude #PHP #Architecture #TechnicalDeepDive</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=baae918535b8" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/building-neural-draft-a-deep-dive-into-multi-ai-content-generation-architecture-baae918535b8">Building Neural Draft: A Deep Dive into Multi-AI Content Generation Architecture</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building My First Cross-Platform AI Tool: What I Learned]]></title>
            <link>https://itnext.io/building-my-first-cross-platform-ai-tool-what-i-learned-b5c30a31b21d?source=rss-51e16679109e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5c30a31b21d</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[prompt]]></category>
            <category><![CDATA[macos]]></category>
            <dc:creator><![CDATA[Vedran Balagovic]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 08:07:22 GMT</pubDate>
            <atom:updated>2025-07-10T10:09:09.287Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A developer’s guide to creating Chrome extensions and macOS apps that work together</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2aUHYp9o8VtBdZMoLP4eUA.png" /></figure><p>When I decided to build <a href="https://promptual.pro/">Promptual</a> — a tool that enhances AI prompts and everyday text — I faced a choice: Chrome extension or macOS app? Instead of picking one, I built both. Here’s what I learned along the way, and why you might want to consider a cross-platform approach for your next project.</p><h3>Why Build for Multiple Platforms?</h3><p>Text enhancement needs happen everywhere. Sometimes you’re crafting AI prompts in ChatGPT, other times you’re writing emails, messages, or documents. The Chrome extension excels at AI prompt improvement, while the macOS app’s global shortcut makes it perfect for enhancing any text instantly — emails, Slack messages, even tweets.</p><p><strong>The result?</strong> Even with just a handful of beta users, I already see clear use patterns: the Chrome extension gets heavy use for AI workflows, while the macOS app has become their go-to for everyday writing tasks. Users love having both options available depending on their context.</p><h3>Lesson 1: Start with Shared Architecture</h3><p>The biggest mistake I could have made was building two completely separate apps. Instead, I designed a shared backend that both platforms could use:</p><pre>// Shared API design<br>const PromptualAPI = {<br>  async enhancePrompt(prompt, userToken) {<br>    return fetch(&#39;/api/enhance&#39;, {<br>      method: &#39;POST&#39;,<br>      headers: { &#39;Authorization&#39;: `Bearer ${userToken}` },<br>      body: JSON.stringify({ prompt })<br>    });<br>  },<br>  <br>  async getUserQuota(userToken) {<br>    return fetch(&#39;/api/quota&#39;, {<br>      headers: { &#39;Authorization&#39;: `Bearer ${userToken}` }<br>    });<br>  }<br>};</pre><p><strong>Why this matters:</strong> Changes to AI models, pricing, or features only need to happen once in the backend. Both apps automatically benefit from improvements.</p><h3>Lesson 2: Embrace Platform Differences</h3><p>While the core logic is shared, the user experience should feel native to each platform:</p><h3>Chrome Extension: Seamless Integration</h3><pre>// Inject enhancement button into ChatGPT<br>const addEnhanceButton = () =&gt; {<br>  const textArea = document.querySelector(&#39;textarea&#39;);<br>  if (textArea &amp;&amp; !document.querySelector(&#39;.promptual-button&#39;)) {<br>    const button = document.createElement(&#39;button&#39;);<br>    button.textContent = &#39;✨ Enhance&#39;;<br>    button.className = &#39;promptual-button&#39;;<br>    button.onclick = () =&gt; enhanceCurrentPrompt();<br>    textArea.parentNode.appendChild(button);<br>  }<br>};</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*aVwnADOqvDW73sQHlr3ycQ.png" /></figure><h3>macOS App: Global Text Enhancement</h3><pre>// Global shortcut for instant text enhancement<br>func setupGlobalShortcut() {<br>    let shortcut = MASShortcut(keyCode: kVK_Space, modifierFlags: .command)<br>    MASShortcutMonitor.shared().register(shortcut) { [weak self] in<br>        self?.showEnhancementWindow()<br>    }<br>}</pre><p>The macOS app goes beyond AI prompts — with enhancement modes like Professional, Casual, Concise, Email, Formal, and Persuasive, users can improve any text instantly. Need to make a Slack message more professional? Cmd+Space, paste, enhance, done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0fQBugbnI4mX4StJ2xfGrw.png" /></figure><p><strong>Key insight:</strong> Don’t try to make both platforms identical. Users expect Chrome extensions to integrate with web pages and macOS apps to feel native. The global shortcut makes the macOS app perfect for everyday writing tasks beyond just AI prompts.</p><h3>Lesson 3: Security From Day One</h3><p>Even with a small user base, security matters. I learned this the hard way when I initially planned to call OpenAI directly from the client:</p><pre>// ❌ DON&#39;T DO THIS - Exposes API keys<br>const badApproach = async (prompt) =&gt; {<br>  const response = await fetch(&#39;https://api.openai.com/v1/chat/completions&#39;, {<br>    headers: { &#39;Authorization&#39;: &#39;Bearer sk-YOUR-KEY-HERE&#39; } // Exposed!<br>  });<br>};</pre><pre>// ✅ DO THIS - Secure backend proxy<br>const goodApproach = async (prompt) =&gt; {<br>  const response = await fetch(&#39;/api/enhance&#39;, {<br>    method: &#39;POST&#39;,<br>    headers: { &#39;Authorization&#39;: `Bearer ${userAuthToken}` },<br>    body: JSON.stringify({ prompt })<br>  });<br>};</pre><p><strong>Why this matters:</strong> API keys in client code can be extracted by anyone. A secure backend also lets you implement rate limiting and abuse prevention.</p><h3>Lesson 4: Simple Authentication Goes Far</h3><p>I used Firebase Auth because it handles the complex stuff (password reset, email verification) while giving me flexibility:</p><pre>// Chrome extension - uses Firebase SDK<br>import { getAuth, signInWithEmailAndPassword } from &#39;firebase/auth&#39;;</pre><pre>const auth = getAuth();<br>await signInWithEmailAndPassword(auth, email, password);</pre><pre>// macOS app - uses REST API for more control<br>func signIn(email: String, password: String) async {<br>    let url = URL(string: &quot;https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword&quot;)!<br>    // Handle authentication manually<br>}</pre><p><strong>Pro tip:</strong> SDKs are convenient but not always available. Learning the REST API gives you more control and makes your app more portable.</p><h3>Lesson 5: Start Simple with Payments</h3><p>Stripe made cross-platform billing surprisingly straightforward:</p><pre>// Same checkout flow works for both platforms<br>const createCheckoutSession = async (userId) =&gt; {<br>  const session = await stripe.checkout.sessions.create({<br>    customer_email: userEmail,<br>    payment_method_types: [&#39;card&#39;],<br>    line_items: [{<br>      price: &#39;price_pro_plan&#39;,<br>      quantity: 1,<br>    }],<br>    mode: &#39;subscription&#39;,<br>    success_url: platformSpecificSuccessUrl,<br>    cancel_url: platformSpecificCancelUrl,<br>  });<br>  <br>  return session.url;<br>};</pre><p><strong>What I learned:</strong> Hosted checkout pages eliminate most payment complexity. Webhooks handle the backend logic, and both apps just need to redirect users to the same checkout URL.</p><h3>Lesson 6: Build for Real Users Early</h3><p>Even with limited users, I learned valuable lessons:</p><ul><li><strong>Chrome users</strong> want seamless AI prompt enhancement right where they’re typing</li><li><strong>macOS users</strong> love the versatility — they use it for emails, messages, documents, and AI prompts</li><li><strong>Both</strong> appreciate seeing enhancement modes (Professional, Casual, Concise, etc.) tailored to their specific needs</li><li><strong>Everyone</strong> wants fast response times (I cache common enhancements)</li></ul><p>The macOS app’s global shortcut (Cmd+Space) became unexpectedly popular for everyday writing tasks, not just AI prompts.</p><h3>The Development Reality</h3><p>Building cross-platform isn’t twice the work — it’s about 1.5x the work if you architect it right. Here’s what actually takes time:</p><ul><li><strong>Platform-specific UI</strong>: 40% of development time</li><li><strong>Shared backend</strong>: 30% of development time</li><li><strong>Authentication &amp; payments</strong>: 20% of development time</li><li><strong>Testing &amp; deployment</strong>: 10% of development time</li></ul><h3>What I’d Do Differently</h3><ol><li><strong>Start with one platform</strong> to validate the idea, then expand</li><li><strong>Use TypeScript</strong> from the beginning for better code sharing</li><li><strong>Plan for offline usage</strong> (users hate when things break without internet)</li></ol><h3>Try Building Cross-Platform</h3><p>If you’re building developer tools, productivity apps, or AI-powered utilities, consider starting with a web extension and native app combo. The shared backend approach makes it surprisingly manageable.</p><p>The key insights:</p><ul><li><strong>Abstract your core logic</strong> so it can be reused</li><li><strong>Embrace platform conventions</strong> rather than fighting them</li><li><strong>Start with security</strong> rather than adding it later</li><li><strong>Test with real users</strong> as early as possible</li></ul><h3>Want to See It in Action?</h3><p>I’m still working on Promptual and would love feedback from fellow developers. You can check it out at <a href="https://promptual.pro/">promptual.pro</a> and see how the cross-platform approach works in practice. The Chrome extension focuses on AI prompt enhancement, while the macOS app has evolved into a versatile text improvement tool with modes for emails, documents, and everyday communication — all accessible with a simple Cmd+Shift+E shortcut.</p><p>Whether you’re building your first extension or thinking about going cross-platform, I hope these lessons help you avoid some of the mistakes I made along the way.</p><p><em>Building something similar? I’d love to hear about your approach. Connect with me on </em><a href="https://x.com/dr_terapeut"><em>Twitter</em></a><em> or check out the </em><a href="https://promptual.pro/"><em>Promptual website</em></a><em> for more details.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5c30a31b21d" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/building-my-first-cross-platform-ai-tool-what-i-learned-b5c30a31b21d">Building My First Cross-Platform AI Tool: What I Learned</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Truly Cross-Platform Flutter Applications: Desktop and Web Mastery]]></title>
            <link>https://itnext.io/building-truly-cross-platform-flutter-applications-desktop-and-web-mastery-8c359592c661?source=rss-51e16679109e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c359592c661</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-web]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[flutter-mac]]></category>
            <dc:creator><![CDATA[Vedran Balagovic]]></dc:creator>
            <pubDate>Sat, 24 May 2025 10:12:20 GMT</pubDate>
            <atom:updated>2025-05-27T18:54:10.868Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Most developers stop at iOS and Android. Here’s how to build Flutter apps that truly work everywhere.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hjIFvSXmt_IpY-E928vxwg.png" /></figure><p>Flutter has gained significant popularity for mobile app development, but its capabilities extend far beyond just Android and iOS. In this article, I’ll share insights from developing complex Flutter applications that run seamlessly across Windows, macOS, and web platforms. While mobile development with Flutter is well-documented, the desktop and web aspects often present unique challenges that aren’t widely discussed.</p><p>If you’ve ever wondered how to make your Flutter app feel truly native on every platform — not just “working” but actually belonging — this guide will show you exactly how.</p><h3>The Challenge of True Cross-Platform Development</h3><p>When we talk about cross-platform development, we often focus on Android and iOS. However, a truly cross-platform application should work across desktop operating systems and the web as well. This presents several unique challenges:</p><h3>1. Platform-Specific UI/UX Expectations</h3><p>Users expect applications to behave according to their platform’s conventions. A Windows user expects different interactions than a macOS user.</p><h3>2. Different Screen Sizes and Input Methods</h3><p>From touch screens to mouse and keyboard, each platform has different interaction paradigms.</p><h3>3. Platform-Specific Features</h3><p>System tray integration, window management, file system access — each platform offers unique capabilities.</p><h3>4. Web-Specific Limitations</h3><p>Browser security restrictions, lack of direct file system access, and performance considerations.</p><p>Let’s explore how to address these challenges using Flutter’s multiplatform capabilities.</p><h3>Architecture for Cross-Platform Success</h3><h3>Shared Core, Platform-Specific Shells</h3><p>One of the most effective approaches is to maintain a shared core codebase while implementing platform-specific shells. However, avoid this anti-pattern:</p><pre>// ❌ Bad: Hard to maintain and test<br>if (kIsWeb) {<br>  // Web-specific implementation<br>} else if (Platform.isWindows) {<br>  // Windows-specific implementation<br>} else if (Platform.isMacOS) {<br>  // macOS-specific implementation<br>}</pre><p>Instead, use dependency injection and abstract interfaces:</p><pre>// ✅ Good: Clean, testable architecture<br>abstract class PlatformService {<br>  factory PlatformService() {<br>    if (kIsWeb) {<br>      return WebServiceImpl();<br>    } else if (Platform.isWindows) {<br>      return WindowsServiceImpl();<br>    } else if (Platform.isMacOS) {<br>      return MacOSServiceImpl();<br>    }<br>    return DefaultServiceImpl();<br>  }<br><br>Future&lt;void&gt; performPlatformSpecificOperation();<br>  String get platformName;<br>  bool get supportsSystemTray;<br>}<br>// Platform-specific implementations<br>class WindowsServiceImpl implements PlatformService {<br>  @override<br>  Future&lt;void&gt; performPlatformSpecificOperation() async {<br>    // Windows-specific logic<br>  }<br>  @override<br>  String get platformName =&gt; &#39;Windows&#39;;<br>  @override<br>  bool get supportsSystemTray =&gt; true;<br>}<br>class WebServiceImpl implements PlatformService {<br>  @override<br>  Future&lt;void&gt; performPlatformSpecificOperation() async {<br>    // Web-specific logic using dart:html<br>  }<br>  @override<br>  String get platformName =&gt; &#39;Web&#39;;<br>  @override<br>  bool get supportsSystemTray =&gt; false;<br>}</pre><p>This pattern allows you to write platform-agnostic code that delegates to platform-specific implementations when needed, making your code much more maintainable and testable.</p><h3>Responsive UI Beyond Mobile Thinking</h3><p>Responsive design in Flutter isn’t just about adapting to different phone sizes. When targeting desktop and web, you need to consider much larger variations in screen real estate and completely different interaction patterns.</p><h3>Adaptive Layouts That Actually Work</h3><p>Create a responsive layout system that provides different implementations based on screen size and platform capabilities:</p><pre>class ResponsiveLayout extends StatelessWidget {<br>  final Widget mobile;<br>  final Widget tablet;<br>  final Widget desktop;<br>  final Widget? largeDesktop;<br><br>const ResponsiveLayout({<br>    Key? key,<br>    required this.mobile,<br>    required this.tablet,<br>    required this.desktop,<br>    this.largeDesktop,<br>  }) : super(key: key);<br>  @override<br>  Widget build(BuildContext context) {<br>    return LayoutBuilder(<br>      builder: (context, constraints) {<br>        // Ultra-wide desktop screens<br>        if (constraints.maxWidth &gt;= 1600 &amp;&amp; largeDesktop != null) {<br>          return largeDesktop!;<br>        }<br>        // Standard desktop<br>        else if (constraints.maxWidth &gt;= 1100) {<br>          return desktop;<br>        }<br>        // Tablet<br>        else if (constraints.maxWidth &gt;= 650) {<br>          return tablet;<br>        }<br>        // Mobile<br>        else {<br>          return mobile;<br>        }<br>      },<br>    );<br>  }<br>}<br>// Usage example<br>ResponsiveLayout(<br>  mobile: SingleColumnLayout(),<br>  tablet: TwoColumnLayout(),<br>  desktop: ThreeColumnLayout(),<br>  largeDesktop: FourColumnLayout(), // For ultra-wide monitors<br>)</pre><h3>Platform-Aware Input Handling</h3><p>Different platforms expect different interaction patterns:</p><pre>class PlatformAwareGestureDetector extends StatelessWidget {<br>  final Widget child;<br>  final VoidCallback? onTap;<br>  final VoidCallback? onSecondaryTap; // Right-click<br><br>  const PlatformAwareGestureDetector({<br>    Key? key,<br>    required this.child,<br>    this.onTap,<br>    this.onSecondaryTap,<br>  }) : super(key: key);<br>  @override<br>  Widget build(BuildContext context) {<br>    return GestureDetector(<br>      onTap: onTap,<br>      onSecondaryTap: kIsWeb || Platform.isWindows || Platform.isMacOS <br>          ? onSecondaryTap <br>          : null, // No right-click on mobile<br>      child: MouseRegion(<br>        cursor: (kIsWeb || Platform.isWindows || Platform.isMacOS) &amp;&amp; onTap != null<br>            ? SystemMouseCursors.click<br>            : SystemMouseCursors.basic,<br>        child: child,<br>      ),<br>    );<br>  }<br>}</pre><h3>Desktop-Specific Features That Matter</h3><h3>Professional Window Management</h3><p>For desktop applications, proper window management is crucial for a native feel:</p><pre>import &#39;package:window_manager/window_manager.dart&#39;;<br>class DesktopWindowSetup {<br>  static Future&lt;void&gt; initialize() async {<br>    if (!kIsWeb &amp;&amp; (Platform.isWindows || Platform.isMacOS || Platform.isLinux)) {<br>      await windowManager.ensureInitialized();<br>      const windowOptions = WindowOptions(<br>        size: Size(1200, 900),<br>        minimumSize: Size(800, 600),<br>        center: true,<br>        backgroundColor: Colors.transparent,<br>        skipTaskbar: false,<br>        titleBarStyle: TitleBarStyle.normal,<br>        windowButtonVisibility: true,<br>      );<br>      await windowManager.waitUntilReadyToShow(windowOptions, () async {<br>        await windowManager.show();<br>        await windowManager.focus();<br>      });<br>      // Set up window event handling<br>      windowManager.addListener(WindowEventListener());<br>    }<br>  }<br>}<br>class WindowEventListener extends WindowListener {<br>  @override<br>  void onWindowClose() async {<br>    // Handle window close event<br>    bool isPreventClose = await windowManager.isPreventClose();<br>    if (isPreventClose) {<br>      // Show confirmation dialog or save data<br>      showDialog(<br>        context: navigatorKey.currentContext!,<br>        builder: (context) =&gt; AlertDialog(<br>          title: const Text(&#39;Confirm Exit&#39;),<br>          content: const Text(&#39;Are you sure you want to exit?&#39;),<br>          actions: [<br>            TextButton(<br>              onPressed: () =&gt; Navigator.pop(context),<br>              child: const Text(&#39;Cancel&#39;),<br>            ),<br>            TextButton(<br>              onPressed: () async {<br>                Navigator.pop(context);<br>                await windowManager.destroy();<br>              },<br>              child: const Text(&#39;Exit&#39;),<br>            ),<br>          ],<br>        ),<br>      );<br>    }<br>  }<br>  @override<br>  void onWindowMinimize() {<br>    // Optionally minimize to system tray<br>    if (shouldMinimizeToTray) {<br>      windowManager.hide();<br>    }<br>  }<br>}</pre><h3>System Tray Integration Done Right</h3><p>Adding system tray support enhances the desktop experience significantly:</p><pre>import &#39;package:tray_manager/tray_manager.dart&#39;;<br>class SystemTraySetup extends TrayListener {<br>  static Future&lt;void&gt; initialize() async {<br>    if (!kIsWeb &amp;&amp; (Platform.isWindows || Platform.isMacOS)) {<br>      await trayManager.setIcon(<br>        Platform.isWindows<br>            ? &#39;assets/icons/app_icon.ico&#39; // Windows requires .ico<br>            : &#39;assets/icons/app_icon.png&#39;, // macOS uses .png<br>      );<br>      // Platform-specific configuration<br>      if (Platform.isWindows) {<br>        await trayManager.setToolTip(&#39;My Application&#39;);<br>      }<br>      await _buildTrayMenu();<br>      trayManager.addListener(SystemTraySetup());<br>    }<br>  }<br>  static Future&lt;void&gt; _buildTrayMenu() async {<br>    final List&lt;MenuItem&gt; items = [<br>      MenuItem(<br>        key: &#39;show_window&#39;,<br>        label: &#39;Open App&#39;,<br>      ),<br>      MenuItem.separator(),<br>      MenuItem(<br>        key: &#39;settings&#39;,<br>        label: &#39;Settings&#39;,<br>      ),<br>      MenuItem.separator(),<br>      MenuItem(<br>        key: &#39;exit&#39;,<br>        label: Platform.isWindows ? &#39;Exit&#39; : &#39;Quit&#39;, // Platform-specific terminology<br>      ),<br>    ];<br>    await trayManager.setContextMenu(Menu(items: items));<br>  }<br>  @override<br>  void onTrayIconMouseDown() {<br>    // Show window on tray icon click (Windows behavior)<br>    if (Platform.isWindows) {<br>      windowManager.show();<br>    }<br>  }<br>  @override<br>  void onTrayIconRightMouseDown() {<br>    // Show context menu on right-click (cross-platform)<br>    trayManager.popUpContextMenu();<br>  }<br>  @override<br>  void onTrayMenuItemClick(MenuItem menuItem) {<br>    switch (menuItem.key) {<br>      case &#39;show_window&#39;:<br>        windowManager.show();<br>        windowManager.focus();<br>        break;<br>      case &#39;settings&#39;:<br>        _showSettings();<br>        break;<br>      case &#39;exit&#39;:<br>        windowManager.close();<br>        break;<br>    }<br>  }<br>  void _showSettings() {<br>    // Show settings dialog or navigate to settings page<br>  }<br>}</pre><h3>Web Platform Mastery</h3><h3>Handling Web-Specific Features Gracefully</h3><p>Web applications have unique capabilities and limitations. Here’s how to handle them properly:</p><pre>// web_utils.dart - Platform-agnostic interface<br>abstract class WebUtils {<br>  static WebUtils? _instance;<br>  <br>  static WebUtils get instance {<br>    _instance ??= _createInstance();<br>    return _instance!;<br>  }<br><br>static WebUtils _createInstance() {<br>    if (kIsWeb) {<br>      return WebUtilsWeb();<br>    }<br>    return WebUtilsDefault();<br>  }<br>  String createBlobUrl(Uint8List data, String mimeType);<br>  void openInNewTab(String url);<br>  void downloadFile(Uint8List data, String filename, String mimeType);<br>  bool get supportsFileDownload;<br>}<br>// Default implementation for non-web platforms<br>class WebUtilsDefault implements WebUtils {<br>  @override<br>  String createBlobUrl(Uint8List data, String mimeType) {<br>    throw UnsupportedError(&#39;Blob URLs not supported on this platform&#39;);<br>  }<br>  @override<br>  void openInNewTab(String url) {<br>    // Could use url_launcher package for non-web platforms<br>    throw UnsupportedError(&#39;New tab not supported on this platform&#39;);<br>  }<br>  @override<br>  void downloadFile(Uint8List data, String filename, String mimeType) {<br>    // Could implement platform-specific file saving<br>    throw UnsupportedError(&#39;File download not supported on this platform&#39;);<br>  }<br>  @override<br>  bool get supportsFileDownload =&gt; false;<br>}</pre><pre>// web_utils_web.dart - Only compiled for web<br>import &#39;dart:html&#39; as html;<br>import &#39;dart:typed_data&#39;;<br><br>class WebUtilsWeb implements WebUtils {<br>  @override<br>  String createBlobUrl(Uint8List data, String mimeType) {<br>    final blob = html.Blob([data], mimeType);<br>    return html.Url.createObjectUrlFromBlob(blob);<br>  }<br>  @override<br>  void openInNewTab(String url) {<br>    html.window.open(url, &#39;_blank&#39;);<br>  }<br>  @override<br>  void downloadFile(Uint8List data, String filename, String mimeType) {<br>    final blob = html.Blob([data], mimeType);<br>    final url = html.Url.createObjectUrlFromBlob(blob);<br>    <br>    final anchor = html.AnchorElement(href: url)<br>      ..setAttribute(&#39;download&#39;, filename)<br>      ..click();<br>    <br>    // Clean up the blob URL<br>    html.Url.revokeObjectUrl(url);<br>  }<br>  @override<br>  bool get supportsFileDownload =&gt; true;<br>}</pre><p>Make your Flutter web app feel more like a native application:</p><pre>// Add to web/index.html in the &lt;head&gt; section<br>/*<br>&lt;link rel=&quot;manifest&quot; href=&quot;manifest.json&quot;&gt;<br>&lt;meta name=&quot;theme-color&quot; content=&quot;#000000&quot;&gt;<br>&lt;meta name=&quot;apple-mobile-web-app-capable&quot; content=&quot;yes&quot;&gt;<br>&lt;meta name=&quot;apple-mobile-web-app-status-bar-style&quot; content=&quot;black&quot;&gt;<br>&lt;meta name=&quot;apple-mobile-web-app-title&quot; content=&quot;My App&quot;&gt;<br>*/<br><br>// web/manifest.json<br>/*<br>{<br>  &quot;name&quot;: &quot;My Flutter App&quot;,<br>  &quot;short_name&quot;: &quot;MyApp&quot;,<br>  &quot;start_url&quot;: &quot;/&quot;,<br>  &quot;display&quot;: &quot;standalone&quot;,<br>  &quot;background_color&quot;: &quot;#ffffff&quot;,<br>  &quot;theme_color&quot;: &quot;#000000&quot;,<br>  &quot;icons&quot;: [<br>    {<br>      &quot;src&quot;: &quot;icons/Icon-192.png&quot;,<br>      &quot;sizes&quot;: &quot;192x192&quot;,<br>      &quot;type&quot;: &quot;image/png&quot;<br>    },<br>    {<br>      &quot;src&quot;: &quot;icons/Icon-512.png&quot;,<br>      &quot;sizes&quot;: &quot;512x512&quot;,<br>      &quot;type&quot;: &quot;image/png&quot;<br>    }<br>  ]<br>}<br>*/<br><br>class PWAService {<br>  static Future&lt;void&gt; initialize() async {<br>    if (kIsWeb) {<br>      // Register service worker for offline support<br>      await _registerServiceWorker();<br>      <br>      // Check if app can be installed<br>      _checkInstallPrompt();<br>    }<br>  }<br>  static Future&lt;void&gt; _registerServiceWorker() async {<br>    // Service worker registration logic<br>  }<br>  static void _checkInstallPrompt() {<br>    // Check for PWA install prompt<br>  }<br>}</pre><h3>Advanced Navigation and Routing</h3><p>A robust routing system is essential for multiplatform applications, especially for web where users expect URL-based navigation:</p><pre>import &#39;package:go_router/go_router.dart&#39;;<br>class AppRouter {<br>  static final GoRouter router = GoRouter(<br>    initialLocation: &#39;/home&#39;,<br>    debugLogDiagnostics: true,<br>    routes: [<br>      // Shell route for main app layout<br>      ShellRoute(<br>        builder: (context, state, child) {<br>          return AppShellLayout(child: child);<br>        },<br>        routes: [<br>          GoRoute(<br>            path: &#39;/home&#39;,<br>            name: &#39;home&#39;,<br>            pageBuilder: (context, state) =&gt; _buildPage(<br>              child: const HomeScreen(),<br>              state: state,<br>            ),<br>          ),<br>          GoRoute(<br>            path: &#39;/settings&#39;,<br>            name: &#39;settings&#39;,<br>            pageBuilder: (context, state) =&gt; _buildPage(<br>              child: const SettingsScreen(),<br>              state: state,<br>            ),<br>            routes: [<br>              // Nested route for settings sub-pages<br>              GoRoute(<br>                path: &#39;/profile&#39;,<br>                name: &#39;profile&#39;,<br>                pageBuilder: (context, state) =&gt; _buildPage(<br>                  child: const ProfileScreen(),<br>                  state: state,<br>                ),<br>              ),<br>            ],<br>          ),<br>        ],<br>      ),<br>    ],<br>    errorBuilder: (context, state) =&gt; ErrorScreen(<br>      error: state.error.toString(),<br>    ),<br>  );<br>  static Page&lt;dynamic&gt; _buildPage({<br>    required Widget child,<br>    required GoRouterState state,<br>  }) {<br>    // Use different transitions based on platform<br>    if (kIsWeb || Platform.isWindows || Platform.isMacOS) {<br>      // No transition for desktop/web<br>      return NoTransitionPage(<br>        key: state.pageKey,<br>        child: child,<br>      );<br>    } else {<br>      // Mobile-style transition<br>      return MaterialPage(<br>        key: state.pageKey,<br>        child: child,<br>      );<br>    }<br>  }<br>}<br>// Custom no-transition page for desktop<br>class NoTransitionPage extends Page&lt;void&gt; {<br>  const NoTransitionPage({<br>    required this.child,<br>    super.key,<br>  });<br>  final Widget child;<br>  @override<br>  Route&lt;void&gt; createRoute(BuildContext context) {<br>    return PageRouteBuilder&lt;void&gt;(<br>      settings: this,<br>      pageBuilder: (context, animation, _) =&gt; child,<br>      transitionDuration: Duration.zero,<br>      reverseTransitionDuration: Duration.zero,<br>    );<br>  }<br>}</pre><p>For web platforms, configure URL strategy:</p><pre>import &#39;package:flutter_web_plugins/url_strategy.dart&#39;;<br><br>void main() {<br>  if (kIsWeb) {<br>    // Use path-based URLs instead of hash-based for better SEO<br>    usePathUrlStrategy();<br>  }<br>  <br>  runApp(MyApp());<br>}</pre><h3>Testing Across Platforms</h3><p>Testing a multiplatform application requires a comprehensive approach:</p><h3>1. Unit Tests for Platform Services</h3><pre>// test/platform_service_test.dart<br>import &#39;package:flutter_test/flutter_test.dart&#39;;<br>// Simple test without external dependencies<br>void main() {<br>  group(&#39;PlatformService&#39;, () {<br>    late PlatformService platformService;<br>    setUp(() {<br>      platformService = PlatformService();<br>    });<br>    test(&#39;should return correct platform name&#39;, () {<br>      expect(platformService.platformName, isNotEmpty);<br>    });<br>    test(&#39;should handle platform-specific operations&#39;, () async {<br>      // Test actual platform implementation<br>      expect(() async =&gt; await platformService.performPlatformSpecificOperation(), <br>             returnsNormally);<br>    });<br>    test(&#39;should correctly identify platform capabilities&#39;, () {<br>      if (kIsWeb) {<br>        expect(platformService.supportsSystemTray, isFalse);<br>      } else if (Platform.isWindows || Platform.isMacOS) {<br>        expect(platformService.supportsSystemTray, isTrue);<br>      }<br>    });<br>  });<br>}</pre><h3>2. Widget Tests with Platform Mocking</h3><pre>// test/responsive_layout_test.dart<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter_test/flutter_test.dart&#39;;<br><br>void main() {<br>  group(&#39;ResponsiveLayout&#39;, () {<br>    testWidgets(&#39;should show mobile layout on small screens&#39;, (tester) async {<br>      await tester.pumpWidget(<br>        MaterialApp(<br>          home: ResponsiveLayout(<br>            mobile: const Text(&#39;Mobile&#39;),<br>            tablet: const Text(&#39;Tablet&#39;),<br>            desktop: const Text(&#39;Desktop&#39;),<br>          ),<br>        ),<br>      );<br>      // Set small screen size<br>      await tester.binding.setSurfaceSize(const Size(400, 800));<br>      await tester.pumpAndSettle();<br>      expect(find.text(&#39;Mobile&#39;), findsOneWidget);<br>      expect(find.text(&#39;Tablet&#39;), findsNothing);<br>      expect(find.text(&#39;Desktop&#39;), findsNothing);<br>    });<br>    testWidgets(&#39;should show desktop layout on large screens&#39;, (tester) async {<br>      await tester.pumpWidget(<br>        MaterialApp(<br>          home: ResponsiveLayout(<br>            mobile: const Text(&#39;Mobile&#39;),<br>            tablet: const Text(&#39;Tablet&#39;),<br>            desktop: const Text(&#39;Desktop&#39;),<br>          ),<br>        ),<br>      );<br>      // Set large screen size<br>      await tester.binding.setSurfaceSize(const Size(1200, 800));<br>      await tester.pumpAndSettle();<br>      expect(find.text(&#39;Desktop&#39;), findsOneWidget);<br>      expect(find.text(&#39;Mobile&#39;), findsNothing);<br>      expect(find.text(&#39;Tablet&#39;), findsNothing);<br>    });<br>  });<br>}</pre><h3>3. Integration Tests</h3><pre>// integration_test/app_test.dart<br>import &#39;package:flutter/foundation.dart&#39;;<br>import &#39;package:flutter_test/flutter_test.dart&#39;;<br>import &#39;package:integration_test/integration_test.dart&#39;;<br>import &#39;package:my_app/main.dart&#39; as app;<br><br>void main() {<br>  IntegrationTestWidgetsFlutterBinding.ensureInitialized();<br>  group(&#39;App Integration Tests&#39;, () {<br>    testWidgets(&#39;should navigate between screens&#39;, (tester) async {<br>      app.main();<br>      await tester.pumpAndSettle();<br>      // Test platform-specific navigation<br>      if (kIsWeb || defaultTargetPlatform == TargetPlatform.windows) {<br>        // Desktop-specific tests<br>        await tester.tap(find.byTooltip(&#39;Settings&#39;));<br>      } else {<br>        // Mobile-specific tests<br>        await tester.tap(find.byIcon(Icons.settings));<br>      }<br>      await tester.pumpAndSettle();<br>      expect(find.text(&#39;Settings&#39;), findsOneWidget);<br>    });<br>  });<br>}</pre><h3>Deployment Considerations</h3><p>Each platform has its own deployment process and requirements: (the deployment article incoming)</p><h3>Windows Deployment</h3><pre># pubspec.yaml<br>flutter:<br>  # ... other configuration<br>  <br>msix_config:<br>  display_name: My Flutter App<br>  publisher_display_name: My Company<br>  identity_name: com.mycompany.myapp<br>  msix_version: 1.0.0.0<br>  logo_path: assets\icons\app_icon.png<br>  capabilities: &#39;internetClient,microphone,webcam&#39;</pre><h3>macOS Deployment</h3><pre># macos/Runner/Info.plist additions<br>&lt;key&gt;NSMicrophoneUsageDescription&lt;/key&gt;<br>&lt;string&gt;This app needs microphone access for voice features&lt;/string&gt;<br>&lt;key&gt;NSCameraUsageDescription&lt;/key&gt;<br>&lt;string&gt;This app needs camera access for video features&lt;/string&gt;</pre><h3>Web Deployment</h3><pre># .github/workflows/web-deploy.yml<br>name: Deploy to Web<br>on:<br>  push:<br>    branches: [ main ]<br>jobs:<br>  build-and-deploy:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - uses: actions/checkout@v2<br>      - uses: subosito/flutter-action@v2<br>        with:<br>          flutter-version: &#39;3.16.0&#39;<br>      - run: flutter build web --release<br>      - uses: peaceiris/actions-gh-pages@v3<br>        with:<br>          github_token: ${{ secrets.GITHUB_TOKEN }}<br>          publish_dir: ./build/web</pre><h3>Performance Optimization Across Platforms</h3><h3>Platform-Specific Optimizations</h3><pre>class PerformanceOptimizer {<br>  static void initialize() {<br>    if (kIsWeb) {<br>      _optimizeForWeb();<br>    } else if (Platform.isWindows || Platform.isMacOS) {<br>      _optimizeForDesktop();<br>    } else {<br>      _optimizeForMobile();<br>    }<br>  }<br><br>static void _optimizeForWeb() {<br>    // Web-specific optimizations<br>    // - Lazy load images<br>    // - Use efficient list rendering<br>    // - Minimize JavaScript interop<br>  }<br>  static void _optimizeForDesktop() {<br>    // Desktop-specific optimizations<br>    // - Enable hardware acceleration<br>    // - Optimize for larger screen redraws<br>    // - Efficient window management<br>  }<br>  static void _optimizeForMobile() {<br>    // Mobile-specific optimizations<br>    // - Battery usage optimization<br>    // - Memory management<br>    // - Touch interaction optimization<br>  }<br>}</pre><h3>Common Pitfalls and How to Avoid Them</h3><h3>❌ Don’t Do This:</h3><pre>// Bad: Platform checks scattered throughout UI code<br>Widget build(BuildContext context) {<br>  if (Platform.isWindows) {<br>    return WindowsSpecificWidget();<br>  } else if (Platform.isMacOS) {<br>    return MacOSSpecificWidget();<br>  }<br>  return DefaultWidget();<br>}</pre><h3>✅ Do This Instead:</h3><pre>// Good: Abstract platform differences away<br>Widget build(BuildContext context) {<br>  return PlatformAdaptiveWidget(<br>    child: MyContent(),<br>  );<br>}<br><br>class PlatformAdaptiveWidget extends StatelessWidget {<br>  final Widget child;<br>  <br>  const PlatformAdaptiveWidget({Key? key, required this.child}) : super(key: key);<br>  @override<br>  Widget build(BuildContext context) {<br>    return PlatformService.instance.adaptWidget(child);<br>  }<br>}</pre><h3>Conclusion</h3><p>Building a truly cross-platform Flutter application that targets Windows, macOS, and web requires careful architecture, platform-specific considerations, and attention to detail. By using the patterns and techniques described in this article, you can create applications that not only run on multiple platforms but feel native to each one.</p><h3>Key Takeaways:</h3><ol><li><strong>Use abstract interfaces</strong> with platform-specific implementations instead of scattered platform checks</li><li><strong>Create truly responsive layouts</strong> that adapt to different form factors and input methods</li><li><strong>Implement platform-specific features</strong> like window management and system tray integration thoughtfully</li><li><strong>Handle web-specific limitations</strong> and capabilities with conditional imports and graceful fallbacks</li><li><strong>Design robust routing systems</strong> that work well across all platforms</li><li><strong>Test thoroughly</strong> on all target platforms with appropriate testing strategies</li><li><strong>Plan deployment early</strong> and understand each platform’s requirements</li><li><strong>Optimize for each platform’s</strong> strengths and constraints</li></ol><p>With Flutter’s growing support for desktop and web platforms, it’s becoming an increasingly powerful tool for building applications that truly work everywhere. The investment in proper multiplatform architecture pays off in maintainability, user experience, and development velocity.</p><p><strong>The future of app development is multiplatform, and Flutter is leading the way.</strong></p><h3>About the Author</h3><p><strong>I’m a seasoned Flutter developer specializing in cross-platform applications and multiplatform architecture.</strong> With extensive experience building Flutter apps that run seamlessly across mobile, desktop, and web platforms, I help teams navigate the unique challenges of true cross-platform development.</p><p>My expertise includes:</p><ul><li><strong>Multiplatform Flutter architecture</strong> and design patterns</li><li><strong>Desktop application development</strong> with native-feeling user experiences</li><li><strong>Progressive Web App development</strong> with Flutter</li><li><strong>Platform-specific integrations</strong> while maintaining code reusability</li><li><strong>Performance optimization</strong> across different platforms and form factors</li></ul><p><strong>Building a multiplatform Flutter app or facing platform-specific challenges?</strong> I offer consulting services to help you:</p><ul><li><strong>Design scalable multiplatform architecture</strong> from the ground up</li><li><strong>Implement platform-specific features</strong> without breaking code maintainability</li><li><strong>Optimize performance</strong> for each target platform</li><li><strong>Navigate deployment complexities</strong> across app stores and web hosting</li><li><strong>Establish testing strategies</strong> for multiplatform applications</li></ul><p>Whether you’re expanding from mobile to desktop, building a PWA, or starting a greenfield multiplatform project, I’m here to help you build applications that feel native everywhere they run.</p><p>📧 <strong>Available for consulting projects</strong> — <a href="/service/mailto:vedran.balagovic@gmail.com">Contact me</a> or connect on <a href="https://www.linkedin.com/in/vedran-balagovic">LinkedIn</a></p><p><em>Found this helpful? Give it a clap and share it with other developers building cross-platform applications. Follow me for more deep-dive Flutter content and multiplatform development insights.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c359592c661" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/building-truly-cross-platform-flutter-applications-desktop-and-web-mastery-8c359592c661">Building Truly Cross-Platform Flutter Applications: Desktop and Web Mastery</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing the iOS 15 WebView Zero Frame Issue in Flutter InAppWebView: A Complete Solution]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://itnext.io/fixing-the-ios-15-webview-zero-frame-issue-in-flutter-inappwebview-a-complete-solution-08093d0d9cc2?source=rss-51e16679109e------2"><img src="https://cdn-images-1.medium.com/max/1536/1*pAltz__89Fe4Q6AQPXNLtg.png" width="1536"></a></p><p class="medium-feed-snippet">When iOS 15 broke your WebViews and left users staring at blank screens or even crashes the app, this is how we fixed it.</p><p class="medium-feed-link"><a href="https://itnext.io/fixing-the-ios-15-webview-zero-frame-issue-in-flutter-inappwebview-a-complete-solution-08093d0d9cc2?source=rss-51e16679109e------2">Continue reading on ITNEXT »</a></p></div>]]></description>
            <link>https://itnext.io/fixing-the-ios-15-webview-zero-frame-issue-in-flutter-inappwebview-a-complete-solution-08093d0d9cc2?source=rss-51e16679109e------2</link>
            <guid isPermaLink="false">https://medium.com/p/08093d0d9cc2</guid>
            <category><![CDATA[inappwebview]]></category>
            <category><![CDATA[ios15]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Vedran Balagovic]]></dc:creator>
            <pubDate>Sat, 24 May 2025 09:59:49 GMT</pubDate>
            <atom:updated>2026-03-13T10:52:45.001Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Flutter Performance Optimization: 10 Techniques That Actually Work in 2025]]></title>
            <link>https://itnext.io/flutter-performance-optimization-10-techniques-that-actually-work-in-2025-4def9e5bbd2d?source=rss-51e16679109e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4def9e5bbd2d</guid>
            <category><![CDATA[consulting]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter-performance]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Vedran Balagovic]]></dc:creator>
            <pubDate>Sat, 24 May 2025 09:41:33 GMT</pubDate>
            <atom:updated>2025-05-25T07:56:59.319Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Your users don’t care about your beautiful UI if your app feels like it’s running through molasses.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gN_u8tlp87Y13taJx8qDaQ.png" /></figure><p>Picture this: You’ve spent weeks crafting the perfect Flutter app. The design is stunning, the features are solid, but there’s one problem — it’s slow. Users are complaining about lag, your animations are choppy, and you’re losing downloads faster than you can count them.</p><p>Sound familiar? You’re not alone.</p><p>After optimizing dozens of Flutter apps and helping developers fix performance nightmares, I’ve discovered that <strong>most performance issues come from just 10 common mistakes</strong>. Fix these, and you’ll see dramatic improvements in your app’s speed and user experience.</p><p>Let’s dive into the techniques that actually move the needle.</p><h3>Why Flutter Performance Matters More Than Ever</h3><p>Before we jump into solutions, let’s get real about why this matters:</p><ul><li><strong>53% of users abandon apps</strong> that take longer than 3 seconds to load</li><li><strong>Poor performance directly impacts</strong> your app store ratings</li><li><strong>Smooth 60fps animations</strong> are now the minimum expectation, not a luxury</li><li><strong>Memory-efficient apps</strong> survive longer on users’ devices</li></ul><p>The good news? Flutter gives us incredible tools to build performant apps. The bad news? It’s easy to misuse them.</p><h3>🚀 Technique #1: Master the const Keyword</h3><p><strong>The Problem:</strong> Your widgets are rebuilding unnecessarily, killing performance.</p><p><strong>The Solution:</strong> Use const constructors religiously.</p><pre>// ❌ Bad: Widget rebuilds every time<br>Container(<br>  padding: EdgeInsets.all(16.0),<br>  child: Text(&#39;Hello World&#39;),<br>)</pre><pre>// ✅ Good: Widget is cached and reused<br>const Container(<br>  padding: EdgeInsets.all(16.0),<br>  child: const Text(&#39;Hello World&#39;),<br>)</pre><p><strong>Why it works:</strong> The const keyword tells Flutter this widget will never change, so it can be cached and reused instead of rebuilt. This can reduce widget rebuilds by up to 70%.</p><p><strong>Pro tip:</strong> Enable the prefer_const_constructors lint rule in your analysis_options.yaml to catch these automatically.</p><h3>🎯 Technique #2: Optimize Your Widget Tree Structure</h3><p><strong>The Problem:</strong> Deep widget trees cause cascade rebuilds.</p><p><strong>The Solution:</strong> Break large widgets into smaller, focused components.</p><pre>// ❌ Bad: Everything rebuilds when counter changes<br>class BadHomePage extends StatefulWidget {<br>  @override<br>  _BadHomePageState createState() =&gt; _BadHomePageState();<br>}<br><br>class _BadHomePageState extends State&lt;BadHomePage&gt; {<br>  int _counter = 0;<br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      appBar: AppBar(title: Text(&#39;My App&#39;)), // Rebuilds unnecessarily<br>      body: Column(<br>        children: [<br>          ExpensiveHeader(), // Rebuilds unnecessarily<br>          Text(&#39;Counter: $_counter&#39;),<br>          ExpensiveFooter(), // Rebuilds unnecessarily<br>        ],<br>      ),<br>      floatingActionButton: FloatingActionButton(<br>        onPressed: () =&gt; setState(() =&gt; _counter++),<br>        child: Icon(Icons.add),<br>      ),<br>    );<br>  }<br>}<br>// ✅ Good: Only counter widget rebuilds<br>class GoodHomePage extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      appBar: AppBar(title: const Text(&#39;My App&#39;)),<br>      body: Column(<br>        children: [<br>          const ExpensiveHeader(), // Won&#39;t rebuild<br>          CounterWidget(), // Only this rebuilds<br>          const ExpensiveFooter(), // Won&#39;t rebuild<br>        ],<br>      ),<br>    );<br>  }<br>}<br>class CounterWidget extends StatefulWidget {<br>  @override<br>  _CounterWidgetState createState() =&gt; _CounterWidgetState();<br>}<br>class _CounterWidgetState extends State&lt;CounterWidget&gt; {<br>  int _counter = 0;<br>  @override<br>  Widget build(BuildContext context) {<br>    return Column(<br>      children: [<br>        Text(&#39;Counter: $_counter&#39;),<br>        FloatingActionButton(<br>          onPressed: () =&gt; setState(() =&gt; _counter++),<br>          child: Icon(Icons.add),<br>        ),<br>      ],<br>    );<br>  }<br>}</pre><p><strong>Impact:</strong> This technique alone can improve rebuild performance by 60–80% in complex UIs.</p><h3>🔄 Technique #3: Smart State Management</h3><p><strong>The Problem:</strong> Using setState() everywhere causes unnecessary rebuilds.</p><p><strong>The Solution:</strong> Choose the right state management for your needs.</p><pre>// ❌ Bad: setState rebuilds entire widget tree<br>class BadShoppingCart extends StatefulWidget {<br>  @override<br>  _BadShoppingCartState createState() =&gt; _BadShoppingCartState();<br>}<br><br>class _BadShoppingCartState extends State&lt;BadShoppingCart&gt; {<br>  List&lt;Product&gt; _items = [];<br>  <br>  @override<br>  Widget build(BuildContext context) {<br>    return ListView.builder(<br>      itemCount: _items.length,<br>      itemBuilder: (context, index) {<br>        return ProductCard(product: _items[index]); // All cards rebuild<br>      },<br>    );<br>  }<br>}<br>// ✅ Good: Using Riverpod for granular updates<br>final cartProvider = StateNotifierProvider&lt;CartNotifier, List&lt;Product&gt;&gt;((ref) {<br>  return CartNotifier();<br>});<br>class GoodShoppingCart extends ConsumerWidget {<br>  @override<br>  Widget build(BuildContext context, WidgetRef ref) {<br>    final items = ref.watch(cartProvider);<br>    <br>    return ListView.builder(<br>      itemCount: items.length,<br>      itemBuilder: (context, index) {<br>        return ProductCard(product: items[index]); // Only changed cards rebuild<br>      },<br>    );<br>  }<br>}</pre><p><strong>Recommendation:</strong> Use Riverpod for new projects, Provider for existing ones, BLoC for complex business logic.</p><h3>🖼️ Technique #4: Optimize Image Loading</h3><p><strong>The Problem:</strong> Images are eating your memory and causing jank.</p><p><strong>The Solution:</strong> Implement smart image loading strategies.</p><pre>// ❌ Bad: Loads full-size images<br>Image.network(&#39;https://example.com/huge-image.jpg&#39;)<br><br>// ✅ Good: Optimized image loading<br>CachedNetworkImage(<br>  imageUrl: &#39;https://example.com/huge-image.jpg&#39;,<br>  width: 200,<br>  height: 200,<br>  fit: BoxFit.cover,<br>  placeholder: (context, url) =&gt; const CircularProgressIndicator(),<br>  errorWidget: (context, url, error) =&gt; const Icon(Icons.error),<br>  memCacheWidth: 200, // Resizes in memory to save RAM<br>  memCacheHeight: 200, // Separate from network bandwidth savings<br>)</pre><p><strong>Additional tips:</strong></p><ul><li>Use WebP format when possible (30% smaller than JPEG)</li><li>Implement lazy loading for image lists</li><li>Preload critical images</li><li><strong>memCacheWidth/Height</strong> optimize memory usage, not download size</li></ul><h3>⚡ Technique #5: Implement Lazy Loading</h3><p><strong>The Problem:</strong> Loading all data at once blocks the UI.</p><p><strong>The Solution:</strong> Load content as needed.</p><pre>// ✅ Lazy loading implementation<br>class LazyProductList extends StatefulWidget {<br>  @override<br>  _LazyProductListState createState() =&gt; _LazyProductListState();<br>}<br><br>class _LazyProductListState extends State&lt;LazyProductList&gt; {<br>  final List&lt;Product&gt; _products = [];<br>  bool _isLoading = false;<br>  final ScrollController _scrollController = ScrollController();<br>  @override<br>  void initState() {<br>    super.initState();<br>    _loadProducts();<br>    _scrollController.addListener(_onScroll);<br>  }<br>  void _onScroll() {<br>    if (_scrollController.position.pixels == <br>        _scrollController.position.maxScrollExtent &amp;&amp; !_isLoading) {<br>      _loadProducts();<br>    }<br>  }<br>  Future&lt;void&gt; _loadProducts() async {<br>    setState(() =&gt; _isLoading = true);<br>    <br>    // Simulate API call<br>    await Future.delayed(Duration(seconds: 1));<br>    final newProducts = await ProductAPI.getProducts(_products.length, 20);<br>    <br>    setState(() {<br>      _products.addAll(newProducts);<br>      _isLoading = false;<br>    });<br>  }<br>  @override<br>  Widget build(BuildContext context) {<br>    return ListView.builder(<br>      controller: _scrollController,<br>      itemCount: _products.length + (_isLoading ? 1 : 0),<br>      itemBuilder: (context, index) {<br>        if (index == _products.length) {<br>          return const Center(child: CircularProgressIndicator());<br>        }<br>        return ProductCard(product: _products[index]);<br>      },<br>    );<br>  }<br>}</pre><h3>🧵 Technique #6: Use Isolates for Heavy Computing</h3><p><strong>The Problem:</strong> CPU-intensive tasks block the UI thread.</p><p><strong>The Solution:</strong> Offload heavy work to isolates.</p><pre>// ❌ Bad: Blocks UI thread<br>List&lt;int&gt; processLargeDataset(List&lt;int&gt; data) {<br>  // Heavy computation that freezes the app<br>  return data.map((item) =&gt; expensiveCalculation(item)).toList();<br>}<br><br>// ✅ Good: Uses isolate<br>Future&lt;List&lt;int&gt;&gt; processLargeDatasetInIsolate(List&lt;int&gt; data) async {<br>  return await compute(processLargeDataset, data);<br>}<br>// Usage<br>class DataProcessingWidget extends StatefulWidget {<br>  @override<br>  _DataProcessingWidgetState createState() =&gt; _DataProcessingWidgetState();<br>}<br>class _DataProcessingWidgetState extends State&lt;DataProcessingWidget&gt; {<br>  bool _isProcessing = false;<br>  List&lt;int&gt; _results = [];<br>  Future&lt;void&gt; _processData() async {<br>    setState(() =&gt; _isProcessing = true);<br>    <br>    final largeDataset = List.generate(1000000, (index) =&gt; index);<br>    final results = await processLargeDatasetInIsolate(largeDataset);<br>    <br>    setState(() {<br>      _results = results;<br>      _isProcessing = false;<br>    });<br>  }<br>  @override<br>  Widget build(BuildContext context) {<br>    return Column(<br>      children: [<br>        if (_isProcessing)<br>          const CircularProgressIndicator()<br>        else<br>          ElevatedButton(<br>            onPressed: _processData,<br>            child: const Text(&#39;Process Data&#39;),<br>          ),<br>        Expanded(<br>          child: ListView.builder(<br>            itemCount: _results.length,<br>            itemBuilder: (context, index) =&gt; Text(&#39;${_results[index]}&#39;),<br>          ),<br>        ),<br>      ],<br>    );<br>  }<br>}</pre><h3>📱 Technique #7: Optimize ListView Performance</h3><p><strong>The Problem:</strong> Large lists cause memory issues and scroll jank.</p><p><strong>The Solution:</strong> Use ListView.builder with proper optimization.</p><pre>// ✅ Optimized ListView implementation<br>class OptimizedListView extends StatelessWidget {<br>  final List&lt;String&gt; items;<br><br>const OptimizedListView({Key? key, required this.items}) : super(key: key);<br>  @override<br>  Widget build(BuildContext context) {<br>    return ListView.builder(<br>      // Only build visible items + buffer<br>      itemCount: items.length,<br>      // Fixed item height improves performance (only use if items are uniform height)<br>      itemExtent: 80.0, // ⚠️ Warning: Only use if all items have same height<br>      // Reduce overscroll for better performance<br>      physics: const ClampingScrollPhysics(),<br>      // Cache extent for smoother scrolling<br>      cacheExtent: 200.0,<br>      itemBuilder: (context, index) {<br>        return OptimizedListItem(<br>          key: ValueKey(items[index]), // Stable keys for item identity<br>          title: items[index],<br>        );<br>      },<br>    );<br>  }<br>}<br>class OptimizedListItem extends StatelessWidget {<br>  final String title;<br>  const OptimizedListItem({Key? key, required this.title}) : super(key: key);<br>  @override<br>  Widget build(BuildContext context) {<br>    return Container(<br>      height: 80,<br>      padding: const EdgeInsets.all(16),<br>      child: Row(<br>        children: [<br>          const Icon(Icons.person), // const for better performance<br>          const SizedBox(width: 16),<br>          Expanded(child: Text(title)),<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><h3>🎨 Technique #8: Optimize Animations</h3><p><strong>The Problem:</strong> Janky animations ruin user experience.</p><p><strong>The Solution:</strong> Use efficient animation techniques.</p><pre>// ✅ Optimized animation implementation<br>class OptimizedAnimation extends StatefulWidget {<br>  @override<br>  _OptimizedAnimationState createState() =&gt; _OptimizedAnimationState();<br>}<br><br>class _OptimizedAnimationState extends State&lt;OptimizedAnimation&gt;<br>    with SingleTickerProviderStateMixin {<br>  late AnimationController _controller;<br>  late Animation&lt;double&gt; _animation;<br>  @override<br>  void initState() {<br>    super.initState();<br>    _controller = AnimationController(<br>      duration: const Duration(milliseconds: 300),<br>      vsync: this,<br>    );<br>    <br>    // Use Curves for natural animations<br>    _animation = CurvedAnimation(<br>      parent: _controller,<br>      curve: Curves.easeInOut,<br>    );<br>  }<br>  @override<br>  Widget build(BuildContext context) {<br>    return AnimatedBuilder(<br>      animation: _animation,<br>      builder: (context, child) {<br>        return Transform.translate(<br>          offset: Offset(0, 100 * (1 - _animation.value)),<br>          child: Opacity(<br>            opacity: _animation.value,<br>            child: child, // Child is passed to avoid rebuilding<br>          ),<br>        );<br>      },<br>      child: const ExpensiveWidget(), // Built only once<br>    );<br>  }<br>  @override<br>  void dispose() {<br>    _controller.dispose(); // Always dispose controllers<br>    super.dispose();<br>  }<br>}</pre><p>Animation Pro Tips:</p><ul><li>Prefer AnimatedBuilder over setState in animations</li><li>Use Transform instead of changing widget properties</li><li>Always dispose animation controllers</li><li>Use RepaintBoundary for complex animations</li></ul><h3>🧹 Technique #9: Proper Resource Management</h3><p><strong>The Problem:</strong> Memory leaks slow down your app over time.</p><p><strong>The Solution:</strong> Always clean up resources.</p><pre>class ResourceManagedWidget extends StatefulWidget {<br>  @override<br>  _ResourceManagedWidgetState createState() =&gt; _ResourceManagedWidgetState();<br>}<br><br>class _ResourceManagedWidgetState extends State&lt;ResourceManagedWidget&gt; {<br>  late StreamSubscription _subscription;<br>  late Timer _timer;<br>  final TextEditingController _controller = TextEditingController();<br>  @override<br>  void initState() {<br>    super.initState();<br>    <br>    // Set up resources<br>    _subscription = someStream.listen((data) {<br>      // Handle stream data<br>    });<br>    <br>    _timer = Timer.periodic(Duration(seconds: 1), (timer) {<br>      // Periodic updates<br>    });<br>  }<br>  @override<br>  void dispose() {<br>    // Always clean up resources<br>    _subscription.cancel();<br>    _timer.cancel();<br>    _controller.dispose();<br>    super.dispose();<br>  }<br>  @override<br>  Widget build(BuildContext context) {<br>    return TextField(controller: _controller);<br>  }<br>}</pre><h3>🔧 Technique #10: Use Flutter DevTools Like a Pro</h3><p><strong>The Problem:</strong> You’re optimizing blind without performance data.</p><p><strong>The Solution:</strong> Use Flutter DevTools to identify real bottlenecks.</p><h3>Key DevTools Features:</h3><p><strong>Performance Tab:</strong></p><ul><li>Monitor frame rendering times</li><li>Identify dropped frames</li><li>Track GPU/CPU usage</li></ul><p><strong>Memory Tab:</strong></p><ul><li>Find memory leaks</li><li>Monitor heap usage</li><li>Identify objects not being garbage collected</li></ul><p><strong>Widget Inspector:</strong></p><ul><li>Identify unnecessary rebuilds</li><li>Visualize widget tree depth</li><li>Check widget render times</li></ul><h3>Quick DevTools Setup:</h3><pre># Launch your app in PROFILE mode for accurate performance data<br>flutter run --profile<br><br># Open DevTools in browser<br># URL will be shown in terminal</pre><p><strong>⚠️ Important:</strong> Always use --profile mode for performance testing, not --debug. Debug mode has overhead that skews performance metrics.</p><p><strong>Pro tip:</strong> Use the “Track Widget Rebuilds” option to see exactly which widgets are rebuilding and why.</p><h3>Real-World Performance Results</h3><p>Here’s what these optimizations achieved in a recent project:</p><p><strong>Before Optimization:</strong></p><ul><li>App startup: 4.2 seconds</li><li>List scroll performance: 45 FPS average</li><li>Memory usage: 180MB baseline</li><li>User retention: 67%</li></ul><p><strong>After Optimization:</strong></p><ul><li>App startup: 1.8 seconds ⚡ <strong>58% improvement</strong></li><li>List scroll performance: 59 FPS average ⚡ <strong>31% improvement</strong></li><li>Memory usage: 95MB baseline ⚡ <strong>47% reduction</strong></li><li>User retention: 84% ⚡ <strong>25% improvement</strong></li></ul><h3>Your Performance Checklist</h3><p>Before pushing your next Flutter app, run through this checklist:</p><ul><li>[ ] Used const constructors wherever possible</li><li>[ ] Broke large widgets into smaller components</li><li>[ ] Implemented proper state management</li><li>[ ] Optimized image loading with caching</li><li>[ ] Added lazy loading for lists</li><li>[ ] Moved heavy computations to isolates</li><li>[ ] Used ListView.builder for dynamic lists</li><li>[ ] Optimized animations with AnimatedBuilder</li><li>[ ] Properly disposed all resources</li><li>[ ] Profiled with Flutter DevTools</li></ul><h3>The Bottom Line</h3><p>Flutter performance isn’t about knowing every advanced technique — it’s about consistently applying these fundamentals. Start with the const keyword and proper widget structure. Those two changes alone will solve 80% of your performance issues.</p><p><strong>Bonus tip for 2025:</strong> If you’re targeting newer devices, consider enabling Flutter’s <strong>Impeller rendering engine</strong> (default on iOS, opt-in on Android). It provides more consistent performance and better GPU utilization compared to the legacy Skia renderer.</p><p>Remember: <strong>your users don’t care how complex your code is. They care how fast your app feels.</strong></p><p><strong>What’s your biggest Flutter performance challenge?</strong> Drop a comment below, and I’ll help you tackle it. And if this article helped you optimize your app, give it a clap and share it with other Flutter developers who need to see this.</p><p><em>Happy coding! 🚀</em></p><h3>About the Author</h3><p><strong>I’m a seasoned Flutter developer with extensive experience building high-performance mobile applications.</strong> Over the years, I’ve helped dozens of startups and enterprises optimize their Flutter apps, turning slow, janky interfaces into smooth, responsive experiences that users love.</p><p>My expertise spans the full Flutter ecosystem — from state management architecture to advanced performance optimization techniques. I’ve successfully scaled Flutter apps from prototype to millions of users, always with a focus on maintaining that buttery-smooth 60fps experience.</p><p><strong>Need help optimizing your Flutter app?</strong> I offer consulting services to help you:</p><ul><li><strong>Performance audits</strong> — Identify and fix bottlenecks causing jank</li><li><strong>Architecture reviews</strong> — Ensure your app scales efficiently</li><li><strong>Code optimization</strong> — Implement best practices for maximum performance</li><li><strong>Team training</strong> — Level up your developers’ Flutter skills</li></ul><p>Whether you’re experiencing performance issues or want to prevent them before they happen, I’m here to help. <strong>Let’s connect and make your Flutter app blazing fast.</strong></p><p>📧 <strong>Available for consulting projects</strong> — <a href="/service/mailto:vedran.balagovic@gmail.com">Contact me</a> or connect on <a href="https://www.linkedin.com/in/vedran-balagovic">LinkedIn</a></p><p><em>Want more Flutter performance tips? Follow me for weekly Flutter content that actually helps you build better apps.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4def9e5bbd2d" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/flutter-performance-optimization-10-techniques-that-actually-work-in-2025-4def9e5bbd2d">Flutter Performance Optimization: 10 Techniques That Actually Work in 2025</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hidden Cost of GetX: Lessons from Real-World Flutter Projects]]></title>
            <link>https://itnext.io/the-hidden-cost-of-getx-lessons-from-real-world-flutter-projects-e7b6b6f955ed?source=rss-51e16679109e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7b6b6f955ed</guid>
            <category><![CDATA[getx]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[riverpod]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Vedran Balagovic]]></dc:creator>
            <pubDate>Fri, 16 May 2025 08:20:10 GMT</pubDate>
            <atom:updated>2025-05-16T08:56:48.940Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*i7Hkx-KsD1r0Cn6F6ChUDg.png" /></figure><p>“It worked great until it didn’t.” That’s how a senior developer on my team described our experience with GetX after six months. When starting a new Flutter project, choosing a state management solution is a crucial decision. GetX initially attracts developers with its simplicity and rich feature set. However, as a seasoned Flutter developer, I’ve observed how this initial convenience can turn into significant technical debt over time.</p><p>This article shares my experiences with GetX in production, highlighting both its initial appeal and the challenges encountered as projects scale. The aim is to provide a balanced perspective rather than discourage its use entirely.</p><h3>The Initial Appeal of GetX</h3><p>GetX markets itself as an “extra-light and powerful solution for Flutter,” offering several compelling advantages:</p><ul><li><strong>Minimal Boilerplate</strong>: Significantly less setup code compared to BLoC or Riverpod.</li><li><strong>All-in-One Package</strong>: Includes routing, dependency injection, and internationalization.</li><li><strong>Gentle Learning Curve</strong>: Accessible API suitable for Flutter beginners.</li><li><strong>Quick Development</strong>: Ideal for rapid MVP development.</li></ul><p>These benefits initially made GetX attractive, enabling our team to rapidly prototype and launch features.</p><h3>The Scaling Challenges</h3><p>As our application grew, we faced several unforeseen issues:</p><h4>1. Testability Issues</h4><p>Testing became challenging, largely due to common implementation patterns rather than inherent GetX flaws:</p><ul><li><strong>Controller Testing</strong>: Controllers often tightly coupled to views or other controllers, complicating isolated unit tests.</li><li><strong>Widget Tests</strong>: Global state management patterns made test environments unpredictable.</li><li><strong>Mocking Dependencies</strong>: The implicit DI system in GetX was less straightforward to mock effectively.</li></ul><p>Code<strong> </strong>Example</p><pre>// Tightly-coupled GetX example (harder to test)<br>class UserController extends GetxController {<br>  final UserService userService = Get.find(); // Implicit DI makes testing difficult<br>                                             // Hard to substitute with test double<br><br>  Future&lt;void&gt; loadUser() async {<br>    user.value = await userService.getUser();<br>  }<br>}<br><br>// More testable Riverpod alternative<br>final userProvider = FutureProvider((ref) async {<br>  final service = ref.watch(userServiceProvider); // Explicit dependency<br>                                                 // Easy to override in tests<br>  return service.getUser();<br>});</pre><h4>2. Code Organization and Maintainability</h4><p>Our codebase suffered from inconsistent patterns and tightly coupled components:</p><ul><li><strong>Inconsistent Patterns</strong>: Team members implemented GetX differently due to lack of strict guidelines.</li><li><strong>Global State Access</strong>: Easy access to state caused unpredictable data flows.</li><li><strong>Component Coupling</strong>: Modifying features frequently led to unintended side effects.</li></ul><h4>3. Performance Concerns</h4><p>Performance issues emerged primarily due to implementation oversights:</p><ul><li><strong>Memory Management</strong>: Reactive subscriptions not disposed correctly caused memory leaks.</li><li><strong>Unnecessary Re-renders</strong>: Without disciplined use, widgets re-rendered excessively.</li><li><strong>Initialization Overhead</strong>: Eagerly-loaded dependencies significantly slowed app startup times.</li></ul><h4>4. Onboarding New Developers</h4><p>Despite its simplicity, GetX posed onboarding challenges:</p><ul><li><strong>Non-Standard Approach</strong>: Developers familiar with standard Flutter patterns needed adjustment.</li><li><strong>Documentation Gaps</strong>: Lack of deep documentation for advanced scenarios.</li><li><strong>Community Support</strong>: Limited resources available for complex or unusual issues.</li></ul><h3>Alternative Approaches</h3><p>After experiencing these challenges, our team evaluated alternatives:</p><p><strong>Riverpod (Recommended)</strong></p><ul><li>Type safety and compile-time error detection.</li><li>Excellent testability and straightforward dependency mocking.</li><li>Clear, maintainable architecture.</li></ul><p><strong>Code Example</strong>:</p><pre>final authProvider = StateNotifierProvider&lt;AuthNotifier, AuthState&gt;((ref) {<br>  final authService = ref.watch(authServiceProvider); // Dependencies are explicit<br>  return AuthNotifier(authService);                  // and easily substituted<br>});</pre><p><strong>Flutter Bloc</strong></p><ul><li>Predictable and traceable event-to-state transitions.</li><li>Strong debugging tools and well-documented architecture.</li></ul><p><strong>Provider</strong></p><ul><li>Official Flutter recommendation.</li><li>Simple and straightforward state management.</li><li>Extensive community resources.</li></ul><h3>When GetX Might Still Be Appropriate</h3><p>Despite the challenges outlined, GetX can still be a reasonable choice in certain scenarios:</p><p><strong>Small, Short-lived Projects</strong>: For prototypes, MVPs with limited lifespans, or single-developer projects, GetX’s quick setup can be advantageous.</p><p><strong>Simple Applications</strong>: Apps with minimal state complexity and few interdependencies may not encounter the scaling issues.</p><p><strong>Teams Experienced with GetX</strong>: If your team has established strong conventions and testing practices around GetX, these mitigate many of the issues described.</p><h3>Migration Strategies</h3><p>If you’re already using GetX and experiencing challenges, here are practical migration approaches:</p><h4>1. Gradual Feature Migration</h4><ul><li>Select a standalone feature.</li><li>Implement the feature using Riverpod or BLoC.</li><li>Build adapters between systems during transition.</li></ul><h4>2. Improved GetX Implementation</h4><ul><li>Establish strict architectural guidelines.</li><li>Disciplined use of lazy loading and DI.</li><li>Enhance your testing utilities.</li></ul><h3>Conclusion</h3><p>While GetX can quickly accelerate initial development, our experiences highlight significant long-term maintainability, testability, and performance challenges. Consider your project’s lifespan carefully when choosing state management solutions, favoring more structured solutions for long-term projects.</p><p><em>Vedran Balagović is a CTO and full-stack developer with 8+ years of experience building technology companies. He’s the author of popular Flutter packages like flutter-presetup (120+ GitHub stars) and flutter_scalable_ocr (72+ GitHub stars), and writes extensively on Flutter, architecture, and technical leadership.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7b6b6f955ed" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/the-hidden-cost-of-getx-lessons-from-real-world-flutter-projects-e7b6b6f955ed">The Hidden Cost of GetX: Lessons from Real-World Flutter Projects</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Complete Guide to Flutter macOS Distribution Outside the App Store]]></title>
            <link>https://itnext.io/complete-guide-to-flutter-macos-distribution-outside-the-app-store-e382c6d7db47?source=rss-51e16679109e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e382c6d7db47</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[distribution]]></category>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[flutter-mac]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Vedran Balagovic]]></dc:creator>
            <pubDate>Mon, 02 Dec 2024 11:23:40 GMT</pubDate>
            <atom:updated>2024-12-02T14:09:07.185Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r58E0MspUEWT5kPiJretLA.png" /></figure><p>This comprehensive guide will walk you through the entire process of preparing, signing, and distributing a Flutter macOS application outside the App Store, including certificate creation and management through which I went while creating <a href="https://flutter-builder.app/">Flutter Builder</a>.</p><h3>Developer ID Certificate Creation and Management</h3><p>Before we begin signing our application, we need to obtain and manage the proper certificates. The Developer ID Application certificate is designed to distribute macOS applications outside the App Store.</p><h4>Listing Installed Developer ID Certificates</h4><p>To see what certificates you currently have installed, open Terminal and run:</p><pre>security find-identity -v -p codesigning</pre><p>This command will show all installed signing certificates. Look for entries starting with “Developer ID Application:”. Each entry will show the certificate’s hash and full name.</p><h4>Creating a Developer ID Application Certificate</h4><ol><li>Log into your <a href="https://developer.apple.com/account">Apple Developer Account</a></li><li>Navigate to “Certificates, Identifiers &amp; Profiles”</li><li>Click the “+” button to add a new certificate</li><li>Select “Developer ID Application” under Software</li><li>Follow these steps to create a Certificate Signing Request (CSR):</li></ol><pre># Create a private key<br>openssl genrsa -out developerID.key 2048<br><br># Create a Certificate Signing Request (CSR)<br>openssl req -new -key developerID.key -out developerID.csr \<br>-subj &quot;/emailAddress=your@email.com, CN=Your Name, C=US&quot;<br><br># The CSR file (developerID.csr) should be uploaded to Apple&#39;s developer portal</pre><ol><li>Upload the CSR file to Apple’s developer portal</li><li>Download the certificate and double-click to install it in Keychain Access</li></ol><h3>Project Configuration</h3><h4>Bundle Identifier Setup</h4><p>Open macos/Runner/Configs/AppInfo.xcconfig and configure your app:</p><pre>PRODUCT_BUNDLE_IDENTIFIER=com.yourdomain.yourapp<br>PRODUCT_NAME=$(TARGET_NAME)<br>FLUTTER_BUILD_NAME=1.0.0<br>FLUTTER_BUILD_NUMBER=1</pre><h4>Entitlements Configuration</h4><p>Create or modify macos/Runner/Release.entitlements:</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;<br>&lt;plist version=&quot;1.0&quot;&gt;<br>&lt;dict&gt;<br>&lt;key&gt;com.apple.security.app-sandbox&lt;/key&gt;<br>&lt;true/&gt;<br>&lt;key&gt;com.apple.security.network.client&lt;/key&gt;<br>&lt;true/&gt;<br>&lt;key&gt;com.apple.security.files.user-selected.read-write&lt;/key&gt;<br>&lt;true/&gt;<br>&lt;/dict&gt;<br>&lt;/plist&gt;</pre><h3><strong>Comprehensive Build and Signing Script</strong></h3><p>Create a file named build_macos.sh:</p><pre>#!/bin/bash<br><br># Configuration<br>DEVELOPER_ID=&quot;Developer ID Application: Your Company Name (YOUR_TEAM_ID)&quot;<br>APP_NAME=&quot;Your App Name&quot;<br>APP_PATH=&quot;build/macos/Build/Products/Release/$APP_NAME.app&quot;<br><br>echo &quot;Starting Flutter macOS build and signing process...&quot;<br><br># Clean and build<br>flutter clean<br>flutter pub get<br>flutter build macos --release<br><br>echo &quot;Build completed. Starting signing process...&quot;<br><br># Step 1: Sign all individual binaries inside frameworks<br>echo &quot;Signing individual binaries within frameworks...&quot;<br>find &quot;${APP_PATH}/Contents/Frameworks&quot; -type f -name &quot;*&quot; | while read binary; do<br>    if [[ -f &quot;binary&quot; &amp;&amp; ! -L &quot;binary&quot; ]]; then<br>        echo &quot;  → Signing binary: $binary&quot;<br>        codesign --force --options runtime --sign &quot;DEVELOPER_ID&quot; --timestamp &quot;binary&quot; || true<br>    fi<br>done<br><br># Step 2: Sign framework versions<br>echo &quot;Signing framework versions...&quot;<br>find &quot;${APP_PATH}/Contents/Frameworks&quot; -type d -name &quot;Versions&quot; | while read versions_dir; do<br>    if [ -d &quot;${versions_dir}/Current&quot; ]; then<br>        echo &quot;  → Signing Current version: ${versions_dir}/Current&quot;<br>        codesign --force --options runtime --sign &quot;DEVELOPER_ID&quot; --timestamp &quot;{versions_dir}/Current&quot;<br>    fi<br><br>    if [ -d &quot;${versions_dir}/A&quot; ]; then<br>        echo &quot;  → Signing version A: ${versions_dir}/A&quot;<br>        codesign --force --options runtime --sign &quot;DEVELOPER_ID&quot; --timestamp &quot;{versions_dir}/A&quot;<br>    fi<br>done<br><br># Step 3: Sign the framework bundles<br>echo &quot;Signing framework bundles...&quot;<br>find &quot;${APP_PATH}/Contents/Frameworks&quot; -type d -name &quot;*.framework&quot; | while read framework; do<br>    echo &quot;  → Signing framework: $framework&quot;<br>    codesign --force --options runtime --sign &quot;DEVELOPER_ID&quot; --timestamp &quot;framework&quot;<br>done<br><br># Step 4: Sign the main binary<br>echo &quot;Signing main application binary...&quot;<br>codesign --force --options runtime \<br>    --entitlements &quot;macos/Runner/Release.entitlements&quot; \<br>    --sign &quot;$DEVELOPER_ID&quot; \<br>    --timestamp &quot;{APP_PATH}/Contents/MacOS/APP_NAME&quot;<br><br># Step 5: Sign the app bundle<br>echo &quot;Signing complete application bundle...&quot;<br>codesign --force --deep --options runtime \<br>    --sign &quot;$DEVELOPER_ID&quot; \<br>    --timestamp &quot;$APP_PATH&quot;<br><br># Verify signature<br>echo &quot;Verifying signature...&quot;<br>codesign --verify --deep --strict --verbose=2 &quot;$APP_PATH&quot;<br><br># Create DMG<br>echo &quot;Creating DMG...&quot;<br>mkdir -p installer<br><br># Using create-dmg (install via: brew install create-dmg)<br>create-dmg \<br>  --volname &quot;$APP_NAME&quot; \<br>  --window-pos 200 120 \<br>  --window-size 600 300 \<br>  --icon-size 100 \<br>  --icon &quot;$APP_NAME.app&quot; 175 120 \<br>  --hide-extension &quot;$APP_NAME.app&quot; \<br>  --app-drop-link 425 120 \<br>  &quot;installer/$APP_NAME.dmg&quot; \<br>  &quot;$APP_PATH&quot;<br><br># Sign DMG<br>echo &quot;Signing DMG...&quot;<br>codesign --force --sign &quot;$DEVELOPER_ID&quot; \<br>    --timestamp --options runtime \<br>    &quot;installer/$APP_NAME.dmg&quot;<br><br># Notarization<br>echo &quot;Setting up notarization...&quot;<br># Create a notarization profile in Keychain Access first:<br># xcrun notarytool store-credentials &quot;Your-Notary-Profile&quot; \<br>#    --apple-id &quot;your.email@example.com&quot; \<br>#    --team-id &quot;YOUR_TEAM_ID&quot; \<br>#    --password &quot;app-specific-password&quot;<br><br>echo &quot;Submitting for notarization...&quot;<br>xcrun notarytool submit &quot;installer/$APP_NAME.dmg&quot; \<br>    --keychain-profile &quot;Your-Notary-Profile&quot; \<br>    --wait<br><br>echo &quot;Stapling notarization ticket...&quot;<br>xcrun stapler staple &quot;installer/$APP_NAME.dmg&quot;<br><br>echo &quot;Build and signing process completed!&quot;<br><br># Final verification<br>echo &quot;Performing final verification...&quot;<br>spctl --assess -vv --type install &quot;installer/$APP_NAME.dmg&quot;</pre><h4>Setting Up Notarization Profile</h4><p>Before running the script, set up your notarization profile:</p><pre>xcrun notarytool store-credentials &quot;Your-Notary-Profile&quot; \<br> - apple-id &quot;your.email@example.com&quot; \<br> - team-id &quot;YOUR_TEAM_ID&quot; \<br> - password &quot;app-specific-password&quot;</pre><p>You’ll need an app-specific password from Apple ID management:</p><ol><li>Go to <a href="https://appleid.apple.com/">Apple ID account management</a></li><li>Navigate to Security → App-Specific Passwords</li><li>Generate a new password specifically for notarization</li></ol><h3>Troubleshooting Common Issues and Solutions</h3><p>“No identity found” error:</p><pre># List all available signing identities<br>security find-identity -v -p codesigning</pre><p>Framework signing failures:</p><pre># Check signing status of a framework<br>codesign -vv - deep - display &quot;${APP_PATH}/Contents/Frameworks/YourFramework.framework&quot;</pre><p>Notarization failures:</p><pre># Check notarization history<br>xcrun notarytool history - keychain-profile &quot;Your-Notary-Profile&quot;<br># Get detailed info about a submission<br>xcrun notarytool info [submission-id] - keychain-profile &quot;Your-Notary-Profile&quot;</pre><h3>Verification Commands</h3><p>After building and signing, verify everything:</p><pre># Verify app signing<br>codesign - verify - deep - strict - verbose=2 &quot;$APP_PATH&quot;<br># Verify DMG signing<br>codesign - verify - deep - strict - verbose=2 &quot;installer/$APP_NAME.dmg&quot;<br># Verify Gatekeeper acceptance<br>spctl - assess -vv - type install &quot;installer/$APP_NAME.dmg&quot;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e382c6d7db47" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/complete-guide-to-flutter-macos-distribution-outside-the-app-store-e382c6d7db47">Complete Guide to Flutter macOS Distribution Outside the App Store</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Riverpod 2.0: Modern State Management and Code Generation]]></title>
            <link>https://medium.com/@vedran.balagovic/flutter-riverpod-2-0-modern-state-management-and-code-generation-ac82bd6dfb6a?source=rss-51e16679109e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac82bd6dfb6a</guid>
            <category><![CDATA[flutter-state-management]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[riverpod]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Vedran Balagovic]]></dc:creator>
            <pubDate>Thu, 28 Nov 2024 17:45:46 GMT</pubDate>
            <atom:updated>2024-12-01T11:44:26.966Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A follow-up to Flutter Riverpod Networking Guide</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TKijTF4Qj6JoWYRG-vU4cQ.png" /></figure><h3>Introduction</h3><p><a href="https://medium.com/itnext/flutter-riverpod-example-and-guide-with-networking-b758af7b646b">In our previous article, we built a movie app using Riverpod 1.0.</a> Today, we’ll upgrade our implementation to use Riverpod 2.0’s powerful features, focusing on code generation and modern state management patterns.</p><blockquote>For the generation of the models, providers, services and even crud widgets directly from JSON model using Riverpod check out <a href="https://flutter-builder.app/">Flutter Builder.</a></blockquote><h3>Setup and Dependencies</h3><p>First, update your <strong>pubspec.yaml</strong>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/213c78b8e2bb5477c9b43819df37f322/href">https://medium.com/media/213c78b8e2bb5477c9b43819df37f322/href</a></iframe><h3>Key Changes in Riverpod 2.0</h3><h3>1. Simplified Provider Annotations</h3><p>Instead of using separate types like <strong>StateNotifierProvider</strong>, we now use a single <strong>@riverpod</strong> annotation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c70ec531c81712d2174621c1ec79d7e/href">https://medium.com/media/6c70ec531c81712d2174621c1ec79d7e/href</a></iframe><h3>2. Immutable Models with Freezed</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a0a9df08b3d914f54ad3eea94f4d5111/href">https://medium.com/media/a0a9df08b3d914f54ad3eea94f4d5111/href</a></iframe><h3>3. Modern API Service</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8cfe00f07d9acd592f81b8a7130b502f/href">https://medium.com/media/8cfe00f07d9acd592f81b8a7130b502f/href</a></iframe><h3>4. Improved State Management</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/21cd7c07df5ec569940f10aab050316a/href">https://medium.com/media/21cd7c07df5ec569940f10aab050316a/href</a></iframe><h3>5. Proper Edit State Management</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3756c3cabdfffe369212ae154975ba31/href">https://medium.com/media/3756c3cabdfffe369212ae154975ba31/href</a></iframe><h3>6. Enhanced UI Integration</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2889db9e7760323c2a09e6518cc002b2/href">https://medium.com/media/2889db9e7760323c2a09e6518cc002b2/href</a></iframe><h3>7. Simplified Provider Parameter Types</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aad953649eb6d02ea4f8138bf3f17b47/href">https://medium.com/media/aad953649eb6d02ea4f8138bf3f17b47/href</a></iframe><h3>Key Benefits of These Updates</h3><ol><li><strong>Type Safety</strong>: Code generation provides compile-time checking</li><li><strong>State Immutability</strong>: Freezed ensures proper state management</li><li><strong>Error Handling</strong>: AsyncValue provides structured error handling</li><li><strong>Safe State Updates</strong>: Proper initialization avoids build-time errors</li><li><strong>Simplified Code</strong>: Less boilerplate with better organization</li></ol><h3>Best Practices</h3><ol><li>Always initialize provider state modifications in addPostFrameCallback</li><li>Use AsyncValue for all async operations</li><li>Keep providers focused and small</li><li>Use immutable state with Freezed</li><li>Leverage code generation for all providers</li><li>Handle loading and error states consistently</li></ol><h3>Running Code Generation</h3><p>After making changes:</p><blockquote><strong><em>dart run build_runner watch</em></strong></blockquote><h3>Complete Example</h3><p>The complete example is available on <a href="https://idx.google.com/movie-example-42900">IDX</a> shared workspace, you can even run it right there, demonstrating:</p><ul><li>Full CRUD operations</li><li>Proper state management</li><li>Error handling</li><li>Loading states</li><li>Form handling</li><li>Navigation</li></ul><h3>Conclusion</h3><p>Riverpod 2.0 with code generation significantly improves our movie app by providing better type safety, state management, and error handling. The combination of code generation, AsyncValue, and modern Dart features creates a robust foundation for Flutter applications.</p><p>Full working example in case that IDX has problems.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ee0d8de4081d36e3d51dd734c4c83850/href">https://medium.com/media/ee0d8de4081d36e3d51dd734c4c83850/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac82bd6dfb6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>