<?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: Rishikesh Bidkar</title>
    <description>The latest articles on DEV Community by Rishikesh Bidkar (@rustyrishii).</description>
    <link>https://dev.to/rustyrishii</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%2F968730%2F9ba85025-91eb-4ac5-aac9-46345a38568e.png</url>
      <title>DEV Community: Rishikesh Bidkar</title>
      <link>https://dev.to/rustyrishii</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rustyrishii"/>
    <language>en</language>
    <item>
      <title>How to make API calls using the Refresh Indicator and Provider package in Flutter.</title>
      <dc:creator>Rishikesh Bidkar</dc:creator>
      <pubDate>Thu, 22 Dec 2022 18:42:42 +0000</pubDate>
      <link>https://dev.to/rustyrishii/how-to-make-api-calls-using-the-refresh-indicator-and-provider-package-in-flutter-3kh7</link>
      <guid>https://dev.to/rustyrishii/how-to-make-api-calls-using-the-refresh-indicator-and-provider-package-in-flutter-3kh7</guid>
      <description>&lt;p&gt;Most of the apps you use have a feature that refreshes the page when you pull down from the top of the screen to refresh the page! It is called the Refresh indicator! Let's learn how to use them in flutter projects with the provider package! We will use a simple API from stoic-quotes&lt;/p&gt;

&lt;p&gt;Link:- &lt;a href="https://stoic-quotes.com/api/quote" rel="noopener noreferrer"&gt;https://stoic-quotes.com/api/quote&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 1:- Open a new flutter project!&lt;/p&gt;

&lt;p&gt;Step 2:- Integrate the &lt;a href="https://pub.dev/packages/provider" rel="noopener noreferrer"&gt;provider&lt;/a&gt; package from &lt;code&gt;pub.dev&lt;/code&gt; in the &lt;code&gt;pubspec.yaml&lt;/code&gt; file or simply use the command in your IDE terminal!&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;flutter pub add provider
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Step 3:- Create a new file and name it anything you want. I'll name it the &lt;code&gt;providerfile.dart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1671729872197%2F96664227-4c94-4555-8c35-4d10fec23c76.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1671729872197%2F96664227-4c94-4555-8c35-4d10fec23c76.png" alt="" width="506" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 4:- Import the library in both files. Paste this command in both files. &lt;code&gt;main.dart&lt;/code&gt; and &lt;code&gt;providerfile.dart&lt;/code&gt; on top.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="hljs-keyword"&gt;import&lt;/span&gt; &lt;span class="hljs-string"&gt;'package:provider/provider.dart'&lt;/span&gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Step 5:- Integrate the &lt;a href="https://pub.dev/packages/http" rel="noopener noreferrer"&gt;HTTP&lt;/a&gt; package from &lt;code&gt;pub.dev&lt;/code&gt; in the &lt;code&gt;pubspec.yaml&lt;/code&gt; or use the below command&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;flutter pub add http
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Step 6:- Go to the &lt;code&gt;providerfile.dart&lt;/code&gt; file and create a provider class that extends &lt;code&gt;ChangeNotifier&lt;/code&gt;. Name the class &lt;code&gt;Refresher&lt;/code&gt;. Add a String named &lt;code&gt;Quote&lt;/code&gt;. Create a method named &lt;code&gt;updater&lt;/code&gt; that can make the API call using the &lt;code&gt;HTTP&lt;/code&gt; package! Don't forget to import the HTTP library in this file! Code below 👇&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="hljs-keyword"&gt;import&lt;/span&gt; &lt;span class="hljs-string"&gt;'package:flutter/cupertino.dart'&lt;/span&gt;;
&lt;span class="hljs-keyword"&gt;import&lt;/span&gt; &lt;span class="hljs-string"&gt;'package:provider/provider.dart'&lt;/span&gt;;
&lt;span class="hljs-keyword"&gt;import&lt;/span&gt; &lt;span class="hljs-string"&gt;'package:http/http.dart'&lt;/span&gt; &lt;span class="hljs-keyword"&gt;as&lt;/span&gt; http;
&lt;span class="hljs-keyword"&gt;import&lt;/span&gt; &lt;span class="hljs-string"&gt;'dart:convert'&lt;/span&gt; &lt;span class="hljs-keyword"&gt;as&lt;/span&gt; convert;
&lt;span class="hljs-keyword"&gt;import&lt;/span&gt; &lt;span class="hljs-string"&gt;'dart:convert'&lt;/span&gt;;

&lt;span class="hljs-class"&gt;&lt;span&gt;class&lt;/span&gt; &lt;span&gt;Refresher&lt;/span&gt; &lt;span&gt;extends&lt;/span&gt; &lt;span&gt;ChangeNotifier&lt;/span&gt; &lt;/span&gt;{

  &lt;span class="hljs-built_in"&gt;String&lt;/span&gt; Quote = &lt;span class="hljs-string"&gt;""&lt;/span&gt;;
  &lt;span class="hljs-built_in"&gt;String&lt;/span&gt; Author = &lt;span class="hljs-string"&gt;""&lt;/span&gt;;

  &lt;span class="hljs-keyword"&gt;void&lt;/span&gt; updater() &lt;span class="hljs-keyword"&gt;async&lt;/span&gt; {
    &lt;span class="hljs-keyword"&gt;var&lt;/span&gt; url = &lt;span class="hljs-built_in"&gt;Uri&lt;/span&gt;.parse(&lt;span class="hljs-string"&gt;"https://stoic-quotes.com/api/quote"&lt;/span&gt;);
    &lt;span class="hljs-keyword"&gt;var&lt;/span&gt; response = &lt;span class="hljs-keyword"&gt;await&lt;/span&gt; http.&lt;span class="hljs-keyword"&gt;get&lt;/span&gt;(url);
    &lt;span class="hljs-keyword"&gt;if&lt;/span&gt; (response.statusCode == &lt;span class="hljs-number"&gt;200&lt;/span&gt;) {
      &lt;span class="hljs-built_in"&gt;print&lt;/span&gt;(&lt;span class="hljs-string"&gt;"Works"&lt;/span&gt;);
    }
    &lt;span class="hljs-keyword"&gt;var&lt;/span&gt; data = jsonDecode(response.body);
    &lt;span class="hljs-built_in"&gt;print&lt;/span&gt;(data);
    Quote = (data[&lt;span class="hljs-string"&gt;"text"&lt;/span&gt;]);
    Author = (data[&lt;span class="hljs-string"&gt;"author"&lt;/span&gt;]);

    notifyListeners();
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;var data = jsonDecode(response.body);&lt;/code&gt; decodes the response of the API call output!&lt;br&gt;and &lt;code&gt;Quote = (data["text"]);&lt;/code&gt; takes the main quote text from the output. so does the &lt;code&gt;Author&lt;/code&gt;. Don't forget the &lt;code&gt;notifyListeners();&lt;/code&gt; in the end, or else the code won't work!&lt;/p&gt;

&lt;p&gt;Step 7:- Now go to the &lt;code&gt;main.dart&lt;/code&gt; file! and import the &lt;code&gt;providerfile.dart&lt;/code&gt; file, also the official provider package. You need to activate the provider. In this &lt;code&gt;main.dart&lt;/code&gt; file, create a stateless widget, with a scaffold, AppBar, and a body. The body consists of &lt;code&gt;RefreshIndicator&lt;/code&gt; with &lt;code&gt;ListView&lt;/code&gt; as its child. And &lt;code&gt;Column&lt;/code&gt; with 2 &lt;code&gt;Text&lt;/code&gt; Widgets as the child of &lt;code&gt;ListView&lt;/code&gt;. Code below👇&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span class="hljs-keyword"&gt;import&lt;/span&gt; &lt;span class="hljs-string"&gt;'package:flutter/material.dart'&lt;/span&gt;;
&lt;span class="hljs-keyword"&gt;import&lt;/span&gt; &lt;span class="hljs-string"&gt;'package:provider/provider.dart'&lt;/span&gt;;
&lt;span class="hljs-keyword"&gt;import&lt;/span&gt; &lt;span class="hljs-string"&gt;'providerfile.dart'&lt;/span&gt;;

&lt;span class="hljs-keyword"&gt;void&lt;/span&gt; main() {
  runApp(MultiProvider(
    providers: [
      ChangeNotifierProvider(create: (_) =&amp;gt; Refresher()),
    ],
    child: MaterialApp(home: MyApp()),
  ));
}

&lt;span class="hljs-class"&gt;&lt;span&gt;class&lt;/span&gt; &lt;span&gt;MyApp&lt;/span&gt; &lt;span&gt;extends&lt;/span&gt; &lt;span&gt;StatelessWidget&lt;/span&gt; &lt;/span&gt;{
  MyApp({Key? key}) : &lt;span class="hljs-keyword"&gt;super&lt;/span&gt;(key: key);

  &lt;span class="hljs-meta"&gt;@override&lt;/span&gt;
  Widget build(BuildContext context) {
    &lt;span class="hljs-keyword"&gt;return&lt;/span&gt; Scaffold(
      appBar: AppBar(
        title: &lt;span class="hljs-keyword"&gt;const&lt;/span&gt; Text(&lt;span class="hljs-string"&gt;"Refresh Indicator"&lt;/span&gt;),
      ),
      body: RefreshIndicator(
        edgeOffset: &lt;span class="hljs-number"&gt;0.1&lt;/span&gt;,
        backgroundColor: Colors.black,
        color: Colors.white,
        onRefresh: () &lt;span class="hljs-keyword"&gt;async&lt;/span&gt; {
          Provider.of&amp;lt;Refresher&amp;gt;(context, listen: &lt;span class="hljs-keyword"&gt;false&lt;/span&gt;).updater();
        },
        child: ListView(
          children: &amp;lt;Widget&amp;gt;[
            Column(
              children: &amp;lt;Widget&amp;gt;[
                Text(Provider.of&amp;lt;Refresher&amp;gt;(context, listen: &lt;span class="hljs-keyword"&gt;false&lt;/span&gt;).Quote),
                SizedBox(height: &lt;span class="hljs-number"&gt;20&lt;/span&gt;),
                Text(&lt;span class="hljs-string"&gt;"-&lt;span&gt;${Provider.of&amp;lt;Refresher&amp;gt;(context, listen: &lt;span&gt;false&lt;/span&gt;).Author}&lt;/span&gt;"&lt;/span&gt;),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It's important to initialize the Provider in the &lt;code&gt;runapp&lt;/code&gt; method, or else it won't work. Inside the refresh indicator's &lt;code&gt;onRefresh&lt;/code&gt; function call the &lt;code&gt;updater&lt;/code&gt; class from the &lt;code&gt;providerfile.dart&lt;/code&gt; file. In the Text widget, you need to get the quote using the provider as mentioned in the code.&lt;/p&gt;

&lt;p&gt;Done! Now run the app. It should work!&lt;/p&gt;

&lt;p&gt;You can access this project on GitHub!&lt;br&gt;Link:- &lt;a href="https://github.com/Rishikesh-278/ProviderAPIcalls" rel="noopener noreferrer"&gt;https://github.com/Rishikesh-278/ProviderAPIcalls&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://vimeo.com/783721018" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://vimeo.com/783721018" rel="noopener noreferrer"&gt;https://vimeo.com/783721018&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;If you liked my article consider supporting me through &lt;a href="https://www.buymeacoffee.com/RustyRishii" rel="noopener noreferrer"&gt;Buymeacoffee&lt;/a&gt;&lt;br&gt;&lt;a href="https://linktr.ee/rustyrishii" rel="noopener noreferrer"&gt;https://linktr.ee/rustyrishii&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;


&lt;p&gt;This article is published w/ &lt;a href="https://scattr.io?ref=dev" rel="noopener noreferrer"&gt;Scattr  ↗️&lt;/a&gt;&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>How to deploy flutter web app on netlify through GitHub and set up continuous deployment</title>
      <dc:creator>Rishikesh Bidkar</dc:creator>
      <pubDate>Thu, 22 Dec 2022 13:23:30 +0000</pubDate>
      <link>https://dev.to/rustyrishii/how-to-deploy-flutter-web-app-on-netlify-through-github-and-set-up-continuous-deployment-38c0</link>
      <guid>https://dev.to/rustyrishii/how-to-deploy-flutter-web-app-on-netlify-through-github-and-set-up-continuous-deployment-38c0</guid>
      <description>&lt;p&gt;Creating a website with flutter is very easy, you don't have to write CSS code separately, and almost everything can be done in the main.dart file. Deploying a site shouldn’t be difficult either, let’s get started.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:-&lt;/strong&gt; Before we host the app on Netlify make sure to debug and run it on your chrome browser. To run the web app locally on your system use the below command on your IDE’s terminal.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;flutter run -d chrome
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 2:-&lt;/strong&gt; If it is working properly on the chrome browser, Then run the below command&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;flutter build web
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step 3:-&lt;/strong&gt; After that in the project window, there should be a Directory named “build” with a web folder inside it. Your build is now ready.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F875%2F1%2A19qWr2ynK_pYOGNTuqWTUA.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%2Fmiro.medium.com%2Fmax%2F875%2F1%2A19qWr2ynK_pYOGNTuqWTUA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:-&lt;/strong&gt; Upload your project to GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:-&lt;/strong&gt; Go to &lt;a href="http://netlify.com" rel="noopener noreferrer"&gt;netlify.com&lt;/a&gt; and create an account or just log in with GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6:-&lt;/strong&gt; Your Netlify dashboard should look something like this👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F875%2F1%2APRKlawHIes7xmx9BXsLXMA.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%2Fmiro.medium.com%2Fmax%2F875%2F1%2APRKlawHIes7xmx9BXsLXMA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7:-&lt;/strong&gt; Click on “Add a new site”, you will get three options.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F645%2F1%2AyTyinournNjQAjf2ljwAAA.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%2Fmiro.medium.com%2Fmax%2F645%2F1%2AyTyinournNjQAjf2ljwAAA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 8:-&lt;/strong&gt; Click on the first option, choose GitHub, and select the repository of your project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F875%2F1%2AuEiIGLF6QV_ov4jTFPEQ0A.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%2Fmiro.medium.com%2Fmax%2F875%2F1%2AuEiIGLF6QV_ov4jTFPEQ0A.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 9:-&lt;/strong&gt; In the Publish directory, mention build/web&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F875%2F1%2A85rCwRN2JcaAtkG_Y_sZxA.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%2Fmiro.medium.com%2Fmax%2F875%2F1%2A85rCwRN2JcaAtkG_Y_sZxA.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 10:-&lt;/strong&gt; Click Deploy site or hit enter on your keyboard.&lt;/p&gt;

&lt;p&gt;Congratulations your site is deployed.&lt;/p&gt;

&lt;p&gt;If you don't like the autogenerated name of your site, you can change it by going to the site settings&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F875%2F1%2AshXwATBIzVQ5q5g0dhoMnw.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%2Fmiro.medium.com%2Fmax%2F875%2F1%2AshXwATBIzVQ5q5g0dhoMnw.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For continuous deployment, Every time you make changes to your site, it's necessary to run the build command, or else your changes won't be visible. The command is&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;flutter build web
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After you run the command, push the project to GitHub.&lt;br&gt;Netlify will automatically detect the changes from GitHub and deploy them.&lt;/p&gt;

&lt;p&gt;Thanks for reading. If you like my article you can support me through &lt;a href="https://www.buymeacoffee.com/RustyRishii" rel="noopener noreferrer"&gt;buymeacoffee&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;This article is published w/ &lt;a href="https://scattr.io?ref=dev" rel="noopener noreferrer"&gt;Scattr  ↗️&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>What are some platforms in india that pay to write blogs?</title>
      <dc:creator>Rishikesh Bidkar</dc:creator>
      <pubDate>Tue, 08 Nov 2022 13:00:21 +0000</pubDate>
      <link>https://dev.to/rustyrishii/what-are-some-platforms-in-india-that-pay-to-write-blogs-532e</link>
      <guid>https://dev.to/rustyrishii/what-are-some-platforms-in-india-that-pay-to-write-blogs-532e</guid>
      <description>&lt;p&gt;India does is not included Medium's partner program&lt;br&gt;
So does anybody knows any platforms?&lt;/p&gt;

</description>
      <category>blogs</category>
      <category>beginners</category>
      <category>career</category>
      <category>news</category>
    </item>
  </channel>
</rss>
