Adding Borders to Cards in Flutter (2 Examples)
This article walks you through a couple of practical examples about adding borders to Cards in Flutter. Card Border Customization To config borders for a Card widget, focus on its shape property. We can set this…
Flutter: How to Fully Print a Long String/List/Map
If you’re running a Flutter with an iOS simulator or an Android emulator by using the following command: Then you’ll notice that whenever you print out a long string, list, map, or JSON data to the…
Working with ListWheelScrollView in Flutter (2 Examples)
This article is about ListWheelScrollView in Flutter. We’ll discover the fundamentals of the widget and then study 2 different examples. The first example is straightforward and nondescript, while the second one is a result of customization…
Flutter: Get Current Scroll Offset in ListView/GridView
This article shows you how to get the current scroll offset (that indicates the distance to the top, in pixels) in a ListView or other scrollable widgets in Flutter like GridView, SingleSchildScrollView, CustomScrollView, etc. We’ll discover…
Flutter BottomAppBar: Tutorial & Examples
This article is about the BottomAppBar widget in Flutter. We’ll cover the fundaments and walk through a couple of examples (from basics to advanced) of implementing and customizing the widget in practice. A Quick Overview To…
Flutter: Rendering an Image from Byte Buffer/Int8List
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)
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
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 and make him…
How to Reverse/Shuffle a List in Dart
The two examples below show you how to reverse and shuffle a given list in Dart. Reversing a Dart list The code: Output: Shuffling a Dart list We can shuffle a list randomly by using the…
Dart: Calculate the Sum of all Values in a Map
This short 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 Reduce()…
Flutter: 5 Ways to Add a Drop Shadow to a Widget
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)
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…