Category Archives: Flutter
Custom Theme using Theme Extensions
Theme extensions were introduced in Flutter 3. But what are Theme Extensions? As the name says, it helps to extend the inbuilt themes with our own extensions. Let’s jump into an example So when you create a flutter app, your basic root widget will look like this return MaterialApp( title: ‘Flutter Theme Extensions’, theme: ThemeData( primarySwatch: Colors.blue, ),… Read More »
Flutter Best Practices — Part 2
1. Avoid Functional Widgets We usually have a situation where we need to separate out UI code from the widget, But we avoid creating a separate widget and use function which returns Widget. This practice have some benefits, like you don’t need to pass all parameters in your new widget, You have less code and less files. But this approach… Read More »
Flutter Best Practices — Part 1
1. Placeholder Widgets Use SizedBox instead of Container as Placeholder widgets. Take a look at the below use-case return _loaded ? Container() : YourWidget(); The SizedBox is a const constructor and creates a fixed-size box. The width and height parameters can be null to indicate that the size of the box should not be constrained in the corresponding dimension. Hence, when we… Read More »
Debugging Network Calls in Flutter with Alice
In this article I am showing a useful plugin to debug network calls in Flutter. Alice! You can find the alice package here. Alice is an HTTP Inspector tool for Flutter which helps debugging http requests. It catches and stores http requests and responses, which can be viewed via simple UI. It is simple to integrate! First add… Read More »
Creating Dynamic Forms & Get Data from Dynamic Forms in Flutter
Questions How can we create dynamic forms in Flutter? How can we access data from dynamic Forms? Watch Video Tutorial So let’s create a simple dynamic layout We are gonna create a dynamic layout with one TexField when we tap on a plus button in the AppBar. So this is how our AppBar is going to look like… Read More »
Theming your App in Flutter using BLoc, Save & Reload
In this article, we will see how we can use BLoc to Theme your app in Flutter. To understand BLoC with a real world example, you can refer to my previous post on BLoC here. Part 1 Part 1 For this demo also we will need the below plugins If you follow my previous tutorial, it would be… Read More »
BLOC Pattern in Flutter explained with Real Example
In this article we will learn BLoc pattern in flutter for State Management with a simple real world example. Watch Video Tutorial For this example, we will try to consume a web service. The service we are going to use is https://jsonplaceholder.typicode.com/albums What BLoc does? BLoc helps to separate you presentation and business logic. So in simple terms,… Read More »
How to use YouTube APIs and Play YouTube videos in Flutter.
In this article we are gonna talk about how to use YouTube API’s and play YouTube videos in Flutter. Watch Video Tutorial Add Dependencies Open pubspec.yaml file in your Flutter project and add below dependencies Now, Let’s create two screens Home Screen Video Player Screen In the HomeScreen we will show the list of videos. API Key We… Read More »
Local Notifications in Flutter
Hello everyone, In this article we will learn how to show local notifications in Flutter. What we are going to learn? Show Simple notifications Show Repeated Notifications Show Scheduled Notifications Show Notifications at a particular time and day of a week Show Notification with an attachment Show Notifications with HTML content Cancel a Notification. Cancel all Notifications Deal… Read More »
Create an awesome background running Music Player like Amazon Music in Flutter
We all at sometime have played audio in our apps, correct? But we may not have created a complete music player that will run even if the application is not running in the foreground, yes? Watch Video Tutorial So in this article we will see how we can easily create such a music player. Our requirements are Should… Read More »
Select Image from Camera/Gallery, Save Image in App’s Directory in separate Thread, Load Image from App’s Directory to UI.
In this article, we will how to select an image by capturing from camera or gallery, then we will save the image in app’s temporary directory in a separate thread and then load it from there. Watch Video Tutorial For this demo we need three packages. Add Dependencies Open pubspec.yaml file and then add the below dependencies. path_provider:… Read More »
Chat Application in Flutter Using Socket IO
In this article we will see how we can create a chat application in flutter using Socket IO node js server. For this we need to have a server installed with Node js Socket IO and related dependencies So let’ start with Flutter. Here we need three screens Login screen Chat Users List screen Chat Screen. Login Screen… Read More »
Easily Parse JSON, Create JSON Model Classes, Show in ListView.
Hi, This article might be an important one for people who are new into Flutter and others too. I am going to explain about a simple thing here. How do you parse complex JSON in Flutter into Dart classes. Of-course there are libraries in Dart to do that. But that requires an extra bit of effort to identify… Read More »
Easy StateManagement in Flutter using Providers, MultiProviders, ChangeNotifiers and Consumers
With Providers and MultiProviders we can do easy StateManagement in Flutter. State Management in Flutter Watch Video Tutorial Add Dependencies First Go to your pubspec.yaml file add the below dependency, I would recommend to add the latest dependency version, at this moment it is 4.0.4 provider: ^4.0.4 The Providers will have Change Notifiers Consumers The Basic flow to update… Read More »
Socket Programming in Flutter, Build Chat Apps in Flutter
Today’s video will let you know how to create sockets in Flutter to make bi-directional communication possible. First we will go with the ‘IOWebSocketChannel‘ class. Watch Video Tutorial You can read about IOWebSocketChannel by following this link. Let’s use the Official Sample first. Create a new file SocketDemo.dart and add the below code into it. This will create… Read More »
Wrap Widget & Chip Widgets in Flutter
Wrap widget is such a useful widget in many circumstances. Watch Video Tutorial First Let’s create a Chip Widget. The above code creates a Chip widget and you can add it to the UI as you want. If we add it inside a row…then this happens… But we want the chips that overflow to be wrapped to the… Read More »
Firebase Push Notifications in Flutter
This article will show how to send push notifications in Flutter using Firebase. We will start with Android. Add Dependency For sending push notifications we use a plugin called firebase_messaging… https://pub.dev/packages/firebase_messaging Open your pubspec.yaml file and add this dependency Firebase Account Make sure you have a firebase account before proceeding. Once you have created your account, proceed by… Read More »
Using extension-methods in Flutter
This article will help you to understand what are extension methods and what is the use of extension methods. Extension functions can be added to classes which are already compiled. So if you want to extend a library which is already added in your app, you can make use of Extension methods. Watch Video Tutorial Let’s take a… Read More »
App Theming in Flutter – Dark Mode/ Light Mode
In this article, we will see how to theme our apps in Flutter. As you know Google and Apple has released Dark Mode and Light Modes in their latest OS releases in Android 10 and iOS 13. So we have to make sure that our apps works perfectly when the user switch modes in their devices. Watch Video… Read More »
Proper way to Handle Exceptions in Flutter
Today we will see how we can properly handle errors and exceptions in Flutter. Watch Video Tutorial For this example we will be doing a service call and handle exceptions related to that. We will create a sample service here In the above example we are catching all exceptions using a simple try catch block which is not… Read More »
Different ways to Navigate and Different ways to send parameters for Navigation in Flutter
Watch Video Tutorial Navigate using Push Normally if we want to navigate from one screen to another we would use Navigate.push, like in the code below And if we want to send parameters, then one of the way to do this is like below Here SecondScreen is another screen that extends StatelessWidget or StatefulWidget which as a constructor… Read More »
Parsing RSS Feeds in Flutter
Add Dependencies The first thing is to add the plugins in the pubspec.yaml file. We need 4 plugins for this demo. http package – to get the Feed webfeed – to parse the RSS/Atom Feed cached_network_image – to cache the images url_launcher – to open the feed url in a browser Your pubspec.yaml file should look like this… Read More »
Custom BottomSheet, Custom Snackbar in Flutter using FlushBox
In this article we will see how to use a nice plugin called FlushBox in Flutter. Watch Video Tutorial First thing to do is to add dependencies. Add Dependencies Go to your pubspec.yaml file and add the below dependency. Once done that run ‘flutter packages get’ in the terminal to download the packages to be used by your… Read More »
Open Urls in Browser, In App, Make Phone Calls, Open Installed Apps in Flutter
This demo will show how can we Launch urls in a browser outside the App Launch urls in a browser inside the App Launch Installed app (eg:youtube) Make Phone Call. Watch Video Tutorial Add Dependencies To make all this work, we need the url launcher plugin. Open the pubspec.yaml file in your project and add this plugin at… Read More »