<?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 Muhammad R Kahfi on Medium]]></title>
        <description><![CDATA[Stories by Muhammad R Kahfi on Medium]]></description>
        <link>https://medium.com/@mrijalulkahfi?source=rss-252ba9defbc6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9k6eAheOZVbRJWhkzAR8Rw.png</url>
            <title>Stories by Muhammad R Kahfi on Medium</title>
            <link>https://medium.com/@mrijalulkahfi?source=rss-252ba9defbc6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 09:19:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrijalulkahfi/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[Performance Benchmark: React Native vs. Flutter Mobile App]]></title>
            <link>https://blog.zero-one-group.com/performance-benchmark-react-native-vs-flutter-mobile-app-f879ee2ebf36?source=rss-252ba9defbc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f879ee2ebf36</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Muhammad R Kahfi]]></dc:creator>
            <pubDate>Tue, 24 Jun 2025 06:45:08 GMT</pubDate>
            <atom:updated>2025-06-24T06:45:08.216Z</atom:updated>
            <content:encoded><![CDATA[<h4>Research Team</h4><ul><li><a href="https://www.linkedin.com/in/mrkahvi/"><em>Muhammad Rijalul Kahfi</em></a><em>, Senior Product Engineer at Zero One Group</em></li><li><a href="https://www.linkedin.com/in/dharmayudistira/"><em>Dharma Yudistira Eka Putra</em></a><em>, Product Engineer at Zero One Group</em></li><li><a href="https://www.linkedin.com/in/dyva-pandhu/"><em>Dyva Pandhu</em></a><em>, Product Engineer at Zero One Group</em></li><li><a href="https://www.linkedin.com/in/muhwid/"><em>Muhammad Widodo</em></a><em>, Product Engineer at Zero One Group</em></li><li><a href="https://www.linkedin.com/in/johansutrisno/"><em>Johan Sutrisno</em></a><em>, Product Engineer at Zero One Group</em></li></ul><p>This report details a comprehensive performance benchmark comparing React Native and Flutter, two leading frameworks for cross-platform mobile app development. The study evaluated both frameworks across various metrics under defined scenarios, utilizing a unified benchmarking demo application.</p><h3>Background</h3><p>In the rapidly evolving landscape of mobile application development, the choice of framework is critical. React Native and Flutter stand out as leading solutions for building cross-platform applications, offering developers the ability to create apps for both iOS and Android from a single codebase. However, significant questions remain about the comparative performance of these two frameworks, particularly as React Native undergoes architectural updates.</p><p>Many existing performance benchmarks were conducted using older versions of React Native, pre-dating its New Architecture. This makes it essential to revisit and reassess the performance landscape with the New Architecture enabled to determine its impact on performance compared to Flutter. Specifically, this benchmark seeks to understand if the New Architecture in React Native effectively closes the performance gap with Flutter, or potentially even outperforms it in specific areas.</p><p>This comprehensive benchmark aims to provide current, relevant data to inform development decisions. By systematically evaluating both React Native (with the New Architecture) and Flutter across various performance metrics and testing scenarios, this report will offer valuable insights into their respective strengths and weaknesses. The goal is to equip developers with empirical evidence, enabling them to make informed choices that align with their project requirements and performance expectations.</p><h3>Objective</h3><p>The primary objective was to rigorously assess and juxtapose the performance of React Native (RN) and Flutter. Testing spanned diverse metrics in distinct scenarios, all within the controlled environment of a purpose-built benchmarking application.</p><h3>Metrics Tracked</h3><p>Key performance indicators were systematically measured, including:</p><ol><li><strong>CPU Utilization: </strong>Quantifying processing power required during rendering, animation, and user interactions.</li><li><strong>Memory Usage: </strong>Monitoring memory allocation and management for lists, animations, and interactivity.</li><li><strong>Frame Rate (FPS):</strong> Capturing rendering smoothness during animations and interactions.</li><li><strong>App Startup Time: </strong>Measuring the initiation time from launch to the first UI display.</li><li><strong>App Size: </strong>Comparing the binary size of application releases.</li></ol><h3>Performance Benchmark Criteria</h3><p>Testing scenarios were meticulously designed to isolate different performance aspects:</p><ol><li><strong>Pure UI Performance: </strong>Evaluating the frameworks’ efficiency in rendering UI, managing large lists, and executing basic animations. The tasks included rendering a 10,000-item list with lazy loading and smoothly animating color transitions and decorative elements in a grid view. Metrics included CPU Utilization, Memory Usage, and Frame Rate.</li><li><strong>Resource-Intensive Tasks: </strong>Pushing the frameworks to their limits with complex animations and interactions. This involved animating color borders with shadows on a 100-tile grid, enabling drag-and-drop, and executing simultaneous color transitions and background rotations. Metrics included CPU Utilization, Memory Usage, and Frame Rate.</li><li><strong>Input Responsiveness: </strong>Measuring UI responsiveness during high-load interactions. Testing focused on rapid drag-and-drop and button taps during active background animations, tracking Frame Rate, CPU Utilization, and Memory Usage.</li></ol><h3>Implementation Methodology</h3><h4>Devices Used</h4><p>To maintain consistency, the following physical devices were used for benchmarking:</p><ul><li><strong>Android Devices: </strong>Samsung Galaxy A14</li><li><strong>iOS Devices: </strong>iPhone 8</li><li><strong>Testing Device:</strong> Macbook Air M1 2020 8GB Memory</li></ul><h4>App Specification</h4><p>The demo application was structured with a master-detail layout covering the various test scenarios. It included a home screen, list rendering/animation test, grid rendering/interaction test, input responsiveness test, and settings to control features.</p><h4>CPU Utilization, Memory Usage, and FPS Test Procedure</h4><p>Testing was standardized as much as possible. Physical devices were used in release mode with cleared caches and restarts. Each scenario ran for 30 seconds except app startup and size tests. Data was collected using profiling tools, documented at 30-second intervals, and analyzed for average, peak, and significant differences.</p><h4>Tools for Measuring Metrics</h4><ul><li>Android Studio Profiler</li><li>Xcode Instruments</li></ul><h4>App Startup Time Measurement</h4><p>One of the most critical metrics for mobile app performance is <strong>cold start time</strong> — the duration from tapping the app icon to the moment the app becomes usable. To benchmark this, we profiled clean builds of both a Flutter and a React Native (RN) app on iOS using <strong>Xcode Instruments</strong>.</p><h4>App Binary Size Measurement</h4><p>Both Flutter and React Native apps were built in <strong>release mode</strong> and exported as <strong>universal APKs</strong> for Android. The React Native app was cleaned up to remove unnecessary default Expo assets, splash screens, and dependencies to ensure a fair comparison. On iOS, bundle size was measured using the final <strong>.ipa file</strong>, generated manually by re-packaging the <strong>.xcarchive Payload</strong> into an .ipa, also in release mode. All builds were prepared to reflect realistic production deployments.</p><h3>Benchmark Results</h3><p>Android and iOS benchmark results are reported separately due to differences in profiling tool capabilities. Android Studio Profiler and Xcode Instruments expose distinct metrics and levels of granularity. For example, Android Studio Profiler provides both allocated and total memory metrics out of the box, while Xcode Instruments does not expose total memory directly. Conversely, Xcode Instruments reports average FPS as a summarized metric, whereas Android Studio outputs raw frame timing data without direct FPS aggregation. Consequently, the metrics presented reflect what each tool natively supports, without additional instrumentation or post-processing.</p><h3>App Sizes</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a2a1208b80586f27714746a185fba772/href">https://medium.com/media/a2a1208b80586f27714746a185fba772/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*AWi_E5lWqyTJbWQKX9IOzw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*qxjtu-6kv-ItVFgsqLM-mQ.png" /></figure><p>Benchmark results show mixed outcomes: the Flutter app APK size is significantly smaller than React Native, while React Native has a slight edge over Flutter in IPA size.</p><h3>Startup Time</h3><p><strong>Cold Start Time on Android</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/61241e8532ff9d08d0de4981f0194306/href">https://medium.com/media/61241e8532ff9d08d0de4981f0194306/href</a></iframe><p><strong>Cold Start Time on iOS</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/371943aed7aa50abab8beddcf6527d62/href">https://medium.com/media/371943aed7aa50abab8beddcf6527d62/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*D8PIb9ZoZ7GxI6MparPQPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*Bk0CL3Pbgi7f6Rj-DFbONQ.png" /></figure><p>Benchmark results show mixed performance: the Flutter app cold-starts slightly faster than React Native on iOS, while React Native has an edge over Flutter in cold-start performance on Android.</p><h3>CPU Utilization, Memory Usage, and FPS</h3><h4>Scenario 1: Pure UI Performance (Scrolling 10,000 List Items)</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9dea1326fcee44ed5985835873b66ef6/href">https://medium.com/media/9dea1326fcee44ed5985835873b66ef6/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*nixS4vWqXSco167yiKDJXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*q2EjSmdHV2m8xBlHEi-kLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*R31Z7DB4ifCv3-HMEa8yog.png" /></figure><h4>Scenario 2: Resource-Intensive Task</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/44711124404ed4a7159f6e21cbb038fc/href">https://medium.com/media/44711124404ed4a7159f6e21cbb038fc/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*h8hCW8gCuesQI8Na3xLSIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*qsoSsdaK9lYtYz4-X9oDBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*XVR3H-m2f5CVuFln0B4aJA.png" /></figure><h4>Scenario 3: Input Responsiveness Task</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd54fc62497d0d8ee242bfd6ed7087f5/href">https://medium.com/media/dd54fc62497d0d8ee242bfd6ed7087f5/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*cbjsBznym0gVMq7QWS4ojw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*mqXnKTybpTAYTENiUm3Idw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*qv5PGd7iZJ9TQ3kVyt5_KQ.png" /></figure><h3>iOS Benchmarks (Device: iPhone 8)</h3><p><strong>Note: Memory units are iOS-style (</strong><strong>MiB);</strong></p><h4>Scenario 1: Pure UI Performance (Scrolling 10,000 List Items)</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e926a590adba30dd47674ddcd771253/href">https://medium.com/media/0e926a590adba30dd47674ddcd771253/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*fqEcfQN5ex8L60RR0UPr5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*nDhydjuYQIaWFJgnciTnXQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*LTr7LizB9qg1pGKupTCjOw.png" /></figure><h4>Scenario 2: Resource-Intensive Task</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8773c6a0bd6ae5de627c21d68d294a2/href">https://medium.com/media/a8773c6a0bd6ae5de627c21d68d294a2/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*sIBWi-LQj2UPX_CmgSSgog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*dWf7pDxO7u5uac1VCSNgcA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*G2l8c66mAg905cqgydjKPg.png" /></figure><h4>Scenario 3: Input Responsiveness Task</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2cfd8357287e737a2a8b2d315a510467/href">https://medium.com/media/2cfd8357287e737a2a8b2d315a510467/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*Gb4AcWU4e_O2QaHDx8BYtA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*6ykFHsoA1QzU9oqiQKu7iQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*Kn1xtSM8pSliwPfvKyi1eg.png" /></figure><h4>Automation Challenges</h4><p>While automation is ideal for ensuring repeatability and scalability, our benchmarking efforts faced several real-world limitations:</p><ul><li><strong>Framework-Specific Overhead</strong>: Many testing frameworks (e.g., Detox, integration_test) introduce their own performance overhead, especially in debug or test modes, which distorts metrics like CPU usage and frame rate. Accurate release-mode measurement is not always supported or reliable.</li><li><strong>Tool Limitations in Release Mode</strong>: Tools like <strong>Appium</strong> can automate drag-and-drop scenarios but suffer from <strong>high latency</strong>, making them unsuitable for measuring responsiveness or real-time interactions. Similarly, <strong>Maestro.dev</strong> works well for drag-and-drop on Android, but <strong>does not support iOS physical devices in release mode</strong>, limiting cross-platform parity.</li><li><strong>Execution Latency &amp; Timing Inconsistencies</strong>: Automated inputs often exhibit <strong>inconsistent execution timing</strong>, especially for interactions like rapid taps or drags. This introduces variability in time-sensitive benchmarks such as input responsiveness and frame drops.</li><li><strong>Cross-Platform Parity Concerns</strong>: Designing equivalent automation flows for both Flutter and React Native — across Android and iOS — without introducing test-specific artifacts or bias proved challenging.</li></ul><p>Due to these limitations, we opted for <strong>manual testing</strong> in controlled conditions, using physical devices and consistent procedures across all scenarios. While this reduces automation scalability, it ensures that the collected performance data reflects true release-mode behavior without interference from test harnesses.</p><h3>Conclusion</h3><p>In terms of CPU usage, memory consumption, and frame rates, preliminary results suggest that <strong>React Native</strong>, <strong>even with the new architecture enabled</strong>, continues to exhibit higher CPU and memory usage — especially during resource-intensive operations. This may lead to lower frame rates and a higher number of frame drops. In contrast, <strong>Flutter</strong> is expected to deliver smoother animations with more stable frame rates.</p><p><strong>App startup time and bundle size</strong> vary across platforms.<br> On <strong>Android</strong>, the Flutter APK is significantly smaller than React Native’s, and Flutter also shows slightly faster cold-start times.<br> On <strong>iOS</strong>, React Native has a slight advantage in IPA size and cold-start performance, which could be attributed to optimizations introduced by the new architecture.</p><h3>Short Analysis</h3><p>This benchmark compares Flutter and React Native, with React Native using its <strong>new architecture (Fabric, JSI, TurboModules)</strong>. These improvements significantly enhance runtime performance by reducing JavaScript-to-native communication overhead and enabling more efficient layout updates.</p><p>Initial results show that <strong>React Native still tends to consume more CPU and memory</strong>, especially during resource-intensive operations, aligning with its hybrid rendering model and reliance on the JavaScript engine. In contrast, <strong>Flutter shows more efficient resource usage</strong>, likely due to its ahead-of-time compiled Dart code and single-threaded rendering pipeline.</p><p>In terms of cold start time and app size, the results vary across platforms:</p><ul><li><strong>React Native shows slightly faster cold starts on Android</strong>, potentially due to optimizations from the new architecture.</li><li><strong>Flutter starts slightly faster on iOS</strong>, and its APK size is significantly smaller than React Native’s, though <strong>React Native has a slight edge in IPA size</strong>.</li></ul><p>These early findings are consistent with architectural expectations, but further in-depth testing is needed to draw definitive conclusions about runtime performance under broader usage conditions.</p><h3>Further Direction</h3><p>Further in-depth testing scenario is necessary to draw definitive conclusions about runtime performance under broader usage conditions. This should include:</p><ul><li>Longer duration testing periods in fully-automated way to observe performance trends over time.</li><li>Testing with a wider range of devices, including low-end and high-end models.</li><li>Analyzing background task performance under different app states (active, background, terminated).</li></ul><p>Considering further comparisons, future work could also evaluate:</p><ul><li>Developer experience (ease of use, tooling, community support) for React Native and Flutter.</li><li>A benchmark against other cross-platform frameworks, though <strong>Lynx</strong> is primarily a document processor and not directly comparable for mobile app development.</li></ul><h3>Appendix &amp; Artifacts</h3><p>To promote transparency and reproducibility, we’ve made the source code, performance recordings, and raw profiling data available for review:</p><ul><li><strong>Benchmark App Source Code (Flutter &amp; React Native)</strong><br> <a href="https://github.com/zero-one-group/flutter-react-native-benchmark">GitHub Repository — Benchmark Project</a></li></ul><blockquote><em>If you would like access to the raw artifacts or encounter any issues reproducing the results, please contact </em><a href="/service/mailto:kahfi@zero-one-group.com"><em>kahfi@zero-one-group.com</em></a><em>.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f879ee2ebf36" width="1" height="1" alt=""><hr><p><a href="https://blog.zero-one-group.com/performance-benchmark-react-native-vs-flutter-mobile-app-f879ee2ebf36">Performance Benchmark: React Native vs. Flutter Mobile App</a> was originally published in <a href="https://blog.zero-one-group.com/">Zero One Group</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI has Changed The Way I Learn New Tech]]></title>
            <link>https://medium.com/@mrijalulkahfi/ai-has-changed-they-way-i-learn-new-techs-0ffade6da40d?source=rss-252ba9defbc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ffade6da40d</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Muhammad R Kahfi]]></dc:creator>
            <pubDate>Tue, 18 Mar 2025 03:33:57 GMT</pubDate>
            <atom:updated>2025-03-19T02:02:44.662Z</atom:updated>
            <content:encoded><![CDATA[<p>I used to think learning a new tech stack or a new stack or even a new tech domain meant spending hours reading official documentation, watching tutorials, or following some long-winded online course. And to be fair, that approach works for some people. But for me?</p><p><strong>In tech, I’ve never been a fan of that slow, theoretical learning.</strong> That’s a painfully slow way to learn.</p><p>I realized something: most of the tutorials out there teach you to build <strong>trivial projects </strong>like a to-do list app, a basic weather app, or something equally uninspiring.</p><p>The real issue with these projects isn’t just that they’re too simple, but that they might feel disconnected from what you actually want to build. If you’re not motivated or invested in the project, you’re likely to lose interest quickly. The key is to pick something meaningful that aligns with your goals, something that excites you and pushes you to learn.</p><p>As an experienced developer, you already know how to break down complex problems into manageable parts; learning a new stack is just about understanding how to use the tools effectively.<strong> Instead of building trivial projects like a to-do list app, your focus should be on quickly becoming productive with real-world use cases.</strong></p><h4>Skimming Docs and Jumping Straight Into Real-World Use Cases</h4><p>Now, when I want to learn a new domain or stack, I don’t waste time reading every single page of the official documentation like a textbook. Instead, I would read and comprehend just the basic parts, and then:</p><ol><li><strong>Skim the docs</strong> to get a rough idea of the key concepts.</li><li><strong>Play around in an interactive playground or REPL</strong> (if available) just to get a feel for the syntax.</li><li><strong>Jump straight into a real-world use case.</strong></li></ol><p>Rather than following a generic tutorial, I think of a <strong>small but practical project, </strong>something that actually interests me. Then, I <strong>break it down step by step</strong>, treating it like a real project.</p><h4>AI as My On-Demand Tutor</h4><p>Once I have my project idea, I <strong>use AI chatbots like ChatGPT, Gemini, or DeepSeek</strong> as my <strong>instant tutor</strong>. But not in the way some people misuse it.</p><p>You don’t just ask, <em>“Build an authentication system in Next.js?”</em> That’s too broad. Instead you should break it down:</p><ul><li><em>“Add a new page in containing a login form and a button”, </em>and then,</li><li><em>“Add an action to the button and create a hook to handle it”, </em>and then,</li><li><em>“Add a new master-detail page ”,</em>and then,</li><li><em>“Create a new route to master detail and trigger the action by the login button tap”, </em>and then</li></ul><p>And on every single answer, you are learning from it and practicing your self to make changes on other parts of the codebase.</p><p>By doing this, you’re not just copying and pasting code , instead you are <strong>understanding each piece</strong> as you go. And because youbreak tasks down into small, focused steps, you can <strong>spot when the AI is hallucinating</strong> or when its answer isn’t idiomatic.</p><p>The key is to leverage AI to break down complex topics into smaller, digestible tasks where you can ask specific questions, apply what youlearn immediately, and refine your understanding through practice. This approach allows you to <strong>follow a step-by-step pattern while actively building a real product or solving an actual problem</strong>. You’re not passively consuming information. You are learning by doing, and AI helps you speed up that process.</p><p>Of course, this doesn’t mean skipping fundamentals entirely. <strong>You still need to learn it, but you don’t have to comprehend everything upfront.</strong> If your goal is to become an expert in the subject, then sure, mastering all the fundamentals first makes sense. But if your goal is to deliver value as soon as possible, it’s time to think pragmatically: <strong>learn what you need as you go, apply it, and deepen your knowledge through real-world practice.</strong></p><h4>Why I Don’t Watch Video Courses</h4><p>A lot of people are content with video courses, but for me? <strong>They’re way too slow.</strong></p><ul><li>You can’t <strong>search</strong> them easily.</li><li>You’re forced to watch at the pace the instructor dictates.</li><li>Most of them are <strong>bloated with unnecessary explanations</strong>.</li></ul><p>Reading is much faster. If I need a deep dive, I’ll look at documentation or a well-written blog post. If I need a quick, precise answer, I ask AI. Simple as that.</p><h4>The Danger of Blindly Trusting AI-Generated Code</h4><p>Here’s the part where AI can mess you up: <strong>blindly copying and pasting code without understanding it</strong>.</p><p>I’ve seen developers use AI to generate code or fix bugs they don’t even comprehend. And that’s dangerous because:</p><ol><li><strong>AI makes mistakes.</strong> If you don’t understand the solution, you won’t even notice when it’s wrong.</li><li><strong>AI doesn’t always follow best practices.</strong> Sometimes, the generated code is inefficient, unidiomatic, or even insecure. Unless you question it repeatedly and cross-check with reliable sources, you might not notice subtle mistakes or poor implementations. Sometimes the generated code is inefficient, unidiomatic, or insecure.</li><li><strong>You won’t actually learn.</strong> If you keep relying on AI without questioning it, you’re just outsourcing your thinking.</li></ol><p>Whenever AI gives you a solution, you read the explanation, cross-check it with documentation if needed, and make sure you actually understand it before applying it. That way, you are <strong>using AI as a learning tool, not a crutch</strong>.</p><h4>My Rust Learning Experience: Beating the Steep Learning Curve</h4><p>Let’s be real, learning <strong>Rust is hard.</strong></p><p>It’s not like picking up JavaScript or Python, where you can just jump in and start hacking things together. Rust forces you to think about <strong>ownership, borrowing, and lifetimes</strong> right from the start, and the compiler can feel more like a strict teacher than a helpful guide. That’s why it has a reputation for having a <strong>steep learning curve, </strong>even experienced developers struggle with it.</p><p>It’s interesting to know that I started to get productive (meaning delivering value) with Rust after <strong>just two weeks of learning</strong>. While Google did an internal study and found that <strong>most of their engineers took around two months to feel productive in Rust</strong>. And these aren’t junior devs; they’re some of the best engineers in the industry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c9zvxVSiVcO6oV17i3YlzQ.png" /></figure><p><a href="https://opensource.googleblog.com/2023/06/rust-fact-vs-fiction-5-insights-from-googles-rust-journey-2022.html">https://opensource.googleblog.com/2023/06/rust-fact-vs-fiction-5-insights-from-googles-rust-journey-2022.html</a></p><p>Of course it’s not because I’m some genius or smarter than them. I’m not.</p><p>The difference? <strong>I leveraged AI to learn fast. </strong>Most likely, these Google engineers already started adopting Rust before AI-powered assistants were widely available. So they followed the traditional learning method.</p><p>As for me, the emerging of AI Chatbots really led me to a completely different approach of learning.</p><ul><li><strong>I comprehended just the basic parts, and then skimmed the Rust book</strong> just to get a basic feel and whole concept or features for the language.</li><li>I <strong>jumped into writing real code right away,</strong> even if I didn’t fully understand every concept yet.</li><li>I used AI chatbots as an <strong>on-demand tutor</strong>, asking targeted questions to help me understand the tricky parts <em>while I was coding</em>.</li></ul><p>At the end of the day, the most effective way to learn is by <strong>doing</strong>. AI is just a tool that accelerates the process, but the effort still comes from you. By continuously iterating between asking targeted questions, applying what you learn, and refining your skills through hands-on experience, you develop both competence and confidence in new technologies.</p><h4>AI Won’t Replace Learning, But It Will Change How We Learn</h4><p>Some people say using AI to learn is “cheating.” It’s not. AI won’t replace the need to understand programming, it just <strong>removes a lot of the friction</strong> in the learning process.</p><p>Instead of spending weeks struggling through vague documentation, outdated Stack Overflow answers, and slow tutorial videos, I get direct, <strong>real-time explanations tailored to my exact problem</strong>. But at the end of the day, <strong>I still have to do the thinking.</strong></p><p>That’s the real power of AI in learning new stacks: <strong>it accelerates the learning process, but you still have to put in the effort to make it stick.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ffade6da40d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Startup Doesn’t Really Need Mobile Apps]]></title>
            <link>https://medium.com/@mrijalulkahfi/your-startup-doesnt-really-need-mobile-apps-5f1500a3e8fb?source=rss-252ba9defbc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f1500a3e8fb</guid>
            <category><![CDATA[product]]></category>
            <category><![CDATA[mobile-apps]]></category>
            <category><![CDATA[progressive-web-app]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Muhammad R Kahfi]]></dc:creator>
            <pubDate>Sun, 15 Oct 2023 06:01:11 GMT</pubDate>
            <atom:updated>2023-10-18T03:53:18.087Z</atom:updated>
            <content:encoded><![CDATA[<h3>You Don’t Really Need Mobile Apps for Your Startups</h3><p>A couple of years ago, a buddy of mine came up to me with an idea: he wanted me to help him build a mobile app for his startup. His gig? Running a catering service that had teamed up with event organizers to modernize their game.</p><p>Their grand plan was to go all digital and, like everyone else, they thought a mobile app was the way to go. It was like a trend — every company seemed to be hopping on the mobile app bandwagon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ea9rWcZVf5GOQ6kY4MaVw.png" /></figure><p>But hold on a minute. This service wasn’t kind of your everyday grub service. Nope, it was a catering outfit that only swung into action when there was a big event. We’re talking serving up the eats for massive shindigs with dozens or even hundreds of hungry guests.</p><p>So, what did their app look like?</p><p>Customers could pick a date, scroll through the food options, see if they could cater on the chosen date, place an order, make a down payment, and keep tabs on how things were cooking. It’s kinda like the old-school way, but with a mobile app twist.</p><p>Now, don’t get me wrong, If I wanted I could just say building a mobile app for this kinda service is totally okay. But just because I am a mobile guy who can whip up mobile apps doesn’t mean I’d push for it. My concern was just what’s best for the product, plain and simple.</p><p>So, is a mobile app really worth it for this gig? How often will folks use it? 🤔</p><p>Creating a mobile app for this deal might not hit the bullseye. Typically, folks don’t throw fancy parties every month, not even every week. As a regular Joe, I wouldn’t bother downloading an app just to order a service I might only use once a year, if that. 🗓👨‍🍳</p><p>Here’s another story. Back in 2019, another friend of mine had a plan to develop a mobile app for his tailoring service marketplace. The marketplace idea sounds sensible enough, but the mobile app?</p><p>My first question was, how many of his customers really needed tailoring regularly? Is it worth installing an app if folks won’t be fiddling with it even once a month? 🤷‍♂️</p><p>Building an app can cost a pretty penny, so it’s gotta be a bang for your buck. Don’t be a sheep and follow the crowd. Make sure it’s the right fit for you. 💰</p><p>Mobile apps are really relevant when you’ve got a product that folks would use them day in and day out. Here are a few scenarios where building mobile apps for your startup does make sense:</p><ol><li>Frequent Use: Your product is something people use often, like daily or weekly. There’s gotta be a bunch of customers who need your app all the time to make it worthwhile.</li><li>On-Demand Services: Think ride-hailing apps — you might not book a ride every month, but it’d be a hassle to open a browser, type in a URL, and wait for the web page to load just for a quick ride. Apps make things quick and easy. 🚗</li><li>Intermittent Services: Imagine your product is something folks use occasionally, but when they do, it’s gotta be pronto. Like travel agencies using apps for tracking tourists or field workers who need to fill out forms while out in the field. Apps help get stuff done smoothly, even if they’re only used for a few days.</li></ol><p>So, what did I really suggest for their product and service delivery? What was really my solution? 🤔</p><p><strong>PWA</strong>, to be precise, mobile PWA. Yeah, that’s the way to go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*El-fxg6FIv_ZR61ig6vlyg.png" /></figure><p>For those who don’t know, PWA (Progressive Web App) is basically a web app that feels like a native app. It aims to have nearly zero occurrence of page loading every time users interact with it and navigate between screens.</p><p>The other cool thing about PWAs is offline capabilities. They work offline, just like those fancy native apps.</p><p>What does that mean? Well it doesn’t mean the apps would fully work when offline. That means the UI would still be around even when the app is on a very slow or even no connection at all. This is what differentiates regular web apps with PWAs. As opposed to PWAs, regular web apps (even SPAs) still need to load the UI and won’t load if you don’t have connection.</p><p>Let’s get back into discussing why native mobile apps won’t work out for their services.</p><p>Well, for our catering buddy’s case, booking a huge spread for an event isn’t exactly a digital necessity. Some folks prefer the old-fashioned, face-to-face approach rather than going all techy with apps. 😄 But for those who do prefer apps, a web app does the trick just fine. They can easily hop on a web app whether they’re on their desktop or mobile.</p><p>Now, as for our tailoring service pal, the story’s pretty much the same. In fact, a startup like that might attract more new customers than keeping the old ones.</p><p>Why? Because it’s not your average Joe who’s getting their clothes tailored every week, let alone every day. On the other side, there’s a whole bunch of potential customers out there who haven’t even heard of your marketplace yet. So, having your marketplace rocking the web mode makes it a breeze for search engines to give it a boost. Imagine this: someone Googles “tailoring services nearby” and, voila, your website pops up right at the top of the list. This is something we couldn’t do using mobile apps.</p><p>In a nutshell, when it comes to venturing into the realm of mobile apps for your startup, it should be all about what your product is and how people use it. Don’t just follow the crowd; make sure it’s the right fit for you. If traditional native mobile apps don’t seem to sync up with your product, consider embracing PWAs as they can be a great alternative in many scenarios.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f1500a3e8fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Figma Dev Mode: My Review as A Mobile Developer, Does It Help?]]></title>
            <link>https://medium.com/@mrijalulkahfi/figma-dev-mode-how-it-helps-flutter-developers-66f5308967af?source=rss-252ba9defbc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/66f5308967af</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ui-design]]></category>
            <category><![CDATA[figma]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Muhammad R Kahfi]]></dc:creator>
            <pubDate>Fri, 30 Jun 2023 04:01:59 GMT</pubDate>
            <atom:updated>2023-07-05T10:03:49.947Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Disclaimer: This is what I experience as per Juny, 30 2023.</blockquote><p>This post is my review on the newly introduced Figma Developer Mode feature.</p><p>Last week, I opened Figma and eventually got an announcement that Figma has just launched the developer mode. It took place just a few days after a UX Designer asked me whether our engineers can make use of a Figma of Flutter converter to streamline our workflow.</p><p>I said no. No doubts.</p><p>This feature is actually designed to help developers accelerate the UI implementation by generating code snippets.</p><p>I remember vividly last year, when a Figma to Flutter plugin was introduced, we were so excited in the beginning, we couldn’t wait to use it. However after a couple of tries, a lot of Flutter folks including me conclude this plugin is pity. No wonder most of them opt to implement the design on their own from scratch.</p><p>So, what about this new Figma Developer Mode? Does it really work? Let’s do some quick tries.</p><h3><strong>Trying a Full Page</strong></h3><p>Pick a simple design from <a href="https://www.figma.com/file/WXhESpK89HJV064oMi0X8z/Delivery-App-(Community)?node-id=101%3A6&amp;mode=dev">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*Dho7Wo9W6VggPiE7txzRcw.png" /></figure><p>It isn’t that complex design, is it?</p><p>And then copy the generated code and pasted it into Dartpad.dev. Here is the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nXAi4rjZWYbX3yvcn5trGw.png" /></figure><p>Turns out it’s just a white square show, with 78 issues. Error compiling to Javascript.</p><p>So what are really going on here? Check this out.</p><h4>Unexpected identifiers everywhere</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*9u8i6sBNJTUVhNXDfP7ZIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*aFkF8e9yY-ia4llHaeo4fg.png" /></figure><p>I didn’t have enough time to figure out what should be placed here to fix this. And it’s hard to do as well.</p><h4>Deeply nested (Kamehameha) code</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7s6kAiqOEFXVXOShSeX85A.png" /></figure><p>Even a beginer Flutter developer knows how bad this practice is. Hard to read. Violate the standard Flutter lints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*ORFGevwp9_G5pb219S5qOQ.png" /></figure><h4>Hardcoded values everywhere</h4><p>Still the same screenshot. There are so many hardcoded values here and there, making it difficult to reason about.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2k768TiPaRufElpFwFkTnA.png" /></figure><h4>Reliance on Stack and Positioned</h4><p>I suppose the developer of this converter has no proper Flutter experience or is simply ignorant about how the UI in Flutter is composed. As you can see on the screenshot above, pretty much all the widgets (if not all) are just made of Positioned and Stack. No columns, no rows. It is no more than a collection of Stacks and Positioneds 😀.</p><p>Most of the compile errors are caused by the “<em>unexpected identifer</em>” commas inside Stack widget. So I just tried to omit all those commas and then the errors are finally gone.</p><p>Is it now working?</p><p>Unfortunately, still no. The Dartpad preview shows nothing but a white square.</p><p>Surely, I had no idea what the code is really doing? It’s just a bunch of code, widely nesting. I just didn’t want to take my time to figure it out.</p><p>I also wonder is it the plugin the problem or is it just me that don’t know how to use it properly 🤔? Please let me know if it works on your end!</p><h3>Trying A Simple Widget</h3><p>Okay, perhaps hoping it generate proper code for a full page is too much. Let’s do it to a simple widget. Pick just the green button on the same page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*fK6vHJcG5LYI01gIEPrXQg.png" /></figure><p>Then pasted the code to the Dartpad editor.</p><p>It failed to compile initially because of the same issue <em>“unexpected identifier”</em>. There was only one issue this time. Not bad. I just had to remove it.</p><p>Then finally it showed a green edge-rounded square, <em>yeaayy</em>. But with no text 😞.</p><p>Here is the code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6bf0e29b819b338c712ffa6530293da1/href">https://medium.com/media/6bf0e29b819b338c712ffa6530293da1/href</a></iframe><p>And when you look at the code, it’s just messy snippet with some unreasonable, overcomplicated widgets such as Matrix4.identity()..translate(0.0, 0.0)..rotateZ(-3.14) and so on, when it could be implemented very easily using Flutter’s ElevatedButton.</p><h3>Conclusion</h3><p>Again, our conclusion is still the same. I think it is a great feature initiative, we love the idea. But it’s delivered very poorly.</p><p>For you who might ask whether I have tried it on VS code and test it on emulator instead of Dartpad, I have. And it resulted exactly the same. On top of that, just by looking at the produced code, I think it’s a no-go when it comes to implementing the UI design.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66f5308967af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Form Validation with Riverpod, Formz, and Freezed]]></title>
            <link>https://medium.com/@mrijalulkahfi/form-validation-with-riverpod-formz-and-freezed-part-2-logic-29f45c677a11?source=rss-252ba9defbc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/29f45c677a11</guid>
            <category><![CDATA[forms]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[riverpod]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[state-management]]></category>
            <dc:creator><![CDATA[Muhammad R Kahfi]]></dc:creator>
            <pubDate>Sat, 17 Dec 2022 14:59:47 GMT</pubDate>
            <atom:updated>2023-05-11T08:31:17.933Z</atom:updated>
            <content:encoded><![CDATA[<p>We will be explaining how to manage form validation’s states using <a href="https://riverpod.dev/">Riverpod</a> state management package. In addition, we also use <a href="https://pub.dev/packages/formz">Formz</a> as form state manager and <a href="https://pub.dev/packages/freezed">Freezed</a></p><h3>The Goal</h3><p>So, given some sort of requirements of a login form like these:</p><ul><li>forms must validate on user interaction.</li><li>the validation of the password form must match a certain regex pattern and meet a minimum length. So must the validation of the email form.</li><li>if the validation fails, the form must show that common red borders and red error message,</li><li>the submit button must only be enabled interactively once the validation passes.</li></ul><h3>Required Packages</h3><p>Alright, the first thing is to include them to our pubspec.yaml and then to run flutter pub get.</p><pre>dependencies:<br> flutter:<br> sdk: flutter</pre><pre># other dependencies<br> flutter_riverpod: ^2.1.1<br> freezed_annotation: 2.1.0<br> formz: ^0.4.1</pre><h3>Project Structure</h3><p>We are following the Feature-First approach to manage our project folder, meaning that the features folders are placed on top of the layers folder. This structure is best way if you want to develop large scalable app.</p><p>Also, we are adopting a kind of clean architecture whereby the code for presentation, logic, data, and domain is placed in different layers.</p><p>So here is how the project structure looks like.</p><pre>lib<br>│ ├── features<br>│ │ ├── authentication<br>│ │ │ ├── presentation<br>│ │ │ ├── application<br>│ │ │ ├── domain<br>│ │ │ ├── data<br>│ ├── utils<br>│ │ ├── string_validators.dart<br>│ ├── constants<br>│ │ ├── app_theme.dart</pre><p>Let’s ignore both data and application folder for now since we are not going to implement any isolated logic, nor we want to communicate with databases or remote API. We just need presentation and domain.</p><ol><li>Presentation is where we put the widget, it’s state, and it’s state notifier (which we will be calling it controller).</li><li>Domain is where we put the entities, classes that represents the UI or data that need to be consumed by the UI. In real world app, this layer also contains repositories and mappers (classes that map models to entities).</li></ol><h3>Preparing the App Theme</h3><p>Here we are just going to style our text form field widgets. Let’s make them fully rounded with some different colors representing their different states.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f2bf9f50cef22a3c1a3ef1b5956c615e/href">https://medium.com/media/f2bf9f50cef22a3c1a3ef1b5956c615e/href</a></iframe><p>We put this file in folder lib/constants .</p><p>Since we are going to focus on form, we just create the style only for input decoration. No need to add more decorations.</p><p>By the way, this post is assuming you have already familiar with basic concept of Flutter app development. So there is no necessity to cover how to create a new project, and so on. We will be just jumping into the code snippets you need to demonstrate how the goal is attained.</p><h3>Implementing the Widget</h3><p>Then we create the UI for the login form.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/66f40e88fe12816c50c6b5e898cbc385/href">https://medium.com/media/66f40e88fe12816c50c6b5e898cbc385/href</a></iframe><p>BTextField and BButton is just our custom widget. Here is how they look inside.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a762ebde6b594f298e094656bed6c789/href">https://medium.com/media/a762ebde6b594f298e094656bed6c789/href</a></iframe><p>The reason why we have to create a custom widget for text field is that we want to have its label separated from the field, which is not the style the built-in TextField has.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ad201261212c26c76eb5df414643ff24/href">https://medium.com/media/ad201261212c26c76eb5df414643ff24/href</a></iframe><p>Now, we have our screen looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*93X5hVNW2wFnNtx-sTvD6w.png" /></figure><p>The submit button is still greyed out as we set it to be disabled by default. It will be activated only when the form is validated.</p><p>Just to make it a bit nicer, we add a random illustration image above the username text field. I put it from <a href="https://cdni.iconscout.com/illustration/premium/thumb/account-login-6003624-4976687.png">https://cdni.iconscout.com/illustration/premium/thumb/account-login-6003624-4976687.png</a></p><pre>Image.network(<br>  &#39;https://cdni.iconscout.com/illustration/premium/thumb/account-login-6003624-4976687.png&#39;,<br>   height: MediaQuery.of(context).size.height / 4,<br>),</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*d_3dMqPz0I9yCvqfbZOPWQ.png" /></figure><p>Great!</p><p>We still have a couple things to do:</p><ol><li>Define the form entity using Formz.</li><li>Implement the state management of the forms using Riverpod</li></ol><h3>Adding Form Entities with Formz</h3><p>Now that we already have the screen, we are going to add the form entities.</p><p>However, before writing the entities, it’d be better to create validator classes first. These classes contain all the validators such as regex pattern validator, minimum length validator, etc.</p><p>We put those classes all together in one file under directory lib/utils/</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b7377215b8efc4bbbfb378ccbf17c9e8/href">https://medium.com/media/b7377215b8efc4bbbfb378ccbf17c9e8/href</a></iframe><p>Once done, all we have to do next is to add the entities for both email and password.</p><p>We then create a new directory first at lib/features/authentication/domain/forms. And then we create a new file that represents the email form entity.</p><p>Below is the email form entity.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8db197ade2e547ef1fabbc7edad6d229/href">https://medium.com/media/8db197ade2e547ef1fabbc7edad6d229/href</a></iframe><p>And this is the password form entity.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7bae5de18bc385acb6bfafacd0cb1559/href">https://medium.com/media/7bae5de18bc385acb6bfafacd0cb1559/href</a></iframe><p>Please pay attention to validator() method which overrides from FormzInput’s validator. This is where all the validation rules go.</p><p>And also, look at the getMessage() method inside the EmailValidationError enum. The Formz package unfortunately doesn’t provide for you the mechanism to map the errors to the messages out of the box. Therefore we need to implement it on our own.</p><p>We are fortunate enough to achieve this using an enhanced enum since Dart 2.17 was released.</p><p>Great! One more step left, which is…</p><h3>Managing Forms’s State with Riverpod</h3><p>Let’s create the state class first using Freezed annotation. Note that we are putting this file under lib/features/authentication/presentation.</p><p>Here is how we define it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/521de9d565b679bdc3b1ef1fe4f12998/href">https://medium.com/media/521de9d565b679bdc3b1ef1fe4f12998/href</a></iframe><p>Don’t forget to run the builder, since we’re using an annotation.</p><pre>$ flutter pub run build_runner build</pre><p>Once done, you should have got the Freezed file named sign_in_state.freezed.dart automatically generated.</p><p>Some might think using Freezed for this simple model is an overkill. While for me itsn’t. Freezed is really an awesome package to save your time by generating all those common methods required by a Dart model.</p><p>The last this is to write a StateNotifier which we would call controller. We’re going to name it SignInController.</p><p>Here we go….!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1458fde35900ac839af294818dc0b655/href">https://medium.com/media/1458fde35900ac839af294818dc0b655/href</a></iframe><p>Kinda simple, isn’t it?</p><p>The method updateEmail() and updatePassword() will be invoked every time the value of email and password text field is changed.</p><p>Pretty much done!</p><p>Now we bind the controller to the UI we have created previously. So we will add a state watcher for both email and password form into the build() method of the SignInScreen.</p><pre>final email = ref.watch(signInNotifierProvider).email;<br>final password = ref.watch(signInNotifierProvider).password;</pre><p>And then, on both the onChanged() callback of both widgets add</p><ul><li>(value) =&gt; ref.read(signInNotifierProvider.notifier).updateEmail(value) for the email’s BTextfield.</li><li>(value) =&gt; ref.read(signInNotifierProvider.notifier).updatePassword(value) for rhe password’s BTextfield.</li></ul><p>And call the errorText() method of our form entities</p><ul><li>(value) =&gt; email..error?.getMessage() for the email’s BTextfield.</li><li>(value) =&gt; password.error?.getMessage()for the password’s BTextfield.</li></ul><p>Then we need our submit Button to watch the state change of both form’s validation. So we add ref.watch(signInNotifierProvider).status == FormzStatus.valid to check whether the current status of the form is valid.</p><p>The final look of our SignInScreen class should be like this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e6eaeb67a9dc1faba83c4151cbdaa4e/href">https://medium.com/media/2e6eaeb67a9dc1faba83c4151cbdaa4e/href</a></iframe><p>Let’s run the code now!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*4kWkyHPH_86K-zSNp_wEIg.gif" /></figure><p>Congrats! We have successfully done it.</p><p>Hope this help!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29f45c677a11" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>