Dart: How to Update a Map

August 17, 2021 A Goodman

This short article shows you 3 ways to update a map in Dart (and Flutter as well). 1 – Using map[key] = [newValue] syntax This approach is straightforward and makes the code easy to read and…

Dart: How to remove specific Entries from a Map

August 17, 2021 A Goodman

In Dart, you can remove key/value pairs from a given map by using one of the following methods: remove(): Removes the entry that associated with the provided key. No error will occur even if the provided…

Flutter: Make a Widget Fill Remaining Space of Row/Column

August 17, 2021 Guest Contributor

In Flutter, you can make a widget fill up the remaining space of a Row or Column by wrapping it inside an Expanded or a Flexible widget. Example Preview: In this example, the amber box will…

Using Cascade Notation in Dart and Flutter

August 12, 2021 Guest Contributor

This short post walks you through a few examples of using the cascade notation (.., ?…) in Dart. What Is The Point? In Dart, cascades let you execute a sequence of operations on the same object….

Flutter: Add a Search Field to an App Bar (2 Approaches)

August 10, 2021 A Goodman

This article walks you through a couple of examples of adding a search field to an app bar in Flutter. The first one uses the AppBar widget (most seen in entertainment apps) and the second one…

Flutter: ListView Pagination (Load More) example

August 2, 2021 A Goodman

In real Flutter applications, we often load dynamic data from servers or databases instead of using hardcode/dummy data as we often see in the examples. For example, you have an e-commerce app and need to load…

Flutter Gradient Text Examples

July 30, 2021 A Goodman

Below are a few examples of creating gradient color text in Flutter without using any third-party plugins. Example 1: Linear Gradient Text (with Shader) Screenshot: The code: You can find more information about the Shader class…

Flutter: Ask for Confirmation when Back button pressed

July 29, 2021 A Goodman

When developing Flutter apps, there might be cases where we want to display a confirmation dialog when a user presses the back button. The purpose is to prevent accidentally leaving a screen (page), especially a screen…

Dart: Convert Timestamp to DateTime and vice versa

July 29, 2021 A Goodman

The examples below show you how to convert timestamp (also known as Unix time or Epoch time) to DateTime and vice versa in Dart (and Flutter as well). We can archive our goal without using any…

Flutter: ListTile with multiple Trailing Icon Buttons

July 29, 2021 A Goodman

There might be cases where you want to add multiple trailing icon buttons to a ListTIle widget. Many Flutter developers will get a solution in seconds: using a Row widget and place some icon buttons inside…

Flutter & SQLite: CRUD Example (2021)

July 28, 2021 A Goodman

SQLite is a fast relational database that can be used to store data offline for mobile applications. CRUD means create, read, update, and delete, the four essential operations of persistent storage. In this article, we are…

Dart & Flutter: Get the Index of a Specific Element in a List

July 27, 2021 A Goodman

In Dart, the List class has 4 methods that can help you find the index of a specific element in a list: indexOf: Returns the first index of the first element in the list that equals…

1 2 3 4 5 26