<?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>Forem: Fiifi Pius </title>
    <description>The latest articles on Forem by Fiifi Pius  (@geekpius).</description>
    <link>https://forem.com/geekpius</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%2F402223%2F80ada42a-3aa1-4973-8e61-b155054f5298.jpg</url>
      <title>Forem: Fiifi Pius </title>
      <link>https://forem.com/geekpius</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/geekpius"/>
    <language>en</language>
    <item>
      <title>Use A Package Like A Pro</title>
      <dc:creator>Fiifi Pius </dc:creator>
      <pubDate>Tue, 25 Oct 2022 12:53:20 +0000</pubDate>
      <link>https://forem.com/geekpius/use-a-package-like-a-pro-1cpm</link>
      <guid>https://forem.com/geekpius/use-a-package-like-a-pro-1cpm</guid>
      <description>&lt;p&gt;As a developer, you will make mistakes when learning something new. I used to make this particular mistake we are going to talk about, till I realized I couldn't live like that.&lt;/p&gt;

&lt;p&gt;I see beginners, import packages and start using them everywhere in their project. This makes it difficult when there's a change of package. They will have to touch too many places to get things working. Or, when there's a breaking changes, they go through the same hell. &lt;/p&gt;

&lt;h1&gt;
  
  
  Now, let's look at using packages the right way
&lt;/h1&gt;

&lt;p&gt;We are going to look a simple package but you can apply this same logic for all kinds of packages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a class or function to handle the package however you want it. This class could be either widget class or a normal class. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create A Class
&lt;/h2&gt;

&lt;p&gt;This is my class for package_info_plus package which has a function of getting app version.&lt;br&gt;
&lt;/p&gt;

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

class AppPackageInfo {
  static Future&amp;lt;String&amp;gt; getAppVersion() async {
    final packageInfo = await PackageInfo.fromPlatform();
    return '${packageInfo.version}';
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can use it in any widget you like and if in any case you would like to change the package, all you need to do is change it at one place.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class AppVersionScreen extends StatefulWidget {
  const AppVersionScreen({Key? key}) : super(key: key);

  @override
  State&amp;lt;AppVersionScreen&amp;gt; createState() =&amp;gt; _AppVersionScreenState();
}

class _AppVersionScreenState extends State&amp;lt;AppVersionScreen&amp;gt; {
  String _appVersion = '';
  void _getAppVersion() async {
    String appVersion = await AppVersion.getAppVersion();
    if (mounted) setState(() =&amp;gt; _appVersion = appVersion);
  }

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

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Text('$_appVersion'),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Let's look at widget package
&lt;/h2&gt;

&lt;p&gt;Say, you want to do a loading effect for your &lt;strong&gt;ListViews&lt;/strong&gt;. You could use a package like &lt;strong&gt;shimmer&lt;/strong&gt; to create a nice loading effect. You don't want to be using this package anywhere in your project.&lt;br&gt;
If there's no support for &lt;strong&gt;shimmer&lt;/strong&gt; package anymore, you have replace it with a similar package like &lt;strong&gt;skeleton&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This means you will have to touch places you have &lt;strong&gt;shimmer&lt;/strong&gt; package and replace &lt;strong&gt;skeleton&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead, create a &lt;strong&gt;custom stateless widget&lt;/strong&gt; and create your &lt;strong&gt;Shimmer&lt;/strong&gt; effect there. Make it highly customizable so it could suit your use cases.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ShimmerLoadingEffect extends StatelessWidget {
  const ShimmerLoadingEffect({
    Key? key,
    required this.child,
    this.itemCount = 4,
  }) : super(key: key);

  final Widget child;
  final int itemCount;

  @override
  Widget build(BuildContext context) {
    return Shimmer.fromColors(
      baseColor: Colors.grey.shade300,
      highlightColor: Colors.grey.shade100,
      child: ListView.builder(
        padding: EdgeInsets.zero,
        itemCount: itemCount,
        itemBuilder: (context, index){
          return child;
        },
      ),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a simple stateful widget consuming API&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ViewPeopleScreen extends StatefulWidget {
  const ViewPeopleScreen({Key? key}) : super(key: key);

  @override
  State&amp;lt;ViewPeopleScreen&amp;gt; createState() =&amp;gt; _ViewPeopleScreenState();
}

class _ViewPeopleScreenState extends State&amp;lt;ViewPeopleScreen&amp;gt; {

List _people = [];

  void _getPeople() async{
    try{

        var response = await _peopleService.fetchPeople();
        if(!mounted) return;
        setState(() =&amp;gt; _people = response['data'] );

    } on TimeoutException catch (t) {
      log(t.toString());
    } catch(e){
      log(e.toString());
    }
  }

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

  @override
  Widget build(BuildContext context) {
    return  _people.length == 0 ?
      ShimmerLoadingEffect()
         :
       ListView.builder(
          itemCount: _people.length,
          itemBuilder: (context, index){
          final people = _people[index];
            return Text(people['name'].toString());
          },
       );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Take Away
&lt;/h2&gt;

&lt;p&gt;Whenever there's a change to the &lt;strong&gt;shimmer&lt;/strong&gt; package, it will affect one place and one file only. This also allows you to adhere to the &lt;strong&gt;DRY&lt;/strong&gt; principle.&lt;/p&gt;

&lt;p&gt;These are just simple examples and this technique applies to a complex use cases as well.&lt;/p&gt;

&lt;p&gt;Writing application is hard, and as a beginner, if you don't take care, this little mistakes could frustrate you.&lt;/p&gt;

</description>
      <category>dart</category>
      <category>flutter</category>
      <category>mobile</category>
    </item>
    <item>
      <title>HOW TO USE ON GENERATE ROUTE IN FLUTTER</title>
      <dc:creator>Fiifi Pius </dc:creator>
      <pubDate>Wed, 12 Aug 2020 19:44:36 +0000</pubDate>
      <link>https://forem.com/geekpius/how-to-use-on-generate-route-in-flutter-4kml</link>
      <guid>https://forem.com/geekpius/how-to-use-on-generate-route-in-flutter-4kml</guid>
      <description>&lt;p&gt;When I started using routes in flutter I tried to use the simple routing code. When my application started having multiple pages/screens and passing data between screens, then I realized I need a better way. Most flutter try to hack their way just to avoid using on generate route. It seems complex at a glance but very easy grasp when you pay attention to it.&lt;/p&gt;

&lt;h5&gt;
  
  
  On Generate Route
&lt;/h5&gt;

&lt;p&gt;What the flutter team is saying is, instead of extracting the arguments directly inside the widget, you can also extract the arguments inside an onGenerateRoute() function and pass them to a widget. &lt;/p&gt;

&lt;h6&gt;
  
  
  Say our app always passes data to LocationScreen
&lt;/h6&gt;

&lt;p&gt;I always to put my route in one file(route_generator.dart) so that it doesn't get mixed up and its a class. So we get the data from final args = settings.arguments; and pass it inside LocationScreen constructor. Refer to the image below&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjanyb2c9l07dtr4n84yc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjanyb2c9l07dtr4n84yc.png" alt="Route Class"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Setting Your Routes
&lt;/h5&gt;

&lt;p&gt;So in the main.dart file I will call my initial route and set to the home screen using the name route not the name widget. I will also set my onGenerateRoute to the route method we created in our route class.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7r05vu8uti1r9fzusgv1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7r05vu8uti1r9fzusgv1.png" alt="Main"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Using Your Route With Arguments
&lt;/h5&gt;

&lt;p&gt;So now we can pass arguments to our target screen through our route. With the route below, the pushNamed takes two parameters: first, for our named route and second, for the data we want to pass to LocationScreen&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fucsn9dwmau3xni0k4qat.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fucsn9dwmau3xni0k4qat.png" alt="Usage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Creating Constructor In LocationScreen
&lt;/h5&gt;

&lt;p&gt;Create a constructor in the LocationScreen. Make it required if your screen/page is always going to get data which in this case it is.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F29ag4t8qmqh4m4yb8zhk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F29ag4t8qmqh4m4yb8zhk.png" alt="Create"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Accessing data in LocationScreen State
&lt;/h5&gt;

&lt;p&gt;This is where you have to use the fundamental of flutter. Now we will call widget and tap inside to get our weatherData. eg: widget.weatherData.&lt;br&gt;
The LocationScreen object and the LocationScreen state object are linked. The state object knows which statefull widget it belongs to. So the state object has a property call widget which points to its parent.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F77xk9qh1zy6qtsiqx5t3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F77xk9qh1zy6qtsiqx5t3.png" alt="Access"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Take Away
&lt;/h3&gt;

&lt;p&gt;So you could see, on generate route is not difficult after all. The best route approach flutter offers you. So don't be like me back then when I was try to avoid the hard way.&lt;/p&gt;

</description>
      <category>dart</category>
      <category>flutter</category>
      <category>material</category>
      <category>mobile</category>
    </item>
    <item>
      <title>BENEFITS OF REST APIs</title>
      <dc:creator>Fiifi Pius </dc:creator>
      <pubDate>Tue, 28 Jul 2020 17:29:03 +0000</pubDate>
      <link>https://forem.com/geekpius/benefits-of-rest-apis-55l4</link>
      <guid>https://forem.com/geekpius/benefits-of-rest-apis-55l4</guid>
      <description>&lt;p&gt;As an engineer or developer, it's important to keep up with the latest programming innovations. As with many other API developers, I've opted for a tried-and-true, simplified approach to our data validation APIs that is REST.&lt;/p&gt;

&lt;p&gt;The REST architecture generally consists of clients, servers, resources, and a vocabulary of HTTP operations known as request methods. In essence, clients send requests to servers and servers respond. These interactions are centered around representations of resources such as a document or URI. These representations are typically exchanged over a standardized interface such as HTTP. Clients, servers, and other connectors can mediate requests without having to know anything beyond the resource's identifier, required action, and the format of the representation that must be returned such as JSON or XML.&lt;/p&gt;

&lt;p&gt;REST uses a standardized set of request methods including: GET, POST, PUT, DELETE, and other existing HTTP capabilities.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---pEuuxJV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/m2wrxjau2bwck629tvli.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---pEuuxJV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/m2wrxjau2bwck629tvli.png" alt="Alt Text" width="300" height="37"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  EXAMPLE OF REST API
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3f7-ORK2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cae5it5oi1kn3paa8jzs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3f7-ORK2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cae5it5oi1kn3paa8jzs.png" alt="Alt Text" width="810" height="561"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  BENEFITS OF REST API
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;REST is much easier than other approaches such as SOAP which keeps developers from having to reinvent the wheel as far as HTTP request operations go. SOAP also requires separate server and client programs.&lt;/li&gt;
&lt;li&gt;REST is based on standard HTTP operations, and it uses verbs with specific meanings such as "get" or "delete" for clarity. Resources are assigned individual URIs, adding flexibility.&lt;/li&gt;
&lt;li&gt;With REST, information that is produced and consumed is separated from the technologies that facilitate production and consumption. As a result, REST performs well, is highly scalable, simple, and easy to modify and extend.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  WHY I LOVE IT
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g0fOB1s4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://mk0buildfireqbf86ll2.kinstacdn.com/wp-content/uploads/2018/01/visual-representation.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g0fOB1s4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://mk0buildfireqbf86ll2.kinstacdn.com/wp-content/uploads/2018/01/visual-representation.png" alt="API for all" width="523" height="462"&gt;&lt;/a&gt;&lt;br&gt;
The thought of writing one back-end code for all your platform applications with easy accessibility, not reinventing the wheel, scalability, extend and modify is a joy for me.&lt;/p&gt;

&lt;p&gt;Lets connect @ Twitter&lt;br&gt;
Download this rest api tutorial for a start @ REST API - Github&lt;/p&gt;

</description>
      <category>rest</category>
      <category>api</category>
      <category>python</category>
      <category>restframeowork</category>
    </item>
    <item>
      <title>Taking Advantage Over Flutter Mobile App As Web Developer</title>
      <dc:creator>Fiifi Pius </dc:creator>
      <pubDate>Thu, 25 Jun 2020 17:55:22 +0000</pubDate>
      <link>https://forem.com/geekpius/taken-advantage-over-flutter-mobile-app-as-web-developer-2588</link>
      <guid>https://forem.com/geekpius/taken-advantage-over-flutter-mobile-app-as-web-developer-2588</guid>
      <description>&lt;p&gt;Being a software developer is one of the most challenging profession in the world. Technologies changes rapidly since humans want more no matter how much you give them. As a web developer you have to HTML, CSS, JavaScript and any other back-end programming language. We developers always don’t forget their HTML element attributes especially the front end developers. If you are a full stack web developer/front end developer who loves to work APIs and don’t want to worry about learning more languages to keep up with IOS and android then look into flutter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://flutter.dev/"&gt;Flutter&lt;/a&gt; is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.&lt;br&gt;
Flutter uses widgets to create UI. With the use of material designs, you can create beautiful, natively UI for your applications. &lt;/p&gt;

&lt;h4&gt;
  
  
  Flutter UI Example
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---0uazfDx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://flutter.dev/assets/homepage/news-1-325f033155f8fa7a28a9d3f2a512da9a2b1675be0f97e790d124c0e9a8d7546f.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---0uazfDx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://flutter.dev/assets/homepage/news-1-325f033155f8fa7a28a9d3f2a512da9a2b1675be0f97e790d124c0e9a8d7546f.gif" alt="Flutter UI" width="880" height="407"&gt;&lt;/a&gt;&lt;br&gt;
But then, flutter comes with a programming language called Dart. Dart is strict type programming language just like the C#, java, etc. So far as you understand programming concept in your preferred language, you can cope with that really fast (well  it depends on your ability learn fast).&lt;/p&gt;

&lt;h4&gt;
  
  
  Dart Code Example
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--69X9FoB---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/m37flll2vp33ftf3eioi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--69X9FoB---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/m37flll2vp33ftf3eioi.png" alt="Dart Code" width="880" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now look at our traditional HTML and CSS and the flutter Widgets Scripts.&lt;/p&gt;

&lt;h4&gt;
  
  
  HTML, CSS And Flutter Example
&lt;/h4&gt;

&lt;h2&gt;
  
  
  HTML
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SV-uCg2F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/si9tngkrv0524i7e7153.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SV-uCg2F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/si9tngkrv0524i7e7153.png" alt="Html code" width="880" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OznZqwsn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gif01e7u9z3w6lu5u8jf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OznZqwsn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gif01e7u9z3w6lu5u8jf.png" alt="Css code" width="617" height="816"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  FLUTTER
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yf4VeUoE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4o9li75xwbd1l420pj6a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yf4VeUoE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4o9li75xwbd1l420pj6a.png" alt="Flutter code" width="880" height="1025"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;As you can see there are some patterns in there like the font style, font family, color, background image, rows, columns, padding,etc.&lt;br&gt;
The thing is if you know how to write HTML and CSS for web UI taken advantage over flutter will be easy.&lt;br&gt;
It worked for me and I believe it will work for you. The most important thing is to learning the basis of flutter. Apply the knowledge of the front end scripts to the flutter widget and the back-end for dart.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>webapp</category>
      <category>mobileapp</category>
      <category>dart</category>
    </item>
    <item>
      <title>Diving into React useEffect</title>
      <dc:creator>Fiifi Pius </dc:creator>
      <pubDate>Mon, 22 Jun 2020 12:51:04 +0000</pubDate>
      <link>https://forem.com/geekpius/diving-into-react-useeffect-3mfd</link>
      <guid>https://forem.com/geekpius/diving-into-react-useeffect-3mfd</guid>
      <description>&lt;h1&gt;Introuduction&lt;/h1&gt;

&lt;p&gt;
The first time you used useEffect, it was amazing the work it could do with just one inbuilt function. I began to love it more the the class high-order-components. I got to know more when I had a webinar with &lt;a href="https://mobile.twitter.com/dan_abramov"&gt;Dan Abramov&lt;/a&gt;. I then dive more into by follow up on &lt;a href="https://overreacted.io/a-complete-guide-to-useeffect/"&gt;Dan's blog&lt;/a&gt; because I wanted to understand.
&lt;/p&gt;

&lt;h1&gt;The Notion&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3Vaw9meS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eddkh09wbu7t2vgfsreg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3Vaw9meS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eddkh09wbu7t2vgfsreg.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
Most developers including me back then, think that when the button is clicked our count state changes and update automatically. Well that might be a useful first intuition when you learn React but it’s not an accurate mental model.
&lt;/p&gt;

&lt;p&gt;
Before you understand how this works, you need to unlearn the class base high-order-component hierarchy and start learning the useEffect ways. 
&lt;/p&gt;

&lt;h4&gt;Look at this&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OkUzbTNX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3mpwc4il8kijg3asa3xz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OkUzbTNX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3mpwc4il8kijg3asa3xz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example, count is just a number. The first time our component renders, the count variable we get from useState() is 0. When we call setCount(1), React calls our component again. This time, count will be 1. And so on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zXt_VRoj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3mx0ub282vqz32m7rr1d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zXt_VRoj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3mx0ub282vqz32m7rr1d.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Whenever we update the state, React calls our component. Each render result “sees” its own counter state value which is a constant inside our function.&lt;/p&gt;

&lt;p&gt;It only embeds the {count} number value into the render output. That number is provided by React. When we setCount, React calls our component again with a different count value. Then React updates the DOM to match our latest render output.

The key takeaway is that the count constant inside any particular render doesn’t change over time. It’s our component that’s called again and each render “sees” its own count value that’s isolated between renders.&lt;/p&gt;
&lt;h1&gt;Keep In Mind&lt;/h1&gt;
&lt;p&gt;So what I am saying is render has it own everything(props,state,handlers,functions). &lt;strong&gt;One thing to know that effects run after every render, are conceptually a part of the component output, and “see” the props and state from that particular render.&lt;/strong&gt;&lt;/p&gt;
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/eddkh09wbu7t2vgfsreg.png)
&lt;p&gt;If I click several times with a small delay, what is the log going to look like?

Each one belonging to a particular render and thus with its own count value. You can try it yourself:&lt;/p&gt;
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/j9il5w0m1dgt5696m689.gif)
&lt;h4&gt;Lets look at the class implementation&lt;/h4&gt;
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/z7u0wf7rhocext59c1y2.png)
&lt;p&gt;However, this.state.count always points at the latest count rather than the one belonging to a particular render. So you’ll see 5 logged each time instead:&lt;/p&gt;
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/odqg4mr5gmllc3tdzafy.gif)
I hope you get the difference.
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;React only runs the effects after letting the browser paint. This makes your app faster as most effects don’t need to block screen updates. Effect cleanup is also delayed. The previous effect is cleaned up after the re-render with new props.&lt;/p&gt;
&lt;p&gt;
Each render is has its own props and state, functions and even even handlers. The key takeaway is that it’s our component that’s called again and each render “sees” its own props and states, function and event handlers that are isolated between renders.
&lt;/p&gt;

&lt;h1&gt;Dive Deeper&lt;/h1&gt;

&lt;p&gt;To dive deeper, continue reading more &lt;a href="https://overreacted.io/a-complete-guide-to-useeffect/"&gt;Dan's blog has it into details&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;Connect With Me&lt;/h1&gt;

&lt;p&gt;Connect with me and lets share ideas that will help developers learning new technologies. Hit me on &lt;a href="https://twitter.com/FiifiDr"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>hooks</category>
      <category>javascript</category>
      <category>insight</category>
    </item>
  </channel>
</rss>
