How to Reverse a String in Dart (3 Approaches)

June 22, 2022 A Goodman

The three examples below show you three different ways to reverse a given string in Dart (e.g. turn ABC to CBA). Example 1 Output: Example 2 Output: Example 3 Output: Futher reading: How to Subtract two…

Flutter: Create a New Project in the Current Directory

May 30, 2022 A Goodman

To create a new Flutter project in the current directory, you can run the flutter create command and use the dot (.) for the path: Important: The folder name should be all lowercase, with underscores to…

How to Subtract two Dates in Flutter & Dart

May 28, 2022 A Goodman

In Flutter and Dart, you can subtract two dates by using the DateTime.difference method. The result is a duration. Example: Output: The DateTime class also has a method named subtract. However, this one isn’t used for…

Flutter: Giving a Size to a CircularProgressIndicator

May 28, 2022 A Goodman

In Flutter, the CircularProgressIndicator widget, as its name implies, helps you implement a circle progress indicator that lets the user know that something is loading. This widget doesn’t ship options to set its size like width,…

Dart & Flutter: Convert a Duration to HH:mm:ss format

May 28, 2022 A Goodman

When working with Dart and Flutter, there might be cases where you want to turn a Duration into a string of HH:mm:ss format: mm: minutes as 2 digits from 00 to 59 ss: seconds as 2…

How to Create Rounded ListTile in Flutter

May 24, 2022 A Goodman

In Flutter, you can implement a ListTile widget with rounded corners by setting its shape property to RoundedRectangleBorder(/*…*/). Below is a concrete example that demonstrates this. Screenshot: The code: Further reading: Flutter: Creating Transparent/Translucent App Bars…

Flutter: Creating Transparent/Translucent App Bars

May 24, 2022 A Goodman

In Flutter, you can create a transparent or translucent app bar by doing the following things: Set the backgroundColor property of your AppBar widget to completely transparent (Colors.transparent) or translucent (a color with opacity less than…

Flutter: How to Create a Custom Icon Picker from Scratch

May 18, 2022 A Goodman

The example below shows you how to create a custom icon picker from scratch in Flutter. There is no need to install any third-party packages so that our icon picker will be neat and extremely flexible…

Flutter: How to Repair/Remove all Dependencies in .pub-cache

May 14, 2022 A Goodman

If you are developing an app using Flutter and have encountered a problem related to one or more packages being broken in the system cache (in the ./pub-cache folder), you can reinstall all your cached dependencies…

Flutter & Dart: How to Check if a String is Null/Empty

May 11, 2022 The Plumber

When working with Flutter and Dart, there might be cases where you have to check whether a given string is null or empty. Suppose that our app’s functionality only continues when the string is neither null…

How to create selectable text in Flutter

May 5, 2022 Pennywise

This article shows you how to create selectable and copiable text in Flutter. Overview In Flutter, the text presented by the Text widget is undetectable (even on the web). To make text selectable, you can use…

Flutter StatefulBuilder example

May 5, 2022 A Goodman

This article is about the StatefulBuilder widget in Flutter. We’ll cover the fundamentals of the widget then examine a complete example of using it in action. Overview The StatefulBuilder widget makes it possible to rebuild only…

1 2 3 32