<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yadnesh Teli</title>
    <description>The latest articles on DEV Community by Yadnesh Teli (@yadneshteli).</description>
    <link>https://dev.to/yadneshteli</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1560506%2F7d406e74-fec5-48a2-a6e3-33397c4f5db5.jpg</url>
      <title>DEV Community: Yadnesh Teli</title>
      <link>https://dev.to/yadneshteli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yadneshteli"/>
    <language>en</language>
    <item>
      <title>Building a Flutter Shopping App from Scratch — Part 1: Scaffolding Models, Providers, and Screens</title>
      <dc:creator>Yadnesh Teli</dc:creator>
      <pubDate>Tue, 06 Oct 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/yadneshteli/building-a-flutter-shopping-app-from-scratch-part-1-scaffolding-models-providers-and-screens-5d0c</link>
      <guid>https://dev.to/yadneshteli/building-a-flutter-shopping-app-from-scratch-part-1-scaffolding-models-providers-and-screens-5d0c</guid>
      <description>&lt;p&gt;&lt;em&gt;Series 1 of 2 — Part 1 of 5&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Building a Flutter Shopping App from Scratch — Part 1: Scaffolding Models, Providers, and Screens
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Series: Building a Flutter Shopping App — From Zero to Architecture&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every Flutter developer I know has at some point just started writing code without thinking too much about architecture. I was no different. When my internship mentor gave me a shopping app to build as a learning project, I opened VS Code and started typing.&lt;/p&gt;

&lt;p&gt;This post covers what I built on day one — the models, providers, and screens — and why I made the choices I made, even if some of them turned out to be wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  The project brief
&lt;/h2&gt;

&lt;p&gt;A standard e-commerce shopping app. Products, categories, a cart, a favourites list, and user authentication. Nothing groundbreaking, but enough to force you to think about state, data flow, and UI structure.&lt;/p&gt;

&lt;p&gt;At this point in my Flutter journey I had a basic understanding of widgets and &lt;code&gt;StatefulWidget&lt;/code&gt;s. I had read about Provider but not really used it properly. I did not know what MVVM was.&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting with models
&lt;/h2&gt;

&lt;p&gt;The first thing I did was define my data structures. A product has a name, price, image URL, and category. A category is just an id and a label.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ProductModel&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;imageUrl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;categoryId&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="n"&gt;ProductModel&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="kd"&gt;required&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="kd"&gt;required&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="kd"&gt;required&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="kd"&gt;required&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;imageUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="kd"&gt;required&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;categoryId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clean enough to start with. At this stage I was not thinking about &lt;code&gt;fromJson&lt;/code&gt; or &lt;code&gt;toJson&lt;/code&gt; — that would come back to bite me later when I integrated Firestore.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building the providers
&lt;/h2&gt;

&lt;p&gt;I used Riverpod for state management. I created providers for products, categories, cart, favourites, and search. Each was a &lt;code&gt;StateNotifier&lt;/code&gt; that held a list and exposed methods to add, remove, and filter items.&lt;/p&gt;

&lt;p&gt;The cart provider looked reasonable at first. But there was a problem I did not see yet — it had no concept of the current user. The cart data was global. If two users logged in on the same device, they would share the same cart. This is the kind of issue you only discover when you try to add authentication.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up screens
&lt;/h2&gt;

&lt;p&gt;I built three screens: &lt;code&gt;HomeScreen&lt;/code&gt;, &lt;code&gt;CartScreen&lt;/code&gt;, and &lt;code&gt;FavouritesScreen&lt;/code&gt;. The &lt;code&gt;HomeScreen&lt;/code&gt; had a product grid, category filters, and a search bar with debounce. The &lt;code&gt;CartScreen&lt;/code&gt; showed cart items with quantities. The &lt;code&gt;FavouritesScreen&lt;/code&gt; was a responsive grid of saved products.&lt;/p&gt;

&lt;p&gt;I also added Device Preview at this stage, which turned out to be a good decision. It caught several responsive layout bugs early without needing to switch simulators.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I got right
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Using Riverpod from the start&lt;/strong&gt;: Even my naive providers were easier to manage than raw &lt;code&gt;setState&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separating models early&lt;/strong&gt;: Gave me a consistent data layer before I understood the full architecture.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adding Device Preview early&lt;/strong&gt;: Surfaced layout bugs while they were still cheap to fix.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I got wrong
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Global user state&lt;/strong&gt;: Cart and favourites providers had no concept of the current user — state was global.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leaking business logic&lt;/strong&gt;: Business logic was leaking into the UI layer — screens called provider methods with too much knowledge of storage internals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tangled data sources&lt;/strong&gt;: No repositories. API calls, local storage reads, and state updates were all tangled inside the same providers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is coming next
&lt;/h2&gt;

&lt;p&gt;In Part 2 I add authentication — Firebase login, signup, Google Sign-In, and the surprisingly tricky problem of merging accounts when a user signs up with email and then tries to log in with Google using the same address.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Next: Part 2 — Adding Firebase Auth, Google Sign-In, and Account Merging&lt;/em&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>riverpod</category>
      <category>beginners</category>
    </item>
    <item>
      <title>My Flutter Internship Learning Journey: Two Projects, One Progression</title>
      <dc:creator>Yadnesh Teli</dc:creator>
      <pubDate>Mon, 05 Oct 2026 13:03:33 +0000</pubDate>
      <link>https://dev.to/yadneshteli/my-flutter-internship-learning-journey-two-projects-one-progression-103e</link>
      <guid>https://dev.to/yadneshteli/my-flutter-internship-learning-journey-two-projects-one-progression-103e</guid>
      <description>&lt;p&gt;&lt;em&gt;Intro Post&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  My Flutter Internship Learning Journey: Two Projects, One Progression
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;A Dev.to blog series about learning Flutter the hard way — and then the right way.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I am an MCA student based in Mumbai, currently doing a Flutter developer internship. Over the past few weeks I built two Flutter apps as part of my learning journey. On the surface they look similar — both are Flutter apps, both deal with real features, both use Riverpod. But the way I approached them could not have been more different.&lt;/p&gt;

&lt;p&gt;The first project, a shopping app, started with zero knowledge of proper Flutter architecture. I just started building — models, providers, screens — figuring things out as I went. Halfway through, I realised the codebase was becoming hard to manage. So I stopped and refactored the entire thing to MVVM with repositories and viewmodels. It was painful but I learned more from that refactor than from anything else.&lt;/p&gt;

&lt;p&gt;The second project, DevFeed — a Hacker News reader — is where I applied everything I had just learned. I set up MVVM from the first commit. I never had to do a big painful refactor because the architecture was right from day one. It shipped to v1.0.1 with a changelog and a GitHub Actions release workflow.&lt;/p&gt;

&lt;p&gt;These two projects together tell a story I think a lot of Flutter beginners will relate to. So I am writing about both, as two parallel series.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the two series cover
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Series 1 — Building a Flutter Shopping App: From Zero to Architecture&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This follows the shopping app from scratch. You will see me build it the naive way, hit the walls, and then migrate to proper MVVM. If you have ever written Flutter code that became a mess and wondered how to fix it, this series is for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Series 2 — Building DevFeed: A Proper Flutter MVVM App from Day One&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This follows DevFeed from the first commit. No big refactor needed — because the architecture was planned upfront. This series shows what it looks like when you apply the lessons from Series 1 before you start writing features.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beyond the Basics: Deep Dives &amp;amp; State Management Alternatives&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Following both projects, I also explore alternative paradigms that broadened my engineering toolkit: GetX, Flutter BLoC, Supabase as a Firebase alternative, implicit &amp;amp; explicit animations, and GraphQL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who this is for
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Flutter beginners who are learning by building real projects&lt;/li&gt;
&lt;li&gt;Students doing internships who want to write production-quality code&lt;/li&gt;
&lt;li&gt;Anyone who has built a messy Flutter app and wants to understand MVVM&lt;/li&gt;
&lt;li&gt;Anyone curious about what a real learning-in-public journey looks like&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The tech stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Flutter &amp;amp; Dart&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Riverpod&lt;/strong&gt; for state management&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Firebase Auth, Firestore, FCM&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MVVM architecture&lt;/strong&gt; with repositories and viewmodels&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Actions&lt;/strong&gt; for CI/CD automation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to follow along
&lt;/h2&gt;

&lt;p&gt;I will post both series in parallel, alternating weekly. Start with Series 1 Part 1 and Series 2 Part 1 simultaneously — they set up the contrast that makes the whole journey make sense.&lt;/p&gt;

&lt;p&gt;Let us get into it.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>DartBox Buddy: Running Flutter On-Device with a Local Gemma 4 AI Tutor for My Friend</title>
      <dc:creator>Yadnesh Teli</dc:creator>
      <pubDate>Mon, 05 Oct 2026 04:32:27 +0000</pubDate>
      <link>https://dev.to/yadneshteli/dartbox-buddy-running-flutter-on-device-with-a-local-gemma-4-ai-tutor-for-my-friend-1g53</link>
      <guid>https://dev.to/yadneshteli/dartbox-buddy-running-flutter-on-device-with-a-local-gemma-4-ai-tutor-for-my-friend-1g53</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01"&gt;Hacktoberfest Weekend Challenge: Build for a Friend&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;A close friend of mine has wanted to learn Flutter for months. They had great app ideas—little personal tools, habit logs, and clean interfaces—but every time they sat down to start, reality hit them like a wall:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Setup Monster&lt;/strong&gt;: First came downloading gigabytes of Android Studio, fighting Gradle daemon memory errors, configuring Java home variables, and waiting 10 minutes for an initial build. By the time the emulator booted, their creative momentum was completely gone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Layout Maze&lt;/strong&gt;: When they finally got code running, Flutter layouts proved deceptively tricky. Misunderstanding &lt;code&gt;Row&lt;/code&gt; vs &lt;code&gt;Column&lt;/code&gt; constraints, getting mysterious black-and-yellow striped overflow errors, and not knowing why an element vanished caused endless frustration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Closed AI Trap&lt;/strong&gt;: They tried pasting questions into cloud AI assistants, but web playgrounds only produced browser mockups, closed APIs demanded $20/month subscriptions, and personal daily habit ideas were being shipped to third-party corporate servers.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I realized what my friend needed wasn't another thick tutorial or a heavy laptop IDE. They needed a &lt;strong&gt;playful sandbox right in their pocket&lt;/strong&gt;: an app where they could experiment with layouts on the subway, see changes instantly on a real touch screen, and have a patient, private mentor guiding them through every mistake.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DartBox Buddy&lt;/strong&gt; is an on-device Flutter development studio and AI tutor that runs entirely on a mobile phone.&lt;/p&gt;

&lt;p&gt;With DartBox Buddy, you can open any &lt;code&gt;.dart&lt;/code&gt; file on your phone, tap &lt;strong&gt;Run&lt;/strong&gt;, and watch it compile and mount as an interactive, live native Flutter widget in &lt;strong&gt;under 100 milliseconds&lt;/strong&gt;—with &lt;strong&gt;zero project setup, no laptop, no command-line tools, and no internet connection required&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Sitting beside you in the editor is an on-device AI mentor powered by &lt;strong&gt;Google Gemma 4 E2B&lt;/strong&gt; running via LiteRT-LM. When a layout breaks or a compiler error occurs, Gemma analyzes the AST on your phone, explains the visual hierarchy in plain English, and auto-repairs code before mounting it on screen.&lt;/p&gt;

&lt;p&gt;To solve my friend's layout struggles from day one, DartBox bundles &lt;strong&gt;6 Progressive Layout Lessons&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Centering &amp;amp; Text&lt;/strong&gt;: &lt;code&gt;Center&lt;/code&gt;, &lt;code&gt;Container&lt;/code&gt;, padding, and decoration basics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Padding &amp;amp; Margins&lt;/strong&gt;: Visualizing inner space vs outer margin boundaries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Row &amp;amp; Column Alignment&lt;/strong&gt;: Mastering &lt;code&gt;mainAxisAlignment&lt;/code&gt; and &lt;code&gt;crossAxisAlignment&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stack &amp;amp; Positioned&lt;/strong&gt;: Layering badges, floating tags, and overlapping cards.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scrollable Card Feed&lt;/strong&gt;: Constructing lists with &lt;code&gt;ListView&lt;/code&gt;, &lt;code&gt;Card&lt;/code&gt;, and &lt;code&gt;ListTile&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive State&lt;/strong&gt;: Connecting taps to layout updates using &lt;code&gt;StatefulWidget&lt;/code&gt; and &lt;code&gt;setState&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Bundled lessons are read-only templates: editing any lesson automatically forks a custom copy into "My Scripts" so original reference lessons are never overwritten.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj72jjlsjo9ighodl46ta.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj72jjlsjo9ighodl46ta.jpg" alt="DartBox Buddy mobile studio running on a smartphone displaying dark-mode code editor with live Flutter widget preview and on-device Google Gemma 4 AI tutor recommendation pill"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  User Workflow
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────────────────────────────────────────────────┐
│  DartBox Buddy Studio (On-Device Mobile Engine)        │
│                                                        │
│  [Code Editor] ──(Compiles in &amp;lt;100ms)──&amp;gt; [Live Widget] │
│        ▲                                       │       │
│        │                                       ▼       │
│   Auto-Repair &amp;lt;── [On-Device Gemma 4] &amp;lt;── [Errors/AST] │
└────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  My Friend's Reaction
&lt;/h3&gt;

&lt;p&gt;When I handed the phone to my friend and opened Lesson 3 (Row &amp;amp; Column Alignment), their first question was:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Wait, where's the laptop? How is this running without Android Studio open?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Within five minutes, they had changed the button padding, flipped the alignment from &lt;code&gt;spaceEvenly&lt;/code&gt; to &lt;code&gt;spaceBetween&lt;/code&gt;, and used the &lt;strong&gt;Gemma AI Tutor&lt;/strong&gt; to ask why their text wasn't centered. For the first time, learning Flutter felt as fast and playful as playing a mobile game.&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📂 &lt;strong&gt;GitHub Repository&lt;/strong&gt;: &lt;a href="https://github.com/yadneshteli/dartbox" rel="noopener noreferrer"&gt;https://github.com/yadneshteli/dartbox&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📜 &lt;strong&gt;License&lt;/strong&gt;: MIT&lt;/li&gt;
&lt;li&gt;🤖 &lt;strong&gt;AI Model Used&lt;/strong&gt;: &lt;a href="https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm" rel="noopener noreferrer"&gt;Google Gemma 4 E2B LiteRT-LM&lt;/a&gt; (Open-weight, Apache-2.0)&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Built With&lt;/strong&gt;: Flutter, &lt;code&gt;flutter_eval&lt;/code&gt;, &lt;code&gt;flutter_gemma&lt;/code&gt;, LiteRT
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clone and run locally&lt;/span&gt;
git clone https://github.com/yadneshteli/dartbox.git
&lt;span class="nb"&gt;cd &lt;/span&gt;dartbox
flutter pub get
flutter run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;DartBox Buddy connects two cutting-edge open technologies:&lt;/p&gt;
&lt;h3&gt;
  
  
  1. The On-Device Flutter Runtime (&lt;code&gt;flutter_eval&lt;/code&gt; + &lt;code&gt;dart_eval&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;The host app runs standard Flutter compiled for Android. When the user edits code, DartBox passes the source string to the on-device &lt;code&gt;Compiler&lt;/code&gt; with &lt;code&gt;flutterEvalPlugin&lt;/code&gt;, producing platform-agnostic EVC bytecode in memory. The &lt;code&gt;RuntimeWidget&lt;/code&gt; mounts the bytecode as a live widget tree with interactive touch gestures and state management (&lt;code&gt;setState&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;To ensure my friend wasn't restricted to basic containers, we bridged essential Flutter layout and styling primitives into the dynamic runtime:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Layout&lt;/strong&gt;: &lt;code&gt;Flexible&lt;/code&gt;, &lt;code&gt;Wrap&lt;/code&gt;, &lt;code&gt;SingleChildScrollView&lt;/code&gt; for scrollable, wrapping feeds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Styling&lt;/strong&gt;: &lt;code&gt;BoxDecoration&lt;/code&gt;, &lt;code&gt;BorderRadius&lt;/code&gt;, &lt;code&gt;BoxShadow&lt;/code&gt;, and &lt;code&gt;LinearGradient&lt;/code&gt; for sleek card designs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Controls &amp;amp; Inputs&lt;/strong&gt;: &lt;code&gt;NavigationBar&lt;/code&gt;, &lt;code&gt;Checkbox&lt;/code&gt;, &lt;code&gt;Switch&lt;/code&gt;, and &lt;code&gt;OutlineInputBorder&lt;/code&gt; for interactive components.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  2. The On-Device AI Engine (&lt;code&gt;flutter_gemma&lt;/code&gt; + LiteRT-LM)
&lt;/h3&gt;

&lt;p&gt;Inference runs locally using the &lt;code&gt;flutter_gemma&lt;/code&gt; package backed by LiteRT-LM. We deploy &lt;code&gt;gemma-4-E2B-it.litertlm&lt;/code&gt; (an Apache-2.0 open-weight model from the LiteRT community).&lt;br&gt;
&lt;/p&gt;
&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TD
    A["Friend edits layout in Editor"] --&amp;gt; B["CompatChecker (Allowlist &amp;amp; Linter)"]
    B --&amp;gt; C["dart_eval Compiler"]
    C --&amp;gt;|Success in &amp;lt;100ms| D["Live Interactive Widget"]
    C --&amp;gt;|Compile Error| E["On-Device Error Console"]

    E --&amp;gt; F["Gemma 4 E2B Tutor (On-Device via LiteRT)"]
    F --&amp;gt;|System Prompts + Widget Hierarchy| G["Explain Error / Layout Hint"]
    G --&amp;gt; H["Self-Healing Repair Loop"]
    H --&amp;gt;|Repaired Code| C&lt;/code&gt;&lt;/pre&gt;


&lt;h3&gt;
  
  
  3. Mobile Ergonomics &amp;amp; Developer Experience
&lt;/h3&gt;

&lt;p&gt;Writing code on a touch keyboard requires deliberate tooling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One-Tap Symbol Bar&lt;/strong&gt;: Instant access to &lt;code&gt;{&lt;/code&gt;, &lt;code&gt;}&lt;/code&gt;, &lt;code&gt;(&lt;/code&gt;, &lt;code&gt;)&lt;/code&gt;, &lt;code&gt;;&lt;/code&gt;, &lt;code&gt;:&lt;/code&gt;, &lt;code&gt;=&amp;gt;&lt;/code&gt;, quotes, and brackets without toggling keyboard layers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Undo &amp;amp; Redo&lt;/strong&gt;: Directly integrated &lt;code&gt;UndoHistoryController&lt;/code&gt; on the mobile toolbar.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debounced Auto-Save &amp;amp; Safe Navigation&lt;/strong&gt;: Code automatically saves after 1.5s of inactivity and via &lt;code&gt;PopScope&lt;/code&gt; on back navigation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error-to-Line Navigation&lt;/strong&gt;: Tapping any compiler error in the on-device console automatically jumps the cursor to the exact error line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Script Management&lt;/strong&gt;: Local duplicate, rename, delete with confirmation, and clipboard code paste/import.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  4. Benchmarks &amp;amp; Verification
&lt;/h3&gt;

&lt;p&gt;Tested on a &lt;strong&gt;OnePlus 13R (Qualcomm Snapdragon 8 Gen 3, 16 GB RAM)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bytecode Compilation Time&lt;/strong&gt;: &lt;strong&gt;85 ms&lt;/strong&gt; (average for 150-line layout scripts)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Warm Recompile Time&lt;/strong&gt;: &lt;strong&gt;&amp;lt; 15 ms&lt;/strong&gt; (using in-memory AST cache)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated Test Suite&lt;/strong&gt;: &lt;strong&gt;16 passed tests&lt;/strong&gt; (100% pass rate across compiler units, all 6 bundled layout lessons, bridge widgets, and the multi-turn Gemma auto-repair loop)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analyzer Health&lt;/strong&gt;: 0 errors, 0 warnings with &lt;code&gt;flutter analyze&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Packaging&lt;/strong&gt;: Standalone debug APK verified and built cleanly in 68s.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;This project was built to prove why &lt;strong&gt;open-source AI&lt;/strong&gt; is transformative for learning and mobile development:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;100% Offline Independence&lt;/strong&gt;: Learning shouldn't stop when you lose Wi-Fi. By packaging Google's open-weight &lt;strong&gt;Gemma 4 E2B&lt;/strong&gt; model (&lt;code&gt;.litertlm&lt;/code&gt;) directly onto the device, the tutor runs in airplane mode, on trains, or in remote spots with zero network latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complete Data Sovereignty &amp;amp; Privacy&lt;/strong&gt;: The friend's personal thoughts, draft widgets, and habit data never leave the phone. There is no tracking, no logging, and no telemetry sent to a remote API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero Ongoing Costs&lt;/strong&gt;: Cloud LLMs impose steep per-token pricing or monthly subscriptions. Open-weight models democratize access—once installed, millions of tokens of guidance cost exactly $0.00.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic Closed-Loop Compilation&lt;/strong&gt;: Unlike generic cloud chatbots that hallucinate outdated syntax, DartBox pairs Gemma with an on-device compiler (&lt;code&gt;dart_eval&lt;/code&gt; / &lt;code&gt;flutter_eval&lt;/code&gt;). When Gemma suggests or generates a layout, DartBox compiles it in memory. If a syntax mismatch is detected, it feeds the error back to Gemma for an instant &lt;strong&gt;self-healing repair turn&lt;/strong&gt; before the user even sees it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;We saved the AI agent session transcript from our architectural build and test verification using DevRelay:&lt;/p&gt;


&lt;div class="ltag-agent-session"&gt;
  &lt;div class="agent-session-header"&gt;
    
    &lt;span class="agent-session-tool-icon-badge" title="Gemini CLI"&gt;
&lt;/span&gt;
    &lt;span class="agent-session-title"&gt;Building DartBox Buddy with On-Device Gemma 4&lt;/span&gt;
  &lt;/div&gt;

  &lt;div class="agent-session-scroll"&gt;

      &lt;div class="agent-session-message agent-session-user"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-user"&gt;
          You
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Build DartBox Buddy: an on-device Flutter runner and local Google Gemma 4 AI tutor for my friend learning Flutter layouts without laptop setup.&lt;/p&gt;

                &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class="agent-session-message agent-session-assistant"&gt;
        &lt;div class="agent-session-role-badge agent-session-role-assistant"&gt;
          Agent
        &lt;/div&gt;
        &lt;div class="agent-session-content"&gt;
                &lt;div class="agent-session-text"&gt;
                  &lt;p&gt;Designing 100% offline architecture: local bytecode compilation via flutter_eval, on-device Gemma 4 E2B inference via LiteRT-LM, debounced auto-save, and self-healing auto-repair loop.&lt;/p&gt;

                &lt;/div&gt;
              &lt;div class="agent-session-tool-call"&gt;
                
                  &lt;span class="agent-session-chevron"&gt;▸&lt;/span&gt;
                  &lt;span class="tool-name tool-name-runcommand"&gt;run_command&lt;/span&gt;
                    &lt;span class="tool-input-preview"&gt;flutter test&lt;/span&gt;
                
                &lt;div class="agent-session-tool-detail"&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Input&lt;/div&gt;
                      &lt;pre class="agent-session-pre agent-session-terminal"&gt;&lt;code&gt;$ flutter test&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                    &lt;div class="tool-section"&gt;
                      &lt;div class="tool-section-label"&gt;Output&lt;/div&gt;
                      &lt;pre class="agent-session-pre"&gt;&lt;code&gt;All 16 tests passed cleanly! Bytecode compilation, bundled lessons, and Gemma repair loop verified.&lt;/code&gt;&lt;/pre&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;

  &lt;div class="agent-session-footer"&gt;
    &lt;span class="agent-session-meta"&gt;
        2 of 2 messages
    &lt;/span&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Direct Transcript Link&lt;/strong&gt;: &lt;a href="https://dev.to/agent_sessions/building-dartbox-buddy-with-on-device-gemma-4-deqbkr"&gt;DevRelay Agent Session #543&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent session covers designing the 100% offline runtime architecture, extending &lt;code&gt;flutter_eval&lt;/code&gt; with layout bridges, implementing the 3-turn Gemma auto-repair loop, and passing all 16 automated tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Featured Category: Best Use of Gemma ($200)
&lt;/h3&gt;

&lt;p&gt;DartBox Buddy enters the &lt;strong&gt;Best Use of Gemma&lt;/strong&gt; category. The project features Google's open-weight &lt;strong&gt;Gemma 4 E2B&lt;/strong&gt; model (&lt;code&gt;gemma-4-E2B-it.litertlm&lt;/code&gt;, Apache-2.0) running natively on-device via LiteRT-LM. &lt;/p&gt;

&lt;p&gt;Gemma serves as an on-device tutor and autonomous code repair engine:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Visual Hierarchy Explanation&lt;/strong&gt;: Deconstructs Flutter widget trees and explains layout rules in plain English without cloud latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-Healing Auto-Repair&lt;/strong&gt;: Automatically catches compiler errors, feeds AST error diagnostics into an on-device 3-turn repair loop, and outputs corrected code that compiles and mounts live.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Privacy&lt;/strong&gt;: Ensures all user code, draft widgets, and learning conversations remain 100% local on the device.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;em&gt;Thank you to DEV, Google, and the Hacktoberfest organizers for this challenge!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>hf26challenge</category>
      <category>weekendchallenge</category>
      <category>devchallenge</category>
      <category>gemma</category>
    </item>
  </channel>
</rss>
