Flutter

Flutter BottomAppBar: Tutorial & Examples

Updated: September 1, 2023 By: A Goodman

This article is about the BottomAppBar widget in Flutter. We’ll cover the fundamentals and walk through a couple of examples (from basics to advanced) of implementing and customizing the widget in practice (note that we’ll use…

Flutter: Rendering an Image from Byte Buffer/Int8List

Updated: July 14, 2022 By: A Goodman

In Flutter, you can render an image from an Int8List of bytes by using the Image.memory constructor like so: If what you have are byte buffers, use this: Example This example does the following things: Reading…

Adding a Border to an Image in Flutter (3 Examples)

Updated: September 1, 2023 By: A Goodman

This article shows you how to add a border to an image in Flutter. What is the point? To display an image in Flutter, we use the Image widget. However, it doesn’t ship a direct option…

Dart: Sorting Entries of a Map by Its Values

Updated: March 31, 2023 By: A Goodman

Imagine your boss gives you a Dart map like so: And then, he asks you to sort the map in the ascending/descending order of the map’s values. How do you solve this problem to make him…

How to Reverse/Shuffle a List in Dart

Updated: March 31, 2023 By: A Goodman

The two examples below show you how to reverse and shuffle a given list in Dart. Reversing a Dart list Reversing a list means changing the order of the elements in the list so that the…

Dart: Calculate the Sum of all Values in a Map

Updated: March 31, 2023 By: A Goodman

This short example-based article shows you a few ways to find the sum of all values in a given map in Dart (presume that all the values are numbers). Using a For/In loop Example: Output: Using…

Flutter: 5 Ways to Add a Drop Shadow to a Widget

Updated: May 18, 2023 By: A Goodman

This practical article shows you a couple of different ways to add a drop shadow to a widget in Flutter. The first four approaches are to use self-written code while the last one is to make…

How to Reverse a String in Dart (3 Approaches)

Updated: March 31, 2023 By: A Goodman

The three examples below show you three different ways to reverse a given string in Dart (e.g. turn ABC to CBA). Turn the String into an Array Example: Output: Using StringBuffer Example: Output: Using Char Code…

Flutter: Create a New Project in the Current Directory

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

Updated: March 31, 2023 By: A Goodman

In Flutter and Dart, you can subtract two dates by using the DateTime.difference method. The result is a duration. Example: Output: If you want to get rid of the blue line under the print() function, you…

Flutter: Giving a Size to a CircularProgressIndicator

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

Updated: March 31, 2023 By: 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: Though Dart doesn’t provide an out-of-the-box API that can help us get the…

1 6 7 8 9 10 41