<?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 VENKAT RAMAN on Medium]]></title>
        <description><![CDATA[Stories by VENKAT RAMAN on Medium]]></description>
        <link>https://medium.com/@venkatraman230?source=rss-a7ab9c17f08d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*aYPwMc9Yw_QUwdCf</url>
            <title>Stories by VENKAT RAMAN on Medium</title>
            <link>https://medium.com/@venkatraman230?source=rss-a7ab9c17f08d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 21:31:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@venkatraman230/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[Android’s 16KB Page Size Migration: Everything You Need to Know November 2025]]></title>
            <link>https://medium.com/@venkatraman230/androids-16kb-page-size-migration-everything-you-need-to-know-november-2025-b5c3ccbd2a7a?source=rss-a7ab9c17f08d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5c3ccbd2a7a</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[google-play]]></category>
            <dc:creator><![CDATA[VENKAT RAMAN]]></dc:creator>
            <pubDate>Sat, 01 Nov 2025 14:37:37 GMT</pubDate>
            <atom:updated>2025-11-01T14:37:37.706Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>If you’re an Android developer, you need to pay attention. Google is enforcing a major change that could affect your app’s compatibility — and the deadline is </em><strong><em>November 1, 2025</em></strong><em>.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iW9RylG_zk2GASrB28GbcQ.png" /><figcaption>Android 16 KB memory page size</figcaption></figure><p>Starting November 2025, <strong>all apps targeting Android 15+ must support 16KB memory page sizes</strong>. Miss this deadline, and your app updates could be rejected from Google Play.</p><p>But here’s the good news: migration isn’t difficult, and the performance benefits are substantial. Let’s dive in.</p><p><strong>📅 Last Updated:</strong> November 2025</p><p><strong>⚠️ Critical Deadline:</strong> November 1, 2025 for all apps targeting Android 15+ (API 35+)</p><h3>Why This Matters</h3><p>This comprehensive guide provides everything you need to successfully migrate to 16KB page sizes, based on official Google documentation and real-world implementation experience.</p><p><strong>What you’ll learn:</strong></p><ul><li>✅ How to check if your app is affected</li><li>✅ Step-by-step migration instructions</li><li>✅ Automated testing strategies</li><li>✅ Performance benefits you’ll gain</li><li>✅ Testing on emulators and physical devices</li></ul><h3>1. Overview of the Migration</h3><p>To improve performance on devices with large amounts of RAM, Android is moving the standard memory page size from 4KB to 16KB. A larger page size can enhance performance by reducing page faults and improving the efficiency of the Translation Lookaside Buffer (TLB).</p><h3>🚀 Performance Benefits of 16KB Pages</h3><p>The migration isn’t just a requirement — it’s an opportunity to make your app significantly faster:</p><ul><li><strong>⚡ Overall Performance Boost:</strong> 5–10% improvement across the system</li><li><strong>🏃 Faster App Launch Times:</strong> Up to 30% improvement in some cases (3.16% on average)</li><li><strong>🔋 Reduced Power Consumption:</strong> 4.56% reduction in power draw during app operations</li><li><strong>📸 Faster Camera Start-up:</strong> 4.48–6.60% faster camera initialization</li><li><strong>💨 Improved System Boot:</strong> Approximately 0.8 seconds faster system boot time</li></ul><h3>🎯 Who Is Affected?</h3><p>This change primarily affects apps that use <strong>C/C++ native code</strong> (.so files).</p><ul><li><strong>✅ Pure Java/Kotlin apps:</strong> Already compatible (but should still be tested)</li><li><strong>⚠️ Apps with native libraries:</strong> Require migration work</li><li><strong>⚠️ Apps using native SDKs:</strong> May need SDK updates from providers</li></ul><h3>2. 🗓️ Critical Deadline for Compliance</h3><blockquote><strong><em>IMPORTANT DEADLINE: November 1, 2025</em></strong></blockquote><p>Starting <strong>November 1, 2025</strong>, all new apps and updates submitted to Google Play that target Android 15+ (API level 35+) <strong>must support 16KB page sizes</strong>.</p><h3>📋 Who Must Comply?</h3><p><strong>✅ Required for:</strong></p><ul><li>Apps that use native C/C++ code (.so files)</li><li>Apps using third-party SDKs with native libraries</li><li>Apps with indirect native dependencies</li></ul><p><strong>✅ Already Compatible:</strong></p><ul><li>Pure Java/Kotlin apps (no native code)</li><li>Apps built entirely with Android SDK components</li></ul><h3>⏰ Why Act Now?</h3><p>Waiting until the deadline is risky. Here’s why you should migrate now:</p><ol><li><strong>Avoid rejection:</strong> Apps submitted after November 1, 2025 will be rejected if non-compliant</li><li><strong>Gain performance benefits:</strong> Your users will experience faster, more efficient apps immediately</li><li><strong>Test thoroughly:</strong> Give yourself time to identify and fix issues before the deadline</li></ol><h3>3. 🔍 How to Check a Device’s Page Size</h3><p>You can check the page size of any connected Android device (physical or emulator) using a simple adb command:</p><pre>adb  shell  getconf  PAGE_SIZE</pre><p><strong>Understanding the output:</strong></p><ul><li><strong>Output </strong><strong>4096</strong> → The device is using 4KB pages</li><li><strong>Output </strong><strong>16384</strong> → The device is using 16KB pages ✅</li></ul><h3>4. 🔎 How to Check if Your App is Affected</h3><p>Your app is affected if it includes native libraries (.so files). You can check this using Android Studio’s <strong>APK Analyzer</strong>.</p><h3>Using APK Analyzer</h3><ol><li>In Android Studio, go to Build &gt; Analyze APK...</li><li>Select your APK or AAB file</li><li>Look for a lib directory in the APK structure</li><li>If you see subdirectories like arm64-v8a, armeabi-v7a, x86, or x86_64 containing .so files, your app uses native code</li></ol><p><strong>APK Analyzer can also visually indicate your app’s 16KB compatibility status</strong>, making it easy to identify if your app needs migration work.</p><h3>Using readelf to Check Alignment</h3><p>To specifically check if your native libraries are 16KB-aligned, you can use the readelf tool (part of the NDK).</p><pre># Replace &lt;ndk-path&gt; with the path to your NDK installation</pre><pre>&lt;ndk-path&gt;/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-readelf -l &lt;path-to-your-so-file&gt; | grep  &#39;p_align&#39;</pre><ul><li><strong>Look for </strong><strong>p_align value:</strong></li><li>0x1000 (4096): Your library is <strong>not</strong> 16KB aligned.</li><li>0x4000 (16384): Your library <strong>is</strong> 16KB aligned.</li></ul><h3>5. 🛠️ Migration Steps for 16KB Compatibility</h3><p>Follow these steps to make your app compatible with 16KB page sizes.</p><h3>Step 1: Update Android Gradle Plugin (AGP)</h3><p>Ensure your project uses AGP version <strong>8.3.0 or higher</strong>. This version includes support for 16KB alignment by default.</p><h3>Step 2: Update NDK and Build Scripts</h3><p>Update your project to use <strong>NDK version r26 or higher</strong>.</p><ul><li><strong>For </strong><strong>ndk-build (</strong><strong>Application.mk):</strong></li></ul><p>Add the following flag to your Application.mk file:</p><pre>APP_SUPPORT_FLEXIBLE_PAGE_SIZES := true</pre><ul><li><strong>For CMake (</strong><strong>build.gradle or </strong><strong>build.gradle.kts):</strong></li></ul><p>Add the following flag to your CMakeLists.txt through your Gradle file:</p><pre>// In build.gradle (Groovy)</pre><pre>android {</pre><pre>defaultConfig {</pre><pre>externalNativeBuild {</pre><pre>cmake {</pre><pre>arguments &quot;-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON&quot;</pre><pre>}</pre><pre>}</pre><pre>}</pre><pre>}</pre><h3>Step 3: Fix Hardcoded Page Size Dependencies</h3><p>If your native code has hardcoded dependencies on a 4KB page size (e.g., #define PAGE_SIZE 4096), you must remove them.</p><ul><li><strong>DO NOT</strong> hardcode the page size.</li><li><strong>DO</strong> use the getpagesize() function from &lt;unistd.h&gt; or sysconf(_SC_PAGESIZE) to fetch the page size at runtime.</li></ul><p><strong>Example C/C++ Code:</strong></p><pre>#include  &lt;unistd.h&gt;</pre><pre>// ...</pre><pre>size_t page_size = getpagesize();</pre><pre>// Now use the page_size variable for your calculations</pre><pre>void* my_aligned_memory = aligned_alloc(page_size, MY_BUFFER_SIZE);</pre><h3>Step 4: Verify Third-Party SDKs</h3><p>Check with the providers of any third-party native SDKs or libraries you use to ensure they have 16KB-compatible versions available.</p><h3>6. 🧪 Automated Testing with Scripts</h3><p>Before deploying to production, verify your app’s 16KB compatibility using these automated tools.</p><h3>Option 1: Using Official check_elf_alignment.sh Script</h3><p>Google provides an official script to verify ELF alignment in your APK.</p><p><strong>Download:</strong></p><pre># Download from Android source repository</pre><pre>curl  -o  check_elf_alignment.sh  <a href="https://android.googlesource.com/platform/system/extras/+/refs/heads/main/tools/check_elf_alignment.sh?format=TEXT">https://android.googlesource.com/platform/system/extras/+/refs/heads/main/tools/check_elf_alignment.sh?format=TEXT</a> | base64  --decode &gt; check_elf_alignment.sh</pre><pre>chmod  +x  check_elf_alignment.sh</pre><p><strong>Platform Support:</strong> Linux and macOS only</p><p><strong>Usage:</strong></p><pre>./check_elf_alignment.sh  your-app.apk</pre><p><strong>Output:</strong></p><p>The script analyzes all .so libraries in the APK and marks each as:</p><ul><li>ALIGNED: Library is properly aligned for 16KB pages</li><li>UNALIGNED: Library needs to be rebuilt with 16KB alignment</li></ul><h3>Option 2: Using verify-16k-page-align Tool</h3><p>A community-developed tool with easier installation and clear CI/CD integration.</p><p><strong>Installation:</strong></p><p>Option A — Shell script (one-liner):</p><pre>sh  -c  &quot;$(curl  -fsSL https://raw.githubusercontent.com/hotbrainstech/verify-16k-page-align/main/src/verify-16k-page-align.sh)&quot;</pre><p>Option B — NPM global install:</p><pre>sudo  npm  i  -g  verify-16k-page-align</pre><p><strong>Platform Support:</strong> Linux only (requires unzip, objdump, zipalign)</p><p><strong>Usage:</strong></p><pre># Check arm64-v8a libraries</pre><pre>verify-16k-page-align  your-app.apk</pre><pre># Check both arm64-v8a and x86_64 libraries</pre><pre>verify-16k-page-align  your-app.apk  x86</pre><p><strong>Example Output:</strong></p><pre>=== APK zip-alignment ===</pre><pre>lib/arm64-v8a/libfoo.so: 16384 (OK - 16KB aligned)</pre><pre>lib/arm64-v8a/libbar.so: 4096 (BAD - 4KB aligned)</pre><pre>Verification FAILED</pre><p><strong>GitHub Repository:</strong> <a href="https://github.com/hotbrainstech/verify-16k-page-align">https://github.com/hotbrainstech/verify-16k-page-align</a></p><h3>Option 3: Manual Command-Line Verification</h3><p>Using Android SDK tools directly:</p><pre># Extract APK</pre><pre>unzip  your-app.apk  -d  extracted_apk</pre><pre># Check alignment using llvm-objdump (from Android NDK)</pre><pre>$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-objdump -p extracted_apk/lib/arm64-v8a/your-library.so | grep  -A  1  &quot;LOAD&quot;</pre><pre># Verify APK alignment using zipalign</pre><pre>$ANDROID_SDK_ROOT/build-tools/34.0.0/zipalign -c -p -v 16 your-app.apk</pre><h3>7. 📱 Testing on 16KB Devices</h3><p>Once you’ve migrated your code, it’s time to test on actual 16KB devices or emulators.</p><h3>Supported Physical Devices</h3><p>The following Pixel devices support 16KB page size testing:</p><ul><li><strong>Pixel 8 &amp; Pixel 8 Pro</strong> (with Android 15 QPR1 or later)</li><li><strong>Pixel 8a</strong></li><li><strong>Pixel 9 series</strong> (Pixel 9, 9 Pro, 9 Pro XL, 9 Pro Fold)</li><li><strong>Pixel Fold</strong></li><li><strong>Pixel Tablet</strong></li></ul><p><strong>Note:</strong> Starting with Pixel 8 and Android 15 QPR1, these devices have a developer option to switch between 4KB and 16KB page sizes for real-device testing.</p><h3>Setting up a 16KB Emulator</h3><p>If you do not have a supported physical device, you can create an emulator with 16KB page size support.</p><ol><li><strong>Install Android SDK:</strong> In Android Studio, go to Tools &gt; SDK Manager. Under the SDK Platforms tab, install:</li></ol><ul><li><strong>Android 15.0 (“VanillaIceCream”)</strong> — API 35</li><li><strong>Android 16.0</strong> — API 36 (latest)</li></ul><ol><li><strong>Create a 16KB AVD:</strong></li></ol><ul><li>Go to Tools &gt; Device Manager.</li><li>Click <strong>Create Device</strong>.</li><li>Choose a 64-bit hardware profile (e.g., Pixel 8 Pro or Pixel 9 Pro).</li><li>In the <strong>System Image</strong> selection screen, go to the x86_64 Images tab (or arm64-v8a for ARM-based emulators).</li><li>Look for system images that include <strong>“16KB”</strong> in the name or labeled as <strong>“Pre-Release 16KB page size”</strong>:</li><li>Android 15.0 - API 35 - 16KB</li><li>Android 16.0 - API 36 - 16KB</li><li>Download and select the 16KB image, then finish creating the AVD.</li></ul><ol><li><strong>Verify the page size:</strong> After starting the emulator, run:</li></ol><pre>adb shell getconf PAGE_SIZE</pre><p>The output should be 16384 for a 16KB emulator.</p><p><strong>⚠️ Important Note:</strong> When using a 16KB emulator, <strong>you do NOT need to enable any developer options</strong>. The 16KB system image already runs in 16KB mode by default. Your app will automatically be tested in 16KB mode. Developer options are only needed on physical devices to switch them from 4KB to 16KB mode.</p><h3>Automated Testing on 16KB Emulator</h3><p>Once your 16KB emulator is running, you can automate testing with these commands:</p><pre># Verify emulator is in 16KB mode</pre><pre>adb  shell  getconf  PAGE_SIZE</pre><pre># Expected output: 16384</pre><pre># Install your app</pre><pre>adb  install  -r  your-app.apk</pre><pre># Launch your app</pre><pre>adb  shell  am  start  -n  YOUR_PACKAGE_NAME/.MainActivity</pre><pre># Run instrumented tests</pre><pre>./gradlew  connectedAndroidTest</pre><pre># Check for crashes or issues</pre><pre>adb  logcat | grep  -E  &quot;(FATAL|AndroidRuntime)&quot;</pre><p><strong>Complete automated test script:</strong></p><pre>#!/bin/bash</pre><pre># test_16kb_emulator.sh</pre><pre># Start 16KB emulator (replace with your AVD name)</pre><pre>emulator  -avd  Pixel_8_Pro_16KB  -no-window &amp;</pre><pre># Wait for emulator to boot</pre><pre>adb  wait-for-device</pre><pre>sleep  10</pre><pre># Verify 16KB mode</pre><pre>PAGE_SIZE=$(adb  shell  getconf  PAGE_SIZE)</pre><pre>if [ &quot;$PAGE_SIZE&quot; = &quot;16384&quot; ]; then</pre><pre>echo  &quot;✓ Emulator is in 16KB mode&quot;</pre><pre>else</pre><pre>echo  &quot;✗ Error: Not in 16KB mode&quot;</pre><pre>exit  1</pre><pre>fi</pre><pre># Install and test</pre><pre>adb  install  -r  app/build/outputs/apk/debug/app-debug.apk</pre><pre>./gradlew  connectedAndroidTest</pre><pre>echo  &quot;✓ Testing complete&quot;</pre><h3>Enabling 16KB Mode for Testing on Physical Devices</h3><p>There are <strong>two different methods</strong> to enable 16KB page size testing on Pixel devices:</p><h4>Method 1: Per-App Compatibility Change (Recommended)</h4><p>This method tests individual apps without affecting the entire device.</p><p><strong>Supported Devices:</strong></p><ul><li>Pixel 8, Pixel 8 Pro, Pixel 8a</li><li>Pixel 9 series (Pixel 9, 9 Pro, 9 Pro XL, 9 Pro Fold)</li><li>Pixel Fold</li><li>Pixel Tablet</li></ul><p><strong>Steps:</strong></p><ol><li><strong>Enable Developer Options:</strong></li></ol><ul><li>Go to Settings &gt; About phone</li><li>Tap <strong>Build number</strong> 7 times</li></ul><ol><li>Navigate to Settings &gt; System &gt; Developer options</li><li>Scroll down to <strong>App Compatibility Changes</strong></li><li>Tap your app’s name in the list</li><li>Toggle <strong>“Enable 16KB page size”</strong> ON</li><li>Force stop your app to apply changes</li></ol><p><strong>Using ADB (Alternative):</strong></p><pre># Enable 16KB mode for your app</pre><pre>adb  shell  am  compat  enable  ANR_ENABLE_16KB_PAGE_SIZE  YOUR_PACKAGE_NAME</pre><pre># Force stop the app to apply the change</pre><pre>adb  shell  am  force-stop  YOUR_PACKAGE_NAME</pre><p><strong>Advantages:</strong></p><ul><li>No device wipe required</li><li>No bootloader unlock needed</li><li>Can test individual apps</li><li>Easy to toggle on/off</li></ul><h4>Method 2: Boot with 16KB Page Size (System-Wide)</h4><p>This method switches the entire device to 16KB page size mode, providing a more realistic testing environment.</p><p><strong>Supported Devices:</strong></p><ul><li>Pixel 8, Pixel 8 Pro (requires Android 15 QPR1 or later)</li></ul><p><strong>⚠️ Important Requirements:</strong></p><ul><li><strong>Bootloader must be unlocked</strong> (Settings → Developer options → OEM unlocking)</li><li><strong>First-time use requires a complete device wipe</strong></li><li>After initial setup, you can toggle between 4KB ↔ 16KB without data loss</li></ul><p><strong>Steps:</strong></p><ol><li><strong>Enable Developer Options</strong> (if not already enabled)</li><li><strong>Unlock Bootloader:</strong></li></ol><ul><li>Go to Settings &gt; System &gt; Developer options</li><li>Enable <strong>OEM unlocking</strong></li></ul><ol><li>Go to Developer options → <strong>“Boot with 16KB page size”</strong></li><li><strong>First Time:</strong> Device will prompt to wipe data</li></ol><ul><li>Click <strong>“Erase all data and update”</strong></li><li>Device will reboot and apply the 16KB boot configuration</li></ul><ol><li><strong>After Initial Setup:</strong> You can toggle between 4KB and 16KB modes by:</li></ol><ul><li>Toggling the setting</li><li>Rebooting the device</li><li>Data will be preserved</li></ul><p><strong>Advantages:</strong></p><ul><li>Entire device runs in 16KB mode (more realistic)</li><li>Tests system-wide compatibility</li><li>Can toggle back to 4KB after initial setup</li></ul><p><strong>Verification:</strong></p><p>After enabling either method, verify the page size:</p><pre>adb  shell  getconf  PAGE_SIZE</pre><ul><li>Output 16384 = 16KB mode ✓</li><li>Output 4096 = 4KB mode</li></ul><h3>8. ✅ Verifying 16KB Alignment After Building</h3><p>After building your app, use the zipalign tool (found in the Android SDK build-tools directory) to verify that your .so files are correctly aligned within the APK.</p><pre># Replace &lt;sdk-path&gt; with the path to your Android SDK</pre><pre>&lt;sdk-path&gt;/build-tools/&lt;version&gt;/zipalign -c -p -v 4 your-app.apk</pre><p>The -p flag makes the tool check for shared object alignment within the APK.</p><h3>9. 📚 Official Resources</h3><p>For more detailed information, refer to these official Google resources:</p><ul><li><strong>Main Documentation:</strong> <a href="https://developer.android.com/guide/practices/page-sizes">Support 16KB page sizes</a></li><li><strong>Google Play Requirement Announcement:</strong> <a href="https://android-developers.googleblog.com/2025/05/prepare-play-apps-for-devices-with-16kb-page-size.html">Prepare your apps for Google Play’s 16 KB page size compatibility requirement</a></li><li><strong>Android Studio Migration Guide:</strong> <a href="https://android-developers.googleblog.com/2025/07/transition-to-16-kb-page-sizes-android-apps-games-android-studio.html">Transition to using 16 KB page sizes for Android apps and games using Android Studio</a></li><li><strong>Android 15 Release Notes:</strong> <a href="https://developer.android.com/about/versions/15">Android 15 Release Overview</a></li><li><strong>Android 16 Release Notes:</strong> <a href="https://android-developers.googleblog.com/2025/06/android-16-is-here.html">Android 16 is here</a></li><li><strong>Technical Details:</strong> <a href="https://source.android.com/docs/core/architecture/16kb-page-size/16kb">16 KB page size — AOSP</a></li></ul><h3>🎯 Conclusion: Don’t Wait Until It’s Too Late</h3><p>The 16KB page size migration is <strong>mandatory</strong>, but it’s also an <strong>opportunity</strong> to significantly improve your app’s performance. With faster launch times, better battery efficiency, and smoother operation, supporting 16KB pages benefits both you and your users.</p><h3>✅ Quick Action Checklist</h3><p>Before November 1, 2025, make sure you’ve completed these steps:</p><ol><li><strong>🔍 Check if your app uses native code</strong></li></ol><ul><li>Use APK Analyzer to identify .so files</li><li>Review third-party SDKs for native dependencies</li></ul><ol><li><strong>⚙️ Update your build tools</strong></li></ol><ul><li>Upgrade to AGP 8.3.0+</li><li>Update to NDK r26+</li><li>Add 16KB alignment flags</li></ul><ol><li><strong>🧪 Test thoroughly</strong></li></ol><ul><li>Use automated scripts to verify alignment</li><li>Test on 16KB emulators</li><li>Validate on physical devices</li></ul><ol><li><strong>🚀 Submit to Google Play</strong></li></ol><ul><li>Build and sign your updated app</li><li>Submit well before the deadline</li><li>Monitor for any issues</li></ul><h3>Key Takeaways</h3><ul><li><strong>Deadline matters:</strong> November 1, 2025 is the hard cutoff</li><li><strong>Performance benefits:</strong> 5–10% overall improvement, up to 30% faster launches</li><li><strong>Not just for new apps:</strong> Updates to existing apps must also comply</li><li><strong>Testing is critical:</strong> Use emulators, scripts, and physical devices</li><li><strong>Pure Java/Kotlin apps:</strong> Likely already compatible, but verify anyway</li></ul><h3>🤝 Need Help?</h3><p>If you encounter issues during migration:</p><ul><li>Check the <a href="https://developer.android.com/guide/practices/page-sizes">official Android documentation</a></li><li>Review your third-party SDK providers’ migration guides</li><li>Test thoroughly using the automated scripts provided in this guide</li><li>Join Android developer communities for support</li></ul><h3>📝 Final Thoughts</h3><p>The transition to 16KB page sizes represents Android’s commitment to performance and efficiency. While the migration requires some effort, the benefits — both in terms of compliance and user experience — make it well worth your time.</p><p><strong>Start your migration today. Your users (and Google Play) will thank you.</strong></p><h3>👨‍💻 About This Guide</h3><p>This comprehensive guide was created to help Android developers navigate the 16KB page size migration successfully. It combines official Google documentation, community best practices, and real-world implementation experience.</p><p><strong>Have questions or suggestions?</strong> Feel free to leave a comment below or reach out to the Android developer community.</p><p><strong>Found this helpful?</strong> Share it with fellow Android developers who need to prepare for the November 2025 deadline.</p><p><strong>Happy coding, and good luck with your migration! 🚀</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5c3ccbd2a7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Sync Your Web-Saved Google Passwords to Your Android Devices in Flutter]]></title>
            <link>https://medium.com/@venkatraman230/how-to-sync-your-web-saved-google-passwords-to-your-android-devices-in-flutter-9630ba2a4d96?source=rss-a7ab9c17f08d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9630ba2a4d96</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[google-password-manager]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[web-saved-password-sync]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[VENKAT RAMAN]]></dc:creator>
            <pubDate>Thu, 10 Oct 2024 12:52:02 GMT</pubDate>
            <atom:updated>2024-10-10T12:52:02.274Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Dual Approaches: Achieving Your Goal:</strong></h3><ul><li>Google Smart Lock for Passwords <strong>(Depreciated)</strong></li></ul><p><a href="https://developers.google.com/identity/smartlock-passwords/android/associate-apps-and-sites">Enable automatic sign-in across apps and websites | Credential Management | Google for Developers</a></p><ul><li>Google Credential Manager <strong>(Latest)</strong></li></ul><p><a href="https://developer.android.com/identity/sign-in/credential-manager#kts">Sign in your user with Credential Manager | Identity | Android Developers</a></p><ul><li>We have chosen <strong>Google Credential Manager</strong></li></ul><p><strong>Integration</strong> :</p><ul><li>Flutter Android</li><li>Website</li></ul><h4>Websites :</h4><ul><li>Add a JSON file in the name of assetlinks.json in the path <strong>/.well-known/assetlinks.json </strong>in the website .</li><li>This file as to be accessible by this URL <a href="https://sub-domain.sandboxdomain.com/.well-known/assetlinks.json">sample</a><strong>.</strong></li></ul><p><strong>Note: </strong>For production, I need to add this file in the following path<strong> </strong><a href="https://sub-domain.productiondomain.com/.well-known/assetlinks.json">sample</a>.</p><h4>Assetlinks.json:</h4><pre>[<br>  <br>{<br>         &quot;relation&quot;: [<br>            &quot;delegate_permission/common.get_login_creds&quot;<br>        ],<br>       &quot;target&quot;: {<br>            &quot;namespace&quot;: &quot;web&quot;,<br>            &quot;site&quot;: &quot;https://subdomain.sandbox.com&quot;<br>        }<br>    },<br>    {<br>        &quot;relation&quot;: [<br>            &quot;delegate_permission/common.get_login_creds&quot;<br>        ],<br>        &quot;target&quot;: {<br>            &quot;namespace&quot;: &quot;web&quot;,<br>            &quot;site&quot;: &quot;https://subdomain.qa.com&quot;<br>        }<br>    },<br>    {<br>        &quot;relation&quot;: [<br>            &quot;delegate_permission/common.get_login_creds&quot;<br>        ],<br>       &quot;target&quot;: {<br>            &quot;namespace&quot;: &quot;web&quot;,<br>            &quot;site&quot;: &quot;https://subdomain.production.com&quot;<br>        }<br>    },<br> {<br>    &quot;relation&quot; : [<br>      &quot;delegate_permission/common.handle_all_urls&quot;,<br>      &quot;delegate_permission/common.get_login_creds&quot;<br>    ],<br>    &quot;target&quot; : {<br>      &quot;namespace&quot; : &quot;android_app&quot;,<br>      &quot;package_name&quot; : &quot;applicationId&quot;,<br>      &quot;sha256_cert_fingerprints&quot;: [&quot;SHA 256 Key not Hex key but in credential         manager official docs they have mentioned as Hexa key&quot;<br>]<br>    }<br>  }<br>]</pre><ul><li><strong>Sha256_cert_fingerprints : </strong>In this above json file sha256 should only use the key that taken from Google Play console</li></ul><p><strong>Note: </strong>Debug sha256 key, or else Upload sha256 key won’t be working</p><p><strong>Testing Tool Link:</strong></p><p><a href="https://developers.google.com/digital-asset-links/tools/generator">Statement List Generator and Tester | Google Digital Asset Links | Google for Developers</a></p><ul><li>subdomain.sandboxdomain.com</li><li>application id</li><li><strong>(SHA-256 key what we used in assetlinks.json file)</strong></li><li>After entering all the required information the test as to be pass</li></ul><p><strong>Flutter (Android)</strong>:</p><ul><li>android/app/src/main/AndroidManifest.xml</li></ul><pre><br>&lt;meta-data <br>            android:name=&quot;asset_statements&quot;<br>            android:resource=&quot;@string/asset_statements&quot; /&gt;</pre><ul><li>android/app/build.gradle</li></ul><pre> buildTypes {<br>        release {<br>            // TODO: Add your own signing config for the release build.<br>            // Signing with the debug keys for now, so `flutter run --release` works.<br>            signingConfig signingConfigs.release<br>            proguardFiles getDefaultProguardFile(&#39;proguard-android.txt&#39;), &#39;proguard-rules.pro&#39;<br>         nbvcxz§s  }<br>    }</pre><ul><li>android/app/proguard-rules.pro</li></ul><pre>-if class androidx.credentials.CredentialManager<br>-keep class androidx.credentials.playservices.** {<br>  *;<br>}</pre><ul><li>android/app/src/main/kotlin/com/path/CredentialManagerFromGooglePassword.kt</li></ul><pre>import android.app.Activity<br>import android.content.Context<br>import androidx.annotation.NonNull<br>import androidx.credentials.CredentialManager<br>import androidx.credentials.GetCredentialRequest<br>import androidx.credentials.GetPasswordOption<br>import androidx.credentials.PasswordCredential<br>import io.flutter.embedding.engine.plugins.FlutterPlugin<br>import io.flutter.embedding.engine.plugins.activity.ActivityAware<br>import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding<br>import io.flutter.plugin.common.MethodCall<br>import io.flutter.plugin.common.MethodChannel<br>import io.flutter.plugin.common.MethodChannel.MethodCallHandler<br>import io.flutter.plugin.common.MethodChannel.Result<br>import kotlinx.coroutines.CoroutineScope<br>import kotlinx.coroutines.Dispatchers<br>import kotlinx.coroutines.launch<br><br>class CredentialManager: FlutterPlugin, MethodCallHandler, ActivityAware {<br>    private lateinit var channel : MethodChannel<br>    private lateinit var activity: Activity<br>    private lateinit var context: Context<br><br>    override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {<br>        channel = MethodChannel(flutterPluginBinding.binaryMessenger, &quot;credential_manager&quot;)<br>        channel.setMethodCallHandler(this)<br>        context = flutterPluginBinding.applicationContext<br>    }<br><br>    override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {<br>        if (call.method == &quot;getCredential&quot;) {<br>            getCredential(result)<br>        } else {<br>            result.notImplemented()<br>        }<br>    }<br><br>    private fun getCredential(result: Result) {<br>        val getPasswordOption = GetPasswordOption()<br><br>        val getCredRequest = GetCredentialRequest(<br>            listOf(getPasswordOption)<br>        )<br><br><br>        CoroutineScope(Dispatchers.Main).launch {<br>            try {<br><br>                val credentialManager = CredentialManager.create(context)<br><br>                val credentialResult = credentialManager.getCredential(<br>                    context = activity,<br>                    request = getCredRequest<br>                )<br><br><br><br>                val credential = credentialResult.credential as PasswordCredential<br><br>                val userName = credential.id<br>                val password = credential.password<br>                val jsonString = &quot;{\&quot;username\&quot;: \&quot;$userName\&quot;, \&quot;password\&quot;: \&quot;$password\&quot;}&quot;<br>                result.success(jsonString)<br>            } catch (e: Exception) {<br>                result.error(&quot;ERROR&quot;, e.message, null)<br>            }<br>        }<br>    }<br><br>    override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {<br>        channel.setMethodCallHandler(null)<br>    }<br><br>    override fun onAttachedToActivity(binding: ActivityPluginBinding) {<br>        activity = binding.activity<br>    }<br><br>    override fun onDetachedFromActivityForConfigChanges() {<br>        // Handle activity detachment for config changes if needed<br>    }<br><br>    override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {<br>        activity = binding.activity<br>    }<br><br>    override fun onDetachedFromActivity() {<br>        // Handle activity detachment if needed<br>    }<br>}</pre><ul><li>android/app/src/main/res/values/string.xml</li></ul><pre>&lt;resources&gt;<br>     &lt;string name=&quot;asset_statements&quot; translatable=&quot;false&quot;&gt;<br>        [<br>            { \&quot;include\&quot;: \&quot;https://subdomain.sandbox.com/.well-known/assetlinks.json\&quot; },<br>            { \&quot;include\&quot;: \&quot;https://subdomain.qa.com/.well-known/assetlinks.json\&quot; },<br>            { \&quot;include\&quot;: \&quot;https://subdomain.production.com/.well-known/assetlinks.json\&quot; }<br>        ]<br>    &lt;/string&gt;<br>&lt;/resources&gt;</pre><ul><li>lib/model/credential_model.dart</li></ul><pre>class Credentials {<br>  final String? username;<br>  final String? password;<br><br>  Credentials({required this.username, required this.password});<br><br>  factory Credentials.fromJson(Map&lt;String, dynamic&gt; json) {<br>    return Credentials(<br>      username: json[&#39;username&#39;],<br>      password: json[&#39;password&#39;],<br>    );<br>  }<br><br>  Map&lt;String, dynamic&gt; toJson() {<br>    return {<br>      &#39;username&#39;: username,<br>      &#39;password&#39;: password,<br>    };<br>  }<br>}</pre><ul><li>lib/helpers/credential_manager_helper.dart</li></ul><pre>import &#39;dart:convert&#39;;<br>import &#39;dart:io&#39;;<br>import &#39;package:flutter/foundation.dart&#39;;<br>import &#39;package:flutter/services.dart&#39;;<br>import &#39;../model/credential_model.dart&#39;;<br>import &#39;../utils/exception_handler.dart&#39;;<br>import &#39;../utils/log_handler.dart&#39;;<br><br>class CredentialManager {<br>  CredentialManager._();<br><br>  static const MethodChannel _channel = MethodChannel(&#39;credential_manager&#39;);<br><br>  static final CredentialManager instance = CredentialManager._();<br><br>  Future&lt;void&gt; getCredentialFromNative() async {<br>    try {<br>     <br>      if (Platform.isAndroid) {<br>        String jsonString = await _channel.invokeMethod(&#39;getCredential&#39;);<br>        Map&lt;String, dynamic&gt; userMap = jsonDecode(jsonString);<br>        Credentials credentials = Credentials.fromJson(userMap);<br><br>        if (credentials.username != null &amp;&amp; credentials.password != null) {<br>          loginController.emailTextCon.text = credentials.username!;<br>          loginController.passTextCon.text = credentials.password!;<br><br>         <br>        }<br>      }<br>    } catch (error, stackTrace) {<br>     // Catch Exception <br>    }<br>  }<br>}</pre><ul><li>lib/login_view.dart</li></ul><pre>  @override<br>  void initState() {<br>    super.initState();<br><br>    <br>    // * Get credential from android native using method channel<br>    CredentialManager.instance.getCredentialFromNative();<br>  }</pre><pre>import &#39;package:flutter/material.dart&#39;;<br><br>void main() {<br>  runApp(MyApp());<br>}<br><br>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      home: Scaffold(<br>        appBar: AppBar(<br>          title: Text(&#39;Autofill Example&#39;),<br>        ),<br>        body: Padding(<br>          padding: const EdgeInsets.all(16.0),<br>          child: AutofillDemo(),<br>        ),<br>      ),<br>    );<br>  }<br>}<br><br>class AutofillDemo extends StatelessWidget {<br>  final _formKey = GlobalKey&lt;FormState&gt;();<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Form(<br>      key: _formKey,<br>      child: AutofillGroup(<br>        child: Column(<br>          children: [<br>            TextFormField(<br>              decoration: InputDecoration(<br>                labelText: &#39;Email&#39;,<br>                hintText: &#39;Enter your email&#39;,<br>              ),<br>              keyboardType: TextInputType.emailAddress,<br>              autofillHints: [AutofillHints.email],<br>              validator: (value) {<br>                if (value == null || value.isEmpty) {<br>                  return &#39;Please enter your email&#39;;<br>                }<br>                return null;<br>              },<br>            ),<br>            SizedBox(height: 16.0),<br>            TextFormField(<br>              decoration: InputDecoration(<br>                labelText: &#39;Password&#39;,<br>                hintText: &#39;Enter your password&#39;,<br>              ),<br>              obscureText: true,<br>              autofillHints: [AutofillHints.password],<br>              validator: (value) {<br>                if (value == null || value.isEmpty) {<br>                  return &#39;Please enter your password&#39;;<br>                }<br>                return null;<br>              },<br>            ),<br>            SizedBox(height: 16.0),<br>            ElevatedButton(<br>              onPressed: () {<br>                if (_formKey.currentState!.validate()) {<br>                  // Process data<br> TextInput.finishAutofillContext();<br>                }<br>              },<br>              child: Text(&#39;Submit&#39;),<br>            ),<br>          ],<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><h3>Outputs:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*Rp5ZWoYY5RAoy3k948eRAQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*-R3AjDYXM331TgybGYNfYg.png" /></figure><p>Note : Exact testing can be only done after publish app to play store atleast in internal testing , external testing , open testing or else in production , this important line is not mentioned anywhere in the Credential manager docs</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9630ba2a4d96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting android phone device to android studio and mirroring the screen]]></title>
            <link>https://medium.com/@venkatraman230/connecting-android-phone-device-to-android-studio-and-mirroring-the-screen-6be8b45993ba?source=rss-a7ab9c17f08d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6be8b45993ba</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[android-studio-setup]]></category>
            <category><![CDATA[wireless-screen-mirroring]]></category>
            <category><![CDATA[android-studio]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[VENKAT RAMAN]]></dc:creator>
            <pubDate>Mon, 18 Sep 2023 18:20:36 GMT</pubDate>
            <atom:updated>2023-09-18T18:20:36.127Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eeTgc_9xzK3y0qBpQrNPKQ.png" /></figure><h3><strong>Scrcpy windows and for mac :</strong></h3><p>Download scrcpy for windows</p><p>brew install scrcpy for mac</p><p>turn on developer option on android phone then turn on usb debugging or wireless debugging</p><p>connect with android studio</p><p>then do flutter doctor</p><p>then check flutter devices on that it should show your phone</p><p>mac command after installation : scrcpy</p><p>this will trigger the pop up screen mirroring the android phone</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6be8b45993ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Method Channel IOS]]></title>
            <link>https://medium.com/@venkatraman230/flutter-method-channel-ios-ac039106592f?source=rss-a7ab9c17f08d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac039106592f</guid>
            <category><![CDATA[flutterio]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[method-channel]]></category>
            <dc:creator><![CDATA[VENKAT RAMAN]]></dc:creator>
            <pubDate>Sat, 26 Aug 2023 17:34:58 GMT</pubDate>
            <atom:updated>2023-08-26T17:34:58.372Z</atom:updated>
            <content:encoded><![CDATA[<h3>Add an iOS platform-specific implementation</h3><p>Start by opening the iOS host portion of your Flutter app in Xcode:</p><ol><li>Start Xcode.</li><li>Select the menu item <strong>File &gt; Open…</strong>.</li><li>Navigate to the directory holding your Flutter app, and select the <strong>ios</strong> folder inside it. Click <strong>OK</strong>.</li></ol><p>Add support for Swift in the standard template setup that uses Objective-C:</p><ol><li><strong>Expand Runner &gt; Runner</strong> in the Project navigator.</li><li>Open the file AppDelegate.swift located under <strong>Runner &gt; Runner</strong> in the Project navigator.</li></ol><p>Override the application:didFinishLaunchingWithOptions: function and create a FlutterMethodChannel tied to the channel name samples.flutter.dev/battery:</p><pre>@UIApplicationMain<br>@objc class AppDelegate: FlutterAppDelegate {<br>  override func application(<br>    _ application: UIApplication,<br>    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {<br><br>    let controller : FlutterViewController = window?.rootViewController as! FlutterViewController<br>    let batteryChannel = FlutterMethodChannel(name: &quot;samples.flutter.dev/battery&quot;,<br>                                              binaryMessenger: controller.binaryMessenger)<br>    batteryChannel.setMethodCallHandler({<br>      (call: FlutterMethodCall, result: @escaping FlutterResult) -&gt; Void in<br>      // This method is invoked on the UI thread.<br>      // Handle battery messages.<br>    })<br><br>    GeneratedPluginRegistrant.register(with: self)<br>    return super.application(application, didFinishLaunchingWithOptions: launchOptions)<br>  }<br>}</pre><p>Next, add the iOS Swift code that uses the iOS battery APIs to retrieve the battery level. This code is exactly the same as you would write in a native iOS app.</p><p>Add the following as a new method at the bottom of AppDelegate.swift:</p><pre>private func receiveBatteryLevel(result: FlutterResult) {<br>  let device = UIDevice.current<br>  device.isBatteryMonitoringEnabled = true<br>  if device.batteryState == UIDevice.BatteryState.unknown {<br>    result(FlutterError(code: &quot;UNAVAILABLE&quot;,<br>                        message: &quot;Battery level not available.&quot;,<br>                        details: nil))<br>  } else {<br>    result(Int(device.batteryLevel * 100))<br>  }<br>}</pre><p>Finally, complete the setMethodCallHandler() method added earlier. You need to handle a single platform method, getBatteryLevel(), so test for that in the call argument. The implementation of this platform method calls the iOS code written in the previous step. If an unknown method is called, report that instead.</p><pre>batteryChannel.setMethodCallHandler({<br>  [weak self] (call: FlutterMethodCall, result: FlutterResult) -&gt; Void in<br>  // This method is invoked on the UI thread.<br>  guard call.method == &quot;getBatteryLevel&quot; else {<br>    result(FlutterMethodNotImplemented)<br>    return<br>  }<br>  self?.receiveBatteryLevel(result: result)<br>})</pre><p>You should now be able to run the app on iOS. If using the iOS Simulator, note that it doesn’t support battery APIs, and the app displays ‘Battery level not available’.</p><h3><a href="https://github.com/venkat9507/flutter-batterylevel-methodchannel-android">https://github.com/venkat9507/flutter-batterylevel-methodchannel-android</a></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac039106592f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter 3.10.6 with razorpay integration]]></title>
            <link>https://medium.com/@venkatraman230/flutter-3-10-6-with-razorpay-integration-f627aa77b39b?source=rss-a7ab9c17f08d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f627aa77b39b</guid>
            <category><![CDATA[razorpay-integration]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-payment]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[payment-gateway]]></category>
            <dc:creator><![CDATA[VENKAT RAMAN]]></dc:creator>
            <pubDate>Wed, 16 Aug 2023 18:29:30 GMT</pubDate>
            <atom:updated>2023-08-16T18:29:30.741Z</atom:updated>
            <content:encoded><![CDATA[<p>package name razorpay_flutter</p><p><a href="https://pub.dev/packages/razorpay_flutter">razorpay_flutter | Flutter Package</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*Cz8_AgC2wDMsA1Pmp7x_bQ.jpeg" /></figure><h3><strong>Create a button in a widget :</strong></h3><p>ElevatedButton(onPressed: (){<br><br> },<br> child: const Text(“Pay with Razorpay”)),</p><p>now add the razorpay_flutter package inside pubspec.yaml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lMpp_GoEVnd6iFIJ08ZpLA.png" /></figure><p>press pub get on the same page</p><h3><strong>Now add the following code inside the onPressed function :</strong></h3><p>onPressed: (){<br> Razorpay razorpay = Razorpay();<br> var options = {<br> ‘key’: ‘add the key here ’,<br> ‘amount’: 100,<br> ‘name’: ‘Acme Corp.’,<br> ‘description’: ‘Fine T-Shirt’,<br> ‘retry’: {‘enabled’: true, ‘max_count’: 1},<br> ‘send_sms_hash’: true,<br> ‘prefill’: {‘contact’: ‘8888888888’, ‘email’: ‘<a href="/service/mailto:test@razorpay.com">test@razorpay.com</a>’},<br> ‘external’: {<br> ‘wallets’: [‘paytm’]<br> }<br> };<br> razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, handlePaymentErrorResponse);<br> razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, handlePaymentSuccessResponse);<br> razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, handleExternalWalletSelected);<br> razorpay.open(options);<br> },</p><h3><strong>Next open razorpay dashboard and login or sign in inside that :</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VpK9pUYDgTcFG8RCh1V2HA.png" /></figure><h3><strong>Select the test mode at right side top :</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1hbqjhXnLyiTRy4Jvwu0VA.png" /></figure><h3><strong>Generate Test API Key :</strong></h3><p><a href="https://razorpay.com/docs/api/authentication/#generate-api-keys">API Authentication &amp; Sandbox Setup</a></p><p>add the key to onPress function inside</p><p>‘key’: ‘add the key here ’, — -&gt;&gt; ‘key’: ‘rzp_live_ILgsfZCZoFIKMb’,</p><h3><strong>Now create the handle functions :</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*So-T6q3hkp9nxJc5RYp31w.png" /></figure><p>after creating everything when you press the button you will get the razorpay payment screen ..</p><p>superb .. you have completed successfully …</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*Cz8_AgC2wDMsA1Pmp7x_bQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*DkwYbUOAnkPWoPRnUgLutA.jpeg" /></figure><p>for more reference checkout this official github account from razorpay</p><p><a href="https://github.com/razorpay/razorpay-flutter">GitHub - razorpay/razorpay-flutter: Razorpay Flutter Plugin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f627aa77b39b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter with REST API using getx]]></title>
            <link>https://medium.com/@venkatraman230/flutter-with-rest-api-using-getx-a105a977fdd7?source=rss-a7ab9c17f08d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a105a977fdd7</guid>
            <category><![CDATA[pokemon]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[flutter-getx]]></category>
            <dc:creator><![CDATA[VENKAT RAMAN]]></dc:creator>
            <pubDate>Wed, 09 Aug 2023 19:24:14 GMT</pubDate>
            <atom:updated>2023-08-10T07:13:46.767Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pokemon APP</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*a1P7jnjjuF8QzaHNsmD_cg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*eWgoCKxb-A_WHC_vvpEQGg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*E3FaCml3z9ERQK9izxj77Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*HIt19WZs8l_SNn97--Ibgw.jpeg" /></figure><h3>First step create lib folder like this :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*lOJUrC9OUR1HqxuLmEKJdA.png" /></figure><h3>Second step add the dependency packages to pubspec.yaml like this :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tm-N6OKAVmOynstT0hRUtw.png" /></figure><p>Inside pokemon-details-api.dart :</p><pre>class PokemonDetailsApi {<br>  static Future getPokemonDetails({String? number}) async {<br><br>    print(&#39;checking the details page number $number&#39;);<br>    try {<br>      final Uri url = Uri.parse(&#39;https://pokedex.alansantos.dev/api/pokemons/$number.json&#39;);<br>      final response = await http.get(url);<br><br><br>      // print(&#39;getting the response from the api ${response.statusCode}&#39;);<br><br>      if(response.statusCode == 200){<br>        final jsonData = json.decode(response.body);<br>        // debugPrint(&#39;checking the pokemon list api $jsonData&#39;);<br><br>        return response;<br>      }<br><br>    } catch (error){<br>      return error;<br>    }<br><br>  }<br>}</pre><p>Inside pokemon-list-api.dart :</p><pre>class PokemonListApi {<br>  static Future getPokemonList() async {<br><br>    try {<br>      final Uri url = Uri.parse(&#39;https://pokedex.alansantos.dev/api/pokemons.json&#39;);<br>      final response = await http.get(url);<br><br><br>      // print(&#39;getting the response from the api ${response.statusCode}&#39;);<br><br>      if(response.statusCode == 200){<br>        final jsonData = json.decode(response.body);<br>        // debugPrint(&#39;checking the pokemon list api $jsonData&#39;);<br><br>        return response;<br>      }<br><br>    } catch (error){<br>      return error;<br>    }<br><br>  }<br>}</pre><p>Inside binding.dart :</p><pre>class ControllerBindings extends Bindings {<br>  @override<br>  void dependencies() {<br>    // TODO: implement dependencies<br>    Get.lazyPut(() =&gt; PokemonListController(),fenix: true);<br>    Get.lazyPut(() =&gt; PokemonDetailsController(),fenix: true);<br>  }<br><br>}</pre><p>Inside getx controller const.dart :</p><pre>PokemonListController pokemonListController = PokemonListController.instance;<br>PokemonDetailsController pokemonDetailsController = PokemonDetailsController.instance;</pre><p>Inside pokemon details controller.dart :</p><pre>class PokemonDetailsController extends GetxController {<br>  static PokemonDetailsController instance = Get.find();<br>  String apiUrl = &#39;https://pokedex.alansantos.dev&#39;;<br>  int? number;<br>  // PokemonDetailsModels? pokemonDetailsModels;<br>   PokemonDetailsModels? pokemonDetailsModels;<br>  // Rx&lt;PekemonDetailsModels&gt;? pokemonDetailsModels = PekemonDetailsModels(<br>  //<br>  //     number: null,<br>  //     name: null,<br>  //     nextEvolutions: null, imageUrl: null, thumbnailUrl: null, sprites: null, types: null, weaknesses: null,<br>  //     descriptions: null, specie: null, height: null, weight: null, breeding: null, training: null, abilities: null, typesEffectiveness: null, evolutionChain: null, previousEvolutions: null, superEvolutions: null, baseStats: null, cards: null, soundUrl: null, moves: null, generation: null).obs;<br><br><br>  @override<br>  void onInit() {<br>    // TODO: implement onInit<br>    // getData();<br>    super.onInit();<br>  }<br><br>  Future&lt;void&gt; getData({String? number}) async {<br><br><br>    final response = await PokemonDetailsApi.getPokemonDetails(number: number);<br><br>    print(&#39;getting the response from the details api ${response.body}&#39;);<br><br><br>    if(response.statusCode == 200){<br>      pokemonDetailsModels = pokemonDetailsModelsFromJson(response.body);<br><br>      update();<br><br>    }<br>    else {<br>      Get.snackbar(&#39;Error&#39;, &#39;Sorry Error Occurred &#39;);<br>    }<br><br>  }<br><br><br><br>}</pre><p>Inside pokemon list controller.dart :</p><pre>class PokemonListController extends GetxController {<br>  static PokemonListController instance = Get.find();<br>  String apiUrl = &#39;https://pokedex.alansantos.dev&#39;;<br>  RxList&lt;PekemonsListModels&gt;? pokemonsListModels = &lt;PekemonsListModels&gt;[].obs;<br>  RxList&lt;PekemonsListModels&gt;? filteredPokemonListModels = &lt;PekemonsListModels&gt;[].obs;<br><br><br>  @override<br>  void onInit() {<br>    // TODO: implement onInit<br>    getData();<br>    super.onInit();<br>  }<br><br>  Future&lt;void&gt; getData() async {<br><br><br>    final response = await PokemonListApi.getPokemonList();<br><br>    if(response.statusCode == 200){<br>      pokemonsListModels?.value = pekemonsListModelsFromJson(response.body);<br><br>      // for(var pokemons in pokemonsListModels!){<br>      //<br>      //   debugPrint(&#39;checking the name of Pokemons ${pokemons.name}&#39;);<br>      //<br>      // }<br>    }<br>    else {<br>      Get.snackbar(&#39;Error&#39;, &#39;Sorry Error Occurred &#39;);<br>    }<br><br>  }<br><br>  // search category<br>  void searchCat(String searchStr) {<br>    filteredPokemonListModels?.clear();<br>    for (var item in pokemonsListModels!) {<br>      if (item.name.contains(RegExp(searchStr, caseSensitive: false))) {<br>        filteredPokemonListModels?.add(<br>          item<br>        );<br>      }<br>    }<br>    // print(filteredPokemonListModels);<br>    update();<br>  }<br><br>}</pre><p>Inside pokemon details modals.dart :</p><pre>// To parse this JSON data, do<br>//<br>//     final pokemonDetailsModels = pokemonDetailsModelsFromJson(jsonString);<br><br>import &#39;dart:convert&#39;;<br><br>PokemonDetailsModels pokemonDetailsModelsFromJson(String str) =&gt; PokemonDetailsModels.fromJson(json.decode(str));<br><br>// String pokemonDetailsModelsToJson(PokemonDetailsModels data) =&gt; json.encode(data.toJson());<br><br>class PokemonDetailsModels {<br>  String? number;<br>  String? name = &#39;No Name&#39;;<br>  String? imageUrl;<br>  String? thumbnailUrl;<br>  Sprites? sprites;<br>  List&lt;Type&gt;? types;<br>  List&lt;String&gt;? weaknesses;<br>  List&lt;String&gt;? descriptions;<br>  String? specie;<br>  String? height;<br>  String? weight;<br>  Breeding? breeding;<br>  Training? training;<br>  List&lt;Ability&gt;? abilities;<br>  TypesEffectiveness? typesEffectiveness;<br>  List&lt;EvolutionChain&gt;? evolutionChain;<br>  List&lt;dynamic&gt;? previousEvolutions;<br>  List&lt;EvolutionChain&gt;? nextEvolutions;<br>  List&lt;dynamic&gt;? superEvolutions;<br>  BaseStats? baseStats;<br>  List&lt;Card&gt;? cards;<br>  String? soundUrl;<br>  Moves? moves;<br>  String? generation;<br><br>  PokemonDetailsModels({<br>    this.number,<br>    this.name,<br>    this.imageUrl,<br>    this.thumbnailUrl,<br>    this.sprites,<br>    this.types,<br>    this.weaknesses,<br>    this.descriptions,<br>    this.specie,<br>    this.height,<br>    this.weight,<br>    this.breeding,<br>    this.training,<br>    this.abilities,<br>    this.typesEffectiveness,<br>    this.evolutionChain,<br>    this.previousEvolutions,<br>    this.nextEvolutions,<br>    this.superEvolutions,<br>    this.baseStats,<br>    this.cards,<br>    this.soundUrl,<br>    this.moves,<br>    this.generation,<br>  });<br><br>  factory PokemonDetailsModels.fromJson(Map&lt;String, dynamic&gt; json) =&gt; PokemonDetailsModels(<br>    number: json[&quot;number&quot;],<br>    name: json[&quot;name&quot;],<br>    imageUrl: json[&quot;imageUrl&quot;],<br>    thumbnailUrl: json[&quot;thumbnailUrl&quot;],<br>    sprites: Sprites.fromJson(json[&quot;sprites&quot;]),<br>    types: List&lt;Type&gt;.from(json[&quot;types&quot;].map((x) =&gt; typeValues.map[x])),<br>    weaknesses: List&lt;String&gt;.from(json[&quot;weaknesses&quot;].map((x) =&gt; x)),<br>    descriptions: List&lt;String&gt;.from(json[&quot;descriptions&quot;].map((x) =&gt; x)),<br>    specie: json[&quot;specie&quot;],<br>    height: json[&quot;height&quot;],<br>    weight: json[&quot;weight&quot;],<br>    breeding: Breeding.fromJson(json[&quot;breeding&quot;]),<br>    training: Training.fromJson(json[&quot;training&quot;]),<br>    abilities: List&lt;Ability&gt;.from(json[&quot;abilities&quot;].map((x) =&gt; Ability.fromJson(x))),<br>    typesEffectiveness: TypesEffectiveness.fromJson(json[&quot;typesEffectiveness&quot;]),<br>    evolutionChain: List&lt;EvolutionChain&gt;.from(json[&quot;evolutionChain&quot;].map((x) =&gt; EvolutionChain.fromJson(x))),<br>    previousEvolutions: List&lt;dynamic&gt;.from(json[&quot;previousEvolutions&quot;].map((x) =&gt; x)),<br>    nextEvolutions: List&lt;EvolutionChain&gt;.from(json[&quot;nextEvolutions&quot;].map((x) =&gt; EvolutionChain.fromJson(x))),<br>    superEvolutions: List&lt;dynamic&gt;.from(json[&quot;superEvolutions&quot;].map((x) =&gt; x)),<br>    baseStats: BaseStats.fromJson(json[&quot;baseStats&quot;]),<br>    cards: List&lt;Card&gt;.from(json[&quot;cards&quot;].map((x) =&gt; Card.fromJson(x))),<br>    soundUrl: json[&quot;soundUrl&quot;],<br>    moves: Moves.fromJson(json[&quot;moves&quot;]),<br>    generation: json[&quot;generation&quot;],<br>  );<br><br>  // Map&lt;String, dynamic&gt; toJson() =&gt; {<br>  //   &quot;number&quot;: number,<br>  //   &quot;name&quot;: nameValues.reverse[name],<br>  //   &quot;imageUrl&quot;: imageUrl,<br>  //   &quot;thumbnailUrl&quot;: thumbnailUrl,<br>  //   &quot;sprites&quot;: sprites.toJson(),<br>  //   &quot;types&quot;: List&lt;dynamic&gt;.from(types.map((x) =&gt; typeValues.reverse[x])),<br>  //   &quot;weaknesses&quot;: List&lt;dynamic&gt;.from(weaknesses.map((x) =&gt; x)),<br>  //   &quot;descriptions&quot;: List&lt;dynamic&gt;.from(descriptions.map((x) =&gt; x)),<br>  //   &quot;specie&quot;: specie,<br>  //   &quot;height&quot;: height,<br>  //   &quot;weight&quot;: weight,<br>  //   &quot;breeding&quot;: breeding.toJson(),<br>  //   &quot;training&quot;: training.toJson(),<br>  //   &quot;abilities&quot;: List&lt;dynamic&gt;.from(abilities.map((x) =&gt; x.toJson())),<br>  //   &quot;typesEffectiveness&quot;: typesEffectiveness.toJson(),<br>  //   &quot;evolutionChain&quot;: List&lt;dynamic&gt;.from(evolutionChain.map((x) =&gt; x.toJson())),<br>  //   &quot;previousEvolutions&quot;: List&lt;dynamic&gt;.from(previousEvolutions.map((x) =&gt; x)),<br>  //   &quot;nextEvolutions&quot;: List&lt;dynamic&gt;.from(nextEvolutions.map((x) =&gt; x.toJson())),<br>  //   &quot;superEvolutions&quot;: List&lt;dynamic&gt;.from(superEvolutions.map((x) =&gt; x)),<br>  //   &quot;baseStats&quot;: baseStats.toJson(),<br>  //   &quot;cards&quot;: List&lt;dynamic&gt;.from(cards.map((x) =&gt; x.toJson())),<br>  //   &quot;soundUrl&quot;: soundUrl,<br>  //   &quot;moves&quot;: moves.toJson(),<br>  //   &quot;generation&quot;: generation,<br>  // };<br>}<br><br>class Ability {<br>  String? name;<br>  String? description;<br><br>  Ability({<br>    this.name,<br>    this.description,<br>  });<br><br>  factory Ability.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Ability(<br>    name: json[&quot;name&quot;],<br>    description: json[&quot;description&quot;],<br>  );<br><br>  Map&lt;String, dynamic&gt; toJson() =&gt; {<br>    &quot;name&quot;: name,<br>    &quot;description&quot;: description,<br>  };<br>}<br><br>class BaseStats {<br>  int? hp;<br>  int? attack;<br>  int? defense;<br>  int? spAtk;<br>  int? spDef;<br>  int? speed;<br>  int? total;<br><br>  BaseStats({<br>    this.hp,<br>    this.attack,<br>    this.defense,<br>    this.spAtk,<br>    this.spDef,<br>    this.speed,<br>    this.total,<br>  });<br><br>  factory BaseStats.fromJson(Map&lt;String, dynamic&gt; json) =&gt; BaseStats(<br>    hp: json[&quot;hp&quot;],<br>    attack: json[&quot;attack&quot;],<br>    defense: json[&quot;defense&quot;],<br>    spAtk: json[&quot;spAtk&quot;],<br>    spDef: json[&quot;spDef&quot;],<br>    speed: json[&quot;speed&quot;],<br>    total: json[&quot;total&quot;],<br>  );<br><br>  Map&lt;String, dynamic&gt; toJson() =&gt; {<br>    &quot;hp&quot;: hp,<br>    &quot;attack&quot;: attack,<br>    &quot;defense&quot;: defense,<br>    &quot;spAtk&quot;: spAtk,<br>    &quot;spDef&quot;: spDef,<br>    &quot;speed&quot;: speed,<br>    &quot;total&quot;: total,<br>  };<br>}<br><br>class Breeding {<br>  BreedingEgg? egg;<br>  List&lt;Gender&gt;? genders;<br><br>  Breeding({<br>    this.egg,<br>    this.genders,<br>  });<br><br>  factory Breeding.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Breeding(<br>    egg: BreedingEgg.fromJson(json[&quot;egg&quot;]),<br>    genders: List&lt;Gender&gt;.from(json[&quot;genders&quot;].map((x) =&gt; Gender.fromJson(x))),<br>  );<br><br>  // Map&lt;String, dynamic&gt; toJson() =&gt; {<br>  //   &quot;egg&quot;: egg.toJson(),<br>  //   &quot;genders&quot;: List&lt;dynamic&gt;.from(genders.map((x) =&gt; x.toJson())),<br>  // };<br>}<br><br>class BreedingEgg {<br>  List&lt;String&gt;? groups;<br>  String? cycle;<br><br>  BreedingEgg({<br>    this.groups,<br>    this.cycle,<br>  });<br><br>  factory BreedingEgg.fromJson(Map&lt;String, dynamic&gt; json) =&gt; BreedingEgg(<br>    groups: List&lt;String&gt;.from(json[&quot;groups&quot;].map((x) =&gt; x)),<br>    cycle: json[&quot;cycle&quot;],<br>  );<br><br>  // Map&lt;String, dynamic&gt; toJson() =&gt; {<br>  //   &quot;groups&quot;: List&lt;dynamic&gt;.from(groups.map((x) =&gt; x)),<br>  //   &quot;cycle&quot;: cycle,<br>  // };<br>}<br><br>class Gender {<br>  String? type;<br>  String? percentage;<br><br>  Gender({<br>    this.type,<br>    this.percentage,<br>  });<br><br>  factory Gender.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Gender(<br>    type: json[&quot;type&quot;],<br>    percentage: json[&quot;percentage&quot;],<br>  );<br><br>  Map&lt;String, dynamic&gt; toJson() =&gt; {<br>    &quot;type&quot;: type,<br>    &quot;percentage&quot;: percentage,<br>  };<br>}<br><br>class Card {<br>  String? number;<br>  String? name;<br>  String? expansionName;<br>  String? imageUrl;<br><br>  Card({<br>    this.number,<br>    this.name,<br>    this.expansionName,<br>    this.imageUrl,<br>  });<br><br>  factory Card.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Card(<br>    number: json[&quot;number&quot;],<br>    name: json[&quot;name&quot;],<br>    expansionName: json[&quot;expansionName&quot;],<br>    imageUrl: json[&quot;imageUrl&quot;],<br>  );<br><br>  Map&lt;String, dynamic&gt; toJson() =&gt; {<br>    &quot;number&quot;: number,<br>    &quot;name&quot;: nameValues.reverse[name],<br>    &quot;expansionName&quot;: expansionName,<br>    &quot;imageUrl&quot;: imageUrl,<br>  };<br>}<br><br>enum Name {<br>  BULBASAUR,<br>  M_VENUSAUR_EX,<br>  VENUSAUR_EX<br>}<br><br>final nameValues = EnumValues({<br>  &quot;Bulbasaur&quot;: Name.BULBASAUR,<br>  &quot;M Venusaur-EX&quot;: Name.M_VENUSAUR_EX,<br>  &quot;Venusaur-EX&quot;: Name.VENUSAUR_EX<br>});<br><br>class EvolutionChain {<br>  String? number;<br>  String? name;<br>  String? imageUrl;<br>  String? thumbUrl;<br>  String? type;<br>  String? requirement;<br><br>  EvolutionChain({<br>    this.number,<br>    this.name,<br>    this.imageUrl,<br>    this.thumbUrl,<br>    this.type,<br>    this.requirement,<br>  });<br><br>  factory EvolutionChain.fromJson(Map&lt;String, dynamic&gt; json) =&gt; EvolutionChain(<br>    number: json[&quot;number&quot;],<br>    name: json[&quot;name&quot;],<br>    imageUrl: json[&quot;imageUrl&quot;],<br>    thumbUrl: json[&quot;thumbUrl&quot;],<br>    type: json[&quot;type&quot;],<br>    requirement: json[&quot;requirement&quot;],<br>  );<br><br>  Map&lt;String, dynamic&gt; toJson() =&gt; {<br>    &quot;number&quot;: number,<br>    &quot;name&quot;: name,<br>    &quot;imageUrl&quot;: imageUrl,<br>    &quot;thumbUrl&quot;: thumbUrl,<br>    &quot;type&quot;: type,<br>    &quot;requirement&quot;: requirement,<br>  };<br>}<br><br>class Moves {<br>  List&lt;EggElement&gt;? levelUp;<br>  List&lt;EggElement&gt;? technicalMachine;<br>  List&lt;EggElement&gt;? technicalRecords;<br>  List&lt;EggElement&gt;? egg;<br>  List&lt;EggElement&gt;? tutor;<br>  List&lt;dynamic&gt;? evolution;<br>  List&lt;dynamic&gt;? preEvolution;<br><br>  Moves({<br>    this.levelUp,<br>    this.technicalMachine,<br>    this.technicalRecords,<br>    this.egg,<br>    this.tutor,<br>    this.evolution,<br>    this.preEvolution,<br>  });<br><br>  factory Moves.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Moves(<br>    levelUp: List&lt;EggElement&gt;.from(json[&quot;levelUp&quot;].map((x) =&gt; EggElement.fromJson(x))),<br>    technicalMachine: List&lt;EggElement&gt;.from(json[&quot;technicalMachine&quot;].map((x) =&gt; EggElement.fromJson(x))),<br>    technicalRecords: List&lt;EggElement&gt;.from(json[&quot;technicalRecords&quot;].map((x) =&gt; EggElement.fromJson(x))),<br>    egg: List&lt;EggElement&gt;.from(json[&quot;egg&quot;].map((x) =&gt; EggElement.fromJson(x))),<br>    tutor: List&lt;EggElement&gt;.from(json[&quot;tutor&quot;].map((x) =&gt; EggElement.fromJson(x))),<br>    evolution: List&lt;dynamic&gt;.from(json[&quot;evolution&quot;].map((x) =&gt; x)),<br>    preEvolution: List&lt;dynamic&gt;.from(json[&quot;preEvolution&quot;].map((x) =&gt; x)),<br>  );<br><br>  // Map&lt;String, dynamic&gt; toJson() =&gt; {<br>  //   &quot;levelUp&quot;: List&lt;dynamic&gt;.from(levelUp.map((x) =&gt; x.toJson())),<br>  //   &quot;technicalMachine&quot;: List&lt;dynamic&gt;.from(technicalMachine.map((x) =&gt; x.toJson())),<br>  //   &quot;technicalRecords&quot;: List&lt;dynamic&gt;.from(technicalRecords.map((x) =&gt; x.toJson())),<br>  //   &quot;egg&quot;: List&lt;dynamic&gt;.from(egg.map((x) =&gt; x.toJson())),<br>  //   &quot;tutor&quot;: List&lt;dynamic&gt;.from(tutor.map((x) =&gt; x.toJson())),<br>  //   &quot;evolution&quot;: List&lt;dynamic&gt;.from(evolution.map((x) =&gt; x)),<br>  //   &quot;preEvolution&quot;: List&lt;dynamic&gt;.from(preEvolution.map((x) =&gt; x)),<br>  // };<br>}<br><br>class EggElement {<br>  Category? category;<br>  String? move;<br>  Type? type;<br>  String? power;<br>  String? accuracy;<br>  int? level;<br>  int? technicalMachine;<br>  int? technicalRecord;<br><br>  EggElement({<br>    this.category,<br>    this.move,<br>    this.type,<br>    this.power,<br>    this.accuracy,<br>    this.level,<br>    this.technicalMachine,<br>    this.technicalRecord,<br>  });<br><br>  factory EggElement.fromJson(Map&lt;String, dynamic&gt; json) =&gt; EggElement(<br>    category: categoryValues.map[json[&quot;category&quot;]],<br>    move: json[&quot;move&quot;],<br>    type: typeValues.map[json[&quot;type&quot;]],<br>    power: json[&quot;power&quot;],<br>    accuracy: json[&quot;accuracy&quot;],<br>    level: json[&quot;level&quot;],<br>    technicalMachine: json[&quot;technicalMachine&quot;],<br>    technicalRecord: json[&quot;technicalRecord&quot;],<br>  );<br><br>  Map&lt;String, dynamic&gt; toJson() =&gt; {<br>    &quot;category&quot;: categoryValues.reverse[category],<br>    &quot;move&quot;: move,<br>    &quot;type&quot;: typeValues.reverse[type],<br>    &quot;power&quot;: power,<br>    &quot;accuracy&quot;: accuracy,<br>    &quot;level&quot;: level,<br>    &quot;technicalMachine&quot;: technicalMachine,<br>    &quot;technicalRecord&quot;: technicalRecord,<br>  };<br>}<br><br>enum Category {<br>  PHYSICAL,<br>  SPECIAL,<br>  STATUS<br>}<br><br>final categoryValues = EnumValues({<br>  &quot;Physical&quot;: Category.PHYSICAL,<br>  &quot;Special&quot;: Category.SPECIAL,<br>  &quot;Status&quot;: Category.STATUS<br>});<br><br>enum Type {<br>  FAIRY,<br>  FIRE,<br>  GHOST,<br>  GRASS,<br>  NORMAL,<br>  POISON,<br>  PSYCHIC<br>}<br><br>final typeValues = EnumValues({<br>  &quot;Fairy&quot;: Type.FAIRY,<br>  &quot;Fire&quot;: Type.FIRE,<br>  &quot;Ghost&quot;: Type.GHOST,<br>  &quot;Grass&quot;: Type.GRASS,<br>  &quot;Normal&quot;: Type.NORMAL,<br>  &quot;Poison&quot;: Type.POISON,<br>  &quot;Psychic&quot;: Type.PSYCHIC<br>});<br><br>class Sprites {<br>  String? mainSpriteUrl;<br>  String? frontAnimatedSpriteUrl;<br>  String? backAnimatedSpriteUrl;<br>  String? frontShinyAnimatedSpriteUrl;<br>  String? backShinyAnimatedSpriteUrl;<br><br>  Sprites({<br>    this.mainSpriteUrl,<br>    this.frontAnimatedSpriteUrl,<br>    this.backAnimatedSpriteUrl,<br>    this.frontShinyAnimatedSpriteUrl,<br>    this.backShinyAnimatedSpriteUrl,<br>  });<br><br>  factory Sprites.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Sprites(<br>    mainSpriteUrl: json[&quot;mainSpriteUrl&quot;],<br>    frontAnimatedSpriteUrl: json[&quot;frontAnimatedSpriteUrl&quot;],<br>    backAnimatedSpriteUrl: json[&quot;backAnimatedSpriteUrl&quot;],<br>    frontShinyAnimatedSpriteUrl: json[&quot;frontShinyAnimatedSpriteUrl&quot;],<br>    backShinyAnimatedSpriteUrl: json[&quot;backShinyAnimatedSpriteUrl&quot;],<br>  );<br><br>  Map&lt;String, dynamic&gt; toJson() =&gt; {<br>    &quot;mainSpriteUrl&quot;: mainSpriteUrl,<br>    &quot;frontAnimatedSpriteUrl&quot;: frontAnimatedSpriteUrl,<br>    &quot;backAnimatedSpriteUrl&quot;: backAnimatedSpriteUrl,<br>    &quot;frontShinyAnimatedSpriteUrl&quot;: frontShinyAnimatedSpriteUrl,<br>    &quot;backShinyAnimatedSpriteUrl&quot;: backShinyAnimatedSpriteUrl,<br>  };<br>}<br><br>class Training {<br>  String? evYield;<br>  String? catchRate;<br>  String? baseFriendship;<br>  String? baseExp;<br>  String? growthRate;<br><br>  Training({<br>    this.evYield,<br>    this.catchRate,<br>    this.baseFriendship,<br>    this.baseExp,<br>    this.growthRate,<br>  });<br><br>  factory Training.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Training(<br>    evYield: json[&quot;evYield&quot;],<br>    catchRate: json[&quot;catchRate&quot;],<br>    baseFriendship: json[&quot;baseFriendship&quot;],<br>    baseExp: json[&quot;baseExp&quot;],<br>    growthRate: json[&quot;growthRate&quot;],<br>  );<br><br>  Map&lt;String, dynamic&gt; toJson() =&gt; {<br>    &quot;evYield&quot;: evYield,<br>    &quot;catchRate&quot;: catchRate,<br>    &quot;baseFriendship&quot;: baseFriendship,<br>    &quot;baseExp&quot;: baseExp,<br>    &quot;growthRate&quot;: growthRate,<br>  };<br>}<br><br>class TypesEffectiveness {<br>  String? normal;<br>  String? fire;<br>  String ?water;<br>  String? electric;<br>  String? grass;<br>  String? ice;<br>  String? fighting;<br>  String? poison;<br>  String? ground;<br>  String ?flying;<br>  String? psychic;<br>  String? bug;<br>  String? rock;<br>  String ?ghost;<br>  String? dragon;<br>  String ?dark;<br>  String ?steel;<br>  String ?fairy;<br><br>  TypesEffectiveness({<br>    this.normal,<br>    this.fire,<br>    this.water,<br>    this.electric,<br>    this.grass,<br>    this.ice,<br>    this.fighting,<br>    this.poison,<br>    this.ground,<br>    this.flying,<br>    this.psychic,<br>    this.bug,<br>    this.rock,<br>    this.ghost,<br>    this.dragon,<br>    this.dark,<br>    this.steel,<br>    this.fairy,<br>  });<br><br>  factory TypesEffectiveness.fromJson(Map&lt;String, dynamic&gt; json) =&gt; TypesEffectiveness(<br>    normal: json[&quot;Normal&quot;],<br>    fire: json[&quot;Fire&quot;],<br>    water: json[&quot;Water&quot;],<br>    electric: json[&quot;Electric&quot;],<br>    grass: json[&quot;Grass&quot;],<br>    ice: json[&quot;Ice&quot;],<br>    fighting: json[&quot;Fighting&quot;],<br>    poison: json[&quot;Poison&quot;],<br>    ground: json[&quot;Ground&quot;],<br>    flying: json[&quot;Flying&quot;],<br>    psychic: json[&quot;Psychic&quot;],<br>    bug: json[&quot;Bug&quot;],<br>    rock: json[&quot;Rock&quot;],<br>    ghost: json[&quot;Ghost&quot;],<br>    dragon: json[&quot;Dragon&quot;],<br>    dark: json[&quot;Dark&quot;],<br>    steel: json[&quot;Steel&quot;],<br>    fairy: json[&quot;Fairy&quot;],<br>  );<br><br>  Map&lt;String, dynamic&gt; toJson() =&gt; {<br>    &quot;Normal&quot;: normal,<br>    &quot;Fire&quot;: fire,<br>    &quot;Water&quot;: water,<br>    &quot;Electric&quot;: electric,<br>    &quot;Grass&quot;: grass,<br>    &quot;Ice&quot;: ice,<br>    &quot;Fighting&quot;: fighting,<br>    &quot;Poison&quot;: poison,<br>    &quot;Ground&quot;: ground,<br>    &quot;Flying&quot;: flying,<br>    &quot;Psychic&quot;: psychic,<br>    &quot;Bug&quot;: bug,<br>    &quot;Rock&quot;: rock,<br>    &quot;Ghost&quot;: ghost,<br>    &quot;Dragon&quot;: dragon,<br>    &quot;Dark&quot;: dark,<br>    &quot;Steel&quot;: steel,<br>    &quot;Fairy&quot;: fairy,<br>  };<br>}<br><br>class EnumValues&lt;T&gt; {<br>  Map&lt;String, T&gt; map;<br>  late Map&lt;T, String&gt; reverseMap;<br><br>  EnumValues(this.map);<br><br>  Map&lt;T, String&gt; get reverse {<br>    reverseMap = map.map((k, v) =&gt; MapEntry(v, k));<br>    return reverseMap;<br>  }<br>}</pre><p>Inside pokemon list modals.dart :</p><pre>// To parse this JSON data, do<br>//<br>//     final pekemonsListModels = pekemonsListModelsFromJson(jsonString);<br><br>import &#39;dart:convert&#39;;<br><br>List&lt;PekemonsListModels&gt; pekemonsListModelsFromJson(String str) =&gt; List&lt;PekemonsListModels&gt;.from(json.decode(str).map((x) =&gt; PekemonsListModels.fromJson(x)));<br><br>// String pekemonsListModelsToJson(List&lt;PekemonsListModels&gt; data) =&gt; json.encode(List&lt;dynamic&gt;.from(data.map((x) =&gt; x.toJson())));<br><br>class PekemonsListModels {<br>  String number;<br>  String name;<br>  String imageUrl;<br>  String thumbnailUrl;<br>  Sprites sprites;<br>  List&lt;Type&gt; types;<br>  String specie;<br>  Generation generation;<br><br>  PekemonsListModels({<br>    required this.number,<br>    required this.name,<br>    required this.imageUrl,<br>    required this.thumbnailUrl,<br>    required this.sprites,<br>    required this.types,<br>    required this.specie,<br>    required this.generation,<br>  });<br><br>  factory PekemonsListModels.fromJson(Map&lt;String, dynamic&gt; json) =&gt; PekemonsListModels(<br>    number: json[&quot;number&quot;],<br>    name: json[&quot;name&quot;],<br>    imageUrl: json[&quot;imageUrl&quot;],<br>    thumbnailUrl: json[&quot;thumbnailUrl&quot;],<br>    sprites: Sprites.fromJson(json[&quot;sprites&quot;]),<br>    types: List&lt;Type&gt;.from(json[&quot;types&quot;].map((x) =&gt; typeValues.map[x]!)),<br>    specie: json[&quot;specie&quot;],<br>    generation: generationValues.map[json[&quot;generation&quot;]]!,<br>  );<br><br>  Map&lt;String, dynamic&gt; toJson() =&gt; {<br>    &quot;number&quot;: number,<br>    &quot;name&quot;: name,<br>    &quot;imageUrl&quot;: imageUrl,<br>    &quot;thumbnailUrl&quot;: thumbnailUrl,<br>    &quot;sprites&quot;: sprites.toJson(),<br>    &quot;types&quot;: List&lt;dynamic&gt;.from(types.map((x) =&gt; typeValues.reverse[x])),<br>    &quot;specie&quot;: specie,<br>    &quot;generation&quot;: generationValues.reverse[generation],<br>  };<br>}<br><br>enum Generation {<br>  GENERATION_I,<br>  GENERATION_II,<br>  GENERATION_III,<br>  GENERATION_IV,<br>  GENERATION_V,<br>  GENERATION_VI,<br>  GENERATION_VII,<br>  GENERATION_VIII<br>}<br><br>final generationValues = EnumValues({<br>  &quot;GENERATION_I&quot;: Generation.GENERATION_I,<br>  &quot;GENERATION_II&quot;: Generation.GENERATION_II,<br>  &quot;GENERATION_III&quot;: Generation.GENERATION_III,<br>  &quot;GENERATION_IV&quot;: Generation.GENERATION_IV,<br>  &quot;GENERATION_V&quot;: Generation.GENERATION_V,<br>  &quot;GENERATION_VI&quot;: Generation.GENERATION_VI,<br>  &quot;GENERATION_VII&quot;: Generation.GENERATION_VII,<br>  &quot;GENERATION_VIII&quot;: Generation.GENERATION_VIII<br>});<br><br>class Sprites {<br>  String mainSpriteUrl;<br>  String? frontAnimatedSpriteUrl;<br>  String? backAnimatedSpriteUrl;<br>  String? frontShinyAnimatedSpriteUrl;<br>  String? backShinyAnimatedSpriteUrl;<br><br>  Sprites({<br>    required this.mainSpriteUrl,<br>    this.frontAnimatedSpriteUrl,<br>    this.backAnimatedSpriteUrl,<br>    this.frontShinyAnimatedSpriteUrl,<br>    this.backShinyAnimatedSpriteUrl,<br>  });<br><br>  factory Sprites.fromJson(Map&lt;String, dynamic&gt; json) =&gt; Sprites(<br>    mainSpriteUrl: json[&quot;mainSpriteUrl&quot;],<br>    frontAnimatedSpriteUrl: json[&quot;frontAnimatedSpriteUrl&quot;],<br>    backAnimatedSpriteUrl: json[&quot;backAnimatedSpriteUrl&quot;],<br>    frontShinyAnimatedSpriteUrl: json[&quot;frontShinyAnimatedSpriteUrl&quot;],<br>    backShinyAnimatedSpriteUrl: json[&quot;backShinyAnimatedSpriteUrl&quot;],<br>  );<br><br>  Map&lt;String, dynamic&gt; toJson() =&gt; {<br>    &quot;mainSpriteUrl&quot;: mainSpriteUrl,<br>    &quot;frontAnimatedSpriteUrl&quot;: frontAnimatedSpriteUrl,<br>    &quot;backAnimatedSpriteUrl&quot;: backAnimatedSpriteUrl,<br>    &quot;frontShinyAnimatedSpriteUrl&quot;: frontShinyAnimatedSpriteUrl,<br>    &quot;backShinyAnimatedSpriteUrl&quot;: backShinyAnimatedSpriteUrl,<br>  };<br>}<br><br>enum Type {<br>  BUG,<br>  DARK,<br>  DRAGON,<br>  ELECTRIC,<br>  FAIRY,<br>  FIGHTING,<br>  FIRE,<br>  FLYING,<br>  GHOST,<br>  GRASS,<br>  GROUND,<br>  ICE,<br>  NORMAL,<br>  POISON,<br>  PSYCHIC,<br>  ROCK,<br>  STEEL,<br>  WATER<br>}<br><br>final typeValues = EnumValues({<br>  &quot;Bug&quot;: Type.BUG,<br>  &quot;Dark&quot;: Type.DARK,<br>  &quot;Dragon&quot;: Type.DRAGON,<br>  &quot;Electric&quot;: Type.ELECTRIC,<br>  &quot;Fairy&quot;: Type.FAIRY,<br>  &quot;Fighting&quot;: Type.FIGHTING,<br>  &quot;Fire&quot;: Type.FIRE,<br>  &quot;Flying&quot;: Type.FLYING,<br>  &quot;Ghost&quot;: Type.GHOST,<br>  &quot;Grass&quot;: Type.GRASS,<br>  &quot;Ground&quot;: Type.GROUND,<br>  &quot;Ice&quot;: Type.ICE,<br>  &quot;Normal&quot;: Type.NORMAL,<br>  &quot;Poison&quot;: Type.POISON,<br>  &quot;Psychic&quot;: Type.PSYCHIC,<br>  &quot;Rock&quot;: Type.ROCK,<br>  &quot;Steel&quot;: Type.STEEL,<br>  &quot;Water&quot;: Type.WATER<br>});<br><br>class EnumValues&lt;T&gt; {<br>  Map&lt;String, T&gt; map;<br>  late Map&lt;T, String&gt; reverseMap;<br><br>  EnumValues(this.map);<br><br>  Map&lt;T, String&gt; get reverse {<br>    reverseMap = map.map((k, v) =&gt; MapEntry(v, k));<br>    return reverseMap;<br>  }<br>}</pre><p>Inside pokemon list screen.dart :</p><pre>import &#39;package:cached_network_image/cached_network_image.dart&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:get/get.dart&#39;;<br><br>class PokemonListScreen extends StatefulWidget {<br>  const PokemonListScreen({Key? key}) : super(key: key);<br><br>  @override<br>  State&lt;PokemonListScreen&gt; createState() =&gt; _PokemonListScreenState();<br>}<br><br>class _PokemonListScreenState extends State&lt;PokemonListScreen&gt; {<br><br>  @override<br>  void initState() {<br>    // TODO: implement initState<br><br>    pokemonListController.getData();<br>    super.initState();<br>  }<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>        backgroundColor: Colors.white,<br>        body: Obx(() {<br>          return<br>          pokemonListController.pokemonsListModels!.isEmpty ?<br>              const Center(<br>                child: CircularProgressIndicator(<br>                  color: Colors.red,<br>                ),<br>              ) :<br>            CustomScrollView(<br>             slivers: [<br>               SliverAppBar(<br>                 floating: false,<br>                 pinned: true,<br>                 expandedHeight: 100,<br>                 stretch: true,<br>                 backgroundColor: Colors.white,<br>                 elevation: 10,<br>                 flexibleSpace: FlexibleSpaceBar(<br>                   titlePadding: const EdgeInsets.all(12),<br>                   title:<br>                       Container(<br><br>                         height: 50,<br>                         width: MediaQuery.of(context).size.width,<br>                         decoration: BoxDecoration(<br>                             color: Colors.red,<br>                           borderRadius: const BorderRadius.all(Radius.circular(12)),<br>                           border: Border.all(color: Colors.black)<br>                         ),<br>                         child: TextButton.icon(onPressed: (){<br>                           Get.toNamed(&#39;/search&#39;);<br>                         },<br>                             icon: const Icon(Icons.search),<br>                             label: const Text(&#39;search&#39;)),<br>                       ),<br>                   // background: Image.network(&#39;https://htmlcolorcodes.com/assets/images/colors/purple-color-solid-background-1920x1080.png&#39;),<br>                 ),<br>               ),<br>               SliverFillRemaining(<br>                 child:     ListView.separated(<br>                     separatorBuilder: (context, int index) =&gt; const Divider(),<br>                     itemCount: pokemonListController.pokemonsListModels!.length,<br>                     itemBuilder: (context, int index) {<br>                       return InkWell(<br>                         onTap: (){<br>                           pokemonDetailsController.number =<br>                           int.parse(pokemonListController.pokemonsListModels![index].number);<br>                           Get.toNamed(&#39;pokemon-details&#39;);<br>                         },<br>                         child: ListTile(<br>                           leading: SizedBox(<br>                             width: 70,<br>                             child:  ListView.separated(<br>                                 separatorBuilder: (context, int index) =&gt; const SizedBox(height: 10,),<br>                                 itemCount: pokemonListController.pokemonsListModels![index].types.length,<br>                                 itemBuilder: (context, int index) {<br>                                   return Text(<br>                                     pokemonListController.pokemonsListModels![index].types[index].toString(),<br>                                     style: const TextStyle(fontSize: 12),<br>                                   );<br>                                 }<br>                             ),<br>                           ),<br>                           subtitle: Text(<br>                             pokemonListController.pokemonsListModels![index].name.toString(),<br>                             style: const TextStyle(fontSize: 12,fontWeight: FontWeight.bold),<br>                             textAlign: TextAlign.center,<br>                           ),<br>                           trailing: CachedNetworkImage(<br>                             height: 100,width: 50,<br>                             imageUrl: pokemonListController.pokemonsListModels![index].imageUrl,<br>                             imageBuilder: (context, imageProvider) =&gt; Container(<br>                               decoration: BoxDecoration(<br>                                 image: DecorationImage(<br>                                   image: imageProvider,<br>                                   fit: BoxFit.cover,<br>                                   // colorFilter:<br>                                   // ColorFilter.mode(Colors.red, BlendMode.colorBurn),<br>                                 ),<br>                               ),<br>                             ),<br>                             placeholder: (context, url) =&gt; const CircularProgressIndicator(),<br>                             errorWidget: (context, url, error) =&gt; const Icon(Icons.error),<br>                           ),<br>                         ),<br>                       );<br>                     }<br>                 ),<br>               )<br>             ],<br>           );<br>        }));<br>  }<br>}</pre><p>Inside pokemon details screen.dart :</p><pre>import &#39;package:cached_network_image/cached_network_image.dart&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:get/get.dart&#39;;<br><br>import &#39;../../controller/pokemon_details_controller/pokemon_details_controller.dart&#39;;<br><br>class PokemonDetails extends StatefulWidget {<br>  const PokemonDetails({Key? key}) : super(key: key);<br><br>  @override<br>  State&lt;PokemonDetails&gt; createState() =&gt; _PokemonDetailsState();<br>}<br><br>class _PokemonDetailsState extends State&lt;PokemonDetails&gt; {<br>  int? number = 0;<br><br>  @override<br>  void initState() {<br>    // TODO: implement initState<br><br>    number = pokemonDetailsController.number;<br><br>    pokemonDetailsController.getData(number: &#39;00$number&#39;);<br>    super.initState();<br>  }<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return GetBuilder&lt;PokemonDetailsController&gt;(builder: (controller) {<br>      return Scaffold(<br>        appBar: AppBar(<br>          backgroundColor: Colors.white,<br>          elevation: 0,<br>          title: Text(<br>              pokemonDetailsController.pokemonDetailsModels != null ?<br>            pokemonDetailsController.pokemonDetailsModels!.name.toString() : &#39;No Name&#39; ,<br>            style: const TextStyle(fontSize: 16,fontWeight: FontWeight.bold,color: Colors.black),<br>          ),<br>          leading: IconButton(onPressed: (){<br>            Get.back();<br>          }, icon: const Icon(Icons.arrow_back,color: Colors.black,)),<br>        ),<br>          body: controller.pokemonDetailsModels != null<br>              ?<br>          Container(<br>            child: Center(<br>              child: SingleChildScrollView(<br>                child: Column(<br>                  crossAxisAlignment: CrossAxisAlignment.start,<br>                  // mainAxisAlignment: MainAxisAlignment.center,<br>                  children: [<br>                    Align(<br>                      alignment: Alignment.center,<br>                      child: CachedNetworkImage(<br>                        height: 300,<br>                        width: 300,<br>                        imageUrl: pokemonDetailsController.pokemonDetailsModels!<br><br>                            .imageUrl!,<br>                        imageBuilder: (context, imageProvider) =&gt;<br>                            Container(<br>                              decoration: BoxDecoration(<br>                                image: DecorationImage(<br>                                  image: imageProvider,<br>                                  fit: BoxFit.cover,<br>                                  // colorFilter:<br>                                  // ColorFilter.mode(Colors.red, BlendMode.colorBurn),<br>                                ),<br>                              ),<br>                            ),<br>                        placeholder: (context,<br>                            url) =&gt; const CircularProgressIndicator(),<br>                        errorWidget: (context, url, error) =&gt;<br>                        const Icon(Icons.error),<br>                      ),<br>                    ),<br>                    ListTile(<br>                      title:  Text(<br>                        pokemonDetailsController.pokemonDetailsModels!.name.toString().replaceAll(&#39;Name.&#39;, &#39;&#39;),<br>                        style: const TextStyle(fontSize: 16,fontWeight: FontWeight.bold),<br>                      ),<br>                      subtitle:  Text(<br>                        pokemonDetailsController.pokemonDetailsModels!.descriptions.toString().replaceAll(&#39;[&#39;, &#39;&#39;).replaceAll(&#39;]&#39;, &#39;&#39;),<br>                        style: const TextStyle(fontSize: 14),<br>                      ),<br>                    ),<br>                    20.ph,<br>                    const Padding(<br>                      padding: EdgeInsets.only(left: 15),<br>                      child: Text(<br>                        &#39;Types&#39;,<br>                        style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),<br>                      ),<br>                    ),<br>                    10.ph,<br>                    Padding(<br>                      padding: const EdgeInsets.only(left: 15),<br>                      child: SizedBox(<br>                        height: 50,<br>                        width: 70,<br>                        child:  ListView.separated(<br>                            separatorBuilder: (context, int index) =&gt; 10.ph,<br>                            itemCount: pokemonDetailsController.pokemonDetailsModels!.types!.length,<br>                            itemBuilder: (context, int index) {<br>                              return Text(<br>                                pokemonDetailsController.pokemonDetailsModels!.types![index].toString(),<br>                                style: const TextStyle(fontSize: 12,color: Colors.red),<br>                              );<br>                            }<br>                        ),<br>                      ),<br>                    ),<br><br>                 ListTile(<br>                  title: const Text(<br>                  &#39;BaseStats&#39;,<br>                    style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),<br>                  ),<br>                  subtitle: Column(<br>                    crossAxisAlignment: CrossAxisAlignment.start,<br>                    children: [<br>                      Text(<br>                        &#39;HP : ${pokemonDetailsController.pokemonDetailsModels!.baseStats!.hp.toString()}&#39;,<br>                        style: const TextStyle(fontSize: 12,color: Colors.red),<br>                      ),<br>                      10.ph,<br>                      Text(<br>                        &#39;ATTACK : ${pokemonDetailsController.pokemonDetailsModels!.baseStats!.attack.toString()}&#39;,<br>                        style: const TextStyle(fontSize: 12,color: Colors.red),<br>                      ),<br>                      10.ph,<br>                      Text(<br>                        &#39;DEFENSE : ${pokemonDetailsController.pokemonDetailsModels!.baseStats!.defense.toString()}&#39;,<br>                        style: const TextStyle(fontSize: 12,color: Colors.red),<br>                      ),<br>                      10.ph,<br>                      Text(<br>                        &#39;SPATK : ${pokemonDetailsController.pokemonDetailsModels!.baseStats!.spAtk.toString()}&#39;,<br>                        style: const TextStyle(fontSize: 12,color: Colors.red),<br>                      ),<br>                      10.ph,<br>                      Text(<br>                        &#39;SPDEF : ${pokemonDetailsController.pokemonDetailsModels!.baseStats!.spDef.toString()}&#39;,<br>                        style: const TextStyle(fontSize: 12,color: Colors.red),<br>                      ),<br>                      10.ph,<br>                      Text(<br>                        &#39;SPEED : ${pokemonDetailsController.pokemonDetailsModels!.baseStats!.speed.toString()}&#39;,<br>                        style: const TextStyle(fontSize: 12,color: Colors.red),<br>                      ),<br>                      10.ph,<br>                      Text(<br>                        &#39;TOTAL : ${pokemonDetailsController.pokemonDetailsModels!.baseStats!.total.toString()}&#39;,<br>                        style: const TextStyle(fontSize: 12,color: Colors.red),<br>                      ),<br>                    ],<br>                  ),<br>                ),<br>                    20.ph,<br>                    const Padding(<br>                      padding: EdgeInsets.only(left: 15),<br>                      child: Text(<br>                        &#39;Cards&#39;,<br>                        style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),<br>                      ),<br>                    ),<br>                    10.ph,<br>                    ListView.separated(<br>                      physics: const NeverScrollableScrollPhysics(),<br>                      shrinkWrap: true,<br>                        separatorBuilder: (context, int index) =&gt; 10.ph,<br>                        itemCount: pokemonDetailsController.pokemonDetailsModels!.cards!.length,<br>                        itemBuilder: (context, int index) {<br>                          return ListTile(<br>                            title: Text(<br>                              pokemonDetailsController.pokemonDetailsModels!.cards![index].name.toString().replaceAll(&#39;Name.&#39;, &#39;&#39;),<br>                              style: const TextStyle(fontSize: 16,fontWeight: FontWeight.bold),<br>                            ),<br>                            subtitle: Text(<br>                              pokemonDetailsController.pokemonDetailsModels!.cards![index].expansionName.toString(),<br>                              style: const TextStyle(fontSize: 12,),<br>                            ), leading: Text(<br>                              pokemonDetailsController.pokemonDetailsModels!.cards![index].number.toString(),<br>                              style: const TextStyle(fontSize: 12,color: Colors.red),<br>                            ),<br>                            trailing: CachedNetworkImage(<br>                              height: 30,<br>                              width: 30,<br>                              imageUrl:pokemonDetailsController.pokemonDetailsModels!.cards![index]<br><br>                                  .imageUrl!,<br>                              imageBuilder: (context, imageProvider) =&gt;<br>                                  Container(<br>                                    decoration: BoxDecoration(<br>                                      image: DecorationImage(<br>                                        image: imageProvider,<br>                                        fit: BoxFit.cover,<br>                                        // colorFilter:<br>                                        // ColorFilter.mode(Colors.red, BlendMode.colorBurn),<br>                                      ),<br>                                    ),<br>                                  ),<br>                              placeholder: (context,<br>                                  url) =&gt; const CircularProgressIndicator(),<br>                              errorWidget: (context, url, error) =&gt;<br>                              const Icon(Icons.error),<br>                            ),<br>                          );<br>                        }<br>                    ),<br><br>                  ],<br>                ),<br>              ),<br>            ),<br>          ) :<br>          const Center(child: CircularProgressIndicator(color: Colors.red,))<br><br>          );<br>    });<br>  }<br>}</pre><p>Inside search screen view.dart :</p><pre>import &#39;package:cached_network_image/cached_network_image.dart&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:get/get.dart&#39;;<br><br>import &#39;../../controller/getx_bindings/getx_controller_const.dart&#39;;<br><br>class SearchScreen extends StatelessWidget {<br>  const SearchScreen({Key? key}) : super(key: key);<br><br>  @override<br>  Widget build(BuildContext context) {<br><br>    TextEditingController searchController = TextEditingController();<br><br>    return Scaffold(<br>        backgroundColor: Colors.white,<br>        body: Obx(() {<br>          return<br>            CustomScrollView(<br>              slivers: [<br>                SliverAppBar(<br>                  automaticallyImplyLeading: false,<br>                  floating: false,<br>                  pinned: true,<br>                  expandedHeight: 100,<br>                  stretch: true,<br>                  backgroundColor: Colors.white,<br>                  elevation: 10,<br>                  flexibleSpace: FlexibleSpaceBar(<br>                    titlePadding: const EdgeInsets.all(12),<br>                    title:<br>                    Container(<br>                      height: 35,<br>                      margin: const EdgeInsets.all(3),<br>                      width: MediaQuery.of(context).size.width,<br>                      decoration: BoxDecoration(<br>                          color: Colors.green,<br>                          borderRadius: const BorderRadius.all(Radius.circular(12)),<br>                          border: Border.all(color: Colors.black)<br>                      ),<br>                      child: Padding(<br>                        padding: const EdgeInsets.only(left: 2,right: 2),<br>                        child: TextField(<br>                          controller: searchController,<br>                          onChanged: (value) {<br>                            pokemonListController.searchCat(value);<br>                          },<br>                          decoration:  InputDecoration(<br>                            border: InputBorder.none,<br>                            // contentPadding: EdgeInsets.only(top: 20),<br>                            isDense: true,<br>                            hintText: &quot;Search&quot;,<br>                            suffixIcon: Icon(<br>                              Icons.search_outlined, color: Colors.grey.shade300,),<br>                          ),<br>                        ),<br>                      ),<br>                    ),<br>                    // background: Image.network(&#39;https://htmlcolorcodes.com/assets/images/colors/purple-color-solid-background-1920x1080.png&#39;),<br>                  ),<br>                ),<br>                SliverFillRemaining(<br>                  child:<br>                  pokemonListController.filteredPokemonListModels!.isEmpty ?<br>                  const Center(<br>                    child: CircularProgressIndicator(<br>                      color: Colors.red,<br>                    ),<br>                  ) :<br>                  ListView.separated(<br>                      separatorBuilder: (context, int index) =&gt; const Divider(),<br>                      itemCount: pokemonListController.filteredPokemonListModels!.length,<br>                      itemBuilder: (context, int index) {<br>                        return ListTile(<br>                          leading: Text(<br>                            pokemonListController.filteredPokemonListModels![index].name.toString(),<br>                            style: const TextStyle(fontSize: 12,fontWeight: FontWeight.bold),<br>                            textAlign: TextAlign.center,<br>                          ),<br>                          trailing: SizedBox(<br>                            height: 100,<br>                            width: 50,<br>                            child: CachedNetworkImage(<br>                              imageUrl: pokemonListController.filteredPokemonListModels![index].imageUrl,<br>                              imageBuilder: (context, imageProvider) =&gt; Container(<br>                                decoration: BoxDecoration(<br>                                  image: DecorationImage(<br>                                    image: imageProvider,<br>                                    fit: BoxFit.cover,<br>                                    // colorFilter:<br>                                    // ColorFilter.mode(Colors.red, BlendMode.colorBurn),<br>                                  ),<br>                                ),<br>                              ),<br>                              placeholder: (context, url) =&gt; const CircularProgressIndicator(),<br>                              errorWidget: (context, url, error) =&gt; const Icon(Icons.error),<br>                            ),<br>                          ),<br>                        );<br>                      }<br>                  ),<br>                )<br>              ],<br>            );<br>        }));<br>  }<br>}</pre><p>Inside sized box extension.dart :</p><pre><br>import &#39;package:flutter/cupertino.dart&#39;;<br><br>extension Sizedbox on num {<br>  SizedBox get ph =&gt; SizedBox(height: toDouble());<br>  SizedBox get pw =&gt; SizedBox(width: toDouble());<br>}</pre><p>Inside routes.dart :</p><pre><br><br>import &#39;package:get/get.dart&#39;;<br>import &#39;../../screen/landing_screen_view/pokemon_list_screen.dart&#39;;<br><br>class Routes {<br>  static final routes = [<br><br>    GetPage(<br>      name: &#39;/&#39;,<br>  transition: Transition.zoom,<br>  page: () =&gt; PokemonListScreen(),<br><br>    ),<br>GetPage(<br>      name: &#39;/search&#39;,<br>  transition: Transition.zoom,<br>  page: () =&gt; SearchScreen(),<br>    ),<br>    GetPage(<br>      name: &#39;/pokemon-details&#39;,<br>  // transition: Transition.zoom,<br>  page: () =&gt; PokemonDetails(),<br>    ),<br><br>  ];<br>}</pre><p>main.dart :</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:get/get.dart&#39;;<br><br>import &#39;screen/landing_screen_view/pokemon_list_screen.dart&#39;;<br>import &#39;utils/routes/routes.dart&#39;;<br><br>void main() {<br>  runApp(const MyApp());<br>}<br><br>class MyApp extends StatelessWidget {<br>  const MyApp({super.key});<br><br>  // This widget is the root of your application.<br>  @override<br>  Widget build(BuildContext context) {<br>    return GetMaterialApp(<br>      debugShowCheckedModeBanner: false,<br>      initialBinding: ControllerBindings(),<br>      title: &#39;Pokemon&#39;,<br>      getPages: Routes.routes,<br>      // home: const PokemonListScreen(),<br>      initialRoute: &#39;/&#39;,<br>    );<br>  }<br>}</pre><p>checkout the github link for further details :</p><p><a href="https://github.com/venkat9507/pokemon">https://github.com/venkat9507/pokemon</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a105a977fdd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter App connecting with native android using method channel]]></title>
            <link>https://medium.com/@venkatraman230/flutter-app-connecting-with-native-android-using-method-channel-1653efc346ae?source=rss-a7ab9c17f08d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1653efc346ae</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-channel-method]]></category>
            <category><![CDATA[flutter-platform-channel]]></category>
            <category><![CDATA[method-channel]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[VENKAT RAMAN]]></dc:creator>
            <pubDate>Mon, 31 Jul 2023 18:42:41 GMT</pubDate>
            <atom:updated>2023-08-01T03:02:49.257Z</atom:updated>
            <content:encoded><![CDATA[<p>first create a flutter project with Java or else Kotlin</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*Z2GiygyTDGsZOnJUC-qYTg.png" /></figure><h3>1: Create a new app project</h3><p>Start by creating a new app:</p><ul><li>In a terminal run: flutter create batterylevel</li></ul><p>By default, our template supports writing Android code using Kotlin, or iOS code using Swift. To use Java or Objective-C, use the -i and/or -a flags:</p><ul><li>In a terminal run: flutter create -i objc -a java batterylevel</li></ul><h3>Step 2: Create the Flutter platform client</h3><p>add this 3 imports</p><p>import ‘dart:async’;<br>import ‘package:flutter/material.dart’;<br>import ‘package:flutter/services.dart’;</p><p>create a static variable</p><p>class _MyHomePageState extends State&lt;MyHomePage&gt; {<br><strong> static const platform = MethodChannel(‘samples.flutter.dev/battery’);<br></strong> // Get battery level.</p><p>create a string to store the battery percentage from the method channel</p><pre>// Get battery level.<br>String _batteryLevel = &#39;Unknown battery level.&#39;;</pre><p>create a function inside stateful widget</p><pre>Future&lt;void&gt; _getBatteryLevel() async {<br>  String batteryLevel;<br>  try {<br>    final int result = await platform.invokeMethod(&#39;getBatteryLevel&#39;);<br>    batteryLevel = &#39;Battery level at $result % .&#39;;<br>  } on PlatformException catch (e) {<br>    batteryLevel = &quot;Failed to get battery level: &#39;${e.message}&#39;.&quot;;<br>  }<br><br>  setState(() {<br>    _batteryLevel = batteryLevel;<br>  });<br>}</pre><p>now create a build widget with button to get the data from the method channel</p><pre>Widget build(BuildContext context) {<br>  return Material(<br>    child: Center(<br>      child: Column(<br>        mainAxisAlignment: MainAxisAlignment.spaceEvenly,<br>        children: [<br>          ElevatedButton(<br>            onPressed: _getBatteryLevel,<br>            child: const Text(&#39;Get Battery Level&#39;),<br>          ),<br>          Text(_batteryLevel),<br>        ],<br>      ),<br>    ),<br>  );<br>}</pre><h3>Step 3: Add an Android platform-specific implementation</h3><ul><li>Start by opening the Android host portion of your Flutter app in Android Studio:</li></ul><ol><li>Start Android Studio</li><li>Select the menu item <strong>File &gt; Open…</strong></li><li>Navigate to the directory holding your Flutter app, and select the <strong>android</strong> folder inside it. Click <strong>OK</strong>.</li><li>Open the MainActivity.java file located in the <strong>java</strong> folder in the Project view.</li></ol><p>Note : The above steps are important you should not edit directly from the project/android/app/src/main/jave/projectname/MainActivity.java…. you should instead follow the above steps and then open the project in android studio as new</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J77A1cO7bSISZ9dNB3kyzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DOsrNJdNi3x0fce0ThqBTw.png" /></figure><p>from the above image select click on new window</p><p>wait for a while it will take some time and then left side corner you can see the menu from that menu choose app/java/com.example.batterylevel/MainActivity.java</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q6R0Yu3PsFNMqEy13y5_yQ.png" /></figure><p>Next, create a MethodChannel and set a MethodCallHandler inside the configureFlutterEngine() method. Make sure to use the same channel name as was used on the Flutter client side.</p><pre>import androidx.annotation.NonNull;<br>import io.flutter.embedding.android.FlutterActivity;<br>import io.flutter.embedding.engine.FlutterEngine;<br>import io.flutter.plugin.common.MethodChannel;<br><br>public class MainActivity extends FlutterActivity {<br>  private static final String CHANNEL = &quot;samples.flutter.dev/battery&quot;;<br><br>  @Override<br>  public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {<br>  super.configureFlutterEngine(flutterEngine);<br>    new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), CHANNEL)<br>        .setMethodCallHandler(<br>          (call, result) -&gt; {<br>            // This method is invoked on the main thread.<br>            // TODO<br>          }<br>        );<br>  }<br>}</pre><p>Add the Android Java code that uses the Android battery APIs to retrieve the battery level. This code is exactly the same as you would write in a native Android app.</p><p>First, add the needed imports at the top of the file:</p><p>import android.content.ContextWrapper;<br>import android.content.Intent;<br>import android.content.IntentFilter;<br>import android.os.BatteryManager;<br>import android.os.Build.VERSION;<br>import android.os.Build.VERSION_CODES;<br>import android.os.Bundle;</p><p>Then add the following as a new method in the MainActivity class, below the configureFlutterEngine() method:</p><pre>private int getBatteryLevel() {<br>  int batteryLevel = -1;<br>  if (VERSION.SDK_INT &gt;= VERSION_CODES.LOLLIPOP) {<br>    BatteryManager batteryManager = (BatteryManager) getSystemService(BATTERY_SERVICE);<br>    batteryLevel = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY);<br>  } else {<br>    Intent intent = new ContextWrapper(getApplicationContext()).<br>        registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));<br>    batteryLevel = (intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1) * 100) /<br>        intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);<br>  }<br><br>  return batteryLevel;<br>}</pre><p>Remove the following code:</p><pre>(call, result) -&gt; {<br>  // This method is invoked on the main thread.<br>  if (call.method.equals(&quot;getBatteryLevel&quot;)) {<br>    int batteryLevel = getBatteryLevel();<br><br>    if (batteryLevel != -1) {<br>      result.success(batteryLevel);<br>    } else {<br>      result.error(&quot;UNAVAILABLE&quot;, &quot;Battery level not available.&quot;, null);<br>    }<br>  } else {<br>    result.notImplemented();<br>  }<br>}</pre><p>and press ctrl + R on java android studio file it will run on the app from the java after that you can run the app from the flutter main.dart</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NRTDlIbB-Z0CYrIyND3e7A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z2GiygyTDGsZOnJUC-qYTg.png" /></figure><p>for more information check out this github page</p><p><a href="https://github.com/venkat9507/flutter-batterylevel-methodchannel-android">GitHub - venkat9507/flutter-batterylevel-methodchannel-android: This is the flutter battery level getting from the method channel from the android device</a></p><p>if you like this please follow me on github and give me a star at github and medium</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1653efc346ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>