<?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 Danish khan on Medium]]></title>
        <description><![CDATA[Stories by Danish khan on Medium]]></description>
        <link>https://medium.com/@da-nish?source=rss-98dbe4b370------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WwS-5Vd0efmqma5AY7zK_w.jpeg</url>
            <title>Stories by Danish khan on Medium</title>
            <link>https://medium.com/@da-nish?source=rss-98dbe4b370------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 08:32:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@da-nish/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 Face ID in Android — Why It Doesn’t Work on Many Devices]]></title>
            <link>https://medium.com/@da-nish/flutter-face-id-in-android-why-it-doesnt-work-on-many-devices-5282d27a0b7a?source=rss-98dbe4b370------2</link>
            <guid isPermaLink="false">https://medium.com/p/5282d27a0b7a</guid>
            <category><![CDATA[face-id]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Danish khan]]></dc:creator>
            <pubDate>Wed, 20 May 2026 12:28:31 GMT</pubDate>
            <atom:updated>2026-05-20T12:28:31.995Z</atom:updated>
            <content:encoded><![CDATA[<p>When implementing biometric authentication in Flutter using packages like <a href="https://pub.dev/packages/local_auth?utm_source=chatgpt.com">local_auth</a>, many developers notice something confusing:</p><p>Face ID works perfectly on iPhones</p><p>But on Android, even if the device supports face unlock, the app still asks for:</p><ul><li>Fingerprint</li><li>PIN</li><li>Pattern</li><li>Password</li></ul><p>Meanwhile, Android itself uses face unlock to unlock the phone.</p><p>So why doesn’t Flutter Face ID work properly on Android?</p><p>The answer is:</p><blockquote><em>It depends on how secure the Android device’s face recognition system is.</em></blockquote><h3>Why Face ID Works Differently on Android</h3><p>On iOS, Apple controls both hardware and software.</p><p>All modern iPhones use a secure Face ID system with:</p><ul><li>Infrared sensors</li><li>Depth mapping</li><li>Dot projection</li><li>Dedicated security hardware</li></ul><p>Because of this, iOS fully trusts Face ID for app authentication, banking apps, payments, and password managers.</p><p>Android is different.</p><p>Every Android manufacturer implements face unlock differently. Some devices use advanced biometric hardware, while many others only use the front camera.</p><p>That creates security differences.</p><h3>Android Checks Biometric Security Level</h3><p>Android does not simply check:</p><blockquote><em>“Does this phone have face unlock?”</em></blockquote><p>Instead, Android checks:</p><blockquote><em>“Is this biometric method secure enough for authentication?”</em></blockquote><p>This is why many Android devices reject face authentication for apps even though users can unlock the phone using their face.</p><h3>Android Face Unlock Security Levels</h3><p>Android classifies biometric authentication into different security levels.</p><h3>1. Convenience (Low Security)</h3><p>This is the most common type on budget and mid-range Android phones.</p><p>It usually uses only the front camera.</p><h4>Characteristics</h4><ul><li>Fast</li><li>Easy to use</li><li>Less secure</li><li>Can sometimes be fooled using photos or videos</li></ul><h4>Usage</h4><p>Mostly allowed only for unlocking the phone.</p><p>Apps usually cannot trust this method for secure authentication.</p><h3>2. Weak (Medium Security)</h3><p>This is better than basic camera-based face unlock.</p><h4>Characteristics</h4><ul><li>More difficult to trick</li><li>Improved face detection</li><li>Some app authentication support</li></ul><h4>Usage</h4><p>Can work for certain apps, but Android may still reject it for highly secure operations.</p><h3>3. Strong (High Security)</h3><p>This is the closest Android equivalent to Apple Face ID.</p><p>These systems use dedicated biometric hardware such as:</p><ul><li>IR camera</li><li>Depth sensors</li><li>Dot projector</li><li>Secure hardware processing</li></ul><h4>Usage</h4><p>Can safely be used for:</p><ul><li>Banking apps</li><li>Password managers</li><li>Payments</li><li>Secure authentication</li></ul><p>Very few Android phones support this level.</p><h3>Devices That Support Strong Face Authentication</h3><p>Some premium Android devices provide secure face authentication.</p><p>Examples include:</p><ul><li><strong>Google Pixel 4</strong></li><li><strong>Some flagship Samsung devices</strong></li></ul><p>These devices include advanced biometric hardware, so Android allows apps to use face authentication securely.</p><h3>Why Flutter local_auth Falls Back to Fingerprint or PIN</h3><p>Flutter packages like <a href="https://pub.dev/packages/local_auth?utm_source=chatgpt.com">local_auth</a> rely on Android’s official biometric APIs.</p><p>The package does not directly decide whether Face ID is allowed.</p><p>Android itself decides which authentication methods are trusted.</p><p>So if the device’s face unlock is classified as:</p><ul><li>Convenience</li><li>Weak</li></ul><p>Android may ignore face authentication and instead ask for:</p><ul><li>Fingerprint</li><li>Device PIN</li><li>Pattern</li><li>Password</li></ul><p>This behavior is expected and correct from Android’s security perspective.</p><h3>Why iPhone Face ID Always Works</h3><p>Apple Face ID is standardized across supported devices.</p><p>Since Apple guarantees the security level, apps can safely use Face ID authentication everywhere.</p><p>That’s why Flutter biometric authentication behaves consistently on iOS.</p><h3>Important Thing Flutter Developers Should Know</h3><p>If Face ID does not appear on Android:</p><p>❌ It is NOT a Flutter issue<br> ❌ It is NOT a local_auth bug</p><p>It is usually because the Android device does not expose face authentication as a strong biometric method.</p><p>Your Flutter app can only use biometric methods trusted by Android.</p><h3>Final Thoughts</h3><p>Biometric authentication on Android is fragmented because every manufacturer implements it differently.</p><p>Even if a phone supports face unlock for unlocking the device, Android may still block apps from using it for secure authentication.</p><p>That is why:</p><ul><li>iPhone Face ID works consistently</li><li>Android Face ID support depends on device security hardware</li></ul><p>When using Flutter biometric authentication, always remember:</p><blockquote><em>Face unlock availability does not mean secure biometric support availability.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5282d27a0b7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Factory Constructors in Object-Oriented Programming]]></title>
            <link>https://medium.com/@da-nish/exploring-factory-constructors-in-object-oriented-programming-d825a3c86132?source=rss-98dbe4b370------2</link>
            <guid isPermaLink="false">https://medium.com/p/d825a3c86132</guid>
            <category><![CDATA[factory-construction]]></category>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[object-oriented]]></category>
            <category><![CDATA[dart]]></category>
            <dc:creator><![CDATA[Danish khan]]></dc:creator>
            <pubDate>Sun, 21 May 2023 12:57:59 GMT</pubDate>
            <atom:updated>2023-05-21T12:57:59.438Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*VHBQWecI007dDd594bnkRA.png" /><figcaption>Factory Constructor</figcaption></figure><p><strong>Introduction:</strong><br>In object-oriented programming, constructors play a crucial role in creating instances of classes. However, there are scenarios where a standard constructor may not be sufficient. This is where factory constructors come into play. In this article, we will delve into the concept of factory constructors and explore their various use cases.</p><p><strong>Understanding Factory Constructors:</strong><br>A factory constructor is a special type of constructor that allows for non-standard object creation. Unlike regular constructors, factory constructors have the flexibility to determine whether to create a new instance, return an existing instance from a cache, or even return an instance of a subclass. The “factory” keyword is used to implement these constructors, enabling the use of the “return” statement.</p><h3>Use Cases for Factory Constructors:</h3><ol><li><strong>Returning Existing Instances:</strong><br>A common use case for factory constructors is when creating expensive objects. Instead of creating a new instance every time, a factory constructor can return an existing instance from a cache. This approach promotes reusability and can significantly improve performance.</li><li><strong>Implementing the Singleton Pattern:</strong><br>Factory constructors are useful when implementing the singleton pattern, which ensures that only one instance of a class is created throughout the application’s lifecycle. By returning the same instance every time the factory constructor is invoked, we can enforce the singleton behavior.</li><li><strong>Returning Subclass Instances:</strong><br>Factory constructors provide the flexibility to return instances of subclasses instead of the class itself. This allows for dynamic decision-making during object creation. Depending on runtime conditions or parameters, the factory constructor can determine the appropriate subclass to instantiate and return.</li></ol><h3><strong>Benefits of Using Factory Constructors:</strong></h3><p>Utilizing factory constructors offers several benefits:</p><ul><li><strong>Improved Performance:</strong><br>By returning existing instances from a cache, factory constructors eliminate the overhead of repetitive object creation. This optimization leads to improved performance and reduced resource consumption.</li><li><strong>Simplified Object Management:</strong><br>Factory constructors centralize control over object creation, facilitating better management and coordination of object instances. This is particularly useful in scenarios involving caching or the singleton pattern.</li><li><strong>Enhanced Flexibility:</strong><br>Factory constructors enable dynamic decision-making during object creation. This flexibility allows developers to determine the specific type of object to instantiate based on runtime conditions or parameters.</li></ul><p><strong>Conclusion:</strong><br>Factory constructors are a powerful feature in object-oriented programming languages that provide flexibility and control over object creation. By utilizing factory constructors, developers can optimize performance, effectively manage object instances, and make dynamic decisions during object creation. Understanding and utilizing factory constructors can greatly enhance the design and implementation of software systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d825a3c86132" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter get custom parameters from Playstore and test locally]]></title>
            <link>https://medium.com/@da-nish/flutter-get-custom-parameters-from-playstore-and-test-locally-909b40e1874?source=rss-98dbe4b370------2</link>
            <guid isPermaLink="false">https://medium.com/p/909b40e1874</guid>
            <category><![CDATA[google-play]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[referrals]]></category>
            <dc:creator><![CDATA[Danish khan]]></dc:creator>
            <pubDate>Sun, 26 Mar 2023 14:51:57 GMT</pubDate>
            <atom:updated>2023-03-26T14:51:57.832Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8SlAgD9XUJDo_u-XeYvLiQ.jpeg" /><figcaption>PlayStore referrer</figcaption></figure><p>Custom parameters allow you to track and analyze the effectiveness of your referral campaigns. You can use them to identify which users are driving the most traffic to your app, which referral channels are performing the best, and which incentives are the most effective at driving downloads.</p><p>To get started with custom parameters in your playstore referral links, simply add the relevant parameters to your URL. These might include information like the user’s ID, the referral source, or the incentive being offered. By using custom parameters, you can take your referral marketing efforts to the next level and drive even more downloads and installs for your app.</p><p>step 1. Install pub dependency</p><pre>dependencies:<br>  android_play_install_referrer: ^0.2.1</pre><p>step 2. Get referral details</p><pre>Future&lt;List&lt;String&gt;&gt; initReferrerDetails() <strong>async</strong> {<br>    String referrerDetailsString;<br>    <strong>try</strong> {<br>      ReferrerDetails referrerDetails = <strong>await</strong> AndroidPlayInstallReferrer.installReferrer;</pre><pre><br>      referrerDetailsString = referrerDetails.toString();<br>    } <strong>catch</strong> (e) {<br>      referrerDetailsString = &#39;Failed to get referrer details: $e&#39;;<br>    }<br><br>   <br>  }</pre><p>step 3. Create referral link</p><p>In order to add custom parameters to your playstore referral links, you’ll need to modify the URL that you’re using for your referral campaign.</p><blockquote>To pass multiple parameters <br>replace = (symbol) with %3D<br>replace &amp; (symbol) with %26</blockquote><p><strong>Link:</strong></p><p>https://play.google.com/store/apps/details?id=&lt;package.name&gt;&amp;referrer=custom1=9999</p><p><strong>Link after replacing symbol with code.</strong></p><p><a href="https://play.google.com/store/apps/details?id=">https://play.google.com/store/apps/details?id=</a>&lt;package.name&gt;&amp;referrer=custom1%3D9999%26custom2%3D8888</p><p>Now send this link yourself on Gmail or anywhere, So you can access the link from your mobile device.</p><p>step 4. Create apk file</p><pre>&gt;flutter build apk lib/main.dart</pre><p>step 4. <strong>How to test playstore custom parameters in flutter</strong><br>open the device(real or emulator) uninstall the app if already installed<br>click on the link you created in step 3, and it will redirect to the PlayStore.<br>you don’t need to install it from the play store just stay on the screen and then open the terminal(adb commands should be working)</p><ul><li>Your device name should be displayed on your IDE</li><li>Run the below command to install apk</li><li>After installation play store install green button will convert into an open button, then open the app from playstore</li></ul><pre>&gt;adb install -r full/path/of/app.apk</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*8JtNYFcodzriPBSCVW1Xow.png" /></figure><p>Now you will be able to access playstore parameters from the dart code.</p><p>By using custom parameters in your playstore referral links, you can get a much more detailed view of how your referral marketing efforts are performing. With this information, you can optimize your campaigns for maximum impact and drive even more downloads and installs for your app.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=909b40e1874" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter ProxyProvider in sample way]]></title>
            <link>https://medium.com/@da-nish/flutter-proxyprovider-in-sample-way-4c7cfe641137?source=rss-98dbe4b370------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c7cfe641137</guid>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[provider]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Danish khan]]></dc:creator>
            <pubDate>Sun, 26 Mar 2023 09:09:13 GMT</pubDate>
            <atom:updated>2023-03-26T09:09:13.738Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*BB5RUGkREBcZnfh7VIhP-w.png" /><figcaption>Flutter Provider — ProxyProvider</figcaption></figure><p>The ProxyProvider is a powerful tool that can be used to combine data from multiple providers in order to create a new object. This can be incredibly useful in situations where you need to access data from multiple sources and combine it in a meaningful way.</p><p>For example, let’s say you have two providers: one that provides user data, and another that provides user history data. In order to display the user’s history, you would need a user object in the user history provider, both of these providers will help to display data. This is where the ProxyProvider comes in. where one provider is dependent on another provider.</p><p>By using the ProxyProvider, you can inject the changed value from one provider into another provider. This allows you to create a new object that contains all of the data you need in order to display the latest information. By doing this, you can save time and effort, and ensure that your code is clean and efficient.</p><p>Code Example</p><pre>//User Provider<br>class User with ChangeNotifier {<br>  Person({required this.name, required this.userId});<br><br>  final String name;<br>  int userId;<br><br>  void changeUserId(int id) {<br>    this.userId=id;<br>    notifyListeners();<br>  }<br>}<br>//UserHistory Provider<br>class UserHistory with ChangeNotifier {<br>  UserHistory(this.user);<br><br>  final User user;<br>  List&lt;String&gt; get title {<br>    return getUserHistory(user.userId);<br>  }<br>}<br><br><br>//ProxyProvider Code<br>MultiProvider(<br>      providers: [<br>        ChangeNotifierProvider&lt;User&gt;(<br>            create: (_) =&gt; User(name: &#39;Name&#39;, userId: 24)),<br>        ChangeNotifierProxyProvider&lt;User, UserHistory&gt;(<br>          create: (BuildContext context) =&gt;<br>              UserHistory(Provider.of&lt;User&gt;(context, listen: false)),<br>          update: (BuildContext context, User user, UserHistory? job) =&gt;<br>              UserHistory(user),<br>        ),<br>      ],<br>      child: MyApp(),</pre><p>In the above code, we have defined a User provider with name and userId. and there is another UserHistory provider which is dependent on the User provider. Assume UserHistory will display the user’s history according to User.userId field, whenever the User provider changes the userId from 24 to 26 then the UserHistory provider updates itself and display the user’s history according to the new userId(26).</p><p>Furthermore, the ProxyProvider is a flexible tool that can be used in a variety of different ways. Whether you are working on a small project or a large application, the ProxyProvider can help you to simplify your code and ensure that your data is organized and accessible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c7cfe641137" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dependency Injector in flutter using GetX]]></title>
            <link>https://medium.com/@da-nish/dependency-injector-in-flutter-using-getx-fc7ca229402?source=rss-98dbe4b370------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc7ca229402</guid>
            <category><![CDATA[context]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[getx]]></category>
            <category><![CDATA[dependency-injection]]></category>
            <dc:creator><![CDATA[Danish khan]]></dc:creator>
            <pubDate>Wed, 15 Sep 2021 10:45:03 GMT</pubDate>
            <atom:updated>2021-09-26T18:49:34.819Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sI10vKjJYQHtTKoWQalPLg.png" /><figcaption>Dependency injector flutter</figcaption></figure><h3>Dependency injector</h3><p>Dependency injector, means passing required objects where is the need. It makes developer work much easier. we can pass a reference to any widget or class, it does not pass new object of class each time, rather it pass reference only, means same object can be used in many widgets. We can pass any number of methods, variable and object using dependency injector.</p><blockquote>we use put() method and find() method for setting and getting dependency</blockquote><p>This post is about <a href="https://pub.dev/packages/get">Getx</a>, all the given codes will work with GetX only. Other option like <strong>provider</strong> you can use, but the problem is, it always need <strong>context object</strong>. so you will face difficulty for getting <strong>dependencies in model view</strong> classes.</p><h4>How to Add Dependency</h4><p>Once we put the object then we can use that object in any widget.</p><pre>final homeController = Get.put(ServiceController());</pre><h4>How to Get Dependency</h4><p>To get the object, we just need to give same reference/generic type with <strong>find()</strong> method.</p><pre>final controller = Get.find&lt;ServiceController&gt;();</pre><p><strong>EXAMPLE -</strong></p><ol><li>Use GetMaterialApp instead MaterialApp</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c97bd8e3923771636c261685ebfb2af/href">https://medium.com/media/3c97bd8e3923771636c261685ebfb2af/href</a></iframe><p>2. Add/Put Dependency</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5c087b6fc22c3bbd5eea23fc91b0be5c/href">https://medium.com/media/5c087b6fc22c3bbd5eea23fc91b0be5c/href</a></iframe><p>3. Get/Find dependency and use</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6525ff11003419890fb99c5de94f03ba/href">https://medium.com/media/6525ff11003419890fb99c5de94f03ba/href</a></iframe><h4>Using Binding</h4><p>It is another way to add dependency in <strong>GetX</strong>. when we have to add <strong>multiple dependencies</strong> or want to maintain in separate file we should use this way.</p><p>we create separate binding file and we put all dependencies inside the binding file and we can find that dependency in widget or any other file.</p><p><strong>EXAMPLE -</strong></p><ol><li>To use we have to pass binding object in route :</li></ol><pre>GetPage(<br>   name: &#39;name&#39;,<br>   page: () =&gt; Screen(),<br>   binding: ServiceBinding() //need to pass<br>)</pre><p>Binding object called first and add dependencies and then widget will create and we can use dependencies inside widget which were defined in binding file. And we can also use dependencies in any view model class.</p><p>2. Create binding file, Add/Put Dependency</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6ca4c3fe54d81d698429755ae706a46/href">https://medium.com/media/c6ca4c3fe54d81d698429755ae706a46/href</a></iframe><p>3. Get/Find dependency and use.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6525ff11003419890fb99c5de94f03ba/href">https://medium.com/media/6525ff11003419890fb99c5de94f03ba/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc7ca229402" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>