<?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: Sanskar Tiwari</title>
    <description>The latest articles on DEV Community by Sanskar Tiwari (@theindianappguy).</description>
    <link>https://dev.to/theindianappguy</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%2F500608%2Fd188fc7f-bdfc-4076-9ce2-78af75acace6.jpg</url>
      <title>DEV Community: Sanskar Tiwari</title>
      <link>https://dev.to/theindianappguy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/theindianappguy"/>
    <language>en</language>
    <item>
      <title>Maximum call stack size exceeded</title>
      <dc:creator>Sanskar Tiwari</dc:creator>
      <pubDate>Mon, 14 Nov 2022 16:48:13 +0000</pubDate>
      <link>https://dev.to/theindianappguy/maximum-call-stack-size-exceeded-5f2n</link>
      <guid>https://dev.to/theindianappguy/maximum-call-stack-size-exceeded-5f2n</guid>
      <description>&lt;p&gt;I faced this problem with NextJs recently and the solution was quite simple.&lt;/p&gt;

&lt;p&gt;I had a component Name PeopleInfo and the page with the same name, So when i tried importing the component into the page this error happened.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Discord notifications on Google form submission</title>
      <dc:creator>Sanskar Tiwari</dc:creator>
      <pubDate>Wed, 17 Aug 2022 21:47:02 +0000</pubDate>
      <link>https://dev.to/theindianappguy/discord-notifications-on-google-form-submission-2n80</link>
      <guid>https://dev.to/theindianappguy/discord-notifications-on-google-form-submission-2n80</guid>
      <description>&lt;p&gt;it works in 3 simple steps&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 Get Webhook
&lt;/h2&gt;

&lt;p&gt;Visit your discord channel and get the webhook url from integration settings&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1fwhv8s7iegifrqhe4e.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft1fwhv8s7iegifrqhe4e.gif" alt="get webhook url from discord integration and coopy webhook url" width="760" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 Open DiscordNotify
&lt;/h2&gt;

&lt;p&gt;Just open the google form and open DiscordNotify App, Click Add and add all the info with message template and press "Add"&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6xmgvk856xpz720ip017.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6xmgvk856xpz720ip017.gif" alt="Open DiscordNotify" width="760" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 Ready to Go 💨
&lt;/h2&gt;

&lt;p&gt;DiscordNotify will do the heavylifting of sending Discord Notifications on you Google Form Submit&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb9rpowc6ntet8vgp97dy.gif" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb9rpowc6ntet8vgp97dy.gif" alt="Google Form Submission being sent to discord" width="1280" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Messenger Clone built with Flutter &amp; Firebase</title>
      <dc:creator>Sanskar Tiwari</dc:creator>
      <pubDate>Thu, 14 Jan 2021 05:20:38 +0000</pubDate>
      <link>https://dev.to/theindianappguy/messenger-clone-built-with-flutter-firebase-23a9</link>
      <guid>https://dev.to/theindianappguy/messenger-clone-built-with-flutter-firebase-23a9</guid>
      <description>&lt;p&gt;Originally published at :&lt;a href="https://flutternerd.com/messenger-clone-built-with-flutter-firebase/" rel="noopener noreferrer"&gt; Messenger Clone built with Flutter &amp;amp; Firebase&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Let's learn how to build a chat app with flutter and firebase by building messenger clone. [Full source code]&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/2d1fslyxBjQ" rel="noopener noreferrer"&gt;https://youtu.be/2d1fslyxBjQ&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you like to learn via video then you can &lt;strong&gt;&lt;a href="https://youtu.be/2d1fslyxBjQ" rel="noopener noreferrer"&gt;watch it on Youtube&lt;/a&gt;, &lt;/strong&gt;Or you can watch the demo at least, source code link in the end.&lt;/p&gt;

&lt;p&gt;📕 Things covered in this video:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://firebase.google.com/" rel="noopener noreferrer"&gt;Firebase&lt;/a&gt; Firestore (updated 2021) create, update, read&lt;/li&gt;
&lt;li&gt;Firestore Query &amp;amp; Composite Query&lt;/li&gt;
&lt;li&gt;Google Sign In with Firebase Auth &amp;amp; Sign Out&lt;/li&gt;
&lt;li&gt;User Login Persistence.&lt;/li&gt;
&lt;li&gt;Save user info locally with &lt;a href="https://pub.dev/packages/shared_preferences" rel="noopener noreferrer"&gt;shared preference&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;App Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign in with Google&lt;/li&gt;
&lt;li&gt;Search user via username&lt;/li&gt;
&lt;li&gt;Send user message real time (it's better)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Prerequisites :&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Install Flutter if not already &lt;a rel="noreferrer noopener" href="https://flutter.dev/docs/get-started/install"&gt;https://flutter.dev/docs/get-started/install&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step1&lt;/strong&gt;: Creating Flutter project &amp;amp; Refactor Code&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step2&lt;/strong&gt;: Import required packages in pubspec.yaml&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  firebase_auth:
  firebase_core:
  google_sign_in:
  shared_preferences:
  random_string:
  cloud_firestore:&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step3&lt;/strong&gt;: Implemnet Sign In with Google&lt;/p&gt;

&lt;p&gt;for this we will create a folder called services/auth.dart file&lt;/p&gt;

&lt;p&gt;As you can see in auth.dart once the user is signed in we save user info to local database with sharedpreference so we need to create those functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step4&lt;/strong&gt;: Create function to get and save data with sharedpreference. so create a folder helperfun/sharedpref_helper.dart file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step5&lt;/strong&gt;: Connect flutter app with firebase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step6&lt;/strong&gt;: Add Sha1 key to firebase project to make google sign in work properly &lt;/p&gt;

&lt;p&gt;run this command in terminal/cmd  &lt;a href="https://stackoverflow.com/questions/15727912/sha-1-fingerprint-of-keystore-certificate" rel="noopener noreferrer"&gt;link to answer on stackoverflow&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android &lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;then add the sha1 key to firebase&amp;gt; project settings &amp;gt; Add fingerprint &amp;gt; Save.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step7&lt;/strong&gt;: Upload user info to firestore.&lt;/p&gt;

&lt;p&gt;create a file in services/database.dart create a class called DatabaseMethods and add this function to it.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;addUserInfoToDB(
      {String userID,
      String email,
      String username,
      String name,
      String profileUrl}) {
    FirebaseFirestore.instance.collection("users").doc(userID).set({
      "email": email,
      "username": username,
      "name": name,
      "imgUrl": profileUrl
    });
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step8&lt;/strong&gt;: Fix multidex Issue&lt;/p&gt;

&lt;p&gt;open android/app/build.gradle and add multidex to true (multiDexEnabled true) in default config.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    defaultConfig {
        // Enabling multidex support.
        multiDexEnabled true
    }&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and add the dependency.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dependencies {
    implementation 'com.android.support:multidex:1.0.3'
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step9&lt;/strong&gt;: Implement search user by username&lt;/p&gt;

&lt;p&gt;First we will create the user interface with a textfield, search icon &amp;amp; back icon to cancel search.&lt;/p&gt;

&lt;p&gt;Then we will create a firebase query function to fetch the user info from firestore where username is equal to what we are searching for.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Future&amp;lt;Stream&amp;lt;QuerySnapshot&amp;gt;&amp;gt; getUserByUserName(String username) async {
    return FirebaseFirestore.instance
        .collection("users")
        .where("username", isEqualTo: username)
        .snapshots();
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Step10&lt;/strong&gt;: Create Conversation screen&lt;/p&gt;

&lt;p&gt;we will start by creating the message box.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step11&lt;/strong&gt;: Write function to add message to firebase database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step12&lt;/strong&gt;: Check &amp;amp; Create Chatroom with usernames&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step13&lt;/strong&gt;: Get and Set Messages&lt;/p&gt;

&lt;p&gt;now since we have added messages now let's fetch them and show in a list view with custom list item.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step14&lt;/strong&gt;: Show list of chatrooms &lt;/p&gt;

&lt;p&gt;Full source code:  &lt;a href="https://github.com/theindianappguy/messenger-clone-flutter" rel="noopener noreferrer"&gt;https://github.com/theindianappguy/messenger-clone-flutter&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Let's Build More fully functioning apps with Flutter : &lt;/h3&gt;

&lt;h4&gt;&lt;strong&gt;Build a Recipe App with Flutter&lt;/strong&gt;&lt;/h4&gt;

&lt;p&gt;Written Tutorial: &lt;a href="https://flutternerd.com/build-a-recipe-app-with-flutter/" rel="noopener noreferrer"&gt;https://flutternerd.com/build-a-recipe-app-with-flutter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/VTR5HpRfS0A" rel="noopener noreferrer"&gt;https://youtu.be/VTR5HpRfS0A&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;&lt;strong&gt;Build a Wallpaper App with Flutter From Scratch&lt;/strong&gt;&lt;/h4&gt;

&lt;p&gt;written tutorial: &lt;a href="https://flutternerd.com/build-a-wallpaper-app-with-flutter-a-flutter-project/" rel="noopener noreferrer"&gt;https://flutternerd.com/build-a-wallpaper-app-with-flutter-a-flutter-project/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/EKdAU3l_0gA" rel="noopener noreferrer"&gt;https://youtu.be/EKdAU3l_0gA&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;&lt;strong&gt;Build a Quiz Maker App with Flutter &amp;amp; Firebase&lt;/strong&gt;&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://youtu.be/ixWtgO22hBE" rel="noopener noreferrer"&gt;https://youtu.be/ixWtgO22hBE&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;&lt;strong&gt;Build a Fully Functioning Flutter Chat App with Firebase&lt;/strong&gt;&lt;/h4&gt;

&lt;p&gt;written tutorial: &lt;a href="https://flutternerd.com/build-a-fully-functioning-flutter-chat-app-with-firebase-part-1-4/" rel="noopener noreferrer"&gt;https://flutternerd.com/build-a-fully-functioning-flutter-chat-app-with-firebase-part-1-4/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/FTju8w4zEno" rel="noopener noreferrer"&gt;https://youtu.be/FTju8w4zEno&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>firebase</category>
      <category>appfromscratch</category>
      <category>chatapp</category>
    </item>
    <item>
      <title>Build a Recipe App with Flutter 🍳</title>
      <dc:creator>Sanskar Tiwari</dc:creator>
      <pubDate>Thu, 26 Nov 2020 19:06:10 +0000</pubDate>
      <link>https://dev.to/theindianappguy/build-a-recipe-app-with-flutter-4iko</link>
      <guid>https://dev.to/theindianappguy/build-a-recipe-app-with-flutter-4iko</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/VTR5HpRfS0A"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Let’s make a recipe app with flutter, basically learning how to build full app with flutter, also learning how to use API in a flutter app, It is a good flutter project to add to cv.&lt;/p&gt;

&lt;p&gt;If you like to learn via video then you can &lt;a href="https://youtu.be/VTR5HpRfS0A" rel="noopener noreferrer"&gt;watch the video&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📕 Things covered in this Series:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetch data from an API with flutter&lt;/li&gt;
&lt;li&gt;How useState in a flutter app&lt;/li&gt;
&lt;li&gt;How to pass down data in a flutter widget&lt;/li&gt;
&lt;li&gt;Using Custom Font in Flutter App&lt;/li&gt;
&lt;li&gt;How to show a grid view and much more.
Prerequisites :&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://flutter.dev/docs/get-started/install" rel="noopener noreferrer"&gt;Install Flutter&lt;/a&gt; if not already.&lt;/p&gt;

&lt;p&gt;Source code:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/theindianappguy" rel="noopener noreferrer"&gt;
        theindianappguy
      &lt;/a&gt; / &lt;a href="https://github.com/theindianappguy/recipe_app" rel="noopener noreferrer"&gt;
        recipe_app
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Recipe App with Flutter
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/55942632/77454399-7b9a3780-6e1e-11ea-8aa3-ddd8e50cb90f.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F55942632%2F77454399-7b9a3780-6e1e-11ea-8aa3-ddd8e50cb90f.png" alt="Flutter Recipe App"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Build a Recipe App with Flutter&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;Full FREE Course : &lt;a href="https://youtu.be/VTR5HpRfS0A" rel="nofollow noopener noreferrer"&gt;https://youtu.be/VTR5HpRfS0A&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In todays episode we are going to take the basics of #flutter and we are going to create a real world application. We are going to learn how to build a food recipe application using only flutter.&lt;/p&gt;
&lt;p&gt;📕 Things covered in this video:&lt;/p&gt;
&lt;p&gt;• Fetch data from an api with flutter&lt;/p&gt;
&lt;p&gt;• How useState in flutter&lt;/p&gt;
&lt;p&gt;• How to pass down data in flutter on widgets&lt;/p&gt;
&lt;p&gt;• How to show a grid view&lt;/p&gt;
&lt;p&gt;If you are a beginner with flutter I highly encourage you to follow along because you are going to learn how to put all the small pieces together to understand things like how to fetch data from an api, how to update state and more&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/theindianappguy/recipe_app" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;So let’s get started coding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Create a flutter project,&lt;br&gt;
I am going to do it with Android studio you can user terminal/cmd or VS code there will be no difference.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Code Cleanup&lt;br&gt;
We will start by getting rid of all the comments in the main.dart and getting rid of MyHomePage() stateful widget&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Install the required package&lt;br&gt;
http // for using api.&lt;br&gt;
webview_flutter // for webview in mobile app.&lt;br&gt;
url_launcher // for website to open recipe url in new tab.&lt;br&gt;
to install just add then to pubspec.yaml file below cupertino_icons and then for vs code CTRL + S (save) , Android Studio click on Packages get at the top right hand corner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Create home.dart&lt;br&gt;
inside views folder and add it to main.dart like this.&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:flutter/material.dart';
import 'package:recipe_app/views/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 Recipe',
      debugShowCheckedModeBanner: false,
      home: Home(),
    );
  }
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Let’s create the User Interface for our app now.&lt;br&gt;
As a beginner to understand all the widgets (everything is widget in flutter image, text, container…..) check out flutter official Widget catalog : &lt;a href="https://flutter.dev/docs/development/ui/widgets" rel="noopener noreferrer"&gt;https://flutter.dev/docs/development/ui/widgets&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s discuss most important once i will recommend to watch the video to understand better.&lt;/p&gt;
&lt;h3&gt;
  
  
  What is Scaffold?
&lt;/h3&gt;

&lt;p&gt;It’s a wrapper which provides prebuild widgets like appbar, floating action button, drawer and much more so we don’t have to create all of them from scratch.&lt;/p&gt;

&lt;p&gt;What is Stack?&lt;/p&gt;

&lt;p&gt;We use stack to put one widget above another think of it like a sandwich but instead of brads we have some widgets, it can be text above image, may be full app above custom image/background and many more&lt;/p&gt;

&lt;p&gt;What is Column?&lt;/p&gt;

&lt;p&gt;Column are used to arrange widgets in Vertical Manner one below the other.&lt;/p&gt;

&lt;p&gt;What is Row?&lt;/p&gt;

&lt;p&gt;Row are used to arrange widget in Horizontal Manner one after the other.&lt;/p&gt;

&lt;p&gt;What is Sizedbox?&lt;/p&gt;

&lt;p&gt;Sizedbox are used to create space in our app that can be space between between the image and the text and text and text and in general with any widgets.&lt;/p&gt;

&lt;p&gt;How to use Gradient Color background?&lt;/p&gt;

&lt;p&gt;For Gradient color we use Box Decoration property if Container which have a Linear Gradient property.&lt;/p&gt;

&lt;p&gt;Furthermore we have used Textedit Controller to keep track of what user is typing in the field. I have also used a custom font Overpass(i really like this one) so next step will be to add it as well.&lt;/p&gt;

&lt;p&gt;This all sums up what we have built in home.dart file. ( did i miss anything? let me know in the comments)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'dart:convert';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:recipe_app/models/recipe_model.dart';
import 'package:recipe_app/views/recipe_view.dart';
import 'package:url_launcher/url_launcher.dart';

class Home extends StatefulWidget {
  @override
  _HomeState createState() =&amp;gt; _HomeState();
}

class _HomeState extends State&amp;lt;Home&amp;gt; {
  List&amp;lt;RecipeModel&amp;gt; recipies = new List();
  String ingridients;
  bool _loading = false;
  String query = "";
  TextEditingController textEditingController = new TextEditingController();

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: &amp;lt;Widget&amp;gt;[
          Container(
            height: MediaQuery.of(context).size.height,
            width: MediaQuery.of(context).size.width,
            decoration: BoxDecoration(
                gradient: LinearGradient(
                    colors: [
                  const Color(0xff213A50),
                  const Color(0xff071930)
                ],
                    begin: FractionalOffset.topRight,
                    end: FractionalOffset.bottomLeft)),
          ),
          SingleChildScrollView(
            child: Container(
              padding: EdgeInsets.symmetric(vertical: !kIsWeb ? Platform.isIOS? 60: 30 : 30, horizontal: 24),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: &amp;lt;Widget&amp;gt;[
                  Row(
                    mainAxisAlignment: kIsWeb
                        ? MainAxisAlignment.start
                        : MainAxisAlignment.center,
                    children: &amp;lt;Widget&amp;gt;[
                      Text(
                        "AppGuy",
                        style: TextStyle(
                            fontSize: 18,
                            color: Colors.white,
                            fontFamily: 'Overpass'),
                      ),
                      Text(
                        "Recipes",
                        style: TextStyle(
                            fontSize: 18,
                            color: Colors.blue,
                            fontFamily: 'Overpass'),
                      )
                    ],
                  ),
                  SizedBox(
                    height: 60,
                  ),
                  Text(
                    "What will you cook today?",
                    style: TextStyle(
                        fontSize: 20,
                        color: Colors.white,
                        fontWeight: FontWeight.w400,
                        fontFamily: 'Overpass'),
                  ),
                  Text(
                    "Just Enter Ingredients you have and we will show the best recipe for you",
                    style: TextStyle(
                        fontSize: 15,
                        color: Colors.white,
                        fontWeight: FontWeight.w300,
                        fontFamily: 'OverpassRegular'),
                  ),
                  SizedBox(
                    height: 40,
                  ),
                  Container(
                    child: Row(
                      children: &amp;lt;Widget&amp;gt;[
                        Expanded(
                          child: TextField(
                            controller: textEditingController,
                            style: TextStyle(
                                fontSize: 16,
                                color: Colors.white,
                                fontFamily: 'Overpass'),
                            decoration: InputDecoration(
                              hintText: "Enter Ingridients",
                              hintStyle: TextStyle(
                                  fontSize: 16,
                                  color: Colors.white.withOpacity(0.5),
                                  fontFamily: 'Overpass'),
                              enabledBorder: UnderlineInputBorder(
                                borderSide: BorderSide(color: Colors.white),
                              ),
                              focusedBorder: UnderlineInputBorder(
                                borderSide: BorderSide(color: Colors.white),
                              ),
                            ),
                          ),
                        ),
                        SizedBox(
                          width: 16,
                        ),
                        InkWell(
                            onTap: () async {
                              if (textEditingController.text.isNotEmpty) {
                                setState(() {
                                  _loading = true;
                                });
                                recipies = new List();
                                String url =
                                    "https://api.edamam.com/search?q=${textEditingController.text}&amp;amp;app_id=0f21d949&amp;amp;app_key=8bcdd93683d********5cb95e64ab26";
                                var response = await http.get(url);
                                print(" $response this is response");
                                Map&amp;lt;String, dynamic&amp;gt; jsonData =
                                    jsonDecode(response.body);
                                print("this is json Data $jsonData");
                                jsonData["hits"].forEach((element) {
                                  print(element.toString());
                                  RecipeModel recipeModel = new RecipeModel();
                                  recipeModel =
                                      RecipeModel.fromMap(element['recipe']);
                                  recipies.add(recipeModel);
                                  print(recipeModel.url);
                                });
                                setState(() {
                                  _loading = false;
                                });

                                print("doing it");
                              } else {
                                print("not doing it");
                              }
                            },
                            child: Container(
                              decoration: BoxDecoration(
                                borderRadius: BorderRadius.circular(8),
                                  gradient: LinearGradient(
                                      colors: [
                                    const Color(0xffA2834D),
                                    const Color(0xffBC9A5F)
                                  ],
                                      begin: FractionalOffset.topRight,
                                      end: FractionalOffset.bottomLeft)),
                              padding: EdgeInsets.all(8),
                              child: Row(
                                mainAxisSize: MainAxisSize.min,
                                children: &amp;lt;Widget&amp;gt;[
                                  Icon(
                                    Icons.search,
                                    size: 18,
                                      color: Colors.white
                                  ),
                                ],
                              ),
                            )),
                      ],
                    ),
                  ),
                  SizedBox(
                    height: 30,
                  ),
                  Container(
                    child: GridView(
                        gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
                            mainAxisSpacing: 10.0, maxCrossAxisExtent: 200.0),
                        shrinkWrap: true,
                        scrollDirection: Axis.vertical,
                        physics: ClampingScrollPhysics(),
                        children: List.generate(recipies.length, (index) {
                          return GridTile(
                              child: RecipieTile(
                            title: recipies[index].label,
                            imgUrl: recipies[index].image,
                            desc: recipies[index].source,
                            url: recipies[index].url,
                          ));
                        })),
                  ),
                ],
              ),
            ),
          )
        ],
      ),
    );
  }
}

class RecipieTile extends StatefulWidget {
  final String title, desc, imgUrl, url;

  RecipieTile({this.title, this.desc, this.imgUrl, this.url});

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

class _RecipieTileState extends State&amp;lt;RecipieTile&amp;gt; {
  _launchURL(String url) async {
    print(url);
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }

  @override
  Widget build(BuildContext context) {
    return Wrap(
      children: &amp;lt;Widget&amp;gt;[
        GestureDetector(
          onTap: () {
            if (kIsWeb) {
              _launchURL(widget.url);
            } else {
              print(widget.url + " this is what we are going to see");
              Navigator.push(
                  context,
                  MaterialPageRoute(
                      builder: (context) =&amp;gt; RecipeView(
                            postUrl: widget.url,
                          )));
            }
          },
          child: Container(
            margin: EdgeInsets.all(8),
            child: Stack(
              children: &amp;lt;Widget&amp;gt;[
                Image.network(
                  widget.imgUrl,
                  height: 200,
                  width: 200,
                  fit: BoxFit.cover,
                ),
                Container(
                  width: 200,
                  alignment: Alignment.bottomLeft,
                  decoration: BoxDecoration(
                      gradient: LinearGradient(
                          colors: [Colors.white30, Colors.white],
                          begin: FractionalOffset.centerRight,
                          end: FractionalOffset.centerLeft)),
                  child: Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: &amp;lt;Widget&amp;gt;[
                        Text(
                          widget.title,
                          style: TextStyle(
                              fontSize: 13,
                              color: Colors.black54,
                              fontFamily: 'Overpass'),
                        ),
                        Text(
                          widget.desc,
                          style: TextStyle(
                              fontSize: 10,
                              color: Colors.black54,
                              fontFamily: 'OverpassRegular'),
                        )
                      ],
                    ),
                  ),
                )
              ],
            ),
          ),
        ),
      ],
    );
  }
}

class GradientCard extends StatelessWidget {
  final Color topColor;
  final Color bottomColor;
  final String topColorCode;
  final String bottomColorCode;

  GradientCard(
      {this.topColor,
      this.bottomColor,
      this.topColorCode,
      this.bottomColorCode});

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(8.0),
      child: Wrap(
        children: &amp;lt;Widget&amp;gt;[
          Container(
            child: Stack(
              children: &amp;lt;Widget&amp;gt;[
                Container(
                  height: 160,
                  width: 180,
                  decoration: BoxDecoration(
                      gradient: LinearGradient(
                          colors: [topColor, bottomColor],
                          begin: FractionalOffset.topLeft,
                          end: FractionalOffset.bottomRight)),
                ),
                Container(
                  width: 180,
                  alignment: Alignment.bottomLeft,
                  decoration: BoxDecoration(
                      gradient: LinearGradient(
                          colors: [Colors.white30, Colors.white],
                          begin: FractionalOffset.centerRight,
                          end: FractionalOffset.centerLeft)),
                  child: Padding(
                    padding: const EdgeInsets.all(8.0),
                    child: Column(
                      children: &amp;lt;Widget&amp;gt;[
                        Text(
                          topColorCode,
                          style: TextStyle(fontSize: 16, color: Colors.black54),
                        ),
                        Text(
                          bottomColorCode,
                          style: TextStyle(fontSize: 16, color: bottomColor),
                        )
                      ],
                    ),
                  ),
                )
              ],
            ),
          ),
        ],
      ),
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt; Add Custom Font to Flutter App:&lt;br&gt;
First download the font .otf files from my github repo : here and add then to the assets/ fonts folder&lt;/p&gt;

&lt;p&gt;then mention them in the pubspec.yaml file like this. check the full pubspec.yaml file here&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; fonts:
    - family: Overpass
      fonts:
       - asset: assets/fonts/overpass_bold.otf
    - family: OverpassRegular
      fonts:
        - asset: assets/fonts/overpass_regular.otf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 7:&lt;/strong&gt; Using Api in Flutter App&lt;br&gt;
now we will add the Edamam Api to use their database of recipes and show when requested in out app&lt;/p&gt;

&lt;p&gt;First Signup : &lt;a href="https://developer.edamam.com/edamam-recipe-api" rel="noopener noreferrer"&gt;https://developer.edamam.com/edamam-recipe-api&lt;/a&gt;&lt;br&gt;
Click on Dashboard &amp;gt; Applications &amp;gt; View &amp;gt; Copy the application key.&lt;br&gt;
&lt;strong&gt;Step8:&lt;/strong&gt; Call the api and get data on search in the app so when app user submit something and click on search we will run this onTap:&lt;/p&gt;

&lt;p&gt;code is already added in the top home.dart file so now if you will run it should work. Just make sure to update the Api Key&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 9:&lt;/strong&gt; Add Web View in the App.&lt;br&gt;
it’s pretty simple to show web view the extra code is just the app bar, also i faced this issue that only https website were visible in webview so i made a custom function to redirect http sites to https. Here is the code just create a new file in views recipe_view.dart&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'dart:async';
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

class RecipeView extends StatefulWidget {
  final String postUrl;
  RecipeView({@required this.postUrl});

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

class _RecipeViewState extends State&amp;lt;RecipeView&amp;gt; {

  final Completer&amp;lt;WebViewController&amp;gt; _controller =
      Completer&amp;lt;WebViewController&amp;gt;();

  String finalUrl ;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    finalUrl = widget.postUrl;
    if(widget.postUrl.contains('http://')){
      finalUrl = widget.postUrl.replaceAll("http://","https://");
      print(finalUrl + "this is final url");
    }

  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        child: Column(
          children: &amp;lt;Widget&amp;gt;[
            Container(
              padding: EdgeInsets.only(top: Platform.isIOS? 60: 30, right: 24,left: 24,bottom: 16),
              width: MediaQuery.of(context).size.width,
              decoration: BoxDecoration(
                  gradient: LinearGradient(
                      colors: [
                        const Color(0xff213A50),
                        const Color(0xff071930)
                      ],
                      begin: FractionalOffset.topRight,
                      end: FractionalOffset.bottomLeft)),
              child:  Row(
                mainAxisAlignment: kIsWeb
                    ? MainAxisAlignment.start
                    : MainAxisAlignment.center,
                children: &amp;lt;Widget&amp;gt;[
                  Text(
                    "AppGuy",
                    style: TextStyle(
                        fontSize: 18,
                        color: Colors.white,
                        fontFamily: 'Overpass'),
                  ),
                  Text(
                    "Recipes",
                    style: TextStyle(
                        fontSize: 18,
                        color: Colors.blue,
                        fontFamily: 'Overpass'),
                  )
                ],
              ),
            ),
            Container(
              height: MediaQuery.of(context).size.height - (Platform.isIOS ? 104 : 30),
              width: MediaQuery.of(context).size.width,
              child: WebView(
                onPageFinished: (val){
                  print(val);
                },
                javascriptMode: JavascriptMode.unrestricted,
                initialUrl: finalUrl,
                onWebViewCreated: (WebViewController webViewController){
                  setState(() {
                    _controller.complete(webViewController);
                  });
                },
              ),
            ),
          ],
        ),
      )
    );
  }

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

&lt;/div&gt;



&lt;p&gt;view rawrecipe_app.dart hosted with ❤ by GitHub&lt;br&gt;
Run the app and test if it is running fine any problems? Google it 😅 (it works for me),……. ohhh still not solved comment it down below all the FlutterNerd community will love to help.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 10:&lt;/strong&gt; Running Flutter App On Web.&lt;br&gt;
First make sure you are in beta channel to run flutter web apps step by step &amp;gt; here &amp;lt;&lt;/p&gt;

&lt;p&gt;Then just run the app selecting chrome voila 🥳 it works it’s that simple no setup required.&lt;/p&gt;

&lt;p&gt;If you are facing problem i will highly recommend to follow the video it’s better and i tried to explain each step visually.&lt;/p&gt;

&lt;p&gt;🎓 More tutorials you may like&lt;/p&gt;

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

&lt;p&gt;1.Build a Fully Functioning Flutter Chat App with Firebase&lt;br&gt;
In this one you learn to build a fully functioning chat app with one-2-one real time chat search user like Insta DM.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://flutternerd.com/build-a-fully-functioning-flutter-chat-app-with-firebase-part-1-4/" rel="noopener noreferrer"&gt;https://flutternerd.com/build-a-fully-functioning-flutter-chat-app-with-firebase-part-1-4/&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;2.Build a Wallpaper App with Flutter&lt;br&gt;
In this You will learn how to build a Wallpaper app with Flutter this is a great project to add to portfolio&lt;/p&gt;

&lt;p&gt;&lt;a href="https://flutternerd.com/build-a-wallpaper-app-with-flutter/" rel="noopener noreferrer"&gt;https://flutternerd.com/build-a-wallpaper-app-with-flutter/&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;3.Build a Flutter News App with NewsApi Org&lt;br&gt;
In this project we will use NewsAPI.org and build a news app with it&lt;/p&gt;

&lt;p&gt;&lt;a href="https://flutternerd.com/news-app-with-newsapi-org-flutter/" rel="noopener noreferrer"&gt;https://flutternerd.com/news-app-with-newsapi-org-flutter/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>api</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Flutter Push Notification on document create Firestore</title>
      <dc:creator>Sanskar Tiwari</dc:creator>
      <pubDate>Thu, 29 Oct 2020 09:06:56 +0000</pubDate>
      <link>https://dev.to/theindianappguy/flutter-push-notification-on-document-create-firestore-3f5a</link>
      <guid>https://dev.to/theindianappguy/flutter-push-notification-on-document-create-firestore-3f5a</guid>
      <description>&lt;p&gt;Learn how to send a push notification to Android, IOS, and Flutter Web on new document creation on Firestore.&lt;/p&gt;

&lt;p&gt;📕 Things covered in this tutorial:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connecting Flutter App to Firebase&lt;/li&gt;
&lt;li&gt;Sending test message from Firebase Cloud Messaging to Android device.&lt;/li&gt;
&lt;li&gt;Adding Multidex support&lt;/li&gt;
&lt;li&gt;Creating cloud function to listen for new document create and push notification automatically to a single device by the token.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Make sure you have flutter installed if not visit flutter.dev&lt;/p&gt;

&lt;h3&gt;
  
  
  So let’s get started coding,
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Create a flutter project, I am going to do it with Android studio you can user terminal/cmd or VS code there will be no difference.&lt;/p&gt;

&lt;p&gt;to create project in android studio click +Start a new flutter project &amp;gt; select flutter application &amp;gt; provide project name and click next.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; We will start by getting rid of all the comments in the main.dart and getting rid of MyHomePage() stateful widget&lt;/p&gt;

&lt;p&gt;this helps in getting the code more clean to work with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Create a folder/package inside the lib&lt;/p&gt;

&lt;p&gt;we will create all the screens in this folder so I am going to name this views. then create home.dart.&lt;/p&gt;

&lt;p&gt;just add a stateful widget called Home can call it from MyApp.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Create a new Firebase Project&lt;/p&gt;

&lt;p&gt;visit firebase.com and click “Get Started” sign in with google account&lt;/p&gt;

&lt;p&gt;click on Go to console, + Add project&lt;br&gt;
Enter project name and continue.&lt;br&gt;
you can add google analytics but it’s not required.&lt;br&gt;
once the project is created.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Writing cloud function code we can write it in Javascript and Typescript, don’t worry if you don’t have experience with these&lt;/p&gt;

&lt;p&gt;we will use javascript.&lt;/p&gt;

&lt;p&gt;Install Node.js for your operating system ( i downloaded “Recommended for Most Users”)&lt;br&gt;
&lt;strong&gt;Step 6:&lt;/strong&gt; Add firebase to your Android, IOS or Web app&lt;/p&gt;
&lt;h4&gt;
  
  
  Android
&lt;/h4&gt;

&lt;p&gt;1.Select the Android Icon on Firebase Console.&lt;br&gt;
2.Submit package name which you can find from app_folder/android/app/src/main/AndroidManifest.xml line:2&lt;br&gt;
You can provide nickname not mandatory&lt;br&gt;
3.Add SHA-1 by generating SHA-1 key and submit&lt;br&gt;
Download the google-services.json file and add it to app_folder/android/app/&lt;br&gt;
then add what’s missing to Project-level build.gradle&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;buildscript {
  repositories {
    // Check that you have the following line (if not, add it):
    google()  // Google's Maven repository
  }
  dependencies {
    ...
    // Add this line
    classpath 'com.google.gms:google-services:4.3.3'
  }
}

allprojects {
  ...
  repositories {
    // Check that you have the following line (if not, add it):
    google()  // Google's Maven repository
    ...
  }
}
 then to App-level build.gradle
apply plugin: 'com.android.application'
// Add this line
apply plugin: 'com.google.gms.google-services'

dependencies {
  // add the Firebase SDK for Google Analytics
  implementation 'com.google.firebase:firebase-analytics:17.5.0'
  // add SDKs for any other desired Firebase products
  // https://firebase.google.com/docs/android/setup#available-libraries
}

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

&lt;/div&gt;



&lt;p&gt;click next and i usually click “skip this step” but you can run the app and confirm the connection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7:&lt;/strong&gt; Add cloud firestore package &amp;amp; firebase_messaging from pub.dev&lt;/p&gt;

&lt;p&gt;Error you may face&lt;br&gt;
Multi Index : If you find this anywhere in the error then Modify your build.gradle&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0"

         defaultConfig {
             minSdkVersion 14 //lower than 14 doesn't support multidex
             targetSdkVersion 22

             // Enabling multidex support.
             multiDexEnabled true
         }
}

dependencies {
    implementation 'com.android.support:multidex:1.0.3'
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 8:&lt;/strong&gt; Setting up Firestore&lt;/p&gt;

&lt;p&gt;Open firebase and select Firestore and click “Create database”&lt;br&gt;
Select test mode so that we do not need to add authentication to access the database and click “Next”.&lt;br&gt;
Click selecting firestore location “Done”&lt;br&gt;
&lt;strong&gt;Step 9:&lt;/strong&gt; Adding internet permission &lt;/p&gt;

&lt;p&gt;Add this code snippet to AndroidManifest.xml (app_folder/android/app/src/main/AndroidManifest.xml) within the MainActivity&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; &amp;lt;intent-filter&amp;gt;
      &amp;lt;action android:name="FLUTTER_NOTIFICATION_CLICK" /&amp;gt;
      &amp;lt;category android:name="android.intent.category.DEFAULT" /&amp;gt;
  &amp;lt;/intent-filter&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;open app_folder/android/app/src/main/AndroidManifest.xml and add&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;strong&gt;Step 10:&lt;/strong&gt; Add firebase messaging dependency to Android&lt;/p&gt;

&lt;p&gt;at /android/app/build.gradle, latest version can be found here&lt;/p&gt;

&lt;p&gt;com.google.firebase:firebase-messaging:20.2.4&lt;br&gt;
&lt;strong&gt;Step 11:&lt;/strong&gt; Setting up Firebase Messaging to Your Flutter App:&lt;/p&gt;

&lt;p&gt;Add Firebase Messaging variable and initialise.&lt;br&gt;
create a initstate() and then create a function getToken();&lt;br&gt;
Adding getToken() to the initi state&lt;br&gt;
We also added requestNotificationPermissions for IOS&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:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';

class Home extends StatefulWidget {
  @override
  _HomeState createState() =&amp;gt; _HomeState();
}

class _HomeState extends State&amp;lt;Home&amp;gt; {

  String token = '';
  final FirebaseMessaging firebaseMessaging = FirebaseMessaging();

  @override
  void initState() {
    getToken();

    firebaseMessaging.requestNotificationPermissions(
      const IosNotificationSettings(
        alert: true,
        badge: true,
        provisional: true,
        sound: true
      )
    );

    firebaseMessaging.configure(
      onMessage: (Map&amp;lt;String, dynamic&amp;gt; message) async {
        print("onMessage: $message");
        //_showItemDialog(message);
      },
      //onBackgroundMessage: myBackgroundMessageHandler,
      onLaunch: (Map&amp;lt;String, dynamic&amp;gt; message) async {
        print("onLaunch: $message");
        //_navigateToItemDetail(message);
      },
      onResume: (Map&amp;lt;String, dynamic&amp;gt; message) async {
        print("onResume: $message");
        //_navigateToItemDetail(message);
      },
    );

    super.initState();
  }

  void getToken() async {
    token = await firebaseMessaging.getToken();
  }


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(child: Text("Token : $token")),
      floatingActionButton: FloatingActionButton(onPressed: (){
        print(token);
      },
        child: Icon(Icons.print),
      ),
    );
  }

}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 12:&lt;/strong&gt; Run the App &amp;amp; Get Device token from console when clicking on floating action button.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 13:&lt;/strong&gt; Let’s test if it is working&lt;/p&gt;

&lt;p&gt;Visit Firebase “Grow Section” &amp;gt; “Cloud Messaging”&lt;/p&gt;

&lt;p&gt;Click on “Send your first message”&lt;br&gt;
Enter title&lt;br&gt;
Enter notification text&lt;br&gt;
click on “Send test message”&lt;br&gt;
submit FCM token&lt;br&gt;
Now make sure the app is in background app will not receive notification if it is in foreground&lt;br&gt;
click on “Test”&lt;br&gt;
you will receive notification on your device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 14:&lt;/strong&gt; Time to write Cloud Function&lt;/p&gt;

&lt;p&gt;1.Visit firebase in the Developer Section click on “Functions”.&lt;br&gt;
2.Click on Get Started&lt;br&gt;
Install firebase tools by running the command as shown in the new folder after opening it in VS code.&lt;br&gt;
Make sure you are logged in to firebase through the terminal &lt;/p&gt;

&lt;p&gt;run “firebase login”&lt;br&gt;
then “firebase init”&lt;/p&gt;

&lt;p&gt;Now select Functions by clicking the [Space] key then enter&lt;br&gt;
select Use an existing project (remember the project we created before)&lt;/p&gt;

&lt;p&gt;Select Javascript for Language&lt;/p&gt;

&lt;p&gt;then to use EsLint just click enter&lt;/p&gt;

&lt;p&gt;Now the project is setting up once done, Open the index.js file and remove everything and paste as i pasted below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const functions = require("firebase-functions");

admin.initializeApp(functions.config().firebase);

const fcm = admin.messaging();

exports.senddevices = functions.firestore
  .document("notification/{id}")
  .onCreate((snapshot) =&amp;gt; {
    const name = snapshot.get("name");
    const subject = snapshot.get("subject");
    const token = snapshot.get("token");

    const payload = {
      notification: {
        title: "from " + name,
        body: "subject " + subject,
        sound: "default",
      },
    };

    return fcm.sendToDevice(token, payload);
  }); 

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 15:&lt;/strong&gt; Let’s deploy this now&lt;/p&gt;

&lt;p&gt;run “firebase deploy” and visit the Dashboard section in Function you will be able to see the added function&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 16:&lt;/strong&gt; Now open Firestore in firebase&lt;/p&gt;

&lt;p&gt;Add a new collection named “notification” as we mentioned in the cloud function and add a document with three values as we require in the cloud function.&lt;/p&gt;

&lt;p&gt;click save now if your app is in background you should see the notification&lt;/p&gt;

&lt;p&gt;So finally we have successfully added Flutter Push Notification on document create Firestore 🎉.&lt;/p&gt;

&lt;p&gt;If you have any questions? any error/problem you are facing feel free to comment them down I will get back to you as soon as possible.&lt;/p&gt;

&lt;p&gt;🎓 More tutorials you may like&lt;/p&gt;

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

&lt;p&gt;1.Build a Fully Functioning Flutter Chat App with Firebase&lt;br&gt;
In this one you learn to build a fully functioning chat app with one-2-one real time chat search user like Insta DM.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://flutternerd.com/build-a-fully-functioning-flutter-chat-app-with-firebase-part-1-4/" rel="noopener noreferrer"&gt;https://flutternerd.com/build-a-fully-functioning-flutter-chat-app-with-firebase-part-1-4/&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;2.Build a Wallpaper App with Flutter&lt;br&gt;
In this You will learn how to build a Wallpaper app with Flutter this is a great project to add to portfolio&lt;/p&gt;

&lt;p&gt;&lt;a href="https://flutternerd.com/build-a-wallpaper-app-with-flutter/" rel="noopener noreferrer"&gt;https://flutternerd.com/build-a-wallpaper-app-with-flutter/&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;3.Build a Flutter News App with NewsApi Org&lt;br&gt;
In this project we will use NewsAPI.org and build a news app with it&lt;/p&gt;

&lt;p&gt;&lt;a href="https://flutternerd.com/news-app-with-newsapi-org-flutter/" rel="noopener noreferrer"&gt;https://flutternerd.com/news-app-with-newsapi-org-flutter/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>firebase</category>
      <category>notification</category>
    </item>
  </channel>
</rss>
