<?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 Ganesh L G on Medium]]></title>
        <description><![CDATA[Stories by Ganesh L G on Medium]]></description>
        <link>https://medium.com/@ganeshlg?source=rss-deac55377474------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*yLBNDPnz09NmCBzW</url>
            <title>Stories by Ganesh L G on Medium</title>
            <link>https://medium.com/@ganeshlg?source=rss-deac55377474------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 22:15:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ganeshlg/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[Agent vs Inline Suggestions: The Workflow That Changed My Vibe Coding]]></title>
            <link>https://ganeshlg.medium.com/agent-vs-inline-suggestions-the-workflow-that-changed-my-vibe-coding-66260b0c2893?source=rss-deac55377474------2</link>
            <guid isPermaLink="false">https://medium.com/p/66260b0c2893</guid>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[vibe-coding-guide]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[efficient-working]]></category>
            <dc:creator><![CDATA[Ganesh L G]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 07:21:34 GMT</pubDate>
            <atom:updated>2026-07-02T07:21:34.312Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z6r3YPFGVo2eeRtq_7l2Ow.png" /></figure><p>Recently, I started a small side project to test how capable AI-assisted development has become. I chose GitHub Copilot and decided to rely on it as much as possible to see how far it could take me.</p><p>To my surprise, the Copilot Agent was incredibly helpful. It assisted with everything — from designing the project structure and generating code to explaining deployment steps for platforms like AWS, Firebase, and even free-tier hosting providers such as Render.</p><p>It almost felt like having another developer working alongside me.</p><h3>The Catch with the Free Tier</h3><p>The only downside is that GitHub Copilot’s free tier comes with a limited number of <strong>Agent credits</strong> each month.</p><p>If you’re new to Copilot, it’s very easy to burn through those credits.</p><p>The Agent chat is so convenient that you naturally start asking it to do everything:</p><ul><li>Create a new API.</li><li>Rename a function.</li><li>Fix a small bug.</li><li>Add validation.</li><li>Modify a single file.</li></ul><p>Each of these requests consumes Agent credits.</p><p>Before you know it, you’ve exhausted your monthly limit — even though your project isn’t finished.</p><p>What made me realize this was checking my usage after working on my project.</p><p>My Agent credits were <strong>100% exhausted</strong>, while my <strong>Inline Suggestions</strong> usage was still around <strong>95% remaining</strong>.</p><p>That made me think:</p><blockquote><em>Maybe I’m using the wrong tool for the wrong job.</em></blockquote><h3>Understanding the Two Features</h3><p>GitHub Copilot actually provides two different AI experiences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/357/1*bDk2R6agxlusJTpu7uGqjw.png" /></figure><h3>1. Agent Chat</h3><p>The Agent is like a software engineer you can talk to.</p><p>You describe what you want, and it can:</p><ul><li>Create files and folders</li><li>Modify existing code</li><li>Generate project architecture</li><li>Explain deployment steps</li><li>Integrate cloud services</li><li>Handle large refactoring tasks</li></ul><p>It’s powerful — but every interaction costs Agent credits.</p><h3>2. Inline Suggestions</h3><p>Inline Suggestions work directly inside your editor.</p><p>Instead of chatting with an AI, you simply start writing code — or even write a comment — and Copilot completes the implementation.</p><p>These suggestions don’t consume your Agent credits in the same way and are perfect for smaller coding tasks.</p><h3>A Simple Example</h3><p>Imagine your Agent has already generated the backend structure for your application.</p><p>It has created:</p><ul><li>Database connection</li><li>User model</li><li>CRUD APIs</li><li>Service layer</li></ul><p>Now you want to add one more endpoint:</p><p><strong>Get all users</strong></p><p>Most beginners would open the Agent and type:</p><blockquote><em>Add an API to get all the users</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*Mt1XLKfm0mBzpQwsYZBH9Q.png" /></figure><p>The Agent does the work — but another credit is gone.</p><p>Instead, you could simply open your API file and write a comment like:</p><pre>//API: Get all users</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sf7zISi7H87R8JRvUzdxCQ.gif" /></figure><p>Within seconds, Copilot’s Inline Suggestions will usually generate the implementation for you.</p><p>No conversation required.</p><p>No unnecessary Agent usage.</p><h3>Why This Workflow Is Better</h3><p>Using Inline Suggestions for smaller tasks forces you to stay inside your codebase.</p><p>You naturally:</p><ul><li>Read more code.</li><li>Understand how different components interact.</li><li>Learn the project’s architecture.</li><li>Become more confident making changes yourself.</li></ul><p>This becomes incredibly valuable later.</p><p>Because eventually, every project reaches the testing phase.</p><p>That’s when bugs appear.</p><p>If you’ve spent the entire project asking the Agent to make every tiny change, you may not fully understand what’s happening under the hood.</p><p>Debugging suddenly becomes difficult because too many changes happened too quickly, and you never really followed the code.</p><h3>My Recommended Workflow</h3><p>After experimenting with Copilot, here’s the workflow I now prefer:</p><p><strong>Use the Agent for:</strong></p><ul><li>Initial project setup</li><li>Designing architecture</li><li>Creating new modules</li><li>Adding major features</li><li>Large refactoring</li><li>Deployment guidance</li></ul><p><strong>Use Inline Suggestions for:</strong></p><ul><li>Small APIs</li><li>Helper functions</li><li>Validation logic</li><li>Bug fixes</li><li>Minor UI changes</li><li>Simple refactoring</li><li>Repetitive coding tasks</li></ul><p>This balance helps you preserve your Agent credits while also improving your understanding of the project.</p><h3>Vibe Coding Doesn’t Mean Switching Your Brain Off</h3><p>One misconception about vibe coding is that the AI should do everything.</p><p>In reality, the best experience comes from working <em>with</em> the AI — not simply watching it write code.</p><p>The Agent should accelerate the heavy lifting.</p><p>Inline Suggestions should speed up the implementation.</p><p>And you should stay engaged enough to understand what is being built.</p><p>That combination leads to faster development, better debugging, and a much more enjoyable learning experience.</p><h3>Final Thoughts</h3><p>AI has changed the way we build software, but it hasn’t removed the need to understand our own code.</p><p>If you’re using GitHub Copilot’s free tier, treat the Agent like a senior engineer you consult for bigger problems, not every small task.</p><p>For the day-to-day coding, let Inline Suggestions handle the repetitive work while you stay involved in the implementation.</p><p>That’s the workflow that has worked best for me — and it might help you get much more value out of your monthly Copilot credits while becoming a better developer along the way.</p><p>Happy vibe coding! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66260b0c2893" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI — A Threat to Software Development or a New Pathway for Opportunities?]]></title>
            <link>https://ganeshlg.medium.com/ai-a-threat-to-software-development-or-a-new-pathway-for-opportunities-ee2ea6d9e9d7?source=rss-deac55377474------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee2ea6d9e9d7</guid>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[ai-applications]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Ganesh L G]]></dc:creator>
            <pubDate>Wed, 03 Sep 2025 13:14:28 GMT</pubDate>
            <atom:updated>2025-09-03T13:14:28.335Z</atom:updated>
            <content:encoded><![CDATA[<h3>AI — A Threat to Software Development or a New Pathway for Opportunities?</h3><p>I’ve been reading a lot of articles and posts lately claiming that AI is going to replace the jobs of many software developers, testers, and others in the tech space.</p><p>Yes, there’s some truth to that — AI can write better and faster code in certain scenarios. But rather than replacing jobs, I believe AI is actually making our work easier and more efficient.</p><p>Now, with just a few prompts, you can generate a significant amount of code. This accelerates the development process considerably. However, it’s not without its challenges. Sometimes the generated code includes deprecated packages, or it may not work as expected. I’ve personally encountered exceptions when running AI-generated logic, requiring manual intervention to debug and fix the issues.</p><p>That said, AI does make many complex tasks easier. For example, I wanted to create a custom UI using the Shape widget in a Flutter mobile app. I described the UI through prompts and provided some sample coordinates. The generated code worked really well! The key here is prompt engineering — a well-crafted prompt can lead to excellent results.</p><p>So yes, AI can reduce the development load significantly. But let’s look at the bright side — AI is opening up new opportunities across various sectors.</p><p>With the help of AI agents and large language models (LLMs), we can do so much more. Ever heard of MCPs or web scraping for dynamic data gathering? There’s a lot out there that many of us haven’t explored yet.</p><p>For instance, using Figma MCP, you can generate UI designs with just a prompt. With Gmail MCP, you can send emails via prompts — no need to copy and paste from ChatGPT anymore. You can even develop your own MCPs tailored for your product and integrate them with AI models.</p><p>Another exciting area is feeding live data into AI models for real-time analysis. AI models, by default, lack access to real-time data — but you have it.</p><p>For instance, if you’ve built your own MCP, you can stream live data directly from it into your AI workflows. This opens up powerful automation and analytics capabilities tailored to your specific needs.</p><p>There’s also something called web scraping, which allows you to collect live data from public websites. Say you want the latest trade news — using a web scraper, you can automatically fetch headlines from financial news sites, feed that information into your AI model, and then analyze it to predict potential market shifts based on your custom parameters.</p><p>The possibilities with live data + AI are truly immense — whether through your own MCP or smart use of web scraping.</p><p>In short, developers can now shift their focus more toward product development and innovation, rather than spending time optimizing every line of code — something AI can assist with.</p><p>I firmly believe AI cannot perform effectively without human oversight. So instead of worrying about AI taking your job, think about how you can leverage AI to create something great.</p><p>So go ahead — explore more applications that can work hand-in-hand with AI models, just like MCPs or web scraping. You might discover tools, techniques, or ideas that not only enhance your productivity but also open up entirely new career opportunities.</p><p>Have a great day!</p><p>PS : This article was edited by an AI… so if something sounds too smart, it probably wasn’t me 😏🤓🤖.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee2ea6d9e9d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is a State? (Flutter)]]></title>
            <link>https://ganeshlg.medium.com/what-is-a-state-flutter-1fbded358a4b?source=rss-deac55377474------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fbded358a4b</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[state]]></category>
            <category><![CDATA[flutter-state-management]]></category>
            <category><![CDATA[app-state]]></category>
            <category><![CDATA[ephemeral-state]]></category>
            <dc:creator><![CDATA[Ganesh L G]]></dc:creator>
            <pubDate>Wed, 01 May 2024 18:43:51 GMT</pubDate>
            <atom:updated>2024-05-01T19:04:29.561Z</atom:updated>
            <content:encoded><![CDATA[<p>Let me try to explain to you with myself as an example, currently, I am writing this blog sitting on a chair so we can consider my state as <strong>sitting</strong> as soon as I start to walk towards bed my state will be <strong>walking,</strong> later if I sleep on the bed my state will be <strong>sleeping</strong>.</p><p>When it comes to flutter a state is a data input that you have provided for a widget at a particular moment, the widget in turn renders the user interface based on its state.</p><p>Flutter has two types are widgets those are <strong>stateless widget</strong> and <strong>stateful widget</strong>.</p><p>As the name suggests, a stateless widget doesn’t contain a state, whereas only a <strong>stateful widget contains a state</strong>.</p><p>As defined by Flutter there are two types of conceptual states those are <strong>Ephemeral state</strong> and <strong>App state</strong>.</p><blockquote><strong>Ephemeral state</strong></blockquote><p>In general terms, an ephemeral state is defined as a temporary state that soon disappears.</p><p>In terms of Flutter, ephemeral state is a state that will be contained within a single widget, commonly known as UI state or local state.</p><blockquote><strong>App state</strong></blockquote><p>In general terms, an app state is everything that exists in the memory when the app is running.</p><p>In terms of Flutter, an app state is a state that needs to be shared across multiple widgets, commonly known as a shared state.</p><p>For managing the app state, we can make use of state management solutions. (Flutter’s own Inherited Widget or Third Party Libraries)</p><blockquote><strong>Example for App State and Ephemeral State</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*oXoVeBw89e_yCIcOaBECBw.gif" /></figure><p>In the above sample you can observe that we are displaying both app state and ephemeral state.</p><ol><li>Initially, the car’s state will be <strong>PARKED</strong>.</li><li>If the car is accelerated the car’s state changes to <strong>MOVING, </strong>in turn acceleration state changes from<strong> ACCELERATION NOT APPLIED</strong> to <strong>ACCELERATION APPLIED</strong>.</li><li>If the car is steered the car’s state changes to <strong>TURNED</strong>, in turn, the steering state changes from <strong>NOT TURNED</strong> to <strong>TURNED LEFT</strong> or <strong>TURNED RIGHT</strong>.</li><li>If the brake is applied the car’s state changes to <strong>STOPPED</strong>, in turn brake state changes from <strong>BRAKE NOT APPLIED</strong> to <strong>BRAKE APPLIED</strong>.</li><li>If the car’s state is resettled, the car’s state is changed to <strong>PARKED,</strong> in turn, acceleration, steering, and brake are resettled to their original value.</li></ol><p>For the above example we have used the Inherited Widget state management solution, please check out the GitHub repo for your reference.</p><p><a href="https://github.com/ganeshlg/state_flutter.git">GitHub - ganeshlg/state_flutter</a></p><p>Thank You…</p><blockquote><strong>References</strong></blockquote><ul><li><a href="https://docs.flutter.dev/data-and-backend/state-mgmt/ephemeral-vs-app">Differentiate between ephemeral state and app state</a></li><li><a href="https://stackoverflow.com/questions/60246075/what-is-called-as-ephemeral-state-and-app-state-in-flutter-application">What is called as Ephemeral state and App state in Flutter Application?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fbded358a4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Imperative or Declarative UI Approach, which is the future of front-end development?]]></title>
            <link>https://blog.stackademic.com/imperative-or-declarative-ui-approach-which-is-the-future-of-front-end-development-04c05acce2d9?source=rss-deac55377474------2</link>
            <guid isPermaLink="false">https://medium.com/p/04c05acce2d9</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[declarative-vs-imperative]]></category>
            <category><![CDATA[declarative]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[imperative]]></category>
            <dc:creator><![CDATA[Ganesh L G]]></dc:creator>
            <pubDate>Sun, 21 Apr 2024 13:40:44 GMT</pubDate>
            <atom:updated>2024-04-24T01:10:49.048Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are a front-end developer it’s really important to know what is declarative UI and imperative UI approaches.</p><p>When I was going through some articles about the imperative and declarative UI concepts, the basic difference that I observed was <strong>imperative UI paradigm</strong> promotes <strong>mutating</strong> UI elements during state changes and <strong>the declarative UI paradigm</strong> promotes <strong>immutable</strong> UI elements. i.e., it promotes <strong>rebuilding</strong> UI elements on state change.</p><p>Frameworks from Android, IOS, and the Web which were using imperative UI approach already moved towards a declarative UI approach. For example, <strong>JetpackComposeUI</strong> in <strong>Android</strong> and <strong>SwiftUI</strong> in <strong>IOS</strong> use a declarative UI approach.</p><p><strong>Advantages of Declarative UI Approach over imperative UI Approach</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/db3e55c9d70762d1e51c6d8f0b6aaf28/href">https://medium.com/media/db3e55c9d70762d1e51c6d8f0b6aaf28/href</a></iframe><p>Please find the below code snippets to understand imperative (Android XML) and declarative(Flutter) UI approach.</p><p><strong>Example :</strong></p><p>Add a button that initially displays “Sign In” text, on click it changes from text to circular progress loader.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*LO5Nxe8Pa8XyI4lBQOzflQ.gif" /></figure><p>Imperative UI approach</p><pre># Code for UI Design<br><br>&lt;Button  <br>        android:id=&quot;@+id/button&quot;  <br>        android:layout_width=&quot;wrap_content&quot;  <br>        android:layout_height=&quot;wrap_content&quot;  <br>        android:layout_centerHorizontal=&quot;true&quot;  <br>        android:layout_marginTop=&quot;10dp&quot;  <br>        android:text=&quot;Sign In&quot;/&gt;</pre><pre>// Code for functionality<br><br>// Modified the button widget to show circular loader icon.<br>// Here Button widget in mutable<br><br>Button button = findViewById(R.id.button);<br><br>button.setOnClickListener(new View.OnClickListener() {  <br>        @Override  <br>        public void onClick(View view) {  <br>           button.setIcon(MaterialCircularIcon);<br>           button.setText(&quot;&quot;);<br>        }  <br> });  </pre><p>Declarative Approach</p><pre>// Code for both UI design and functionality<br><br>class Button extends StatefulWidget{<br>  const Button({super.key});<br><br>  @override<br>  State&lt;Button&gt; createState() =&gt; _ButtonState();<br>}<br><br>class _ButtonState extends State&lt;Button&gt; {<br>  // isLoading is the state of the widget.<br>  bool isLoading = false;<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return ElevatedButton(<br>      onPressed: () {<br>       // State of the widget is altered using setState, which rebuilds Button Widget <br>       // Here Button widget in immutable<br>        setState(() {<br>          isLoading = true;<br>        });<br>      },<br>      child: isLoading ? const CircularProgressIndicator() : const Text(<br>          &#39;Sign In&#39;),<br>    );<br>  }<br>}</pre><p>In the above example, you can observe that in the imperative UI approach, we are mutating the button widget using setter methods.</p><p>But in the declarative UI approach, the complete button widget is rebuilding on change of its state. This is ok — because modern CPU’s have the ability to do so.</p><p><strong>Time Line of Declarative UI Paradigm</strong></p><p>Declarative UI started with the rise of Javascript frameworks like <strong>React</strong>, which was released to the public in <strong>2013</strong>.</p><p>Later, the declarative UI for mobile started as a hackathon project of Facebook (<strong>React Native</strong>). A framework for building mobile applications with Javascript and React, which was released to the public in <strong>2015</strong>.</p><p>Flutter an open source framework used to build an application’s user interface for multiple platforms with single code base also uses declarative UI approach, which was released to the public by google in <strong>2018.</strong></p><p><strong>Conclusion</strong></p><p>Both approaches have their own pros and cons. But in this article, I may have leaned towards the declarative UI approach, because of its advantages in state management and code maintainability.</p><p>I believe that the declarative approach will be the future of front-end UI development.</p><p>This is just my point of view, feel free to comment your suggestions.</p><p>Thank You.</p><p><strong>References</strong></p><ul><li><a href="https://docs.flutter.dev/get-started/flutter-for/declarative">Introduction to declarative UI</a></li><li><a href="https://www.dhiwise.com/post/declarative-ui-vs-imperative-ui-in-flutter-development">Dive Deep: Declarative UI vs. Imperative UI</a></li><li><a href="https://www.rootstrap.com/blog/imperative-v-declarative-ui-design-is-declarative-programming-the-future">Imperative v Declarative UI Design - Is Declarative Programming the future?</a></li><li><a href="https://embrace.io/blog/declarative-paradigm-of-flutter-vs-imperative/">Embracing Flutter&#39;s declarative paradigm from the imperative world</a></li><li><a href="https://increment.com/mobile/the-shift-to-declarative-ui/">The new shiny - Increment: Mobile</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><strong> | </strong><a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a><strong> | </strong><a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a><strong> | </strong><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><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a><strong> | </strong><a href="https://blog.cubed.run/"><strong>Cubed</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=04c05acce2d9" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/imperative-or-declarative-ui-approach-which-is-the-future-of-front-end-development-04c05acce2d9">Imperative or Declarative UI Approach, which is the future of front-end development?</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[SSL/TLS in depth(HTTPS)]]></title>
            <link>https://ganeshlg.medium.com/sls-tls-in-depth-https-10177dee9afe?source=rss-deac55377474------2</link>
            <guid isPermaLink="false">https://medium.com/p/10177dee9afe</guid>
            <category><![CDATA[ssltls]]></category>
            <category><![CDATA[ssl-certificate-chain]]></category>
            <category><![CDATA[public-key-certificate]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[ssl-in-depth]]></category>
            <dc:creator><![CDATA[Ganesh L G]]></dc:creator>
            <pubDate>Sun, 22 Aug 2021 09:36:00 GMT</pubDate>
            <atom:updated>2023-06-20T06:13:55.344Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*DMNW7XshA9hmuo_RDfRuZQ.jpeg" /></figure><p>The following article gives you a idea about SSL/TLS and also small brief about topics involved in the process like public key certificate, CA(certificate authority), RSA Crypto System, SSL Certificate Chain, etc.</p><p><strong>Public Key Certificate</strong></p><p>In cryptography, a public key certificate, also known as a digital certificate or identity certificate, is an electronic document used to prove the ownership of a public key.</p><p>The certificate includes information about the key, information about the identity of its owner (called the subject), and the digital signature of an entity that has verified the certificate’s contents (called the issuer). If the signature is valid, and the software examining the certificate trusts the issuer, then it can use that key to communicate securely with the certificate’s subject.</p><p>In a typical public key infrastructure (PKI) scheme, the certificate issuer is a certificate authority (CA), usually a company that charges customers to issue certificates for them.</p><blockquote>Types of Public Key Certificate</blockquote><ol><li>TLS/SSL Server Certificate</li><li>TLS/SSL Client Certificate</li><li>Email Certificate</li><li>EMV Certificate</li><li>Code Signing Certificate</li><li>Root, Intermediate and End-Entity/Leaf Certificate, etc.</li></ol><blockquote>Common Fields in Public Key Certificate</blockquote><p>These are some of the most common fields in certificates. Most certificates contain a number of fields not listed here. Note that in terms of a certificate’s X.509 representation, a certificate is not “flat” but contains these fields nested in various structures within the certificate.</p><p>Serial Number: Used to uniquely identify the certificate within a CA’s systems. In particular this is used to track revocation information.</p><p>• Subject: The entity a certificate belongs to: a machine, an individual, or an organization.</p><p>• Issuer: The entity that verified the information and signed the certificate.</p><p>• Not Before: The earliest time and date on which the certificate is valid.</p><p>• Not After: The time and date past which the certificate is no longer valid.</p><p>• Key Usage: The valid cryptographic uses of the certificate’s public key. Common values include digital signature validation, key encipherment, and certificate signing.</p><p>• Extended Key Usage: The applications in which the certificate may be used. Common values include TLS server authentication, email protection, and code signing.</p><p>• Public Key: A public key belonging to the certificate subject.</p><p>• Signature Algorithm: This contain a hashing algorithm and an encryption algorithm. For example “sha265RSA” where sha265 is the hashing algorithm and RSA is the encryption algorithm.</p><ul><li>Signature: The body of the certificate is hashed (hashing algorithm in “Signature Algorithm” field is used) and then the hash is encrypted (encryption algorithm in the “Signature Algorithm” field is used) with the issuer’s private key.</li></ul><p><strong>SSL/TLS Certificate</strong></p><p>A Secure Sockets Layer certificate (SSL certificate) is a small data file installed on a Web server that allows for a secure connection between the server and a Client.</p><p>In TLS (an updated replacement for SSL), a server is required to present a certificate as part of the initial connection setup. A client connecting to that server will perform the certificate path validation algorithm:</p><p>1. The subject of the certificate matches the hostname (i.e. domain name) to which the client is trying to connect;</p><p>2. The certificate is signed by a trusted certificate authority.</p><p>The primary hostname (domain name of the website) is listed as the Common Name in the Subject field of the certificate. A certificate may be valid for multiple hostnames (multiple websites).</p><p><strong>SSL Certificate Chain(Chain of Trust)</strong></p><blockquote>What is SSL Certificate Chain?</blockquote><p>A certificate chain acts to establish a trust between Certificate Authorities (CAs) of a Public Key Infrastructure (PKI). The trust establishes the hierarchical roles and relationships between the root CA, the intermediate CA, and the Secure Sockets Layer (SSL) certificates.</p><p>Actually, in order to identify the trust factor of the SSL certificate, a browser has to verify few more details. These details are nothing but few more certificate that has been vetted by this list of SSL Certificate from the root certificate to the end browser, represents the SSL Certificate chain.</p><blockquote>Component of SSL Certificate Chain</blockquote><p>1. URL/Leaf/End-Entity Certificate</p><p>2. Intermediate Certificate</p><p>3. Root Certificate</p><blockquote>Differentiating root and intermediate CAs</blockquote><p>The root CA is the base of the certificate chain. Certificates from the root CA carries the same level of trust as the root CA certificate. The root CA signs the certificate for the intermediate CA. The role of the intermediate CA is to sign end-entity certificates for the root CA.</p><blockquote>SSL certificate</blockquote><p>The SSL certificate is signed by an intermediate CA for use as a domain specific certificate. The SSL certificate is installed on an SSL enabled server (end-entity) and the certificate is presented to the browser when initiating an SSL connection with the server. The browser will try to confirm the authenticity of the SSL certificate by checking the signing authority of the certificate.</p><blockquote>Intermediate CA</blockquote><p>The intermediate CA is a deputy to a specific root CA and uses a certificate signed by the root CA. The intermediate CA is the signer of SSL certificates. The intermediate CAs get their CA directly from the signing root CA.</p><blockquote>Root CA</blockquote><p>The root CA utilizes a X.509-based public key certificate that specifically identifies the root CA. The root CA is the signing authority for the SSL certificate chain. Browser vendors include a list of known, trusted root CAs that will ultimately determine the validity of an SSL certificate.</p><p>For a browser to accept an SSL certificate, the certificate must be issued by a CA that has a signed certificate from a root CA. That is included in the browser’s store of known, trusted root CAs.</p><p>The browser will check each intermediate CA’s certificate to establish if it was issued by a known, trusted root CA. In case the certificate of the intermediate CA was signed by some another intermediate CA, the web browser will then verify if that intermediate CA’s certificate to check if the issuer of the certificate is a trusted root CA.</p><p>This chain of checking a level deeper will continue until the root CA certificate is located and checked against the browser’s trusted store of root CA’s. When the root CA matches a known and trusted root CA in the browser’s store, the certificate is accepted as valid.</p><p>Untrusted SSL connections are managed in various ways by different vendors, most will warn that the connection is distrusted, requiring the user to acknowledge the discrepancy or outright fail to allow the connection to establish.</p><blockquote>Introduction about RSA Crypto System.</blockquote><p>The Certificate signing process involve RSA encryption methodology. Please understand its basic before proceeding further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*TqedLzdelSBoQ3IMT1qRRQ.png" /></figure><p>First, the receiver generates a public key and a private key, and sends the public key to the sender. Then, the sender encrypts the message with the received public key, and sends it back to the receiver. The receiver then decrypts the message using the private key, and the original message is retrieved.</p><p>As we can see from the diagram above, the raw message never gets transmitted over the public domain, which is where attackers will be eavesdropping. The private key must be kept securely at all times, so that the message cannot be decrypted by a third party.</p><p>Please refer the below flow chart where I tried to show detailed explanation regarding SSL/TLS connection and Chain of Trust.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gWYVcHIzT1SKLEvpEpqsZg.png" /></figure><p>Thank You…!!!</p><p><strong>References</strong></p><ul><li><a href="https://en.wikipedia.org/wiki/Public_key_certificate">Public key certificate - Wikipedia</a></li><li><a href="https://medium.com/@jinkyulim96/algorithms-explained-rsa-encryption-9a37083aaa62">Algorithms Explained: RSA Encryption</a></li><li><a href="https://www.https.in/blog/ssl-certificate-chain/">SSL Certificate Chain | Your in-depth Guide - https.in Blog</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10177dee9afe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adobe XD to Flutter(UI/UX Support).]]></title>
            <link>https://ganeshlg.medium.com/adobe-xd-to-flutter-11e845713c73?source=rss-deac55377474------2</link>
            <guid isPermaLink="false">https://medium.com/p/11e845713c73</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[xd-to-flutter]]></category>
            <category><![CDATA[adobe-xd]]></category>
            <dc:creator><![CDATA[Ganesh L G]]></dc:creator>
            <pubDate>Tue, 11 May 2021 06:40:07 GMT</pubDate>
            <atom:updated>2021-05-11T07:00:38.198Z</atom:updated>
            <content:encoded><![CDATA[<h3>Adobe XD to Flutter(UI/UX Support). How to create a widget from Adobe XD using XD to Flutter Plugin?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RqrjDpKvlaIU-BQ99VttHQ.png" /></figure><p>The following article gives you a idea about how to utilize adobe xd to build and export flutter widgets to your project.</p><p>Okay, let us understand what is adobe xd?</p><p><strong>Adobe XD</strong> (also known as <strong>Adobe Experience Design</strong>) is a vector-based user experience tool for web apps and mobile apps, developed and published by Adobe Inc. It is available for macOS and Windows.</p><p>Adobe XD has following features,</p><p><strong>Repeat grid:</strong> Helps creating a grid of repeating items such as lists, and photo galleries.<br><strong>Prototype and animation:</strong> Creates animated prototypes through linking artboards. These prototypes can be previewed on supported mobile devices.</p><p><strong>Interoperability:</strong> XD supports and can open files from Illustrator, Photoshop, Photoshop Sketch, and After Effects. In addition to the Adobe Creative Cloud, XD can also connect to other tools and services such as Slack and Microsoft Teams to collaborate. XD is also able to auto-adjust and move smoothly from macOS to Windows. For security, prototypes can be sent with password protection to ensure full disclosure.</p><p><strong>Voice design:</strong> Apps can be designed using voice commands. In addition, what users create for smart assistants can be previewed as well.</p><p><strong>Components:</strong> Users can create components (previously known as symbols) to create logos, buttons and other assets for reuse. Their appearance can change with the context where they are used.</p><p><strong>Responsive resize:</strong> Responsive resize automatically adjusts and sizes pictures and other objects on the artboards. This allows the user to have their content automatically adjusted for different screens for different sized platforms such as mobile phones and PCs.</p><p><strong>Plugins:</strong> XD is compatible with custom plugins that add additional features and uses. Plugins range from design to functionality, automation and animation.</p><p>Now let us see how does it work for flutter,</p><p>Step 1:</p><p>Install Adobe XD from the following link.</p><p><a href="https://www.adobe.com/in/products/xd/pricing/individual.html">XD Individual Pricing | Free Starter Plan Info | Adobe XD</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XWb4LuyZEUIr25i3K7Rx8Q.png" /><figcaption>Initially install starter to experiment and learn, later can be subscribed based on the requirement.</figcaption></figure><p>Once downloaded install the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wUeZgv3yVT0K7W1z03Ta_g.png" /><figcaption>Installing window</figcaption></figure><p>Step 2:</p><p>Select screen size based on your requirement for designing and prototyping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wU_u00siwwgic4NKsFvCFQ.png" /><figcaption>Will be selecting iphone12 Pro Max(428 * 926 px)</figcaption></figure><p>Once you select the required screen size following screen will be displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YUJ3Nk-v1yTybyyNMKeEzw.png" /></figure><p>click on Plugins -&gt; Discover Plugins -&gt; install XD to Flutter official plugin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wjj_jC8lgVLGgJvEnfQLSQ.png" /><figcaption>XD to Flutter plugin</figcaption></figure><p>Step 3:</p><p>By default, you have the following options in adobe XD to design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u9b0WU1Xz5wDKSloX-qv7Q.png" /><figcaption>Default Editing Options</figcaption></figure><p>You can edit the deployed shapes,text etc. from the following window shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DYGDK84C7XgnBFHlJ5qRdA.png" /><figcaption>Edit option for deployed shapes,text etc.</figcaption></figure><p>Step 4:</p><p>Now let’s discuss what needs to be done in the flutter project.</p><p>Add the following dependency in pubspec.yaml.</p><pre>adobe_xd: ^2.0.0+1</pre><p>Create assets/images folder under lib also mention the same under pubspec.yaml</p><pre>assets:<br>  - assets/images/</pre><p>Step 5:</p><p>Coming to Adobe XD, after making some changes to the project.</p><p>Add the project folder to Adobe XD before exporting widget as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zVdH009FrOaja8kBsG4Z8g.png" /><figcaption>Add the project path, in addition to that mention assets folder under CODE PATH and IMAGE PATH as shown.</figcaption></figure><p>Step 6:</p><p>Click on Export All Widgets to export the created design into widget tree for flutter project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xUsGV_rTHN78ehnJUQpkWw.png" /><figcaption>Exported widget design</figcaption></figure><p>You will see the created widget tree under the lib folder as mentioned in code path, you can change the same as per your convenience.</p><p>Please refer below code created from XD to Flutter plugin.</p><p>XDiPhone12ProMax1.dart</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:adobe_xd/pinned.dart&#39;;<br>import &#39;dart:ui&#39; as ui;<br><br>class XDiPhone12ProMax1 extends StatelessWidget {<br>  XDiPhone12ProMax1({<br>    Key key,<br>  }) : super(key: key);<br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      backgroundColor: const Color(0xffffffff),<br>      body: Stack(<br>        children: &lt;Widget&gt;[<br>          Pinned.fromPins(<br>            Pin(start: 86.0, end: 86.0),<br>            Pin(size: 316.0, middle: 0.5),<br>            child: Container(<br>              decoration: BoxDecoration(<br>                color: const Color(0xff127961),<br>                border: Border.all(width: 1.0, color: const Color(0xff707070)),<br>              ),<br>            ),<br>          ),<br>          Pinned.fromPins(<br>            Pin(size: 105.0, middle: 0.4985),<br>            Pin(size: 98.0, middle: 0.3043),<br>            child: ClipOval(<br>              child: BackdropFilter(<br>                filter: ui.ImageFilter.blur(sigmaX: 32.0, sigmaY: 32.0),<br>                child: Container(<br>                  decoration: BoxDecoration(<br>                    borderRadius:<br>                        BorderRadius.all(Radius.elliptical(9999.0, 9999.0)),<br>                    color: Colors.<em>transparent</em>,<br>                    border:<br>                        Border.all(width: 1.0, color: const Color(0xff707070)),<br>                    boxShadow: [<br>                      BoxShadow(<br>                        color: const Color(0x290c0b0b),<br>                        offset: Offset(0, 3),<br>                        blurRadius: 6,<br>                      ),<br>                    ],<br>                  ),<br>                ),<br>              ),<br>            ),<br>          ),<br>          Pinned.fromPins(<br>            Pin(size: 100.0, middle: 0.5015),<br>            Pin(size: 27.0, middle: 0.5),<br>            child: Text(<br>              &#39;Some App&#39;,<br>              style: TextStyle(<br>                fontFamily: &#39;Segoe UI&#39;,<br>                fontSize: 20,<br>                color: Colors.white,//Changed manually to white<br>                fontWeight: FontWeight.<em>w700</em>,<br>              ),<br>              textAlign: TextAlign.left,<br>            ),<br>          ),<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><p><em>Changed the text color to Colors.white as it was not visible with specified color from adobe xd.</em></p><p>Please refer to the image for clarity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*LxCIMJDcIkOEOVJ6MvEAvA.jpeg" /><figcaption>Image of built widget from Android Device.</figcaption></figure><h3>References</h3><ul><li><a href="https://en.wikipedia.org/wiki/Adobe_XD">Adobe XD - Wikipedia</a></li><li><a href="https://pub.dev/packages/adobe_xd">adobe_xd | Flutter Package</a></li></ul><p>Thank You…!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11e845713c73" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter — Sharing PDF File(Text and Image)]]></title>
            <link>https://ganeshlg.medium.com/flutter-sharing-pdf-file-text-and-image-ff4be20e45c4?source=rss-deac55377474------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff4be20e45c4</guid>
            <category><![CDATA[flutter-pdf]]></category>
            <category><![CDATA[flutter-widget-share-pdf]]></category>
            <category><![CDATA[flutter-share]]></category>
            <category><![CDATA[pdf-share-to-social-media]]></category>
            <category><![CDATA[image-to-pdf-flutter]]></category>
            <dc:creator><![CDATA[Ganesh L G]]></dc:creator>
            <pubDate>Wed, 24 Mar 2021 16:13:33 GMT</pubDate>
            <atom:updated>2021-03-24T16:24:25.534Z</atom:updated>
            <content:encoded><![CDATA[<h3>Flutter — Sharing PDF File(Text and Image)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*1Mlwm2Fmb7cJ4JfGpfx0Ew.png" /></figure><p>The following article describes how to share text and images in PDF format with flutter.</p><p>The following steps will guide you, how you can share PDF in flutter.</p><p>Step 1:</p><p>Add following permission AndroidManifest.xml file</p><pre>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;<br>&lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot;/&gt;<br>&lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot;/&gt;</pre><p>Step 2:</p><p>Add following line of code inside under activity in AndroidManifest.xml file to support android api 29+(image_picker package).</p><pre>&lt;activity<br>    ....<br>    android:requestLegacyExternalStorage=&quot;true&quot;<br>    ....         <br>                                              &gt;</pre><p>Step 3:</p><p>Add following plugins in pubspec.yaml file.</p><pre>image_picker: ^0.7.3<br>esys_flutter_share: ^1.0.2<br>pdf: ^3.1.0</pre><p>Step 4:</p><p>Refer the below code to share text or image in PDF Format</p><p><em>main.dart</em></p><pre>import &#39;dart:io&#39;;<br>import &#39;dart:typed_data&#39;;<br>import &#39;package:esys_flutter_share/esys_flutter_share.dart&#39;;<br>import &#39;package:flutter/cupertino.dart&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:image_picker/image_picker.dart&#39;;<br>import &#39;package:pdf/pdf.dart&#39;;<br>import &#39;package:pdf/widgets.dart&#39; as pw;<br><br>void main() {<br>  runApp(MyApp());<br>}<br><br>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      title: &#39;PDF Share Demo&#39;,<br>      debugShowCheckedModeBanner: false,<br>      theme: ThemeData(<br>        primarySwatch: Colors.<em>red</em>,<br>      ),<br>      home: MyHomePage(title: &#39;PDF Share - Home Page&#39;),<br>    );<br>  }<br>}<br><br>class MyHomePage extends StatefulWidget {<br>  MyHomePage({Key key, this.title}) : super(key: key);<br><br>  final String title;<br><br>  @override<br>  _MyHomePageState createState() =&gt; _MyHomePageState();<br>}<br><br>class _MyHomePageState extends State&lt;MyHomePage&gt; {<br>  TextEditingController text = new TextEditingController();<br>  File _image;<br>  final _picker = ImagePicker();<br>  final _pdfText = pw.Document();<br>  final _pdfImage = pw.Document();<br>  Uint8List _pdfTextByte;<br>  Uint8List _pdfImageByte;<br><br>  Future&lt;Uint8List&gt; _addPDFPageText() async {<br>    _pdfText.addPage(pw.Page(<br>        pageFormat: PdfPageFormat.<em>a4</em>,<br>        build: (pw.Context context) {<br>          return pw.Center(<br>            child: pw.Text(text.text),<br>          ); // Center<br>        }));<br>    _pdfTextByte = await _pdfText.save();<br>    return _pdfTextByte;<br>  }<br><br>  Future&lt;Uint8List&gt; _addPDFPageImage() async {<br>    final image = pw.MemoryImage(<br>      _image.readAsBytesSync(),<br>    );<br>    _pdfImage.addPage(pw.Page(build: (pw.Context context) {<br>      return pw.Center(<br>        child: pw.Image(image),<br>      ); // Center<br>    }));<br>    _pdfImageByte = await _pdfImage.save();<br>    return _pdfImageByte;<br>  }<br><br>  Future getImage() async {<br>    final pickedFile = await _picker.getImage(source: ImageSource.gallery);<br><br>    setState(() {<br>      if (pickedFile != null) {<br>        _image = File(pickedFile.path);<br>      } else {<br>        print(&#39;No image selected.&#39;);<br>      }<br>    });<br>  }<br><br>  _sharePdfText() {<br>    _addPDFPageText().whenComplete(() async =&gt;<br>        await Share.<em>file</em>(&quot;pdfText&quot;, &quot;pdfText&quot; + &quot;.pdf&quot;, _pdfTextByte, &#39;*/*&#39;));<br>  }<br><br>  _sharePdfImage() async {<br>    _addPDFPageImage().whenComplete(() async =&gt; await Share.<em>file</em>(<br>        &quot;pdfImage&quot;, &quot;pdfImage&quot; + &quot;.pdf&quot;, _pdfImageByte, &#39;*/*&#39;));<br>  }<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      appBar: AppBar(<br>        title: Text(widget.title),<br>        centerTitle: true,<br>      ),<br>      body: SingleChildScrollView(<br>        child: Column(<br>          mainAxisAlignment: MainAxisAlignment.center,<br>          children: &lt;Widget&gt;[<br>            SizedBox(<br>              height: 50,<br>            ),<br>            Text(<br>              &#39;Share PDF Text File&#39;,<br>              style: TextStyle(<br>                  fontStyle: FontStyle.normal,<br>                  fontSize: 15,<br>                  fontWeight: FontWeight.<em>bold</em>),<br>            ),<br>            Container(<br>              decoration: BoxDecoration(<br>                  borderRadius: BorderRadius.circular(5), color: Colors.<em>red</em>),<br>              margin: EdgeInsets.all(15.0),<br>              child: TextFormField(<br>                maxLines: 6,<br>                controller: text,<br>              ),<br>            ),<br>            ElevatedButton(<br>                onPressed: () {<br>                  _sharePdfText();<br>                },<br>                child: Text(&quot;Share&quot;)),<br>            SizedBox(<br>              height: 50,<br>            ),<br>            Text(<br>              &#39;Share PDF Image File&#39;,<br>              style: TextStyle(<br>                  fontStyle: FontStyle.normal,<br>                  fontSize: 15,<br>                  fontWeight: FontWeight.<em>bold</em>),<br>            ),<br>            _image == null<br>                ? Container(<br>                    margin: EdgeInsets.all(15.0),<br>                    child: ElevatedButton(<br>                        onPressed: () {<br>                          getImage();<br>                        },<br>                        child: Text(&quot;Add Image&quot;)))<br>                : Container(<br>                    margin: EdgeInsets.all(15.0),<br>                    alignment: Alignment.<em>center</em>, // use aligment<br>                    child: Image.file(<br>                      _image,<br>                      height: 300,<br>                      width: 150,<br>                      fit: BoxFit.fill,<br>                    ),<br>                  ),<br>            ElevatedButton(<br>                onPressed: () {<br>                  _sharePdfImage();<br>                },<br>                child: Text(&quot;Share&quot;)),<br>          ],<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><p>Please watch below video for your reference,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*uZzIOxb3f0MCWVI28bWRqg.gif" /></figure><h3>References</h3><ul><li><a href="https://pub.dev/packages/pdf">pdf | Dart Package</a></li><li><a href="https://pub.dev/packages/image_picker">image_picker | Flutter package</a></li><li><a href="https://pub.dev/packages/esys_flutter_share">esys_flutter_share | Flutter Package</a></li></ul><p>Thank you…!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff4be20e45c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter 2 — Complete Overview]]></title>
            <link>https://ganeshlg.medium.com/flutter-2-complete-overview-7cb6d965afb8?source=rss-deac55377474------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cb6d965afb8</guid>
            <category><![CDATA[flutter-engage]]></category>
            <category><![CDATA[fixflutter]]></category>
            <category><![CDATA[flutter-desktop-beta]]></category>
            <category><![CDATA[flutter-upgrade]]></category>
            <category><![CDATA[flutter-2]]></category>
            <dc:creator><![CDATA[Ganesh L G]]></dc:creator>
            <pubDate>Tue, 23 Mar 2021 13:44:37 GMT</pubDate>
            <atom:updated>2021-03-23T13:44:37.124Z</atom:updated>
            <content:encoded><![CDATA[<h3>Flutter 2 — Complete Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*DZrRfNSwuXxa5nbyDgqNEw.png" /></figure><p>Recently flutter announced release of flutter 2.0, a major upgrade to Flutter that enables developers to create beautiful, fast and portable apps for any platform.</p><p>With Flutter 2, you can use the same codebase to ship native apps to five operating systems: iOS, Android, Windows, macOS, and Linux; as well as web experiences targeting browsers such as Chrome, Firefox, Safari, or Edge. Flutter can even be embedded in cars, TVs, and smart home appliances.</p><p>Let’s discuss what’s new in Flutter 2.0, continue reading!</p><h3><strong>Web</strong></h3><p>As of now flutter, flutters web support has moved from beta to stable channel (Flutter has four release channels: <strong>stable</strong>, <strong>beta</strong>, <strong>dev</strong>, and <strong>master</strong>. Flutter team recommends using the <strong>stable</strong> channel unless you need a more recent release.)</p><p>In the initial release of web support, flutter focuses on three app scenarios:</p><ol><li>Progressive web app (<strong>PWA</strong>): — A <strong>PWA </strong>is a type of application software delivered through the web, built using common web technologies including HTML, CSS and JavaScript. It is intended to work on any platform that uses a standards-compliant browser, including both desktop and mobile devices.PWA features narrow the gap between user experience in web-based and native applications.</li><li>Single page app<strong> </strong>(<strong>SPA</strong>): — A <strong>SPA </strong>is a web application or website that interacts with the user by dynamically rewriting the current web page with new data from the web server, instead of the default method of the browser loading entire new pages. The goal is faster transitions that make the website feel more like a native app.In a SPA, all necessary HTML, JavaScript, and CSS code is either retrieved by the browser with a single page load, or the appropriate resources are dynamically loaded and added to the page as necessary, usually in response to user actions. The page does not reload at any point in the process, nor does it transfer control to another page, although the location hash or the HTML5 History API can be used to provide the perception and navigability of separate logical pages in the application.</li><li>Expanding existing Flutter mobile apps to the web, enabling shared code for both experiences.</li></ol><p>Today’s web platform is richer than ever, with hardware-accelerated 2D and 3D graphics, offline and installation support, and access to the underlying operating system and hardware.</p><p>Since Flutter is written in Dart, a language that offers JavaScript compilation, it was a natural next step to explore the web as a target. This also builds towards our vision of providing a portable framework for building beautiful UI wherever you want to paint pixels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ralW5YQX6hd3yMwtBsp4NA.png" /></figure><p>At an architectural level, Flutter is a multilayer system with:</p><ul><li>A framework that provides abstractions for common idioms like widgets, animation, and gestures.</li><li>An engine that renders to the target device using the system APIs it exposes.</li></ul><p>With Dart’s ability to compile the Flutter framework (as well as your app code) into JavaScript, our work to support the web involved replacing the low-level C++ rendering engine used by mobile apps with code that maps to web platform APIs. Flutter doesn’t merely transpile to HTML equivalents of its widgets. Instead, Flutter’s web engine offers a choice of two renderers: an <strong>HTML renderer</strong> that is optimized for size and broad compatibility, and a <strong>CanvasKit renderer</strong> that uses WebAssembly and WebGL to render Skia paint commands to the browser canvas.</p><p>Flutter has made major architectural improvements and added features that extend and optimize Flutter for the web, focusing on four areas: <strong>performance</strong>, <strong>web-specific features</strong>, <strong>desktop form factors, </strong>and <strong>plugins.</strong></p><p>Flutter’s goal is to offer a new way to target the web platform, build on existing foundations, and provide new insights that improve the web for everyone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*JM-bBux6kjCrZYR6aVvaog.png" /></figure><p><strong>Performance</strong></p><p>Flutter originally started with an HTML, DOM-based model. In this model, Flutter’s web engine translates each generated Flutter scene into HTML, CSS, or Canvas, and renders a frame onto the page as a tree of HTML elements. Even though the HTML renderer offered the greatest compatibility with a wide variety of browsers and had a smaller code size, the HTML renderer’s repaint performance was less suitable for more graphic-intensive applications.</p><p>To handle the fidelity required to render intensive graphics efficiently, flutter started experimenting with CanvasKit, which enables rendering Skia paint commands in the browser using WebAssembly and WebGL. We discovered that CanvasKit can deliver superior performance, fidelity, and correctness, enabling the level of graphical horsepower.</p><p>Each renderer offers advantages in different scenarios, so Flutter is supporting both rendering modes:</p><ul><li><strong>HTML renderer:</strong> Uses a combination of HTML elements, CSS, Canvas elements, and SVG elements. This renderer has a smaller download size.</li><li><strong>CanvasKit renderer:</strong> This renderer is fully consistent with Flutter mobile and desktop, has faster performance with higher widget density, but adds about 2MB in download size.</li></ul><p>You can also use — web-renderer html or — web-renderer canvaskit to explicitly choose which renderer your app uses.</p><p><strong>Web-specific features</strong></p><p>The web has many strengths, especially its global reach. One of the many reasons to bring your existing Flutter app to the web is to reach users outside of app stores. To do that, flutter added support for custom URL strategies, to ensure that it’s possible for your users to reach your app anywhere with just a click of a URL. With this feature, you have control over the URLs shown in the address bar as well as the routing of your app on the web.</p><p>Hyperlinks are also critical to how users navigate the web. A new <strong>link widget </strong>in the <strong>url_launcher </strong>package enables users to deep link to anchors within your app or to external websites. You can use link on relevant widgets, including buttons, inline text, images, and specify whether the link opens in the same tab or in a new tab.</p><p>Interacting with text is just as important as being able to render text quickly and accurately. Text can now be selected, copied, and pasted by using <strong>SelectableText </strong>and <strong>EditableText </strong>widgets. Also, form text fields support <strong>autofill </strong>by enabling the browser to store data and handle cases for future autofills.</p><p>When you create a Flutter web app, we include a PWA web <strong>manifest file</strong>, as well as code to setup service workers. The <strong>manifest file</strong> provides metadata about how your app should run, including information like icons and an app title. Service workers enable caching of resources and running your app offline. When running a Flutter app in the browser as a PWA, you’ll see the opportunity to install it to your device, whether as a mobile or desktop app.</p><p><strong>Support for desktop form factors</strong></p><p>Flutter wants to make web experiences feel right, regardless of the shape and size of your browser window. On mobile browsers, Flutter apps already have excellent support for gestures and scrolling physics inherited from mobile app support. But desktop browsers offer different UI affordances, and so updated Flutter accordingly.</p><p>For instance, there is an expectation for content on the desktop to display scrollbars that can be controlled by a mouse or keyboard. So, the new customizable interactive scrollbars support a theme, a track, and the ability to scroll by dragging a thumb. The PrimaryScrollController has been expanded so that you can use keyboard shortcuts to scroll without having to wire up your own scroll views.</p><p>Flutter also increased the default content density, because mouse pointers support a tighter density than touch devices. And we added a superset of system mouse cursors in the framework to support all platforms.</p><p>Finally, to support all users, Flutter’s web semantic features are expanded to support accessibility for Windows, macOS, and ChromeOS. On the web, a second DOM tree called the SemanticsNode tree is generated in parallel to the RenderObject DOM tree. The SemanticsNode tree translates the flags, actions, labels, and other semantic properties into ARIA attributes. Now you can use Narrator, VoiceOver, TalkBack, or ChromeVox screen readers to navigate a Flutter web app.</p><p><strong>Plugin ecosystem</strong></p><p>Since the beta release and with help from the community, support for the following plugins was added:</p><ul><li>image_picker</li><li>google_maps</li><li>firebase_analytics</li><li>firebase_storage</li><li>connectivity</li><li>cloud_firestore</li><li>cloud_functions</li><li>cross_file</li></ul><h3><strong>Sound Null Safety</strong></h3><p>Void safety (also known as null safety) is a guarantee within an object-oriented programming language that no object references will have null or void values.</p><p>In object-oriented languages, access to objects is achieved through references (or, equivalently, pointers). A typical call is of the form:</p><p><em>x.f(a, …)</em></p><p>where f denotes an operation and x denotes a reference to some object. At execution time, however, a reference can be void (or null). In such cases, the call above will be a void call, leading to a run-time exception, often resulting in abnormal termination of the program.</p><p>Void safety is a static (compile-time) guarantee that no void calls will ever arise.</p><p>Sound null safety is a significant addition to the Dart language, which further strengthens the type system by distinguishing nullable types from non-nullable types. This enables developers to prevent null error crashes, a common reason for apps to crash. By incorporating null checks into the type system, these errors can be caught during development, thus preventing crashes in production. Sound null safety is fully supported in stable as of Flutter 2, which contains Dart 2.12.</p><p>The pub.dev package repository already has more than 1,000 null safe packages published, including hundreds of packages by the Dart, Flutter, Firebase, and Material teams.</p><h3><strong>Desktops, foldables, and embedded devices</strong></h3><p><strong>Desktop support for flutter</strong></p><p>Desktop support allows you to compile Flutter source code to a native Windows, macOS, or Linux desktop app. Flutter’s desktop support also extends to plugins — you can install existing plugins that support the Windows, macOS, or Linux platforms, or you can create your own.</p><p>To create a Flutter application with desktop support, you need the following software:</p><ol><li>Flutter SDK. See the Flutter SDK installation instructions.</li><li>Optional: An IDE that supports Flutter. You can install Android Studio, IntelliJ IDEA, or Visual Studio Code and install the Flutter and Dart plugins to enable language support and tools for refactoring, running, debugging, and reloading your desktop app within an editor. See setting up an editor for more details.</li></ol><p>Additional Windows requirements:</p><p>For Windows desktop development, you need the following in addition to the Flutter SDK:</p><ul><li>Visual Studio 2019 (not to be confused with Visual Studio Code) with the “Desktop development with C++” workload installed, including all of its default components</li></ul><p>Additional macOS requirements:</p><p>For macOS desktop development, you need the following in addition to the Flutter SDK:</p><ul><li>Xcode</li><li>CocoaPods if you use plugins</li></ul><p>Additional Linux requirements:</p><p>For Linux desktop development, you need the following in addition to the Flutter SDK:</p><ul><li>Clang</li><li>CMake</li><li>GTK development headers</li><li>Ninja build</li><li>pkg-config</li></ul><p>Set up:</p><p>At the command line, perform the following commands to make sure that you have the latest desktop support and that it’s enabled. If you see “flutter: command not found”, then make sure that you have installed the Flutter SDK and that it’s in your path.</p><p><em>flutter config — enable-&lt;platform&gt;-desktop</em></p><p>Where <em>&lt;platform&gt;</em> is windows, macos, or linux.</p><p>Create and run:</p><p>Creating a new project with desktop support is no different than creating a new Flutter project for other platforms.</p><p>Once you’ve configured your environment for desktop support, you can create and run a desktop application either in the IDE or from the command line.</p><p>Using an IDE:</p><p>After you’ve configured your environment to support desktop, make sure you restart the IDE if it was already running.</p><p>Create a new application in your IDE and it automatically creates iOS, Android, web, and desktop versions of your app. From the device pulldown, select windows (desktop), macOS (desktop), or linux (desktop) and run your application to see it launch on the desktop.</p><p>From the command line:</p><p>To create a new application that includes desktop support (in addition to mobile and web support), run the following commands, substituting myapp with the name of your project:</p><p><em>flutter create myapp</em></p><p><em>cd myapp</em></p><p>To launch your application from the command line, enter one of the following commands from the top of the package:</p><p><em>flutter run -d windows</em></p><p><em>flutter run -d macos</em></p><p><em>flutter run -d linux</em></p><p>Build a release app</p><p>To generate a release build, run one of the following commands:</p><p><em>flutter build windows</em></p><p><em>flutter build macos</em></p><p><em>flutter build linux</em></p><p>Distribution:</p><p>Flutter don’t recommend releasing a desktop application until desktop support is stable.</p><p>In this release, Flutter announced that desktop support is available in the stable channel under an early release flag. What this means is that Flutter is ready to try as a deployment target for your Flutter apps: you can think of it as a “beta snapshot” that previews the final stable release coming later this year.</p><p>To bring Flutter desktop to this degree of quality, there have been improvements both big and small, starting with working to ensure that text editing operates like the native experience on each of the supported platforms, including foundational features like text selection pivot points and being able to stop propagation of a keyboard event once it’s been handled. On the mouse input side, dragging with a high precision pointing device now starts immediately instead of waiting for the lag needed when handling touch input. Also, a built-in context menu has been added to the TextField and TextFormField widgets for Material and Cupertino design languages. Finally, grab handles have been added to the ReorderableListView widget.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z6ChOXGSZomdquqEbCQLNg.gif" /><figcaption>The ReorderableListView now has grab handles for easy drag ’n’ drop with a mouse</figcaption></figure><p>The ReorderableListView was always good at moving items around with very little effort on your part as a developer, but it required the user to initiate a drag using a long-press. That made sense on a mobile device, but few desktop users would think to long-press on an item with their mouse to move it around, so this release includes a grab handle suitable for mouse or touch input. Another improvement for platform-idiomatic functionality is an updated scrollbar that shows up correctly for the desktop form-factor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a74a-Ni_8NerC26WLCTdQg.gif" /><figcaption>This release includes an updated Scrollbar widget that works great in a desktop environment</figcaption></figure><p>The Scrollbar widget has been updated to provide the interactive features that are expected on the desktop, including the ability to drag the thumb, click on the track to page up and down, and to show a track when the mouse hovers over any part of the scrollbar. Furthermore, since the Scrollbar is themeable using the new ScrollbarTheme class, you can style it to match your app’s look and feel.</p><p>For additional desktop-specific functionality, this release also enables command-line argument handling for Flutter apps so that simple things like a double-click on a data file in the Windows File Explorer can be used to open the file in your app. We’ve also worked hard to make resizing much smoother for both Windows and macOS, and to enable IME (Input Method Editors) for international users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*FUxvtxVMo2nvVLijFJO5Fw.gif" /><figcaption>Flutter desktop now supports intuitive IME input</figcaption></figure><p>Finally,<strong> Toyota</strong>, the world’s best-selling automaker, announced its plans to bring a best-in-market digital experience to vehicles, by building infotainment systems powered by Flutter. Using Flutter marks a large departure in approach from how in-vehicle software has been developed in the past. Toyota chose Flutter because of its high performance and consistency of experience, fast iteration and developer ergonomics as well as smartphone-tier touch mechanics. By using Flutter’s embedder API, Toyota is able to tailor Flutter for the unique needs of an in-vehicle system.</p><h3><strong>Google Mobile Ads</strong></h3><p>Recently flutter announced the beta release of Google Mobile Ads for Flutter, a new SDK that works with AdMob and AdManager to offer a variety of ad formats, including banner, interstitial, native, and rewarded video ads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fvr0v6T-UYR6wWx6GIYVRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hf56-hNgcFzVt3YSctQI3Q.png" /></figure><h3><strong>New iOS features</strong></h3><p>This release fulfills a long-standing request to build an IPA directly from the command line without opening Xcode and updates the CocoaPods version to match the latest tooling. In addition, a few iOS widgets have been added to the Cupertino design language implementation.</p><p>A new CupertinoSearchTextField offers the iOS search bar UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/0*rJUjLta8BVgCTrCw" /></figure><p>The CupertinoFormSection, CupertinoFormRow, and CupertinoTextFormFieldRow widgets make it easier to produce validated form fields with iOS’s sectioned visual aesthetics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*jQxez5RDRHdHOddjAAY_UQ.png" /></figure><h3><strong>New widgets: Autocomplete and ScaffoldMessenger</strong></h3><p>This release of Flutter comes with two additional new widgets, AutocompleteCore and ScaffoldMessenger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*-0ajeXrAdmhxHnlFR_apLw.gif" /></figure><p>Autocomplete is an often-requested feature for Flutter, so this release starts to provide this functionality. You can use it today, but if you’re curious about the design for the complete feature, check out the autocomplete design document.</p><p>Likewise, the ScaffoldMessenger was created to deal with a number of SnackBar-related issues, including the ability to easily create a SnackBar in response to an AppBar action, creating SnackBars to persist between Scaffold transitions, and being able to show SnackBars at the completion of an asynchronous action, even if the user has navigated to a page with a different Scaffold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*hK9SVjvl4M8Zs43ldddyTw.gif" /></figure><p>All of this goodness can be yours with a couple of lines of code that you should be using from now on to display your SnackBars:</p><p><em>final messenger = ScaffoldMessenger.of(context); <br>messenger.showSnackBar(SnackBar(content: Text(‘I can fly.’)));</em></p><h3><strong>Multiple Flutter instances with Add-to-App</strong></h3><p>It’s sometimes not practical to rewrite your entire application in Flutter all at once. For those situations, Flutter can be integrated into your existing application piecemeal, as a library or module. That module can then be imported into your Android or iOS (currently supported platforms) app to render a part of your app’s UI in Flutter. Or, just to run shared Dart logic.</p><p>In a few steps, you can bring the productivity and the expressiveness of Flutter into your own app.</p><p>As of Flutter v1.12, add-to-app is supported for the basic scenario of integrating one full-screen Flutter instance at a time per app. It currently has the following limitations:</p><p>Packing multiple Flutter libraries into an application isn’t supported.</p><p>Plugins used in add-to-app on Android should migrate to the new Android plugin APIs, based on FlutterPlugin.</p><p>Plugins that don’t support FlutterPlugin might have unexpected behaviors if they make assumptions that are untenable in add-to-app (such as assuming that a Flutter Activity is always present).</p><p>As of v1.17, the Flutter module only supports AndroidX applications on Android.</p><p>As of Flutter v1.26, add-to-app experimentally supports adding multiple instances of Flutter engines, screens, or views into your app. This can help integration scenarios such as a hybrid navigation stack with mixed native and Flutter screens, or a page with multiple partial-screen Flutter views. Having multiple Flutter instances allows each instance to maintain independent application and UI state while using minimal memory resources.</p><p><strong>Supported features</strong></p><p>Add to Android applications:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QQ7zzHtmRwQL4_gf22dJqA.gif" /></figure><ol><li>Auto-build and import the Flutter module by adding a Flutter SDK hook to your Gradle script.</li><li>Build your Flutter module into a generic Android Archive (AAR) for integration into your own build system and for better Jetifier interoperability with AndroidX.</li><li>FlutterEngine API for starting and persisting your Flutter environment independently of attaching a FlutterActivity/FlutterFragment etc.</li><li>Android Studio Android/Flutter co-editing and module creation/import wizard.</li><li>Java and Kotlin host apps are supported.</li><li>Flutter modules can use Flutter plugins to interact with the platform. Android plugins should be migrated to the V2 plugins APIs for best add-to-app correctness. As of Flutter v1.12, most of the plugins maintained by the Flutter team as well as FlutterFire have been migrated.</li><li>Support for Flutter debugging and stateful hot reload by using flutter attach from IDEs or the command line to connect to an app that contains Flutter.</li></ol><p>Add to iOS applications:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*e4PpFFXbFtgAwHxibMZL-w.gif" /></figure><ol><li>Auto-build and import the Flutter module by adding a Flutter SDK hook to your CocoaPods and to your Xcode build phase.</li><li>Build your Flutter module into a generic iOS Framework for integration into your own build system.</li><li>FlutterEngine API for starting and persisting your Flutter environment independently of attaching a FlutterViewController.</li><li>Objective-C and Swift host apps supported.</li><li>Flutter modules can use Flutter plugins to interact with the platform.</li><li>Support for Flutter debugging and stateful hot reload by using flutter attach from IDEs or the command line to connect to an app that contains Flutter.</li></ol><p>See more in the multiple Flutter below,</p><p>Before Flutter 2.0.0, multiple instances of FlutterEngine and its associated UI could be launched, but each instance came with significant latency and fixed memory cost.</p><p>Multiple Flutter instances can be useful in the following scenarios:</p><ul><li>An application where the integrated Flutter screen is not a leaf node of the navigation graph, and the navigation stack might be a hybrid mixture of native -&gt; Flutter -&gt; native -&gt; Flutter.</li><li>A screen where multiple partial screen Flutter views might be integrated and visible at once.</li></ul><p>The advantage of using multiple Flutter instances is that each instance is independent and maintains its own internal navigation stack, UI, and application states. This simplifies the overall application code’s responsibility for state keeping and improves modularity.</p><p>In the past, additional Flutter instances had the same memory cost as the first instance. In Flutter 2, it reduced the static memory cost of creating additional Flutter engines by ~99% to ~180kB per instance.</p><h3><strong>Flutter Fix</strong></h3><p>Flutter Fix is a combination of things. First, there’s a new command-line option to the dart CLI tool called dart fix that knows where to look for a list of deprecated APIs and how to update code using those APIs. Second, it’s the list of available fixes itself, which is bundled with the Flutter SDK as of version 2. And finally, it’s an updated set of Flutter extensions for the VS Code, IntelliJ, and Android Studio IDEs that know how to expose that same list of available fixes as quick fixes with little light bulbs that will help you to change the code with a click of your mouse.</p><p>As an example, let’s say you had the following line of code in your app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*zutDMYcvBfEwH26Oq_1Pwg.png" /><figcaption>Creating a Flutter widget using a deprecated argument</figcaption></figure><p>Because the argument to this constructor is deprecated, it should be replaced with the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*pyfz0rohcN-blPssal31xQ.png" /><figcaption>Creating a Flutter widget with the deprecated argument replaced</figcaption></figure><p>Even if you’re familiar with all of the many Flutter deprecations, the larger the number of changes you have to make in your code, the harder it is for you to apply all of the fixes and the easier it is to make mistakes; humans are not great at these kinds of repetitive tasks. But computers are; by executing the following command, you can see all of the fixes we know how to make across your entire project:</p><p><em>$ dart fix — dry-run</em></p><p>If you’d like to apply them in bulk, you can easily do so:</p><p><em>$ dart fix — apply</em></p><p>Or, if you’d like to apply these fixes interactively in your favorite IDE, you can do that, too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*mIZBksF3_1gXVODxdZUdIA.png" /></figure><h3><strong>Ecosystem updates</strong></h3><p>The Flutter development experience includes more than the framework and the tools; it also includes the wide range of packages and plugins available for Flutter apps. In the time since the last Flutter stable release, much has happened in that space as well. For example, between the camera and the video_player plugins, nearly 30 PRs have been merged to greatly increase the quality of both. If you’ve had trouble using either of these in the past, you should have another look; we think you’ll find them much more robust.</p><p>Also, if you’re a Firebase user, we are pleased to announce that the most popular plugins have been brought to production quality, including null safety support, and a full set of reference documentation and common usage tutorials for Android, iOS, web, and macOS. These plugins include the following</p><ul><li>Core</li><li>Authentication</li><li>Cloud Firestore</li><li>Cloud Functions</li><li>Cloud Messaging</li><li>Cloud Storage</li><li>Crashlytics</li></ul><p>Also, if you’re looking for crash reporting for your app, you may want to consider Sentry, which has announced a new SDK for Flutter apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F7YDQEdQxlVnbxwve2lpiA.png" /><figcaption>The Sentry crash reporting tool now supports Flutter</figcaption></figure><p>With Sentry’s SDK for Flutter, you can be notified of errors that occur on Android, iOS, or native platforms in real-time. You can see the details in the Sentry documentation.</p><p>In addition, if you haven’t yet seen the Flutter Community “plus” plugins, you’ll want to check them out. They’ve forked a number of the popular plugins initially developed by the Flutter team and have added null safety support, support for additional platforms and a whole new set of documentation as well as beginning to fix appropriate issues from the flutter/plugins repository. These plugins include the following:</p><ul><li>Android Alarm+</li><li>Android Intent+</li><li>Battery+</li><li>Connectivity+</li><li>Device Info+</li><li>Network Info+</li><li>Package Info+</li><li>Sensors+</li><li>Share+</li></ul><p>At this point, the set of Flutter-compatible packages and plugins numbers greater than 15,000, which makes it hard to find those you should consider first. For this reason, we publish the Pub Points (static analysis scoring), popularity rank, likes and, for exceptionally high quality, a special designation for those packages marked as a Flutter Favorite. In time for Flutter 2, we’ve added several new packages to the list of favorites:</p><ul><li>animated_text_kit</li><li>bottom_navy_bar</li><li>chopper</li><li>font_awesome_flutter</li><li>flutter_local_notifications</li><li>just_audio</li></ul><p>And last but certainly not least, for package authors or package users interested in whether the latest version of a package works on a recent version of Flutter, you’ll want to check out Codemagic’s new pub.green site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wP-efroUQAPUVnxEwc10LA.png" /><figcaption>Codemagic’s new <a href="http://pub.green/">pub.green</a> site shows compatibility for the top packages with recent Flutter releases</figcaption></figure><h3>References</h3><ul><li><a href="https://medium.com/flutter/whats-new-in-flutter-2-0-fe8e95ecc65">What’s New in Flutter 2.0</a></li><li><a href="https://developers.googleblog.com/search/label/Flutter%20Engage">Google Developers Blog</a></li><li><a href="https://medium.com/flutter/flutter-web-support-hits-the-stable-milestone-d6b84e83b425">Flutter web support hits the stable milestone</a></li><li><a href="https://flutter.dev/desktop#create-a-new-project">Desktop support for Flutter</a></li><li><a href="https://flutter.dev/docs/development/add-to-app">Add Flutter to existing app</a></li><li><a href="https://flutter.dev/docs/development/add-to-app/multiple-flutters">Multiple Flutter screens or views</a></li><li><a href="https://flutter.dev/docs/development/tools/flutter-fix">Flutter Fix</a></li></ul><p>Thank you…!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7cb6d965afb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AES Encryption(Intro).Comparing AES encryption in Dart and Java with an example.]]></title>
            <link>https://ganeshlg.medium.com/aes-encryption-intro-comparing-aes-encryption-in-dart-and-java-with-an-example-303730eeed9a?source=rss-deac55377474------2</link>
            <guid isPermaLink="false">https://medium.com/p/303730eeed9a</guid>
            <category><![CDATA[encryption-flutter-native]]></category>
            <category><![CDATA[flutter-aes-encryption]]></category>
            <category><![CDATA[dart-vs-java-aes]]></category>
            <category><![CDATA[aes-encrption-basics]]></category>
            <category><![CDATA[aes-encryption]]></category>
            <dc:creator><![CDATA[Ganesh L G]]></dc:creator>
            <pubDate>Fri, 25 Dec 2020 09:19:23 GMT</pubDate>
            <atom:updated>2020-12-25T15:43:16.800Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*k6mbTeCaGJQphwOUzqKiig.jpeg" /></figure><p>The following article gives you a small idea about AES (Advanced encryption standard).</p><p>The advanced encryption standard is a symmetric block cipher. AES is implemented in software and hardware all over the world to encrypt data.</p><p>Now let us see how does it work,</p><p>AES includes three block ciphers :</p><blockquote>AES-128</blockquote><blockquote>AES-192</blockquote><blockquote>AES-256</blockquote><p>As the name only defines that AES-128,192,256 uses 128,192,256 bit key length to encrypt and decrypt a block of messages. Each cipher encrypts and decrypts data in blocks of 128 bits using cyptographic keys of 128,192 and 256 bits respectively.</p><p>The ciphers use the same key for encrypting and decrypting, so the sender and receiver must both know and use same secret key.</p><p>Described above types uses different rounds in the process. A round consists of several processing steps that include substitution, transportation and mixing of the input plain text to transform it into the final output of cipher text.</p><blockquote>128 bit keys -&gt; 10 rounds</blockquote><blockquote>192 bit keys -&gt; 12 rounds</blockquote><blockquote>256 bit keys -&gt; 14 rounds</blockquote><p>Below, you can see the basic design diagram for reference…!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*GgYyPdhQ2oZ2jBclX7F52g.png" /></figure><p>Let’s understand what is IV(initialization vector) before proceeding to the example.</p><p>IV(initialization vector) -&gt; In cryptography an initialization vector is a fixed size input to a cryptographic primitive.</p><p>In simple words, IV adds randomness to the start of your encryption process.</p><p>Below you can find example for AES encryption in both java(Native) and dart(Flutter).</p><p>Java-AESHelper.java</p><blockquote>import android.os.Build;</blockquote><blockquote>import android.util.Base64;</blockquote><blockquote>import androidx.annotation.RequiresApi;</blockquote><blockquote>import java.nio.charset.StandardCharsets;</blockquote><blockquote>import java.util.Arrays;</blockquote><blockquote>import javax.crypto.Cipher;</blockquote><blockquote>import javax.crypto.spec.IvParameterSpec;</blockquote><blockquote>import javax.crypto.spec.SecretKeySpec;</blockquote><blockquote>public class AesHelper {</blockquote><blockquote>private static final String keyMain = “aesEncryptionKey”;</blockquote><blockquote>private static final String initVector = “aesEncryptionIV!”;</blockquote><blockquote>@RequiresApi(api = Build.VERSION_CODES.KITKAT)</blockquote><blockquote>public static String encrypt(String value) {</blockquote><blockquote>try {</blockquote><blockquote>IvParameterSpec iv = new IvParameterSpec(initVector.getBytes(“UTF-8”));</blockquote><blockquote>SecretKeySpec skeySpec = new SecretKeySpec(keyMain.getBytes(“UTF-8”), “AES”);</blockquote><blockquote>System.out.println(“Native Output…!!!”);</blockquote><blockquote>System.out.println(“IV: “+Arrays.toString(iv.getIV()));</blockquote><blockquote>System.out.println(“KEY: “+Arrays.toString(skeySpec.getEncoded()));</blockquote><blockquote>Cipher cipher = Cipher.getInstance(“AES/CBC/PKCS7PADDING”);</blockquote><blockquote>cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);</blockquote><blockquote>byte[] encrypted = cipher.doFinal(value.getBytes());</blockquote><blockquote>System.out.println(“Encrypted: “+Arrays.toString(encrypted));</blockquote><blockquote>System.out.println(“Base64: “+Base64.encodeToString(encrypted,0));</blockquote><blockquote>return Base64.encodeToString(encrypted,0);</blockquote><blockquote>} catch (Exception ex) {</blockquote><blockquote>ex.printStackTrace();</blockquote><blockquote>}</blockquote><blockquote>return null;</blockquote><blockquote>}</blockquote><blockquote>@RequiresApi(api = Build.VERSION_CODES.KITKAT)</blockquote><blockquote>public static String decrypt(String encrypted) {</blockquote><blockquote>try {</blockquote><blockquote>IvParameterSpec iv = new IvParameterSpec(initVector.getBytes(“UTF-8”));</blockquote><blockquote>SecretKeySpec skeySpec = new SecretKeySpec(keyMain.getBytes(“UTF-8”), “AES”);</blockquote><blockquote>Cipher cipher = Cipher.getInstance(“AES/CBC/PKCS5PADDING”);</blockquote><blockquote>cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);</blockquote><blockquote>byte[] original = cipher.doFinal(Base64.decode(encrypted,0));</blockquote><blockquote>System.out.println(new String(original));</blockquote><blockquote>return new String(original);</blockquote><blockquote>} catch (Exception ex) {</blockquote><blockquote>ex.printStackTrace();</blockquote><blockquote>}</blockquote><blockquote>return null;</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><p>Dart-AESHelper.dart</p><blockquote>import ‘package:encrypt/encrypt.dart’;//pubspec.yaml-&gt;encrypt: ^4.1.0</blockquote><blockquote>String key = “aesEncryptionKey”;</blockquote><blockquote>String iv = “aesEncryptionIV!”;</blockquote><blockquote>Encrypted encrypt(String plainText){</blockquote><blockquote>final key1 = Key.fromUtf8(key);</blockquote><blockquote>final iv1 = IV.fromUtf8(iv);</blockquote><blockquote>final encrypter = Encrypter(AES(key1));</blockquote><blockquote>print(“Dart Output…!!!”);</blockquote><blockquote>print(“IV: “ + iv1.bytes.toString());</blockquote><blockquote>print(“Key: “ + key1.bytes.toString());</blockquote><blockquote>final encrypted = encrypter.encrypt(plainText, iv: iv1);</blockquote><blockquote>print(“Encrypted: “+ encrypted.bytes.toString());</blockquote><blockquote>print(“Base64: “+encrypted.base64);</blockquote><blockquote>return encrypted;</blockquote><blockquote>}</blockquote><blockquote>String decrypt(Encrypted encrypted){</blockquote><blockquote>final key1 = Key.fromUtf8(key);</blockquote><blockquote>final iv1 = IV.fromUtf8(iv);</blockquote><blockquote>final encrypter = Encrypter(AES(key1));</blockquote><blockquote>final decrypted = encrypter.decrypt(encrypted, iv: iv1);</blockquote><blockquote>print(“Decrypted: “+ decrypted);</blockquote><blockquote>return decrypted;</blockquote><blockquote>}</blockquote><p>Comparing AES encryption in Java and Dart.</p><p>Native Output…!!!</p><blockquote>IV: [97, 101, 115, 69, 110, 99, 114, 121, 112, 116, 105, 111, 110, 73, 86, 33]</blockquote><blockquote>KEY: [97, 101, 115, 69, 110, 99, 114, 121, 112, 116, 105, 111, 110, 75, 101, 121]</blockquote><blockquote>Encrypted: [-83, 37, -81, -115, -48, 49, -15, -97, -54, -96, 54, -101, 109, 34, 95, -121]</blockquote><blockquote>Base64: rSWvjdAx8Z/KoDabbSJfhw==</blockquote><blockquote>Decrypted: Ganesh L G</blockquote><p>Dart Output…!!!</p><blockquote>IV: [97, 101, 115, 69, 110, 99, 114, 121, 112, 116, 105, 111, 110, 73, 86, 33]</blockquote><blockquote>Key: [97, 101, 115, 69, 110, 99, 114, 121, 112, 116, 105, 111, 110, 75, 101, 121]</blockquote><blockquote>Encrypted: [173, 37, 175, 141, 208, 49, 241, 159, 202, 160, 54, 155, 109, 34, 95, 135]</blockquote><blockquote>Base64: rSWvjdAx8Z/KoDabbSJfhw==</blockquote><blockquote>Decrypted: Ganesh L G</blockquote><p>The negative numbers in encrypted byte array in native side is due to java signed byte’s(range:-128 to 127), but dart is using unsigned byte’s(range:-0 to 255).</p><p>(just add +256 to negative byte’s to cross verify).</p><p>Thank You…!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=303730eeed9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Passing parameters from Flutter(Dart) <-> Android(Native)]]></title>
            <link>https://ganeshlg.medium.com/passing-parameters-from-flutter-dart-android-native-6b3730eac2b9?source=rss-deac55377474------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b3730eac2b9</guid>
            <category><![CDATA[flutter-platform-specific]]></category>
            <category><![CDATA[passing-parameters-dart]]></category>
            <category><![CDATA[flutter-native]]></category>
            <category><![CDATA[darttonative]]></category>
            <category><![CDATA[dart-to-kotlin]]></category>
            <dc:creator><![CDATA[Ganesh L G]]></dc:creator>
            <pubDate>Fri, 18 Dec 2020 18:41:47 GMT</pubDate>
            <atom:updated>2021-04-28T10:31:32.316Z</atom:updated>
            <content:encoded><![CDATA[<h3>Passing parameters Flutter(Dart) &lt;-&gt; Android(Native)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*uO61_ZIFV2Se7B4kqWpl2A.jpeg" /></figure><p>The following article describes how to pass parameters and invoke method from native-android to flutter and vice versa with basic “data transfer” example.</p><p>Refer to the following link to know basics about the platform specific code from my previous story.</p><p><a href="https://ganeshlg.medium.com/custom-platform-specific-code-flutter-android-native-2f7191121475">Custom Platform Specific Code(Flutter)-Android Native | by Ganesh L G | Nov, 2020 | Medium</a></p><p>The following code will guide you , how you can actually pass the parameters in both native(kotlin) and dart(flutter).</p><p>Client(dart)-main.dart</p><blockquote>const platform = const MethodChannel(‘flutter.native/helper’);</blockquote><blockquote>Future&lt;void&gt; platfromSpecific(text1,text2) async {</blockquote><blockquote>try {</blockquote><blockquote>final int result = await platform.invokeMethod(‘flutterToNative’,{“text1”:text1,”text2&quot;:text2});</blockquote><blockquote>} on PlatformException catch (e) {</blockquote><blockquote>print(e.message);</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><blockquote>Future&lt;dynamic&gt; handlePlatformChannelMethods() async {</blockquote><blockquote>platform.setMethodCallHandler((methodCall) async {</blockquote><blockquote>if (methodCall.method == “nativeToFlutter”) {</blockquote><blockquote>String text = methodCall.arguments;</blockquote><blockquote>//Parameters received from Native…!!!!</blockquote><blockquote>List&lt;String&gt; message = text.split(‘,’);//</blockquote><blockquote>String text1 = message[0];</blockquote><blockquote>String text2 = message[1];</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><blockquote>//Always call the the above function in initState() wherever ur using it…!!!</blockquote><blockquote>initState(){</blockquote><blockquote>super.initState();</blockquote><blockquote>handlePlatformChannelMethods();</blockquote><blockquote>}</blockquote><p>Native(Kotlin)-MainActivity.kt</p><blockquote>class MainActivity: io.flutter.embedding.android.FlutterActivity(){</blockquote><blockquote>private val CHANNEL = “flutter.native/helper”</blockquote><blockquote>override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {</blockquote><blockquote>super.configureFlutterEngine(flutterEngine)</blockquote><blockquote>MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result -&gt;</blockquote><blockquote>// Note: this method is invoked on the main thread.</blockquote><blockquote>// TODO</blockquote><blockquote>if(call.method == “flutterToNative”){</blockquote><blockquote>//Parameters received from dart…!!!!</blockquote><blockquote>val text1 = call.argument&lt;String&gt;(“text1”)</blockquote><blockquote>val text2 = call.argument&lt;String&gt;(“text2”)</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><blockquote>//To invoke method in client(flutter)</blockquote><blockquote>fun nativeToFlutter(text1:String?,text2:String?){</blockquote><blockquote>MethodChannel(flutterEngine!!.dartExecutor.binaryMessenger, CHANNEL).invokeMethod(“nativeToFlutter”,”$text1,$text2&quot;);</blockquote><blockquote>}</blockquote><blockquote>}</blockquote><p>Thank you…!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b3730eac2b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>