<?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 Niteshwarik on Medium]]></title>
        <description><![CDATA[Stories by Niteshwarik on Medium]]></description>
        <link>https://medium.com/@niteshwarik23?source=rss-a8d2d5eb2122------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*nUf7k-_2AlnQ5RY-</url>
            <title>Stories by Niteshwarik on Medium</title>
            <link>https://medium.com/@niteshwarik23?source=rss-a8d2d5eb2122------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:23:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@niteshwarik23/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[“Testing in Flutter: The Complete Guide to Unit, Widget & Integration Tests”]]></title>
            <link>https://medium.com/@niteshwarik23/testing-in-flutter-the-complete-guide-to-unit-widget-integration-tests-207dd73d21c4?source=rss-a8d2d5eb2122------2</link>
            <guid isPermaLink="false">https://medium.com/p/207dd73d21c4</guid>
            <category><![CDATA[widget-testing]]></category>
            <category><![CDATA[integration-testing]]></category>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Niteshwarik]]></dc:creator>
            <pubDate>Sat, 25 Oct 2025 13:10:01 GMT</pubDate>
            <atom:updated>2025-10-25T13:10:01.570Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eRJ6vZwk94CvtU3-jCHIBQ.png" /></figure><p>The more features your app has, the harder it is to test manually. Automated tests help ensure that your app performs correctly before you publish it, while retaining your feature and bug fix velocity.</p><h4>What Is Testing in Flutter?</h4><p>Testing means verifying that your code behaves the way you expect — automatically.<br> Flutter provides built-in support for writing tests that simulate user actions, check widget layouts, and even run full-app flows.</p><p>The testing framework is part of the Flutter SDK, so you don’t need any extra setup to start.</p><p>Their are few categories of Automated testing :</p><ul><li>A <a href="https://docs.flutter.dev/testing/overview#unit-tests"><em>unit test</em></a> tests a single function, method, or class.</li><li>A <a href="https://docs.flutter.dev/testing/overview#widget-tests"><em>widget test</em></a> (in other UI frameworks referred to as <em>component test</em>) tests a single widget.</li><li>An <a href="https://docs.flutter.dev/testing/overview#integration-tests"><em>integration test</em></a> tests a complete app or a large part of an app.</li></ul><p>Recommended Codelab and Flutter Documentation Links</p><h4><a href="https://codelabs.developers.google.com/codelabs/flutter-app-testing?hl=en#0">Google Codelab on Testing Flutter App</a></h4><h4><a href="https://docs.flutter.dev/cookbook/testing/unit/introduction">Flutter Documentation — Unit Test</a></h4><h4><a href="https://docs.flutter.dev/cookbook/testing/widget/introduction">Flutter Documentation — Widget Test</a></h4><h4><a href="https://docs.flutter.dev/cookbook/testing/integration/introduction">Flutter Documentation — Integration Test</a></h4><h4><a href="https://docs.flutter.dev/cookbook/testing/unit/introduction">Unit Test</a></h4><p>&gt; As the name goes UNIT …What is an UNIT a small part of a huge entity / app.<br>So Your app is also full of features which will be used by the users and the smallest piece which helps the feature to function properly ..like a function / method within a class or an Future method which fetches Data from the servers.</p><p>Note : The structure of the unit test will be almost similar to the lib or project structure.</p><p>Basic Step by Step guide for getting started to write unit test.</p><ol><li>Add the test or flutter_test dependency.</li><li>Create a test file.</li><li>Create a class to test.</li><li>Write a test for our class.</li><li>Combine multiple tests in a group.</li><li>Run the tests.</li></ol><p>Below is an small example for you to understand — For a Favorites Class in which user can add / remove items from the list.</p><pre>import &#39;package:test/test.dart&#39;;<br>import &#39;package:testing_app/models/favorites.dart&#39;;<br><br>void main() {<br>  // The Flutter testing framework allows you to bind similar tests related to each other in a group. <br>  // There can be multiple groups in a single test file intended to test different parts of the corresponding file in the lib directory.<br>  group(&#39;Testing App Provider&#39;, () {<br>    var favorites = Favorites();<br><br>  // The test() method takes two positional parameters: <br>  // the description of the test and <br>  // the callback where you actually write the test.<br>    test(&#39;A new item should be added&#39;, () {<br>      var number = 35;<br>      favorites.add(number);<br>      expect(favorites.items.contains(number), true);<br>    });<br><br>    test(&#39;An item should be removed&#39;, () {<br>      var number = 45;<br>      favorites.add(number);<br>      expect(favorites.items.contains(number), true);<br>      favorites.remove(number);<br>      expect(favorites.items.contains(number), false);<br>    });<br>  });<br>}</pre><pre>import &#39;package:flutter_test/flutter_test.dart&#39;;<br>import &#39;package:http/http.dart&#39; as http;<br>import &#39;package:mockito/annotations.dart&#39;;<br>import &#39;package:mockito/mockito.dart&#39;;<br>import &#39;package:testing_app/main.dart&#39;;<br><br>import &#39;temp_main_test.mocks.dart&#39;;<br><br>// Generate a MockClient using the Mockito package.<br>// Create new instances of this class in each test.<br>// Note: Naming the generated mock `MockHttpClient` to avoid confusion with<br>// `MockClient` from `package:http/testing.dart`.<br>@GenerateMocks([], customMocks: [MockSpec&lt;http.Client&gt;(as: #MockHttpClient)])<br>void main() {<br>  group(&#39;fetchAlbum&#39;, () {<br>    test(&#39;returns an Album if the http call completes successfully&#39;, () async {<br>      final client = MockHttpClient();<br><br>      // Use Mockito to return a successful response when it calls the<br>      // provided http.Client.<br>      when(<br>        client.get(Uri.parse(&#39;https://jsonplaceholder.typicode.com/albums/1&#39;)),<br>      ).thenAnswer(<br>        (_) async =&gt;<br>            http.Response(&#39;{&quot;userId&quot;: 1, &quot;id&quot;: 2, &quot;title&quot;: &quot;mock&quot;}&#39;, 200),<br>      );<br><br>      expect(await fetchAlbum(client), isA&lt;Album&gt;());<br>    });<br><br>    test(&#39;throws an exception if the http call completes with an error&#39;, () {<br>      final client = MockHttpClient();<br><br>      // Use Mockito to return an unsuccessful response when it calls the<br>      // provided http.Client.<br>      when(<br>        client.get(Uri.parse(&#39;https://jsonplaceholder.typicode.com/albums/1&#39;)),<br>      ).thenAnswer((_) async =&gt; http.Response(&#39;Not Found&#39;, 404));<br><br>      expect(fetchAlbum(client), throwsException);<br>    });<br>  });<br>}</pre><h4><a href="https://docs.flutter.dev/cookbook/testing/widget/introduction">Widget Test</a></h4><p>A Widget Test means testing the UI widget on the screen which are rendered by Flutter. Finding ,Interacting, Matching with the widgets and all this is possible by flutter_test package.</p><p>The flutter_test package provides the following tools for testing widgets:</p><ul><li>The <a href="https://api.flutter.dev/flutter/flutter_test/WidgetTester-class.html">WidgetTester</a> allows building and interacting with widgets in a test environment.</li><li>The <a href="https://api.flutter.dev/flutter/flutter_test/testWidgets.html">testWidgets()</a> function automatically creates a new WidgetTester for each test case, and is used in place of the normal test() function.</li><li>The <a href="https://api.flutter.dev/flutter/flutter_test/Finder-class.html">Finder</a> classes allow searching for widgets in the test environment.</li><li>Widget-specific <a href="https://api.flutter.dev/flutter/package-matcher_matcher/Matcher-class.html">Matcher</a> constants help verify whether a Finder locates a widget or multiple widgets in the test environment.</li></ul><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter_test/flutter_test.dart&#39;;<br>import &#39;package:provider/provider.dart&#39;;<br>import &#39;package:testing_app/models/favorites.dart&#39;;<br>import &#39;package:testing_app/screens/favorites.dart&#39;;<br><br>late Favorites favoritesList;<br><br>Widget createFavoritesScreen() =&gt; ChangeNotifierProvider&lt;Favorites&gt;(<br>  create: (context) {<br>    favoritesList = Favorites();<br>    return favoritesList;<br>  },<br>  child: const MaterialApp(home: FavoritesPage()),<br>);<br><br>void addItems() {<br>  for (var i = 0; i &lt; 10; i += 2) {<br>    favoritesList.add(i);<br>  }<br>}<br><br>void main() {<br>  group(&#39;Favorites Page Widget Tests&#39;, () {<br>    testWidgets(&#39;Test if ListView shows up&#39;, (tester) async {<br>      await tester.pumpWidget(createFavoritesScreen());<br>      addItems();<br>      await tester.pumpAndSettle();<br>      expect(find.byType(ListView), findsOneWidget);<br>    });<br><br>    testWidgets(&#39;Testing Remove Button&#39;, (tester) async {<br>      await tester.pumpWidget(createFavoritesScreen());<br>      addItems();<br>      await tester.pumpAndSettle();<br>      var totalItems = tester.widgetList(find.byIcon(Icons.close)).length;<br>      await tester.tap(find.byIcon(Icons.close).first);<br>      await tester.pumpAndSettle();<br>      expect(<br>        tester.widgetList(find.byIcon(Icons.close)).length,<br>        lessThan(totalItems),<br>      );<br>      expect(find.text(&#39;Removed from favorites.&#39;), findsOneWidget);<br>    });<br>  });<br>}</pre><h4><a href="https://docs.flutter.dev/cookbook/testing/integration/introduction">Integration Test</a></h4><p>Unit tests and widget tests validate individual classes, functions, or widgets. They don’t validate how individual pieces work together in whole or capture the performance of an app running on a real device. To perform these tasks, use <em>integration tests</em>.</p><p>Integration tests verify the behavior of the complete app. This test can also be called end-to-end testing or GUI testing.</p><p>The Flutter SDK includes the <a href="https://github.com/flutter/flutter/tree/main/packages/integration_test">integration_test</a> package.</p><p>The below code is to test the overall app functionality.</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter_test/flutter_test.dart&#39;;<br>import &#39;package:testing_app/main.dart&#39;;<br><br>void main() {<br>  group(&#39;Testing App&#39;, () {<br>    testWidgets(&#39;Favorites operations test&#39;, (tester) async {<br>      await tester.pumpWidget(const TestingApp());<br><br>      final iconKeys = [&#39;icon_0&#39;, &#39;icon_1&#39;, &#39;icon_2&#39;];<br><br>      for (var icon in iconKeys) {<br>        await tester.tap(find.byKey(ValueKey(icon)));<br>        await tester.pumpAndSettle(const Duration(seconds: 1));<br><br>        expect(find.text(&#39;Added to favorites.&#39;), findsOneWidget);<br>      }<br><br>      await tester.tap(find.text(&#39;Favorites&#39;));<br>      await tester.pumpAndSettle();<br><br>      final removeIconKeys = [<br>        &#39;remove_icon_0&#39;,<br>        &#39;remove_icon_1&#39;,<br>        &#39;remove_icon_2&#39;,<br>      ];<br><br>      for (final iconKey in removeIconKeys) {<br>        await tester.tap(find.byKey(ValueKey(iconKey)));<br>        await tester.pumpAndSettle(const Duration(seconds: 1));<br><br>        expect(find.text(&#39;Removed from favorites.&#39;), findsOneWidget);<br>      }<br>    });<br>  });<br>}</pre><p>The below code is to test the performance</p><pre>import &#39;package:flutter/material.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:testing_app/main.dart&#39;;<br><br>void main() {<br>  group(&#39;Testing App Performance&#39;, () {<br>    final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();<br>    binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive;<br><br>    testWidgets(&#39;Scrolling test&#39;, (tester) async {<br>      await tester.pumpWidget(const TestingApp());<br><br>      final listFinder = find.byType(ListView);<br><br>      await binding.traceAction(() async {<br>        await tester.fling(listFinder, const Offset(0, -500), 10000);<br>        await tester.pumpAndSettle();<br><br>        await tester.fling(listFinder, const Offset(0, 500), 10000);<br>        await tester.pumpAndSettle();<br>      }, reportKey: &#39;scrolling_summary&#39;);<br>    });<br>  });<br>}</pre><p>The Below code is to get summary of the integration test</p><pre>import &#39;package:flutter_driver/flutter_driver.dart&#39; as driver;<br>import &#39;package:integration_test/integration_test_driver.dart&#39;;<br><br>Future&lt;void&gt; main() {<br>  return integrationDriver(<br>    responseDataCallback: (data) async {<br>      if (data != null) {<br>        final timeline = driver.Timeline.fromJson(<br>            data[&#39;scrolling_summary&#39;] as Map&lt;String, dynamic&gt;);<br><br>        final summary = driver.TimelineSummary.summarize(timeline);<br><br>        await summary.writeTimelineToFile(<br>          &#39;scrolling_summary&#39;,<br>          pretty: true,<br>          includeSummary: true,<br>        );<br>      }<br>    },<br>  );<br>}</pre><h4>🧠 Why Testing Matters</h4><ol><li><strong>Catch Bugs Early</strong> — Detect logic errors before release.</li><li><strong>Refactor Safely</strong> — Modify code confidently with automated checks.</li><li><strong>Improve Reliability</strong> — Ensure your app behaves the same on every device.</li><li><strong>Save Time Long-Term</strong> — Automated tests replace repetitive manual QA.</li></ol><h4>⚡ Running Tests</h4><p>Use these simple commands in your terminal:</p><pre># Run all tests<br>flutter test<br><br># Run specific file<br>flutter test test/utils/calculator_test.dart<br><br># Run integration tests<br>flutter test integration_test</pre><p>If you want to test directly on an emulator or real device:</p><pre>flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart</pre><h4>💬 Conclusion</h4><p>Testing in Flutter isn’t just about passing or failing — it’s about <strong>building confidence</strong>.<br> Whether you’re checking a small function or running end-to-end flows, automated testing ensures your app grows without breaking.</p><p>And now, with AI tools by your side, writing tests has never been easier — or faster.</p><p>So the next time you push new code, make sure your tests are ready to back you up. 🧪✅</p><p>#Flutter #Testing #UnitTesting #WidgetTesting #IntegrationTesting #CI_CD #AI #FlutterUnboxed #MobileDevelopment</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=207dd73d21c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Mastering GitHub Actions for CI/CD — A Practical Guide]]></title>
            <link>https://medium.com/@niteshwarik23/mastering-github-actions-for-ci-cd-a-practical-guide-433d20bfa8e6?source=rss-a8d2d5eb2122------2</link>
            <guid isPermaLink="false">https://medium.com/p/433d20bfa8e6</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[workflow-automation]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Niteshwarik]]></dc:creator>
            <pubDate>Wed, 22 Oct 2025 18:49:53 GMT</pubDate>
            <atom:updated>2025-10-22T18:49:53.385Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 Mastering GitHub Actions for CI/CD — A Practical Guide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ly6dYDk1xZ-GNrgwy_rjVQ.png" /></figure><p>Automation is the heartbeat of modern development.<br> If you’ve ever manually deployed your code or copied build files by hand, GitHub Actions can be your new best friend.</p><p>In this guide, we’ll cover <strong>what GitHub Actions are</strong>, <strong>how they work</strong>, and <strong>how you can set up your first</strong> <strong>CI/CD pipeline</strong> — from pushing code to auto-deploying your app or website.</p><h4>🧩 What Are GitHub Actions?</h4><p><strong>GitHub Actions</strong> is an automation and CI/CD tool built directly into GitHub.<br> It allows you to define workflows that run automatically whenever certain events happen — like:</p><ul><li>Code push</li><li>Pull request creation</li><li>Issue update</li><li>Release publishing</li></ul><p>These workflows live inside your repository in the <strong>.github/workflows/</strong> directory and are written in <strong>YAML</strong>.</p><h4>⚙️ The Building Blocks of a Workflow</h4><p>A GitHub Actions workflow is made up of:</p><p><strong>Workflow </strong>The automation file that runs your pipeline.<br><strong>Job </strong>A collection of steps that run on a virtual machine (runner).<br><strong>Step </strong>A single task — running a command or using an Action.<br><strong>Runner </strong>The environment that executes your jobs (Linux, Windows, macOS).<br><strong>Event </strong>The trigger that starts the workflow (push, PR, etc).</p><h4>🚀 Example: Deploy Your Website Using GitHub Actions + GitHub Pages</h4><p>Let’s automate your website deployment in just a few lines 👇</p><p>Create a file:<br> .github/workflows/deploy.yml</p><pre>name: Deploy Website<br><br>on:<br>  push:<br>    branches:<br>      - main<br>  pull_request:<br>    branches:<br>      - main<br><br>jobs:<br>  build-and-deploy:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: Checkout Repository<br>        uses: actions/checkout@v4<br><br>      - name: Setup Node.js<br>        uses: actions/setup-node@v4<br>        with:<br>          node-version: 18<br><br>      - name: Install Dependencies<br>        run: npm install<br><br>      - name: Build Project<br>        run: npm run build<br><br>      - name: Deploy to GitHub Pages<br>        uses: peaceiris/actions-gh-pages@v3<br>        with:<br>          github_token: ${{ secrets.GITHUB_TOKEN }}<br>          publish_dir: ./dist</pre><p>✅ <strong>How it works</strong>:</p><ul><li>Every time you push to main, GitHub Actions runs this workflow.</li><li>It installs dependencies, builds your website, and deploys the output (./dist) to GitHub Pages.</li></ul><p>You can adapt this for React, Flutter Web, Vue, or any static site generator.</p><h4>🔄 Common Use Cases for GitHub Actions</h4><p><strong>Continuous Integration (CI)</strong></p><ul><li>Run tests automatically on every PR or push.</li><li>Example: flutter test, npm test, or pytest.</li></ul><p><strong>Continuous Deployment (CD)</strong></p><ul><li>Deploy apps to GitHub Pages, Firebase, AWS, or Docker.</li></ul><p><strong>Code Quality Checks</strong></p><ul><li>Auto-run formatters (Prettier, Dart format, ESLint).</li><li>Prevent merging if checks fail.</li></ul><p><strong>Automations</strong></p><ul><li>Auto-assign reviewers or label issues.</li><li>Send notifications to Slack or Discord.</li></ul><h4>🧠 Learning GitHub Actions (Official Docs &amp; Tips)</h4><p>The <strong>best place to learn</strong> is GitHub’s official documentation 👇<br> 📘 <a href="https://docs.github.com/en/actions">https://docs.github.com/en/actions</a></p><p>Here’s how you can approach it:</p><ol><li>Start with the <strong>“Quickstart”</strong> section — it walks you through your first workflow.</li><li>Learn about <strong>workflow syntax</strong> — events, jobs, and steps.</li><li>Explore <strong>marketplace actions</strong> — pre-built tools that you can plug into your workflow.</li><li>Experiment by automating small tasks: build → test → deploy.</li></ol><p>As you get comfortable, move toward <strong>multi-environment CI/CD</strong> and <strong>matrix builds</strong> for real-world scalability.</p><h4>💡 Pro Tips</h4><p>✅ Keep secrets safe using <strong>GitHub Secrets</strong> (no API keys in code).<br> ✅ Use <strong>caching</strong> for faster builds (npm, Flutter, etc).<br> ✅ Add status badges to your README to show workflow success.<br> ✅ Write reusable workflows that you can share across projects.</p><h4>🧩 Why It’s Worth Learning</h4><p>In 2025, knowing GitHub Actions isn’t just a “nice to have.”<br> It’s a <strong>must-have skill</strong> for developers who care about automation, productivity, and reliable software delivery.</p><p>Start small, automate one thing — and soon you’ll be deploying production-ready apps with zero manual steps.</p><h4>✨ Closing Thoughts</h4><p>GitHub Actions turns your GitHub repo into a <strong>mini DevOps powerhouse</strong> — right out of the box.<br> You don’t need to set up Jenkins, Travis, or any external CI/CD tool — everything lives in your repo, versioned alongside your code.</p><p>Try it out today, and you’ll never go back to manual deployments again!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=433d20bfa8e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Jaspr: Full-Stack Dart for the Web — From Installation to Deployment]]></title>
            <link>https://medium.com/@niteshwarik23/jaspr-full-stack-dart-for-the-web-from-installation-to-deployment-dfff99d67acb?source=rss-a8d2d5eb2122------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfff99d67acb</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[jaspr]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-web]]></category>
            <category><![CDATA[website]]></category>
            <dc:creator><![CDATA[Niteshwarik]]></dc:creator>
            <pubDate>Mon, 02 Jun 2025 12:46:41 GMT</pubDate>
            <atom:updated>2025-06-02T12:46:41.448Z</atom:updated>
            <content:encoded><![CDATA[<h3>🔥<strong> Jaspr: Full-Stack Dart for the Web — From Installation to Deployment</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*ziWqaGXKh7iQVy6D0INylg.png" /></figure><p>Have you ever wished to build full-stack web apps with <strong>Dart</strong>, just like you do with Flutter? Meet <strong>Jaspr</strong>, a modern web framework that enables server-side rendering (SSR), static site generation (SSG), and reactive UI development — all in Dart!</p><p>This article walks you through:</p><ul><li>What Jaspr is and why it’s exciting</li><li>Key features</li><li>Step-by-step installation &amp; setup</li><li>Building a simple example</li><li>Deployment tips</li></ul><h3>🚀 What is Jaspr?</h3><p><strong>Jaspr</strong> is a full-stack web framework written in <strong>Dart</strong>. It enables you to:</p><ul><li>Build modern, reactive websites with Dart</li><li>Use server-side rendering (SSR)</li><li>Generate static sites (SSG)</li><li>Run Dart on the server with a component model similar to React/Flutter</li></ul><p>Think of Jaspr as <strong>Next.js for Dart</strong>. You get all the advantages of Dart’s type safety, tooling, and Flutter-like UI structure, but for the web.</p><h3>🌟 Key Features</h3><ul><li>✅ <strong>Full-stack Dart</strong> — write both frontend &amp; backend in Dart</li><li>🌐 <strong>SSR &amp; SSG support</strong> — for blazing-fast loading and SEO</li><li>⚡ <strong>Reactive components</strong> — similar to Flutter/React</li><li>🧱 <strong>Component-based architecture</strong> — write UI as reusable Dart components</li><li>📦 <strong>Hot-reload</strong> in development</li><li>🏁 <strong>Lightweight and fast</strong></li><li><strong>Familiar</strong>: Works with a component model similar to Flutter widgets, making it intuitive for Flutter developers.</li><li><strong>Powerful</strong>: Offers server-side rendering (SSR) out of the box, enhancing performance and SEO.</li><li><strong>♻️ Easy</strong>: Automatically synchronizes component state between the server and client.</li><li><strong>⚡️ Fast</strong>: Performs optimized DOM updates only where necessary, ensuring efficient rendering.</li><li><strong>Flexible</strong>: Can run on the server, client, or both, with manual or automatic setup — you decide.</li></ul><h4>⚡️ Server-Side Rendering (SSR)</h4><p>Jaspr provides <strong>built-in SSR</strong>, which:</p><ul><li>Improves initial load times.</li><li>Makes your app SEO-friendly.</li><li>Allows faster perceived performance.</li></ul><h4>🔄 Hydration</h4><p>With Jaspr, the server-rendered HTML is <strong>“hydrated”</strong> on the client, preserving interactive state. Jaspr automatically keeps the UI in sync between server and browser after loading.</p><h4>🧭 Routing</h4><p>Jaspr includes a powerful routing system:</p><ul><li>Simple declarative route definitions.</li><li>Dynamic segments and parameters.</li><li>Server and client-side routing support.</li><li>Nested and lazy-loading routes.</li></ul><h4>🧩 Third-Party Packages (Ecosystem)</h4><p>Jaspr supports many community and official packages, including:</p><ul><li>jaspr_router for routing.</li><li>jaspr_tailwind for Tailwind CSS integration.</li><li>jaspr_markdown to render Markdown content.</li></ul><p>You can even bring in standard Dart packages like http, riverpod, dart_mappable, and more.</p><h4>🎨 Styling</h4><p>Jaspr supports multiple styling strategies:</p><ul><li>Use <strong>Tailwind CSS</strong> via jaspr_tailwind (recommended).</li><li>Write custom CSS in scoped or global stylesheets.</li><li>Inline styling through Style components.</li><li>Easily integrate CSS frameworks.</li></ul><h4>🔎 Data Fetching</h4><p>Data can be fetched:</p><ul><li>On the <strong>server</strong> before rendering for SEO and performance.</li><li>On the <strong>client</strong> after hydration for interactivity.</li><li>Via FutureBuilder-like patterns or lifecycle hooks.</li><li>Works seamlessly with APIs like REST or GraphQL using Dart packages.</li></ul><h4>♻️ Reactivity</h4><p>Built with <strong>fine-grained reactivity</strong> using signals (similar to SolidJS or Riverpod’s StateProvider), which makes UI updates very efficient and clean.</p><h4>🧪 Component Lifecycle</h4><p>You get full lifecycle hooks like:</p><ul><li>onInit(), onDispose()</li><li>didChangeDependencies()</li><li>build() (just like in Flutter)</li></ul><h4>🔧 Tooling &amp; Developer Experience</h4><ul><li>Built with Dart.</li><li>Supports hot reload for faster development.</li><li>Easily deployable to static hosting or server environments.</li></ul><h3>🛠️ Installation &amp; Setup</h3><h4>1. Install Dart</h4><p>Make sure Dart SDK (&gt;=3.0) is installed:</p><pre>dart --version</pre><p>2. <strong>Activate Jaspr CLI</strong></p><pre>dart pub global activate jaspr_cli</pre><p>Ensure $HOME/.pub-cache/bin is in your PATH.</p><p>3. <strong>Create a New Jaspr App</strong></p><pre>jaspr create my_jaspr_app<br>cd my_jaspr_app</pre><p>This scaffolds a basic Jaspr project with components and routing.</p><p>4. <strong>Run in Development</strong></p><pre>jaspr serve</pre><p>Open <a href="http://localhost:8080/">http://localhost:8080</a> — your app is live with hot reload!</p><h4>🧪 Basic Example: Hello Jaspr</h4><p>Inside lib/main.dart, you&#39;ll see a component-based structure like this:</p><pre>import &#39;package:jaspr/jaspr.dart&#39;;<br><br>void main() {<br>  runApp(MyApp());<br>}<br><br>class MyApp extends StatelessComponent {<br>  @override<br>  Iterable&lt;Component&gt; build(BuildContext context) sync* {<br>    yield Html(<br>      lang: &#39;en&#39;,<br>      children: [<br>        Head(children: [<br>          Meta(charset: &#39;UTF-8&#39;),<br>          Title(text: &#39;Jaspr App&#39;),<br>        ]),<br>        Body(children: [<br>          Div(classes: [&#39;container&#39;], children: [<br>            H1(text: &#39;🚀 Hello from Jaspr!&#39;),<br>            P(text: &#39;This is a full-stack web app written entirely in Dart.&#39;)<br>          ])<br>        ]),<br>      ],<br>    );<br>  }<br>}</pre><h4>🚀 Deployment</h4><p>Jaspr supports both <strong>SSR</strong> and <strong>Static Site Generation (SSG)</strong>.</p><p>We can deploy the site using</p><p>GitHub Pages</p><p>Server Hosting</p><p>Firebase Hosting</p><h3>🎯 Why Choose Jaspr?</h3><ul><li>All Dart — no JS/TS needed.</li><li>SEO out-of-the-box with SSR.</li><li>Modern reactive UI architecture.</li><li>Clean integration with Dart backend.</li></ul><h3>📘 Resources</h3><ul><li><a href="https://docs.jaspr.site/">Official Docs</a></li></ul><p>Start your fullstack Dart journey today with Jaspr! 💙</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfff99d67acb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Demystifying Flutter Keys: A Developer’s Best Friend!]]></title>
            <link>https://medium.com/@niteshwarik23/demystifying-flutter-keys-a-developers-best-friend-a1a5e6576d3f?source=rss-a8d2d5eb2122------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1a5e6576d3f</guid>
            <category><![CDATA[flutter-key]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Niteshwarik]]></dc:creator>
            <pubDate>Fri, 30 May 2025 04:14:43 GMT</pubDate>
            <atom:updated>2025-05-30T04:14:43.329Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vtwO6S6fLA4GoAr4" /><figcaption>Photo by <a href="https://unsplash.com/@shs521?utm_source=medium&amp;utm_medium=referral">Susan Holt Simpson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When building dynamic and efficient user interfaces in Flutter, understanding how <strong>Keys</strong> work can save you from subtle UI bugs and help boost your app’s performance. In this article, we’ll dive into what Keys are, why they matter, and how to use them correctly — complete with practical code examples.</p><h4>📌 What Are Keys in Flutter?</h4><p><strong>Keys</strong> are identifiers for widgets, elements, and semantic nodes. They tell Flutter when a widget should be preserved or recreated during a rebuild. This is especially useful when working with dynamic widget trees, such as lists or complex layouts.</p><h4>🔹 Types of Keys in Flutter</h4><h4><strong>✅ ValueKey</strong></h4><p>Use a ValueKey when the value used to identify the widget is stable and unique among siblings.</p><pre>ListView(<br>  children: items.map((item) =&gt; <br>    ListTile(<br>      key: ValueKey(item.id),<br>      title: Text(item.name),<br>    )<br>  ).toList(),<br>)</pre><p><strong>When to use:</strong> Reordering or modifying widgets based on stable unique values like an ID.</p><h4>🔂 UniqueKey</h4><p>A UniqueKey generates a new, completely unique key every time.</p><pre>ListView(<br>  children: [<br>    ListTile(key: UniqueKey(), title: Text(&quot;Item 1&quot;)),<br>    ListTile(key: UniqueKey(), title: Text(&quot;Item 2&quot;)),<br>  ],<br>)</pre><p><strong>When to use:</strong> When you want each widget to be treated as a completely new widget.</p><h4>🌐 GlobalKey</h4><p>A GlobalKey allows access to a widget’s state or context from anywhere in the app.</p><pre>final _formKey = GlobalKey&lt;FormState&gt;();<br><br>Form(<br>  key: _formKey,<br>  child: Column(<br>    children: [<br>      TextFormField(),<br>      ElevatedButton(<br>        onPressed: () {<br>          if (_formKey.currentState!.validate()) {<br>            // Proceed<br>          }<br>        },<br>        child: Text(&quot;Submit&quot;),<br>      ),<br>    ],<br>  ),<br>)</pre><p><strong>When to use:</strong> For accessing or validating widget state globally, like forms.</p><h4>🗄️ PageStorageKey</h4><p>Used with PageStorage to preserve the scroll position of widgets like ListView when navigating between tabs or pages.</p><pre>class MyHomePage extends StatelessWidget {<br>  final PageStorageBucket bucket = PageStorageBucket();<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return PageStorage(<br>      bucket: bucket,<br>      child: ListView(<br>        key: PageStorageKey(&#39;myList&#39;),<br>        children: List.generate(100, (index) =&gt; ListTile(title: Text(&#39;Item \$index&#39;))),<br>      ),<br>    );<br>  }<br>}</pre><p><strong>When to use:</strong> When maintaining scroll position in tab views or page transitions.</p><h4>💡 Additional Tips for Developers</h4><h4>⚙️ Custom Keys</h4><p>If your use case isn’t satisfied by the built-in keys, you can create custom keys by extending the LocalKey or Key class. This is rare but useful for complex scenarios.</p><h4>🧪 Debugging with Keys</h4><p>Use debugPrint() to inspect widget trees and make sure keys are correctly assigned, especially in dynamic or conditionally-rendered UI parts.</p><h4>🚧 Avoid Overusing GlobalKeys</h4><p>While powerful, GlobalKey can lead to memory leaks or performance issues if overused. Prefer local keys unless absolutely necessary.</p><h4>🧰 Tools that Help</h4><p>Widgets like ReorderableListView, AnimatedList, and Form rely heavily on keys. Explore their documentation and examples to deepen your understanding.</p><h4>🚀 Why Use Keys in Flutter?</h4><ul><li>✅ Preserve widget state across rebuilds.</li><li>📈 Improve performance by minimizing unnecessary widget rebuilds.</li><li>🧠 Maintain the identity of widgets when moving them in the tree.</li><li>📍 Access widgets from outside their scope using GlobalKey.</li><li>🔄 Retain scroll position and UI state with PageStorageKey.</li></ul><h4>🧠 Final Thoughts</h4><p>Mastering the use of Keys is an essential step toward building robust Flutter apps. Whether it’s preserving form inputs, managing dynamic lists, or maintaining scroll positions across tabs, using the right key can make a huge difference.</p><p>Start experimenting with these in your next Flutter project and see the improvements for yourself!</p><p>📚 Official Flutter Docs on Keys</p><p>Have any cool experiences or tips about using Keys? Drop them in the comments below! 🚀</p><p>#Flutter #FlutterDev #MobileDevelopment #UI #Performance #Tech</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1a5e6576d3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[InheritedWidget: Your Flutter Data-Sharing Superhero ]]></title>
            <link>https://medium.com/@niteshwarik23/inheritedwidget-your-flutter-data-sharing-superhero-51dc03a034c8?source=rss-a8d2d5eb2122------2</link>
            <guid isPermaLink="false">https://medium.com/p/51dc03a034c8</guid>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[widget]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[inheritedwidget]]></category>
            <dc:creator><![CDATA[Niteshwarik]]></dc:creator>
            <pubDate>Fri, 02 May 2025 12:40:09 GMT</pubDate>
            <atom:updated>2025-05-02T12:40:09.624Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jD9qTHjLGMtEdpUFxwluYw.png" /></figure><p>Tired of passing data through layers of widgets? InheritedWidget is your solution! It efficiently propagates data down the widget tree.</p><h3>Why Use It?</h3><ul><li><strong>Avoid Prop Drilling</strong>: No more passing data through widgets that don’t need it.</li><li><strong>Efficient</strong>: Only dependent widgets rebuild when the data changes.</li></ul><h3>When to Use It?</h3><ul><li><strong>App-wide data</strong>: Like theme or user settings.</li><li><strong>Deeply nested widgets</strong>: To avoid tedious prop drilling.</li></ul><h3>How to Use It?</h3><ol><li><strong>Create an InheritedWidget</strong>:</li></ol><pre>class MyInheritedWidget extends InheritedWidget {<br>  const MyInheritedWidget({<br>    Key? key,<br>    required this.data,<br>    required Widget child,<br>  }) : super(key: key, child: child);<br><br>final String data;<br>  @override<br>  bool updateShouldNotify(MyInheritedWidget oldWidget) {<br>    return data != oldWidget.data;<br>  }<br>  static MyInheritedWidget of(BuildContext context) {<br>    final MyInheritedWidget? result =<br>        context.dependOnInheritedWidgetOfExactType&lt;MyInheritedWidget&gt;();<br>    assert(result != null, &#39;No MyInheritedWidget found in context&#39;);<br>    return result!;<br>  }<br>}</pre><p>2. <strong>Provide the data</strong>:</p><pre>MaterialApp(<br>  home: MyInheritedWidget(<br>    data: &quot;Hello from InheritedWidget!&quot;,<br>    child: MyPage(),<br>  ),<br>);</pre><p>3. <strong>Consume the data:</strong></p><pre>class MyPage extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    final String data = MyInheritedWidget.of(context).data;<br>    return Text(data); // Displays &quot;Hello from InheritedWidget!&quot;<br>  }<br>}</pre><h3>Where to Use It?</h3><ul><li>Wrap the part of the widget tree that needs access to the data.</li></ul><h3>Here are some more concrete examples:</h3><ul><li><strong>Theme Data</strong>: Sharing your app’s theme (colors, fonts) with all widgets. Instead of passing the ThemeData object down through constructors, you can use an InheritedWidget. Flutter’s Theme widget is actually an InheritedWidget.</li><li><strong>User Authentication State</strong>: Making the current user’s authentication status (logged in or logged out) available to the entire app. Any widget can then easily check if the user is logged in and display the appropriate UI.</li><li><strong>Locale/Localization</strong>: Providing the current locale or translated strings to all widgets in your application, allowing for easy internationalization. Flutter’s Localizations widget is an InheritedWidget.</li><li><strong>Global Configuration</strong>: Sharing configuration settings, such as API endpoints, environment flags, or feature toggles, with the widgets that need them.</li><li><strong>Business Logic Components</strong>: Making a BLoC or other state management object available to a section of your widget tree. This is often done with packages like flutter_bloc or provider, which use InheritedWidget internally.</li></ul><h3>Example: Sharing Theme Data</h3><pre>class AppTheme extends InheritedWidget {<br>  const AppTheme({super.key, required this.data, required super.child});<br><br>final ThemeData data;<br>  static AppTheme of(BuildContext context) {<br>    return context.dependOnInheritedWidgetOfExactType&lt;AppTheme&gt;()!;<br>  }<br>  @override<br>  bool updateShouldNotify(AppTheme oldWidget) =&gt; data != oldWidget.data;<br>}<br>class MyWidget extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    final theme = AppTheme.of(context).data;<br>    return Container(<br>      color: theme.primaryColor,<br>      child: Text(&#39;Hello&#39;, style: theme.textTheme.bodyMedium),<br>    );<br>  }<br>}<br><br><br>//Usage<br>MaterialApp(<br>  home: AppTheme(<br>    data: ThemeData.light(), // Or ThemeData.dark()<br>    child: MyWidget(),<br>  ),<br>);</pre><h3>Key takeaway:</h3><p>InheritedWidget simplifies data sharing in Flutter, making your code cleaner and more efficient!</p><h3>When Does an InheritedWidget Rebuild?</h3><p>An InheritedWidget itself doesn’t “rebuild” in the same way a regular widget does with setState(). Instead, a new instance of the InheritedWidget is provided in the widget tree. Here&#39;s a breakdown:</p><ol><li><strong>InheritedWidget is Immutable</strong>: An InheritedWidget is essentially a container for data. You don’t change the data <em>within</em> the same instance of an InheritedWidget.</li></ol><p>2. <strong>Parent Rebuilds and Provides New Instance</strong>: When the parent widget of an InheritedWidget rebuilds (due to setState() or any other reason), it provides a <em>new</em> instance of the InheritedWidget with the updated data.</p><p>3. <strong>updateShouldNotify() Determines Rebuilds:</strong> The key is the updateShouldNotify() method.</p><p>In essence: The InheritedWidget is replaced, and updateShouldNotify() controls whether descendants are notified of the change and thus rebuilt.</p><h3>Connection with MediaQuery</h3><p>MediaQuery is a class in Flutter that provides information about the current media, such as screen size, orientation, pixel density, and accessibility settings. It&#39;s closely related to InheritedWidget in the following way:</p><ul><li>MediaQuery is an InheritedWidget: MediaQuery itself <em>is</em> an InheritedWidget. This is how Flutter makes media information available to all parts of your app.</li></ul><h3>How it Works:</h3><ul><li>Flutter creates a MediaQueryData object containing the device&#39;s media information.</li><li>This MediaQueryData is then wrapped in a MediaQuery InheritedWidget.</li><li>This MediaQuery widget is placed high up in the widget tree (usually near the top of your MaterialApp).</li><li>When the device’s configuration changes (e.g., the user rotates the screen), Flutter creates a <em>new</em> MediaQueryData and a <em>new</em> MediaQuery InheritedWidget.</li><li>The updateShouldNotify() method in MediaQuery determines if the new MediaQueryData is different from the old one. If it is, widgets that use MediaQuery.of(context) are rebuilt to reflect the updated information.</li></ul><h3>Accessing the Data:</h3><ul><li>You access the media information using MediaQuery.of(context). This method retrieves the nearest MediaQuery InheritedWidget in the widget tree and returns the MediaQueryData.</li></ul><h3>In summary:</h3><p>MediaQuery uses InheritedWidget to efficiently provide device-specific information to your Flutter application. When the device configuration changes, a new MediaQuery is provided, and updateShouldNotify() ensures that only the widgets that depend on this information are rebuilt.</p><h3>For More Info Head Over To</h3><p><a href="https://api.flutter.dev/flutter/widgets/InheritedWidget-class.html">InheritedWidget — Flutter Website</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51dc03a034c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>