Examples of using Future, async, await in Flutter
A few examples of using Future, async, and await in Flutter applications. Simple Example This example simply prints “Doing…” and “Task completed!” to the console. However, the first will appear before the later 2 seconds. The…
Flutter Firebase Auth: MISSING_CUSTOM_TOKEN
This short article is about an error that often happens when using Firebase Authentication in Flutter. The Problem When implementing with Firebase Authentication and Flutter, you may face the MISSING_CUSTOM_TOKEN error. The response body: The common…
Flutter CupertinoSliverNavigationBar: Tutorial & Example
This article is about CupertinoSliverNavigationBar in Flutter. We’ll have a glance at the fundamentals of the widget and then walk through a complete example of implementing it in practice. Overview This iOS-style sliver navigation bar consists…
Working with Cupertino Bottom Tab Bar in Flutter
This article (which has been recently updated) shows you how to implement a simple Cupertino bottom tab bar in Flutter. A Brief Introduction To create an iOS-styled bottom navigation tab bar in Flutter, these widgets are…
Flutter: Drawing Polygons using ClipPath (4 Examples)
This practical, code-centric article shows you how to draw a triangle, quadrangle, pentagon, and hexagon using ClipPath in Flutter. Triangle Screenshot: The code: Quadrangle Screenshot: The code: Pentagon Screenshot: The code: Hexagon Screenshot (I guess it…
How to implement Pull-to-Refresh in Flutter
In this tutorial, we’ll build a simple Flutter app that fetches a to-do list from an open API and displays it on the screen. We also implement a Pull-to-Refresh feature that lets the user refresh the…
4 ways to convert Double to Int in Flutter & Dart
This succinct, practical article walks you through 4 common ways to convert a double to an integer in Flutter and Dart. Using toInt() The toInt() method will truncate a double to an integer and return a…
How to check Type of a Variable in Flutter
To check the type of a variable in Flutter and Dart, you can use the runtimeType property. Example The code: Output: If you want to avoid warnings (just warnings, not errors) that come with the print()…
Flutter: Moving TextFormField focus with soft keyboard
In Flutter, the user can shift the focus between multiple TextFormFields inside a Form by using the soft keyboard (not by tapping the TextFormFields). This article shows you 2 ways to do so. FocusScope.of(context).nextFocus() This method…
How to create custom Accordions in Flutter without plugins
Accordions display collapsible content panels to present information in a limited amount of space. This article shows you how to make Accordions in Flutter without using third-party plugins. Preview Here’s what we’re going to make: The…
Example of Loading Indicator in Flutter
A simple example of using a loading indicator in Flutter. We’ll make a tiny Flutter app that contains a button. When the user clicks that button, a loading indicator will show up for 5 seconds and…
How to encode/decode JSON in Flutter
A Quick Note This article shows you how to encode/decode JSON in Flutter. The steps you need to follow are: 1. Import the dart:convert library: 2. Use: The concepts are just brief. Now, it’s time for…