Dart

Sorting Lists in Dart and Flutter (5 Examples)

Updated: April 19, 2023 By: Pennywise

In this article, we’ll walk through a couple of examples of sorting lists in Dart (and Flutter as well), a common task that you may have to deal with in the vast majority of your projects….

Flutter & Dart: Get File Name and Extension from Path/URL

Updated: April 22, 2023 By: Pennywise

This article shows you how to retrieve the name and extension of a file from a file path or a web URL in Dart (and Flutter as well). In order to get the job done, we…

How to check your Flutter and Dart versions

Updated: March 31, 2023 By: A Goodman

This short article is about checking Flutter SDK and Dart SDK versions that are installed on your computer. In addition, you’ll also learn how to upgrade your Flutter SDK, find out which Flutter channel is being…

Understanding Typedefs (Type Aliases) in Dart and Flutter

Updated: March 31, 2023 By: Pennywise

Flutter and Dart have gotten better and more popular recently. Many new features and improvements have been added. In this article, we’ll explore typedefs in Dart (also known as type aliases) and go through a few…

2 ways to remove duplicate items from a list in Dart

Updated: February 3, 2023 By: A Goodman

This article shows you a couple of different ways to remove duplicate items from a list in Dart (and Flutter, of course). The first one works well for a list of primitive data types. The second…

How to remove items from a list in Dart

Updated: February 6, 2023 By: A Goodman

One of the most common tasks you encounter while working with a list in Dart is removing its items. Similar to other popular programming languages, Dart has some built-in list methods that help us get this…

Dart regex to validate US/CA phone numbers

Updated: February 14, 2023 By: A Goodman

Validating phone numbers is a common task when making Flutter applications. Before sending an SMS with a verification code (that usually costs real money), we should implement some basic checks. In this article, we’ll use a…

How to check numeric strings in Flutter and Dart

Updated: February 14, 2023 By: A Goodman

A numeric string is a string that represents a number. Numeric strings can contain digits (0-9) and may also include a decimal point, a minus sign (for negative numbers), and an optional exponential notation (for very…

Dart regular expressions to check people’s names

Updated: February 14, 2023 By: A Goodman

The name of a person (in common languages) usually contains the letters A through Z (lowercase or uppercase), spaces, periods (in abbreviations), and may contain dashes. Examples of human names: This is a simple regex pattern…

Base64 encoding and decoding in Dart (and Flutter)

Updated: February 14, 2023 By: A Goodman

What are the points? To encode or decode Base64 in Dart, you can import and use the dart:convert library: For base64 decoding, use one of these 2 methods: For base64 decoding, use one of the following…

How to clone a List or Map in Flutter/Dart (4 methods)

Updated: February 14, 2023 By: A Goodman

In Dart, cloning a list or a map means creating a new instance of the list or map that has the same elements or key-value pairs as the original but is a separate, distinct object. When…

2 ways to convert DateTime to time ago in Flutter

Updated: January 8, 2023 By: A Goodman

This article shows you 2 approaches to convert DateTime to time ago format in Flutter (and Dart, too), for example, 5 minutes ago, 1 day ago, 2 days ago… The first one uses the difference() method…

1 4 5 6 7 8