<?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 Mariganesh on Medium]]></title>
        <description><![CDATA[Stories by Mariganesh on Medium]]></description>
        <link>https://medium.com/@mariganesh?source=rss-b2041a901344------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*09TZQPDpWAzl2EFG-nVHAw.jpeg</url>
            <title>Stories by Mariganesh on Medium</title>
            <link>https://medium.com/@mariganesh?source=rss-b2041a901344------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 19:49:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mariganesh/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[Mastering Flutter Navigation with GetX Binding— A Complete Guide]]></title>
            <link>https://medium.com/@mariganesh/mastering-flutter-navigation-with-getx-binding-a-complete-guide-4a33c8edc565?source=rss-b2041a901344------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a33c8edc565</guid>
            <category><![CDATA[getx-state-management]]></category>
            <category><![CDATA[flutter-getx]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-navigation]]></category>
            <category><![CDATA[binding]]></category>
            <dc:creator><![CDATA[Mariganesh]]></dc:creator>
            <pubDate>Thu, 04 Apr 2024 18:52:34 GMT</pubDate>
            <atom:updated>2024-04-04T18:52:34.225Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog post, we’ll explore how to leverage the GetX package for efficient and powerful navigation management in Flutter applications. GetX is a state management library that provides a simple and intuitive way to handle navigation, among other features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_d8rwdJ3VJr94MMishhQ5Q.png" /></figure><h3>Introduction to GetX</h3><p>First, we’ll provide an overview of the GetX package and its benefits compared to other navigation solutions in Flutter. GetX offers a lightweight and highly performant alternative to the built-in Navigator widget, with features such as route management, dependency injection, and more.</p><h4>Step 1: Install GetX Package</h4><pre>dependencies:<br>  flutter:<br>    sdk: flutter<br>  get: ^4.6.6</pre><h3>Understanding Routing in GetX</h3><p>We’ll dive into the routing mechanism provided by GetX and explain how routes are defined, managed, and accessed within a Flutter application. GetX offers a declarative approach to defining routes, making it easy to create and navigate between different screens.</p><p>Define your routes using GetX’s GetMaterialApp widget instead of Flutter&#39;s MaterialApp. This provides access to GetX&#39;s routing features.</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:get/get.dart&#39;;<br>import &#39;package:my_app/screens/home_screen.dart&#39;;<br>import &#39;package:my_app/screens/detail_screen.dart&#39;;<br><br>void main() {<br>  runApp(MyApp());<br>}<br><br>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return GetMaterialApp(<br>      title: &#39;My App&#39;,<br>      initialRoute: &#39;/&#39;,<br>      getPages: [<br>        GetPage(name: &#39;/&#39;, page: () =&gt; HomeScreen()),<br>        GetPage(name: &#39;/detail&#39;, page: () =&gt; DetailScreen()),<br>      ],<br>    );<br>  }<br>}</pre><h3>Exploring Route Bindings</h3><p>One of the key concepts in GetX is route bindings, which allow us to inject dependencies into our routes and manage their lifecycle. We’ll discuss how route bindings work, why they’re useful, and how to use them effectively in our Flutter applications.</p><p>Using bindings in Flutter, particularly with packages like GetX, can greatly improve the organisation, performance, and maintainability of your codebase. Here’s why using bindings is beneficial:</p><h4>1. Separation of Concerns:</h4><p>Bindings help separate the concerns of dependency injection from the UI layer. Instead of directly initialising controllers or services in widgets, you define bindings to handle dependency injection. This promotes a cleaner and more modular code structure.</p><h4>2. Dependency Injection:</h4><p>Bindings facilitate dependency injection, allowing you to inject dependencies into your screens, controllers, or other components. This promotes loose coupling and makes it easier to replace or mock dependencies for testing purposes.</p><h4>3. Performance Optimisation:</h4><p>Using bindings with lazy loading can help optimize performance by deferring the initialisation of dependencies until they are actually needed. This can reduce startup time and memory usage, especially in larger applications with many dependencies.</p><pre>import &#39;package:get/get.dart&#39;;<br>import &#39;package:my_app/controllers/detail_controller.dart&#39;;<br><br>class DetailBinding implements Bindings {<br>  @override<br>  void dependencies() {<br>    Get.lazyPut(() =&gt; DetailController());<br>  }<br>}</pre><p>Lazy Initialisation: Dependencies are lazily initialised using GetX’s Get.lazyPut() method. This means that dependencies are only created when they are first accessed, reducing memory usage and startup time.</p><p>Bind the binding class to a route:</p><pre>import &#39;package:get/get.dart&#39;;<br>import &#39;package:my_app/screens/detail_screen.dart&#39;;<br>import &#39;package:my_app/bindings/detail_binding.dart&#39;;<br><br>void main() {<br>  runApp(MyApp());<br>}<br><br>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return GetMaterialApp(<br>      title: &#39;My App&#39;,<br>      initialRoute: &#39;/&#39;,<br>      getPages: [<br>        GetPage(name: &#39;/&#39;, page: () =&gt; HomeScreen()),<br>        GetPage(<br>          name: &#39;/detail&#39;,<br>          page: () =&gt; DetailScreen(),<br>          binding: DetailBinding(),<br>        ),<br>      ],<br>    );<br>  }<br>}</pre><p>Access dependencies in the screen using Get.find():</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:get/get.dart&#39;;<br>import &#39;package:my_app/controllers/detail_controller.dart&#39;;<br><br>class DetailScreen extends StatelessWidget {<br>  final DetailController _controller = Get.find&lt;DetailController&gt;();<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      appBar: AppBar(title: Text(&#39;Detail&#39;)),<br>      body: Center(<br>        child: Text(&#39;Value from Controller: ${_controller.someValue}&#39;),<br>      ),<br>    );<br>  }<br>}</pre><p>In your screen or controller, you can access dependencies using GetX’s Get.find() method. This retrieves the instance of the dependency from the GetX dependency injection container.</p><p>GetX takes care of managing the lifecycle of dependencies, ensuring that they are disposed of properly when they are no longer needed. This helps prevent memory leaks and ensures efficient resource management.</p><h3>Navigate to a Route</h3><p>Use Get.toNamed() to navigate to a named route:</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:get/get.dart&#39;;<br><br>class HomeScreen extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      appBar: AppBar(title: Text(&#39;Home&#39;)),<br>      body: Center(<br>        child: ElevatedButton(<br>          onPressed: () {<br>            Get.toNamed(&#39;/detail&#39;);<br>          },<br>          child: Text(&#39;Go to Detail Screen&#39;),<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><h3>Passing Arguments</h3><p>Passing arguments between screens is straightforward. You can pass arguments when navigating between screens using the arguments parameter in the Get.to() or Get.off() methods. Here&#39;s how you can do it:</p><pre>Get.to(<br>  DetailScreen(),<br>  arguments: {<br>    &#39;id&#39;: 123,<br>    &#39;name&#39;: &#39;John Doe&#39;,<br>  },<br>);</pre><h3>Receive Arguments in the Destination Screen</h3><pre>class DetailScreen extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    final args = Get.arguments; // Get the arguments passed from the previous screen<br>    final id = args[&#39;id&#39;];<br>    final name = args[&#39;name&#39;];<br><br>    return Scaffold(<br>      appBar: AppBar(title: Text(&#39;Detail&#39;)),<br>      body: Center(<br>        child: Text(&#39;ID: $id, Name: $name&#39;),<br>      ),<br>    );<br>  }<br>}</pre><p>In the DetailScreen, we use Get.arguments to retrieve the arguments passed from the previous screen.</p><p>By following this pattern, bindings in GetX provide a clean and efficient way to manage dependencies in Flutter applications. They promote separation of concerns, facilitate dependency injection, and help ensure that your codebase remains organised, testable, and scalable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a33c8edc565" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AES and RSA Encryption in Flutter: A Comprehensive Guide]]></title>
            <link>https://medium.com/@mariganesh/aes-and-rsa-encryption-in-flutter-a-comprehensive-guide-9f4d5bce6733?source=rss-b2041a901344------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f4d5bce6733</guid>
            <category><![CDATA[flutter-mobile-app]]></category>
            <category><![CDATA[mobileapplicationsecurity]]></category>
            <category><![CDATA[decryption]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[banking-apps]]></category>
            <dc:creator><![CDATA[Mariganesh]]></dc:creator>
            <pubDate>Sat, 23 Dec 2023 09:01:37 GMT</pubDate>
            <atom:updated>2023-12-23T10:28:12.410Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CCqngvDkFtnxLTwN9iI23g.png" /></figure><p>Encryption is a crucial aspect of data security in modern mobile applications. In this blog post, we will explore two widely used encryption algorithms, AES (Advanced Encryption Standard) and RSA (Rivest-Shamir-Adleman), and how to implement them in a Flutter application.</p><h3>AES Encryption</h3><p>AES is a symmetric encryption algorithm that is widely adopted as the standard encryption algorithm by the U.S. government. It is known for its efficiency and security. AES operates on fixed-size blocks of data and uses a secret key to perform both encryption and decryption.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*PTUWHWuIXVomP2_gcIhqDg.jpeg" /></figure><p>To use AES encryption in a Flutter application, we can use the <a href="https://pub.dev/packages/encrypt">encrypt</a> package provided by the Flutter team. This package provides various cryptographic operations, including AES encryption and decryption.</p><p>First, add the encrypt package as a dependency in your pubspec.yaml file:</p><pre>dependencies:  encrypt: ^5.0.3</pre><p>Then, import the necessary classes in your Dart file:</p><pre>import &#39;package:encrypt/encrypt.dart&#39; as encrypt;<br>import &#39;dart:convert&#39;;</pre><p>To perform the encryption we can have the separate utils class.</p><pre>class EncryptionUtils {<br>static late encrypt.IV iv;<br>late String aesEncryptionKey;<br>static late encrypt.Encrypter encrypter;<br>}</pre><pre>EncryptionUtils._() {<br> <br>aesEncryptionKey = getRandomString(length: 16, isNumeric: false);<br>iv = encrypt.IV.fromUtf8(aesEncryptionKey);<br>encrypter = Encrypter(AES(Key.fromUtf8(aesEncryptionKey), mode: AESMode.ctr, padding: null));<br>}<br>}</pre><p>Make sure to replace the aesEncryptionKey parameter with the secret key you want to use for encryption and decryption.</p><p>To encrypt a string using AES, you can use the following code snippet:</p><pre>String encryptAES(String text) =&gt; encrypter.encrypt(text, iv: iv).base64;</pre><p>To decrypt the encrypted string, you can use the following code:</p><pre>String decryptAES(String encrypted) {<br>    final Uint8List encryptedBytesWithSalt = base64.decode(encrypted);<br>    final Uint8List encryptedBytes = encryptedBytesWithSalt.sublist(<br>      0,<br>      encryptedBytesWithSalt.length,<br>    );<br>    final String decrypted =<br>        encrypter.decrypt64(base64.encode(encryptedBytes), iv: iv);<br>    return decrypted;<br>  }</pre><h3>RSA Encryption</h3><p>RSA is an asymmetric encryption algorithm that is widely used for securing sensitive data transmission. It uses a public key for encryption and a private key for decryption. RSA is particularly suitable for scenarios where two parties need to communicate securely without having a shared secret key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*62jXEUT5P3URYu-tvaWLcg.png" /></figure><p>To use RSA encryption in a Flutter application, we can use the <a href="https://pub.dev/packages/fast_rsa">fast_rsa</a> package, which provides various cryptographic algorithms, including RSA.</p><p>First, add the fast_rsa package as a dependency in your pubspec.yaml file:</p><pre>dependencies:  fast_rsa: ^3.6.1</pre><p>Then, import the necessary classes in your Dart file:</p><pre>import &#39;package:fast_rsa/fast_rsa.dart&#39; as fastRsa;</pre><p>To encrypt a string using RSA, you can use the following code snippet:</p><pre>Future&lt;String&gt; encryptRSA({required payload}) async =&gt; await fastRsa.RSA<br>      .encryptOAEP(payload, &#39;&#39;, fastRsa.Hash.SHA256, publicKey);</pre><p>OAEP (Optimal Asymmetric Encryption Padding) is a cryptographic padding scheme used in RSA encryption to enhance the security and prevent certain vulnerabilities.</p><p>To decrypt the encrypted string, you can use the following code:</p><pre>Future&lt;String&gt; decryptRSA({required payload}) async =&gt; await fastRsa.RSA<br>  .decryptOAEP(payload, &#39;&#39;, fastRsa.Hash.SHA256, privateKey)</pre><p>Make sure to generate the RSA key pair (public and private keys) using a trusted tool or library and provide the respective key in the encryption and decryption functions.</p><h3>Conclusion</h3><p>Implementing AES and RSA encryption in your Flutter application is essential for securing sensitive data transmission. In this blog post, we explored the usage of AES and RSA encryption algorithms using the encrypt and fast_rsa packages, respectively. By following the outlined code snippets, you can effectively encrypt and decrypt data in your Flutter application. Remember to always handle and store your encryption keys securely.</p><p>Feel free to explore more cryptographic algorithms and experiment with various encryption techniques to enhance the security of your Flutter application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f4d5bce6733" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>