<?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 Vikas Gupta on Medium]]></title>
        <description><![CDATA[Stories by Vikas Gupta on Medium]]></description>
        <link>https://medium.com/@vikank9891?source=rss-570457969924------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*H62C5txlSbOH6fGNFRGL1g.jpeg</url>
            <title>Stories by Vikas Gupta on Medium</title>
            <link>https://medium.com/@vikank9891?source=rss-570457969924------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 19:26:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vikank9891/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[Deep Links in Flutter: A Complete Guide (Universal Links, App Links, Custom Schemes)]]></title>
            <link>https://medium.com/@vikank9891/deep-links-in-flutter-a-complete-guide-universal-links-app-links-custom-schemes-793f931f68e1?source=rss-570457969924------2</link>
            <guid isPermaLink="false">https://medium.com/p/793f931f68e1</guid>
            <category><![CDATA[universal-links]]></category>
            <category><![CDATA[flutter-deep-link]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[deep-linking]]></category>
            <category><![CDATA[android-app-links]]></category>
            <dc:creator><![CDATA[Vikas Gupta]]></dc:creator>
            <pubDate>Sun, 19 Jul 2026 16:39:17 GMT</pubDate>
            <atom:updated>2026-07-19T16:39:17.827Z</atom:updated>
            <content:encoded><![CDATA[<p>Deep links are one of those features that sound simple but have about 15 ways to get wrong across iOS and Android.</p><p>Let me walk you through everything — the theory, the three types of deep links, the setup, and the common mistakes that will cost you hours if you don’t know about them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BoiOmkUClOXV6IJM5Khy6Q.png" /><figcaption>Deep Links in Flutter</figcaption></figure><blockquote><strong>What Is a Deep Link?</strong></blockquote><p>A deep link is a URL that opens your app and navigates to a specific screen — not just the app home screen.</p><p>Example: https://myapp.com/product/123 Opens your app directly on the product detail screen for product 123. If the app isn&#39;t installed, it opens the website (or App Store/Play Store).</p><p><strong>Three Types of Deep Links</strong></p><p><strong>1. Custom URL Schemes (</strong><strong>myapp://product/123)</strong> Oldest approach. Easy to set up. The problem: any app can register any scheme. If another app on the device registers myapp://, your links might open that app instead. Android shows a disambiguation dialog. iOS has unpredictable behavior. <strong>Not recommended for production.</strong></p><p><strong>2. iOS Universal Links (</strong><strong>https://myapp.com/product/123)</strong> Apple&#39;s preferred approach. Uses actual HTTPS URLs backed by a domain you control. iOS verifies the association between your app and your domain — other apps can&#39;t hijack it. Requires an Apple App Site Association (AASA) file hosted on your server.</p><p><strong>3. Android App Links (</strong><strong>https://myapp.com/product/123)</strong> Android&#39;s equivalent. Uses Digital Asset Links JSON hosted on your domain. When Android verifies the association, the link opens your app directly — no disambiguation dialog.</p><blockquote><strong>Flutter Setup with go_router</strong></blockquote><pre>// main.dart<br>final _router = GoRouter(<br>  routes: [<br>    GoRoute(<br>      path: &#39;/&#39;,<br>      builder: (context, state) =&gt; HomeScreen(),<br>    ),<br>    GoRoute(<br>      path: &#39;/product/:id&#39;,<br>      builder: (context, state) {<br>        final productId = state.pathParameters[&#39;id&#39;]!;<br>        return ProductScreen(productId: productId);<br>      },<br>    ),<br>    GoRoute(<br>      path: &#39;/order/:orderId&#39;,<br>      builder: (context, state) {<br>        return OrderScreen(orderId: state.pathParameters[&#39;orderId&#39;]!);<br>      },<br>    ),<br>  ],<br>);<br><br>void main() {<br>  runApp(MaterialApp.router(routerConfig: _router));<br>}</pre><blockquote><strong>Android Setup (App Links)</strong></blockquote><p>In AndroidManifest.xml:</p><pre>&lt;activity android:name=&quot;.MainActivity&quot; ...&gt;<br>  &lt;intent-filter android:autoVerify=&quot;true&quot;&gt;<br>    &lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;<br>    &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;<br>    &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&gt;<br>    &lt;data android:scheme=&quot;https&quot; android:host=&quot;myapp.com&quot; /&gt;<br>  &lt;/intent-filter&gt;<br>&lt;/activity&gt;</pre><p>On your server, host at <a href="https://myapp.com/.well-known/assetlinks.json:">https://myapp.com/.well-known/assetlinks.json:</a></p><pre>[{<br>  &quot;relation&quot;: [&quot;delegate_permission/common.handle_all_urls&quot;],<br>  &quot;target&quot;: {<br>    &quot;namespace&quot;: &quot;android_app&quot;,<br>    &quot;package_name&quot;: &quot;com.yourcompany.myapp&quot;,<br>    &quot;sha256_cert_fingerprints&quot;: [&quot;YOUR_SHA256_FINGERPRINT&quot;]<br>  }<br>}]</pre><p>Get your SHA256 fingerprint:</p><pre>keytool -list -v -keystore your-keystore.jks</pre><blockquote><strong>iOS Setup (Universal Links)</strong></blockquote><p>In ios/Runner/Runner.entitlements:</p><pre>&lt;key&gt;com.apple.developer.associated-domains&lt;/key&gt;<br>&lt;array&gt;<br>  &lt;string&gt;applinks:myapp.com&lt;/string&gt;<br>&lt;/array&gt;</pre><p>On your server, at <a href="https://myapp.com/.well-known/apple-app-site-association:">https://myapp.com/.well-known/apple-app-site-association:</a></p><pre>{<br>  &quot;applinks&quot;: {<br>    &quot;apps&quot;: [],<br>    &quot;details&quot;: [{<br>      &quot;appID&quot;: &quot;TEAMID.com.yourcompany.myapp&quot;,<br>      &quot;paths&quot;: [&quot;/product/*&quot;, &quot;/order/*&quot;, &quot;/user/*&quot;]<br>    }]<br>  }<br>}</pre><p><strong>Critical:</strong> This file must:</p><ul><li>Be served over HTTPS with a valid SSL certificate</li><li>Have Content-Type: application/json</li><li>Be accessible without redirects</li><li>Be served from your actual domain (not a CDN subdomain in some cases)</li></ul><p><strong>Handling the Initial Link (App Launch from Cold Start)</strong></p><p>When the app is completely closed and opened via a deep link, GoRouter handles it automatically if set up correctly. But with custom navigation, you need:</p><pre>// With app_links package<br>final _appLinks = AppLinks();<br><br>@override<br>void initState() {<br>  super.initState();<br>  _handleInitialLink();<br>  _listenForLinks();<br>}<br><br>Future&lt;void&gt; _handleInitialLink() async {<br>  final uri = await _appLinks.getInitialLink();<br>  if (uri != null) _handleLink(uri);<br>}<br><br>void _listenForLinks() {<br>  _appLinks.uriLinkStream.listen(_handleLink);<br>}<br><br>void _handleLink(Uri uri) {<br>  // Navigate based on uri.path and uri.queryParameters<br>  if (uri.pathSegments.first == &#39;product&#39;) {<br>    Navigator.pushNamed(context, &#39;/product/${uri.pathSegments[1]}&#39;);<br>  }<br>}</pre><p><strong>The Mistakes Everyone Makes</strong></p><ul><li><strong>Not testing on a real device</strong> — Simulators/emulators often don’t properly verify App Links/Universal Links</li><li><strong>Missing the </strong><strong>autoVerify attribute on Android</strong> — Without it, users get the disambiguation dialog every time</li><li><strong>CDN caching the AASA file</strong> — iOS fetches this file through Apple’s CDN. Changes take 24–48 hours to propagate. Deploy early!</li><li><strong>Wrong Team ID in iOS entitlements</strong> — Double-check your 10-character Team ID from developer.apple.com</li><li><strong>Not handling the null case</strong> — getInitialLink() returns null when the app opened normally. Always null-check.</li></ul><p>Deep links done right are invisible to users — the app just opens to the right place, like magic. Done wrong, they’re a source of frustrating bugs that are hard to reproduce. Get the setup right once and you never have to touch it again.</p><p>#Flutter #DeepLinks #UniversalLinks #AppLinks #FlutterDev #MobileDevelopment #iOS #Android</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=793f931f68e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[App Performance & Profiling in Flutter: How to Actually Find and Fix Jank]]></title>
            <link>https://medium.com/@vikank9891/app-performance-profiling-in-flutter-how-to-actually-find-and-fix-jank-a5601872564f?source=rss-570457969924------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5601872564f</guid>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[flutter-app-performance]]></category>
            <category><![CDATA[flutter-profile]]></category>
            <category><![CDATA[flutter-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Vikas Gupta]]></dc:creator>
            <pubDate>Mon, 18 May 2026 16:39:12 GMT</pubDate>
            <atom:updated>2026-05-18T16:39:12.854Z</atom:updated>
            <content:encoded><![CDATA[<p>Your Flutter app is janky. You can feel it - that slight hesitation when scrolling, that stutter when navigating. Your users feel it too.</p><p>The mistake most developers make is <strong>guessing</strong> what’s slow. They optimize things that don’t matter and miss the actual bottleneck.</p><p>Don’t guess. Profile. Here’s how.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ncbzVQztl-pSidPbo97BdQ.png" /><figcaption>App Performance &amp; Profiling in Flutter</figcaption></figure><p><strong>The 16ms Budget</strong></p><p>At 60fps, each frame has <strong>16.67ms</strong> to render. If your build/layout/paint pipeline takes longer than that for any frame, you drop frames. Users see jank.</p><p>On 90fps/120fps displays (common on flagship Android phones), your budget shrinks to 11ms or 8ms.</p><p><strong>Flutter DevTools: Your Performance Bible</strong></p><p>Open DevTools → Performance tab. Enable “Track Widget Rebuilds.” Record a session while doing the janky interaction.</p><p>You’ll see two tracks:</p><ul><li><strong>UI - </strong>Dart/framework work</li><li><strong>Raster - </strong>GPU compositing work</li></ul><p>If the UI track is the bottleneck, your Dart code is doing too much work per frame. If the Raster track is the bottleneck, you have expensive compositing operations (too many layers, heavy shaders, etc.).</p><p><strong>The Number One Cause of Jank: Excessive Rebuilds</strong></p><p>Every time setState() is called, Flutter rebuilds the entire subtree below. In many apps, this means rebuilding hundreds of widgets to change one value.</p><pre>// BAD — entire page rebuilds when counter changes<br>class MyPage extends StatefulWidget { ... }<br>class _MyPageState extends State&lt;MyPage&gt; {<br>  int counter = 0;<br>  <br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      body: Column(<br>        children: [<br>          HeavyListWidget(), // This rebuilds too! Expensive!<br>          Text(&#39;$counter&#39;),  // This is all we wanted to rebuild<br>        ],<br>      ),<br>      floatingActionButton: FloatingActionButton(<br>        onPressed: () =&gt; setState(() =&gt; counter++),<br>      ),<br>    );<br>  }<br>}</pre><pre>// GOOD — extract into own StatefulWidget or use ValueListenableBuilder<br>class CounterDisplay extends StatefulWidget { ... }<br>// OR<br>ValueListenableBuilder&lt;int&gt;(<br>  valueListenable: counterNotifier,<br>  builder: (context, value, _) =&gt; Text(&#39;$value&#39;),<br>)</pre><p><strong>const Widgets: Your Free Optimization</strong></p><p>Mark widgets const wherever possible. const widgets are compile-time constants; Flutter skips them entirely during rebuilds.</p><pre>// Without const — rebuilds every time parent rebuilds<br>child: Padding(<br>  padding: EdgeInsets.all(16),<br>  child: Text(&#39;Static Label&#39;),<br>)<br><br>// With const — never rebuilds<br>child: const Padding(<br>  padding: EdgeInsets.all(16),<br>  child: Text(&#39;Static Label&#39;),<br>)</pre><p>Enable the prefer_const_constructors lint rule in your analysis_options.yaml. It&#39;ll flag every place you missed const. It&#39;s free performance.</p><p><strong>Repaint Boundary: Isolate Expensive Paints</strong></p><p>Some widgets are expensive to repaint - complex custom paintings, animated widgets. If they’re in the same repaint layer as everything else, any change in the widget tree triggers a full repaint.</p><pre>RepaintBoundary(<br>  child: ComplexAnimatedChart(), // This now has its own layer<br>)</pre><p>Now when your chart animates, only the chart’s layer is repainted. The rest of the screen stays untouched.</p><p><strong>ListView Optimization</strong></p><p>Using ListView with a children list? Every child is built upfront and kept in memory even if it&#39;s off-screen.</p><pre>// BAD for long lists<br>ListView(children: myItems.map((item) =&gt; ItemWidget(item)).toList())<br><br>// GOOD — builds only visible items<br>ListView.builder(<br>  itemCount: myItems.length,<br>  itemBuilder: (context, index) =&gt; ItemWidget(myItems[index]),<br>)</pre><p>For lists with varying item heights, add addAutomaticKeepAlives: false and addRepaintBoundaries: false if items don&#39;t need to keep state when scrolled off screen. This reduces memory significantly.</p><p><strong>Avoid Opacity Widget for Animations</strong></p><p>Opacity widget causes a repaint every frame during animation. Use AnimatedOpacity or better yet, FadeTransition with an AnimationController.</p><p>FadeTransition is composited on the GPU layer - no repaint needed. It&#39;s dramatically cheaper.</p><pre>// Expensive — repaints every frame<br>Opacity(opacity: _animation.value, child: myWidget)<br><br>// Cheap — GPU compositing only<br>FadeTransition(opacity: _animation, child: myWidget)</pre><p><strong>Image Performance</strong></p><ul><li>Always specify width and height on images - prevents layout recalculation</li><li>Use cacheWidth/cacheHeight to decode at display size, not original resolution</li><li>Use WebP format - 25-34% smaller than JPEG at equivalent quality</li><li>For lists, use FilterQuality.low — imperceptible to users, much faster to render</li></ul><p><strong>My Profiling Workflow</strong></p><ol><li>Run app in <strong>profile mode</strong> (flutter run --profile) - never profile in debug mode (JIT compilation, extra assertions)</li><li>Open DevTools Performance tab</li><li>Record the janky interaction</li><li>Find the frame that exceeded 16ms</li><li>Click it - see which widget’s build took the most time</li><li>Fix that specific widget, not something nearby</li></ol><blockquote>Targeted fixes &gt; blind optimizations every time.</blockquote><p>#Flutter #AppPerformance #FlutterDev #Optimization #MobileDevelopment #DartLang #Profiling</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5601872564f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Memory Management: What Nobody Tells You Until Your App Crashes]]></title>
            <link>https://medium.com/@vikank9891/flutter-memory-management-what-nobody-tells-you-until-your-app-crashes-1fd42434b22d?source=rss-570457969924------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fd42434b22d</guid>
            <category><![CDATA[flutter-memory-management]]></category>
            <category><![CDATA[memory-management]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[android-memory-leaks]]></category>
            <category><![CDATA[app-crash]]></category>
            <dc:creator><![CDATA[Vikas Gupta]]></dc:creator>
            <pubDate>Wed, 13 May 2026 04:31:07 GMT</pubDate>
            <atom:updated>2026-05-13T04:31:07.000Z</atom:updated>
            <content:encoded><![CDATA[<p>Memory leaks in Flutter are sneaky.</p><p>Your app looks fine in development. It passes QA. It ships. Three days later, you get crash reports from users with “out of memory” errors. You add memory monitoring, and you watch the app’s memory grow… and grow… and never come back down.</p><p>Here’s what’s actually happening and how to fix it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SlCWRBGSD0X1XH8xENj2Bw.png" /></figure><p><strong>How Dart Manages Memory</strong></p><p>Dart uses a <strong>generational garbage collector</strong>. Objects are placed in</p><ul><li><strong>New space (nursery) - </strong>short-lived objects. Collected frequently, cheaply.</li><li><strong>Old space - </strong>objects that survived multiple GC cycles. Collected less often.</li></ul><p>The GC is “stop-the-world” in short bursts — it pauses execution briefly to collect. Usually, this is imperceptible, but if you’re creating a massive number of objects in a tight loop, you can cause GC pressure that manifests as stuttering.</p><p><strong>The Most Common Memory Leak: StreamSubscriptions</strong></p><p>This is responsible for probably 70% of Flutter memory leaks I’ve seen in production code.</p><pre>// WRONG — leaks memory<br>class _MyWidgetState extends State&lt;MyWidget&gt; {<br>  @override<br>  void initState() {<br>    super.initState();<br>    someStream.listen((event) {<br>      // handle event<br>    });<br>  }<br>}</pre><p>What’s wrong? The StreamSubscription is never cancelled. Even after the widget is disposed, the subscription keeps the widget in memory. If you navigate back and forth 10 times, you now have 10 active subscriptions all holding references to 10 dead widgets.</p><pre>// CORRECT<br>class _MyWidgetState extends State&lt;MyWidget&gt; {<br>  StreamSubscription? _subscription;<br>  <br>  @override<br>  void initState() {<br>    super.initState();<br>    _subscription = someStream.listen((event) {<br>      // handle event<br>    });<br>  }<br>  <br>  @override<br>  void dispose() {<br>    _subscription?.cancel();<br>    super.dispose();<br>  }<br>}</pre><p>Rule: <strong>If you open it, close it in </strong><strong>dispose().</strong></p><p>AnimationControllers - The Silent Killers</p><pre>// WRONG<br>class _MyWidgetState extends State&lt;MyWidget&gt; with SingleTickerProviderStateMixin {<br>  late AnimationController _controller;<br>  <br>  @override<br>  void initState() {<br>    super.initState();<br>    _controller = AnimationController(vsync: this, duration: Duration(seconds: 1));<br>  }<br>  // No dispose!<br>}</pre><p>AnimationControllers keep ticking. They hold a reference to the TickerProvider (your State object). Without dispose(), the controller, the ticker, and your entire State subtree stay alive in memory.</p><pre>@override<br>void dispose() {<br>  _controller.dispose(); // Always!<br>  super.dispose();<br>}</pre><p><strong>TextEditingControllers and FocusNodes</strong></p><p>Same story. These must be explicitly disposed.</p><pre>class _FormState extends State&lt;MyForm&gt; {<br>  final _nameController = TextEditingController();<br>  final _emailController = TextEditingController();<br>  final _nameFocus = FocusNode();<br>  <br>  @override<br>  void dispose() {<br>    _nameController.dispose();<br>    _emailController.dispose();<br>    _nameFocus.dispose();<br>    super.dispose();<br>  }<br>}</pre><p>I’ve seen production apps with registration forms that created new controllers on every navigation but never disposed them. After enough navigations, the app ran out of memory.</p><p><strong>Image Caching</strong></p><p>CachedNetworkImage and even Flutter&#39;s built-in image cache can balloon your memory.</p><p>Flutter’s image cache defaults to storing the last 1000 images (up to 100MB). In an app showing a lot of images (e-commerce, social feed), this can be a problem.</p><pre>// Tune the cache size<br>PaintingBinding.instance.imageCache.maximumSize = 100; // max images<br>PaintingBinding.instance.imageCache.maximumSizeBytes = 50 * 1024 * 1024; // 50MB</pre><p>Also - avoid decoding images at their full resolution when you only need a thumbnail:</p><pre>Image.network(<br>  url,<br>  cacheWidth: 200,  // Decodes at 200px, much less memory<br>  cacheHeight: 200,<br>)</pre><p><strong>Using Flutter DevTools to Find Leaks</strong></p><ol><li>Open DevTools → Memory tab</li><li>Take a snapshot while navigating your app repeatedly</li><li>Look for objects with growing instance counts</li><li>Check “Unreachable objects” - those are your leaks</li></ol><p>The <strong>Allocation Tracing</strong> feature is gold. Enable it before triggering the suspected leak, then look at what was allocated and never freed.</p><p><strong>Practical Checklist</strong></p><p>Every StatefulWidget you write, ask yourself:</p><p>☑ Did I cancel all StreamSubscriptions in dispose()?<br>☑ Did I dispose all AnimationControllers?<br>☑ Did I dispose all TextEditingControllers and FocusNodes?<br>☑ Am I holding any large objects (images, buffers) that should be released?☑ Am I using mounted checks before calling setState in async callbacks?</p><blockquote><strong>Memory management isn’t glamorous. But it’s the difference between an app that feels solid after weeks of use and one that gets slower and crashes over time.</strong></blockquote><p>#Flutter #MemoryManagement #FlutterDev #DartLang #MobileDevelopment #AppPerformance #CleanCode</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fd42434b22d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dart Isolates: True Multithreading in Flutter (Most Devs Miss This)]]></title>
            <link>https://medium.com/@vikank9891/dart-isolates-true-multithreading-in-flutter-most-devs-miss-this-c05dee18122c?source=rss-570457969924------2</link>
            <guid isPermaLink="false">https://medium.com/p/c05dee18122c</guid>
            <category><![CDATA[multithreading-in-flutter]]></category>
            <category><![CDATA[isolates-in-flutter]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dart-isolates]]></category>
            <category><![CDATA[multithreading]]></category>
            <dc:creator><![CDATA[Vikas Gupta]]></dc:creator>
            <pubDate>Sat, 09 May 2026 11:48:54 GMT</pubDate>
            <atom:updated>2026-05-09T11:48:54.810Z</atom:updated>
            <content:encoded><![CDATA[<p>Let me ask you something.</p><p>You have a Flutter app. User taps a button. You need to parse a 50,000-row JSON file and build a sorted, filtered list from it.</p><p>You put it in a FutureBuilder. App freezes for 2 seconds. UI jank. User notices.</p><p>Why? Because <strong>Dart is single-threaded by default.</strong> Even async/await doesn&#39;t help here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uKftfV1yQqO0IkTf80wUKw.png" /></figure><p><strong>The Async Misconception</strong></p><p>Here’s what most Flutter devs get wrong early on:</p><p>async/await in Dart is <strong>concurrency, not parallelism.</strong></p><p>When you await a Future, you&#39;re not spawning a new thread. You&#39;re just yielding control back to the event loop while waiting for something (usually I/O). The moment you do CPU-heavy work (JSON parsing, encryption, image processing), async/await gives you nothing. It all runs on the same main thread, blocking your UI.</p><p><strong>Enter Isolates</strong></p><p>Dart’s answer to true multithreading is <strong>Isolates</strong>.</p><p>An Isolate is like a separate Dart VM. It has its own memory heap. It does NOT share memory with the main isolate. The only way to communicate is through <strong>message passing - </strong>you send a message, the other isolate processes it, sends back a message.</p><p>This design eliminates an entire class of bugs - no race conditions, no shared mutable state, no mutex locks. It’s clean.</p><p><strong>The Old Way - Spawning Isolates Manually</strong></p><pre>import &#39;dart:isolate&#39;;<br><br>Future&lt;List&lt;Item&gt;&gt; parseHeavyData(String rawJson) async {<br>  final receivePort = ReceivePort();<br>  <br>  await Isolate.spawn(_parseInBackground, {<br>    &#39;data&#39;: rawJson,<br>    &#39;sendPort&#39;: receivePort.sendPort,<br>  });<br>  <br>  return await receivePort.first as List&lt;Item&gt;;<br>}<br><br>void _parseInBackground(Map&lt;String, dynamic&gt; message) {<br>  final sendPort = message[&#39;sendPort&#39;] as SendPort;<br>  final data = message[&#39;data&#39;] as String;<br>  <br>  // This runs in a separate isolate — UI is free!<br>  final result = heavyParsing(data);<br>  sendPort.send(result);<br>}</pre><p>This works, but the setup is verbose and error-prone. Passing data back and forth manually is clunky.</p><p><strong>The Modern Way - </strong><strong>compute()</strong> <strong>and</strong> <strong>Isolate.run()</strong></p><p>Flutter gave us compute() which wraps isolate spawning:</p><pre>final result = await compute(parseHeavyData, rawJson);</pre><p>Simple. Clean. Does the same thing.</p><p>Dart 2.19 went a step further with Isolate.run():</p><pre>final result = await Isolate.run(() =&gt; parseHeavyData(rawJson));</pre><p>Even cleaner. You pass a closure, it runs in a new isolate, returns the result.</p><p><strong>When Should You Use Isolates?</strong></p><p>Use isolates when the work is:</p><ul><li><strong>CPU-bound</strong> (not I/O-bound) - parsing large JSON, encrypting files, complex calculations, image compression</li><li><strong>Time-consuming - </strong>anything that takes more than a few milliseconds</li></ul><p>Do NOT use isolates for:</p><ul><li>Network calls (use async/await - the OS handles I/O on a separate thread anyway)</li><li>Quick calculations</li><li>Anything that needs to touch the UI (isolates can’t touch widgets)</li></ul><p><strong>Long-Lived Isolates with Ports</strong></p><p>Sometimes you don’t want to spawn/kill an isolate for every operation. Think of a background sync service. You want a persistent isolate you can send messages to.</p><pre>class BackgroundWorker {<br>  late SendPort _sendPort;<br>  final _receivePort = ReceivePort();<br><br>  Future&lt;void&gt; init() async {<br>    await Isolate.spawn(_workerMain, _receivePort.sendPort);<br>    _sendPort = await _receivePort.first;<br>  }<br><br>  Future&lt;dynamic&gt; process(dynamic message) {<br>    final responsePort = ReceivePort();<br>    _sendPort.send([message, responsePort.sendPort]);<br>    return responsePort.first;<br>  }<br><br>  static void _workerMain(SendPort mainSendPort) {<br>    final workerReceivePort = ReceivePort();<br>    mainSendPort.send(workerReceivePort.sendPort);<br>    <br>    workerReceivePort.listen((message) {<br>      final data = message[0];<br>      final replyTo = message[1] as SendPort;<br>      <br>      // Do heavy work here<br>      final result = doHeavyWork(data);<br>      replyTo.send(result);<br>    });<br>  }<br>}</pre><p>This pattern is useful for apps that do a lot of continuous background processing - think real-time data sync, background encryption, or continuous audio processing.</p><p><strong>A Real-World Example: Image Processing</strong></p><p>I was working on a document scanning feature. User captures an image, we needed to:</p><ol><li>Detect edges</li><li>Apply perspective correction</li><li>Enhance contrast</li><li>Convert to PDF</li></ol><p>All on a 12-megapixel image. Doing this on the UI thread made the app completely unresponsive for 3–4 seconds.</p><p>Moving all four steps to an isolate: still took the same time, but the UI stayed completely responsive. The user saw a loading indicator, could even navigate away and come back.</p><p><strong>That’s the difference isolates make.</strong></p><p>#Flutter #Dart #Isolates #Multithreading #AppPerformance #FlutterDev #MobileDevelopment</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c05dee18122c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Flutter Actually Renders Your UI (The Engine Deep Dive)]]></title>
            <link>https://medium.com/@vikank9891/how-flutter-actually-renders-your-ui-the-engine-deep-dive-ef9af784be32?source=rss-570457969924------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef9af784be32</guid>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter-rendering-engine]]></category>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-engine]]></category>
            <dc:creator><![CDATA[Vikas Gupta]]></dc:creator>
            <pubDate>Thu, 07 May 2026 09:20:22 GMT</pubDate>
            <atom:updated>2026-05-09T11:46:23.154Z</atom:updated>
            <content:encoded><![CDATA[<p>If someone asks you, “How does Flutter work under the hood,” and you say “it uses widgets” - that’s like asking how a car engine works and saying “it uses fuel.”</p><p>Let me actually walk you through what happens from the moment you write Text(&quot;Hello&quot;) to when those pixels show up on screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9LnmlzV_tbWm0QfWYPl-w.png" /><figcaption>How Flutter Actually Renders Your UI</figcaption></figure><p><strong>Flutter has three layers. Most people only ever see one.</strong></p><p><strong>Layer 1 — The Dart Framework (what you write)</strong> This is everything you interact with - widgets, state, animations, gestures. When you call setState() or a stream emits, you&#39;re kicking off a process called the <em>build-layout-paint</em> pipeline.</p><p><strong>Layer 2 - The Flutter Engine (written in C++)</strong> This is where the real work happens. The engine handles:</p><ul><li>The Skia (or Impeller on newer builds) graphics library that actually draws pixels</li><li>The Dart runtime</li><li>The rendering pipeline</li><li>Platform channel communication</li></ul><p><strong>Layer 3 - The Embedder</strong> This is what makes Flutter run on Android, iOS, Web, and Desktop. Each platform has its own embedder that exposes a canvas (called a FlutterView) to the engine and handles lifecycle events.</p><p><strong>The Rendering Pipeline — Step by Step</strong></p><p>Every frame goes through this exact sequence:</p><p><strong>1. Build Phase</strong> Flutter calls build() on every dirty widget. This produces a tree of widget objects. Widgets are <em>immutable descriptions</em> — they&#39;re cheap to create and throw away.</p><p><strong>2. Element Tree</strong> Behind every widget is an Element. Elements are the <em>mutable, long-lived</em> objects that maintain state between rebuilds. When Flutter rebuilds, it diffs the old widget tree against the new one using the element tree as the reconciler. This is similar to React&#39;s virtual DOM, but more efficient because Flutter knows widget types at compile time.</p><p><strong>3. RenderObject Tree</strong> Elements that involve actual layout (like Container, Row, Column) create RenderObjects. These are responsible for layout() and paint(). This tree is separate from the widget tree — and it&#39;s the one that actually knows the size and position of everything.</p><p><strong>4. Layout Pass</strong> Flutter walks the render tree top-down passing <em>constraints</em> (min/max width and height) to each node. Each node calculates its own size and passes constraints down to children. Then sizes bubble back up. This is the famous “constraints go down, sizes go up, parent sets position” model.</p><p><strong>5. Paint Pass</strong> Flutter walks the render tree and calls paint() on each RenderObject. This generates a list of drawing commands.</p><p><strong>6. Compositing</strong> The engine takes all paint layers and composites them. Some widgets (like animations, clips, opacity) create their own <em>layers</em> that can be composited on the GPU independently — this is why RepaintBoundary is such a useful performance optimization.</p><p><strong>7. Rasterization (GPU)</strong> Finally, the composed scene is rasterized by the GPU and sent to the display.</p><p><strong>Two Threads That Matter</strong></p><p>Flutter runs on two critical threads:</p><ul><li><strong>UI Thread - </strong>runs your Dart code, builds the widget tree, runs the build/layout/paint pipeline</li><li><strong>Raster Thread - </strong>runs on the GPU side, does the actual rasterization</li></ul><p>If either thread takes more than ~16ms per frame (for 60fps), you drop frames. This is why heavy work in build() or synchronous I/O will visibly stutter your app.</p><p><strong>Impeller vs Skia</strong></p><p>Flutter historically used Skia for rendering. The problem? Skia compiles shaders at runtime - causing jank the first time a new visual appears (you’ve seen that stutter the first time an animation plays).</p><p>Impeller, Flutter’s new rendering engine, pre-compiles all shaders at build time. No more first-frame jank. It’s now the default on iOS and coming to Android.</p><p><strong>Why This Matters for You as a Developer</strong></p><p>Once you understand the three trees (widget → element → renderObject), a lot of Flutter’s “weird” behavior starts making sense:</p><ul><li>Why const widgets skip rebuilds (same element, no new widget)</li><li>Why RepaintBoundary helps performance (isolates repaint layer)</li><li>Why GlobalKey is expensive (it moves elements across the tree)</li><li>Why ListView.builder is fast (only builds visible elements)</li></ul><p>This isn’t just trivia. When you’re debugging jank with Flutter DevTools, and you see a frame spike on the raster thread, you know exactly where to look.</p><blockquote><strong>Understanding your tools at this level is what separates a developer who can build from a developer who can build fast.</strong></blockquote><p>#Flutter #FlutterDev #MobileDevelopment #DartLang #SoftwareEngineering #FlutterEngine #AppDevelopment</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef9af784be32" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlock the Power of External App Integration in Flutter with external_app_launcher]]></title>
            <link>https://medium.com/@vikank9891/unlock-the-power-of-external-app-integration-in-flutter-with-external-app-launcher-e4441d57c9a3?source=rss-570457969924------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4441d57c9a3</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[external-app-launcher]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[third-party-integrations]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Vikas Gupta]]></dc:creator>
            <pubDate>Wed, 26 Jun 2024 16:31:23 GMT</pubDate>
            <atom:updated>2024-06-26T16:31:23.628Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0abhKbpt-SPAmEPUnFH6aA.png" /><figcaption>Flutter Mobile Demo App</figcaption></figure><p>Hey Flutter enthusiasts!</p><p>I recently came across a gem of a library on the <a href="https://pub.dev/">pub.dev</a> called external_app_launcher, and I had to share my experience with you all. If you’re looking to enhance your Flutter app by launching external applications seamlessly, this is the library you need.</p><p><strong>Why I Love </strong><a href="https://pub.dev/packages/external_app_launcher"><strong>external_app_launcher</strong></a></p><p>In my latest project, I needed a way to open other apps directly from my Flutter app. After some research, I stumbled upon external_app_launcher, it was exactly what I was looking for. Not only does it simplify the process, but it also offers a smooth user experience.</p><blockquote><strong>Getting Started</strong></blockquote><p>First things first, adding the external_app_launcher to your project is a breeze. Just add it to your pubspec.yaml:</p><pre>dependencies:<br>  external_app_launcher: </pre><p><em>(Always check for the latest version on </em><strong><em>pub.dev</em></strong><em>).</em></p><blockquote>How to Use It</blockquote><p>Using this library is straightforward. Here’s a quick example to get you started:</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:external_app_launcher/external_app_launcher.dart&#39;;<br><br>void main() {<br>  runApp(MyApp());<br>}<br><br>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      home: Scaffold(<br>        appBar: AppBar(<br>          title: Text(&#39;External App Launcher Example&#39;),<br>        ),<br>        body: Center(<br>          child: ElevatedButton(<br>            onPressed: () async {<br>              await LaunchApp.openApp(<br>                androidPackageName: &#39;com.example.app&#39;,<br>                iosUrlScheme: &#39;example://&#39;,<br>                openStore: true,<br>              );<br>            },<br>            child: Text(&#39;Open External App&#39;),<br>          ),<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><blockquote><em>Features That Stand Out</em></blockquote><ol><li>Cross-Platform Support: Whether you’re developing for Android or iOS, external_app_launcher has you covered.</li><li>Flexibility: You can specify different parameters such as package name for Android or URL scheme for iOS.</li><li>Store Fallback: If the app isn’t installed, you can redirect users to the respective app store, ensuring a seamless experience.</li></ol><blockquote><strong><em>Conclusion</em></strong></blockquote><p>If you’re working on a Flutter project that requires interaction with other apps, I highly recommend giving external_app_launcher a try. It’s efficient, easy to implement, and backed by a strong community.</p><p>#flutter #external_app_launcher #thirdpartyintegration #mobiledevelopment</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4441d57c9a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>