<?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: Samuel Wahome</title>
    <description>The latest articles on DEV Community by Samuel Wahome (@samuelwahome).</description>
    <link>https://dev.to/samuelwahome</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%2F493020%2Fde10290d-f5d1-432d-8caa-d0a6a73d9b68.gif</url>
      <title>DEV Community: Samuel Wahome</title>
      <link>https://dev.to/samuelwahome</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/samuelwahome"/>
    <language>en</language>
    <item>
      <title>Navigator overview in Flutter.</title>
      <dc:creator>Samuel Wahome</dc:creator>
      <pubDate>Tue, 18 Jan 2022 15:50:50 +0000</pubDate>
      <link>https://dev.to/samuelwahome/navigator-overview-in-flutter-367e</link>
      <guid>https://dev.to/samuelwahome/navigator-overview-in-flutter-367e</guid>
      <description>&lt;p&gt;If you come from a native Android development background, then you've probably used &lt;a href="https://developer.android.com/guide/navigation?gclid=CjwKCAiAxJSPBhAoEiwAeO_fPzO7PrUke5_f6wXQbOjigiDOL3XZ3ByWPEVNcUDEqkEjMuT5H18ushoCT6oQAvD_BwE&amp;amp;gclsrc=aw.ds" rel="noopener noreferrer"&gt;&lt;strong&gt;Jetpack Navigation&lt;/strong&gt;&lt;/a&gt; to navigate between Fragments in an application. The same can be said for &lt;a href="https://developer.apple.com/documentation/uikit/uinavigationcontroller" rel="noopener noreferrer"&gt;&lt;strong&gt;UINavigationController&lt;/strong&gt;&lt;/a&gt; if you come from an iOS background, which defines a stack-based scheme for navigating hierarchical content.&lt;/p&gt;

&lt;p&gt;In Flutter, it is accustomed for one to use a &lt;a href="https://api.flutter.dev/flutter/widgets/Navigator-class.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Navigator&lt;/strong&gt;&lt;/a&gt; widget to manage your screens or pages(which may also be referred to as routes). A &lt;strong&gt;stack&lt;/strong&gt; is a data structure that manages pages. You insert the elements last-in, first-out, and only the element at the top of the stack is visible to the user.&lt;/p&gt;

&lt;p&gt;There are currently two iterations of Navigation in Flutter: Navigator 1.0 and Navigator 2.0. Before we delve into Navigator 2.0, let's have a quick overview of Navigator 1.0.&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%2Fxu06ra7yw1mr6zzh588l.gif" 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%2Fxu06ra7yw1mr6zzh588l.gif" alt="GIF"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview of Navigator 1.0
&lt;/h2&gt;

&lt;p&gt;Navigator 1.0 provides a simple set of APIs for you to navigate between screens. The most common ones include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;push()&lt;/code&gt;: Adds a new route on the stack.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pop()&lt;/code&gt;: Removes a route from the stack.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One is able to add Navigator to a Flutter application via the use of &lt;a href="https://api.flutter.dev/flutter/widgets/WidgetsApp-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;WidgetsApp&lt;/code&gt;&lt;/a&gt;, which wraps many other common widgets that a Flutter app requires. Among these wrapped widgets is a top-level &lt;code&gt;Navigator&lt;/code&gt; to manage the pages you push and pop. To get a deeper understanding of how navigation with named routes works, then this &lt;a href="https://medium.com/@samuelwahome/navigation-and-named-routes-in-flutter-2d31d0975498" rel="noopener noreferrer"&gt;article&lt;/a&gt; will be of much help.&lt;/p&gt;

&lt;p&gt;Using Navigator 1.0 may seem easy enough, but it does have its own disadvantages, which are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There's no good way to manage your pages without keeping a mental map of where you push and pop a screen.&lt;/li&gt;
&lt;li&gt;Navigator 1.0 doesn't expose the route stack to developers.&lt;/li&gt;
&lt;li&gt;Navigator 1.0 does not update the web URL path.&lt;/li&gt;
&lt;li&gt;On Android devices, the &lt;strong&gt;Back&lt;/strong&gt; button might not work with Navigator 1.0 when you have nested navigators or when you add Flutter to your host Android app.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Overview of Navigator 2.0
&lt;/h2&gt;

&lt;p&gt;Navigator 2.0 came with Flutter 1.22, which allowed one to take full control of the application's navigation stack. The main goals of this declarative API include but are not limited to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Manage nested navigators:&lt;/strong&gt; Gives you control over which navigator has priority.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manage navigation state:&lt;/strong&gt; This lets you parse routes and handle web URLs and deep linking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exposing the navigator's page stack:&lt;/strong&gt; One can now manage app pages. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backward-compatible with imperative API:&lt;/strong&gt; One can use both imperative and declarative styles in the same app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handle operating system events:&lt;/strong&gt; Works better with events like the Android system's Back button.&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%2Fp6n0wx3z6hsiaq1l7fop.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%2Fp6n0wx3z6hsiaq1l7fop.png" alt="https://medium.com/flutter/learning-flutters-new-navigation-and-routing-system-7c9068155ade"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above image shows an overview of Navigator 2.0's declarative API. The declarative API includes the following key components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Page:&lt;/strong&gt; An abstract class that describes the configuration for a route.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Router:&lt;/strong&gt; Handles configuring the list of pages the Navigator displays.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RouterDelegate:&lt;/strong&gt; defines how the router listens for changes to the app state to rebuild the navigator's configuration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RouteInformationProvider:&lt;/strong&gt; Provides &lt;code&gt;RouteInformation&lt;/code&gt; to the router.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RouteInformationParser:&lt;/strong&gt; Parses route information into a user-defined data type.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BackButtonDispatcher:&lt;/strong&gt; Reports presses on the platform system's Back button to the router.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TransitionDelegate:&lt;/strong&gt; Decides how pages transition into and out of the screen.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/xFFQKvcad3s?start=3158"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;It is important to note, however, that this post is by no means a nudge towards using a particular navigation option, but only an overview of the two options that are available thus far, hence if you are happy with how the &lt;code&gt;Navigator&lt;/code&gt; works today, you may keep using it in the same (imperative) way. If you do need any more information on the differences between the two approaches, then this video should be of much help:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/JmfYeF4gUu0?start=9728"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Navigator 2.0 libraries to check out.
&lt;/h2&gt;

&lt;p&gt;Navigator 2.0 may not be the easiest API to use out there, hence the following are some of the packages out there that wrap around the Navigator 2.0 API to make routing and navigation easier:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Beamer.
&lt;/h3&gt;

&lt;p&gt;According to the &lt;a href="https://pub.dev/packages/beamer" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Beamer handles your application routing on all platforms, synchronize it with the browser's URL bar, and more. Beamer uses the power of &lt;a href="https://api.flutter.dev/flutter/widgets/Router-class.html" rel="noopener noreferrer"&gt;Router&lt;/a&gt; and implements all the underlying logic for you.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Beamer was designed to solve the following two major pain points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make the use of Router API easier, especially for beginners.&lt;/li&gt;
&lt;li&gt;Segregate the responsibility of creating a page stack, for intermediate and advanced usage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the highest level, &lt;code&gt;Beamer&lt;/code&gt; is a wrapper for &lt;code&gt;Router&lt;/code&gt; and uses its own implementations for &lt;code&gt;RouterDelegate&lt;/code&gt; and &lt;code&gt;RouteInformationParser&lt;/code&gt;(&lt;code&gt;BeamerDelegate&lt;/code&gt; and &lt;code&gt;BeamerParser&lt;/code&gt;). The goal of Beamer is to separate the responsibility of building a page stack for &lt;code&gt;Navigator.pages&lt;/code&gt; into multiple classes with different states, instead of one global state for all page stacks.&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%2Fdo6hue5f1nr80b3c5fx7.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%2Fdo6hue5f1nr80b3c5fx7.png" alt="Beamer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. go_router.
&lt;/h3&gt;

&lt;p&gt;According to the &lt;a href="https://pub.dev/packages/go_router" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;go_router is a declarative router for Flutter based on Navigation 2 supporting deep linking, data-driven routes and more.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The goal of the &lt;a href="https://pub.dev/packages/go_router" rel="noopener noreferrer"&gt;go_router&lt;/a&gt; package is to simplify the use of the &lt;a href="https://api.flutter.dev/flutter/widgets/Router-class.html" rel="noopener noreferrer"&gt;Router&lt;/a&gt; in Flutter as specified by the &lt;a href="https://api.flutter.dev/flutter/material/MaterialApp/MaterialApp.router.html" rel="noopener noreferrer"&gt;MaterialApp.router&lt;/a&gt; constructor. By default, it requires an implementation of the &lt;a href="https://api.flutter.dev/flutter/widgets/RouterDelegate-class.html" rel="noopener noreferrer"&gt;RouterDelegate&lt;/a&gt; and &lt;a href="https://api.flutter.dev/flutter/widgets/RouteInformationParser-class.html#:~:text=RouteInformationParser%20class%20Null%20safety,initial%20route%20information%20from%20Router." rel="noopener noreferrer"&gt;RouteInformationParser&lt;/a&gt; classes. These two implementations themselves imply the definition of a custom type to hold the app state that drives the creation of the &lt;a href="https://api.flutter.dev/flutter/widgets/Navigator-class.html" rel="noopener noreferrer"&gt;Navigator&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. flow_builder.
&lt;/h3&gt;

&lt;p&gt;According to the &lt;a href="https://pub.dev/packages/flow_builder" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;flow_builder&lt;/strong&gt; is a Flutter package which simplifies flows with a flexible, declarative API.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;FlowBuilder&lt;/code&gt; is a widget that builds a navigation stack in response to changes in the flow state. &lt;code&gt;onGeneratePages&lt;/code&gt; will be invoked for each state change and must return the new navigation stack as a list of pages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FlowBuilder&amp;lt;Profile&amp;gt;(
  state: const Profile(),
  onGeneratePages: (profile, pages) {
    return [
      MaterialPage(child: NameForm()),
      if (profile.name != null) MaterialPage(child: AgeForm()),
    ];
  },
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. fluro.
&lt;/h3&gt;

&lt;p&gt;According to the &lt;a href="https://pub.dev/packages/fluro" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Fluro is a null-safe Flutter routing library that adds flexible routing options like wildcards, named parameters, and clear route definitions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Fluro prides itself on having the following features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple route navigation&lt;/li&gt;
&lt;li&gt;Function handlers (map to a function instead of a route)&lt;/li&gt;
&lt;li&gt;Wildcard parameter matching&lt;/li&gt;
&lt;li&gt;Querystring parameter parsing&lt;/li&gt;
&lt;li&gt;Common transitions built-in&lt;/li&gt;
&lt;li&gt;Simple custom transition creation&lt;/li&gt;
&lt;li&gt;Follows &lt;code&gt;beta&lt;/code&gt; Flutter channel&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;While that is a list of package options, they are by no means the only options out there, and thus the choice solely depends on your particular use case.&lt;/p&gt;

&lt;h2&gt;
  
  
  References.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://medium.com/flutter/learning-flutters-new-navigation-and-routing-system-7c9068155ade" rel="noopener noreferrer"&gt;https://medium.com/flutter/learning-flutters-new-navigation-and-routing-system-7c9068155ade&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/flutter-community/beamer-v1-0-0-is-out-whats-new-and-how-to-migrate-b251b3758e3c" rel="noopener noreferrer"&gt;https://medium.com/flutter-community/beamer-v1-0-0-is-out-whats-new-and-how-to-migrate-b251b3758e3c&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://morioh.com/p/137cb642b5f1" rel="noopener noreferrer"&gt;https://morioh.com/p/137cb642b5f1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://verygood.ventures/blog/navigator-with-flow-builder" rel="noopener noreferrer"&gt;https://verygood.ventures/blog/navigator-with-flow-builder&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;That was indeed all that I have to share for now. To all readers, cheers to code🥂, and have a blessed day.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>android</category>
      <category>ios</category>
      <category>programming</category>
    </item>
    <item>
      <title>State Management in Flutter.</title>
      <dc:creator>Samuel Wahome</dc:creator>
      <pubDate>Fri, 07 Jan 2022 13:12:36 +0000</pubDate>
      <link>https://dev.to/samuelwahome/state-management-in-flutter-186i</link>
      <guid>https://dev.to/samuelwahome/state-management-in-flutter-186i</guid>
      <description>&lt;p&gt;Managing &lt;strong&gt;state&lt;/strong&gt; in an application is one of the most important and necessary processes in the life cycle of an application. The main job of a UI is to represent &lt;strong&gt;state&lt;/strong&gt;. According to the &lt;a href="https://docs.flutter.dev/development/data-and-backend/state-mgmt/ephemeral-vs-app" rel="noopener noreferrer"&gt;official Flutter documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In the broadest possible sense, the state of an app is everything that exists in memory when the app is running. This includes the app's assets, all the variables that the Flutter framework keeps about the UI, animation state, textures, fonts, and so on.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;From this definition, we can then conclude that the pattern that programmatically establishes how to track changes and how to broadcast details about states to the rest of your app is known as &lt;strong&gt;state management&lt;/strong&gt;.&lt;br&gt;
The two state types that are normally considered are &lt;strong&gt;ephemeral state&lt;/strong&gt;(also known as &lt;strong&gt;&lt;em&gt;UI state&lt;/em&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;em&gt;local state&lt;/em&gt;&lt;/strong&gt;)and &lt;strong&gt;app state&lt;/strong&gt;(sometimes also called &lt;strong&gt;&lt;em&gt;shared state&lt;/em&gt;&lt;/strong&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ephemeral state&lt;/strong&gt; is the state you can neatly contain in a single widget. Ephemeral state is used when no other component in the widget tree needs to access a widget's data. Examples include whether a &lt;code&gt;TabBarView&lt;/code&gt; tab is selected or when tracking the current progress of a complex animation. In other words, there is no need to use state management techniques (ScopedModel, Redux, Provider, etc.) on this kind of state. All you need is a &lt;code&gt;StatefulWidget&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;State that is not ephemeral, that you want to share across many parts of your app, and that you want to keep between user sessions, is what is called &lt;strong&gt;&lt;em&gt;application state&lt;/em&gt;&lt;/strong&gt;. Application state when other parts of your app need to access a widget's state data. One example is an image that changes over time, like an icon for the current weather. Another example is when accessing login info that may be required in more than one section of your Flutter application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we've gotten the basic definitions out of the way, let's get to work exploring the various options we have at our disposal to manage the application 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%2Fbxcaet663t3crzqz5ois.gif" 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%2Fbxcaet663t3crzqz5ois.gif" alt="GIF"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Managing state in a Flutter application.
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. InheritedWidget.
&lt;/h3&gt;

&lt;p&gt;According to the &lt;a href="https://api.flutter.dev/flutter/widgets/InheritedWidget-class.html" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;InheritedWidget class is a base class for widgets that efficiently propagate information down the tree.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's the basis for a lot of other state management widgets. If you create a class that extends &lt;code&gt;InheritedWidget&lt;/code&gt; and give it some data, any child widget can access that data by calling &lt;code&gt;context.dependOnInheritedWidgetOfExactType&amp;lt;class&amp;gt;()&lt;/code&gt;. &lt;br&gt;
Inherited widgets, when referenced in this way, will cause the consumer to rebuild when the inherited widget itself changes state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class SampleWidget extends InheritedWidget {
  final Sample sample;
  SampleWidget(Key? key, required this.sample, required Widget child}) :
        super(key: key, child: child);

  @override
  bool updateShouldNotify(SampleWidget oldWidget) =&amp;gt; sample!= oldWidget.sample;

  static SampleWidget of(BuildContext context) =&amp;gt; context.dependOnInheritedWidgetOfExactType&amp;lt;SampleWidget&amp;gt;()!;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One can then extract data from that widget. Since that's such a long method name to call, the convention is to create an &lt;code&gt;of()&lt;/code&gt; method. Then a child widget, for example, a text field that displays the sample text, can just use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SampleWidget sampleWidget = SampleWidget.of(context);
print(sampleWidget.sample.text);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An advantage of using &lt;code&gt;InheritedWidget&lt;/code&gt; is it's a built-in widget so you don't need to worry about using external packages.&lt;/p&gt;

&lt;p&gt;A disadvantage of using &lt;code&gt;InheritedWidget&lt;/code&gt; is that the value of a Sample can't change unless you rebuild the whole widget tree because &lt;code&gt;InheritedWidget&lt;/code&gt; is immutable. So, if you want to change the displayed sample text, you'll have to rebuild the whole &lt;code&gt;SampleWidget&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Provider.
&lt;/h3&gt;

&lt;p&gt;According to the &lt;a href="https://pub.dev/packages/provider" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Provider is a wrapper around &lt;a href="https://api.flutter.dev/flutter/widgets/InheritedWidget-class.html" rel="noopener noreferrer"&gt;InheritedWidget&lt;/a&gt; to make them easier to use and more reusable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;Provider&lt;/code&gt; was designed by Remi Rousselet to wrap around &lt;code&gt;InheritedWidget&lt;/code&gt;, simplifying it. In short, Provider is a set of classes that simplifies building a state management solution on top of &lt;code&gt;InheritedWidget&lt;/code&gt;.&lt;br&gt;
Provider has several commonly used classes such as: &lt;code&gt;ChangeNotifierProvider&lt;/code&gt;, &lt;code&gt;Consumer&lt;/code&gt;, &lt;code&gt;FutureProvider&lt;/code&gt;, &lt;code&gt;MultiProvider&lt;/code&gt; , &lt;code&gt;StreamProvider&lt;/code&gt;, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ChangeNotifier&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;ChangeNotifier&lt;/code&gt; is a class that adds and removes listeners, then notifies those listeners of any changes. You usually extend the class for models so you can send notifications when your model changes. When something in the model changes, you call &lt;code&gt;notifyListeners()&lt;/code&gt; and whoever is listening can use the newly changed model to redraw a piece of UI, for example.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ChangeNotifierProvider&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;ChangeNotifierProvider&lt;/code&gt; is a widget that wraps a class, implementing &lt;code&gt;ChangeNotifier&lt;/code&gt; and uses the child widget for display. When changes are broadcast, the widget rebuilds its tree.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ChangeNotifierProvider(
  create: (context) =&amp;gt; SampleModel(),
  child: &amp;lt;widget&amp;gt;,
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Consumer&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Consumer&lt;/code&gt; is a widget that listens for changes in a class that implements &lt;code&gt;ChangeNotifier&lt;/code&gt;, then rebuilds the widgets below itself when it finds any. When building your widget tree, try to put a &lt;code&gt;Consumer&lt;/code&gt; as deep as possible in the UI hierarchy, so updates don't recreate the whole widget tree.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Consumer&amp;lt;SampleModel&amp;gt;(
  builder: (context, model, child) {
    return Text('Hello ${model.text}');
  }
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you only need access to the model and don't need notifications when the data changes, use &lt;code&gt;Provider.of&lt;/code&gt;, as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Provider.of&amp;lt;SampleModel&amp;gt;(context, listen: false).&amp;lt;method name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;listen: false&lt;/code&gt; indicates you don't want notifications for any updates. This parameter is required to use &lt;code&gt;Provider.of()&lt;/code&gt; inside &lt;code&gt;initState()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FutureProvider&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;FutureProvider&lt;/code&gt; works like other providers and uses the required &lt;code&gt;create&lt;/code&gt; parameter that returns a &lt;code&gt;Future&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FutureProvider(
  initialData: null,
  create: (context) =&amp;gt; createFuture(),
  child: &amp;lt;widget&amp;gt;,
);

Future&amp;lt;SampleModel&amp;gt; createFuture() async {
  return Future.value(SampleModel());
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;code&gt;Future&lt;/code&gt; is handy when a value is not readily available but will be in the future. Examples include calls that request data from the internet or asynchronously read data from a database or network.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MultiProvider&lt;/strong&gt;&lt;br&gt;
What if you need more than one provider? You could nest them, but it'd get messy, making them hard to read and maintain. Instead, use &lt;code&gt;MultiProvider&lt;/code&gt; to create a list of providers and a single &lt;code&gt;child&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MultiProvider(
  providers: [
    Provider&amp;lt;SampleModel&amp;gt;(create: (_) =&amp;gt; Model()),
    Provider&amp;lt;SampleDatabase&amp;gt;(create: (_) =&amp;gt; Database()),
  ],
  child: &amp;lt;widget&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;StreamProvider&lt;/strong&gt;&lt;br&gt;
Provider also has a provider that's specifically for &lt;a href="https://dart.dev/tutorials/language/streams" rel="noopener noreferrer"&gt;streams&lt;/a&gt; and works the same way as &lt;code&gt;FutureProvider&lt;/code&gt;. Stream providers are handy when data comes in via streams and values change over time like, for example, when you're monitoring the connectivity of a device, or listening to active changes from a network.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Riverpod.
&lt;/h3&gt;

&lt;p&gt;According to the &lt;a href="https://pub.dev/packages/riverpod" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Rivepod can be considered as a rewrite of &lt;a href="https://github.com/rrousselGit/provider" rel="noopener noreferrer"&gt;provider&lt;/a&gt; to make improvements that would be otherwise impossible.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Riverpod was written by Provider's author, Remi Rousselet, to address some of Provider's weaknesses. In fact, you'd be surprised to find out that Riverpod is in fact an anagram of Provider.&lt;br&gt;
Riverpod is a very powerful state management library that allows you to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easily &lt;strong&gt;&lt;em&gt;create&lt;/em&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;access&lt;/em&gt;&lt;/strong&gt;, and &lt;strong&gt;&lt;em&gt;combine&lt;/em&gt;&lt;/strong&gt; providers with minimal boilerplate code.&lt;/li&gt;
&lt;li&gt;Write &lt;strong&gt;&lt;em&gt;testable code&lt;/em&gt;&lt;/strong&gt; and keep your logic outside the widget tree.&lt;/li&gt;
&lt;li&gt;Catch programming errors at &lt;strong&gt;&lt;em&gt;compile-time&lt;/em&gt;&lt;/strong&gt; rather than at runtime.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By design, Provider is an improvement over &lt;a href="https://api.flutter.dev/flutter/widgets/InheritedWidget-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;InheritedWidget&lt;/code&gt;&lt;/a&gt; and it depends on the widget tree. This leads to some drawbacks such as:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Combining Providers is very verbose.&lt;/li&gt;
&lt;li&gt;Getting Providers by type and runtime exceptions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To combat this, Riverpod is completely independent of the widget tree and doesn't suffer from any of these drawbacks.&lt;/p&gt;
&lt;h3&gt;
  
  
  4. Redux.
&lt;/h3&gt;

&lt;p&gt;According to the &lt;a href="https://pub.dev/packages/redux" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Redux is a &lt;strong&gt;&lt;em&gt;predictable state container for Dart and Flutter apps.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Redux uses concepts such as actions, reducers, views, and store, whose flow is shown below:&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%2Fpnixqawu10g62obzt9pc.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%2Fpnixqawu10g62obzt9pc.png" alt="https://blog.novoda.com/introduction-to-redux-in-flutter/"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In summary, actions, like clicks on the UI or events from network operations, are sent to reducers, which turn them into a state. That state is saved in a store, which notifies listeners, like views and components, about changes.&lt;/p&gt;
&lt;h3&gt;
  
  
  5. BLoC.
&lt;/h3&gt;

&lt;p&gt;According to the &lt;a href="https://pub.dev/packages/bloc" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The goal of this package is to make it easy to implement the &lt;code&gt;BLoC&lt;/code&gt; Design Pattern (Business Logic Component).This design pattern helps to separate presentation from business logic. Following the BLoC pattern facilitates testability and reusability. This package abstracts reactive aspects of the pattern allowing developers to focus on writing the business logic.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Think of it as a stream of events: some widgets submit events and other widgets respond to them. BLoC sits in the middle and directs the conversation, leveraging the power of streams.&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%2F6pmrnrgd5wn05mdq3ds4.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%2F6pmrnrgd5wn05mdq3ds4.png" alt="https://www.dbestech.com/tutorials/flutter-bloc-pattern-examples"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  6. MobX.
&lt;/h3&gt;

&lt;p&gt;According to the &lt;a href="https://pub.dev/packages/mobx" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;MobX&lt;/em&gt;&lt;/strong&gt; is a library for reactively managing the state of your applications. Use the power of observables, actions, and reactions to supercharge your Dart and Flutter applications.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;MobX utilizes the following concepts in its functioning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Observables:&lt;/em&gt;&lt;/strong&gt; Observables represent the reactive-state of your application. They can be simple scalars to complex object trees.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Actions:&lt;/em&gt;&lt;/strong&gt; Actions are how you mutate the observables. Rather than mutating them directly, actions add a semantic meaning to the mutations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Reactions:&lt;/em&gt;&lt;/strong&gt; They are the observers of the reactive-system and get notified whenever an observable they track is changed.&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%2Fq0oacc0n2m5ipw9bl6dg.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%2Fq0oacc0n2m5ipw9bl6dg.png" alt="https://itnext.io/flutter-state-management-with-mobx-and-providers-change-app-theme-dynamically-ba3b60619050"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  7. GetX.
&lt;/h3&gt;

&lt;p&gt;According to the &lt;a href="https://pub.dev/packages/get" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;GetX is an extra-light and powerful solution for Flutter. It combines high-performance state management, intelligent dependency injection, and route management quickly and practically.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;GetX uses two different state managers: the simple state manager (GetBuilder) and the reactive state manager (GetX/Obx).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class SampleController extends GetxController {

     @override 
    void onInit() {
       // Here you can fetch you product from server
       super.onInit();
    }

    @override 
    void onReady() {
       super.onReady();
    }

    @override
    void onClose() { 
          // Here, you can dispose your StreamControllers
          // you can cancel timers
          super.onClose();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F892f3h749m8kdghpthsn.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%2F892f3h749m8kdghpthsn.png" alt="https://kauemurakami.github.io/getx_pattern/"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://medium.com/flutter-community/making-sense-all-of-those-flutter-providers-e842e18f45dd" rel="noopener noreferrer"&gt;https://medium.com/flutter-community/making-sense-all-of-those-flutter-providers-e842e18f45dd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codewithandrea.com/articles/flutter-state-management-riverpod/" rel="noopener noreferrer"&gt;https://codewithandrea.com/articles/flutter-state-management-riverpod/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.novoda.com/introduction-to-redux-in-flutter/" rel="noopener noreferrer"&gt;https://blog.novoda.com/introduction-to-redux-in-flutter/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://itnext.io/flutter-state-management-with-mobx-and-providers-change-app-theme-dynamically-ba3b60619050" rel="noopener noreferrer"&gt;https://itnext.io/flutter-state-management-with-mobx-and-providers-change-app-theme-dynamically-ba3b60619050&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/gunathilakahashan10/getx-a-superior-state-management-in-flutter-4jcl"&gt;https://dev.to/gunathilakahashan10/getx-a-superior-state-management-in-flutter-4jcl&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;While that is a long list of state management options, they are by no means the only options out there, and thus the choice solely depends on your particular use case. &lt;br&gt;
That was indeed all that I have to share for now. To all readers, cheers to code🥂, and have a blessed day.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>android</category>
      <category>ios</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>View Binding in Android.</title>
      <dc:creator>Samuel Wahome</dc:creator>
      <pubDate>Mon, 03 Jan 2022 16:31:14 +0000</pubDate>
      <link>https://dev.to/samuelwahome/view-binding-in-android-4im0</link>
      <guid>https://dev.to/samuelwahome/view-binding-in-android-4im0</guid>
      <description>&lt;p&gt;If you're familiar with native Android app development with either &lt;a href="https://www.java.com/en/" rel="noopener noreferrer"&gt;Java&lt;/a&gt; or &lt;a href="https://kotlinlang.org/" rel="noopener noreferrer"&gt;Kotlin&lt;/a&gt;, then you've probably needed a means by which to write code that interacts with your views, which would have probably been written in an &lt;a href="https://developer.android.com/guide/topics/ui/declaring-layout" rel="noopener noreferrer"&gt;XML layout file&lt;/a&gt;. Well, to make things simpler, that's where &lt;a href="https://developer.android.com/topic/libraries/view-binding" rel="noopener noreferrer"&gt;View Binding&lt;/a&gt; comes right in.&lt;/p&gt;

&lt;p&gt;For starters, according to the official Android developer resource:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;View binding is a feature that allows you to more easily write code that interacts with views.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once view binding is enabled in a module, it generates a &lt;em&gt;binding class&lt;/em&gt; for each XML layout file present in that module. An instance of a binding class contains direct references to all views that have an ID in the corresponding layout.&lt;br&gt;
In most cases, view binding replaces &lt;code&gt;findViewById&lt;/code&gt;. This simply means that you are essentially able to get rid of the excess boilerplate code. &lt;br&gt;
Without wasting any more time, let's get straight to the code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/tJDz8mPYyUJZ1Pg9fA/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/tJDz8mPYyUJZ1Pg9fA/giphy.gif" alt="GIF"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting it up.
&lt;/h2&gt;

&lt;p&gt;Fun fact: You don't need to include any extra libraries to enable view binding, as it's built into the Android Gradle Plugin starting with the versions shipped from Android Studio 3.6 onwards. To enable view binding, configure &lt;code&gt;viewBinding&lt;/code&gt; in your module-level &lt;code&gt;build.gradle&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;android {
    ...
    buildFeatures {
        viewBinding true
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once enabled for a project, view binding will generate a binding class for all of your layouts automatically. The name of the binding class is generated by converting the name of the XML file to Pascal case and adding the word "Binding" to the end.&lt;br&gt;
Once this is done, you can use the binding class whenever you inflate layouts such as &lt;code&gt;Fragment&lt;/code&gt;, &lt;code&gt;Activity&lt;/code&gt;, or even a RecyclerView &lt;code&gt;Adapter&lt;/code&gt; (or &lt;code&gt;ViewHolder&lt;/code&gt;).&lt;/p&gt;
&lt;h2&gt;
  
  
  View Binding in an Activity.
&lt;/h2&gt;

&lt;p&gt;To set up an instance of the binding class for use with an activity, you have to perform the following in the activity's &lt;a href="https://developer.android.com/reference/kotlin/android/app/Activity#oncreate" rel="noopener noreferrer"&gt;&lt;code&gt;onCreate()&lt;/code&gt;&lt;/a&gt; method:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Call the static &lt;code&gt;inflate()&lt;/code&gt; method included in the generated binding class. This creates an instance of the binding class for the activity to use.&lt;/li&gt;
&lt;li&gt;Get a reference to the root view by either calling the &lt;code&gt;getRoot()&lt;/code&gt; method or using &lt;a href="https://kotlinlang.org/docs/properties.html#declaring-properties" rel="noopener noreferrer"&gt;Kotlin property syntax&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Pass the root view to &lt;a href="https://developer.android.com/reference/kotlin/android/app/Activity#setcontentview_1" rel="noopener noreferrer"&gt;&lt;code&gt;setContentView()&lt;/code&gt;&lt;/a&gt; to make it the active view on the screen.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private SampleLayoutBinding binding;
private TextView categoryName;
private Button submitButton;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    binding = SampleLayoutBinding.inflate(getLayoutInflater());
    View view = binding.getRoot();
    setContentView(view);
    init();
}
private void init() {
    categoryName = binding.categoryName;
    submitButton = binding.submitButton;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Once this is done, you can now use the instance of the binding class to reference and utilize any of the views:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;categoryName.setText(categoryList.get(category_index).getName());
submitButton.setOnClickListener(v -&amp;gt; submitTest());

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  View Binding in Fragments.
&lt;/h2&gt;

&lt;p&gt;To set up an instance of the binding class for use with a fragment, you have to perform the following in the fragment's &lt;a href="https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment#oncreateview" rel="noopener noreferrer"&gt;&lt;code&gt;onCreateView()&lt;/code&gt;&lt;/a&gt; method:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Call the static &lt;code&gt;inflate()&lt;/code&gt; method included in the generated binding class. This creates an instance of the binding class for the fragment to use.&lt;/li&gt;
&lt;li&gt;Get a reference to the root view by either calling the &lt;code&gt;getRoot()&lt;/code&gt;method or using &lt;a href="https://kotlinlang.org/docs/properties.html#declaring-properties" rel="noopener noreferrer"&gt;Kotlin property syntax&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Return the root view from the &lt;code&gt;onCreateView()&lt;/code&gt; method to make it the active view on the screen.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private SampleLayoutBinding binding;
private TextView categoryName;
private Button submitButton;

@Override
public View onCreateView (LayoutInflater inflater,
                          ViewGroup container,
                          Bundle savedInstanceState) {
    binding = SampleLayoutBinding.inflate(inflater, container, false);
    View view = binding.getRoot();
    init();

    return view;
}

private void init() {
    categoryName = binding.categoryName;
    submitButton = binding.submitButton;
}

@Override
public void onDestroyView() {
    super.onDestroyView();
    binding = null;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once this is done, you can now use the instance of the binding class to reference and utilize any of the views:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;categoryName.setText(categoryList.get(category_index).getName());
submitButton.setOnClickListener(v -&amp;gt; submitTest());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ViewBinding in a RecyclerView Adapter(or ViewHolder).
&lt;/h2&gt;

&lt;p&gt;To set up an instance of the binding class for use with a RecyclerView Adapter, you need to pass the generated binding class object to the holder class constructor. In your example, you may have &lt;code&gt;recipe_card&lt;/code&gt; XML file for &lt;code&gt;RecyclerView&lt;/code&gt; item and the generated class is &lt;code&gt;RecipeCardBinding&lt;/code&gt; . &lt;br&gt;
Therefore, you need to use the &lt;code&gt;onCreateViewHolder&lt;/code&gt; to pass the generated binding class to the &lt;code&gt;ViewHolder&lt;/code&gt; class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@NonNull
@Override
public CategoryAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
    RecipeCardBinding itemBinding = RecipeCardBinding .inflate(LayoutInflater.from(parent.getContext()), parent, false);
    return new ViewHolder(itemBinding);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the above steps have been completed, you may then use the holder class like this so you can use these fields in &lt;code&gt;onBindViewHolder&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;static class ViewHolder extends RecyclerView.ViewHolder {
    private TextView textView;
    private ImageView imageView; 

    MyViewHolder(RecipeCardBinding itemBinding) {
        super(itemBinding.getRoot());
        imageView = itemBinding.img ;
        textView = itemBinding.txt ;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;All in all, View Binding is a pretty good solution when it comes to binding views as they are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Type-safe:&lt;/strong&gt; Properties are always correctly typed based on the views in the layout. So if you put a &lt;code&gt;TextView&lt;/code&gt; in the layout, view binding will expose a &lt;code&gt;TextView&lt;/code&gt; property.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Null-safe:&lt;/strong&gt; This is applicable for layouts defined in multiple configurations. View binding will detect if a view is only present in some configurations and create a &lt;code&gt;@Nullable&lt;/code&gt; property.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And since the generated binding classes are regular Java classes with Kotlin-friendly annotations, you can use view binding from both the Java programming language and Kotlin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Differences between findViewById(), Butterknife, Kotlin Synthetics, DataBinding, and View Binding.
&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%2Fnb46qswk8evx5fbl5xo1.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%2Fnb46qswk8evx5fbl5xo1.png" alt="Courtesy of https://wajahatkarim.com/"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources.
&lt;/h2&gt;

&lt;p&gt;In case you may need further information on View Binding or any of its alternatives, then these links will be of much help:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.android.com/topic/libraries/view-binding#java" rel="noopener noreferrer"&gt;https://developer.android.com/topic/libraries/view-binding#java&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/androiddevelopers/use-view-binding-to-replace-findviewbyid-c83942471fc" rel="noopener noreferrer"&gt;https://medium.com/androiddevelopers/use-view-binding-to-replace-findviewbyid-c83942471fc&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wajahatkarim.com/2020/04/evolution-of-finding-views/" rel="noopener noreferrer"&gt;https://wajahatkarim.com/2020/04/evolution-of-finding-views/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;That was indeed all that I have to share for now✌. To all readers, cheers to code🥂, and have a blessed day.&lt;/p&gt;

</description>
      <category>android</category>
      <category>java</category>
      <category>kotlin</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>FoodyShare: The Flutter Recipe sharing application.</title>
      <dc:creator>Samuel Wahome</dc:creator>
      <pubDate>Wed, 15 Dec 2021 19:14:33 +0000</pubDate>
      <link>https://dev.to/samuelwahome/foodyshare-the-flutter-recipe-sharing-application-1m9k</link>
      <guid>https://dev.to/samuelwahome/foodyshare-the-flutter-recipe-sharing-application-1m9k</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;Hi&lt;/em&gt;&lt;/strong&gt; there👋👋. It's definitely been a minute since I posted stuff on Flutter. It's definitely been a journey of sorts in terms of app development. Think of me as the sort of person who fell in love with coding, attended a Bootcamp, and is now freelancing while building interesting personal side projects. &lt;/p&gt;

&lt;p&gt;My fascination with Flutter began when I saw a &lt;a href="https://twitter.com/onuoha_ifeanyi/status/1352904489192345600?s=19"&gt;Twitter post&lt;/a&gt; by Onuoha Ifeanyi detailing how he had developed and published a &lt;a href="https://github.com/o-ifeanyi/musicPlayer"&gt;Flutter music player&lt;/a&gt; app to the &lt;a href="https://play.google.com/store/apps/details?id=com.onuifeanyi.vybeplayer"&gt;Google Play Store&lt;/a&gt;. And hearing all this talk about the framework, I decided to try it out and see how it would go. &lt;/p&gt;

&lt;p&gt;And I do have to say, the journey has been long and interesting. However, that isn't the purpose of this blog and I will cover that in another segment. This blog's purpose is to talk about my latest project: &lt;strong&gt;&lt;a href="https://play.google.com/store/apps/details?id=com.samwahome.foodshare.food_share"&gt;FoodyShare&lt;/a&gt;&lt;/strong&gt;. Without wasting any more time, let's get down to business.&lt;br&gt;
&lt;a href="https://i.giphy.com/media/nY73w9brtLXTG9Zm5q/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/nY73w9brtLXTG9Zm5q/giphy.gif" alt="GIF" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The setup.
&lt;/h3&gt;

&lt;p&gt;To program with Flutter, I did have to learn a bit of &lt;a href="https://dart.dev/"&gt;Dart&lt;/a&gt;, which was kinda not that difficult as its syntax is similar to that of &lt;a href="https://www.java.com/en/"&gt;Java&lt;/a&gt; and &lt;a href="https://www.typescriptlang.org/"&gt;Typescript&lt;/a&gt;. The next step was downloading the &lt;a href="https://docs.flutter.dev/get-started/install"&gt;Flutter SDK&lt;/a&gt; and setting up the necessary code editors. From then on it was tutorial after tutorial with a few additional exercises of course.&lt;/p&gt;

&lt;h3&gt;
  
  
  The idea.
&lt;/h3&gt;

&lt;p&gt;One day I had the epiphany to build an app till the production phase and just get it out there, as the tutorials and sample exercises and projects were getting kinda boring, plus I did already have a &lt;a href="https://play.google.com/console/about/"&gt;Google Play Console&lt;/a&gt; account that I had purchased for 15$, and it was just sitting there, collecting dust. Looking through some food images on Pinterest, being the food junkie I am, I decided there and then to build a recipe social media app of sorts, not because it would be a revolutionary idea or anything of the sort; I just thought it would be interesting to see how users would interact with the app, or even if it would catch on at all. Ever since I wrote my first line of code, it has been my dream to have something out there that I actually made being used by people, and that's where &lt;strong&gt;&lt;a href="https://play.google.com/store/apps/details?id=com.samwahome.foodshare.food_share"&gt;FoodyShare&lt;/a&gt;&lt;/strong&gt; comes in.&lt;br&gt;
From the app name, I guess you can tell it involves food(Don't ask how I came up with the name😂). &lt;br&gt;
The app's premise is simple: A user gets to view recipes from a general discover section, and if you're a more food category-specific person, then there are collections that contain a wide variety of food categories to choose from. The default app only has a select number of recipes to view at a time, hence one could increase the threshold and obtain the ability to view all recipes via in-app subscriptions. &lt;br&gt;
With the idea and app name checked off my huge list, it was time to get right to the code.&lt;/p&gt;

&lt;h3&gt;
  
  
  The code.
&lt;/h3&gt;

&lt;p&gt;All in all, version one of &lt;strong&gt;&lt;a href="https://play.google.com/store/apps/details?id=com.samwahome.foodshare.food_share"&gt;FoodyShare&lt;/a&gt;&lt;/strong&gt; has taken me about three months to complete. In between those months, there have been productive, lazy, good, and bad days. Sometimes the code would run on the first try, other times it would take me a few hours to a day or two to resolve a bug. I can definitely say I've learned a lot about Flutter and programming after all the blood, toil, and sweat. &lt;br&gt;
From the blog title, you can tell the app has been made with Flutter, the UI cross-platform framework from Google. In addition to that, the app utilizes &lt;a href="https://firebase.google.com/"&gt;Firebase&lt;/a&gt; for its backend, in terms of authentication, analytics, and database needs. Other &lt;a href="https://pub.dev/"&gt;libraries&lt;/a&gt; have also been extremely helpful in extending the application's features in terms of the user interfaces, animations, accessing native device features such as the camera, styling text, in-app payments, etc.&lt;br&gt;
On matters of plugins, I have made a series that can be accessed right &lt;a href="https://dev.to/samueldotcloud/flutter-interesting-packages-part-3-2c5a"&gt;here&lt;/a&gt;. With all that said, I would like to add that the code is definitely nowhere near perfection, though I have made steps to gather knowledge and follow best practices where possible.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing.
&lt;/h3&gt;

&lt;p&gt;Here's  the fun part. Making sure the app functions for all or most use-cases, &lt;a href="https://docs.flutter.dev/development/ui/layout/adaptive-responsive"&gt;be it on small screens or even on extra-large screens&lt;/a&gt;, that text is formatted properly, and many other delightful tasks, definitely had me busy, ensuring that all objectives were met.&lt;br&gt;
Not to mention &lt;a href="https://docs.flutter.dev/cookbook/testing/unit/introduction"&gt;unit tests&lt;/a&gt;, which are a developer's favorite hobby, had to be written and run to ensure that the app ran smoothly even as it continued to scale.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preparing for launch.
&lt;/h3&gt;

&lt;p&gt;After the app ideation, the code, and a bit of testing here and there, it was finally time to get it out there, on the &lt;a href="https://play.google.com/store/apps/details?id=com.samwahome.foodshare.food_share"&gt;Google Play Store&lt;/a&gt; to be more specific, though the App Store version will be coming out soon enough. Doing that involved generating an app icon, app screenshots, a feature graphic, and some catchy text of course. For the app icon, I found &lt;a href="https://www.canva.com/"&gt;Canva&lt;/a&gt; to suffice my requirements, though there are obviously many other options.&lt;br&gt;
For the app screenshots, I managed to find a nifty &lt;a href="https://appscreens.com/"&gt;website&lt;/a&gt; that was intuitive, feature-packed, and definitely easy to use. For the feature graphic, I found this &lt;a href="https://hotpot.ai/templates/google-play-feature-graphic"&gt;website&lt;/a&gt; to have many appealing templates to choose from, and generating it was also a piece of cake.&lt;/p&gt;

&lt;h3&gt;
  
  
  Further steps.
&lt;/h3&gt;

&lt;p&gt;Now that the app is out there for the world to use, the next steps will definitely be to improve upon the app to improve the general user experience. &lt;br&gt;
Of course, I'll be sure to follow up with another blog post detailing app performance, revenue generated, downloads, etc., after a period of time. My project endeavors have many inspirations, though I'd like to mention &lt;a href="https://twitter.com/tinyprojectsdev"&gt;Ben Stokes&lt;/a&gt; and his &lt;a href="https://tinyprojects.dev/"&gt;tiny projects&lt;/a&gt;, which have been quite interesting, to say the least.&lt;br&gt;
For now, it would definitely be a plus if you were able to download the app and tell me what you think of it.&lt;/p&gt;

&lt;p&gt;That was indeed all that I have to share for now✌. To all readers, cheers to code🥂, and have a blessed day.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>android</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Flutter: Interesting widgets, part 3.</title>
      <dc:creator>Samuel Wahome</dc:creator>
      <pubDate>Mon, 25 Oct 2021 14:45:01 +0000</pubDate>
      <link>https://dev.to/samuelwahome/flutter-interesting-widgets-part-3-30l7</link>
      <guid>https://dev.to/samuelwahome/flutter-interesting-widgets-part-3-30l7</guid>
      <description>&lt;p&gt;Welcome one and all, to yet another blog article in this series where I outline various interesting &lt;a href="https://flutter.dev/docs/development/ui/widgets"&gt;Flutter widgets&lt;/a&gt; that I have discovered in my exploits with the &lt;a href="https://flutter.dev/"&gt;framework&lt;/a&gt;. The first and second parts of the blog series can be found right &lt;a href="https://medium.com/@samuelwahome/flutter-interesting-widgets-part-1-c166c07f3b60"&gt;here&lt;/a&gt; and &lt;a href="https://dev.to/samueldotcloud/flutter-interesting-widgets-part-2-1o35"&gt;here&lt;/a&gt;. Enough of the small talk, and let's get straight to the business at hand.&lt;br&gt;
&lt;a href="https://i.giphy.com/media/xUOwGmsFStnxzIGC2s/giphy-downsized-large.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/xUOwGmsFStnxzIGC2s/giphy-downsized-large.gif" alt="GIF" width="480" height="382"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/Visibility-class.html"&gt;Visibility&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Ever wanted to show or hide widgets programmatically? Well then, look no further as the &lt;code&gt;Visibility&lt;/code&gt; widget is one option that you can consider. The &lt;code&gt;Visibility&lt;/code&gt; widget works by wrapping around a child widget and determining whether to show or hide a child.&lt;br&gt;
By default, the &lt;a href="https://api.flutter.dev/flutter/widgets/Visibility/visible.html"&gt;visible&lt;/a&gt; property controls whether the child is included in the subtree or not; when it is not &lt;a href="https://api.flutter.dev/flutter/widgets/Visibility/visible.html"&gt;visible&lt;/a&gt;, the replacement child (typically a zero-sized box) is included instead. &lt;br&gt;
With properties such as &lt;a href="https://api.flutter.dev/flutter/widgets/Visibility/replacement.html"&gt;replacement&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/Visibility/child.html"&gt;child&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/Visibility/visible.html"&gt;visible&lt;/a&gt;, etc, customizing the functionality of the &lt;code&gt;Visibility&lt;/code&gt; widget has never been easier. &lt;br&gt;
In case of any further queries, then this blog &lt;a href="https://medium.com/flutterdevs/show-hide-widget-in-flutter-227d69d29266"&gt;post&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/RotatedBox-class.html"&gt;RotatedBox&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Need to design a custom layout where a widget needs to be rotated about its own axis? Well, look no further as to the &lt;code&gt;RotatedBox&lt;/code&gt; widget. This widget works by rotating its child by an integral number of quarter turns, with each quarter turn being equal to 90 degrees. Unlike &lt;a href="https://api.flutter.dev/flutter/widgets/Transform-class.html"&gt;Transform&lt;/a&gt;, which applies a transform just prior to painting, this object applies its rotation prior to layout, which means the entire rotated box consumes only as much space as required by the rotated child.&lt;br&gt;
With properties such as &lt;a href="https://api.flutter.dev/flutter/widgets/RotatedBox/quarterTurns.html"&gt;quarterTurns&lt;/a&gt;, etc, one can customize how the &lt;code&gt;RotatedBox&lt;/code&gt; widget and its child are rendered during runtime. &lt;br&gt;
In case of any further queries, this &lt;a href="https://www.youtube.com/watch?v=BFE6_UglLfQ"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/material/CircleAvatar-class.html"&gt;CircleAvatar&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Ever needed to represent a user's profile image in a circular manner. While there are many workarounds out there, the &lt;code&gt;CircleAvatar&lt;/code&gt; widget is definitely one good option that you may consider. The &lt;code&gt;CircleAvatar&lt;/code&gt; widget is simply a circle that represents a user.&lt;br&gt;
Typically used with a user's profile image, or, in the absence of such an image, the user's initials. A given user's initials should always be paired with the same background color, for consistency.&lt;br&gt;
With properties such as &lt;a href="https://api.flutter.dev/flutter/material/CircleAvatar/backgroundColor.html"&gt;backgroundColor&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/CircleAvatar/backgroundImage.html"&gt;backgroundImage&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/CircleAvatar/foregroundColor.html"&gt;foregroundColor&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/CircleAvatar/radius.html"&gt;radius&lt;/a&gt;, etc, one can customize how the &lt;code&gt;CircleAvatar&lt;/code&gt; widget is rendered.&lt;br&gt;
In case of any further queries, then this &lt;a href="https://www.youtube.com/watch?v=PDgIfizxbbk"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/FutureBuilder-class.html"&gt;FutureBuilder&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Ever needed to listen to a one-time response from a network? Well then, the &lt;code&gt;FutureBuilder&lt;/code&gt; widget may be just what you've been searching for. In short, it is simply a widget that builds itself based on the latest snapshot of interaction with a &lt;a href="https://api.flutter.dev/flutter/dart-async/Future-class.html"&gt;Future&lt;/a&gt;.&lt;br&gt;
With properties such as &lt;a href="https://api.flutter.dev/flutter/widgets/FutureBuilder/builder.html"&gt;builder&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/FutureBuilder/future.html"&gt;future&lt;/a&gt;, etc, one can easily customize how the &lt;code&gt;FutureBuilder&lt;/code&gt; widget is rendered. &lt;br&gt;
In case of any further queries, then this &lt;a href="https://www.youtube.com/watch?v=ek8ZPdWj4Qo"&gt;video&lt;/a&gt; and discussion concerning &lt;a href="https://stackoverflow.com/questions/50844519/flutter-streambuilder-vs-futurebuilder"&gt;the difference between FutureBuilders and Streambuilders&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/Center-class.html"&gt;Center&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Ever needed to center a widget within its specific constraints. Then I do believe the &lt;code&gt;Center&lt;/code&gt; widget may be just what you have been searching for. The &lt;code&gt;Center&lt;/code&gt; widget works by centering its child within itself.&lt;br&gt;
In case of any further queries, then this &lt;a href="https://www.youtube.com/watch?v=c726pWTtxqI"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/PageView-class.html"&gt;PageView&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Ever thought of creating multiple screens with animations, then making them swipeable, such as when designing an onboarding feature of sorts? Well then, look no further as the &lt;code&gt;PageView&lt;/code&gt; widget may be just what you are looking for.&lt;br&gt;
A &lt;code&gt;PageView&lt;/code&gt; is simply a scrollable list that works page by page. It is also important to note that each child of a page view is forced to be the same size as the viewport.&lt;br&gt;
With various constructors such as &lt;a href="https://api.flutter.dev/flutter/widgets/PageView/PageView.builder.html"&gt;builder&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/PageView/PageView.custom.html"&gt;custom&lt;/a&gt;, etc, one can easily customize how the &lt;code&gt;PageView&lt;/code&gt; widget is rendered. In case of any further queries, then this &lt;a href="https://www.youtube.com/watch?v=J1gE9xvph-A"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/material/CircularProgressIndicator-class.html"&gt;CircularProgressIndicator&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Ever needed your app to show that something is still being loaded in the background? Well then, the &lt;code&gt;CircularProgressIndicator&lt;/code&gt; widget is simply one option that may just suit your specific use case.&lt;br&gt;
A &lt;code&gt;CircularProgressIndicator&lt;/code&gt; widget is simply a material design circular progress indicator, which spins to indicate that the application is busy.&lt;br&gt;
With properties such as &lt;a href="https://api.flutter.dev/flutter/material/CircularProgressIndicator/backgroundColor.html"&gt;backgroundColor&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/CircularProgressIndicator/strokeWidth.html"&gt;strokeWidth&lt;/a&gt;, etc, one is able to customize how the &lt;code&gt;CircularProgressIndicator&lt;/code&gt; widget is rendered. In case of any further queries, then this &lt;a href="https://www.youtube.com/watch?v=O-rhXZLtpv0"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/TweenAnimationBuilder-class.html"&gt;TweenAnimationBuilder&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;You've heard how &lt;a href="https://flutter.dev/docs/development/ui/animations"&gt;animation&lt;/a&gt; is at the core of Flutter's philosophy. Looking for a widget that enables you to animate other widgets? Well, look no further as the &lt;code&gt;TweenAnimationBuilder&lt;/code&gt; widget may be just what you are looking for. It is simply a &lt;a href="https://api.flutter.dev/flutter/widgets/Widget-class.html"&gt;widget&lt;/a&gt; builder that animates a property of a &lt;a href="https://api.flutter.dev/flutter/widgets/Widget-class.html"&gt;Widget&lt;/a&gt; to a target value whenever the target value changes.&lt;br&gt;
With properties such as &lt;a href="https://api.flutter.dev/flutter/widgets/TweenAnimationBuilder/child.html"&gt;child&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/TweenAnimationBuilder/tween.html"&gt;tween&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/TweenAnimationBuilder/builder.html"&gt;builder&lt;/a&gt;, etc, one can easily customize how the &lt;code&gt;TweenAnimationBuilder&lt;/code&gt; widget is rendered. &lt;br&gt;
In case of any further queries, then this &lt;a href="https://www.youtube.com/watch?v=l9uHB8VXZOg"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/MediaQuery-class.html"&gt;MediaQuery&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Designing an app that needs to dynamically cater for changing screen sizes such as when in portrait or landscape mode, or perhaps designing an app both for normal mobile phones and tablets? Then the &lt;code&gt;MediaQuery&lt;/code&gt; widget may be just what you are looking for.&lt;br&gt;
The &lt;code&gt;MediaQuery&lt;/code&gt; widget  works by establishing a subtree in which media queries resolve to the given data. For example, to learn the size of the current media (e.g., the window containing your app), you can read the &lt;a href="https://api.flutter.dev/flutter/widgets/MediaQueryData/size.html"&gt;MediaQueryData.size&lt;/a&gt; property from the &lt;a href="https://api.flutter.dev/flutter/widgets/MediaQueryData-class.html"&gt;MediaQueryData&lt;/a&gt; returned by &lt;a href="https://api.flutter.dev/flutter/widgets/MediaQuery/of.html"&gt;MediaQuery.of&lt;/a&gt;: &lt;code&gt;MediaQuery.of(context).size&lt;/code&gt;. Querying the current media using &lt;a href="https://api.flutter.dev/flutter/widgets/MediaQuery/of.html"&gt;MediaQuery.of&lt;/a&gt; will cause your widget to rebuild automatically whenever the &lt;a href="https://api.flutter.dev/flutter/widgets/MediaQueryData-class.html"&gt;MediaQueryData&lt;/a&gt; changes (e.g., if the user rotates their device).&lt;br&gt;
In case of any further queries, then this &lt;a href="https://youtu.be/A3WrA4zAaPw"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/material/Tooltip-class.html"&gt;Tooltip&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Ever felt that the icons and/or images you use in your app are a bit obscure in terms of meaning? Then the &lt;code&gt;Tooltip&lt;/code&gt; widget may be just what you are looking for. &lt;br&gt;
Tooltips provide text labels that help explain the function of a button or other user interface action. Wrap the button in a &lt;code&gt;Tooltip&lt;/code&gt; widget and provide a message which will be shown when the widget is long pressed.&lt;br&gt;
Many widgets, such as &lt;a href="https://api.flutter.dev/flutter/material/IconButton-class.html"&gt;IconButton&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/FloatingActionButton-class.html"&gt;FloatingActionButton&lt;/a&gt;, and &lt;a href="https://api.flutter.dev/flutter/material/PopupMenuButton-class.html"&gt;PopupMenuButton&lt;/a&gt; have a &lt;code&gt;tooltip&lt;/code&gt; property that, when non-null, causes the widget to include a &lt;a href="https://api.flutter.dev/flutter/material/Tooltip-class.html"&gt;Tooltip&lt;/a&gt; in its build.&lt;br&gt;
Tooltips improve the accessibility of visual widgets by proving a textual representation of the widget, which, for example, can be vocalized by a screen reader.&lt;br&gt;
With properties such as &lt;a href="https://api.flutter.dev/flutter/material/Tooltip/decoration.html"&gt;decoration&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/Tooltip/margin.html"&gt;margin&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/Tooltip/message.html"&gt;message&lt;/a&gt;, etc, one is easily able to customize how the &lt;code&gt;ToolTip&lt;/code&gt; widget will be rendered.&lt;br&gt;
In case of any further queries, then this &lt;a href="https://www.youtube.com/watch?v=EeEfD5fI-5Q"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;




&lt;p&gt;That was indeed all that I have to share for now✌. To all readers, cheers to code🥂, and have a blessed day.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>codenewbie</category>
      <category>100daysofcode</category>
      <category>dart</category>
    </item>
    <item>
      <title>Flutter: Interesting widgets, part 2.</title>
      <dc:creator>Samuel Wahome</dc:creator>
      <pubDate>Mon, 18 Oct 2021 06:21:48 +0000</pubDate>
      <link>https://dev.to/samuelwahome/flutter-interesting-widgets-part-2-1o35</link>
      <guid>https://dev.to/samuelwahome/flutter-interesting-widgets-part-2-1o35</guid>
      <description>&lt;p&gt;Welcome one and all to yet another edition of this blog series, that revolves around interesting yet useful &lt;a href="https://flutter.dev/?gclid=CjwKCAjwk6-LBhBZEiwAOUUDpyiFfJ5G96xWuWr-lzfw7y7EseI5e8gpd9qbPai9Zu78jZWSPJxViRoC8Y4QAvD_BwE&amp;amp;gclsrc=aw.ds"&gt;Flutter&lt;/a&gt; widgets that I've encountered in my exploits with the framework. The first part of this series can be found right &lt;a href="https://medium.com/@samuelwahome/flutter-interesting-widgets-part-1-c166c07f3b60"&gt;here&lt;/a&gt;. Enough of the pleasantries, and let's cut straight to the chase.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/l4Epj0XzZbQ4go3Qs/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/l4Epj0XzZbQ4go3Qs/giphy.gif" alt="GIF" width="480" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/Icon-class.html"&gt;Icon&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Ever need to render icons in your app? Well, look no further as this widget definitely has your back. Simply put, the &lt;code&gt;Icon&lt;/code&gt; widget is a graphical icon widget, that is able to draw icons as described in its &lt;a href="https://api.flutter.dev/flutter/widgets/Icon/icon.html"&gt;icon&lt;/a&gt; property, that accepts an &lt;a href="https://api.flutter.dev/flutter/widgets/IconData-class.html"&gt;IconData&lt;/a&gt; class, which is a description of an icon fulfilled by a font glyph.&lt;br&gt;
This widget has other properties that can be modified, such as &lt;a href="https://api.flutter.dev/flutter/widgets/Icon/size.html"&gt;size&lt;/a&gt; and &lt;a href="https://api.flutter.dev/flutter/widgets/Icon/color.html"&gt;color&lt;/a&gt;, all in order to make the UI even more appealing. It is important to note that Icons are not interactive, hence would need to be wrapped with other interactive widgets, or one may also consider material's &lt;a href="https://api.flutter.dev/flutter/material/IconButton-class.html"&gt;IconButton&lt;/a&gt;, which does that work just as efficiently.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/Text-class.html"&gt;Text&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;This widget is responsible for displaying a string of text, but with a single style. This widget has various properties such as &lt;a href="https://api.flutter.dev/flutter/widgets/Text/data.html"&gt;data&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/Text/maxLines.html"&gt;maxLines&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/Text/overflow.html"&gt;overflow&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/Text/style.html"&gt;style&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/Text/textAlign.html"&gt;textAlign&lt;/a&gt;, and &lt;a href="https://api.flutter.dev/flutter/widgets/Text-class.html"&gt;others&lt;/a&gt; that are used to customize how a &lt;code&gt;Text&lt;/code&gt; widget is rendered on the screen.&lt;br&gt;
It is important to note that the &lt;code&gt;Text&lt;/code&gt; widget is not interactive, hence to make &lt;a href="https://api.flutter.dev/flutter/widgets/Text-class.html"&gt;Text&lt;/a&gt; react to touch events, wrap it in a &lt;a href="https://api.flutter.dev/flutter/widgets/GestureDetector-class.html"&gt;GestureDetector&lt;/a&gt; widget with a &lt;a href="https://api.flutter.dev/flutter/widgets/GestureDetector/onTap.html"&gt;GestureDetector.onTap&lt;/a&gt; handler. In a material design application, consider using a &lt;a href="https://api.flutter.dev/flutter/material/TextButton-class.html"&gt;TextButton&lt;/a&gt; instead, or if that isn't appropriate, at least using an &lt;a href="https://api.flutter.dev/flutter/material/InkWell-class.html"&gt;InkWell&lt;/a&gt; instead of &lt;a href="https://api.flutter.dev/flutter/widgets/GestureDetector-class.html"&gt;GestureDetector&lt;/a&gt;. To make sections of the text interactive, use &lt;a href="https://api.flutter.dev/flutter/widgets/RichText-class.html"&gt;RichText&lt;/a&gt; and specify a &lt;a href="https://api.flutter.dev/flutter/gestures/TapGestureRecognizer-class.html"&gt;TapGestureRecognizer&lt;/a&gt; as the &lt;a href="https://api.flutter.dev/flutter/painting/TextSpan/recognizer.html"&gt;TextSpan.recognizer&lt;/a&gt; of the relevant part of the text.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/RichText-class.html"&gt;RichText&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;This widget is also responsible for displaying text. However, the &lt;code&gt;RichText&lt;/code&gt; widget displays text that uses multiple different styles. The text to display is described using a tree of &lt;a href="https://api.flutter.dev/flutter/painting/TextSpan-class.html"&gt;TextSpan&lt;/a&gt; objects, each of which has an associated style that is used for that subtree.&lt;br&gt;
This widget also has various useful properties such as &lt;a href="https://api.flutter.dev/flutter/widgets/MultiChildRenderObjectWidget/children.html"&gt;children&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/RichText/maxLines.html"&gt;maxLines&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/RichText/overflow.html"&gt;overflow&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/RichText/text.html"&gt;text&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/RichText/textAlign.html"&gt;textAlign&lt;/a&gt;, etc, that can be used to customize how the &lt;code&gt;RichText&lt;/code&gt; widget is rendered on the screen. For more information, this &lt;a href="https://www.youtube.com/watch?v=rykDVh-QFfw"&gt;video&lt;/a&gt; will definitely be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/StreamBuilder-class.html"&gt;Streambuilder&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;According to the official documentation, the &lt;code&gt;Streambuilder&lt;/code&gt; widget is simply a widget that builds itself based on the latest snapshot of interaction with a &lt;a href="https://api.flutter.dev/flutter/dart-async/Stream-class.html"&gt;Stream&lt;/a&gt;. This widget is especially useful when retrieving data asynchronously from a source, and displaying that data via the use of other widgets.&lt;br&gt;
This widget has various properties such as &lt;a href="https://api.flutter.dev/flutter/widgets/StreamBuilder/builder.html"&gt;builder&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/StreamBuilder/initialData.html"&gt;initialData&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/StreamBuilderBase/stream.html"&gt;stream&lt;/a&gt;, etc, that define how a new &lt;code&gt;Streambuilder&lt;/code&gt; widget is built. &lt;br&gt;
For more information on this widget and streams in general, then &lt;a href="https://youtu.be/MkKEWHfy99Y"&gt;this&lt;/a&gt; and &lt;a href="https://api.flutter.dev/flutter/widgets/StreamBuilderBase/stream.html"&gt;that&lt;/a&gt; video should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/material/ListTile-class.html"&gt;ListTile&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Ever wanted your app's list display to follow material design guidelines, or you just couldn't find the right combination of widgets to create a whole other widget to be displayed in a list? Well, here comes the &lt;code&gt;ListTile&lt;/code&gt; widget that solves just that predicament. &lt;br&gt;
A &lt;code&gt;ListTile&lt;/code&gt; widget contains one to three lines of text optionally flanked by icons or other widgets, such as &lt;a href="https://api.flutter.dev/flutter/material/Checkbox-class.html"&gt;check boxes&lt;/a&gt;. The icons (or other widgets) for the tile are defined with the &lt;a href="https://api.flutter.dev/flutter/material/ListTile/leading.html"&gt;leading&lt;/a&gt; and &lt;a href="https://api.flutter.dev/flutter/material/ListTile/trailing.html"&gt;trailing&lt;/a&gt; parameters. The first line of text is not optional and is specified with &lt;a href="https://api.flutter.dev/flutter/material/ListTile/title.html"&gt;title&lt;/a&gt;. The value of &lt;a href="https://api.flutter.dev/flutter/material/ListTile/subtitle.html"&gt;subtitle&lt;/a&gt;, which is optional, will occupy the space allocated for an additional line of text, or two lines if &lt;a href="https://api.flutter.dev/flutter/material/ListTile/isThreeLine.html"&gt;isThreeLine&lt;/a&gt; is true. Note that &lt;a href="https://api.flutter.dev/flutter/material/ListTile/leading.html"&gt;leading&lt;/a&gt; and &lt;a href="https://api.flutter.dev/flutter/material/ListTile/trailing.html"&gt;trailing&lt;/a&gt; widgets can expand as far as they wish horizontally, so ensure that they are properly constrained. List tiles are typically used in &lt;a href="https://api.flutter.dev/flutter/widgets/ListView-class.html"&gt;ListViews&lt;/a&gt;, or arranged in &lt;a href="https://api.flutter.dev/flutter/widgets/Column-class.html"&gt;Columns&lt;/a&gt; in &lt;a href="https://api.flutter.dev/flutter/material/Drawer-class.html"&gt;Drawers&lt;/a&gt; and &lt;a href="https://api.flutter.dev/flutter/material/Card-class.html"&gt;Cards&lt;/a&gt;.&lt;br&gt;
This widget has various properties such as &lt;a href="https://api.flutter.dev/flutter/material/ListTile/contentPadding.html"&gt;contentPadding&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/ListTile/enabled.html"&gt;enabled&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/ListTile/hoverColor.html"&gt;hoverColor&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/ListTile/leading.html"&gt;leading&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/ListTile/onTap.html"&gt;onTap&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/ListTile/selected.html"&gt;selected&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/ListTile/shape.html"&gt;shape&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/ListTile/subtitle.html"&gt;subtitle&lt;/a&gt;, etc, that define how the &lt;code&gt;ListTile&lt;/code&gt; widget is rendered on the screen. &lt;br&gt;
In case of any further queries, then this &lt;a href="https://www.youtube.com/watch?v=l8dj0yPBvgQ"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/material/RefreshIndicator-class.html"&gt;RefreshIndicator&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Ever needed to create the 'swipe to refresh feature'? Well, look no further as this has been the widget that you've definitely been searching for. A &lt;code&gt;RefreshIndicator&lt;/code&gt; in simple terms, is a widget that supports the Material "swipe to refresh" idiom.&lt;br&gt;
When the child's &lt;a href="https://api.flutter.dev/flutter/widgets/Scrollable-class.html"&gt;Scrollable&lt;/a&gt; descendant over scrolls, an animated circular progress indicator is faded into view. When the scroll ends, if the indicator has been dragged far enough for it to become completely opaque, the &lt;a href="https://api.flutter.dev/flutter/material/RefreshIndicator/onRefresh.html"&gt;onRefresh&lt;/a&gt; callback is called. The callback is expected to update the scrollable's contents and then complete the &lt;a href="https://api.flutter.dev/flutter/dart-async/Future-class.html"&gt;Future&lt;/a&gt; it returns. The refresh indicator disappears after the callback's &lt;a href="https://api.flutter.dev/flutter/dart-async/Future-class.html"&gt;Future&lt;/a&gt; has completed.&lt;br&gt;
It is also important to note that a &lt;a href="https://api.flutter.dev/flutter/material/RefreshIndicator-class.html"&gt;RefreshIndicator&lt;/a&gt; can only be used with a vertical scroll view.&lt;br&gt;
This widget has various properties such as &lt;a href="https://api.flutter.dev/flutter/material/RefreshIndicator/backgroundColor.html"&gt;backgroundColor&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/RefreshIndicator/color.html"&gt;color&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/RefreshIndicator/displacement.html"&gt;displacement&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/RefreshIndicator/onRefresh.html"&gt;onRefresh&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/material/RefreshIndicator/child.html"&gt;child&lt;/a&gt;, etc, that define where and how the &lt;code&gt;RefreshIndicator&lt;/code&gt; widget shall be rendered on the screen.&lt;br&gt;
In case of further queries, then this &lt;a href="https://www.youtube.com/watch?v=ORApMlzwMdM"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/ClipRRect-class.html"&gt;ClipRRect&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Need a rounded rectangle shape on a widget? Well, look no further as the &lt;code&gt;ClipRRect&lt;/code&gt; widget is definitely what you've been searching for. In simple terms, this widget works by clipping its child using a rounded rectangle.&lt;br&gt;
With properties such as &lt;a href="https://api.flutter.dev/flutter/widgets/ClipRRect/borderRadius.html"&gt;borderRadius&lt;/a&gt;, etc, one can customize how this widget is rendered on the screen.&lt;br&gt;
In case of any further queries, then this &lt;a href="https://www.youtube.com/watch?v=eI43jkQkrvs"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/Expanded-class.html"&gt;Expanded&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Ever needed a child widget in a &lt;a href="https://api.flutter.dev/flutter/widgets/Row-class.html"&gt;Row&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/Column-class.html"&gt;Column&lt;/a&gt;, or &lt;a href="https://api.flutter.dev/flutter/widgets/Flex-class.html"&gt;Flex&lt;/a&gt; to fill and occupy any extra space? Then the &lt;code&gt;Expanded&lt;/code&gt; widget is definitely what you've been searching for. If multiple children are expanded, the available space is divided among them according to the &lt;a href="https://api.flutter.dev/flutter/widgets/Flexible/flex.html"&gt;flex&lt;/a&gt; factor.&lt;br&gt;
With properties such as &lt;a href="https://api.flutter.dev/flutter/widgets/ProxyWidget/child.html"&gt;child&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/Flexible/flex.html"&gt;flex&lt;/a&gt;, etc, one can define how this widget is rendered on the screen.&lt;br&gt;
In case of any further queries, then this &lt;a href="https://www.youtube.com/watch?v=_rnZaagadyo"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/Padding-class.html"&gt;Padding&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Need to add some extra space around a widget? Well, look no further as the &lt;code&gt;Padding&lt;/code&gt; widget may be just what you need. The &lt;code&gt;Padding&lt;/code&gt; widget works by insetting its child by the given padding.&lt;br&gt;
With its properties such as &lt;a href="https://api.flutter.dev/flutter/widgets/SingleChildRenderObjectWidget/child.html"&gt;child&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/Padding/padding.html"&gt;padding&lt;/a&gt;, etc, one can customize how the widget is rendered on a screen.&lt;br&gt;
In case of any further queries, then this &lt;a href="https://www.youtube.com/watch?v=oD5RtLhhubg"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://api.flutter.dev/flutter/widgets/GridView-class.html"&gt;GridView&lt;/a&gt;.
&lt;/h3&gt;

&lt;p&gt;Ever needed to display items in a grid format? Well, look no further as the &lt;code&gt;GridView&lt;/code&gt; widget may be just what you are looking for. A grid view is simply a scrollable, 2D array of widgets. With its various &lt;a href="https://api.flutter.dev/flutter/widgets/GridView-class.html"&gt;constructors&lt;/a&gt; such as &lt;a href="https://api.flutter.dev/flutter/widgets/GridView/GridView.builder.html"&gt;builder&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/GridView/GridView.count.html"&gt;count&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/GridView/GridView.custom.html"&gt;custom&lt;/a&gt;, &lt;a href="https://api.flutter.dev/flutter/widgets/GridView/GridView.extent.html"&gt;extent&lt;/a&gt;, etc, one is able to customize the functionality of the resulting grid.&lt;br&gt;
In case of any further queries, then this &lt;a href="https://www.youtube.com/watch?v=bLOtZDTm4H8"&gt;video&lt;/a&gt; should be of much help.&lt;/p&gt;




&lt;p&gt;That was all that I had to share for now✌. To all readers, cheers to code🥂, and have a blessed day.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>ios</category>
      <category>android</category>
    </item>
    <item>
      <title>Flutter: Interesting packages, part 3.</title>
      <dc:creator>Samuel Wahome</dc:creator>
      <pubDate>Tue, 28 Sep 2021 11:07:21 +0000</pubDate>
      <link>https://dev.to/samuelwahome/flutter-interesting-packages-part-3-2c5a</link>
      <guid>https://dev.to/samuelwahome/flutter-interesting-packages-part-3-2c5a</guid>
      <description>&lt;p&gt;Welcome one and all to yet another edition of this blog series, that revolves around flutter packages that can and may be included in your individual flutter projects. The first and second parts can be found right &lt;a href="https://medium.com/@samuelwahome/flutter-interesting-packages-part-1-bcbae82e4d4b"&gt;here&lt;/a&gt; and &lt;a href="https://medium.com/@samuelwahome/flutter-interesting-packages-part-2-b8edd9292e90"&gt;here&lt;/a&gt;. Finally, enough of the niceties and let's cut to the chase.&lt;/p&gt;




&lt;p&gt;1.&lt;a href="https://pub.dev/packages/video_player"&gt;video_player&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Need to include video playback functionality in your flutter app, well look no further than this, as the Flutter dev team has your back with this awesome plugin. It is able to display videos by integrating with &lt;a href="https://exoplayer.dev/"&gt;ExoPlayer&lt;/a&gt; and &lt;a href="https://developer.apple.com/documentation/avfoundation/avplayer"&gt;AVPlayer&lt;/a&gt; for Android and iOS specifically. As much as it is a great package, the tooling isn't exactly a piece of cake, as one would be required to build their own custom controls for volume, playback speed, and everything in between. Plus &lt;a href="https://docs.fileformat.com/video/srt/#:~:text=SRT%20(SubRip%20file%20format)%20is,content%20after%20it%20is%20produced."&gt;SRT&lt;/a&gt; is the only subtitle format it supports at the moment, hence this plugin does have some improvements that should be considered in the near future.&lt;br&gt;
Other than that, if your needs aren't that complex, then this package is definitely a good recommendation for you.&lt;/p&gt;

&lt;p&gt;2.&lt;a href="https://pub.dev/packages/chewie"&gt;chewie&lt;/a&gt;&lt;br&gt;
Enough judgment of the &lt;a href="https://pub.dev/packages/video_player"&gt;video_player&lt;/a&gt; plugin, as it may have just found a suitable companion. Long story short, chewie simply wraps around the video player plugin and adds custom controls that you can easily adjust to your liking, resulting in a unique and positive user experience. In case you do need a bit of help integrating both chewie and &lt;a href="https://pub.dev/packages/video_player"&gt;video_player&lt;/a&gt; in your flutter app, this &lt;a href="https://medium.com/flutterdevs/video-player-in-flutter-22202be72d6e"&gt;post&lt;/a&gt; by &lt;a href="https://medium.com/@shaiq_khan"&gt;Shaiq khan&lt;/a&gt; should be of much help. Therefore, this package is definitely a good recommendation.&lt;/p&gt;

&lt;p&gt;3.&lt;a href="https://pub.dev/packages/url_launcher"&gt;url_launcher&lt;/a&gt;&lt;br&gt;
Ever required your flutter to handle URLs? Well, then this package may be just what you need to accomplish just that. This package supports a wide variety of URL schemes, both on Android and iOS, hence this package definitely has your back. All in all, this package is definitely a good recommendation for all interested flutter developers out there.&lt;/p&gt;

&lt;p&gt;4.&lt;a href="https://pub.dev/packages/flutter_blurhash"&gt;flutter_blurhash&lt;/a&gt;&lt;br&gt;
Ever required a placeholder for an image that may be loaded from storage or a network? Then this package may be just what you need for that very purpose. I know that I've mentioned &lt;a href="https://pub.dev/packages/transparent_image"&gt;transparent_image&lt;/a&gt; somewhere in one of my other posts. Well, this package simply serves as an alternative to that, depending of course, on your preferences or specific use-case. In case you do need help incorporating this package, then this blog &lt;a href="https://medium.com/flutterdevs/exploring-blurhash-image-placeholder-in-flutter-24dad611c487"&gt;post&lt;/a&gt; should be of much help. All in all, this package is definitely a good recommendation.&lt;/p&gt;

&lt;p&gt;5.&lt;a href="https://pub.dev/packages/flutter_bloc"&gt;flutter_bloc&lt;/a&gt;&lt;br&gt;
All this talk about &lt;a href="https://flutter.dev/docs/development/data-and-backend/state-mgmt"&gt;state management&lt;/a&gt;, then suddenly bloc pops into the fray. In addition to other solutions out there such as &lt;a href="https://pub.dev/packages/provider"&gt;provider&lt;/a&gt;, &lt;a href="https://pub.dev/packages/flutter_bloc"&gt;flutter_bloc&lt;/a&gt; simply enables you to share application state between screens, and across your app. Therefore, depending on your specific use case, then this package is definitely a good recommendation.&lt;/p&gt;

&lt;p&gt;6.&lt;a href="https://pub.dev/packages/share_plus"&gt;share_plus&lt;/a&gt;&lt;br&gt;
Do you require your flutter application to be able to share content with other apps, much like implicit &lt;a href="https://developer.android.com/guide/components/intents-filters"&gt;intents&lt;/a&gt; in android? Well, look no further as this package definitely has your back. This package enables you to share files, text, and links with ease, and also invokes the share dialog on your behalf, so it definitely has you covered. All in all, this package is definitely a worthy recommendation.&lt;/p&gt;

&lt;p&gt;7.&lt;a href="https://pub.dev/packages/device_info_plus"&gt;device_info_plus&lt;/a&gt;&lt;br&gt;
Do you need to collect information on the specific device your application is running on, perhaps for analytical or debugging purposes? Well, look no further as this package may just be what you need. With this package, you are able to get current device information from within the Flutter application and is supported on most platforms, which is definitely a huge plus. All in all, this package is definitely a good recommendation.&lt;/p&gt;

&lt;p&gt;8.&lt;a href="https://pub.dev/packages/sign_in_with_apple"&gt;sign_in_with_apple&lt;/a&gt;&lt;br&gt;
Are you a flutter dev that needs an authentication service that is specific to Apple device users, specifically via their Apple ID? Then this package may be just what you need. Implementing this functionality goes beyond just importing this package in your app, but the official package docs do a good job of simplifying the process to ensure a smooth user experience. All in all, this package is definitely a worthy recommendation.&lt;/p&gt;

&lt;p&gt;9.&lt;a href="https://pub.dev/packages/android_alarm_manager_plus"&gt;android_alarm_manager_plus&lt;/a&gt;&lt;br&gt;
Ever needed to include an alarm clock-like functionality in your Flutter application? Then this package may be just what you are looking for. This package works by accessing the android &lt;a href="https://developer.android.com/reference/android/app/AlarmManager"&gt;AlarmManager&lt;/a&gt; service, then runs some dart code underneath to extend even more control to your Flutter app.&lt;br&gt;
With that said, there is one catch though, as this package only caters to the android platform, which kinda beats the logic of designing an app that can work on more than one platform. Anyways, this package is still definitely a worthy recommendation to all who may need it.&lt;/p&gt;

&lt;p&gt;10.&lt;a href="https://pub.dev/packages/infinite_scroll_pagination"&gt;infinite_scroll_pagination&lt;/a&gt;&lt;br&gt;
All this talk about efficiently retrieving information from databases and suddenly pagination pops into mind. Need a package for this exact use case? Well, look no further as this package may be just what you need. Call it auto-pagination, lazy loading pagination, progressive loading pagination, or endless scrolling pagination, then this package definitely has your back, and is also a worthy recommendation to all who may need it.&lt;/p&gt;




&lt;p&gt;I guess that has been a lot to swallow😂. All the afro mentioned packages have null safety incorporated into them, hence no worries about incompatibility with recent versions of Flutter. If you've loved this post, leaving a like❤ won't hurt one bit.&lt;br&gt;
To all readers, cheers to code🥂, and have a blessed day.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>100daysofcode</category>
      <category>codenewbie</category>
      <category>dart</category>
    </item>
  </channel>
</rss>
