Flutter: Get the Heights of AppBar and CupertinoNavigationBar

Updated: February 6, 2023 By: Augustus

This article is about the heights of the AppBar (material app bar) and CupertinoNavigationBar (iOS-style app bar) in Flutter. Height of a material AppBar The height of an AppBar is 56 regardless of mobile phones, tablets,…

Flutter: Fetching user input from TextField

Updated: February 6, 2023 By: A Goodman

This article shows you 2 different ways to get user input from TextField in Flutter. Using TextEditingController To retrieve the text or value the user has entered into a text field, we can initialize a TextEditingController…

Flutter: Change the AppBar title dynamically

Updated: January 18, 2023 By: 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)

Updated: May 28, 2023 By: A Goodman

This is an easy-to-understand step-by-step guide on how to use stateful widgets in Flutter (beginner level). Prerequisites Before getting started, you should have: The tiny app we’re going to make has nothing but a text field….

4 Ways to Format DateTime in Flutter

Updated: March 6, 2024 By: 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

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

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

Updated: August 5, 2023 By: Augustus

Some common use cases of the fold() method in Dart (and Flutter as well). Calculating the Sum of a List What this example does is simply find the sum of a given numeric list: Output: Finding…

Flutter decimal number keyboard example

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

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

Updated: April 23, 2023 By: Augustus

Flutter has a built-in function named showDatePicker that can help us easily implement a date picker. Example Preview: If you want to format the selected date to make it look better, see this article: 4 Ways…

Flutter FractionallySizedBox example

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

1 36 37 38 39 40 41