Category Archives: Flutter

Custom Theme using Theme Extensions

By | December 16, 2022

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(… Read More »

Flutter Best Practices — Part 2

By | October 17, 2022

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.… Read More »

Flutter Best Practices — Part 1

By | October 13, 2022

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.… Read More »

Theming your App in Flutter using BLoc, Save & Reload

By | December 6, 2020

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,… Read More »

BLOC Pattern in Flutter explained with Real Example

By | October 5, 2020

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… Read More »

How to use YouTube APIs and Play YouTube videos in Flutter.

By | August 27, 2020

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.… Read More »

Local Notifications in Flutter

By | July 4, 2020

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… Read More »

Create an awesome background running Music Player like Amazon Music in Flutter

By | June 24, 2020

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… Read More »

Select Image from Camera/Gallery, Save Image in App’s Directory in separate Thread, Load Image from App’s Directory to UI.

By | June 7, 2020

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… Read More »

Easy StateManagement in Flutter using Providers, MultiProviders, ChangeNotifiers and Consumers

By | March 15, 2020

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… Read More »

Socket Programming in Flutter, Build Chat Apps in Flutter

By | February 16, 2020

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.… Read More »

Wrap Widget & Chip Widgets in Flutter

By | January 30, 2020

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… Read More »

Firebase Push Notifications in Flutter

By | January 14, 2020

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… Read More »

Proper way to Handle Exceptions in Flutter

By | December 23, 2019

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… Read More »

Different ways to Navigate and Different ways to send parameters for Navigation in Flutter

By | December 17, 2019

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… Read More »

Parsing RSS Feeds in Flutter

By | December 8, 2019

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… Read More »

Custom BottomSheet, Custom Snackbar in Flutter using FlushBox

By | December 4, 2019

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… Read More »

Open Urls in Browser, In App, Make Phone Calls, Open Installed Apps in Flutter

By | November 24, 2019

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… Read More »