Flutter

Flutter: Ask for Confirmation when Back button pressed

Updated: February 4, 2023 By: 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

Updated: October 6, 2022 By: 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

Updated: August 27, 2023 By: 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 placing some icon buttons inside…

Flutter & SQLite: CRUD Example (updated)

Updated: August 5, 2023 By: 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

Updated: August 24, 2023 By: A Goodman

In Dart, the List class has 4 methods that can help you find the index of a specific element in a list: The examples below will help you understand them better. Example 1: Finding the Index…

Flutter: ValueListenableBuilder Example

Updated: June 5, 2023 By: A Goodman

This article walks you through a complete example of using ValueListenableBuilder, ValueNotifier, and ValueListenable to manage state in a multi-page (or multi-screen) Flutter application. A Quick Note The ValueListenableBuilder widget uses a builder callback to rebuild…

Flutter: Customizing Status Bar Color (Android, iOS)

Updated: August 24, 2023 By: A Goodman

This short post shows you how to change the status bar color (and control its text and icon brightness) in Flutter. iOS On iOS, the background color of the status bar is the same as the…

Viewing PDF files in Flutter

Updated: May 18, 2023 By: Guest Contributor

This article walks you through a couple of examples of viewing PDF (.pdf) documents from within a Flutter app. We are going to use the following PDF file for testing purposes: Using advance_pdf_viewer plugin This package…

Dart & Flutter: 2 Ways to Count Words in a String

Updated: August 24, 2023 By: A Goodman

This short post shows you 2 ways to count the number of words in a given string in Dart (and Flutter as well). Using the split() method We can use the split() method to return the…

Displaying Subscripts and Superscripts in Flutter

Updated: May 27, 2023 By: A Goodman

There might be cases where you want to display some subscripts and superscripts in a Flutter application, such as mathematical formulas, chemical equations, or physics curves. To render subscripts, you can set the style of Text…

Dart: Capitalize the First Letter of Each Word in a String

Updated: March 31, 2023 By: A Goodman

The example below shows you how to capitalize the first letter of each word in a string (use a title case for each word in a string) in Dart (and Flutter as well). The code: Output:…

Flutter Vertical Text Direction: An Example

Updated: August 24, 2023 By: A Goodman

In Flutter, you can set the orientation of the text characters in a line to vertical by wrapping a Text widget inside a RotatedBox widget, like this: A Complete Example Screenshot: The full code: Continue learning…

1 16 17 18 19 20 41