<?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: 0xAirdropfarmer</title>
    <description>The latest articles on DEV Community by 0xAirdropfarmer (@kris).</description>
    <link>https://dev.to/kris</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%2F46651%2Fa5dfa3c8-744a-4e21-bf03-41b29096a468.jpeg</url>
      <title>DEV Community: 0xAirdropfarmer</title>
      <link>https://dev.to/kris</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kris"/>
    <language>en</language>
    <item>
      <title>5 Cools Flutter Fitness App Template 2021</title>
      <dc:creator>0xAirdropfarmer</dc:creator>
      <pubDate>Wed, 21 Apr 2021 08:26:18 +0000</pubDate>
      <link>https://dev.to/kris/5-cools-flutter-fitness-app-template-2021-5hc7</link>
      <guid>https://dev.to/kris/5-cools-flutter-fitness-app-template-2021-5hc7</guid>
      <description>&lt;p&gt;What do most people look for when they want to get fit and healthy? Definitely, the fitness applications that provide them with the best workout routines and health instruction to get themselves fit and healthy. But almost every fitness application does that, but we are looking for the ones that provide the best UI design that grabs the users’ eye and indulges them in the best experience. We also look for some robust features that help users manage their fitness routines and get what they want out of the fitness app. Well, this article is not about the fitness app but about the development of the fitness app using some of the best fitness app templates built using Flutter and dart programming.&lt;/p&gt;

&lt;p&gt;Flutter mobile development framework is definitely making its mark in the world of mobile app development with its ability to create pixel-perfect UI and house powerful features. Using Flutter, we can definitely build an app that has beautiful UI and state-of-the-art features. But, the thing that makes app development even easier, fast, and cheap is the availability of app templates.&lt;/p&gt;

&lt;p&gt;Here, we list out some of the best Flutter fitness app templates out there in the market that provide intuitive and elegant UI interfaces with robust and dynamic features:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Flutter Fitness App Template by Instaflutter
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wbtVQBDA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AZHjQhnT8fzXs3GzB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wbtVQBDA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AZHjQhnT8fzXs3GzB.png" alt="" width="600" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are looking for a &lt;a href="https://www.instaflutter.com/app-templates/flutter-fitness-app-template/"&gt;fitness app template&lt;/a&gt; build using Flutter that has everything then this is it. One of the best Flutter fitness apps templates out there in the market offered by &lt;a href="http://instaflutter.com"&gt;instaflutter.com&lt;/a&gt;. The complete fitness app templates offering more than 50+ screens. Each screen is equipped with state-of-the-art UI containing beautiful design elements ensuring a highly intuitive user experience. This template comes with complete source code in Flutter &amp;amp; Dart and also free lifetime updates for future maintenance purposes.&lt;/p&gt;

&lt;p&gt;With beautiful UI screens comes powerful and robust features. The template houses an authentication mechanism leveraging 2-way authentication. The profile features offer screens to fully customize your fitness settings. The other major feature includes Calorie calculations screens, steps calculation screen, calorie burn index, a podcast for meditation, music player as well as a push notification. It can basically be a social app for fitness personals. The template offers heavyweight features which are bound to catch your eye along with modern UI designed for optimum user experience. If you are thinking of building your next fitness application in Flutter, then this is the place to start.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Flutter Fitness App Template
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2UvpIfIH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A72YxO_PHVTeL2MiTDbfGjA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2UvpIfIH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A72YxO_PHVTeL2MiTDbfGjA.png" alt="" width="592" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another great &lt;a href="https://codecanyon.net/item/flutter-fitness-app-template/30147551"&gt;fitness app template&lt;/a&gt; build completely using Flutter and dart programming offered by codecanyon. The template houses more that 20 screens build completely using Flat UI design specification. The coding structure is well organized with clear and concise coding practice. The entire UI interface looks clean and intuitive. The features are will equipped with step wise approach to using the app properly. The template offers full set of features to customize profile, workout routines, upload videos, store the trending routines and videos, publish pictures. The entire UI is dark themed and profile feature resembles that of the Instagram. The features offered are well adequate for any fitness application. Hence, this template can surely be one of the best choices for your next fitness application program if you are looking to build one using Flutter app development framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Flutter Fitness Workout UI
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EttYr1tk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AZL-QG5dGOg2QPLIfC528mg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EttYr1tk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AZL-QG5dGOg2QPLIfC528mg.png" alt="" width="599" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://codecanyon.net/item/flutter-fitness-workout-ui/29966677"&gt;Flutter fitness app&lt;/a&gt; UI template offering a simple and clean UI interface. This template may not be as powerful and offer a maximum feature like the ones before but certainly packs a punch if you are looking to develop the fitness app only concentrating on fitness features. This template generally offers features for workout routines at different levels. The users can keep track of their daily exercise routine and build up their level as they progress. The UI designs seem simple and intuitive. The app highly concentrates on motivating you to exercise rather than other social and media stuff. The features such as workout description, scheduling, level upgrades, instructions, etc are available in this application template. All in all the best Flutter fitness app template concentrating fully on workouts and exercise.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Flutter fitness Workout
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1Xg7Yeqm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ANSaytneKAHUBOK_4VShIag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1Xg7Yeqm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ANSaytneKAHUBOK_4VShIag.png" alt="" width="591" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This &lt;a href="https://codecanyon.net/item/flutter-fitness-workout-full-source-code-with-admob-ready-to-publish/31302893"&gt;Flutter fitness&lt;/a&gt; app template is entirely similar to the one above. The UI design implementations, as well as the features offered, are very much the same. The only new thing it adds is the integration of Admob which will certainly help to make some money out of the app once published. The template offers the full source code of the app entirely written in Flutter and dart programming. The UI designs in the screen look intuitive and anyone with basic knowledge of application users can easily use it. The designs look simple and clean in terms of screen. The major features include workout routines, a specific list of workouts, workout descriptions, scheduling, level upgrades, instructions, etc. The template is ready to be published in the app store if need be but customizable based on needs as well. If you are looking for a simple workout app template built using Flutter that can make some cash when published then this is it.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Flutter Flare: Activity and Fitness App UI
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f4qUebOO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2Al9Vg91ZbiU63S8AD61gOfw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f4qUebOO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2Al9Vg91ZbiU63S8AD61gOfw.png" alt="" width="595" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Probably the simplest in terms of UI design but power-packed in terms of features offered, &lt;a href="https://codecanyon.net/item/flare-activity-and-fitness-app-ui/24710434"&gt;this template&lt;/a&gt; is the most balanced app template available in the fitness genre built entirely using Flutter and dart. The template offers 6+ screens with a simple and elegant UI which looks highly intuitive. It houses features such as authentication (login, email registration), chat interface, Home screen with filter option to browse through different workout manuals, workout detail screen, Map feature, inbox, notifications, Profile, etc. The entire template contains more than 11 reusable Widgets which you can customize and reuse on different screens easily. All the basic features required in the fitness app are available in this template along with simple and modern UI which makes this template great for your next Flutter fitness app project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This article lists out some of the best Fitness app templates built entirely using Flutter and dart programming. The UI interface range from simple to complex and the same goes for features as well. If you are going for the fitness app template that has everything in terms of UI and features then definitely go for the one by instamobile. If you are looking for a fitness app with great UI and some social features then the second one would be the best. And if you are looking for a fitness app solely focused on workout features then definitely the third and fourth. The fifth one is the balanced one with simple UI and adequate features. Now, it is up to you to choose the best one the fits your need for your next Flutter fitness application.&lt;/p&gt;

</description>
      <category>flutter</category>
    </item>
    <item>
      <title>Create Instagram Photo Filters in React NativeReact Native</title>
      <dc:creator>0xAirdropfarmer</dc:creator>
      <pubDate>Fri, 16 Apr 2021 05:04:18 +0000</pubDate>
      <link>https://dev.to/kris/create-instagram-photo-filters-in-react-nativereact-native-lih</link>
      <guid>https://dev.to/kris/create-instagram-photo-filters-in-react-nativereact-native-lih</guid>
      <description>&lt;p&gt;Instagram has been growing like crazy over the past few years, and one of its key features that fueled that growth was the famous photo filters. By allowing users to apply various filters to their photos to make them better looking, Instagram has created an amazing product. Any modern photo app must support photo filters nowadays, so we are going to take a look at how to implement the Instagram photo filters in React Native.&lt;/p&gt;

&lt;p&gt;In today’s article, we’re going to be talking about how to implement Instagram photo filters. We’re going to use the &lt;a href="https://github.com/iyegoroff/react-native-image-filter-kit"&gt;**react-native-image-filter-kit&lt;/a&gt;** package*&lt;em&gt;.&lt;/em&gt;* Here at Instamobile, we use this library to seamlessly build this photo filters feature into our &lt;a href="https://www.instamobile.io/app-templates/instagram-clone-app/"&gt;Instagram Clone&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Implementing Instagram Photo Filters in React Native
&lt;/h3&gt;

&lt;p&gt;First of all, let’s install the package we mentioned earlier into your React Native project, by running:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -s react-native-image-filter-kit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here’s a simple React Native project that applies the Instagram photo filters to an image included in the codebase (the image name is “parrot.png”, so make sure you include it in your project folder, so that it can be loaded in the app). In the App.js file, simply place the following code snippet:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import {Image, SafeAreaView} from 'react-native';
import {Emboss} from 'react-native-image-filter-kit';

const App = () =&amp;gt; (
  &amp;lt;&amp;gt;
    &amp;lt;SafeAreaView /&amp;gt;
    &amp;lt;Image
      style={styles.image}
      source={require('./parrot.png')}
      resizeMode={'contain'}
    /&amp;gt;
    &amp;lt;Emboss
      image={
        &amp;lt;Image
          style={styles.image}
          source={require('./parrot.png')}
          resizeMode={'contain'}
        /&amp;gt;
      }
    /&amp;gt;
  &amp;lt;/&amp;gt;
);

const styles = {
  image: {
    width: 320,
    height: 320,
    marginVertical: 10,
    alignSelf: 'center',
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The Emboss component provided by the react-native-filter-kit takes an Image component as a prop and applies the filter as seen in the below screenshot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RoXhhlET--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AFZJbq-ypwHmbFyOx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RoXhhlET--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AFZJbq-ypwHmbFyOx.png" alt="" width="155" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are a ton of other filter components provided by the library react-native-image-filter-kit so we are going to find a way to implement a more comprehensive filter just like the way it is done in the Instagram app itself.&lt;/p&gt;

&lt;p&gt;First of all we need to define an array of filter components that we are going to render and select from:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import {
  AdenCompat,
  _1977Compat,
  BrannanCompat,
  BrooklynCompat,
  ClarendonCompat,
  EarlybirdCompat,
  GinghamCompat,
  HudsonCompat,
  InkwellCompat,
  KelvinCompat,
  LarkCompat,
  LofiCompat,
  MavenCompat,
  MayfairCompat,
  MoonCompat,
  NashvilleCompat,
  PerpetuaCompat,
  ReyesCompat,
  RiseCompat,
  SlumberCompat,
  StinsonCompat,
  ToasterCompat,
  ValenciaCompat,
  WaldenCompat,
  WillowCompat,
  Xpro2Compat,
} from 'react-native-image-filter-kit'; 

const FILTERS = [
  {
    title: 'Normal',
    filterComponent: AdenCompat,
  },
  {
    title: 'Maven',
    filterComponent: MavenCompat,
  },
  {
    title: 'Mayfair',
    filterComponent: MayfairCompat,
  },
  {
    title: 'Moon',
    filterComponent: MoonCompat,
  },
  {
    title: 'Nashville',
    filterComponent: NashvilleCompat,
  },
  {
    title: 'Perpetua',
    filterComponent: PerpetuaCompat,
  },
  {
    title: 'Reyes',
    filterComponent: ReyesCompat,
  },
  {
    title: 'Rise',
    filterComponent: RiseCompat,
  },
  {
    title: 'Slumber',
    filterComponent: SlumberCompat,
  },
  {
    title: 'Stinson',
    filterComponent: StinsonCompat,
  },
  {
    title: 'Brooklyn',
    filterComponent: BrooklynCompat,
  },
  {
    title: 'Earlybird',
    filterComponent: EarlybirdCompat,
  },
  {
    title: 'Clarendon',
    filterComponent: ClarendonCompat,
  },
  {
    title: 'Gingham',
    filterComponent: GinghamCompat,
  },
  {
    title: 'Hudson',
    filterComponent: HudsonCompat,
  },
  {
    title: 'Inkwell',
    filterComponent: InkwellCompat,
  },
  {
    title: 'Kelvin',
    filterComponent: KelvinCompat,
  },
  {
    title: 'Lark',
    filterComponent: LarkCompat,
  },
  {
    title: 'Lofi',
    filterComponent: LofiCompat,
  },
  {
    title: 'Toaster',
    filterComponent: ToasterCompat,
  },
  {
    title: 'Valencia',
    filterComponent: ValenciaCompat,
  },
  {
    title: 'Walden',
    filterComponent: WaldenCompat,
  },
  {
    title: 'Willow',
    filterComponent: WillowCompat,
  },
  {
    title: 'Xpro2',
    filterComponent: Xpro2Compat,
  },
  {
    title: 'Aden',
    filterComponent: AdenCompat,
  },
  {
    title: '_1977',
    filterComponent: _1977Compat,
  },
  {
    title: 'Brannan',
    filterComponent: BrannanCompat,
  },
];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Next, we have to render a horizontal list of filters at the bottom and dynamically change the filter image as the center image when a filter is selected. Your App.js file will then become:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, {useRef, useState} from 'react';
import {
  FlatList,
  Image,
  SafeAreaView,
  StyleSheet,
  Text,
  TouchableOpacity,
} from 'react-native';

const App = () =&amp;gt; {
  const extractedUri = useRef('https://www.hyundai.com/content/hyundai/ww/data/news/data/2021/0000016609/image/newsroom-0112-photo-1-2021elantranline-1120x745.jpg');
  const [selectedFilterIndex, setIndex] = useState(0);

  const onExtractImage = ({nativeEvent}) =&amp;gt; {
    extractedUri.current = nativeEvent.uri;
  };

  const onSelectFilter = selectedIndex =&amp;gt; {
    setIndex(selectedIndex);
  };

  const renderFilterComponent = ({item, index}) =&amp;gt; {
    const FilterComponent = item.filterComponent;
    const image = (
      &amp;lt;Image
        style={styles.filterSelector}
        source={require('./car.jpg')}
        resizeMode={'contain'}
      /&amp;gt;
    );

    return (
      &amp;lt;TouchableOpacity onPress={() =&amp;gt; onSelectFilter(index)}&amp;gt;
        &amp;lt;Text style={styles.filterTitle}&amp;gt;{item.title}&amp;lt;/Text&amp;gt;
        &amp;lt;FilterComponent image={image} /&amp;gt;
      &amp;lt;/TouchableOpacity&amp;gt;
    );
  };

  const SelectedFilterComponent = FILTERS[selectedFilterIndex].filterComponent;

  return (
    &amp;lt;&amp;gt;
      &amp;lt;SafeAreaView /&amp;gt;
      {selectedFilterIndex === 0 ? (
        &amp;lt;Image
          style={styles.image}
          source={require('./car.jpg')}
          resizeMode={'contain'}
        /&amp;gt;
      ) : (
        &amp;lt;SelectedFilterComponent
          onExtractImage={onExtractImage}
          extractImageEnabled={true}
          image={
            &amp;lt;Image
              style={styles.image}
              source={require('./car.jpg')}
              resizeMode={'contain'}
            /&amp;gt;
          }
        /&amp;gt;
      )}

      &amp;lt;FlatList
        data={FILTERS}
        keyExtractor={item =&amp;gt; item.title}
        horizontal={true}
        renderItem={renderFilterComponent}
      /&amp;gt;
    &amp;lt;/&amp;gt;
  );
};

const styles = StyleSheet.create({
  image: {
    width: 520,
    height: 520,
    marginVertical: 10,
    alignSelf: 'center',
  },
  filterSelector: {
    width: 100,
    height: 100,
    margin: 5,
  },
  filterTitle: {
    fontSize: 12,
    textAlign: 'center',
  },
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This source code will produce a simple React Native app that supports selecting various Instagram photo filters, just like the real Instagram photo editor:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4ECuEGaL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2Aw1om6AkSt7hdG8au.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4ECuEGaL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2Aw1om6AkSt7hdG8au.gif" alt="" width="155" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After selection, the handler method onExtractImage saves the URL of the extracted image after the filter has been selected on the variable extractedUri ref which you could save on your server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Now that we have learned how to implement Instagram filters you should check out our &lt;a href="https://www.instamobile.io/app-templates/instagram-clone-app/"&gt;Instagram Clone template&lt;/a&gt;, which is a fully functional codebase, supporting most of the Instagram features, such as photo filters, ephemeral stories, and post feed.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.instamobile.io/react-native-tutorials/instagram-photo-filters-react-native/"&gt;https://www.instamobile.io&lt;/a&gt; on April 15, 2021.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>instagram</category>
    </item>
    <item>
      <title>How to Get Your Location in Flutter</title>
      <dc:creator>0xAirdropfarmer</dc:creator>
      <pubDate>Fri, 09 Apr 2021 13:54:16 +0000</pubDate>
      <link>https://dev.to/kris/how-to-get-your-location-in-flutter-4m7g</link>
      <guid>https://dev.to/kris/how-to-get-your-location-in-flutter-4m7g</guid>
      <description>&lt;p&gt;If you are building a mobile app in Flutter and you are looking to learn how to get the current user location, then this is the tutorial you were looking for.&lt;/p&gt;

&lt;p&gt;In the current context, there are numerous applications that make use of the device location service to implement various location-based features in the application. In mobile apps such as delivery app, eCommerce app, booking apps, geolocation apps, etc the location service is very essential. So let’s take a look at how to access the location service of a device to get the current location of the user/device.&lt;/p&gt;

&lt;p&gt;In this tutorial, we are going to use the &lt;a href="https://pub.dev/packages/geolocator"&gt;geolocator&lt;/a&gt; plugin to access the location service of the device and get the current location coordinates of the user. The &lt;strong&gt;geolocator&lt;/strong&gt; library has made the location service access and getting current location coordinates much easier. The idea is to implement a simple UI template to display the current location and a function to fetch the current location using the geolocator library. So, let’s get started!&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up the Flutter Project
&lt;/h3&gt;

&lt;p&gt;First, we need to create a new Flutter project. For that, make sure that the Flutter SDK and other Flutter app development-related requirements are properly installed. If everything is properly set up, then in order to create a project, we can simply run the following command in the desired local directory:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flutter create flutter_location_example
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After the project has been set up, we can navigate inside the project directory and execute the following command in the Terminal to run the project in either an available emulator or an actual device:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flutter run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Scaffolding The App Project
&lt;/h3&gt;

&lt;p&gt;Now, we are going to scaffold the project by removing the default template codes. First, we need to remove the default MyHomePage stateful class widget from the &lt;strong&gt;main.dart&lt;/strong&gt;. Then, we need to create a new stateful widget class called CurrentLocation. This class will hold all the UI template code and the functions to get the current location of the user. The overall code is provided in the code snippet below:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class CurrentLocation extends StatefulWidget {
  CurrentLocation({Key key}) : super(key: key);

  @override
  _CurrentLocationState createState() =&amp;gt; _CurrentLocationState();
}

class _CurrentLocationState extends State&amp;lt;CurrentLocation&amp;gt; {

  String currentLocation;

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Location"),
      ),
      body: SingleChildScrollView(
        child: Container(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: &amp;lt;Widget&amp;gt;[
              Container(
                  decoration: BoxDecoration(
                    color: Colors.teal[50]
                  ),
                  padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
                  child: Column(
                    children: &amp;lt;Widget&amp;gt;[
                      Row(
                        children: &amp;lt;Widget&amp;gt;[
                          Icon(Icons.location_on),
                          SizedBox(
                            width: 8,
                          ),
                          Expanded(
                            child: Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: &amp;lt;Widget&amp;gt;[
                                Text(
                                  'Location',
                                ),
                                (currentLocation!=null)?Text(currentLocation):Container(),
                              ],
                            ),
                          ),
                          SizedBox(
                            width: 8,
                          ),
                        ],
                      ),
                    ],
                  )),
                  RaisedButton(
                    color: Colors.blue[50],
                    onPressed: (){
                    },
                    child: Text("Get Location"),
                  )
            ],
          ),
        ),
      ),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For the template, we have used the Scaffold widget with an App bar and body. The template is simple with the use of a Column widget that houses other widgets. We have kept a Container that will show the location once fetched. Here, we have also used the icon as well. Then, we have RaisedButton whose onPressed event is empty as of now. Later, we are going to assign a function that grabs the current location value and sets the value to the currentLocation variable. Also, the currentLocation value is used as a conditional rendering to show the location value on the template.&lt;/p&gt;

&lt;p&gt;Now, we need to call the class widget in the home option of the MaterialApp widget of MyApp stateless class:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: CurrentLocation(),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Hence, we will get the following result on the emulator screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3HKJJIXs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AAvHZyXhNzw7n52L1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3HKJJIXs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AAvHZyXhNzw7n52L1.png" alt="" width="307" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing the Geolocator Package
&lt;/h3&gt;

&lt;p&gt;Now, we need to install the package called &lt;a href="https://pub.dev/packages/geolocator"&gt;geolocator&lt;/a&gt; that enables us to fetch the location and play around with it. This library provides easy access to platform-specific location services. It offers a cross-platform (iOS, Android) API for generic location (GPS, etc.) functions. Now in order to install this library, we need to add the &lt;strong&gt;&lt;em&gt;geolocator&lt;/em&gt;&lt;/strong&gt; to &lt;em&gt;pubspec.yaml&lt;/em&gt; file as shown in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dependencies:
  flutter:
    sdk: flutter

  geolocator: ^7.0.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Make sure to upgrade the Flutter/Dart SDK if this plugin does not work.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now, there are some configurations that need to be done so that our Flutter app can use the plugin properly.&lt;/p&gt;

&lt;p&gt;First, the &lt;strong&gt;&lt;em&gt;geolocator&lt;/em&gt;&lt;/strong&gt; plugin requires the AndroidX version of the Android Support Libraries. Hence, we need to add these support libraries to &lt;strong&gt;gradle.properties&lt;/strong&gt; file of &lt;strong&gt;./android&lt;/strong&gt; folder as directed in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;android.useAndroidX=true
android.enableJetifier=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then, we need to make sure that we set the compileSdkVersion in our &lt;strong&gt;./android/app/build.gradle&lt;/strong&gt; file to 30:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;android {
  compileSdkVersion 30
  ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now in order for our Flutter app to access location service from the device, we need to add certain &lt;strong&gt;permissions&lt;/strong&gt; first. For location service to work, we need to add the ACCESS_COARSE_LOCATION and the ACCESS_FINE_LOCATION permission to our &lt;em&gt;AndroidManifest.xml&lt;/em&gt; file. To add these permissions, we need to go to &lt;strong&gt;./android/app/src/main/AndroidManifest.xml&lt;/strong&gt; file and add these permissions as a direct child of  tag:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&amp;gt; 
&amp;lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For Android 10, it will beneficial to add ACCESS_BACKGROUND_LOCATION permission as well. This permission will enable the app to keep receiving updates even when our app is running in the background:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Hence, we have successfully applied all the necessary configurations to use the geolocator plugin in our Flutter app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Getting the User Location in Flutter
&lt;/h3&gt;

&lt;p&gt;Now, we are going to implement a function that checks for permissions if the app can use the location service of the device or not and then return the current location of the device or user.&lt;/p&gt;

&lt;p&gt;First, we need to initialize a Position instance variable that will hold the location position value. Then, we can use the LocationPermission instance provided by the geolocator plugin to check the permission. First, we check if the permission to use location is already available for the app using the checkPermission() method provided by the geolocator plugin. If not then, we request to grant permission using requestPremission() method. If we manually deny the permission then, we assign permission denied value to currentLocation else we fetch the current position value using the getCurrentPosition method and assign it to the position variable. Now, the position variable will hold the latitude and longitude value which we can set to the currentLocation variable.&lt;/p&gt;

&lt;p&gt;The overall Flutter code for this is provided in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Position position;

  void _getCurrentLocation() async {
    LocationPermission permission;

    permission = await Geolocator.checkPermission();
    if (permission == LocationPermission.denied) {
      permission = await Geolocator.requestPermission();
      if (permission == LocationPermission.denied) {
        setState(() {
          currentLocation ="Permission Denied";
        });
      }else{
        var position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
        setState(() {
          currentLocation ="latitude: ${position.latitude}" + " , " + "Logitude: ${position.longitude}";
        });
      }
    }else{
      var position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
      setState(() {
        currentLocation ="latitude: ${position.latitude}" + " , " + "Logitude: ${position.longitude}";
      });
    }
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Lastly, we need to assign this function to the onPressed event of the RaisedButton widget that we implemented earlier in the template:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RaisedButton(
  color: Colors.blue[50],
  onPressed: (){
    _getCurrentLocation();
  },
  child: Text("Get Location"),
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Hence, the overall demo of getting the current user location of the device/user is shown in the simulation below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---DFPVBRW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2Aaldjk5bYJeE1AjjV.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---DFPVBRW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2Aaldjk5bYJeE1AjjV.gif" alt="" width="512" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we can notice, once we tap on the “Get location” button, we will be asked if the permission of the device’s location service is to be provided to the app. If allowed, the location position values are displayed on the screen.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;The main objective of this tutorial was to demonstrate how to fetch the current location position of the user or device by using the geolocator package. The availability of this &lt;strong&gt;&lt;em&gt;geolocator&lt;/em&gt;&lt;/strong&gt; package made the whole process easier for us. The plugin is capable of much in terms of working with location values and whatnot. We can get the last known location, current location, continuous location updates, check for location permissions, calculate the distance between the locations and bearing. Now, the challenge is to use these features provided by the plugin to create location-centric Flutter applications.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.instaflutter.com/flutter-tutorials/user-location-flutter/"&gt;https://www.instaflutter.com&lt;/a&gt; on April 8, 2021.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
    </item>
    <item>
      <title>How to Implement Beautiful Charts in Flutter</title>
      <dc:creator>0xAirdropfarmer</dc:creator>
      <pubDate>Mon, 05 Apr 2021 00:21:08 +0000</pubDate>
      <link>https://dev.to/kris/how-to-implement-beautiful-charts-in-flutter-3icg</link>
      <guid>https://dev.to/kris/how-to-implement-beautiful-charts-in-flutter-3icg</guid>
      <description>&lt;p&gt;In this article, we are going to learn how to implement beautiful charts in Flutter. Charts are a great visual way to represent any type of data, be it statistical data, financial data, or stats. We are using charts in a lot of our Flutter app templates, and we are going to describe how we implemented them.&lt;/p&gt;

&lt;p&gt;When it comes to data visualization or representation in any field, the first thing that comes to our mind is charts. Charts are an effective and efficient mechanism to display statistical data that will not only make it easier to read the data but also compare and contrast. It helps display data in an informative way that makes it easy for readers to comprehend the overall data.&lt;/p&gt;

&lt;p&gt;Now that we know the importance of charts in the statistical world, we should also know that charts are very useful to display complex data in mobile applications as well. Here, we are going to learn how to add charts to a Flutter mobile app.&lt;/p&gt;

&lt;p&gt;The Flutter mobile application development framework is booming in the current context and it will surely take the center stage as a state-of-the-art mobile app development tech in near future. In this tutorial, we are going to make use of a &lt;strong&gt;charts_flutter&lt;/strong&gt; package to add different charts to our Flutter app UI. The idea is to install the library and use the different charts widget offered by it. We will also learn how to define the series list value that is to be used by chart widgets to visually represent the data.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;So, let’s get started!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up the Flutter Charts Project
&lt;/h3&gt;

&lt;p&gt;First, we need to create a new Flutter project. For that, make sure that the Flutter SDK and other flutter app development-related requirements are properly installed. If everything is properly set up, then in order to create a project, we can simply run the following command in the desired local directory:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flutter create chartpost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After the project has been set up, we can navigate inside the project directory and execute the following command in the terminal to run the project in either an available emulator or an actual device:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flutter run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Creating a Home Page UI
&lt;/h3&gt;

&lt;p&gt;Now, we are going to create a home page &lt;em&gt;Scaffold&lt;/em&gt;. For that, we need to create a file called &lt;strong&gt;home_page.dart&lt;/strong&gt;. Inside the file, we can use the code from the following code snippet:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
class HomePage extends StatelessWidget {
  @override
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.red,
        title: Text("Bitcoin price from Jan to March (2021) "),
      ),
      body: Center(
        child: Text("Hello, Charts!")
        ),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here, we have returned a simple Scaffold widget with an App Bar and a body from the stateless widget class called HomePage.&lt;/p&gt;

&lt;p&gt;Now, we need to import this stateless widget class in our main.dart file and assign it to the home option of the MaterialApp widget as shown in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:chartpost/home.dart';
import 'package:flutter/material.dart';

void main() =&amp;gt; runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomePage(),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now if we re-run the app, we will get the following result in our emulator screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jkGNJmmC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AJChUl3IRL6xuLn1E.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jkGNJmmC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AJChUl3IRL6xuLn1E.png" alt="" width="354" height="728"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding the charts_flutter Plugin
&lt;/h3&gt;

&lt;p&gt;Since we are going to add charts to our app, we are going to use the package called &lt;strong&gt;&lt;em&gt;charts_flutter&lt;/em&gt;&lt;/strong&gt;. This package is a Material Design data visualization library written natively in Dart. It provides a wide range of charts for data visualization which is lightweight and easy to configure as well. Now in order to install this library into our flutter project, we need to add the charts_flutter: ^0.8.1 line to our &lt;strong&gt;&lt;em&gt;pubspec.yaml&lt;/em&gt;&lt;/strong&gt; file as directed in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dependencies:
  flutter:
    sdk: flutter

  charts_flutter: ^0.8.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After successful installation, we are ready to use the chart widgets offered by this package.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bar Charts in Flutter
&lt;/h3&gt;

&lt;p&gt;In this section we are going to learn how to add a bar chart to our Flutter app. Firstly, we are going to create a model file that defines attributes of the data to be shown in the bar chart. Here, we are going to name the file &lt;strong&gt;bitcoin_price_series.dart.&lt;/strong&gt; Inside, we are going to define a class called BitcoinPriceSeries that takes in three parameters - month, price, and color. The overall code implementation is shown in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/foundation.dart';

class BitcoinPriceSeries {
  final String month;
  final int price;
  final charts.Color barColor;

  BitcoinPriceSeries(
      {@required this.month,
      @required this.price,
      @required this.barColor});
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now, we need to create a new file called &lt;strong&gt;bitcoin_price_chart.dart&lt;/strong&gt; to define the chart structure. Here, we are going to implement a stateless widget called BitcoinPriceChart that returns the Bar chart with series value. The Series configuration offered by charts library helps us define each series of data. The exact implementation of how to configure the series value is provided in the code snippet below&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:charts_flutter/flutter.dart' as charts;
import 'package:chartpost/bitcoin_price_series.dart';
import 'package:flutter/material.dart';

class BitcoinPriceChart extends StatelessWidget {
  final List&amp;lt;BitcoinPriceSeries&amp;gt; data;

  BitcoinPriceChart({@required this.data});

  @override
  Widget build(BuildContext context) {
    List&amp;lt;charts.Series&amp;lt;BitcoinPriceSeries, String&amp;gt;&amp;gt; series = [
      charts.Series(
          id: "Price",
          data: data,
          domainFn: (BitcoinPriceSeries series, _) =&amp;gt; series.month,
          measureFn: (BitcoinPriceSeries series, _) =&amp;gt; series.price,
          colorFn: (BitcoinPriceSeries series, _) =&amp;gt; series.barColor)
    ];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now that we have the list data that holds the bar chart series data, we can apply it to the UI template. Now, we are going to return a Container widget with Card widget as child that holds the BarChart widget taking the list and animate boolean value as parameters. The overall implementation is provided in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return Container(
      height: 400,
      padding: EdgeInsets.all(20),
      child: Card(
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Column(
            children: &amp;lt;Widget&amp;gt;[
              Text(
                "Bitcoin price from Jan to March (2021) ",
              ),
              Expanded(
                child:( charts.BarChart(series, animate: true)),

              )
            ],
          ),
        ),
      ),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now, we are going to add the Bar chart to our home page. For that, we need to import the BitcoinPriceChart stateless class widget into the home_page.dart file as shown in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';
import 'package:chartpost/bitcoin_price_series.dart';
import 'package:chartpost/bitcoin_price_chart.dart';
import 'package:charts_flutter/flutter.dart' as charts;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After import, we can define the list that stores the data based on BitcoinPriceSeries model as shown in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@override
  Widget build(BuildContext context) {
     final List&amp;lt;BitcoinPriceSeries&amp;gt; data = [
    BitcoinPriceSeries(
      month: "Jan",
      price: 50000,
      barColor: charts.ColorUtil.fromDartColor(Colors.red),
    ),
    BitcoinPriceSeries(
      month: "Feb",
      price: 60000,
      barColor: charts.ColorUtil.fromDartColor(Colors.blue),
    ),
    BitcoinPriceSeries(
      month: "March",
      price: 58000,
      barColor: charts.ColorUtil.fromDartColor(Colors.green),
    ),
  ];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Lastly, we need to add the BitcoinPriceChart widget to the body of the Scaffold in home page bypassing the required list data as shown in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.red,
        title: Text("Bitcoin price from Jan to March (2021) "),
      ),
      body: Center(
        child: BitcoinPriceChart(
      data: data,
    )
        ),
    );
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Hence, we will get the bar chart on our home screen as demonstrated in the emulator screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bop_nBnk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AlmoFaml2GGockYx6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bop_nBnk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AlmoFaml2GGockYx6.png" alt="" width="354" height="728"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hence, we have successfully added a bar chart to our Flutter app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pie Charts in Flutter
&lt;/h3&gt;

&lt;p&gt;Now that we know how to configure the data for the bar chart, we can easily add a pie chart as well using the exact same series list data. The bar chart data series and pie chart data series share the same format of data. Hence, we can simply add a pie chart using the PieChart widget offered by charts library supplying series list and animate boolean parameters as shown in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Expanded( 
  child:( charts.BarChart(series, animate: true)),
 ), Expanded(
    child:( charts.PieChart(series, animate: true)),       
 )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Note that, this PieChart widget was directly added to the &lt;strong&gt;bitcoin_price_chart.dart&lt;/strong&gt; file just below the BarChart widget inside the Column widget.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rFatSkvi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2A8kiaQIiggTm2YPEg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rFatSkvi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2A8kiaQIiggTm2YPEg.png" alt="" width="354" height="728"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hence, we have successfully added a Pie chart to our Flutter app as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;The main goal of this tutorial was to demonstrate how to implement various charts in Flutter. The availability of the &lt;strong&gt;charts_flutter&lt;/strong&gt; library made it easier to add charts to our Flutter app. The series-based data configuration along with lightweight widgets for a wide variety of widgets makes this library very powerful and efficient as well. Here, we learned how to add a bar chart and a pie chart. We also learned how to configure the series-based data to feed to chart widgets.&lt;/p&gt;

&lt;p&gt;Now the challenge is to add other types of charts to the Flutter application. The concept for adding the chart widget is the same but the data configuration might be a bit different.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.instaflutter.com/flutter-tutorials/flutter-charts/"&gt;https://www.instaflutter.com&lt;/a&gt; on April 2, 2021.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>charts</category>
      <category>flutter</category>
    </item>
    <item>
      <title>I created a Bot that will help you buy Doge or BTC based on Elon Musk’s tweet</title>
      <dc:creator>0xAirdropfarmer</dc:creator>
      <pubDate>Thu, 11 Mar 2021 12:01:38 +0000</pubDate>
      <link>https://dev.to/kris/i-created-a-bot-that-will-help-you-buy-doge-or-btc-based-on-elon-musk-s-tweet-15fl</link>
      <guid>https://dev.to/kris/i-created-a-bot-that-will-help-you-buy-doge-or-btc-based-on-elon-musk-s-tweet-15fl</guid>
      <description>&lt;p&gt;Now, we do not need to wait for Elon Musk to tweet something. We are especially waiting for Elon Mush to tweet about some crypto-currency or company so that its value goes up in the market.&lt;/p&gt;

&lt;p&gt;Why don’t we create a bot that will analyze Elon Musk’s tweet and inform us about the tweet?&lt;/p&gt;

&lt;p&gt;The bot is fairly simple. There are two sides: server-side and client-side.&lt;/p&gt;

&lt;p&gt;The server-side works in active mode. It monitors Elon Musk’s tweet and sends the buy signal to the client when detecting the tweet containing some hint of Doge or Bitcoin word.&lt;/p&gt;

&lt;p&gt;The client-side works in passive mode. It waits for the signal from the server on Doge or Bitcoin so that the client can analyze the info. Then finally, the client can decide on which coin to buy.&lt;/p&gt;

&lt;p&gt;The exact interpretation of the client and server-side is demonstrated in the flow image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c8o2J3JU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3840/1%2AL6Lh9YWOG7T10WN-73CkmQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c8o2J3JU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3840/1%2AL6Lh9YWOG7T10WN-73CkmQ.png" alt="" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Limitation…
&lt;/h3&gt;

&lt;p&gt;For now, there is only support for Binance which is for people in the US.&lt;/p&gt;

&lt;p&gt;Please subscribe to this email list and sign up to &lt;a href="https://www.gate.io/signup/3265513"&gt;Gate.io&lt;/a&gt; or &lt;a href="http://coinbase-consumer.sjv.io/gbbRm2"&gt;Coinbase &lt;/a&gt;using my referral link.&lt;/p&gt;

&lt;h2&gt;
  
  
  Roadmap
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Detect only Doge or Bitcoin words from the tweets. ( &lt;strong&gt;already done&lt;/strong&gt; )&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Buy in the Future market. ( *&lt;em&gt;not done yet *&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Detect Doge and Bitcoin logo from the tweet image. ( &lt;strong&gt;on the way on train model&lt;/strong&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Perform sentiment analysis on the stock. only for people located in the USA that can use &lt;a href="https://alpaca.markets/"&gt;Alpaca &lt;/a&gt;or &lt;a href="https://robinhood.com/"&gt;Robinhood&lt;/a&gt;. ( &lt;strong&gt;also not start yet that feature benefit only people in the USA may be kept on a paid plan&lt;/strong&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  If you have any Queries…
&lt;/h2&gt;

&lt;p&gt;You can join our [Facebook group](&lt;a href="https://www.facebook.com/groups/261805308872238%5C"&gt;https://www.facebook.com/groups/261805308872238\&lt;/a&gt;) and ask.&lt;/p&gt;

&lt;p&gt;Now, if you want to start implementing the bot then follow the instructions provided in the steps below:&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Server for Client
&lt;/h2&gt;

&lt;p&gt;In order to run the bot on a server, we require a cheap server. For that, I recommend &lt;a href="https://www.cloudways.com/en/?id=74316&amp;amp;elonbot_promo=signup"&gt;Cloudways&lt;/a&gt; because they provide a 10$/Month VPS server.&lt;/p&gt;

&lt;p&gt;The pricing plan is shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7jl70mzT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2344/1%2AxsCPdBGrOTQMwGt3lKSSeA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7jl70mzT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2344/1%2AxsCPdBGrOTQMwGt3lKSSeA.png" alt="" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, we need to go to the registration page to sign up as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ea6sdA_r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AOQkskIqJOzEMnhN6uRG7hw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ea6sdA_r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AOQkskIqJOzEMnhN6uRG7hw.png" alt="" width="626" height="615"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, we need to set the password as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2u-i2sER--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AV9MZjPrTEBxv4fwBaWEMwA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2u-i2sER--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AV9MZjPrTEBxv4fwBaWEMwA.png" alt="" width="587" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After successful signup, we will be redirected to the dashboard screen. In the dashboard, we need to change the fields specifying Your Application, Your Server, Your project as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WkdhkKtw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2522/1%2Aki1S-JwLW_OaNXe-GRWkFA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WkdhkKtw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2522/1%2Aki1S-JwLW_OaNXe-GRWkFA.png" alt="" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, w need to pick the Laravel as a server application as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DrS4s1Qx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2276/1%2AThaDTWTWklWMimk5BSy3Ig.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DrS4s1Qx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2276/1%2AThaDTWTWklWMimk5BSy3Ig.png" alt="" width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now to create a new server instance, we need to pick the server size and location as directed in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P1rc3wzO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AIdZdUismJPcioZMnVYQ-yQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P1rc3wzO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AIdZdUismJPcioZMnVYQ-yQ.png" alt="" width="460" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, we can see how much we get charged hourly and monthly.&lt;/p&gt;

&lt;p&gt;Next, we simply need to click on the **LAUNCH NOW **button as directed in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Hr-VwPX7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2534/1%2AjXVRHCIVHiHPrcUOyV6Olg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Hr-VwPX7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2534/1%2AjXVRHCIVHiHPrcUOyV6Olg.png" alt="" width="800" height="189"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The launch operation will take some time. Hence, we may need to wait for around 5 minutes for the setup process to complete:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aFcgUf1l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2300/1%2AB-FGpCZmHI_uPmVaFA7IYQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aFcgUf1l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2300/1%2AB-FGpCZmHI_uPmVaFA7IYQ.png" alt="" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After successful setup, we will get access to the server dashboard as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--J-JDOTDY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2286/1%2AH9FhVq6_JGAFgKQQyiOsKA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J-JDOTDY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2286/1%2AH9FhVq6_JGAFgKQQyiOsKA.png" alt="" width="800" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we need to go to the &lt;strong&gt;Setting &amp;amp; Package&lt;/strong&gt; menu and select the &lt;strong&gt;Advanced&lt;/strong&gt; tab as directed in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QgBUrybh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AQfBzlwxw-zztRlaYbPcBAA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QgBUrybh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AQfBzlwxw-zztRlaYbPcBAA.png" alt="" width="800" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we need to scroll down the same tab and enabled the **Access Application VIA IP **as directed in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nEXT875J--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AjHNeAMVNfgVq045uk6Xc-w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nEXT875J--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AjHNeAMVNfgVq045uk6Xc-w.png" alt="" width="733" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lastly, we need to **SAVE CHANGES **as directed in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CsdU_bg---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2Avylg_rCG3ziHdxgR5FjATg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CsdU_bg---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2Avylg_rCG3ziHdxgR5FjATg.png" alt="" width="517" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we need to go to set up our BOT. For that, we need to go to the **Applications **tab as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---xb5mXZS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AeOS4L5d1-gc9KdloFM_0wg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---xb5mXZS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AeOS4L5d1-gc9KdloFM_0wg.png" alt="" width="689" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can see our blank app below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RTFdNfpD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2312/1%2AlEO1IQYgCKtNoVulSY4HKg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RTFdNfpD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2312/1%2AlEO1IQYgCKtNoVulSY4HKg.png" alt="" width="800" height="259"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we need to go to **Deployment via Git **from the sidebar as directed in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bIpb-bu4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2272/1%2ANL-U9KMsk9_EecuNSLZHKA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bIpb-bu4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2272/1%2ANL-U9KMsk9_EecuNSLZHKA.png" alt="" width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, we need to click on **GENERATE SSH KEY **as directed in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pgAbzbf---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AFLe3WzbFJEJ1DKMotodv2g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pgAbzbf---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AFLe3WzbFJEJ1DKMotodv2g.png" alt="" width="731" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Register on GitHub to auto-update the bot
&lt;/h3&gt;

&lt;p&gt;For this tutorial, I chose to host source code on GitHub. It will make the server easier to upgrade.&lt;/p&gt;

&lt;p&gt;Also, make sure that you have a GitHub account. If you don’t, you can go ahead and Sign up as directed in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6O_SbIga--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2522/1%2AVetbyTMRA6WI83yALRtdNg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6O_SbIga--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2522/1%2AVetbyTMRA6WI83yALRtdNg.png" alt="" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The registration process is simple in GitHub, we just need to fill the credentials as directed in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e35JLwNK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AmFbR_XPTZLtmnG3IkhrGIw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e35JLwNK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AmFbR_XPTZLtmnG3IkhrGIw.png" alt="" width="658" height="552"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After successful registration with an email, we need to go to account settings and navigate to &lt;strong&gt;SSH and GPG keys&lt;/strong&gt; tab as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WaMoP7ls--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2126/1%2A1Mk82WlZqsGqYCyqPsuruA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WaMoP7ls--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2126/1%2A1Mk82WlZqsGqYCyqPsuruA.png" alt="" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, we need to hit the **New SSH key **as directed in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---ZhZHaiI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2254/1%2AktC6tCmiZJXQGemy6fgSWA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---ZhZHaiI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2254/1%2AktC6tCmiZJXQGemy6fgSWA.png" alt="" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we need to come back to Cloudways and click on the **View SSH KEY **tab. Here, we can get the SSH key and add it to GitHub. The exact location to get the key is shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9v1oFl2E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AeH5hcl44vNcxGhz70B4Bag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9v1oFl2E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AeH5hcl44vNcxGhz70B4Bag.png" alt="" width="798" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the SSH KEY dialog, we need to copy the SSH KEY:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KvmO-R_y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A19qvrb_DXP4udtCoFESKhg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KvmO-R_y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A19qvrb_DXP4udtCoFESKhg.png" alt="" width="800" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then, we need to paste the SSH key to GitHub as shown in the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IOd-aB4P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AD5_pfUZTiVzBpF5OySRAJA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IOd-aB4P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AD5_pfUZTiVzBpF5OySRAJA.png" alt="" width="778" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we need to come back to Cloudways and add the bot URL to &lt;a href="//mailto:git@github.com"&gt;git@github.com&lt;/a&gt;:krissnawat/elonbot_client.git.&lt;/p&gt;

&lt;p&gt;Then, we need to hit the &lt;strong&gt;PULL&lt;/strong&gt; button as directed in the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3UbLNU-3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2Agjh7o8bg_7Fe9oitBpo0xQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3UbLNU-3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2Agjh7o8bg_7Fe9oitBpo0xQ.png" alt="" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, if everything works fine then it means that the download was successful.&lt;/p&gt;

&lt;p&gt;Now our next step is to set up the bot. For that, we need to have a Chrome extension called &lt;a href="https://chrome.google.com/webstore/detail/secure-shell-app/pnhechapfaindjhompbnflcldabbghjo/related?hl=en"&gt;Secure Shell App&lt;/a&gt;. We can simply search for it in google from Chrome browser and add it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gaZacApD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2274/1%2Aznv55hWM4Kk4q3cGGnrfgg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gaZacApD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2274/1%2Aznv55hWM4Kk4q3cGGnrfgg.png" alt="" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the successful installation, we can hit **Launch App **which will redirect us to the following screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0LtwNFJ2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2302/1%2AUeysMe5RdXS9OQmI8vFVMw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0LtwNFJ2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2302/1%2AUeysMe5RdXS9OQmI8vFVMw.png" alt="" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, we need to paste the username and Server IP address.&lt;/p&gt;

&lt;p&gt;But first, we need to know where to get these credentials.&lt;/p&gt;

&lt;p&gt;For that, we need to go to our app as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UVYIDPKF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2430/1%2AVNOIBo0GJM8_JtaDFGbWJg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UVYIDPKF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2430/1%2AVNOIBo0GJM8_JtaDFGbWJg.png" alt="" width="800" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we navigate inside the app, we will see the credentials as highlighted in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KnomKrnL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ALoFeDlMdeDNYWXClDtu4gw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KnomKrnL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ALoFeDlMdeDNYWXClDtu4gw.png" alt="" width="800" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For now, we can connect and access the inside server as shown in the terminal screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qOAtyRmU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AmO-pxnYQxS1tMXtmNXf12g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qOAtyRmU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AmO-pxnYQxS1tMXtmNXf12g.png" alt="" width="800" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The terminal for the server is shown in the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R0zwwSyT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A0ZIuBa4aqWGz4lwnLBzA7Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R0zwwSyT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A0ZIuBa4aqWGz4lwnLBzA7Q.png" alt="" width="784" height="236"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now next quick thing is to run some commands in the terminal. We need to execute the &lt;strong&gt;composer install.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After the successful execution, we need to run **nano .env **command as shown in the terminal screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--92e5qtGf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A3LHkz2eRjrjP6bT3SAwvCA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--92e5qtGf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A3LHkz2eRjrjP6bT3SAwvCA.png" alt="" width="800" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now inside the .env file, we need to update the database credential as highlighted in the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nlU8l1OW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ADUCmkoMhpg380np1sQZYjA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nlU8l1OW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ADUCmkoMhpg380np1sQZYjA.png" alt="" width="609" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we need to head back to Cloudways dashboard where we need to locate the DB Name, Username, Password. We just need to copy and replace in the .env file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w91tcwL_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AKhWTuk-DANNIKan9h23urQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w91tcwL_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AKhWTuk-DANNIKan9h23urQ.png" alt="" width="449" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When done, we need to hit CTRL+X to save as directed in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1DqUH7-X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AbX_6GK0Q13cU6fbGQQglsA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1DqUH7-X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AbX_6GK0Q13cU6fbGQQglsA.png" alt="" width="605" height="123"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we need to execute the command shown in the snippet below:&lt;/p&gt;

&lt;p&gt;php artisan migrate --seed&lt;/p&gt;

&lt;p&gt;The exact execution of the command in the terminal is shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IlJWaXGN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A1xkdbnSwTg8IHZLUG3rXWw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IlJWaXGN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A1xkdbnSwTg8IHZLUG3rXWw.png" alt="" width="800" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hence, we have completed the installation for now. We can access our app with URL in the Cloudways dashboard:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pBvnrMCY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AY1GspnrX9Xxf5NaqvGBi_Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pBvnrMCY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AY1GspnrX9Xxf5NaqvGBi_Q.png" alt="" width="439" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we navigate to the URL, we will be redirected to the login page. But first, we need to register as directed in the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mspWAUoJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2Ag_yyfHQ2sIRHDNrdH4AQ3Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mspWAUoJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2Ag_yyfHQ2sIRHDNrdH4AQ3Q.png" alt="" width="680" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need to type in our credentials and hit the &lt;strong&gt;REGISTER&lt;/strong&gt; button:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EzGC3ETS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A8Hx5GDOcPSr2vv_FkjjD_Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EzGC3ETS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A8Hx5GDOcPSr2vv_FkjjD_Q.png" alt="" width="559" height="552"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After successful sign-up, we need to perform the following task:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Find and create an API key and Secret Key on Binance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose which coin that you need to buy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start bot.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally, we need to prepare USDT in the Binance wallet.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cxWbcgaY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3820/1%2AWB21T2hnnZyKKUtYgMu2_A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cxWbcgaY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3820/1%2AWB21T2hnnZyKKUtYgMu2_A.png" alt="" width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating Binance API key
&lt;/h2&gt;

&lt;p&gt;First, we need to go to the Binance API Management page as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G2xXNUIU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2Al4JspVmr1F-2BXxCQOYWAw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G2xXNUIU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2Al4JspVmr1F-2BXxCQOYWAw.png" alt="" width="515" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, we need to fill the key label as directed in the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fZ7H7uwf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2162/1%2A594i_N-5YDWpz-FRRwH44A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fZ7H7uwf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2162/1%2A594i_N-5YDWpz-FRRwH44A.png" alt="" width="800" height="286"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For security verification, you can use your own credentials:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YY6UWJ0K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AkPguGgNhDeBhmlL2yMOntA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YY6UWJ0K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AkPguGgNhDeBhmlL2yMOntA.png" alt="" width="378" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, we will get the key as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gLRRX41D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2052/1%2ArmBEy-LQK_oAceZ_VnOPEQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gLRRX41D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2052/1%2ArmBEy-LQK_oAceZ_VnOPEQ.png" alt="" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Activate 2FA for secure our bot
&lt;/h3&gt;

&lt;p&gt;In this step, we are going to activate the 2-factor authentication service to secure our bot.&lt;/p&gt;

&lt;p&gt;For that, we need to head to the Profile tab as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yYHB6ZSm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2042/1%2AjTPkE1lr0Ln_e9MuXmpw1A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yYHB6ZSm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2042/1%2AjTPkE1lr0Ln_e9MuXmpw1A.png" alt="" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, we need to enable the 2FA by hitting the &lt;strong&gt;ENABLE&lt;/strong&gt; button:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dFbmgRcs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2732/1%2AeoBRXptOqbRf-F44zb2gJg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dFbmgRcs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2732/1%2AeoBRXptOqbRf-F44zb2gJg.png" alt="" width="800" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To enable, it will ask you for your password which you can enter and hit the &lt;strong&gt;CONFIRM&lt;/strong&gt; button:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BT5CjmHr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A5z3QDiVLEtXLHbIfpBwnBw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BT5CjmHr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A5z3QDiVLEtXLHbIfpBwnBw.png" alt="" width="800" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, we must make sure not to forgot to save our recovery code for using Google Authenticator:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--njZA0QBa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2616/1%2AoZQoIdbdZZFpEw2erx9jfw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--njZA0QBa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2616/1%2AoZQoIdbdZZFpEw2erx9jfw.png" alt="" width="800" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now in order to log in, we will need to perform 2-factor authentication as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_r13kI_o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AF5sOEb2ZrpFKoM4APqLj_Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_r13kI_o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AF5sOEb2ZrpFKoM4APqLj_Q.png" alt="" width="732" height="474"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h1&gt;
  
  
  Join Coinmonks &lt;a href="https://t.me/joinchat/EPmjKpNYwRMsBI4p"&gt;Telegram group&lt;/a&gt; and learn about crypto trading and investing
&lt;/h1&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Also, Read
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The Best &lt;a href="https://medium.com/coinmonks/crypto-trading-bot-c2ffce8acb2a"&gt;Crypto Trading Bot&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://medium.com/coinmonks/bitcoin-exchange-in-india-7f1fe79715c9"&gt;Bitcoin exchange in India&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://medium.com/coinmonks/bitcoin-savings-account-e65b13f92451"&gt;Bitcoin Savings Account&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Best &lt;a href="https://medium.com/coinmonks/best-crypto-tax-tool-for-my-money-72d4b430816b"&gt;Crypto Tax Software&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://blog.coincodecap.com/grid-trading"&gt;Grid Trading&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://medium.com/coinmonks/crypto-exchange-dd2f9d6f3769"&gt;Best Crypto Exchange&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>twitter</category>
      <category>elonmusk</category>
      <category>doge</category>
    </item>
    <item>
      <title>How to Add Google Maps in Flutter</title>
      <dc:creator>0xAirdropfarmer</dc:creator>
      <pubDate>Fri, 05 Mar 2021 07:48:50 +0000</pubDate>
      <link>https://dev.to/kris/how-to-add-google-maps-in-flutter-36kg</link>
      <guid>https://dev.to/kris/how-to-add-google-maps-in-flutter-36kg</guid>
      <description>&lt;p&gt;The Flutter ecosystem is flourishing and will definitely make a huge mark in the near future as one of the most established cross-platform mobile application development frameworks. The community is rapidly growing and there are already many powerful libraries available already. In this tutorial, we are going to make use of the &lt;strong&gt;&lt;em&gt;googler_maps_flutter&lt;/em&gt;&lt;/strong&gt; package in order to display maps in our Flutter apps.&lt;/p&gt;

&lt;p&gt;Maps are used in applications that deal with navigation and delivery such as Yelp or UberEats, shopping applications, geolocation apps, etc. We can use it to show locations, track locations, real-time navigation, etc. In this tutorial, we are going to use the Google Maps API from the Google Developer Console. The idea is to integrate the Google API key equipped with Android Google map SDK to our Flutter project. Then, we will use the mentioned package to show the map on the app screen. We will also work with markers and their customizations.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;So, let’s get started!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a New Flutter Project
&lt;/h3&gt;

&lt;p&gt;First, we need to create a new Flutter project. For that, make sure that the Flutter SDK and other Flutter app development-related requirements are properly installed. If everything is properly set up, then in order to create a project, we can simply run the following command in the desired local directory:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flutter create googleMapExample
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After the project has been set up, we can navigate inside the project directory and execute the following command in the terminal to run the project in either an available emulator or an actual device:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flutter run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After successfully build, we will get the following result in the emulator screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v9G_C3gd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AKbS_kHyek1fAqpEm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v9G_C3gd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AKbS_kHyek1fAqpEm.jpg" alt="" width="325" height="665"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Scaffolding the Flutter Project
&lt;/h2&gt;

&lt;p&gt;Now, we need to replace the default template with our own project structure template. First, we need to create a folder called &lt;strong&gt;./screens&lt;/strong&gt; inside the &lt;strong&gt;./lib&lt;/strong&gt; folder. Then, inside the ./lib/screens folder, we need to create a new file called &lt;strong&gt;Home.dart&lt;/strong&gt;. Inside the &lt;strong&gt;Home.dart&lt;/strong&gt;, we are going to implement a simple Stateful widget class returning a Scaffold widget with a basic App bar and an empty Container body. The code for &lt;strong&gt;Home.dart&lt;/strong&gt; is shown in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() =&amp;gt; _HomePageState();
}

class _HomePageState extends State&amp;lt;HomePage&amp;gt; {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Maps"),
        centerTitle: true,
      ),
      body: Container(
        child: Center(
          child: Text("Maps"),
        ),
      ),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now, we need to replace the default template in the &lt;strong&gt;&lt;em&gt;main.dart&lt;/em&gt;&lt;/strong&gt; file and call the HomePage screen in the home option of MaterialApp widget as shown in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'package:flutter/material.dart';
import 'package:mapExample/screens/Home.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: HomePage(),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Hence, we will get the screen as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PzW_FAwL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AWRlGzYn_Cw267y7c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PzW_FAwL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AWRlGzYn_Cw267y7c.png" alt="" width="304" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Getting The API Key for Google Maps
&lt;/h3&gt;

&lt;p&gt;Now, we need the API key for Google Maps in order to access the map in our application. The process to get the API key is easy. We need to go on and login to Google Developer Console at &lt;a href="https://cloud.google.com/maps-platform/"&gt;https://cloud.google.com/maps-platform&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In the developer console, we need to create a project if we don’t have one already, which will lead us to the following screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qB48MltP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2AP9TF6U46q2ejfERT.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qB48MltP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2AP9TF6U46q2ejfERT.png" alt="" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above screenshot, we are in the &lt;strong&gt;Credentials&lt;/strong&gt; view of our project. In &lt;strong&gt;Credentials&lt;/strong&gt;, we can create the API key and restrict it for the particular service which in our case is Android Google Maps SDK.&lt;/p&gt;

&lt;p&gt;When we click on “+ CREATE CREDENTIALS”, we will get the options as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IecqTq2_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2As8N3PdbAbRhjEQ_S.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IecqTq2_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2As8N3PdbAbRhjEQ_S.png" alt="" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the options, we need to click on “API key”, which will lead us to follow dialog:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ru6Nzy_K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2ADnisIboWranZM5f9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ru6Nzy_K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2ADnisIboWranZM5f9.jpg" alt="" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The dialog states that the &lt;strong&gt;API key is created&lt;/strong&gt;. It means we have the API key now but the services to be provided by the API key are yet not enabled.&lt;/p&gt;

&lt;p&gt;Hence, we will get the API key without any service as shown in the code snippet below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_UScCfe9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2AL6bQk82_b0jFtZdk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_UScCfe9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2AL6bQk82_b0jFtZdk.jpg" alt="" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since our API key is not restricted to any services, we need to apply some restrictions to it. But before that, we need to ensure that the “ &lt;strong&gt;Google Maps Android API v2&lt;/strong&gt; “ service is enabled.&lt;/p&gt;

&lt;p&gt;Then, we can restrict the API key to Maps SDK for Android by navigating inside &lt;strong&gt;API key1&lt;/strong&gt; as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--weJS0yBW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2Awi80XejaUkpQ332y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--weJS0yBW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2Awi80XejaUkpQ332y.png" alt="" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After selecting the service that we require, we need to click on ‘SAVE’ to save the configurations to the API key.&lt;/p&gt;

&lt;p&gt;Then, we will get the API key with Google Maps SDK for Android enabled as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ciHIMy7I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2AdNd9ouRK0zjtcFt_.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ciHIMy7I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2AdNd9ouRK0zjtcFt_.jpg" alt="" width="800" height="97"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, our API key is enabled and ready for use.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding the API Key to our Flutter App
&lt;/h3&gt;

&lt;p&gt;In order to add the Android Maps API key to the Flutter project, we need to first go to the &lt;strong&gt;AndroidManifest.xml&lt;/strong&gt; file.&lt;/p&gt;

&lt;p&gt;In our &lt;strong&gt;AndroidManifest.xml file&lt;/strong&gt;, we need to add the following code as a child of the application element:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;manifest ...
  &amp;lt;application ...
    &amp;lt;meta-data android:name="com.google.android.geo.API_KEY"
               android:value="YOUR KEY HERE"/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here, we need to replace the value in android:value with the API key that we generated in the above steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Make sure you use your own API key.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Google Maps Flutter Plugin
&lt;/h3&gt;

&lt;p&gt;Now, we are going to use the package called &lt;a href="https://pub.dev/packages/google_maps_flutter"&gt;google_maps_flutter&lt;/a&gt;. This plugin provides the GoogleMap widget to be used in our Flutter project to show the map on the screen. The widget houses many properties that allow us to tamper with the displayed map and customize it accordingly.&lt;/p&gt;

&lt;p&gt;Now, to install this plugin, we need to add the plugin in our &lt;strong&gt;pubspec.yaml&lt;/strong&gt; file as shown in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dependencies: 
     google_maps_flutter: ^1.2.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Adding Maps to The Home Screen
&lt;/h3&gt;

&lt;p&gt;Now, we are going to add the GoogleMap widget to our Home screen to display the map on the screen. For this, we need to initialize the GoogleMapController that handles the loading state of the map. Then, we need to define the CameraPosition that determines which location the map has to show in. In CameraPosition class, we can assign the target value which is latitude and longitude. We can also specify the zoom value which will determine how much the camera is to be zoomed into the map.&lt;/p&gt;

&lt;p&gt;Then, we need to use the GoogleMap widget with all the required properties configured as shown in the code snippet below:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class _HomePageState extends State&amp;lt;HomePage&amp;gt; {
  Completer&amp;lt;GoogleMapController&amp;gt; _controller = Completer();

  static final CameraPosition _initialCameraPosition = CameraPosition(
    target: LatLng(37.42796133580664, -122.085749655962),
    zoom: 15,
  );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Maps"),
        centerTitle: true,
      ),
      body: GoogleMap(
        mapType: MapType.normal,
        initialCameraPosition: _initialCameraPosition,
        onMapCreated: (GoogleMapController controller) {
          _controller.complete(controller);
        },
      ),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here, using the mapType option on the GoogleMap widget, we can choose what type of map to show. It can be a satellite image, a roadmap, or a normal map. The onMapCreated event will be created after the map has been placed on the screen. In this event, we can choose to add the map markers which we are going to do later.&lt;/p&gt;

&lt;p&gt;The resultant map is shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0zv2J0Qw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2A4kLQ4tB0C36MIGGF.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0zv2J0Qw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2A4kLQ4tB0C36MIGGF.png" alt="" width="314" height="629"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding Map Markers
&lt;/h3&gt;

&lt;p&gt;Now, we are going to add a marker to our map. The markers help us show a specific location on the map. In order to set the markers, we need to initialize a state that holds the markers. Then, we are going to create a function that will be triggered in the onMapCreated event. After the map is created, we will add the markers to the screen. To add markers, we have access to the Marker widget which will take a markerId and position value (latitude and longitude). The markers initialization is provided in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Set&amp;lt;Marker&amp;gt; _markers = {};

void _onMapCreated (GoogleMapController controller) {
  setState(() {
    _markers.add(
      Marker(
        markerId: MarkerId("id-1"),
        position: LatLng(37.42796133580664, -122.085749655962)
      )
    );
  });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now, we need to set the markers property in GoogleMap widget and also assign the _onMapCreated function in the onMapCreated event as shown in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;body: GoogleMap(
  mapType: MapType.normal,
  initialCameraPosition: _initialCameraPosition,
  onMapCreated: _onMapCreated,
  markers: _markers,
),
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Hence, we will get the marker on the map as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TjDklIF8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AA5FgjIXIDDf9DhpN.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TjDklIF8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AA5FgjIXIDDf9DhpN.png" alt="" width="314" height="629"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding Info to The Map Markers
&lt;/h3&gt;

&lt;p&gt;We can also customize our markers based on our own needs. We can add information to it as well. The information will be shown once we click on the marker on the map. In order to add the marker info, we need to add infoWindow property to the Marker widget. Then, we need to use the InfoWindow widget to add extra information to the marker as shown in the code snippet below:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;void _onMapCreated (GoogleMapController controller) {
    setState(() {
      _markers.add(
        Marker(
          markerId: MarkerId("id-1"),
          position: LatLng(37.42796133580664, -122.085749655962),
          infoWindow: InfoWindow(
            title: "GooglePlex"
          )
        )
      );
    });
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now once we click on the marker, we will see the information as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uEUAugU0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AtXU6Lguv9H8bQjlI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uEUAugU0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AtXU6Lguv9H8bQjlI.png" alt="" width="314" height="629"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not only that, we can add custom icons and other elements to the marker which is pretty easy as well.&lt;/p&gt;

&lt;p&gt;Finally, we have successfully integrated Google Maps into our Flutter map project using Google Maps SDK API key from Google Developer Console and &lt;em&gt;google_maps_flutter&lt;/em&gt; package.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;The main objective of this Flutter tutorial is to explore the integration of Google Maps in the Flutter environment. Google Maps is a powerful geo-navigation service provided by Google which can be integrated into almost any technology nowadays. In this case, we made use of Google API restricted to Android Google Maps SDK to integrate Google Maps into our Flutter project.&lt;/p&gt;

&lt;p&gt;Then, in order to show the actual map on the UI of the mobile app, we made use of the latest package available which is &lt;strong&gt;&lt;em&gt;google_maps_flutter&lt;/em&gt;&lt;/strong&gt;. The configurations were easy and simple. The map was set up with the help of a simple GoogleMap widget and some basic configurations. In the end, we were also able to add some markers to the map. A lot of other things are possible with this widget which is a challenge for you to explore.&lt;/p&gt;

&lt;p&gt;If you found this tutorial on how to add maps to Flutter apps, please consider spreading the word, by sharing the link further. Cheers!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.instaflutter.com/flutter-tutorials/flutter-maps/"&gt;https://www.instaflutter.com&lt;/a&gt; on March 3, 2021.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>googlemaps</category>
    </item>
    <item>
      <title>How to add Youtube video in React Native</title>
      <dc:creator>0xAirdropfarmer</dc:creator>
      <pubDate>Thu, 04 Mar 2021 08:14:18 +0000</pubDate>
      <link>https://dev.to/kris/how-to-add-youtube-video-in-react-native-47me</link>
      <guid>https://dev.to/kris/how-to-add-youtube-video-in-react-native-47me</guid>
      <description>&lt;p&gt;Video support is a feature to make your app more lively, more interactive, and more fun. By the end of this article, you will be able to embed any Youtube videos of your choice in React Native apps easily. For you to understand this tutorial you should be familiar with the use of &lt;a href="https://reactjs.org/docs/hooks-reference.html#useref"&gt;**useRef &lt;/a&gt;&lt;strong&gt;and&lt;a href="https://reactjs.org/docs/hooks-state.html"&gt;** useState &lt;/a&gt;&lt;/strong&gt;in React Native.&lt;/p&gt;

&lt;p&gt;To achieve playing Youtube videos in React Native, we will be making use of the npm dependency named &lt;a href="https://www.npmjs.com/package/react-native-youtube-iframe"&gt;**react-native-youtube-iframe&lt;/a&gt;. **We will work through using this library by fully integrating it into an app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;You need to install &lt;strong&gt;react-native-webview&lt;/strong&gt; first. Simply run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add react-native-webview

or

npm install react-native-webview
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;then install &lt;strong&gt;react-native-youtube-iframe:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add react-native-youtube-iframe

or 

npm install react-native-youtube-iframe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow strict-local
 */

import React from 'react';
import {View} from 'react-native';
import YoutubePlayer from 'react-native-youtube-iframe';

const App = () =&amp;gt; {

  return (
    &amp;lt;View&amp;gt;
      &amp;lt;YoutubePlayer
        height={300}
        play={true}
        videoId={'84WIaK3bl_s'}
      /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The required props here are &lt;em&gt;**height *&lt;/em&gt;&lt;em&gt;and the *&lt;/em&gt;&lt;em&gt;videoId *&lt;/em&gt;*of the Youtube video you intend to play in the React Native app and as seen in the app below, we have a Casey Neistat travel vlog on display:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bRr6TQt5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AEP6n7qBpP58QsqbA.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bRr6TQt5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AEP6n7qBpP58QsqbA.jpg" alt="" width="138" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;&lt;em&gt;play&lt;/em&gt;&lt;/strong&gt; prop is set to true, so let us take it a step further and control play and pause actions:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
 * Sample React Native App
 * [https://github.com/facebook/react-native](https://github.com/facebook/react-native)
 *
 * @format
 * @flow strict-local
 */

import React, {useState, useCallback} from 'react';
import {Button, View, Alert} from 'react-native';
import YoutubePlayer from 'react-native-youtube-iframe';

const App = () =&amp;gt; {
  const [playing, setPlaying] = useState(false);

  const togglePlaying = () =&amp;gt; {
    setPlaying((prev) =&amp;gt; !prev);
  }

  return (
    &amp;lt;View&amp;gt;
      &amp;lt;YoutubePlayer
        height={300}
        play={playing}
        videoId={'84WIaK3bl_s'}
      /&amp;gt;
      &amp;lt;Button title={playing ? 'pause' : 'play'} onPress={togglePlaying} /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now we have control to play and pause the Youtube video. It would be nice to add a feature to tell the user that the video is done playing by passing a callback such as the &lt;em&gt;**onChangeState *&lt;/em&gt;*prop provided by the dependency:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
 * Sample React Native App
 * [https://github.com/facebook/react-native](https://github.com/facebook/react-native)
 *
 * @format
 * @flow strict-local
 */

import React, {useState} from 'react';
import {Button, View, Alert} from 'react-native';
import YoutubePlayer from 'react-native-youtube-iframe';

const App = () =&amp;gt; {
  const [playing, setPlaying] = useState(false);

  const onStateChange = (state) =&amp;gt; {
    if (state === 'ended') {
      setPlaying(false);
      Alert.alert('video has finished playing!');
    }
  }

  const togglePlaying = () =&amp;gt; {
    setPlaying((prev) =&amp;gt; !prev);
  }

  return (
    &amp;lt;View&amp;gt;
      &amp;lt;YoutubePlayer
        height={300}
        play={playing}
        videoId={'84WIaK3bl_s'}
        onChangeState={onStateChange}
      /&amp;gt;
      &amp;lt;Button title={playing ? 'pause' : 'play'} onPress={togglePlaying} /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bn1XZMwl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2A97FyaaQ_QMCbBxk0.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bn1XZMwl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2A97FyaaQ_QMCbBxk0.gif" alt="" width="138" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we’re done learning the basic usage of this Youtube player dependency, let us go ahead and build complete control for our video player to play, pause, skip, and mute.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, {useState, useRef} from 'react';
import {View, Alert, StyleSheet} from 'react-native';
import YoutubePlayer from 'react-native-youtube-iframe';
import {Icon} from 'react-native-elements';

const App = () =&amp;gt; {
  const [playing, setPlaying] = useState(false);
  const [isMute, setMute] = useState(false);
  const controlRef = useRef();

  const onStateChange = (state) =&amp;gt; {
    if (state === 'ended') {
      setPlaying(false);
      Alert.alert('video has finished playing!');
    }
    if (state !== 'playing') {
      setPlaying(false);
    }
  };

  const togglePlaying = () =&amp;gt; {
    setPlaying((prev) =&amp;gt; !prev);
  };

  const seekBackAndForth = (control) =&amp;gt; {
    console.log('currentTime');
    controlRef.current?.getCurrentTime().then((currentTime) =&amp;gt; {
      control === 'forward'
        ? controlRef.current?.seekTo(currentTime + 15, true)
        : controlRef.current?.seekTo(currentTime - 15, true);
    });
  };

  const muteVideo = () =&amp;gt; setMute(!isMute);

  const ControlIcon = ({name, onPress}) =&amp;gt; (
    &amp;lt;Icon onPress={onPress} name={name} size={40} color="#fff" /&amp;gt;
  );

  return (
    &amp;lt;View style={styles.container}&amp;gt;
      &amp;lt;YoutubePlayer
        height={300}
        ref={controlRef}
        play={playing}
        mute={isMute}
        videoId={'84WIaK3bl_s'}
        onChangeState={onStateChange}
      /&amp;gt;
      &amp;lt;View style={styles.controlContainer}&amp;gt;
        &amp;lt;ControlIcon
          onPress={() =&amp;gt; seekBackAndForth('rewind')}
          name="skip-previous"
        /&amp;gt;
        &amp;lt;ControlIcon
          onPress={togglePlaying}
          name={playing ? 'pause' : 'play-arrow'}
        /&amp;gt;
        &amp;lt;ControlIcon
          onPress={() =&amp;gt; seekBackAndForth('forward')}
          name="skip-next"
        /&amp;gt;
      &amp;lt;/View&amp;gt;
      &amp;lt;ControlIcon
        onPress={muteVideo}
        name={isMute ? 'volume-up' : 'volume-off'}
      /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: 'darkblue',
  },
  controlContainer: {
    flexDirection: 'row',
    justifyContent: 'space-around',
  },
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We have added more custom controls to the original component we already had before and added callbacks to seek forward and backward using the &lt;em&gt;**playerRef *&lt;/em&gt;&lt;em&gt;ref. The mute control is basically managed by the *&lt;/em&gt;&lt;em&gt;isMute&lt;/em&gt;** state but it is worthy of note that the dependency provides a method &lt;strong&gt;&lt;em&gt;isMuted&lt;/em&gt;&lt;/strong&gt; (returns a promise that resolves to true if the video is muted, false if not) to determine if the video is muted or not.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ELmGqB7T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2A2b72kR_dpe9TN2_0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ELmGqB7T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2A2b72kR_dpe9TN2_0.jpg" alt="" width="138" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Embedding and playing Youtube videos in your React Native app is seamless and a more affordable way of displaying videos in your app, given that Youtube will support the costs of hosting the video itself. The npm dependency we described is really easy to use and is highly customizable as we have seen in the above snippet where we added forward and rewind controls.&lt;/p&gt;

&lt;p&gt;Next time you’re looking to add Youtube video support to React Native apps, refer to this tutorial. If you enjoyed the project, please consider sharing the link with your friends and community. Cheers!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://www.instamobile.io/react-native-tutorials/play-youtube-videos-react-native/"&gt;originally published on instamobile.io&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>reactnative</category>
      <category>youtube</category>
    </item>
    <item>
      <title>Generate Haptic Feedback in React Native</title>
      <dc:creator>0xAirdropfarmer</dc:creator>
      <pubDate>Fri, 12 Feb 2021 06:29:32 +0000</pubDate>
      <link>https://dev.to/kris/generate-haptic-feedback-in-react-native-1oh6</link>
      <guid>https://dev.to/kris/generate-haptic-feedback-in-react-native-1oh6</guid>
      <description>&lt;h2&gt;
  
  
  How to Generate Haptic Feedback in React Native
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Perceived performance is critical in mobile apps. We need to make our apps fast and snappy, otherwise, users won’t use them. Adding features like animations and haptic touch feedback makes mobile apps feel more performant. In this article we are going to be talking about &lt;strong&gt;Haptic Feedback in React Native&lt;/strong&gt; — what it is and how can we implement it in mobile apps.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PvzT_9pf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2A_8vlN7eGjH4nS_uJ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PvzT_9pf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2048/0%2A_8vlN7eGjH4nS_uJ.png" alt="" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Haptic touch feedback is engineered feedback from applying touch on a game, console or smartphone. You know those vibrations from your favorite video games when your character dies or when the ball strikes the bar in FIFA.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;At Instamobile, we use haptics feedback in all of our React Native apps, in order to make the user experience snappy and engaging&lt;/strong&gt;. Take a look at big apps, such as Facebook, Instagram or Twitter and notice how nice the haptic feedback feels in your hand when you are taking important actions such as likes or follows.&lt;/p&gt;

&lt;p&gt;The haptic feedback library we are about to explore in this React Native tutorial is provided by &lt;a href="https://expo.io/"&gt;Expo&lt;/a&gt; and is called &lt;strong&gt;&lt;em&gt;expo-haptics&lt;/em&gt;&lt;/strong&gt;. After exploring the library we will go ahead and build a tiny application to apply what what we have learnt.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;Create a new Expo project&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expo init haptic_feedback_example
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Install &lt;strong&gt;&lt;em&gt;expo-haptics&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expo install expo-haptics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now let us explore the methods and their most likely use case, there are three methods provided by this dependency:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a. Haptics.selectionAsync()&lt;/strong&gt;: This function takes no argument. This call produces a vibration about 1 second after this function has been triggered. This function can be applied when the animation is done. The animation could be initiated by the user or initiated programmatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;b. Haptics.notificationAsync(type):&lt;/strong&gt; This function takes an argument *type *which can be one of the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Haptics.NotificationFeedbackType.Success&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Haptics.NotificationFeedbackType.Warning&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Haptics.NotificationFeedbackType.Error&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This function could be applied when giving feedback after validation. Regular users of Snapchat are familiar with this vibration on their phone after scanning a Snapchat QR code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;c. Haptics.impactAsync(style):&lt;/strong&gt; This function also accepts only one argument which is usually one of three values depending the intensity of the desired feedback:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Haptics.ImpactFeedbackStyle.Light&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Haptics.ImpactFeedbackStyle.Medium&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Haptics.ImpactFeedbackStyle.Heavy&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This function, on invocation, produces a quicker feedback than the &lt;em&gt;selectionAsync&lt;/em&gt; and can be used to give instant haptic feedback when a user presses a button. The topping on the cake is that you get to regulate the intensity of the vibration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Haptic Feedback in React Native
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Example 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We have our React Native project created already so so let’s build a simple project and test the &lt;em&gt;impactAsync&lt;/em&gt; method and explore the different haptic feedback styles:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow strict-local
 */

import React from 'react';
import {StyleSheet, TouchableOpacity, View, Text} from 'react-native';
import * as Haptics from 'expo-haptics';

const HapticFeedbackExample = () =&amp;gt; {
  function impactAsync(style) {
    switch (style) {
      case 'light':
        Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
        break;
      case 'medium':
        Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
        break;
      default:
        Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy);
        break;
    }
  }

  return (
    &amp;lt;View&amp;gt;
      &amp;lt;TouchableOpacity onPress={() =&amp;gt; impactAsync('light')}&amp;gt;
        &amp;lt;Text style={styles.light}&amp;gt;Light&amp;lt;/Text&amp;gt;
      &amp;lt;/TouchableOpacity&amp;gt;
      &amp;lt;TouchableOpacity onPress={() =&amp;gt; impactAsync('medium')}&amp;gt;
        &amp;lt;Text style={styles.medium}&amp;gt;Medium&amp;lt;/Text&amp;gt;
      &amp;lt;/TouchableOpacity&amp;gt;
      &amp;lt;TouchableOpacity onPress={() =&amp;gt; impactAsync('heavy')}&amp;gt;
        &amp;lt;Text style={styles.heavy}&amp;gt;Heavy&amp;lt;/Text&amp;gt;
      &amp;lt;/TouchableOpacity&amp;gt;
    &amp;lt;/View&amp;gt;
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
  light: {
    color: '#ffffff',
    fontSize: 20,
    width: 300,
    height: 100,
    backgroundColor: 'green',
    marginVertical: 10,
  },
  medium: {
    color: '#ffffff',
    fontSize: 20,
    width: 300,
    height: 100,
    backgroundColor: 'orange',
    marginVertical: 10,
  },
  heavy: {
    color: '#ffffff',
    fontSize: 20,
    width: 300,
    height: 100,
    backgroundColor: 'red',
    marginVertical: 10,
  },
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;What are we doing in the React Native codebase above?&lt;/p&gt;

&lt;p&gt;We create three buttons to represent the three styles of &lt;em&gt;impactAsync&lt;/em&gt;. We have this simple screenshot showing the different buttons with their several styles and intensities:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Lu2A-7LK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AFqV8vUNLN6VXApjy.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Lu2A-7LK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2AFqV8vUNLN6VXApjy.jpg" alt="" width="473" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the project and start tapping the three buttons alternatively. On close observation you’ll notice the slight differences in intensities ranging from light to medium to heavy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let us build a small QR scanner to verify if a resolved QR code is a valid URL.&lt;/p&gt;

&lt;p&gt;For this, we have to add *expo-barcode-scanner *provided by Expo.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expo install expo-barcode-scanner
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Let us write up code to scan a random barcode and verify if it’s a valid URL:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, {useState, useEffect} from 'react';
import {Text, View, StyleSheet, Button, Alert} from 'react-native';
import {BarCodeScanner} from 'expo-barcode-scanner';
import * as Haptics from 'expo-haptics';

export default function App() {
  const [isPermitted, setPermitted] = useState(null);
  const [scanned, setScanned] = useState(false);

  useEffect(() =&amp;gt; {
    (async () =&amp;gt; {
      const {status} = await BarCodeScanner.requestPermissionsAsync();
      setPermitted(status === 'granted');
    })();
  }, []);

  const handleBarCodeScanned = ({type, data}) =&amp;gt; {
    setScanned(true);
    is_url(data);
  };

  function is_url(str) {
    const regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/;
    hapticNotify(regexp.test(str));
  }

  const hapticNotify = (success) =&amp;gt; {
    switch (success) {
      case true:
        Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
        Alert.alert('Success', 'This is a URL');
        break;
      default:
        Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
        Alert.alert('Error', 'This is not a URL!!');
        break;
    }
  };

  if (isPermitted === null) {
    return &amp;lt;Text&amp;gt;Requesting for camera permission&amp;lt;/Text&amp;gt;;
  }
  if (isPermitted === false) {
    return &amp;lt;Text&amp;gt;No access to camera&amp;lt;/Text&amp;gt;;
  }

  return (
    &amp;lt;View style={styles.container}&amp;gt;
      &amp;lt;BarCodeScanner
        onBarCodeScanned={scanned ? undefined : handleBarCodeScanned}
        style={StyleSheet.absoluteFillObject}
      /&amp;gt;
      {scanned &amp;amp;&amp;amp; (
        &amp;lt;Button title={'Tap to Scan Again'} onPress={() =&amp;gt; setScanned(false)} /&amp;gt;
      )}
    &amp;lt;/View&amp;gt;
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;What are we doing in the above codebase?&lt;/p&gt;

&lt;p&gt;We have to ask for permission first before we go ahead to scan a barcode and then validate the result of the scan to verify whether it’s a URL:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8o3gPyEM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2A9a2aw5QnSPxp86Iw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8o3gPyEM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2A9a2aw5QnSPxp86Iw.jpg" alt="" width="473" height="1024"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We apply different haptic feedback styles based on whether the scanned barcode URL is valid or not. You would notice the difference in the haptic feedback between scanning a valid URL barcode and an invalid URL barcode.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion on Haptic Feedback in React Native
&lt;/h3&gt;

&lt;p&gt;We have gone through the &lt;em&gt;**expo-haptics *&lt;/em&gt;*library and its possible use-cases. We went ahead to apply what we’ve learnt by building a couple of small apps to apply these use cases and get a practical feeling of how these interactions behave.&lt;/p&gt;

&lt;p&gt;Adding haptic feedback in React Native apps is pretty straightforward, given that there are libraries out there that can make this task trivial. However, you need to choose carefully when to trigger these haptic feedback interactions, in order to provide a high-quality mobile app. Abusing these vibrations will piss off your users and it will also drain their phone battery pretty quickly, so choose wisely.&lt;/p&gt;

&lt;p&gt;For more ideas on mobile performance, check out our article on how to &lt;a href="https://www.instamobile.io/mobile-design/perceived-performance-mobile-apps/"&gt;boost performance in mobile apps&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.instamobile.io/react-native-tutorials/haptic-feedback-react-native/"&gt;https://www.instamobile.io&lt;/a&gt; on February 10, 2021.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>hapticfeedback</category>
    </item>
    <item>
      <title>5 Cools Flutter Instagram templates 2021</title>
      <dc:creator>0xAirdropfarmer</dc:creator>
      <pubDate>Wed, 13 Jan 2021 04:25:23 +0000</pubDate>
      <link>https://dev.to/kris/5-cools-flutter-instagram-template-2021-4o2d</link>
      <guid>https://dev.to/kris/5-cools-flutter-instagram-template-2021-4o2d</guid>
      <description>&lt;p&gt;Instagram is a popular social sharing app as we know it. As of 2020, there are 1 billion monthly active Instagram users. Facebook acquired Instagram in 2012. Since then, it has generated four times more interaction than Facebook itself. Now, you can gauge how popular and extensively used this app is in the present world. Now, using the app is one thing, and building such an app is completely another. Building such a highly powerful social media app with high-end UI and functionalities is not an easy job. It takes years, expert developers, costly resources to build these kinds of social sharing apps. But, the thing that takes a bit of pressure of developing is the availability of app templates.&lt;/p&gt;

&lt;p&gt;Just as Instagram has been a top app in recent times, the Flutter app development framework is also growing as one of the leading mobile application development frameworks. Known for providing pixel-perfect UI implementations, Flutter is one of the most used frameworks for developing mobile applications as of 2020. In this article, we are going to combine these two hot topics Flutter and Instagram and talk about Instagram clone templates built using Flutter/Dart coding. This article will introduce you to the five best Flutter Instagram clone app template out there in the market which offers beautiful UI design and features close to that of the original app. The list includes both premium tier and open-source Flutter Instagram clone templates.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.instaflutter.com/app-templates/flutter-instagram-clone/"&gt;Flutter Instagram Clone&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OVOiBgAx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2Av8MUjeuKEw4hQVQ0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OVOiBgAx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/0%2Av8MUjeuKEw4hQVQ0.png" alt="" width="600" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are looking for a fully functional Instagram clone with state of an art user interface and features resembling the original app then this is it. One of the best Instagram clone app available in the market fully coded in the Flutter ecosystem. Hence, the template can be used to build for both Android and iOS. This template offers 60+ screens that are modern and intuitive in close resemblance to the original app. The highlight feature includes 20+ Instagram filters, Ephemeral stories, post feeds, social features such as likes and comments, social graphs, and a real-time chatting interface with photo and video messages.&lt;/p&gt;

&lt;p&gt;Not to mention, all the basic features of the original Instagram app are also available. Of course, the app is integrated with innate features such as push notifications, dark mode theme, and localizations. The performance improvement by Image caching, Smooth loading states, Animations, Empty states, Video compression, and Image optimizations. The backend technology involves Firebase features and services. Most importantly, there is support for life-long updates as well. Hence, this Flutter Instagram Clone is a full package that offers everything there is to for your next Instagram clone app. The template is offered by &lt;a href="http://instaflutter.com"&gt;instaflutter.com&lt;/a&gt; one of the leading portals when it comes to state-of-the-art mobile app templates.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="http://1.envato.market/z1A4x"&gt;Snapta instagram clone app&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UJ9AgGS5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A_0ZxRBGKY4GUR_hk4bc04g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UJ9AgGS5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A_0ZxRBGKY4GUR_hk4bc04g.png" alt="" width="590" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Snapta is another Instagram app built using Flutter and dart with Firebase backend services. The template is available in the Codecanyon marketplace. The app offers a similar UI experience and features compared to the original app. All the basic features such as Post Feeds, Filter effects, Push Notification, Real-time chat, Profile interface are available in this app. This app can be considered as a light-weight alternative to the original Instagram app. The social activity features such as like and comments are available. Users can have real-time conversations and upload images with different filters and camera options to edit the images. However, some of the heavy-weight features such as stories, video stories, etc are not built-in. Hence, this app can be a low-cost and lightweight alternative to the original app as well as other Flutter Instagram clone app. You can create a basic Instagram like app using this template as well as take it as inspiration in the field of Flutter application development.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="http://1.envato.market/nDqyR"&gt;PicShare — Instagram like self-hosted social media application&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3xE-C9Wd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AzuoKnV83Hc4ehhhQKaaB3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3xE-C9Wd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AzuoKnV83Hc4ehhhQKaaB3w.png" alt="" width="592" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another Instagram-like social media app that has a high resemblance to the original app. The key technology used to build this template is Flutter/Dart, PHP/Laravel, and PostgreSQL. The template offers an easy image upload feature that can support the image carousel up to 16 images. The application consists of 20 screens and 30+ API endpoints. All the basic features such as follow, likes, comments, share, comment history, post history, timeline, search, activity, profile activity, and user management are included in this package. The integration of S3 compatible file storage, self-hosted CDN, built on popular app development, and backend frameworks makes this app template a high-end product. It also offers coding documentation. The push notification is integrated with help of Firebase push notifications. The UI designs look modern and intuitive; similar to that of the original app. Just like the previous one the heavy-weight feature of adding multi-optional stories is missing in this template as well. Overall, a great template to start developing your next Instagram like the app.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://github.com/mdanics/fluttergram"&gt;fluttergram&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qWYsRWYa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ARXKu-qjZT_gssjG9PPyyBw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qWYsRWYa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2ARXKu-qjZT_gssjG9PPyyBw.png" alt="" width="507" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The lightweight implementation of an Instagram-like app that offers a fully-functional app with great UI build coded entirely using Flutter/Dart. The backend integration includes Firebase services with Firestore. The template is open-source and available freely on GitHub. Fluttergram offers a basic Home Screen feed just like in the original Instagram app with exception of the stories feature. Users can like and comment on the post. The camera feature has a minimal option with no filters. You can just upload the image, keep the status, and share it as a post. The profile screen UI with its settings option has a similar UI to the original app. There is no integration of video upload or posting in this template.&lt;/p&gt;

&lt;p&gt;The overall app is built using the popular Flutter packages available in the market. If not the best template to build your next Instagram clone like the app, it can be the source of inspiration for the Flutter developers. We can learn a lot from the Flutter UI build, coding structure, and plugins used in implementing this template. This can a great way to start off your next flutter project if you are looking for building an Instagram social platform.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://github.com/hasibullah1811/Instagram-Clone-Flutter-Firebase"&gt;Instagram Clone built using Flutter and Firebase&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JfOtsK8S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A-s6OBIfb_s9f2I-Ustw4SQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JfOtsK8S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2A-s6OBIfb_s9f2I-Ustw4SQ.png" alt="" width="527" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Social Share is another open-source Instagram-like app template built entirely on Flutter/Dart ecosystem. The features offered are minimal compared to other premium app templates but it definitely packs a punch when it comes to UI and some backend Firebase services integration. The UI and features it has in the offer are pretty basic. The Google sign-in is integrated for user authentication and login and Firebase and Firestore for CRUD functionality. The basic features such as follow, likes, comments, search users, image posting are integrated. One major feature is the image compression while uploading which improves the performance check of the app. The template is under development as well as more features are to be added in the near future. The important thing is that the template is open-source and free to download and use. It is a great resource for the new Flutter developers. This template can inspire and provide vital information on building social apps in the Flutter ecosystem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Well, among the five best Flutter Instagram clone templates in the list above, some have high-end heavyweight features, and some house only the basic features. Some are premium templates and some are open-source. But things in common between them is they are all built entirely using the Flutter framework. They can all be developed into the next social sharing app like a flutter and can be also taken as a source of inspiration. Among the five, the one provided by &lt;a href="http://instaflutter.com/"&gt;instaflutter.com&lt;/a&gt; packs the most powerful and complex features. The template provided by it can be developed in the actual full-fledged app. However, other templates will need a bit of work before dedicating themselves as the complete app.&lt;/p&gt;

&lt;p&gt;I hope, this article helps you choose the best Flutter Instagram clone app template available in the market. Nonetheless, there is plenty of inspiration for Flutter developers inside these clone app templates.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Keep in mind that we may receive commissions when you click our links and make purchases. However, this does not impact our reviews and comparisons. We try our best to keep things fair and balanced, in order to help you make the best choice for you.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>flutter</category>
    </item>
    <item>
      <title>How to Add Preloader to Image in Flutter</title>
      <dc:creator>0xAirdropfarmer</dc:creator>
      <pubDate>Thu, 24 Dec 2020 13:05:24 +0000</pubDate>
      <link>https://dev.to/dailydotdev/how-to-add-preloader-to-image-in-flutter-45h5</link>
      <guid>https://dev.to/dailydotdev/how-to-add-preloader-to-image-in-flutter-45h5</guid>
      <description>&lt;p&gt;Flutter is a cross-platform mobile application development framework that offers a widget-based mechanism to implement the pixel-perfect UI. Creating a state of the art apps with beautiful UI is a challenge for every mobile app developer. And, Flutter has made it easier and simple. However, with great UI comes the value of user experience as well. It is necessary to have a sustainable user experience along with a great UI. Hence, this tutorial will help learn a small aspect of optimizing the user experience by showing the loading effect (termed as pre-loaders, placeholders) before the actual data loads.&lt;/p&gt;

&lt;p&gt;The preloaders become necessary for the user to experience the data is still loading or being fetched from the server. Until the actual data is fetched from the server and displayed on the screen, the pre-loaders will help users understand what actually is going on. The displaying of preloaders indicates that the actual data has still not loaded due to some reasons such as slow network, app errors, etc. Thus, optimizing the overall user experience. Hence, the pre-loaders are necessary for any mobile applications as well as websites. And here, we are going to learn just that on how to add image pre-loaders before the actual image loads in a Flutter app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create new Flutter project
&lt;/h3&gt;

&lt;p&gt;First, we need to create a new Flutter project. For that, make sure that the &lt;a href="https://flutter.dev/docs/get-started/install"&gt;Flutter SDK&lt;/a&gt; and other flutter app development related requirements are properly installed. If everything is properly set up, then in order to create a project, we can simply run the following command in the desired local directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutter create imagePreloader
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the project has been set up, we can navigate inside the project directory and execute the following command in the terminal to run the project in either an available emulator or an actual device:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutter run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After successfully build, we will get the following result on the emulator screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fethv0d5c1v6ka6qb7opb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fethv0d5c1v6ka6qb7opb.jpg" alt="Alt Text" width="325" height="665"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Home Screen
&lt;/h3&gt;

&lt;p&gt;Since we have our flutter app up and running in the emulator, we can now move to create screens. For that, we need to create a directory called &lt;strong&gt;./screens&lt;/strong&gt; inside the &lt;strong&gt;./lib&lt;/strong&gt; directory of our project. Inside the &lt;strong&gt;./screens&lt;/strong&gt; directory, we need to create a new dart file called &lt;strong&gt;Home.dart&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;Home.dart&lt;/strong&gt;, we are going to create a stateful widget to show the image as well as the preloaders. But first, we are going to show a simple App bar by returning a &lt;code&gt;Scaffold&lt;/code&gt; widget as shown in the code snippet below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:flutter/foundation.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:flutter/material.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'dart:ui'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HomePage&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;StatefulWidget&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;HomePage&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="n"&gt;Key&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;key:&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="n"&gt;_MyHomePageState&lt;/span&gt; &lt;span class="n"&gt;createState&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_MyHomePageState&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;_MyHomePageState&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;State&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;HomePage&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;initState&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;initState&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="n"&gt;Widget&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Scaffold&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nl"&gt;appBar:&lt;/span&gt; &lt;span class="n"&gt;AppBar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nl"&gt;backgroundColor:&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;white&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nl"&gt;centerTitle:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nl"&gt;title:&lt;/span&gt; &lt;span class="n"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
              &lt;span class="s"&gt;"Image"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="nl"&gt;style:&lt;/span&gt; &lt;span class="n"&gt;TextStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;color:&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;black87&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;fontFamily:&lt;/span&gt; &lt;span class="s"&gt;'Overpass'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;fontSize:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="nl"&gt;elevation:&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
        &lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="nl"&gt;backgroundColor:&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;white&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;body:&lt;/span&gt; &lt;span class="n"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we have added an App bar using &lt;code&gt;AppBar&lt;/code&gt; widget in the &lt;code&gt;Scaffold&lt;/code&gt; widget. The body property returns an empty &lt;code&gt;Container&lt;/code&gt; widget. &lt;/p&gt;

&lt;p&gt;Now, we need to import the Home.dart file in main.dart and replace the default widget with &lt;code&gt;HomePage&lt;/code&gt; widget as shown in the code snippet below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:flutter/material.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:imagePreloader/screens/Home.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;runApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyApp&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;StatelessWidget&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// This widget is the root of your application.&lt;/span&gt;
  &lt;span class="nd"&gt;@override&lt;/span&gt;
  &lt;span class="n"&gt;Widget&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;MaterialApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nl"&gt;title:&lt;/span&gt; &lt;span class="s"&gt;'Flutter Demo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;theme:&lt;/span&gt; &lt;span class="n"&gt;ThemeData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nl"&gt;primarySwatch:&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;visualDensity:&lt;/span&gt; &lt;span class="n"&gt;VisualDensity&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;adaptivePlatformDensity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nl"&gt;home:&lt;/span&gt; &lt;span class="n"&gt;HomePage&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hence, we will get the result as shown in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fts24uf8dj3t74rkq144o.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fts24uf8dj3t74rkq144o.jpg" alt="Alt Text" width="325" height="665"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding Image Container to Home Screen
&lt;/h3&gt;

&lt;p&gt;Now, we are going to display an image on the Home screen. For that, we need to fetch a mock image from &lt;a href="http://pexels.com"&gt;pexels&lt;/a&gt; or from anywhere. Then, we need to add the URL path of the image to a List called &lt;code&gt;imagesPath&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Note that, we can directly use this URL but we are pushing the URL from &lt;code&gt;imagesPath&lt;/code&gt; to a new List called &lt;code&gt;imagesList&lt;/code&gt; because we want to show the Pre-loaders before the image loads on the screen. &lt;/p&gt;

&lt;p&gt;The initializations are provided in the code snippet below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;List&lt;/span&gt; &lt;span class="n"&gt;imagesPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s"&gt;"https://images.pexels.com/photos/2440061/pexels-photo-2440061.jpeg?auto=compress&amp;amp;cs=tinysrgb&amp;amp;dpr=2&amp;amp;h=650&amp;amp;w=940"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;];&lt;/span&gt;

 &lt;span class="kt"&gt;List&lt;/span&gt; &lt;span class="n"&gt;imagesList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we need to create a function to load the image URL from the &lt;code&gt;imagesPath&lt;/code&gt; list to &lt;code&gt;imagesList&lt;/code&gt; list. &lt;strong&gt;Remember that we are doing this as an alternative to fetching images from the server. Since we are not using a server to fetch the image, we have to devise the logic to load the image URL manually from the code itself.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;The implementation of &lt;code&gt;getImages&lt;/code&gt; function is provided in the code snippet below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;getImages&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;imagesList&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;imagesPath&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we need to call the &lt;code&gt;getImages&lt;/code&gt; function inside the &lt;code&gt;initState&lt;/code&gt; method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="nd"&gt;@override&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;initState&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;initState&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="n"&gt;getImages&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This &lt;code&gt;initState&lt;/code&gt; method executes before our main build function executes once we enter the Home screen.&lt;/p&gt;

&lt;p&gt;Now, we are going to create a image view container in the &lt;code&gt;Scaffold&lt;/code&gt; widget body. For that, we can use the code from the following code snippet:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="nl"&gt;body:&lt;/span&gt; &lt;span class="n"&gt;SingleChildScrollView&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Padding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="nl"&gt;padding:&lt;/span&gt; &lt;span class="n"&gt;EdgeInsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;symmetric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;horizontal:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;vertical:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nl"&gt;margin:&lt;/span&gt; &lt;span class="n"&gt;EdgeInsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;only&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="nl"&gt;width:&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nl"&gt;height:&lt;/span&gt; &lt;span class="mi"&gt;350&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nl"&gt;decoration:&lt;/span&gt; &lt;span class="n"&gt;BoxDecoration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
              &lt;span class="nl"&gt;color:&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;black26&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="nl"&gt;borderRadius:&lt;/span&gt; &lt;span class="n"&gt;BorderRadius&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;circular&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;ClipRRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
              &lt;span class="nl"&gt;borderRadius:&lt;/span&gt; &lt;span class="n"&gt;BorderRadius&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;circular&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
              &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;network&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                  &lt;span class="n"&gt;imagesList&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                  &lt;span class="nl"&gt;fit:&lt;/span&gt; &lt;span class="n"&gt;BoxFit&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we have placed the &lt;code&gt;SingleChildScrollView&lt;/code&gt; widget as a primary parent widget so that the whole body section is scrollable. Then, we have a &lt;code&gt;Padding&lt;/code&gt; widget to apply some paddings which have &lt;code&gt;Container&lt;/code&gt; as a child widget. The &lt;code&gt;Container&lt;/code&gt; widget is configured with some unique properties which provide child widgets as a &lt;code&gt;ClipRRect&lt;/code&gt; widget. The &lt;code&gt;ChipRRect&lt;/code&gt; allows us to clip the edges of its child widget. As its child widget, we have used &lt;a href="http://image.network"&gt;&lt;code&gt;Image.network&lt;/code&gt;&lt;/a&gt; widget to display the image.&lt;/p&gt;

&lt;p&gt;The result is displayed in the screenshot below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd9wjo6ad7ot4r7m4usqm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd9wjo6ad7ot4r7m4usqm.jpg" alt="Alt Text" width="325" height="665"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, we have got an image on the screen. Now, it is time to add Pre-loaders.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding Shimmering Image Pre-loader
&lt;/h3&gt;

&lt;p&gt;In order to add the image Pre-loader, we are going to make use of the &lt;a href="https://pub.dev/packages/shimmer"&gt;shimmer&lt;/a&gt; package. This package provides an easy way to apply the shimmer effect in the Flutter app. It makes the Pre-loader implementation easy as well as optimizes the user experience. &lt;/p&gt;

&lt;p&gt;First, we need to install the shimmer package. For that, we need to add the shimmer package to &lt;strong&gt;pubspec.yaml&lt;/strong&gt; file as shown in the code snippet below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;dependencies&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;flutter&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;sdk&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;flutter&lt;/span&gt;

  &lt;span class="na"&gt;shimmer&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1.1.1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we need to import the package to the Home.dart as shown in the code snippet below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:shimmer/shimmer.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, we are going to implement the shimmer preloading effect using the &lt;code&gt;Shimmer&lt;/code&gt; widget provided by the shimmer package. But first, we need to make some configurations so as to show the shimmers perfectly. So, we need to define some constants as shown in the code snippet below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;_loading&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the &lt;code&gt;_loading&lt;/code&gt; Boolean variable is for the conditional rendering of the Image and Pre-loaders. The offset and time value is configured to the &lt;code&gt;Shimmer&lt;/code&gt; widget to set the time interval till which the pre-loaders need to load. The implementation is provided in the code snippet below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="nl"&gt;body:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_loading&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;
        &lt;span class="n"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="nl"&gt;color:&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;white&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;SafeArea&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;ListView&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
              &lt;span class="nl"&gt;padding:&lt;/span&gt; &lt;span class="n"&gt;EdgeInsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
              &lt;span class="nl"&gt;itemCount:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="nl"&gt;itemBuilder:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;offset&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="n"&gt;time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Padding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                  &lt;span class="nl"&gt;padding:&lt;/span&gt; &lt;span class="n"&gt;EdgeInsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;symmetric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;horizontal:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;vertical:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                  &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Shimmer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromColors&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                    &lt;span class="nl"&gt;highlightColor:&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;white&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="nl"&gt;baseColor:&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;grey&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                    &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                      &lt;span class="nl"&gt;margin:&lt;/span&gt; &lt;span class="n"&gt;EdgeInsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;only&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                      &lt;span class="nl"&gt;height:&lt;/span&gt; &lt;span class="mi"&gt;350&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                      &lt;span class="nl"&gt;width:&lt;/span&gt; &lt;span class="mi"&gt;270&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                      &lt;span class="nl"&gt;decoration:&lt;/span&gt; &lt;span class="n"&gt;BoxDecoration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                        &lt;span class="nl"&gt;color:&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;black26&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                        &lt;span class="nl"&gt;borderRadius:&lt;/span&gt; &lt;span class="n"&gt;BorderRadius&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;circular&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                      &lt;span class="p"&gt;),&lt;/span&gt;
                    &lt;span class="p"&gt;),&lt;/span&gt;
                    &lt;span class="nl"&gt;period:&lt;/span&gt; &lt;span class="n"&gt;Duration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;milliseconds:&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                  &lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;);&lt;/span&gt;
              &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
         &lt;span class="n"&gt;SingleChildScrollView&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Padding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nl"&gt;padding:&lt;/span&gt; &lt;span class="n"&gt;EdgeInsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;symmetric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;horizontal:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;vertical:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
              &lt;span class="nl"&gt;margin:&lt;/span&gt; &lt;span class="n"&gt;EdgeInsets&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;only&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
              &lt;span class="nl"&gt;width:&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="nl"&gt;height:&lt;/span&gt; &lt;span class="mi"&gt;350&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="nl"&gt;decoration:&lt;/span&gt; &lt;span class="n"&gt;BoxDecoration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="nl"&gt;color:&lt;/span&gt; &lt;span class="n"&gt;Colors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;black26&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="nl"&gt;borderRadius:&lt;/span&gt; &lt;span class="n"&gt;BorderRadius&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;circular&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
              &lt;span class="p"&gt;),&lt;/span&gt;
              &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;ClipRRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="nl"&gt;borderRadius:&lt;/span&gt; &lt;span class="n"&gt;BorderRadius&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;circular&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;network&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                    &lt;span class="n"&gt;imagesList&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                    &lt;span class="nl"&gt;fit:&lt;/span&gt; &lt;span class="n"&gt;BoxFit&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="p"&gt;),&lt;/span&gt;
              &lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we show the Pre-loader template in contrast to the Image template using the &lt;code&gt;_loading&lt;/code&gt; value as conditional rendering. We have used the &lt;code&gt;Shimmer&lt;/code&gt; widget inside the &lt;code&gt;ListView&lt;/code&gt; so as to show multiple loaders which can be controlled by setting the &lt;code&gt;itemCount&lt;/code&gt; property. We have used the &lt;code&gt;fromColors&lt;/code&gt; extension provided by the &lt;code&gt;Shimmer&lt;/code&gt; widget with configured &lt;code&gt;highlightColor&lt;/code&gt; and &lt;code&gt;baseColor&lt;/code&gt; properties. We have placed a &lt;code&gt;Container&lt;/code&gt; widget similar to &lt;code&gt;Container&lt;/code&gt; in Image template as a child of &lt;code&gt;Shimmer&lt;/code&gt; in order to display the shimmering effect.&lt;/p&gt;

&lt;p&gt;Now, the above template will create a shimmering pre-loader effect. But, we still need to implement the logic to show the pre-loaders. For that, we are going to use the &lt;code&gt;Timer&lt;/code&gt; function. The &lt;code&gt;Timer&lt;/code&gt; function will help to delay the loading of the image onto the screen and show the pre-loaders until then. First, we need to import the package that provides the &lt;code&gt;Timer&lt;/code&gt; function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'dart:async'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now in &lt;code&gt;getImages&lt;/code&gt; function, we use the &lt;code&gt;Timer&lt;/code&gt; to delay the loading of the image and show the shimmer pre-loaders instead. &lt;/p&gt;

&lt;p&gt;In an actual app, we fetch the data from server in which the fetching may take time. Till then, we show some loading effect which improves the overall user experience.&lt;/p&gt;

&lt;p&gt;Since we are not pulling data from the server, we need to manually configure the delay. Hence, the implementation is provided in the code snippet below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;getImages&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;_loading&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="n"&gt;Timer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Duration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;seconds:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;imagesList&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;imagesPath&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]),&lt;/span&gt;
      &lt;span class="n"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;_loading&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, the final result with shimmering effect Pre-loaders is shown in the demo below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgwvjydma8bjgvuzbh368.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgwvjydma8bjgvuzbh368.gif" alt="Alt Text" width="336" height="690"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can notice a shimmering loading effect just before the image loads on the screen. Likewise, we can display the shimmer effect from any widget element structure of the screens as the child of the &lt;code&gt;Shimmer&lt;/code&gt; widget uses the Flutter widgets itself. Hence, it is flexible enough to be shaped into anything.&lt;/p&gt;

&lt;p&gt;Finally, we have implemented the image Pre-loader in a Flutter app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;As we talk about the importance of pre-loaders in optimizing the user experience, we can see the effect it has on the overall app UI and its usage from the demo above. It makes the overall user experience convenient. These types of pre-loaders are used in every app nowadays. So, users expect pre-loaders to happen. It creates a greater impact in terms of visual and understanding of what is going on. Pre-loaders taking a long time can interpret into problems in internet connectivity or some other type of app errors. This makes the user aware of what actually is happening. Hence, it is an important element to have knowledge of for a developer. &lt;/p&gt;

&lt;p&gt;Now, the challenge is to create the preloaders for different widget elements. Here, we implemented the preloaders for the image element which was simple. But, the pre-loaders using the shimmer package can be shaped into anything as it uses the Flutter widgets itself as a child.&lt;/p&gt;

&lt;p&gt;For more inspirations for beautifully designed pre-loaders, check out some amazing &lt;a href="http://instaflutter.com"&gt;Flutter apps&lt;/a&gt; that have them integrated intuitively.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;&lt;a href="https://api.daily.dev/get?r=devto"&gt;daily.dev&lt;/a&gt; delivers the best programming news every new tab. We will rank hundreds of qualified sources for you so that you can hack the future.&lt;/em&gt;&lt;br&gt;
&lt;a href="https://api.daily.dev/get?r=devto"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb996k4sm4efhietrzups.png" alt="Daily Poster" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>webdev</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>4 Top Static Site Generators for Vue.js</title>
      <dc:creator>0xAirdropfarmer</dc:creator>
      <pubDate>Mon, 30 Nov 2020 16:29:05 +0000</pubDate>
      <link>https://dev.to/kris/4-top-static-site-generators-for-vue-js-nl5</link>
      <guid>https://dev.to/kris/4-top-static-site-generators-for-vue-js-nl5</guid>
      <description>&lt;p&gt;Your project may not need a micro-service or a serverless API. In fact, it’s far more likely that all you really need is a simple, scalable, and performant static site generator. Rather than using heavy, bloated frameworks like WordPress or Drupal, a static site generator lets you write your content as static HTML files and handle dynamic components (variables, content blocks, etc.) separately. You can also get out of the web dev game and move onto more important things. &lt;/p&gt;

&lt;p&gt;In this post, I’ve compiled a list of the most popular options for Vue static site generation along with a comprehensive comparison — all in one place.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nuxt.js
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8PPwuwMx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/600/1%2ANTGKGfvCt9bX_S8qqCBgBQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8PPwuwMx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/600/1%2ANTGKGfvCt9bX_S8qqCBgBQ.png" alt="" width="600" height="257"&gt;&lt;/a&gt;&lt;br&gt;
Nuxt.js is a framework built with Vue.js that helps to create application architecture for web applications and features a flexible hands-off development style.&lt;/p&gt;

&lt;p&gt;Nuxt.js is highly configurable and flexible, but it is not a fully proven solution for static site generation. The framework is not able to be used by itself on one project.&lt;br&gt;
Pros&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nuxt.js is very simple to get started with. It is easy to learn and get started with. To use the framework, you have to install &lt;code&gt;vue-cli&lt;/code&gt; and execute &lt;code&gt;vue init nuxt/starter &amp;lt;project-name&amp;gt;&lt;/code&gt;. In general, installation takes around 5 minutes to complete.&lt;/li&gt;
&lt;li&gt;Nuxt.js can be easily extended, and plugins can be ported easily.
Cons&lt;/li&gt;
&lt;li&gt;Nuxt.js is not production-ready — although it has been in development for over a year.&lt;/li&gt;
&lt;li&gt;As an immature framework, it has the chance to change with each update, with the potential risk of breaking client apps.&lt;/li&gt;
&lt;li&gt;As it is a Vue.js extension, developers are beholden to the core Vue developers.&lt;/li&gt;
&lt;li&gt;Nuxt.js is not framework independent.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
   VuePress
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dUs1uPlL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i1.wp.com/wp.laravel-news.com/wp-content/uploads/2018/04/vuepress.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dUs1uPlL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i1.wp.com/wp.laravel-news.com/wp-content/uploads/2018/04/vuepress.png" alt="" width="800" height="405"&gt;&lt;/a&gt;&lt;br&gt;
VuePress is a static site generator based on Vue.js.&lt;br&gt;
VuePress compiles your project folder right to the build directory. It does not use any third-party code and stays very small.&lt;br&gt;
Pro&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VuePress is very easy to use and takes minimum configurations. Because of this reason, it can be used to create a simple personal blog without the need to look for third-party plugins.
Con&lt;/li&gt;
&lt;li&gt;It is a minimal static site generator. As a result, things like the featured image and header logo are not supported.&lt;/li&gt;
&lt;li&gt;VuePress does not provide any options in its framework to build a solid landing page.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Gridsome
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0OKyZzpi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://gridsome.org/assets/static/how-it-works.ad86e53.4e7860c6e309c641097427756a66707c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0OKyZzpi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://gridsome.org/assets/static/how-it-works.ad86e53.4e7860c6e309c641097427756a66707c.png" alt="" width="800" height="346"&gt;&lt;/a&gt;&lt;br&gt;
Gridsome is a development tool that can compile static sites from different file formats featuring an online catalog and live automatic compilation. Gridsome is an open-source project and its most notable features include a built-in marketplace and the ability to support content and content-related features in a variety of markup languages and frameworks.&lt;br&gt;
Pro&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gridsome is built on top of React, which comes with an excellent developer community.&lt;/li&gt;
&lt;li&gt;Gridsome is a fully-functional framework that can be extended.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Con&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gridsome is not developed by Vue or Nuxt.js and therefore, it is hard to say it is “native” to Vue.&lt;/li&gt;
&lt;li&gt;Gridsome isn’t a complete Vue.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Saber
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5tXV03fH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://user-images.githubusercontent.com/4316355/65113403-0fdb9b80-d9b1-11e9-9bda-f5737db13a69.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5tXV03fH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://user-images.githubusercontent.com/4316355/65113403-0fdb9b80-d9b1-11e9-9bda-f5737db13a69.jpg" alt="" width="800" height="485"&gt;&lt;/a&gt;&lt;br&gt;
Saber is based on the Gatsby framework, a static site generator that was created with React.&lt;br&gt;
Saber can be used as a standalone site generator as a Gatsby plugin. Gatsby’s main features include:&lt;/p&gt;

&lt;p&gt;This list has been created based on the popularity and community, but it's important to re-emphasize that the popularity is largely arbitrary.&lt;br&gt;
Pros&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Saber has a great ecosystem of packages.&lt;/li&gt;
&lt;li&gt;Saber has a simple installation process.&lt;/li&gt;
&lt;li&gt;Saber has a vast range of options in addition to the core features such as blog posts.&lt;/li&gt;
&lt;li&gt;Saber offers solid development tools.&lt;/li&gt;
&lt;li&gt;If you run into trouble, the community is large and responds quickly.
Cons&lt;/li&gt;
&lt;li&gt;Saber is hard to get started with.&lt;/li&gt;
&lt;li&gt;Saber lacks a good landing page generator. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You can try Vuepress, Gridsome, Nuxt and Saber if you want to start with a static site generator. Nuxt.js and Gridsome are popular for small sites. VuePress is more suitable for big projects. Saber is great for creating Gatsby project templates. Choose saber for quickly generating a template that uses Gatsby.&lt;/p&gt;

</description>
      <category>vue</category>
    </item>
    <item>
      <title>The Best Web Design Books for HTML, CSS, and UI Interfaces in 2021</title>
      <dc:creator>0xAirdropfarmer</dc:creator>
      <pubDate>Thu, 26 Nov 2020 02:00:25 +0000</pubDate>
      <link>https://dev.to/kris/the-best-web-design-books-for-html-css-and-ui-interfaces-in-2021-218o</link>
      <guid>https://dev.to/kris/the-best-web-design-books-for-html-css-and-ui-interfaces-in-2021-218o</guid>
      <description>&lt;p&gt;If you are starting your web development or design journey, you need to have solid knowledge of HTML and CSS.&lt;/p&gt;

&lt;p&gt;In order to make your mark on a world that’s already full of impeccable design layouts and UI interfaces, you’ll need a good grasp of styling basics. You’ll have to go to the depths of the design pit and return to the top with well-polished skills.&lt;/p&gt;

&lt;p&gt;Now, in order to help you hone your skills and become an expert, I have listed here some of the greatest books available on the market that I have read. These books deal with CSS and Web design knowledge from the ground up.&lt;/p&gt;

&lt;p&gt;They will not only teach you about design specifications but will also help you develop the vision to devise your own state of the art designs. Let’s look at them now.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://amzn.to/3l0R4rK"&gt;CSS in Depth&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ePzEAC0w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/css-in-depth-1-.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ePzEAC0w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/css-in-depth-1-.jpg" alt="" width="600" height="400"&gt;&lt;/a&gt;Web developers must understand at least the basics of HTML and CSS. If you want to become an expert web developer, you’ve gotta know them through and through.&lt;/p&gt;

&lt;p&gt;Well, this book helps you learn the styling part of web development that is CSS. It offers in-depth and structured ways to use CSS to style your HTML elements.&lt;/p&gt;

&lt;p&gt;As I began reading this book, I discovered that it’s packed with creative examples and best practices of using CSS that will definitely sharpen your technical skills and inspire your sense of design.&lt;/p&gt;

&lt;p&gt;With state of the art examples and exercises, this book will definitely hon your CSS skills and take it to the next level. From the basics of design to advanced CSS design concepts, you will experience it all in your path to master the nooks and corners of CSS. The objective of this book is to make you a better web designer and make your web apps look spectacular.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://amzn.to/364kctW"&gt;Enduring CSS&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yLNvo_Up--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/enduringcss.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yLNvo_Up--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/enduringcss.jpg" alt="" width="500" height="647"&gt;&lt;/a&gt;The main objective of this book titled “Enduring CSS” is to make the web developers write the CSS style codes which are durable over a long period of time. It is a guide to writing style sheets for large scale, rapidly changing, long-lived web projects. It taught me how to individualize the styles so that those CSS modules become simpler to transport into different contexts and projects. It imparts knowledge on CSS tools such as PostCSS and linting tools to study and maintain the CSS code base across the large project.&lt;/p&gt;

&lt;p&gt;This book also specifies how to handle states more accessibly with ARIA attributes as opposed to class changes. There is much more in-depth knowledge to explore in this book.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://amzn.to/3q3DBTx"&gt;CSS Refactoring&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d3vte5Pa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/images.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d3vte5Pa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/images.jpg" alt="" width="800" height="1051"&gt;&lt;/a&gt;This book or a chapter of the book is mainly based on refactoring and scaling of the CSS codes. It imparts knowledge on what actually refactoring means and its relation to software architecture. According to the book “Refactoring is the process of rewriting code in order to make it more simple and reusable without changing it’s behavior “. Now, we know that CSS styles can be made re-usable as well by making an external stylesheet.&lt;/p&gt;

&lt;p&gt;This book aims to help us re-write the design elements and attributes that are modular and scalable at the same time without changing their overall functions. It introduced me to best practices, examples, concepts of refactoring the CSS code and also performs a unit test on them. Overall, the book provides ample knowledge on how CSS works and how refactoring it will make the code more efficient, and scalable in the long run.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://bradfrost.com/blog/post/atomic-web-design/"&gt;Atomic Design&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YCznofT5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/book-cover_1024x1024-1-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YCznofT5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/book-cover_1024x1024-1-.png" alt="" width="663" height="1024"&gt;&lt;/a&gt;The Atomic Design book written by Brad Frost introduces techniques for designing our UIs as thoughtful hierarchies. This book also discusses the qualities of effective pattern libraries along with methods to transform the team’s design and development workflow. As a design concern, this Atomic design concept provided in this book divides the design components into different levels such as atoms, molecules, organisms, templates, and pages. They basically help to understand the singular most unit of designing called atom which when structured properly becomes a molecule.&lt;/p&gt;

&lt;p&gt;Molecular designs with the correct pattern of combination become an organism. The organisms placed accurately with proper design patterns from templates that we apply to pages. Hence, learning designs from this book is basically like learning chemistry where design elements are the chemicals. It is indeed an interesting book to read.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://amzn.to/3fxAVZM"&gt;CSS Secrets&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0us4i_l_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/2563-11-21-10_14_15-CSS-Secrets_-Better-Solutions-to-Everyday-Web-Design-Problems_-Verou--Lea_-07833.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0us4i_l_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/2563-11-21-10_14_15-CSS-Secrets_-Better-Solutions-to-Everyday-Web-Design-Problems_-Verou--Lea_-07833.png" alt="" width="800" height="352"&gt;&lt;/a&gt;The Atomic Design book written by Brad Frost introduces techniques for designing our UIs as thoughtful hierarchies. This book also discusses the qualities of effective pattern libraries along with methods to transform the team’s design and development workflow. As a design concern, this Atomic design concept provided in this book divides the design components into different levels such as atoms, molecules, organisms, templates, and pages. They basically help to understand the singular most unit of designing called atom which when structured properly becomes a molecule.&lt;/p&gt;

&lt;p&gt;Molecular designs with the correct pattern of combination become an organism. The organisms placed accurately with proper design patterns from templates that we apply to pages. Hence, learning designs from this book is basically like learning chemistry where design elements are the chemicals. It is indeed an interesting book to read.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://amzn.to/3nY8rv0"&gt;HTML &amp;amp; CSS (also jQuery one)&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FN-eY4jL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/2563-11-21-10_14_43-HTML--CSS-and-JavaScript-All-in-One--Sams-Teach-Yourself_-Covering-HTML5--CSS3--.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FN-eY4jL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/2563-11-21-10_14_43-HTML--CSS-and-JavaScript-All-in-One--Sams-Teach-Yourself_-Covering-HTML5--CSS3--.png" alt="" width="800" height="289"&gt;&lt;/a&gt;This book is a full-fledge learning ground from HTML, CSS, and JavaScript including jQuery as well. It is an all-in-one book that offers a detailed understanding, concepts, practical examples, and best practices of HTML5, CSS3 including jQuery. At the end of the day, you will be able to design your own webpages and get them online in an instant. The lessons are straightforward with a step-by-step guide building upon the design concept from the ground up.&lt;/p&gt;

&lt;p&gt;The main highlights are the stepwise instructions on most common web development tasks, practical examples of the applications of design patterns, and exercises to help you test your knowledge building up to the course. Overall, a well-equipped book to make you an expert in the field of web design and development.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://abookapart.com/products/get-ready-for-css-grid-layout"&gt;GET READY FOR CSS GRID LAYOUT&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v-ieav8z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/2563-11-21-10_15_19-A-Book-Apart--Get-Ready-for-CSS-Grid-Layout.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v-ieav8z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/2563-11-21-10_15_19-A-Book-Apart--Get-Ready-for-CSS-Grid-Layout.png" alt="" width="800" height="300"&gt;&lt;/a&gt;Well, the grid layouts were an important addition to design specifications. They made the positioning of the elements on the webpage easier. The webpage could be segmented into different grid areas where each grid areas have their own set of design elements. The grid areas could be positioned anywhere necessary to give an intuitive look to the overall UI. Now, if you want to dive deep into the pits of grid layout then this book by Rachel Andrew definitely does the job for you.&lt;/p&gt;

&lt;p&gt;With learning content from this book, you can get up to speed with Level 2 of the grid layout and dig into working examples you can experiment with right away. You will be able to harness the power and potential of sub-grid, which makes lining nested grid items with the main grid simple and easy.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://amzn.to/3nUkOby"&gt;CSS: The Definitive Guide: Visual Presentation for the Web&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kljWKpEt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/515X-RDM1LL.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kljWKpEt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/515X-RDM1LL.jpg" alt="" width="381" height="500"&gt;&lt;/a&gt;This book is for web designers that follow sophisticated page styling and improved accessibility which saves tons of time and effort. The latest edition of the guide lets you into the latest design and CSS specifications. This book lets you into the broader aspect of design implementations where you will focus on user experience, speed development, avoid potential bugs, etc.&lt;/p&gt;

&lt;p&gt;Experiencing the depth of knowledge in this book, you will be able to add depth of awesome design elements to your applications through layout, transitions and animations, borders, backgrounds, text properties, and many other tools and techniques. This awesome guide for upgrading your web design skill is a must-read.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://abookapart.com/products/css3-for-web-designers"&gt;CSS3 FOR WEB DESIGNERS&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E94PByTp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/2563-11-21-10_16_08-A-Book-Apart--CSS3-for-Web-Designers.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E94PByTp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.freecodecamp.org/news/content/images/2020/11/2563-11-21-10_16_08-A-Book-Apart--CSS3-for-Web-Designers.png" alt="" width="800" height="223"&gt;&lt;/a&gt;If you look to transition from normal CSS specifications to CSS3 then, this book will definitely help you become an expert on it. CSS3 opens up a world of possibilities in the design world with the introduction of advanced selectors to generated content to web fonts, gradients, shadows, rounded corners with elegant animations as well. In the latest edition of this book by Dan Cederholm, new techniques and properties for micro-layouts are introduced.&lt;/p&gt;

&lt;p&gt;With a wide range of browser support of CSS3 styles, you can polish your skill and test it out in any design environment to create beautiful and well-crafted design layouts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You may as well learn from the online tutorials, video tutorials, and all as they are the quick guide to the design solution you are looking for. But here, we are not only looking for design solutions. We are in search of skilled designers who can envision their own set of designs that mesmerizes the web community. We need those who can transform their imaginations into web layouts.&lt;/p&gt;

&lt;p&gt;In order to have the expertise, one must travel to depths of CSS styling pits learning from the best practices, techniques, and challenging them with every possible criterion for design there is. Hence, these books available will help you do exactly that. Enlighten yourself with the best books on web designing to take your designing career to new heights.&lt;/p&gt;

&lt;p&gt;Learning standard CSS styling mechanisms is essential for any web developer. If you are looking to embark on the journey to become an expert web developer, you can check out some of the standard and full-fledged web development tutorials. Get yourself familiar with web dev ethics and different JavaScript frameworks.&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://kriss.io/the-best-web-design-books-for-html-css-and-ui-interfaces-in-2021/"&gt;The Best Web Design Books for HTML, CSS, and UI Interfaces in 2021&lt;/a&gt; appeared first on &lt;a href="https://kriss.io"&gt;Kriss&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>cssbooks2021</category>
      <category>cssbooks2020</category>
      <category>cssbooksfree</category>
    </item>
  </channel>
</rss>
