<?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 Ashish Sharma on Medium]]></title>
        <description><![CDATA[Stories by Ashish Sharma on Medium]]></description>
        <link>https://medium.com/@theflutterist?source=rss-3180399f276a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ICDMfpG7nkFv3Pc9sTrpSw.jpeg</url>
            <title>Stories by Ashish Sharma on Medium</title>
            <link>https://medium.com/@theflutterist?source=rss-3180399f276a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 19:31:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@theflutterist/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[Seamlessly Sharing Data Across Flutter Apps: Using Deep linking in Flutter.]]></title>
            <link>https://levelup.gitconnected.com/seamlessly-sharing-data-across-flutter-apps-using-deep-linking-in-flutter-93a557754e85?source=rss-3180399f276a------2</link>
            <guid isPermaLink="false">https://medium.com/p/93a557754e85</guid>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[deep-linking]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Ashish Sharma]]></dc:creator>
            <pubDate>Fri, 01 Mar 2024 13:05:11 GMT</pubDate>
            <atom:updated>2024-03-01T13:05:11.064Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fSXUPgAOrSLMlrhzAPSA-g.png" /></figure><p>Imagine you have two apps that you’ve beautifully crafted — one for tracking your daily steps and another for showcasing your fitness progress. You’ve got this brilliant idea to merge the two, allowing your fitness app to display your step count from the first app. But how do you make this magic happen? This is where custom URL schemes come into play. They allow you to create a unique identifier for your apps, enabling seamless data sharing between them. Let’s explore how to set up and use custom URL schemes in Flutter to achieve this integration.</p><h3>Understanding Custom URL Schemes:</h3><p>Custom URL schemes are like secret handshakes that apps use to communicate with each other. Each app has its own unique URL scheme, which is defined in its configuration files (Info.plist for iOS and AndroidManifest.xml for Android).</p><p>This URL scheme tells other apps how to talk to it. When an app wants to send data to another app, it creates a custom URL with the receiving app’s URL scheme and the data it wants to send. The receiving app can then extract the data from the URL and use it however it wants.</p><blockquote>Deep Linking is a powerful tool for sharing data between apps and creating seamless user experiences.</blockquote><p><strong>For example,</strong> when you scan a UPI QR code, it contains the following custom URL scheme:</p><pre>upi://pay?pa=upiaddress@okhdfcbank&amp;pn=JohnDoe&amp;cu=INR</pre><p>This URL scheme starts with <strong>“upi://”</strong> and contains parameters like “pa” for the payee address, “pn” for the payee name, and “cu” for the currency. When you scan this QR code, your UPI app recognizes the custom URL scheme and uses the parameters to initiate the payment.</p><h3>Now, let’s move to the eagerly awaited moment!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*w8DOjpXSBe4jIS0WDC3hHw.gif" /></figure><p><strong>Step 1: </strong>Add these packages in your pubspec.yaml</p><ul><li><a href="https://pub.dev/packages/url_launcher">url_launcher | Flutter package</a></li><li><a href="https://pub.dev/packages/uni_links">uni_links | Flutter package</a></li></ul><p><strong>Step 2:</strong> Firstly, create two very simple apps, such as a simple counter and another to show the count.</p><blockquote>For this, we will use Flutter’s default counter applications. one to increment count and another to display that count.</blockquote><p>Here, the <strong>“MyCounter”</strong> app (Sender) is sending data to the <strong>“DisplayCount” </strong>app (Receiver).</p><p><strong>Step 3:</strong> In your (<strong>DisplayCount</strong>) receiver app, add this intent-filter to the &lt;activity&gt; tag in android/src/main/AndroidManifest.xml:</p><pre>&lt;manifest&gt;<br>  &lt;application&gt;<br>        &lt;activity<br>            android:name=&quot;.MainActivity&quot;<br>        ...&gt;<br>            &lt;intent-filter&gt;<br>                &lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;<br>                &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;<br>                &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&gt;<br>                &lt;!-- Accepts URIs that begin with YOUR_SCHEME://YOUR_HOST --&gt;<br>                &lt;data<br>                    android:scheme=&quot;counter&quot;<br>                    android:host=&quot;display&quot; /&gt;<br>            &lt;/intent-filter&gt;<br>        &lt;/activity&gt;<br>    ...</pre><p>Once our URL scheme is set up, we can send data to other apps using uni_links packages <strong>getInitialLinks() </strong>function.</p><pre>Future&lt;void&gt; uniLinksHandler() async {<br>    // Platform messages may fail, so we use a try/catch.<br>    try {<br>      final initialLink = await getInitialLink();<br>      if (initialLink != null) {<br>        var dataLink = Uri.parse(initialLink);<br><br>        _counter = int.parse(dataLink.queryParameters[&#39;count&#39;] ?? &quot;0&quot;);<br>        message = dataLink.queryParameters[&#39;message&#39;] ?? &quot;&quot;;<br>        setState(() {});<br>      }<br>    } catch (e) {<br>      // Handle exception<br>    }<br>  }</pre><blockquote>we will trigger a URL like “<strong>scheme://host?param1=hello&amp;param2=world</strong>” to App B. App B will receive this message and know exactly what to do with it.</blockquote><h3>Let’s implement this in our Counter App.</h3><p>To achieve this, the URL scheme will be <strong>“Counter://display?count=1&amp;message=Hii, from other App”.</strong></p><p>To launch the URL, use the launchUrl method from the url_launcher package.</p><h4>Here is a simple MyCounter App.</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/910070d1cd6f0b05bb9bd0bd1e9581f8/href">https://medium.com/media/910070d1cd6f0b05bb9bd0bd1e9581f8/href</a></iframe><p>Which passes counter to simple<strong> DisplayCount </strong>App.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/17806a5cb0176d0c97349cdd509f16ca/href">https://medium.com/media/17806a5cb0176d0c97349cdd509f16ca/href</a></iframe><p><strong>Step 5:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4B9u-f_HCwj71J8354D3Aw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*youMbCXuOgEFDIks9bYsdA.gif" /></figure><h3>conclusion</h3><p>we have learned how to share data between Flutter apps using custom URL schemes. We started by creating two simple apps, a counter app to send data and a display app to receive data. We then defined a custom URL scheme for the display app and used the url_launcher package to launch the URL with data parameters. This allowed us to pass data from the counter app to the display app seamlessly. Custom URL schemes are a powerful tool for sharing data between apps and can be used to create a wide range of functionalities.</p><blockquote><em>That’s it for this article! I hope you enjoyed it and leave a few claps if you did. Follow me for more Flutter articles and comment for any feedback you might have about this article.</em></blockquote><blockquote><em>I‘m Ashish Sharma aka theFlutterist. You can find me on </em><a href="https://www.linkedin.com/in/ashishsharma-sde/"><em>LinkedIn</em></a><em> or maybe follow me on </em><a href="https://github.com/sharmaAshish-dev"><em>GitHub</em></a><em> as well.</em></blockquote><ul><li><a href="https://medium.com/nerd-for-tech/implementing-picture-in-picture-in-flutter-enhancing-video-playback-experience-with-auto-enable-d1b52822aa24">Implementing Picture-in-Picture in Flutter: Enhancing Video Playback Experience With Auto Enable.</a></li><li><a href="https://blog.stackademic.com/debouncing-in-flutter-enhancing-user-experience-e330ea85f162">Debouncing in Flutter: Enhancing User Experience</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93a557754e85" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/seamlessly-sharing-data-across-flutter-apps-using-deep-linking-in-flutter-93a557754e85">Seamlessly Sharing Data Across Flutter Apps: Using Deep linking in Flutter.</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Picture-in-Picture in Flutter: Enhancing Video Playback Experience With Auto Enable.]]></title>
            <link>https://theflutterist.medium.com/implementing-picture-in-picture-in-flutter-enhancing-video-playback-experience-with-auto-enable-d1b52822aa24?source=rss-3180399f276a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1b52822aa24</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[vidéo]]></category>
            <dc:creator><![CDATA[Ashish Sharma]]></dc:creator>
            <pubDate>Tue, 09 Jan 2024 08:32:22 GMT</pubDate>
            <atom:updated>2024-01-16T04:26:34.002Z</atom:updated>
            <content:encoded><![CDATA[<h3>Implementing Picture-in-Picture in Flutter: Enhancing Video Playback Experience With Auto Enable When Minimized.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*jzC-L15dnrojRNKZHR-3oQ.gif" /></figure><p>Imagine this: You’re watching a super cool Marvel movie on your favorite video streaming app when suddenly, your best friend texts you about an awesome weekend plan. Yikes! But what if I told you there’s a way to keep watching your video and chat with your friend at the same time? That’s where Picture-in-Picture (PiP) mode swoops in to save the day! PiP shrinks your video into a mini window, so you can keep watching while checking your messages, scrolling through other stuff, or just being your multitasking superstar self.</p><p><strong>So, Let’s dive into PiP and make multitasking fun!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/0*FMd9g_8r1vdC71BU.gif" /></figure><h3>So, What is Picture-in-Picture Mode ?</h3><p>Picture-in-Picture (PiP) functionality enriches the user experience by allowing video content to be displayed in a resizable and movable window while concurrently using other applications. Implementing PiP in Flutter applications provides users with added flexibility and convenience during video playback or any other functionality.</p><h3>Why Implement Picture-in-Picture ?</h3><ol><li><strong>Enhanced Multitasking:</strong> PiP enables users to multitask effortlessly by allowing video content to play in a small overlay window while navigating through the app or performing other tasks.</li><li><strong>Improved Engagement:</strong> PiP encourages longer engagement with video content by providing flexibility in viewing, thereby increasing user retention and satisfaction.</li><li><strong>Flexibility and Convenience:</strong> The resizable and movable PiP window allows users to adjust the video playback according to their preferences, providing a personalized viewing experience.</li><li><strong>Modern and User-Centric Design:</strong> Implementing PiP aligns your app with contemporary design trends, demonstrating responsiveness to user needs and preferences.</li></ol><h3>Now, let’s move to the eagerly awaited moment!</h3><p><strong>Step 1: </strong>Add these packages in your pubspec.yaml</p><ul><li><a href="https://pub.dev/packages/floating">floating | Flutter Package</a></li><li><a href="https://pub.dev/packages/video_player">video_player | Flutter package</a></li></ul><p><strong>Step 2:</strong> Add android:supportsPictureInPicture=&quot;true&quot; line to the &lt;activity&gt; tag in android/src/main/AndroidManifest.xml:</p><pre>&lt;manifest&gt;<br>    &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;<br><br>   &lt;application&gt;<br>        &lt;activity<br>            android:name=&quot;.MainActivity&quot;<br>            android:supportsPictureInPicture=&quot;true&quot;<br>            ...</pre><p><strong>Step 3:</strong> Create a straightforward video player widget with a seek Bar to enable video playback.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/01541d9f5752ffc5d74277cab83408de/href">https://medium.com/media/01541d9f5752ffc5d74277cab83408de/href</a></iframe><p><strong>Step 4:</strong></p><p>The <strong>“</strong><a href="https://pub.dev/packages/floating"><strong>Floating</strong></a><strong>”</strong> package offers a convenient “PiPSwitcher” widget designed for effortlessly toggling between displayed widgets based on the current Picture-in-Picture (PiP) status. Utilize it in the following manner:</p><p><strong>Initialize “Floating” instance to enable PiP view.</strong></p><pre>class PIPExampleApp extends StatefulWidget {<br>  const PIPExampleApp({super.key});<br><br>  @override<br>  State&lt;PIPExampleApp&gt; createState() =&gt; _PIPExampleAppState();<br>}<br><br>class _PIPExampleAppState extends State&lt;PIPExampleApp&gt; {<br>  final String videoUrl = &#39;https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4&#39;;<br><br>  late Floating pip; // Initializing a variable to handle PiP functionalities<br>  bool isPipAvailable = false; // Variable to track PiP availability status<br>  <br>  @override<br>  void initState() {<br>    pip = Floating(); // Instantiating the &quot;Floating&quot; instance to manage PiP functionality<br>    super.initState();<br>    _checkPiPAvailability(); // Checking the availability of PiP upon initializing the widget<br>  }<br>  <br>  // Method to verify the availability of PiP feature asynchronously<br>  _checkPiPAvailability() async {<br>    isPipAvailable = await pip.isPipAvailable; // Checking if PiP mode is available on the device<br>    setState(() {}); // Triggering a UI update based on the PiP availability status<br>  }  <br><br>@override<br>  Widget build(BuildContext context) {<br>    return PiPSwitcher(<br>      // Widget displayed when PiP is disabled or app is in foreground state<br>      childWhenDisabled: Scaffold(<br>        body: Column(<br>          children: [<br>            VideoPlayerWidget(videoUrl: videoUrl),<br>            Expanded(<br>              child: Center(<br>                child: ElevatedButton(<br>                  onPressed: () {<br>                    // Enabling PiP mode if available and configuring the aspect ratio for landscape orientation.<br>                    if (isPipAvailable) {<br>                      pip.enable(aspectRatio: const Rational.landscape()); // Enabling PiP with a landscape aspect ratio<br>                    }<br>                  },<br>                  child: Text(isPipAvailable ? &#39;Enable PIP&#39; : &#39;PIP not available&#39;),<br>                ),<br>              ),<br>            ),<br>          ],<br>        ),<br>      ),<br>      // Widget displayed when PiP window is enabled or app is in background state<br>      childWhenEnabled: VideoPlayerWidget(videoUrl: videoUrl),<br>    );<br>  }<br>}</pre><p><strong>Step 5: All Done.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*sQ-Lr1bdid6Ap7hFmzZ5Sw.gif" /></figure><blockquote>Note: Keep an eye on where the video is playing when you switch to PiP mode because the video restarts from the beginning when you switch.</blockquote><h3>Bonus Tip</h3><p>When the user minimizes the application, commonly referred to as minimizing the app or switching to the background, the app’s visibility is reduced, and it moves from the foreground to the background state.</p><p>This transition to the background state can be utilized to trigger automatic Picture-in-Picture (PiP) mode, facilitating a seamless and enhanced user experience for video playback or continued app interaction while in PiP mode.</p><h4>Implementation</h4><p>In Flutter, the <strong>WidgetsBindingObserver</strong> is a mixin that helps in observing the application&#39;s lifecycle events. It&#39;s used alongside the app&#39;s state to detect when the application is minimized or moved to the background on the device. This mixin allows developers to monitor these state changes and execute specific actions or manage functionalities accordingly.</p><pre>class _PIPExampleAppState extends State&lt;PIPExampleApp&gt; with WidgetsBindingObserver {<br>  final String videoUrl = &#39;https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4&#39;;<br>  late Floating pip; // Instance to handle PiP functionality<br>  bool isPipAvailable = false; // Variable to track PiP availability<br><br>  @override<br>  void didChangeAppLifecycleState(AppLifecycleState state) {<br><br>    // Listening to app lifecycle changes to detect when the app enters the hidden state (minimized)<br>    if (state == AppLifecycleState.hidden &amp;&amp; isPipAvailable) {<br>      <br>      // Triggering PiP mode with a landscape aspect ratio when the app is minimized<br>      pip.enable(aspectRatio: const Rational.landscape());<br>    }<br>  }<br><br>...</pre><h4>Full Code</h4><p><a href="https://github.com/sharmaAshish-dev/flutter_pip_video_player">GitHub - sharmaAshish-dev/flutter_pip_video_player</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*Iy2AR8HgzOLdxcEP.gif" /></figure><h3>Conclusion</h3><p>In summary, implementing Picture-in-Picture (PiP) mode in Flutter applications offers a convenient way for users to multitask, allowing them to continue watching videos or accessing specific app features even when the app is minimized or running in the background. By employing techniques like utilizing WidgetsBindingObserver and monitoring the app&#39;s lifecycle, developers can seamlessly enable PiP mode, ensuring a smooth and uninterrupted user experience. This feature enhances the app&#39;s versatility and user-friendliness, catering to modern user expectations for seamless multitasking and continued engagement.</p><blockquote><em>That’s it for this article! I hope you enjoyed it and leave a few claps if you did. Follow me for more Flutter articles and comment for any feedback you might have about this article.</em></blockquote><blockquote><em>I‘m Ashish Sharma aka theFlutterist. You can find me on </em><a href="https://www.linkedin.com/in/ashishsharma-sde/"><em>LinkedIn</em></a><em> or maybe follow me on </em><a href="https://github.com/sharmaAshish-dev"><em>GitHub</em></a><em> as well.</em></blockquote><ul><li><a href="https://medium.com/nerd-for-tech/do-not-use-buildcontext-in-async-gaps-why-and-how-to-handle-flutter-context-correctly-870b924eb42e">Do Not Use BuildContext in Async Gaps: Why and How to Handle Flutter Context Correctly</a></li><li><a href="https://blog.stackademic.com/debouncing-in-flutter-enhancing-user-experience-e330ea85f162">Debouncing in Flutter: Enhancing User Experience</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1b52822aa24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling “Certification Verification Failed: Unable to Get Local Issuer Certificate” in Flutter]]></title>
            <link>https://theflutterist.medium.com/handling-certification-verification-failed-unable-to-get-local-issuer-certificate-in-flutter-b9f24dd2af42?source=rss-3180399f276a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9f24dd2af42</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[connection]]></category>
            <dc:creator><![CDATA[Ashish Sharma]]></dc:creator>
            <pubDate>Sat, 16 Dec 2023 09:33:46 GMT</pubDate>
            <atom:updated>2023-12-20T05:10:09.871Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J6H6KIxN_1BwQS0fI_kbeg.png" /></figure><p>When working with network requests or APIs in Flutter, encountering SSL/TLS-related issues, such as “<strong>Certification Verification Failed: Unable to Get Local Issuer Certificate</strong>,” can be quite frustrating. This issue frequently arises due to a disparity between the server’s SSL certificate presentation and the client’s ability to verify its authenticity. This error typically occurs due to certificate validation problems, particularly when the local system fails to recognize the certificate authority or issuer of the server’s SSL certificate. Let’s explore how to tackle and resolve this issue effectively.</p><blockquote>Particularly if it works solely on certain devices, troubleshooting becomes more intricate.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*Qt9cdYC6haRybXuPOGd7YA.gif" /></figure><h3>Understanding the Issue</h3><p>The error message points towards a failure in validating the SSL/TLS certificate provided by the server during the HTTPS connection. This often occurs because the client application doesn’t trust the certificate issuer or doesn’t have access to the necessary root certificate.</p><h3>Resolving the Error</h3><h3>1. Addressing Certificate Trust Issues</h3><p>One common cause of this error is the absence of a trusted certificate or failure to recognize the certificate authority that issued the server’s SSL certificate.</p><p><strong>Solution: </strong>Ensure that the client application recognizes and trusts the certificate authority responsible for issuing the server’s SSL certificate. This might involve adding the root certificate of the issuer to the local trust store of the app.</p><h3>2. Configuration of HTTP Client Libraries</h3><p>Certain HTTP client libraries used in Flutter applications have specific configurations related to SSL certificate validation.</p><p><strong>Solution:</strong></p><ol><li>Download cert from <a href="https://letsencrypt.org/certs/lets-encrypt-r3.pem">LetsEncrypt</a> or you can use your own valid certificate.pem</li><li>Add this file to assets/ca/ Flutter project root directory</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*3OTk8P0vrXTfPvGJwNbGjA.png" /></figure><p>3. Add assets/ca/ assets directory in pubspec.yaml</p><pre><br>flutter:<br>    uses-material-design: true<br><br>    assets:<br>      - assets/ca/</pre><p>4. Add this code on your app initialization:</p><pre>void main() async {<br>  WidgetsFlutterBinding.ensureInitialized();<br><br>  ByteData data = await PlatformAssetBundle().load(&#39;assets/ca/lets-encrypt-r3.pem&#39;);<br>  SecurityContext.defaultContext.setTrustedCertificatesBytes(data.buffer.asUint8List());<br><br>  runApp(MyApp());<br>}</pre><h3>3. Considerations when Bypassing Certificate Validation</h3><p>While not recommended due to security risks, some developers consider bypassing SSL certificate validation temporarily to avoid the error.</p><blockquote>If all above solutions failed to work, then</blockquote><h3><strong>Solution:</strong></h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/15d6a36543b9f1a351774e093892bba1/href">https://medium.com/media/15d6a36543b9f1a351774e093892bba1/href</a></iframe><h3>Conclusion</h3><p>Resolving the “Certification Verification Failed: Unable to Get Local Issuer Certificate” error in Flutter requires meticulous attention to SSL/TLS certificate validation. By addressing certificate trust issues, exploring HTTP client configurations, and considering trusted server options, developers can effectively overcome this error and establish secure connections in their Flutter applications.</p><blockquote><em>That’s it for this article! I hope you enjoyed it and leave a few claps if you did. Follow me for more Flutter articles and comment for any feedback you might have about this article.</em></blockquote><blockquote><em>I‘m Ashish Sharma aka theFlutterist. You can find me on </em><a href="https://www.linkedin.com/in/ashishsharma-sde/"><em>LinkedIn</em></a><em> or maybe follow me on </em><a href="https://github.com/sharmaAshish-dev"><em>GitHub</em></a><em> as well.</em></blockquote><h3>Checkout my other articles:</h3><ul><li><a href="https://medium.com/nerd-for-tech/do-not-use-buildcontext-in-async-gaps-why-and-how-to-handle-flutter-context-correctly-870b924eb42e">Do Not Use BuildContext in Async Gaps: Why and How to Handle Flutter Context Correctly</a></li><li><a href="https://theflutterist.medium.com/how-does-hot-reload-or-hot-restart-actually-works-an-insight-under-the-hood-da7c1a44bed2">How does Hot Reload or Hot Restart actually works: An insight under the hood.</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9f24dd2af42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How does Hot Reload or Hot Restart actually works: An insight under the hood.]]></title>
            <link>https://theflutterist.medium.com/how-does-hot-reload-or-hot-restart-actually-works-an-insight-under-the-hood-da7c1a44bed2?source=rss-3180399f276a------2</link>
            <guid isPermaLink="false">https://medium.com/p/da7c1a44bed2</guid>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[information]]></category>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[basics]]></category>
            <dc:creator><![CDATA[Ashish Sharma]]></dc:creator>
            <pubDate>Thu, 16 Nov 2023 05:41:23 GMT</pubDate>
            <atom:updated>2023-11-16T05:56:45.836Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mh1Cld2tmA3l2Nbb06T_vw.png" /></figure><p>Flutter, Google’s open-source UI toolkit, has gained immense popularity among developers for its ability to create beautiful and fast apps for various platforms, including iOS, Android, and the web. One of its standout features is “Hot Reload” and “Hot Restart,” which offer developers a dynamic and efficient development experience. But how do these features actually work? Let’s take a closer look under the hood.</p><h3>Understanding Hot Reload and Hot Restart</h3><h3>Hot Reload:</h3><p>Hot Reload is like a refresh button for your app. It enables developers to inject code changes into a running app without restarting the entire application. Here’s a glimpse of what happens:</p><ol><li><strong>JIT Compilation:</strong> Flutter employs a Just-In-Time (JIT) compiler, a crucial element in the Hot Reload saga. When code alterations occur, Flutter’s JIT compiler springs into action.</li><li><strong>Selective Recompilation:</strong> The JIT compiler selectively recompiles the modified sections of code while the app is still running. This swift compilation process ensures that only the updated parts are refreshed.</li><li><strong>Seamless Update:</strong> Flutter’s ingenious “<strong>widget-diffing</strong>” algorithm steps in next. It analyzes the differences between the app’s current state and the updated code, intelligently applies these changes, and seamlessly updates the user interface.</li><li><strong>Real-Time Gratification:</strong> The result? A near-instantaneous reflection of the code changes on the device or emulator, providing developers with real-time feedback.</li></ol><h3>Hot Restart: A Clean Slate</h3><p>In contrast to Hot Reload, Hot Restart offers a more profound renovation of the app, akin to a fresh canvas:</p><ol><li><strong>Complete Rerun:</strong> Hot Restart initiates a complete restart of the app. It re-executes the main() function and reconstructs the widget tree, revitalizing the app from the ground up.</li><li><strong>Optimized Speed:</strong> Remarkably, despite the thorough restart, Flutter’s optimized mechanisms ensure this process happens with incredible speed, minimizing downtime.</li></ol><h3>Why it’s Handy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*OHW-sMQNRggIcrOGGLdBvw.gif" /></figure><h3>Making Life Easier for Developers</h3><ul><li><strong>Try and See:</strong> You can try out new stuff instantly. Imagine painting a picture and changing colors right away without waiting for the paint to dry.</li><li><strong>Fixing Things Fast:</strong> If something’s not right, you can fix it quickly and see if it works better without going back to the beginning.</li></ul><h3>Conclusion: Making Coding Fun and Quick</h3><p>Hot Reload and Hot Restart are like magic buttons for app developers. They help you change things quickly and see the results right away, which makes coding feel more like playing and less like waiting.</p><blockquote><em>That’s it for this article! I hope you enjoyed it and leave a few claps if you did. Follow me for more Flutter articles and comment for any feedback you might have about this article.</em></blockquote><blockquote><em>I‘m Ashish Sharma aka theFlutterist. You can find me on </em><a href="https://www.linkedin.com/in/ashishsharma-sde/"><em>LinkedIn</em></a><em> or maybe follow me on </em><a href="https://github.com/sharmaAshish-dev"><em>GitHub</em></a><em> as well.</em></blockquote><h3>Checkout my other articles:</h3><ul><li><a href="https://medium.com/nerd-for-tech/do-not-use-buildcontext-in-async-gaps-why-and-how-to-handle-flutter-context-correctly-870b924eb42e">Do Not Use BuildContext in Async Gaps: Why and How to Handle Flutter Context Correctly</a></li><li><a href="https://medium.com/nerd-for-tech/parallax-scroll-effect-in-flutter-elevate-your-apps-user-experience-11a71b08a914">Parallax Scroll Effect in Flutter: Elevate Your App’s User Experience</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da7c1a44bed2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Do Websites Offer Cookies? Understanding the World of Digital Baking]]></title>
            <link>https://blog.stackademic.com/why-do-websites-offer-cookies-understanding-the-world-of-digital-baking-c4f6063e42cb?source=rss-3180399f276a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4f6063e42cb</guid>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[facts]]></category>
            <category><![CDATA[cookies]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Ashish Sharma]]></dc:creator>
            <pubDate>Fri, 03 Nov 2023 10:16:55 GMT</pubDate>
            <atom:updated>2023-11-03T10:16:55.489Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve spent any amount of time on the internet, you’ve likely encountered the term “cookies.” No, we’re not talking about the sweet, oven-baked delights, but rather the digital counterparts that websites offer. These digital cookies play a crucial role in your online experience. In this post, let’s explore the fascinating world of website cookies, and why websites offer them, and uncover some interesting facts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*delUm9PmyYL1Bf07BM7myQ.png" /></figure><h4>1. What Are Website Cookies?</h4><p>First things first, what exactly are website cookies? Website cookies are small pieces of data that websites store on your device, typically in your web browser. They are used to track your online behavior, remember your preferences, and store information to enhance your browsing experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*8VWHG27Wos8I9koqzeTbRA.gif" /></figure><p>Imagine you’re a regular online shopper, and you frequently visit an e-commerce website. Each time you return, the website somehow remembers your account, your preferences, and even the items you’ve added to your cart. This magic isn’t the work of wizards but rather website cookies.</p><blockquote>These digital crumbs of information are like the friendly store associate who greets you by name, knows your style, and makes your shopping experience more enjoyable.</blockquote><h4>2. Why Do Websites Offer Cookies?</h4><p>Now that we know what website cookies are, let’s dive into the why. Websites offer cookies primarily to make your online experience smoother and more personalized. These digital cookies work behind the scenes to remember your login information, site preferences, and even the contents of your online shopping cart.</p><p>This level of personalization and convenience wouldn’t be possible without cookies. They enable websites to offer a tailored experience, allowing you to pick up where you left off, whether it’s reading news articles, shopping for products, or connecting with your friends on social media.</p><h4>3. But, Are Cookies Safe?</h4><p>While cookies are incredibly helpful, you might wonder about their safety. In a scenario where you’re concerned about online security, it’s essential to understand that cookies, for the most part, are harmless. They are merely text files that store data about your online interactions.</p><p>However, it’s crucial to be aware of the distinction between first-party cookies (set by the website you’re visiting) and third-party cookies (set by other domains). While first-party cookies are generally safe, third-party cookies have raised privacy concerns and are subject to stricter regulations due to their potential to track your online behavior across different websites. Understanding this can help you make informed choices about what cookies you should accept and how you interact with cookies online.</p><blockquote>Sometimes these cookies can be used to mimic a user’s identity to gain access on some websites if not managed properly.</blockquote><h4>Interesting facts about Cookie Origin</h4><p>While website cookies are essential for the online experience, there are some facts about their origin:</p><p><strong>1. Inventor’s Sweet Inspiration:</strong> The term “cookie” was inspired by the notion of a “magic cookie,” which is an idea in programming that refers to data shared between different processes. The inventors of web cookies decided to use this term, and it stuck.</p><p><strong>2. Cookie Pioneers:</strong> The first-ever website cookies were created by computer scientists at Netscape Communications in the early 1990s. They introduced cookies to help websites remember user data, but little did they know how integral these little bits of data would become.</p><p><strong>3. Ever-Persistent Cookies:</strong> Some cookies are set to expire at the end of your browsing session, while others can persist for a long time. These are known as persistent cookies and can be used to remember you and your preferences on subsequent visits to a website.</p><p><strong>4. Third-Party Cookie Controversy:</strong> There’s a brewing controversy around third-party cookies, which are set by domains other than the one you’re currently visiting. They’ve raised privacy concerns and led to discussions about their regulation and eventual phasing out. As cookies can be used to track a user’s online behavior over the internet.</p><h4>In Conclusion: A Taste of the Digital World</h4><p>Website cookies, while not as delicious as they are in the kitchen, are an integral part of your online experience. They enhance personalization, security, and convenience while helping website owners gather valuable data and deliver more relevant content. So, the next time a website offers you a cookie, you’ll know it’s not for snacking but for creating a sweeter online experience. And remember, behind these digital bites lies a fascinating history and some intriguing secrets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*upcKIomjNqes80cSGhek3w.gif" /></figure><blockquote><em>That’s it for this article! I hope you enjoyed it and leave a few claps if you did. Follow me for more Flutter articles and comment for any feedback you might have about this article.</em></blockquote><blockquote><em>I‘m Ashish Sharma aka theFlutterist. You can find me on </em><a href="https://www.linkedin.com/in/ashishsharma-sde/"><em>LinkedIn</em></a><em> or maybe follow me on </em><a href="https://github.com/sharmaAshish-dev"><em>GitHub</em></a><em> as well.</em></blockquote><h3>Checkout my other articles:</h3><ul><li><a href="https://medium.com/nerd-for-tech/cancelling-asynchronous-operations-in-flutter-when-and-how-its-achievable-3d9ae0606920">Cancelling Asynchronous Operations in Flutter: When and How It’s Achievable.</a></li><li><a href="https://medium.com/nerd-for-tech/do-not-use-buildcontext-in-async-gaps-why-and-how-to-handle-flutter-context-correctly-870b924eb42e">Do Not Use BuildContext in Async Gaps: Why and How to Handle Flutter Context Correctly</a></li></ul><h3>Stackademic</h3><p><em>Thank you for reading until the end. Before you go:</em></p><ul><li><em>Please consider </em><strong><em>clapping</em></strong><em> and </em><strong><em>following</em></strong><em> the writer! 👏</em></li><li><em>Follow us on </em><a href="https://twitter.com/stackademichq"><strong><em>Twitter(X)</em></strong></a><em>, </em><a href="https://www.linkedin.com/company/stackademic"><strong><em>LinkedIn</em></strong></a><em>, and </em><a href="https://www.youtube.com/c/stackademic"><strong><em>YouTube</em></strong></a><strong><em>.</em></strong></li><li><em>Visit </em><a href="http://stackademic.com/"><strong><em>Stackademic.com</em></strong></a><em> to find out more about how we are democratizing free programming education around the world.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4f6063e42cb" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/why-do-websites-offer-cookies-understanding-the-world-of-digital-baking-c4f6063e42cb">Why Do Websites Offer Cookies? Understanding the World of Digital Baking</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cancelling Asynchronous Operations in Flutter: When and How It’s Achievable.]]></title>
            <link>https://theflutterist.medium.com/cancelling-asynchronous-operations-in-flutter-when-and-how-its-achievable-3d9ae0606920?source=rss-3180399f276a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d9ae0606920</guid>
            <category><![CDATA[async]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[ui-ux-design]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Ashish Sharma]]></dc:creator>
            <pubDate>Mon, 30 Oct 2023 12:43:48 GMT</pubDate>
            <atom:updated>2023-11-01T03:28:19.461Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0yjESXOVn7Ri6Es28sEOrg.png" /></figure><p>Asynchronous operations are integral to the functionality of modern mobile applications. They enable apps to perform tasks in the background without freezing the user interface. In Flutter, these operations are typically managed using “<strong>Futures</strong>” and “<strong>Streams</strong>” combined with “<strong>async/await</strong>” syntax. While these mechanisms work well in most cases, there are situations where the ability to cancel these operations is crucial such as canceling a presently downloading file, and so on.</p><h3>The Significance of Cancellable Asynchronous Operations</h3><p>Consider a scenario in which your Flutter app is in the process of downloading a large file, and the user decides to cancel the download. Without the capability to cancel the asynchronous operation, the app may become unresponsive when the current context is no longer available in the widget tree which will result in a poor user experience. This is precisely where cancellable asynchronous operations come to the rescue. They provide a means to pause and gracefully terminate an ongoing operation when the user chooses to cancel it, ensuring that the app remains responsive and user-centric.</p><h3>Implementing Cancellable Asynchronous Operations</h3><p>Using Flutter’s <strong>CancellableOperations </strong>method, you can achieve cancellable asynchronous operations with dart’s async package.</p><p>Just add this in your pubspec.yaml:</p><pre>dependencies:<br>  flutter:<br>    sdk: flutter<br>  async: ^2.11.0</pre><p>This method provide a seamless way to implement cancellation mechanisms. Let&#39;s continue with our step-by-step guide on how to effectively implement cancellable asynchronous operations in your Flutter app, considering both Futures and streams:</p><h4>Using <strong>CancellableOperations </strong>for Futures:</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/81422411a38eb569663264e4d48fefa8/href">https://medium.com/media/81422411a38eb569663264e4d48fefa8/href</a></iframe><h4>For Streams:</h4><p>As for streams you do not need to use a completer or anything as the StreamSubscription class already provides this functionality.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a027ec998db49cbcdc0f32d0ef3b09d/href">https://medium.com/media/5a027ec998db49cbcdc0f32d0ef3b09d/href</a></iframe><h4>Advantages:</h4><ol><li><strong>Cancellable Asynchronous Operations:</strong> CancellableOperations provide a built-in solution for managing cancellable asynchronous tasks in Flutter. This is crucial for ensuring that long-running operations can be canceled if needed, preventing unresponsive UI or resource leaks.</li><li><strong>Efficient Resource Management:</strong> By using CancellableOperations, you can efficiently manage resources associated with asynchronous operations. This helps in preventing resource leaks and ensuring the application&#39;s performance and responsiveness.</li><li><strong>Improved User Experience:</strong> Implementing cancellable operations with CancellableOperations enhances the user experience by allowing users to interact with the application even during time-consuming tasks. Users can cancel operations when they choose, providing a more responsive and user-friendly application.</li></ol><h3>Conclusion</h3><p>CancellableOperations are a valuable feature in Flutter for managing cancellable asynchronous tasks. They contribute to a more user-friendly and responsive application by simplifying the implementation of cancellations and improving resource management. This built-in solution is a significant advantage for Flutter developers.</p><blockquote><em>That’s it for this article! I hope you enjoyed it and leave a few claps if you did. Follow me for more Flutter articles and comment for any feedback you might have about this article.</em></blockquote><blockquote><em>I‘m Ashish Sharma aka theFlutterist. You can find me on </em><a href="https://www.linkedin.com/in/ashishsharma-sde/"><em>LinkedIn</em></a><em> or maybe follow me on </em><a href="https://github.com/sharmaAshish-dev"><em>GitHub</em></a><em> as well.</em></blockquote><ul><li><a href="https://medium.com/nerd-for-tech/do-not-use-buildcontext-in-async-gaps-why-and-how-to-handle-flutter-context-correctly-870b924eb42e">Do Not Use BuildContext in Async Gaps: Why and How to Handle Flutter Context Correctly</a></li><li><a href="https://medium.com/nerd-for-tech/parallax-scroll-effect-in-flutter-elevate-your-apps-user-experience-11a71b08a914">Parallax Scroll Effect in Flutter: Elevate Your App’s User Experience</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d9ae0606920" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do Not Use BuildContext in Async Gaps: Why and How to Handle Flutter Context Correctly]]></title>
            <link>https://theflutterist.medium.com/do-not-use-buildcontext-in-async-gaps-why-and-how-to-handle-flutter-context-correctly-870b924eb42e?source=rss-3180399f276a------2</link>
            <guid isPermaLink="false">https://medium.com/p/870b924eb42e</guid>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[memory-management]]></category>
            <category><![CDATA[performance]]></category>
            <dc:creator><![CDATA[Ashish Sharma]]></dc:creator>
            <pubDate>Wed, 18 Oct 2023 10:28:27 GMT</pubDate>
            <atom:updated>2023-10-23T11:48:53.567Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post, we’ll look at a common yet often overlooked problem in Flutter app development: using BuildContext across async gaps. We will investigate the why and how of this key part of Flutter, highlighting the need of proper context handling in order to avoid potential errors and memory leaks. Understanding the fundamentals and best practices will help you traverse the difficulties of asynchronous programming in Flutter, ensuring that your app runs smoothly and quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y66B5pBPpPQaHM4lO17zbg.png" /></figure><h3>So, what does this mean?</h3><p>The warning “<strong>Do not use </strong><strong>BuildContext in async gaps</strong>&quot; is an important reminder for Flutter developers to avoid using BuildContext in asynchronous operations. In Flutter, BuildContext is a critical parameter used to access information about a widget&#39;s location in the widget tree and to perform tasks like navigating to other screens, showing dialogs, accessing theme data, and so on.</p><p>However, when developers pass BuildContext across async boundaries, such as within Future Methods, StreamBuilder, or isolates, it can lead to problems. This warning advises against doing so because it can result in unexpected and erroneous behaviors in your app.</p><p><strong>When </strong><strong>BuildContext is used in asynchronous gaps, it might refer to a widget that no longer exists</strong>, leading to issues like:</p><ol><li><strong>Stale Data</strong>: If a widget is rebuilt or disposed of while an asynchronous operation is ongoing, the BuildContext reference may point to an outdated or non-existent widget. This can lead to displaying incorrect or stale data in your app.</li><li><strong>Memory Leaks</strong>: Holding a reference to a BuildContext that should be disposed of can result in memory leaks, as the framework won&#39;t be able to garbage-collect resources associated with that widget.</li><li><strong>App Crashes</strong>: In some cases, using BuildContext in an asynchronous gap might even lead to app crashes if the referenced widget is disposed before the operation is completed.</li></ol><p>In essence, this warning encourages developers to think carefully about how they handle BuildContext in asynchronous operations, emphasizing the importance of understanding widget lifecycle management and avoiding common pitfalls that can impact the reliability and performance of their Flutter apps.</p><h3>But, what should I do now?</h3><h4><strong>Solution 1: Using a GlobalKey and Keyed Subtrees</strong></h4><p>To address the issue of not using BuildContext across async gaps, we can utilize GlobalKey and keyed subtrees. This approach ensures that the correct BuildContext is associated with asynchronous operations, even if the widget is disposed and rebuilt.</p><p>Here’s how you can implement this solution with an example:</p><h4><strong>Step 1: Create a GlobalKey</strong></h4><p>Start by creating a GlobalKey in your Widget State and attaching it to the widget that is the parent of your asynchronous operation. This ensures that the BuildContext retrieved from this GlobalKey is valid.</p><pre>final GlobalKey&lt;_MyWidgetState&gt; myWidgetKey = GlobalKey();</pre><h4><strong>Step 2: Retrieve the BuildContext</strong></h4><p>Within your asynchronous operation, you can retrieve the BuildContext using the GlobalKey.</p><pre>Future&lt;void&gt; fetchData() async {<br>  /// Getting the current context of the widget in the widget tree<br>  final context = myWidgetKey.currentContext;<br><br>  var result = await navigator.of(context).pushNamed(&#39;/user_selection_page&#39;);<br><br>  if (context != null &amp;&amp; context.mounted) {<br>    /// statements after async gap without warning<br>    Scaffold.of(context).showSnackBar(SnackBar(<br>      content: Text(result.name),<br>    ));<br>  }<br>}</pre><p>By following this approach, you ensure that the BuildContext remains valid during async operations, preventing issues related to stale or invalid contexts.</p><p><strong>Benefits:</strong></p><ul><li><strong>Reliable Context:</strong> Using GlobalKey guarantees that the associated BuildContext is always up-to-date and accurate.</li><li><strong>Predictable Behavior:</strong> The widget subtree remains correctly associated with its respective BuildContext even during asynchronous operations.</li><li><strong>Less Prone to Errors:</strong> This approach reduces the chances of errors and crashes due to stale BuildContext references.</li></ul><h3>However, there is another way that does the same thing…</h3><h4><strong>Solution 2: Using the “then” Method with Future</strong></h4><p>The “then” method is a straightforward approach to handling asynchronous operations that require the use of a valid BuildContext. It ensures that your code executes only after the asynchronous operation is completed successfully, thus providing access to the correct BuildContext. Here&#39;s how you can implement this solution with an example:</p><pre>Future&lt;void&gt; fetchData() async {<br>  await navigator.of(context).pushNamed(&#39;/user_selection_page&#39;)<br>  .then((result) {<br>    /// statements after async gap without warning<br>    Scaffold.of(context).showSnackBar(SnackBar(<br>      content: Text(result.name),<br>    ));<br>  });<br>}</pre><p><strong>Benefits:</strong></p><ul><li><strong>Consistent Context:</strong> Using “then” ensures that the code is executed within the same execution context as the asynchronous operation, providing access to a reliable BuildContext.</li><li><strong>Clear Flow:</strong> The code stays organized and intuitive, with the logic following a sequential pattern, making it easier to understand and maintain.</li></ul><p><strong>In case if you ever wanted to use BuildContext in async gaps but the warning is annoying you,</strong></p><p><strong>then add </strong><strong>use_build_context_synchronously rule under linter &gt; rules in your </strong><a href="https://dart.dev/tools/analysis"><strong>analysis_options.yaml</strong></a><strong> file:</strong></p><pre>linter:<br>  rules:<br>    - use_build_context_synchronously</pre><h3>Conclusion</h3><p>It is critical in Flutter development to have a clear and robust method to handle asynchronous actions to avoid issues caused by utilizing the incorrect BuildContext. The warning “Do not use BuildContext in async gaps” serves as a helpful reminder of the dangers.</p><p>Remember, adopting best practices like these will lead to more robust and organized code, ultimately resulting in better user experiences. So, take this valuable lesson and continue building Flutter apps that are both efficient and user-friendly.</p><blockquote><em>That’s it for this article! I hope you enjoyed it and leave a few claps if you did. Follow me for more Flutter articles and comment for any feedback you might have about this article.</em></blockquote><blockquote><em>I‘m Ashish Sharma aka theFlutterist. You can find me on </em><a href="https://www.linkedin.com/in/ashishsharma-sde/"><em>LinkedIn</em></a><em> or maybe follow me on </em><a href="https://github.com/sharmaAshish-dev"><em>GitHub</em></a><em> as well.</em></blockquote><h3>Checkout my other articles:</h3><ul><li><a href="https://theflutterist.medium.com/parallax-scroll-effect-in-flutter-elevate-your-apps-user-experience-11a71b08a914">Parallax Scroll Effect in Flutter: Elevate Your App’s User Experience</a></li><li><a href="https://blog.stackademic.com/debouncing-in-flutter-enhancing-user-experience-e330ea85f162">Debouncing in Flutter: Enhancing User Experience</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=870b924eb42e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parallax Scroll Effect in Flutter: Elevate Your App’s User Experience]]></title>
            <link>https://theflutterist.medium.com/parallax-scroll-effect-in-flutter-elevate-your-apps-user-experience-11a71b08a914?source=rss-3180399f276a------2</link>
            <guid isPermaLink="false">https://medium.com/p/11a71b08a914</guid>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[creativity]]></category>
            <category><![CDATA[parallax]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[Ashish Sharma]]></dc:creator>
            <pubDate>Wed, 11 Oct 2023 09:23:31 GMT</pubDate>
            <atom:updated>2023-10-23T11:48:30.068Z</atom:updated>
            <content:encoded><![CDATA[<p>Parallax scrolling is a technique that can creating an illusion of depth and movement in your flutter design, this effect can captivate users and make your app more engaging. In this post, we’ll delve into the world of parallax scroll effects in Flutter, learning how to implement them step by step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mKUpPhg3Nea8wiHOmKBCZQ.gif" /></figure><h3>Understanding the Parallax Effect</h3><p>Let’s start with the basics. Parallax scrolling is like that cool illusion where different objects seem to move at different speeds or in different directions. It adds depth and interactivity to your Flutter app, creating a visually engaging user experience.</p><p>Think of it as your app’s way of saying, “Hey, I’m not just any app; I’m the app that dances with your scroll.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*Hp7OuBtl8N26e3kJ790R-A.jpeg" /></figure><h3>Implementaion</h3><h4>1. Setting Up Your Flutter Environment</h4><p>Ensure you have a working Flutter project set up before you begin.</p><h4><strong>2. Create a List</strong></h4><p>In your Flutter app, you first need a list of items to display in your ListView. This can be a list of images, text, or any widget you want to apply the parallax effect to. For instance, if you’re creating a captivating image gallery, your list should contain images you want to scroll with that wow-factor.</p><p>Here’s a snippet of how you can create a simple list in Flutter:</p><pre>/// This is your screen where you want to display list<br>class HotelListScreen extends StatefulWidget {<br>  const HotelListScreen({super.key});<br><br>  @override<br>  State createState() =&gt; _HotelListScreenState();<br>}<br><br>class _HotelListScreenState extends State&lt;HotelListScreen&gt; {<br>  final hotelImages = [<br>      /// images&#39; path<br>    ];<br><br>  @override<br>    Widget build(BuildContext context) {<br>      return ListView.builder(<br>        itemBuilder: (context, index) =&gt; Padding(<br>          padding: const EdgeInsets.all(8.0),<br>          child: ParallaxImage(<br>            imagePath: hotelImages[index],<br>          ),<br>        ),<br>        itemCount: hotelImages.length,<br>      );<br>    }<br>}</pre><pre>/// This is the widget which will be used for that wow animation.<br>/// Feel free to customise it accordingly...<br>class ParallaxImage extends StatelessWidget {<br>  ParallaxImage({super.key, required this.imagePath});<br><br>  final GlobalKey _backgroundImageKey = GlobalKey();<br>  final String imagePath;<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return ClipRRect(<br>      // Create rounded corners for the image<br>      borderRadius: BorderRadius.circular(20.0), <br>      child: AspectRatio(<br>        // Define the aspect ratio for the image<br><br>        aspectRatio: 16 / 9, <br>        child: Flow(<br>          delegate: ParallaxFlowDelegate(<br>            /// Access the scrollable widget<br>            scrollable: Scrollable.of(context), <br>            <br>            // Context of the list item<br>            listItemContext: context, <br><br>            // Pass the background image key<br>            backgroundImageKey: _backgroundImageKey, <br>          ),<br>          // Apply anti-aliasing to the clipping<br>          clipBehavior: Clip.antiAlias, <br>          children: [<br>            Image.asset(<br>              imagePath,<br>              // Use the provided key for this image<br>              key: _backgroundImageKey,<br>              fit: BoxFit.cover, // Set the image to cover the available space<br>            ),<br>          ],<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KuPlTMBYHsQVhayKwgKpYA.png" /></figure><h4><strong>What is _backgroundImageKey?</strong></h4><p>The <strong>_backgroundImageKey</strong> is a <strong>GlobalKey</strong> used to uniquely identify and reference a widget within a widget tree. In this specific code, it is employed for several key purposes:</p><p>A. Identifying the Image Widget: The <strong>_backgroundImageKey</strong> is associated with the <strong>Image.asset</strong> widget that loads an image from the provided <strong>imagePath</strong>. By assigning the same key to this widget, it enables the <strong>ParallaxFlowDelegate</strong> to locate and reference this particular image.</p><p>B. Synchronization with <strong>ParallaxFlowDelegate</strong>: The <strong>ParallaxFlowDelegate</strong> widget within the Flow widget uses the <strong>_backgroundImageKey</strong> to paint the background image with the desired parallax effect. It inspects the image&#39;s position and uses this key to understand which image to manipulate.</p><h4>3. Create a Parallax Flow Delegate</h4><p>Experiment with different settings to achieve the desired parallax effect. Enhance the user experience without overwhelming it.</p><p>Below is a code for flow Delegate:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8eaf99c1df738c1eac8cde3778027dc2/href">https://medium.com/media/8eaf99c1df738c1eac8cde3778027dc2/href</a></iframe><h3>Conclusion:</h3><p>With the ParallaxImage widget, you&#39;ve entered the world of parallax scrolling in Flutter. Whether you&#39;re looking to add depth to images, create captivating headers, or simply enhance the user experience, parallax effects offer a dynamic way to engage your audience.</p><p>Flutter gives you the power to explore new dimensions in app design. The parallax effect is a delightful addition to your toolkit, and with some creativity, it can breathe life into your apps like never before. So go ahead, experiment with this technique, and turn your Flutter app into a parallax playground!</p><p>Let me know your thoughts and share your parallax creations. Happy Fluttering!</p><blockquote>That’s it for this article! I hope you enjoyed it and leave a few claps if you did. Follow me for more Flutter articles and comment for any feedback you might have about this article.</blockquote><h3>Checkout my other articles:</h3><ul><li><a href="https://blog.stackademic.com/debouncing-in-flutter-enhancing-user-experience-e330ea85f162">Debouncing in Flutter: Enhancing User Experience</a></li><li><a href="https://blog.stackademic.com/wireless-debugging-on-any-android-device-android-tips-81701131cd21">Wireless debugging on any android device: Android Tips.</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11a71b08a914" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wireless debugging on any android device: Android Tips.]]></title>
            <link>https://blog.stackademic.com/wireless-debugging-on-any-android-device-android-tips-81701131cd21?source=rss-3180399f276a------2</link>
            <guid isPermaLink="false">https://medium.com/p/81701131cd21</guid>
            <category><![CDATA[wireless-debugging]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[adb]]></category>
            <dc:creator><![CDATA[Ashish Sharma]]></dc:creator>
            <pubDate>Tue, 26 Sep 2023 07:25:11 GMT</pubDate>
            <atom:updated>2024-09-24T12:19:48.687Z</atom:updated>
            <content:encoded><![CDATA[<h3>Wireless Debugging on Any Android Device: Android Tips</h3><p>Android app development often involves debugging apps on physical devices, and connecting your smartphone to your development environment via USB is a common practice. But what if you could streamline this process and debug your apps wirelessly?</p><p>In this comprehensive guide, we’ll explore how to set up wireless debugging on any Android smartphone (Even if it’s Android 5.0), making your development workflow more convenient and efficient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6QIiPGx55Hx-VN7ajpDAQ.png" /></figure><p><a href="https://differ.blog/differ-ai">Introducing DifferAI</a></p><h4><strong>Step 1: Enable Developer Options</strong></h4><p>Before diving into wireless debugging, you need to enable Developer Options on your Android device.</p><blockquote><strong>This step can vary device to device.</strong></blockquote><h4>Step 2: Enable USB Debugging</h4><p>Inside Developer Options, find and enable “<strong>USB Debugging.</strong>” This is essential for wireless debugging to work, even though we won’t be using a USB connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*nWcgEdKgKns4B56MpS4QEA.png" /></figure><h4>Step 3: Connect to a Wi-Fi Network</h4><p>Connect your Android device and your development machine to the <strong>same Wi-Fi network</strong>. This ensures they can communicate with each other over the network.</p><h4>Step 4: Install ADB on Your Computer</h4><p>Make sure you have the Android Debug Bridge (ADB) installed on your computer. If you don’t have it, you can download it as part of the Android Studio package or as a standalone SDK tool.</p><blockquote>Make sure you have set the ADB path in your windows environment.</blockquote><p><strong>To set ADB path in your windows environment. follow this guide:</strong></p><p><a href="https://theflutterist.medium.com/setting-up-adb-path-on-windows-android-tips-5b5cdaa9084b">Setting up ADB Path on Windows: Android Tips.</a></p><h4>Step 5: Connect Wirelessly</h4><p>Now that your device is prepared, connect to it using USB <strong>(1st Time)</strong>:</p><ol><li>Open a terminal or command prompt on your computer and type.</li></ol><pre>adb tcpip 5555</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*bXUjtmXYbw1g5rdu1r5TaA.png" /><figcaption>This will open a port for ADB.</figcaption></figure><p>2. Next, Enter the following command to connect to your device:</p><pre>adb connect your-device-ip-address</pre><blockquote>Replace “your-device-ip-address” with your Android device’s IP address. (Which can be obtained from settings -&gt; About Phone -&gt; IPv4 Address)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*lL8o-jfS-H8nwQ-VyZWP5Q.png" /></figure><p>3. Now you can disconnect the device connected via USB and you’ll see that the device is still connected.</p><h4>Important Note:</h4><ol><li>If you restart your computer, then just follow <strong>Step 5 -&gt; ADB connect &lt;IP Address&gt;</strong></li><li>If your device is unable to connect by any reason then you need to reset the ADB server, Just use this command “<strong>ADB Kill-server” </strong>before <strong>Step 5.</strong></li><li>you can connect to multiple devices at the same time using this trick.</li><li>Data transfer speed depends on your device bandwidth.</li></ol><h3>Conclusion:</h3><p>Wireless debugging is a game-changer for Android app development, offering flexibility and convenience. With these simple steps, you can set up wireless debugging on any Android smartphone. making your development workflow smoother and more efficient. Say goodbye to USB cables and hello to a wireless debugging experience that enhances your productivity.</p><p>Have you tried wireless debugging on your Android device? Share your experiences and any additional tips in the comments below!</p><blockquote><em>That’s it for this article! I hope you enjoyed it and leave a few claps if you did. Follow me for more Flutter articles and comment for any feedback you might have about this article.</em></blockquote><h3>Checkout my other articles:</h3><ul><li><a href="https://theflutterist.medium.com/optimizing-imports-and-organizing-file-structure-in-flutter-73c08a5baf5e">Optimizing Imports and Organizing File Structure in Flutter</a></li><li><a href="https://theflutterist.medium.com/fluttering-your-way-to-beautiful-ui-part-1-a-beginners-guide-bc7a3a1d4a1a">Fluttering Your Way to Beautiful UI Part 1: A Beginner’s Guide</a></li></ul><h3>Stackademic 🎓</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a> | <a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a> | <a href="https://cofeed.app/"><strong>CoFeed</strong></a> | <a href="https://differ.blog/"><strong>Differ</strong></a></li><li>More content at <a href="https://stackademic.com/"><strong>Stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81701131cd21" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/wireless-debugging-on-any-android-device-android-tips-81701131cd21">Wireless debugging on any android device: Android Tips.</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up ADB Path on Windows: Android Tips.]]></title>
            <link>https://theflutterist.medium.com/setting-up-adb-path-on-windows-android-tips-5b5cdaa9084b?source=rss-3180399f276a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b5cdaa9084b</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[maximizing-productivity]]></category>
            <category><![CDATA[adb]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Ashish Sharma]]></dc:creator>
            <pubDate>Tue, 26 Sep 2023 06:58:59 GMT</pubDate>
            <atom:updated>2023-09-26T07:26:04.336Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>ADB (Android Debug Bridge)</strong> is a crucial tool for Android app developers, allowing you to communicate with Android devices from your computer. To use ADB effectively, you need to set up the ADB path in your Windows environment. Follow these step-by-step instructions to get started:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yF9h1meFvLCEQ8wNIqrRMQ.jpeg" /></figure><h4>Step 1: Download Android SDK Platform Tools</h4><ol><li>Open your web browser and visit the official Android SDK Platform Tools download page: <a href="https://developer.android.com/studio/releases/platform-tools"><strong>Android SDK Platform Tools</strong></a>.</li><li>Scroll down to find the “<strong>SDK Platform-Tools for Windows</strong>” section.</li><li>Click the “<strong>Download the Windows platform-tools</strong>” link to download the ZIP file containing ADB and other tools.</li></ol><h4>Step 2: Extract the ZIP File</h4><ol><li>Locate the downloaded ZIP file (e.g., “platform-tools_r32.0.0-windows.zip”) in your computer’s Downloads folder.</li><li>Right-click the ZIP file and select “Extract All.”</li><li>Choose a destination folder where you want to extract the files, and click “Extract.” This will create a folder containing the ADB and other tools.</li></ol><h4>Step 3: Copy the ADB Folder Path</h4><ol><li>Navigate to the folder where you extracted the contents of the ZIP file. This folder should contain the “adb.exe” file.</li><li>Click on the folder’s address bar at the top. It will display the full path to the folder.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*0jLgao2m2iXQ3kTSgwoRAA.png" /><figcaption>this folder should contain adb.exe</figcaption></figure><h4>Step 4: Add ADB Path to Environment Variables</h4><ol><li>Type “Environment Variables” in the Windows search bar and select “Edit the system environment variables.”</li><li>In the “System Properties” window, click the “Environment Variables” button at the bottom.</li></ol><h4>Step 5: Edit the “Path” Variable</h4><ol><li>In the “Environment Variables” window, under the “System variables” section, locate the “Path” variable, and select it.</li><li>Click the “Edit” button.</li></ol><h4>Step 6: Add ADB Path</h4><ol><li>In the “Edit Environment Variable” window, click the “New” button.</li><li>Paste the ADB folder path you copied earlier into the input field.</li><li>Click “OK” to close each of the windows.</li></ol><h4>Step 7: Verify ADB Installation</h4><ol><li>Open Command Prompt (cmd) or PowerShell.</li><li>Type “adb” and press Enter.</li><li>You should see ADB commands and options displayed, indicating that ADB is successfully installed and configured.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8JCm5Kq010R8zoe7ghgZUQ.png" /></figure><p><strong>Congratulations!</strong> You’ve successfully set up the ADB path in your Windows environment. You can now use ADB commands from the Command Prompt or PowerShell without specifying the full path to the ADB executable. This is essential for Android app development and debugging on your Windows machine.</p><h3>Conclusion</h3><p>Setting up the ADB path in your Windows environment is a crucial step for any Android app developer. It allows you to seamlessly communicate with Android devices from your computer, making app development and debugging much more efficient.</p><p>By following this step-by-step guide, you’ve learned how to download Android SDK Platform Tools, extract the necessary files, and add the ADB path to your system’s environment variables. This simple process ensures that you can use ADB commands directly from the Command Prompt or PowerShell without specifying the full path.</p><p>Now that you have ADB properly configured, you’re ready to take your Android app development to the next level. Whether you’re testing your apps on physical devices or virtual emulators, ADB will be your indispensable companion for debugging and interacting with Android devices. Happy coding!</p><blockquote><em>That’s it for this article! I hope you enjoyed it and leave a few claps if you did. Follow me for more Flutter articles and comment for any feedback you might have about this article.</em></blockquote><h3>What’s Next:</h3><ul><li><a href="https://theflutterist.medium.com/wireless-debugging-on-any-android-device-android-tips-81701131cd21">Wireless debugging on any android device: Android Tips.</a></li><li><a href="https://blog.stackademic.com/parallel-api-calls-boosting-flutter-app-performance-77ee1afbeec">Parallel API Calls: Boosting Flutter App Performance</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b5cdaa9084b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>