<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dhruvil Patel</title>
    <description>The latest articles on DEV Community by Dhruvil Patel (@dhruvilp).</description>
    <link>https://dev.to/dhruvilp</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F559457%2Ff4f4bbbf-0ccc-4001-8258-c8fe96e666bc.png</url>
      <title>DEV Community: Dhruvil Patel</title>
      <link>https://dev.to/dhruvilp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dhruvilp"/>
    <language>en</language>
    <item>
      <title>Provider — Manage your state efficiently in Flutter.</title>
      <dc:creator>Dhruvil Patel</dc:creator>
      <pubDate>Thu, 23 Sep 2021 19:03:31 +0000</pubDate>
      <link>https://dev.to/dhruvilp/provider-manage-your-state-efficiently-in-flutter-34ho</link>
      <guid>https://dev.to/dhruvilp/provider-manage-your-state-efficiently-in-flutter-34ho</guid>
      <description>&lt;h2&gt;
  
  
  Understanding basic state management concept:
&lt;/h2&gt;

&lt;p&gt;Before diving deep into the Provider package, let’s understand what state management is.&lt;br&gt;
For better understanding, we’ll take a simple shopping app for reference.&lt;br&gt;
In the above image, we can see that there is an app bar, a drawer, a cart, a favorites section, an orders section, and products.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6p4cvi3komcw5iuvmz2l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6p4cvi3komcw5iuvmz2l.png" alt="App wireframe"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Firstly, let’s decrypt the above image. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At the very top, there’s &lt;strong&gt;MyApp&lt;/strong&gt; class which is the entry point of our app. Then it’s divided into 4 paths which lead to separate classes and functionality homepage, cart, favorites, orders. Further away, the homepage extends to provide us the app bar and access to product items.&lt;/li&gt;
&lt;li&gt;Now, if we add a particular product as a favorite or as a cart item then we need to call &lt;strong&gt;setState()&lt;/strong&gt; and update the UI of the Favorites screen or the cart screen respectively. Not to forget about passing the data along when clicking on favorites or the cart icons. By the data we passed, we can now display the products which were marked as favorite or added to the cart. But sometimes it becomes janky/messy while managing state, passing data, updating the UI, etc. all at once.&lt;/li&gt;
&lt;li&gt;In short, all our data should be in the topmost widget/class (in this case MyApp), and bypassing it through arguments from widget to widget becomes kind of messy. Also, performant issues can arrive as if any smaller widget needs data, the whole parent class will change its state. So to prevent it, we use the Provider package.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Provider Package intro:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Implementation of the Provider package is pretty simple.
Firstly, select the class of which, the data should be shared among the whole app. Then simply add &lt;strong&gt;ChangeNotifier&lt;/strong&gt; class in mixin form with the ‘with’ keyword.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Quick tip:&lt;br&gt;
In the case of inheritance, we instance the whole class into another class. While if we add a mixin to a class, it is just instance properties and methods of the class added.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1q91kd9rrd06ytv2oh2i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1q91kd9rrd06ytv2oh2i.png" alt="Change Notifier"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;As shown in the above image, YourClassName mixes with ChangeNotifier class. It is a special class provided by the Provider package.&lt;/li&gt;
&lt;li&gt;Now, we can also see &lt;strong&gt;notifyListeners()&lt;/strong&gt; method which comes with ChangeNotifier class.
What this function does is that if there is some change in data in the class where ChangeNotifier is mixed(in this case YourClassName), it will call the method and update the data and reflect it on the UI.
Taking in mind the example of our e-commerce app, let’s understand this method.&lt;/li&gt;
&lt;li&gt;Let’s say there is a class named Products. In that, there are several methods like markAsFavorite(), addToCart(), etc.
Now, the products must be a map of properties of each product like price, description, title, id, isFavorite, etc.&lt;/li&gt;
&lt;li&gt;And when we call markAsFavorite() method, a new map will be formed containing only those products marked as favorite. This whole logic will be in this method and at last, there will be notifyListeners() which will tell the app state to change its data accordingly. This data can be used to render only those products which are marked favorite.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnggbjae4es9hwbslulc2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnggbjae4es9hwbslulc2.png" alt="listen true"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This was in class. But, how do we implement it in our widgets? Well, as mentioned in the above image,
first, we declare a variable and assign the data to it by fetching it through the provider. Its syntax is similar to that of media query if you've used it in flutter.
Likewise, it uses context to get the location from where the data is stored.&lt;/li&gt;
&lt;li&gt;Since it’s of a generic type, we have to provide what type of value/data we want. Like in Row/Column widget we mention .
Moving ahead, we can provide our class name in which the data is stored and the same data which we want to retrieve. And just like enums in the dart, we can access a specific part of data as shown in the image.&lt;/li&gt;
&lt;li&gt;Now, you may wonder that what is this listen: false mentioned in the below image even though the syntax is the same as above.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffejlp4pb2dgeer1rywq9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffejlp4pb2dgeer1rywq9.png" alt="listen false"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The difference is that: If we mention listening to false, it will not re-run every time some data is changed. This is useful when you just wanna display or store the data in the app. As it won’t require rebuilding the whole app, it will be beneficial to performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fci0fw8yq088xwklh5b9q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fci0fw8yq088xwklh5b9q.png" alt="ChangeNotifierProvider"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now, time to understand one of the very main concepts of implementing the provider package. As mentioned earlier, we need to provide the providers carrying data at the topmost level of our app. So it can be easily passed down through the whole app.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As shown in the image above, you can wrap your MaterialApp or entry widget inside another class provided by the provider package. The ChangeNotifierProvider class, which will have all the providers you need pointing to the respective class mixed with ChangeNotifier. This was the case for a single provider throughout the app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There’s also a scenario where you’ll see &lt;strong&gt;ChangeNotifierProvider.value&lt;/strong&gt; as in the below image.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkda74zxlhz26444nxc5t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkda74zxlhz26444nxc5t.png" alt="ChangeNotifierProvider.value"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The simple justification is that when you first initialize the class, it is better to use create method. After that, when every time you call ChangeNotifierProvider, you just need to call its value rather than the whole function which is already initialized in the main file.&lt;/li&gt;
&lt;li&gt;Moreover, in many cases, you may have more than one provider in your app.
The below-mentioned method would be the way to execute it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  MultiProvider:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fftyq3qzgjacdwkp7ged8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fftyq3qzgjacdwkp7ged8.png" alt="MultiProvider"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Yes, there is a &lt;strong&gt;MultiProvider&lt;/strong&gt; class. It basically consists of the list of providers and again same rules apply here. If you’re setting up the class for the very first time, you’ll need to use create method.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Consumer:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa8e8ks16wfeaqvt4e6tz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa8e8ks16wfeaqvt4e6tz.png" alt="Consumer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last but not the least, this will be the final topic covered in this blog post.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Consumer as from the syntax can be seen that is very much like Provider. And indeed it is. But it has its own benefit. Let’s see how.&lt;/li&gt;
&lt;li&gt;So, there are many circumstances when we just need data for a specific child widget and not for main or bigger widgets. Hence it doesn’t make sense to use the provider in that child’s parent widget.&lt;/li&gt;
&lt;li&gt;The reason is very simple. It will just rerun the whole parent widget unnecessarily whenever there is a change in its child widget.&lt;/li&gt;
&lt;li&gt;To sum it up, Consumer will only rebuild the widget it is attached to. In this case, the IconButton widget.
So, this was all about the Provider package and its implementation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Here are some links to documentation regarding the Provider package:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://pub.dev/packages/provider" rel="noopener noreferrer"&gt;Provider package documentation&lt;/a&gt;&lt;br&gt;
&lt;a href="https://flutter.dev/docs/development/data-and-backend/state-mgmt/simple" rel="noopener noreferrer"&gt;State management docs at flutter.dev&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>dart</category>
    </item>
    <item>
      <title>Navigation made easy with Flutter</title>
      <dc:creator>Dhruvil Patel</dc:creator>
      <pubDate>Fri, 06 Aug 2021 18:48:11 +0000</pubDate>
      <link>https://dev.to/dhruvilp/navigation-made-easy-with-flutter-4d9</link>
      <guid>https://dev.to/dhruvilp/navigation-made-easy-with-flutter-4d9</guid>
      <description>&lt;p&gt;Flutter is a framework for the dart programming language used for building cross-platform mobile apps and even web pages. Flutter converts code into the native language (Kotlin/Java, Swift for apps and HTML, CSS JS for web). &lt;/p&gt;

&lt;p&gt;Although, which app or website is better without navigation amongst screens or pages respectively unless you have single-page applications. &lt;/p&gt;

&lt;p&gt;Let's understand how Flutter provides such ease in navigation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Concept:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Flutter implements the concept of &lt;strong&gt;Stack&lt;/strong&gt; datatype in making navigation possible.&lt;/li&gt;
&lt;li&gt;In normal terms, Stack is a pile of objects referring to the concept of LIFO(Last In First Out). For example, the stack of books, the stack of money, etc. &lt;/li&gt;
&lt;li&gt;In Flutter's case, there is a stack of screens. Scaffolds or any custom widget which represents a screen.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Stack widget and stack referred here are two different cases. &lt;br&gt;
Here, a stack is referred to as datatype not &lt;a href="https://api.flutter.dev/flutter/widgets/Stack-class.html" rel="noopener noreferrer"&gt;Stack&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Methods of navigating:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Push()
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb6ansdtvbn6oh9u3sfq8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb6ansdtvbn6oh9u3sfq8.png" alt="Push"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the above code snippet, &lt;strong&gt;Navigator&lt;/strong&gt; class provides method &lt;strong&gt;push&lt;/strong&gt; which does the same function as in datatype. It pushes the screen on the top of the screen which is currently been rendered.&lt;/li&gt;
&lt;li&gt;Navigator accepts context to locate the position of the current Scaffold(Screen) in the widget tree.&lt;/li&gt;
&lt;li&gt;Then after, We pass another so-called method in push(). Moreover, &lt;strong&gt;MaterialPageRoute&lt;/strong&gt; is not mandatory. You can also provide &lt;strong&gt;CupertinoPageRoute&lt;/strong&gt; which will differ in transition effect only.&lt;/li&gt;
&lt;li&gt;To check out more about them: &lt;a href="https://api.flutter.dev/flutter/cupertino/CupertinoPageRoute-class.html" rel="noopener noreferrer"&gt;CupertinoPageRoute&lt;/a&gt;
&lt;a href="https://api.flutter.dev/flutter/material/MaterialPageRoute-class.html" rel="noopener noreferrer"&gt;MaterialPageRoute&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;It accepts builder argument to build the screen to which you will navigate.&lt;/li&gt;
&lt;li&gt;The following screen can be provided by arrow function or normal function as shown in snippet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  PushNamed()
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj6oc6qrcic7nqhh85ovb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj6oc6qrcic7nqhh85ovb.png" alt="PushNamed"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It has the same functionality as &lt;strong&gt;push()&lt;/strong&gt; do but rather than navigating dynamically, it accepts routes provided and accordingly proceeds.&lt;/li&gt;
&lt;li&gt;Similarly, it starts with

&lt;code&gt;Navigator.of(context)&lt;/code&gt;

, and then we implement &lt;strong&gt;pushNamed&lt;/strong&gt; method. It accepts the route name as its argument which will tell Flutter where to navigate.
&amp;gt; Important points to note:
* It is good to set a static route name so that it can be used not only in that particular file but also in the file where you set functions of navigation according to these route names.
* For example:
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxre0vj8l9t5jgkoyyh.png" alt="Routes"&gt;
* In the above snippet, routes argument is passed which is available in &lt;strong&gt;MaterialApp&lt;/strong&gt; which is the entry widget of your app. It consists of all the routes available or mentioned in your widgets.&lt;/li&gt;
&lt;/ul&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;To add the route we need to provide the route name by the way mentioned in the snippet. The class enum in which your route is and calling it like it's property&lt;br&gt;
&lt;br&gt;
&lt;code&gt;For e.g, Alignment.center&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then we provide value to route name in the form of arrow function of context, and the screen or rather the class constructor which should be rendered after navigation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Other than route name, we can also see the arguments parameter. It is simply the arguments you want to pass to the page we will be going to. For e.g, there is a shopping app and you want to navigate to the details of a product by clicking on it then you can pass the id of it and it will render all the details of the product of id passed as an argument.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To accept the argument, the following method can be used:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqdlyw6tqv84ezis811la.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqdlyw6tqv84ezis811la.png" alt="ModalRoute"&gt;&lt;/a&gt;&lt;br&gt;
Note that you need to provide the data type in which your arguments will be passed on. Then you can simply access it by&lt;br&gt;
&lt;br&gt;
&lt;code&gt;routeArgs['id']&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Pop()
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftms0ix3b9z10xzgbgcma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftms0ix3b9z10xzgbgcma.png" alt="Pop"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;From above snippet, it clearly tells that pop process is simple.
However, we can see that an Id argument is passed in it. What is it?&lt;/li&gt;
&lt;li&gt;It is the parameter that is passed back reverse to the page it goes to. &lt;/li&gt;
&lt;li&gt;For e.g, if SecondPage pops and Flutter renders FirstPage back then the Id argument will be passed to FirstPage and we can perform various methods with it.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0y5tjxixtkg92ixa3hb2.png" alt="then"&gt;
&lt;/li&gt;
&lt;li&gt;Where we pushed the page we came from, we can add then method following push and receive the data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Other push/pop methods:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;pushReplacement() / pushNamedReplacement: It is also an important. What Flutter did till now was keep adding screens on top of each other every time we navigate. It would lead to memory leaks in the future. The above method just replaces the screen with a new one.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;pushAndRemoveUntil() / pushNamedAndRemoveUntil(): It will push the page and remove all other routes as soon as the condition provided it met.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;popAndPushNamed(): It will dispose of the current page and push another page according to the route provided.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;popUntil(): It will repeatedly pop pages until the condition is met.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;canPop(): It will check if the page can be popped. For e.g, if there isn't any page to go back to.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;restorablePopAndPushNamed(): It will pop the current route of the navigator and push a named route in its place.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;maybePop(): It checks for the willPop() method and return result accordingly. Head here to find out more =&amp;gt; &lt;a href="https://api.flutter.dev/flutter/widgets/Navigator/maybePop.html" rel="noopener noreferrer"&gt;maybePop&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thus, there can be many ways to navigate between pages and optimization.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>beginners</category>
      <category>dart</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How Flutter handles everything behind the scenes?</title>
      <dc:creator>Dhruvil Patel</dc:creator>
      <pubDate>Mon, 26 Jul 2021 18:11:35 +0000</pubDate>
      <link>https://dev.to/dhruvilp/how-flutter-handles-everything-behind-the-scenes-114n</link>
      <guid>https://dev.to/dhruvilp/how-flutter-handles-everything-behind-the-scenes-114n</guid>
      <description>&lt;p&gt;Flutter is a cross-platform UI framework for dart which provides features to develop mobile apps. Elegant and astonishing apps can be built with Flutter.&lt;/p&gt;

&lt;p&gt;Flutter renders the code written to the screen of the device in the form of widgets. It can be a desktop, a mobile, etc. Device screens are the canvas for our app on which Flutter paints the widgets and sums up to a fully-fledged app.&lt;/p&gt;

&lt;p&gt;But that's not only what Flutter does. But just displaying widgets is not the only thing Flutter does. Behind the beautiful UI, there lies the logic of how the app will work.&lt;/p&gt;

&lt;p&gt;In this post, we're going to explore the understanding of how Flutter manages to provide such amazing apps. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71ghhkr7hoijad3u2x8p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71ghhkr7hoijad3u2x8p.png" alt="Explaination"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Image Elaboration :
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Widget Tree :
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Widget tree holds the configurations about the widget which are created when the app runs for the very first time. &lt;/li&gt;
&lt;li&gt;For example, the container widget in the widget tree holds the configurations like background color, box-shadow, border radius, etc. &lt;/li&gt;
&lt;li&gt;Every widget in the widget tree holds some information or properties about the particular widget.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Element Tree :
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Each widget present in the widget tree is linked to the respective element.&lt;/li&gt;
&lt;li&gt;Elements are just like empty widgets referring to their associated widget.&lt;/li&gt;
&lt;li&gt;For example, in the image above, the container is linked to the container element, column -&amp;gt; column element, etc.&lt;/li&gt;
&lt;li&gt;These elements perform the major role of connecting widgets from widget tree to rendered widget from render tree.&lt;/li&gt;
&lt;li&gt;These elements provide a reference to configurations of widgets present in the widget tree.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Render Tree:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The configurations of the widget which are pointed by element object are passed onto rendered widget which then accordingly to those properties render the widget on the screen.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  Exclusive case of Stateful Widget:
&lt;/h2&gt;
&lt;/blockquote&gt;

&lt;p&gt;As per the image, we can see that there is some variation in the linkage between the stateful widget and its corresponding element.&lt;/p&gt;

&lt;p&gt;The element is connected to the widget as well as the state. Now, what exactly is a state.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptzswnstn9d4iu0oaga4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptzswnstn9d4iu0oaga4.png" alt="Stful"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Whenever we create a stateful widget it creates two classes, namely User-defined class which extends &lt;strong&gt;StatelessWidget&lt;/strong&gt; and another class which extends &lt;strong&gt;State&lt;/strong&gt; class.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The other class we're talking about is created in the initial class with the help of the &lt;strong&gt;createState()&lt;/strong&gt; method. This then rebuilds the widget according to the changes in state.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpu9d9551jfgeprojkppd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpu9d9551jfgeprojkppd.png" alt="Updating Widget"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this case, the scenario differs. It depends on the current state of the widget. Let's dive deep into it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initially, the element represents the widget and renders it on the screen according to its configurations.&lt;/li&gt;
&lt;li&gt;But whenever the &lt;strong&gt;setState&lt;/strong&gt; method is called it not rebuilds the whole widget tree which would make your app less performant but replaces the widget with a new one containing the configurations provided in the &lt;strong&gt;setState&lt;/strong&gt; method.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For example, if there is a container with background color equals to red then it is stored as a value in widget configurations in widget tree which is then passed to rendering widget by container element which holds the reference to container and finally we see a red container on our screens.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;But when we call setState suppose to change its background color to blue, then the new container widget with background = blue will replace the one with background = red.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now the question arrives that what will happen to container element referring to the container with bg = red. Well, upon calling setState, it relocates its reference to a new widget that replaced the older one. However, the &lt;strong&gt;state&lt;/strong&gt; object will not change. Just its properties will change which will be assigned to the new widget. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After all these processes, the element which refers to the new widget will inform the rendered widget about the changes and it will reflect on the screen.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Thus, Flutter not rebuilds the hold widget but only changes its reference to the updated widget. This will not lead to performance issues.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;So, this was all about behind the scenes and how flutter manages all the rendering and updating of widgets.&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding syntax of Stateless and Stateful widgets.</title>
      <dc:creator>Dhruvil Patel</dc:creator>
      <pubDate>Sat, 19 Jun 2021 19:38:38 +0000</pubDate>
      <link>https://dev.to/dhruvilp/understanding-syntax-of-stateless-and-stateful-widgets-5d6c</link>
      <guid>https://dev.to/dhruvilp/understanding-syntax-of-stateless-and-stateful-widgets-5d6c</guid>
      <description>&lt;div class="ltag__tag ltag__tag__id__1905"&gt;
    &lt;div class="ltag__tag__content"&gt;
      &lt;h2&gt;#&lt;a href="https://dev.to/t/flutter" class="ltag__tag__link"&gt;flutter&lt;/a&gt; Follow
&lt;/h2&gt;
      &lt;div class="ltag__tag__summary"&gt;
        An open source framework by Google for building beautiful, natively compiled, multi-platform applications from a single codebase.
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
 &lt;div class="ltag__tag ltag__tag__id__555"&gt;
    &lt;div class="ltag__tag__content"&gt;
      &lt;h2&gt;#&lt;a href="https://dev.to/t/beginners" class="ltag__tag__link"&gt;beginners&lt;/a&gt; Follow
&lt;/h2&gt;
      &lt;div class="ltag__tag__summary"&gt;
        "A journey of a thousand miles begins with a single step." -Chinese Proverb
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In a Flutter app, everything is a widget. The whole app is a widget tree formed by combining widgets like Scaffold, Container, AppBar, and many more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;But 2 core widgets are controlling the state of widgets. They are &lt;strong&gt;Stateless Widget&lt;/strong&gt; and &lt;strong&gt;Stateful Widget&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;So what are these widgets? Let's understand it first before diving straight into the syntax.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stateless Widgets&lt;/strong&gt; are those widgets whose &lt;a href="https://api.flutter.dev/flutter/widgets/State-class.html" rel="noopener noreferrer"&gt;state&lt;/a&gt; cannot be changed. They are immutable. This explains that if you want to change the color of a container on tap then it's not possible with Stateless Widget. But it can have UI widgets such as &lt;strong&gt;Text&lt;/strong&gt; and &lt;strong&gt;icon&lt;/strong&gt; widgets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stateful Widgets&lt;/strong&gt; on the other hand are the opposite of what we saw previously. Here, not only color but any property or value can be changed of a widget by calling &lt;strong&gt;setState&lt;/strong&gt; method on &lt;strong&gt;onTap&lt;/strong&gt; property. Thus, it's mutable.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F595sjylf2tuphvoh82e7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F595sjylf2tuphvoh82e7.png" alt="Difference"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;As Flutter extensions in your code editor allow you to directly create a Stateless/Stateful Widget, we cannot get the idea of what exactly does the block of code does. So let's understand it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Stateless Widget:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7pri6c0ibchb8g1bt2wa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7pri6c0ibchb8g1bt2wa.png" alt="Stateless Widget"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;So the code starts with extending a class called &lt;strong&gt;StatelessWidget&lt;/strong&gt;. Extending means that we are creating a class (Child Class) that will inherit all the methods and properties of StatelessWidget (Parent Class). In this case the class we defined as is &lt;strong&gt;MyApp&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Note:- &lt;strong&gt;StatelessWidget&lt;/strong&gt; is a class created by material package by flutter. The package we import in every flutter app &lt;em&gt;package:flutter/material.dart&lt;/em&gt; gives us the functionality of the &lt;strong&gt;StatelessWidget&lt;/strong&gt; class.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Before going on to the next step let's understand that:&lt;br&gt;
-&amp;gt; Functions inside a class are called methods and Variables inside a class are called properties of that class.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;So now we have a method inside our MyApp class extended from &lt;strong&gt;StatelessWidget&lt;/strong&gt; class.&lt;br&gt;
Let's take an example of a function to clear it out:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F12ktfu0lgdt8ukeyy2ge.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F12ktfu0lgdt8ukeyy2ge.png" alt="Normal Function"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Here, we have a function &lt;strong&gt;main&lt;/strong&gt; of type void as it has no return type. It can also accept arguments/parameters. And finally the block of code inside it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Similarly, we have a function of name &lt;strong&gt;build&lt;/strong&gt; of type &lt;strong&gt;Widget&lt;/strong&gt; as everything is a widget in flutter. Then we have a parameter &lt;strong&gt;context&lt;/strong&gt; of datatype &lt;strong&gt;BuildContext&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Note:- It is not mandatory to use &lt;strong&gt;context&lt;/strong&gt; word. we can also use &lt;strong&gt;ctx&lt;/strong&gt; or &lt;strong&gt;cntxt&lt;/strong&gt;. It depends on the person. And whenever we pass an argument or a parameter in a function/method then we need to state its datatype. For e.g, int age, String name.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Here, the &lt;strong&gt;build&lt;/strong&gt; method is called by flutter whenever it needs to render something on the screen. &lt;strong&gt;context&lt;/strong&gt; is an object holding information about our widget and where it is in the widget tree. &lt;strong&gt;BuildContext&lt;/strong&gt; is a type notation for &lt;strong&gt;context&lt;/strong&gt; which is a class provided by flutter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And lastly the return type. As the method is not a void type, but a Widget type it should return something. In this case, it returns the &lt;strong&gt;MaterialApp&lt;/strong&gt; widget. This widget is also provided by the flutter and it combines our widget tree and renders it to our fully-fledged app.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Stateful Widget:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fouk6efc9f0mr7qz1d1za.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fouk6efc9f0mr7qz1d1za.png" alt="Stateful Widget"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;As we can see there are 2 classes in this case. &lt;strong&gt;MyApp&lt;/strong&gt; and &lt;strong&gt;MyAppState&lt;/strong&gt;. One extends &lt;strong&gt;StatefulWidget&lt;/strong&gt; and other extends &lt;strong&gt;State&lt;/strong&gt;. Similar to &lt;strong&gt;StatelessWidget&lt;/strong&gt;, these two classes are created by flutter itself.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now, why we have 2 classes? It's because whenever the state of any widget changes, only the main class (MyApp) rebuilds, and another one (MyAppState) remains persistent.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For better understanding, remember &lt;strong&gt;MyApp&lt;/strong&gt; class as widget class and &lt;strong&gt;MyAppState&lt;/strong&gt; class as state class.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also, &lt;strong&gt;State&lt;/strong&gt; is a generic type class. Generic typed classes are those classes that function in the limit to the datatype mentioned. Here, we give it type &lt;strong&gt;MyApp&lt;/strong&gt; so we can tell flutter that &lt;strong&gt;State&lt;/strong&gt; class is a sub-class of MyApp and will work under it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This was the first step to connect both the classes. Now we need to implement &lt;strong&gt;createState&lt;/strong&gt; method inside our widget class. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfxzogh89syhzcpdz3mv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfxzogh89syhzcpdz3mv.png" alt="State Widget"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Above image explains how we implemented &lt;strong&gt;State&lt;/strong&gt; class in &lt;strong&gt;MyApp&lt;/strong&gt; class to connect them.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It accepts no parameter but has a type &lt;strong&gt;State&lt;/strong&gt; which is the same class provided by flutter. As it is a generic type class, it accepts &lt;strong&gt;StatefulWidget&lt;/strong&gt; class as its datatype. It returns the child class we created which extends &lt;strong&gt;State&lt;/strong&gt; class, i.e &lt;strong&gt;MyAppState&lt;/strong&gt; class.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Note:- The main difference between these 2 classes is that the data which is inside &lt;strong&gt;State&lt;/strong&gt; class does not change on rebuilding our app. Only the widget changes according to its state. So as mentioned above, Widget class rebuilds not State class.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;And to the end, we can see &lt;strong&gt;&lt;a class="mentioned-user" href="https://dev.to/override"&gt;@override&lt;/a&gt;&lt;/strong&gt; keyword in both &lt;strong&gt;Stateless&lt;/strong&gt; as well as &lt;strong&gt;Stateful&lt;/strong&gt; widgets. But what is it?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What it does is that it tells flutter that we are using a method of the superclass and we intend to do use that method deliberately.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
