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

January 27, 2022 Augustus

Below is a practical Flutterexample of implementing FractionallySizedBox, a widget that sizes its child to a fraction of the total available space. Example This sample app contains a yellow box with a height of 500 and…

Flutter & Dart: every() method examples

January 27, 2022 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

January 27, 2022 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…

Working with For loop in Dart (and Flutter)

January 27, 2022 Napoleon

The for loop is one of the most important features in many programming languages including Dart. 1. For-in syntax Example: Output: 2. A different syntax of “for” loop in Dart Example: Output: Further reading: Dart: Convert…

Working with OutlinedButton in Flutter (2022)

February 6, 2022 A Goodman

An OutlinedButton in Flutter is a labeled child displayed on a (zero elevation) Material widget that can react to touches by filling with a background color. OutlinedButton is the replacement for OutlineButton which has been depreciated…

Working with TextButton in Flutter (2022)

February 6, 2022 A Goodman

Buttons are an essential component of every Flutter web and mobile application. In this article, we are going to take a look at the TextButton class. You will learn how to implement text buttons, and how…

Simultaneously run Flutter on Android and iOS simulators

January 19, 2022 A Goodman

You can run your Flutter project on an Android emulator and an iOS simulator at the same time by using the following command: Screenshot: The output in the console will be similar to this: Further reading:…

Working with ElevatedButton in Flutter (2022)

February 6, 2022 A Goodman

Most mobile and web applications have buttons that allow users to press to interact with. In Flutter, you can use the ElevatedButton widget to create elevated buttons. ElevatedButton is the replacement for RaisedButton which is obsolete….

Flutter: Vertically center a widget inside a Container

March 7, 2022 A Goodman

This article walks you through 4 techniques to vertically center a child widget inside a Container in Flutter. Using the alignment property Set the alignment property to Alignment.center, Alignment.centerRight, or Alignment.centerLeft. Example Output: Using a Center…

How to embed Youtube video in Flutter

January 24, 2022 A Goodman

This straightforward, concise tutorial shows you how to embed a Youtube video into a Flutter mobile app. We’ll use youtube_player_flutter, one of the most popular packages for this stuff. Setting up the plugin Add this to…

Flutter iOS: Trying to embed a platform view but…

February 10, 2022 A Goodman

The Problem When using some packages to embed Youtube videos, Google Maps, or something similar to these ones, you may see the following error message: Or: Solution To get rid of the mentioned error, what you…

1 31 32 33 34 35