<?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 Balaji Malathi on Medium]]></title>
        <description><![CDATA[Stories by Balaji Malathi on Medium]]></description>
        <link>https://medium.com/@mr.rabbitt?source=rss-26adc92a50ef------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nv4pKyH-XqNGrhNrOHpPKA.png</url>
            <title>Stories by Balaji Malathi on Medium</title>
            <link>https://medium.com/@mr.rabbitt?source=rss-26adc92a50ef------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 18:12:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mr.rabbitt/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[Bridging shadcn/ui and Flutter: Why I Built shadcn_chart]]></title>
            <link>https://medium.com/@mr.rabbitt/bridging-shadcn-ui-and-flutter-why-i-built-shadcn-chart-34704ed5600b?source=rss-26adc92a50ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/34704ed5600b</guid>
            <category><![CDATA[webview]]></category>
            <category><![CDATA[shadcn]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-webview]]></category>
            <dc:creator><![CDATA[Balaji Malathi]]></dc:creator>
            <pubDate>Wed, 01 Jul 2026 05:43:22 GMT</pubDate>
            <atom:updated>2026-07-01T05:43:22.089Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BkKEgtQhy7qFP2Ez5TcTLA.png" /></figure><h3>The Gap I Kept Running Into</h3><p>I spend a lot of time in Flutter. It’s my go-to for building apps that need to work across mobile, desktop, and web with a single codebase. And like anyone building data-driven apps, I need charts — good-looking, interactive charts that don’t look like an afterthought.</p><p>The existing options in Flutter are okay, but they left me wanting.</p><p><strong>fl_chart</strong> is solid and open-source. But it draws everything on a Canvas, and the output — especially for complex interactive charts — never quite matches the polish of modern web charting libraries. The animations feel a bit stiff, tooltip customization is limited, and achieving shadcn/ui-level visual refinement means writing your own renderer.</p><p><strong>Syncfusion</strong> is powerful, feature-packed, and performs well. But it’s a commercial library, the license cost adds up, and the visuals — while functional — still carry that “enterprise widget” DNA. The charting API also pushes you into Syncfusion’s own ecosystem with their specific data-binding patterns.</p><p>Then there’s <strong>shadcn/ui</strong>. If you’re in the React ecosystem, you know it’s been a revelation — beautifully designed, copy-paste-able components that look and feel premium. Their chart components, built on Recharts, are particularly stunning. Clean typography, smooth tooltips, responsive by default, and they inherit your app’s theme seamlessly.</p><p>I kept thinking: <em>Why can’t I have these charts in Flutter?</em></p><p>So I built the bridge.</p><h3>The Approach: WebView ≠ WebView</h3><p>The obvious reaction is “just use a WebView.” And honestly, that’s what I started with. But I had specific requirements:</p><ol><li><strong>Zero network access at runtime</strong> — I don’t want my charts breaking because someone’s on a spotty connection or the CDN is down.</li><li><strong>Native Dart API</strong> — I don’t want to write JavaScript strings in my Flutter code. I want typed models, autocomplete, compile-time safety.</li><li><strong>Automatic theme inheritance</strong> — When I toggle dark mode in my Flutter app, the charts should follow.</li><li><strong>Interactive and responsive</strong> — Tooltips, clickable legends, time-range selectors — all the good stuff.</li></ol><p>Here’s the architecture I landed on:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PDTr_zDkMWZpHU00mxvc4g.png" /></figure><p>The Dart side defines <strong>typed chart models</strong> — InteractiveLineChartData, AreaChartData, PieDonutChartData, and so on. Each model has a toJson() method. When the widget builds, it serializes the chart data to JSON, finds the right bundled HTML renderer for that chart type, and loads it — all from local package assets. The WebView bridge applies the host Flutter theme as CSS variables before the React bundle even finishes loading, so there&#39;s no flash of unstyled content.</p><h3>What’s Under the Hood</h3><p>The HTML renderers are built with React + Vite + Recharts + shadcn/ui components. The build pipeline lives in renderers/ in the repo. When I change a template, I run:</p><pre>cd renderers<br>npm install<br>npm run build:package-assets</pre><p>This produces single-file HTML outputs — one per chart type — that get copied to assets/charts/ and bundled into the Flutter package. Each file is self-contained: inlined CSS, inlined JavaScript, no external dependencies. That&#39;s how zero network access is guaranteed.</p><p>The theme bridge is the bit I’m proudest of. Instead of making you pass colors explicitly through the Dart API (which you can, if you want), <strong>the widget reads </strong><strong>Theme.of(context) automatically</strong>, maps the color scheme to CSS variables, and injects them into the WebView before rendering. Swap between light and dark mode in Flutter, and the chart follows — no additional code.</p><p>Here’s a glimpse of the API in practice:</p><pre>ShadcnChartView(<br>  data: InteractiveLineChartData(<br>    title: &#39;Visitors&#39;,<br>    description: &#39;Last 7 days&#39;,<br>    activeSeriesKey: &#39;desktop&#39;,<br>    series: const [<br>      ChartSeries(key: &#39;desktop&#39;, label: &#39;Desktop&#39;, color: Colors.teal),<br>      ChartSeries(key: &#39;mobile&#39;, label: &#39;Mobile&#39;, color: Colors.deepOrange),<br>    ],<br>    data: [<br>      TimeSeriesPoint(<br>        date: DateTime(2026, 6, 1),<br>        values: const {&#39;desktop&#39;: 120, &#39;mobile&#39;: 98},<br>      ),<br>      TimeSeriesPoint(<br>        date: DateTime(2026, 6, 2),<br>        values: const {&#39;desktop&#39;: 140, &#39;mobile&#39;: 125},<br>      ),<br>    ],<br>  ),<br>)</pre><h3>Seven Chart Types, One Consistent API</h3><p>ChartDart ModelBest ForInteractive AreaAreaChartDataTime-series with range filteringInteractive BarInteractiveBarChartDataDate-based comparisonsMultiple BarMultipleBarChartDataCategory-based grouped barsInteractive LineInteractiveLineChartDataTrend visualizationDonut PiePieDonutChartDataPercentage breakdownsLegend PiePieLegendChartDataPie charts with legendStacked RadialRadialStackedChartDataSingle-value radial gauges</p><p>Every chart type follows the same pattern: create a data object, pass it to ShadcnChartView, and you&#39;re done. For dynamic updates, there&#39;s ShadcnChartController:</p><pre>final controller = ShadcnChartController();</pre><pre>// Later, update with new data<br>await controller.updateData(nextChartData);</pre><h3>Why This Matters</h3><p>The Flutter ecosystem is mature enough that we should be reaching for the best rendering engine for each job. Canvas is great for simple custom drawings. But when you want premium, interactive, shadcn/ui-quality charts — the kind your users judge your app’s polish by — you should be able to leverage the web rendering stack without feeling like you’re hacking something together.</p><p>shadcn_chart is my attempt to make that seamless. One dependency, zero runtime network calls, typed Dart models, automatic theme support, and seven chart types that look like they belong in a polished production app.</p><p>The package is MIT-licensed, open-source, and sitting on <a href="https://pub.dev/packages/shadcn_chart">pub.dev</a> right now. The code is on <a href="https://github.com/balajimalathi/shadcn-chart">GitHub</a>. I’d love feedback, PRs, and ideas for what to build next.</p><h3>Related Resources</h3><ul><li><a href="https://pub.dev/packages/shadcn_chart">shadcn_chart on pub.dev</a></li><li><a href="https://github.com/balajimalathi/shadcn-chart">GitHub repository</a></li><li><a href="https://ui.shadcn.com/charts">shadcn/ui Charts</a></li><li><a href="https://recharts.org/">Recharts</a></li><li><a href="https://pub.dev/packages/flutter_inappwebview">flutter_inappwebview</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34704ed5600b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How do I migrate the mobile app from Cordova to Flutter?]]></title>
            <link>https://medium.com/@mr.rabbitt/how-i-migrated-mobile-app-from-cordova-to-flutter-dd3165c0c3c3?source=rss-26adc92a50ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd3165c0c3c3</guid>
            <category><![CDATA[migrate]]></category>
            <category><![CDATA[cordova]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Balaji Malathi]]></dc:creator>
            <pubDate>Sun, 26 Jun 2022 17:33:13 GMT</pubDate>
            <atom:updated>2024-03-01T01:21:23.200Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKO07PtU2uq632nwGa94Ew.png" /></figure><p>Recently I have faced the challenge of migrating data from the existing Cordova app in the playstore to the flutter app.</p><p>Have you heard about Apache Cordova? I am not. After googling, I know what it is.</p><p><em>Apache Cordova is an open-source mobile development framework. It allows you to use standard web technologies such as HTML5, CSS3, and JavaScript for cross-platform development, avoiding each mobile platforms’ native development language. Applications execute within wrappers targeted to each platform, and rely on standards-compliant API bindings to access each device’s sensors, data, and network status.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o7TKEP6YngkCKFofC%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3o7TKEP6YngkCKFofC%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExN282bmR6cWp4Y3RkdGdzOW9sbm1seXF5OXRlOGtyY2E0OWplZ25ubSZlcD12MV9naWZzX2dpZklkJmN0PWc%2F3o7TKEP6YngkCKFofC%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="328" frameborder="0" scrolling="no"><a href="https://medium.com/media/afb6b9740b42f6ea895220040c234c8a/href">https://medium.com/media/afb6b9740b42f6ea895220040c234c8a/href</a></iframe><p>What are my choices for migrating?</p><blockquote>Local database</blockquote><blockquote>SharedPreference</blockquote><p>Luckily there was a local database and sharedpreference in the app folder but both are failures.</p><p>I tried Sqlite Browser to check if any data stored in local database. There are two tables with zero records. There is sharedpreference file named WLPrefs.xml (Worklight Preferences). Some data is there but there is no use of them after checking with the Bank people.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FTseBjMu53JgWc%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FTseBjMu53JgWc%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FTseBjMu53JgWc%2F200w.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="441" frameborder="0" scrolling="no"><a href="https://medium.com/media/a026cc62b77a4c3b09c14ef8d1f4f037/href">https://medium.com/media/a026cc62b77a4c3b09c14ef8d1f4f037/href</a></iframe><p>Where the local data is stored, I have no idea and confess the bank officials. But they are not willing to make the 100k+ users to login again after update. Then I had a call with my team leader and managing director (techie) but they both are out of ideas of migrating. Then i was doomed.</p><p>Bank officials arrange a meeting with a Cordova developer as a last hope. He jumped in the code and somehow run it in the Browser(WTH). And showed the local data is stored as Local storage (which is browser thing) in a browser. I absolutely have no idea who can I access the local storage data in flutter. Sit back, relax and listen to my struggle.</p><p>I found there is a folder named app_webview in Cordova app folder. After exploring app_webview there was a file as 0000003.log, which is an UTF-8 encoded file. I opened the file in Notepad. It is messy but I found the information which I saw in the browser. But updated flutter app is not creating app_webview folder.</p><blockquote>How to create a app_webview folder in flutter app directory?</blockquote><p>I created a webview page <em>(webview_flutter: ^3.0.4). </em>It is automatically created a app_webview.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F5VKbvrjxpVJCM%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F5VKbvrjxpVJCM%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExcjVjdzR1YjNuYXVyMnZtdzdlcWR1YmlzMDZuYTJ4MG4ybXR1OXUwOSZlcD12MV9naWZzX2dpZklkJmN0PWc%2F5VKbvrjxpVJCM%2Fgiphy.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="348" frameborder="0" scrolling="no"><a href="https://medium.com/media/65b6e44ba9e7b9cb7450d4bf47648491/href">https://medium.com/media/65b6e44ba9e7b9cb7450d4bf47648491/href</a></iframe><p>I found that the flutter is creating file or folder if they are not existing.</p><blockquote>How to get data from the app_webview folder?</blockquote><p>There are a package called localstorage: ^4.0.0+1. But there is no use of it. Because there localstorage save it in a seperate file.</p><p>So I created a file as below,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/821c7fc71d018ed60559dd7bd8197307/href">https://medium.com/media/821c7fc71d018ed60559dd7bd8197307/href</a></iframe><p>It looks kind a messy but the you may have some unsorted information in the 0000003.log file. I prefer this way to extract the information you want. Save it in asset folder. But you can’t load this file in Webview from asset folder, instead you have to give the URL directly from the app_folder. Set this file as Webview URL.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2464d04242c890cd1abfeeafec03a413/href">https://medium.com/media/2464d04242c890cd1abfeeafec03a413/href</a></iframe><p>You will get the localstorage information, in Javascript channel in MyHandler when the Webview is loaded.</p><blockquote>Do not call the Webview for the second time. After you get the JavascriptMessage save the data in the SharedPreference.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F5GoVLqeAOo6PK%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F5GoVLqeAOo6PK%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F5GoVLqeAOo6PK%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="339" frameborder="0" scrolling="no"><a href="https://medium.com/media/3174f7570f1567cfe7f1b63461f3e5c6/href">https://medium.com/media/3174f7570f1567cfe7f1b63461f3e5c6/href</a></iframe><p>It took almost a day to figure out the solution for this problem. It is really a new experience to migrate data from existing app.</p><p>If you want to migrate information from Cordova to Flutter this is one of the way to do. I used this way to migrate data for Banking app.</p><blockquote>Conclusion: If you ever stuck with something impossible, take a step back and break the tasks into small chunks. Complete one by one. You will get a motivation after completing each one of them. Life is really simple, we are the one, making it complex. Cheers.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd3165c0c3c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>