<?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 Ziyauddin Shaik on Medium]]></title>
        <description><![CDATA[Stories by Ziyauddin Shaik on Medium]]></description>
        <link>https://medium.com/@ziyauddinshaik7?source=rss-0a9fdaed7aa8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2INngNXQ57Fgdxcwo32Dlw.jpeg</url>
            <title>Stories by Ziyauddin Shaik on Medium</title>
            <link>https://medium.com/@ziyauddinshaik7?source=rss-0a9fdaed7aa8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 11:46:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ziyauddinshaik7/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[Flutter API -BLoC Pattern]]></title>
            <link>https://medium.com/@ziyauddinshaik7/flutter-api-bloc-pattern-85d72053f0a2?source=rss-0a9fdaed7aa8------2</link>
            <guid isPermaLink="false">https://medium.com/p/85d72053f0a2</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Ziyauddin Shaik]]></dc:creator>
            <pubDate>Fri, 14 Nov 2025 11:34:38 GMT</pubDate>
            <atom:updated>2025-11-14T11:34:38.249Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever found yourself tangled in API implementation in Flutter, this is for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lPn8Ss5R_kb0CvqaPzf9rQ.png" /></figure><p>The 5 step API Integration Blueprint</p><blockquote>Step 1: Generate a Response Model<br>Step 2: Architectural Setup<br>Step 3: The BLoC Integration<br>Step 4 : From Static to Dynamic: The Dynamic Payload Transformation<br>Step 5: Data Mapping</blockquote><h3><strong>Step 1: Generate a Response Model</strong></h3><p>Hit your cURL in Postman to confirm the API works as expected<br>Copy that response JSON and paste it into a “<a href="https://javiercbk.github.io/json_to_dart/">JSON to Dart</a>” converter. <br>Immediately rename those generic Autogenerated and Data classes to something meaningful for your project.</p><h3><strong>Step 2: Architectural Setup</strong></h3><p>1. Copy that response model and add it to <em>module/data</em>.<br>2. Add the request file in <em>module/remote</em>.<br>3. Update the repository in <em>module/domain</em>.<br>4. Update <em>repository_impl</em> in <em>module/data</em>.<br>5. Update <em>api_service</em> in <em>module/remot</em>e.<br>6. Add the <em>use_case</em> in <em>module/domain</em>.</p><p>(Note: Keep adding paths in export files like data.dart, domain.dart, etc.<br>To run build runner for each module, use cd, cd .. commands.)</p><h3><strong>Step 3: The BLoC Integration</strong></h3><p><em>home_state :</em></p><pre>@Default(null) ApiLoginResponse? apiLoginResponse,</pre><p><em>home_event :</em></p><pre>class ApiLoginEvent extends HomeEvent {}</pre><p><em>home_bloc:</em></p><pre>FutureOr&lt;void&gt; onApiLoginEvent(<br>    ApiLoginEvent event, Emitter&lt;HomeState&gt; emit) async {<br>  return callAPI&lt;ApiLoginResponse&gt;(<br>    action: () async {<br>      return await getLoginUseCase.execute(<br>          GetLoginDetailInput(<br>              request: LoginRequest(<br>                  password: &quot;joe@123&quot;,<br>                  username: &quot;joe&quot;<br>               )));<br>    },<br>    handleLoading: true,<br>    onSuccess: (result) async {},<br>    onError: (_) async {},<br>    handleError: true,<br>  );<br>}</pre><p><em>home_screen</em> <em>:</em></p><pre>@override<br>void initState() {<br>  super.initState();<br>  bloc.add(ApiLoginEvent());  //Trigger to test<br>}</pre><p>And just like that — you’re done! Monitor your console to see the request and response in action.</p><h3><strong>Step 4 : From Static to Dynamic: The Dynamic Payload Transformation</strong></h3><p>Once you’ve confirmed the API works with hardcoded values, it’s time to make it dynamic</p><p><em>home_event:</em></p><pre>class ApiLoginEvent extends HomeEvent {<br>  final LoginRequest request;<br>  ApiLoginEvent(this.request);<br>}</pre><p><em>home_bloc:</em></p><pre>action: () async {<br>  return await getLoginUseCase<br>      .execute(GetLoginDetailInput(request: event.request));<br>},</pre><p>Success State Management:</p><pre>onSuccess: (result) async { <br>  if (result.status == true) {<br>    emit(state.copyWith(apiLoginResponse: result));<br>  }<br>}</pre><p>UI Trigger:</p><pre>onPressed: () {<br>  if (nameController.text.isNotEmpty == true) {<br>    bloc.add(ApiLoginEvent(<br>      LoginRequest(<br>        username: nameController.text.trim(),<br>        password: passController.text.trim(),<br>      ),<br>    ));<br>  }<br>}</pre><h3><strong>Step 5: Data Mapping</strong></h3><p>One of the most satisfying parts of this process is watching your data models evolve from dummy data to real API responses.</p><p>State Transformation:</p><pre>// From temporary structure<br>@Default([]) List&lt;DummyDataModel&gt; userList,<br><br>// To actual API model  <br>@Default([]) List&lt;ApiUsers&gt; userList,</pre><p>BLoC Data Processing:</p><pre>onSuccess: (result) async {<br>  if (result.status == true) {<br>    emit(state.copyWith(<br>      apiLoginResponse: result<br>      userList: result.data?.users ?? [],<br>    ));<br>  }<br>}</pre><p>UI Data Binding:</p><pre>// Before<br>final List&lt;DummyDataModel&gt; userList;<br><br>Text(model.name);<br><br><br>// After<br>final List&lt;ApiUsers&gt; userList;<br>  <br>Text(model.users?.name ?? &#39;&#39;);</pre><p>Hope you like it :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85d72053f0a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter 16KB Android Play Store Fix]]></title>
            <link>https://medium.com/nammaflutter/flutter-16kb-android-play-store-fix-1f4330a1c9f2?source=rss-0a9fdaed7aa8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f4330a1c9f2</guid>
            <category><![CDATA[16-kb-page-size]]></category>
            <category><![CDATA[google-play]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Ziyauddin Shaik]]></dc:creator>
            <pubDate>Wed, 01 Oct 2025 11:47:47 GMT</pubDate>
            <atom:updated>2025-11-24T01:25:25.938Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SlrmOLBFGfOm3jI0Bl_YQA.png" /></figure><p>So, Play Store woke up one fine morning and decided to give all of us Flutter devs a gentle <em>panic attack</em>:</p><p><strong>“Hey developers, by November 1, 2025, your APKs must comply with the 16KB page size requirement… or else 👀”</strong></p><p>And if you’re like me you probably saw that email and went:</p><p><em>“Yeah yeah, deadline is far away… I’ll do it tomorrow.”</em><br>Fast-forward → tomorrow becomes next week → next month → suddenly it’s Halloween 2025 and you’re panicking harder than your users.</p><p>Here’s the magic checklist to keep your app safe:</p><h3>Step-by-Step Fix for Flutter’s 16KB Issue</h3><p><strong>Step 1: </strong>Upgrade the Flutter version, Flutter team already patched this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1s0bEIfKc6llgceEHWjrKA.png" /></figure><p><strong>Step 2 :</strong> Install the latest NDK</p><p>Head over to Android Studio → SDK Manager → SDK Tools → check <strong>NDK (Side by side)</strong> → update it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Cpky1MO4LGgjJiOYyT_0Q.png" /></figure><p><strong>Step 3:</strong> Install the latest CMake</p><p>If you don’t upgrade it, app will scream at you anyway😂</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yn_d9YOPV-ka9QMaOjoEmA.png" /></figure><p><strong>Step 4: </strong>Upgrade the Gradle version in gradle-wrapper.properties</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PM24h1hN6lNcOpXL0bMpsw.png" /></figure><p><strong>Step 5:</strong> Point to the installed NDK in app/build.gradle.kts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TdJBy0zE3CWM1mBgSMMNrQ.png" /></figure><p><strong>Step 6 :</strong> Upgrade Android &amp; Kotlin plugins in settings.gradle.kts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vKKKv2uekwesCWT_r392BA.png" /></figure><p><strong>Step 7 : </strong>Fix package issues, If some of your Flutter packages scream after publishing to the store identify them and update them from <a href="http://pub.dev/">pub.dev</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_uyxQMbuwsj_fe3pmWYOOA.png" /></figure><p><strong>Step 8 : </strong>Once done publish your build in all the tracks from Closed Testing -&gt; Internal Testing -&gt; Production and wait for a few hours and the scary <strong>16KB warning notification will magically disappear.</strong> 🎉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*fgfGRlohtY8ZEiDr_TTuwQ.png" /></figure><p>So do yourself a favor and fix it now, so on <strong>Nov 1, 2025</strong> you can relax while sipping coffee instead of Googling “flutter 16kb fix not working” at 3am.</p><p>Happy coding, Flutter fam 💙</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f4330a1c9f2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nammaflutter/flutter-16kb-android-play-store-fix-1f4330a1c9f2">Flutter 16KB Android Play Store Fix</a> was originally published in <a href="https://medium.com/nammaflutter">NammaFlutter</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installation & Setup of Flutter on Windows (Beginner-Friendly Guide-2025)]]></title>
            <link>https://medium.com/nammaflutter/installation-setup-of-flutter-on-windows-beginner-friendly-guide-2025-fc746c8ac363?source=rss-0a9fdaed7aa8------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc746c8ac363</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[Ziyauddin Shaik]]></dc:creator>
            <pubDate>Sat, 09 Aug 2025 09:26:43 GMT</pubDate>
            <atom:updated>2025-11-24T01:25:52.154Z</atom:updated>
            <content:encoded><![CDATA[<h3>Installation &amp; Setup of Flutter on Windows (Beginner-Friendly Guide -2025)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fx4EvX49WNTOGuakfmvctw.png" /></figure><p>If you’re a Windows user eager to dive into Flutter development, you’ve come to the right place.</p><p>In this blog, I’ll cover everything from installing Flutter to configuring Android Studio, setting up the JDK, and even adding Git for version control.</p><p>By the time you’re done here, you’ll be ready to run your first flutter project and actually see your code come to life.</p><p>So, let’s get started…</p><p>First things first : grab the Flutter SDK. <br>Head over to <a href="https://docs.flutter.dev/install/archive">Flutter SDK Archive</a> and pick the version you want</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4OWzQKEBnMTXIMuw26xR0A.png" /></figure><p>Once you hit download, you’ll get a zip file, unzip it wherever you like.</p><p>Right now, your system’s like, <em>“Flutter? Never heard of him”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PkghTjo-4EllL2aASpNSfg.png" /></figure><p>To fix that, Go into your unzipped Flutter folder and copy the path up to the <strong>bin</strong> folder then open Environment Variables find <strong>Path</strong> and add that bin path there and hit OK</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wV2-hU7Udhu7f0wWkogNTw.png" /></figure><p>now your system knows Flutter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wtb6rrPIsrhxOGmjc-Zp8w.png" /></figure><p>Time for a quick health check. Open a terminal and type</p><pre>flutter doctor</pre><p>Flutter will do its thing and tell you what’s missing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5rAkz1Yj6nTHDrWxzsZHqg.png" /></figure><p>Usually, it complains about not having Android Studio or Visual Studio yet. Let’s handle that by downloading Android Studio from <a href="https://developer.android.com/studio">here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vjV64c5Qg7wtx0NB_2nq3Q.png" /></figure><p>Click through the installer — Next, Next, Install — you know the drill.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*v4fqCvcr_O7QzjSlGPKnOg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*Y1xj7hO32zibVKBFyMBq_Q.png" /></figure><p>After installation, Android Studio will launch and probably ask to download some components. Let it! Grab a coffee ☕ while it sets up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*geDBF8NTWJ5XCOMYGfuoYg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QCkh-_Hp5tGolHNc-VdWpw.png" /></figure><p>Once Android Studio is up and running:</p><p>Click on More Actions → SDK Manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-t18DKbvIfvOd8j5IHH3aA.png" /></figure><p>Make sure you’ve installed: <em>Android SDK Command-line Tools</em>, <em>Android SDK Platform Tools</em>, <em>Android SDK Build-Tools</em>.</p><p>These are the unsung heroes behind every build.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kIFMhEmx0yWcmFrb0-3xuw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R4PZPN_YneuP5KoyZ7vIjw.png" /></figure><p>Once the download finishes, Back in your terminal:</p><pre>flutter doctor</pre><p>Now it might say something like <em>“Android licenses not accepted”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QFiv8Q0BMfp_E1cNwJrrKg.png" /></figure><p>Just run:</p><pre>flutter doctor --android-licenses</pre><p>Accept everything (just keep hitting y when prompted).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*faYYv-iqbAVlC1muNqcjtQ.png" /></figure><p>Run flutter doctor one last time — now it should give you a green check on everything</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jrJPE54-sktdvz3LCriP1g.png" /></figure><p>To get started with the Flutter project we download flutter and dart plugins in android studio for smoothest dev experience. Restart the IDE if needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DfR8RGrQRxoNjLjcocDrxw.png" /></figure><p>So finally we are all set…Let’s go! Open a terminal and run:</p><pre>flutter create demo</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h1jX5qejTfBRQ0Mpo28pvw.png" /></figure><p>This creates a brand new Flutter project named demo.</p><p>Now open it up in Android Studio:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PGE6hvc_c5cb6R81VNahAA.png" /></figure><p>Project is created successfully !</p><blockquote><strong>Installing JDK manually (Optional)</strong></blockquote><p>If you’ve installed <strong>Android Studio</strong>, you might have noticed that it already comes with its own <strong>JDK</strong> bundled inside. But if you want more control, or work on multiple Java-based projects, installing your own JDK is a good idea. You can download it from <a href="https://www.oracle.com/java/technologies/javase/jdk17-0-13-later-archive-downloads.html">here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WliniA7ux3bCuwJU4ff_Jw.png" /></figure><p>Complete the installation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rj-e20Mma5AxjvngTn3cvA.png" /></figure><p>Copy the path of your JDK</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D62z6TfIFwezllEJhkyO_w.png" /></figure><p>Now let’s make the Flutter project to use our specific JDK with this command.</p><pre>flutter config --jdk-dir &quot;path_to_your_jdk&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YlKKqoYFng3JRI052BLCrQ.png" /></figure><p>Now our project uses jdk-17.0.4, Now we can create an emulator and run the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_xZGoLbQFPR3NVfMim0O5g.png" /></figure><blockquote><strong>Installing Git for version control (Highly Recommended)</strong></blockquote><p>Alright, we’ve got Flutter, Android Studio, and JDK all set up.<br>Now let’s setup <strong>Git , </strong>its like the magical time machine for your code. Download the git from<a href="https://git-scm.com/downloads/win"> here</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2uFAX2ZX1PQgzXpG5ezD_A.png" /></figure><p>Download the installer and run it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*n9z0IneInfIyWkaHSTp6Sw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*XwajbATx698eFmwdGMh5MA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*253a2XrXhEzHeMZAY-Sdlg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*eSmPHbn2G6UyXpGsgnWAzw.png" /></figure><p>Don’t worry if you see<em> “git is not recognized as an internal or external command” </em>just add the environmental variable</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*eL1rwwJ5FKJHAlUl72tIwg.png" /></figure><p>Congratulations,</p><p>you’ve gone from a blank machine to a <strong>Flutter-ready powerhouse</strong>!</p><p>You’ve got: <br>1. Flutter installed <br>2. Android Studio set up<br>3. JDK ready and configured<br>4. Git installed and accessible from anywhere.</p><p>So what are you waiting for ? Bring your ideas to life…</p><p>Happy Fluttering !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc746c8ac363" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nammaflutter/installation-setup-of-flutter-on-windows-beginner-friendly-guide-2025-fc746c8ac363">Installation &amp; Setup of Flutter on Windows (Beginner-Friendly Guide-2025)</a> was originally published in <a href="https://medium.com/nammaflutter">NammaFlutter</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating App Icon Changes for Seasonal Updates in Flutter (Android)]]></title>
            <link>https://medium.com/nammaflutter/automating-app-icon-changes-for-seasonal-updates-in-flutter-android-native-approach-9610a338d5f4?source=rss-0a9fdaed7aa8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9610a338d5f4</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Ziyauddin Shaik]]></dc:creator>
            <pubDate>Tue, 11 Mar 2025 05:47:18 GMT</pubDate>
            <atom:updated>2025-03-19T10:50:03.150Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*smEKt2J9OwA9hS1O8nPQww.png" /></figure><p>Have you ever wanted your Flutter app to switch its app icon automatically for seasonal updates? Imagine your app displaying a festive New Year’s icon during the first week of January and then reverting to the default icon afterward — without requiring a manual update. No more boring, static app icons — let’s bring some holiday spirit to your app.</p><p><strong>Step 1: Creating a Flutter Project</strong></p><p>First, create a new Flutter project using the following command:</p><pre>flutter create change_icon</pre><p>By default, Flutter generates an app icon (ic_launcher.png) inside the android/app/src/main/res/mipmap directories:</p><ul><li>mipmap-hdpi</li><li>mipmap-mdpi</li><li>mipmap-xhdpi</li><li>mipmap-xxhdpi</li><li>mipmap-xxxhdpi</li></ul><p>To add an additional seasonal icon (e.g., a New Year icon), you need to generate corresponding icon sets. Instead of manually creating these, use<a href="https://www.appicon.co/"> App Icon Generator</a> to generate all required sizes easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4siCPlUr9mr05iRpNJvZeQ.png" /><figcaption>Add New Year App Icon in corresponding sets</figcaption></figure><p><strong>Step 2: Configuring AndroidManifest.xml</strong></p><p>Now, let’s set up two app icons in AndroidManifest.xml using activity-alias. Open <em>android/app/src/main/AndroidManifest.xml</em> and add the following inside the &lt;application&gt; tag:</p><pre>&lt;!-- Default app icon  --&gt;<br>        &lt;activity-alias<br>            android:name=&quot;.MainActivity&quot;<br>            android:enabled=&quot;true&quot;<br>            android:exported=&quot;true&quot;<br>            android:icon=&quot;@mipmap/ic_launcher&quot;<br>            android:targetActivity=&quot;.MainActivity&quot;<br>            android:theme=&quot;@style/LaunchTheme&quot;&gt;<br>            &lt;intent-filter&gt;<br>                &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;<br>                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;<br>            &lt;/intent-filter&gt;<br>        &lt;/activity-alias&gt;<br><br><br>        &lt;!-- New Year app icon  --&gt;<br>        &lt;activity-alias<br>            android:name=&quot;.MainActivityNewYear&quot;<br>            android:enabled=&quot;false&quot;<br>            android:exported=&quot;true&quot;<br>            android:icon=&quot;@mipmap/ic_launcher_new_year&quot;<br>            android:targetActivity=&quot;.MainActivity&quot;<br>            android:theme=&quot;@style/LaunchTheme&quot;&gt;<br>            &lt;intent-filter&gt;<br>                &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;<br>                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;<br>            &lt;/intent-filter&gt;<br>        &lt;/activity-alias&gt;</pre><p>Here, we define two activity aliases — one for the default app icon and another for the New Year icon. Initially, only the default icon is enabled (android:enabled=”true”), while the New Year icon is disabled (android:enabled=”false”). Because, well, it’s not New Year’s every day!</p><p><strong>Step 3: Updating MainActivity.kt</strong></p><p>Modify MainActivity.kt (located in <em>android/app/src/main/kotlin/com/example/change_icon/</em>) to trigger an icon update upon app launch.</p><pre>package com.example.change_icon<br><br><br>import io.flutter.embedding.android.FlutterActivity<br>import android.os.Bundle<br>import androidx.annotation.NonNull<br>import android.util.Log<br>import com.example.change_icon.IconManager<br><br><br>class MainActivity: FlutterActivity() {<br>   override fun onCreate(@NonNull savedInstanceState: Bundle?) {<br>       super.onCreate(savedInstanceState)<br>       Log.d(&quot;MainActivity&quot;, &quot;onCreate called&quot;)<br>       updateIcon()<br>   }<br><br><br>   private fun updateIcon() {<br>       try {<br>           IconManager(this).updateAppIcon()<br>       } catch (e: Exception) {<br>           Log.e(&quot;MainActivity&quot;, &quot;Error updating icon&quot;, e)<br>           e.printStackTrace()<br>       }<br>   }<br>}</pre><p><strong>Step 4: Implementing IconManager.kt</strong></p><p>Create a new file, IconManager.kt, inside <em>android/app/src/main/kotlin/com/example/change_icon/</em>. This file contains the logic for switching between the default and seasonal app icons.</p><pre>package com.example.change_icon<br><br><br>import android.content.ComponentName<br>import android.content.Context<br>import android.content.pm.PackageManager<br>import java.util.Calendar<br>import android.util.Log<br><br><br>class IconManager(private val context: Context) {<br>   private val defaultIcon = ComponentName(context, &quot;com.example.change_icon.MainActivity&quot;)<br>   private val newYearIcon = ComponentName(context, &quot;com.example.change_icon.MainActivityNewYear&quot;)<br><br>   fun updateAppIcon() {<br>       try {<br>           val calendar = Calendar.getInstance()<br>           val isNewYearPeriod = isInNewYearPeriod(calendar)<br>          <br>           Log.d(&quot;IconManager&quot;, &quot;Current date: Month=${calendar.get(Calendar.MONTH)}, Day=${calendar.get(Calendar.DAY_OF_MONTH)}&quot;)<br>           Log.d(&quot;IconManager&quot;, &quot;Is New Year Period: $isNewYearPeriod&quot;)<br><br>           val pm = context.packageManager<br><br>           if (isNewYearPeriod) {<br>               Log.d(&quot;IconManager&quot;, &quot;Switching to New Year icon&quot;)<br>               // Enable New Year icon first<br>               pm.setComponentEnabledSetting(<br>                   newYearIcon,<br>                   PackageManager.COMPONENT_ENABLED_STATE_ENABLED,<br>                   PackageManager.DONT_KILL_APP<br>               )<br>               // Then disable default icon<br>               pm.setComponentEnabledSetting(<br>                   defaultIcon,<br>                   PackageManager.COMPONENT_ENABLED_STATE_DISABLED,<br>                   PackageManager.DONT_KILL_APP<br>               )<br>           } else {<br>               Log.d(&quot;IconManager&quot;, &quot;Switching to default icon&quot;)<br>               // Enable default icon first<br>               pm.setComponentEnabledSetting(<br>                   defaultIcon,<br>                   PackageManager.COMPONENT_ENABLED_STATE_ENABLED,<br>                   PackageManager.DONT_KILL_APP<br>               )<br>               // Then disable New Year icon<br>               pm.setComponentEnabledSetting(<br>                   newYearIcon,<br>                   PackageManager.COMPONENT_ENABLED_STATE_DISABLED,<br>                   PackageManager.DONT_KILL_APP<br>               )<br>           }<br>          <br>       } catch (e: Exception) {<br>           Log.e(&quot;IconManager&quot;, &quot;Error updating icon&quot;, e)<br>           e.printStackTrace()<br>           // Ensure default icon is enabled if something goes wrong<br>           try {<br>               context.packageManager.setComponentEnabledSetting(<br>                   defaultIcon,<br>                   PackageManager.COMPONENT_ENABLED_STATE_ENABLED,<br>                   PackageManager.DONT_KILL_APP<br>               )<br>           } catch (e: Exception) {<br>               Log.e(&quot;IconManager&quot;, &quot;Error enabling default icon&quot;, e)<br>               e.printStackTrace()<br>           }<br>       }<br>   }<br><br><br>   private fun isInNewYearPeriod(calendar: Calendar): Boolean {<br>       val month = calendar.get(Calendar.MONTH)<br>       val day = calendar.get(Calendar.DAY_OF_MONTH)<br><br>       // Check if it&#39;s JANUARY (month 1) and the day is between 1 and 5<br>       return month == Calendar.JANUARY &amp;&amp; day in 1..5<br>   }<br>}</pre><p><strong>Result :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*bAe10p0Bd9FmY8EcV0g_rQ.gif" /></figure><p>Congratulations! 🎉</p><p>Your Flutter app can now dynamically switch its app icon based on the date, adding a touch of seasonal magic without breaking a sweat.</p><p>🚀 Now go ahead and customize this further — perhaps add icons for other seasons or events! Maybe a Halloween pumpkin? Or a summer beach icon? Go wild! Happy fluttering! 🎨💡</p><p>Github : <a href="https://github.com/Ziyauddin189/change_icon/tree/main">https://github.com/Ziyauddin189/change_icon/tree/main</a></p><p>Linkedin : <a href="https://www.linkedin.com/in/shaik-ziyauddin-172546229">https://www.linkedin.com/in/shaik-ziyauddin-172546229</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9610a338d5f4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nammaflutter/automating-app-icon-changes-for-seasonal-updates-in-flutter-android-native-approach-9610a338d5f4">Automating App Icon Changes for Seasonal Updates in Flutter (Android)</a> was originally published in <a href="https://medium.com/nammaflutter">NammaFlutter</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>