Flutter: Change the AppBar title dynamically

January 18, 2023 Augustus

The example below is about changing the AppBar title dynamically in Flutter. App Preview The demo app we’re going to make has an app bar and a text field. When you enter text in the text…

Flutter StateFul example (for beginners)

July 8, 2022 A Goodman

This is an easy-to-understand step-by-step guide on how to use stateful widgets in Flutter (beginner level). Prerequisites Basic Flutter knowledge Flutter SDK, Visual Studio Code Android Studio or Xcode The tiny app we’re going to make…

4 Ways to Format DateTime in Flutter (2023)

January 8, 2023 Augustus

This article walks you through a couple of different ways to format DateTime in Flutter (and Dart). The first approach is to create a format function from scratch, and the later ones are using third-party packages….

Flutter SafeArea example

October 4, 2022 Augustus

In simple words, SafeArea is a widget that automatically adds padding needed to prevent its descendants from being covered by notches, the system status bar, rounded corners… or other similar creative physical features on the device…

Using Local Images in Flutter

February 6, 2023 Augustus

The steps below show you how to display local images in Flutter: 1. Create a folder in your project root directory and name it “images” (the name doesn’t matter, you can name it “assets” or whatever…

Flutter & Dart: fold() method examples

July 9, 2022 Augustus

Some common use cases of the fold() method in Dart (and Flutter as well). Calculating the Sum of a List Output: Finding the biggest number (the maximum) in a List Output: Find the smallest number (the…

Flutter decimal number keyboard example

July 12, 2022 Augustus

To show the decimal number soft keyboard in Flutter, just add the following option to your TextField widgets: Note: If you use keyboardType: TextInputType.number, the soft keyboard on iOS will not have the dot (.) symbol…

How to Use Custom Fonts in Flutter

February 6, 2023 Augustus

This article shows you how to use custom fonts in Flutter. Note: One of the best places to download fonts for your Flutter app is fonts.google.com I will use three fonts for the demo: Dancing Script,…

Flutter Date Picker example

March 7, 2022 Augustus

Flutter has a built-in function named showDatePicker that can help us easily implement a date picker. Example Preview: The complete code with explanations in lib/main.dart: Further reading: How to implement a Date Range Picker in Flutter…

Flutter FractionallySizedBox example

February 6, 2023 Augustus

This article gives you a practical Flutter example of implementing FractionallySizedBox, a widget that sizes its child to a fraction of the total available space. Here’s its constructor: Example This sample app contains a yellow box…

Flutter & Dart: every() method examples

February 6, 2023 Augustus

A few examples of using the every() method (of the Iterable class) in Dart (and Flutter as well). The purpose of this method is to check if every element of a given iterable satisfies one or…

Flutter & Dart: reduce() examples

February 6, 2023 Augustus

In Dart, the reduce() method (of the Iterable class), as its name describes itself, executes a “reducer” callback function (provided by you) on each element of the collection, in order, passing in the return value from…

1 32 33 34 35 36