Flutter: Container border examples

November 28, 2020 Goodman

This article walks you through 3 examples of setting borders for a Container in Flutter. Example 1: Set a border for all sides This example creates a square yellow box enclosed by a red border. Preview:…

Flutter Flexible examples

November 26, 2020 Goodman

This article walks you through a few examples of using the Flexible widget in Flutter. Example 1: Sizing children relative to their parent’s size Screenshot: The code: Example 2: FlexFit.loose vs FlexFit.tight Screenshots: The code: Conclusion…

Flutter FittedBox examples

November 26, 2020 Goodman

In this article, we will go over a few examples of using the FittedBox widget in Flutter. Example 1: Prevent Text from being invisible with FittedBox The text’s font size is reduced to fit its parent….

How to remove yellow lines under Text in Flutter (3 ways)

November 25, 2020 Goodman

There are several ways to remove yellow lines under a Text widget in Flutter. Adding a Material ancestor You can remove the double yellow lines by placing your Text widget inside a Material widget or a…

Flutter FadeTransition example

November 25, 2020 Goodman

An simple example of implementing FadeTransition in Flutter. Preview The complete code You can read also Using Animation Controller in Flutter, Flutter TweenAnimationBuilder Examples, Flutter DecoratedBoxTransition example, Example of using AnimatedContainer in Flutter to learn more…

Example of using ErrorWidget in Flutter

November 25, 2020 Goodman

In Flutter, the ErrorWidget widget is used to render an error message when a build method falls. You can easily implement an ErrorWidget by adding ErrorWidget.builder to the main() function like this: Example Screenshots Without WidgetError,…

Flutter: Displaying text that contains special characters

November 25, 2020 Goodman

This article shows you 2 ways to display text that contains special characters in Flutter. 1. Escaping every special character Like many programming languages, you can escape special characters in a Dart string by using “\”…

Flutter: Set gradient background color for entire screen

November 25, 2020 Goodman

In this article, you will see an example of how to create a fullscreen gradient background for a Flutter application. Summary In order to set a gradient background for the entire screen, just follow these steps:…

Flutter form validation example

November 24, 2020 Goodman

Many web and mobile applications have forms to allow users to enter some information such as names, email addresses, phone numbers, zip codes, passwords, etc. Form validation in Flutter allows error messages to be displayed if…

How to remove items from a list in Dart

November 23, 2020 Goodman

One of the most common tasks you encounter while working with a list in Dart is removing its items. Similar to various programming languages, Dart has some built-in functions that help us get this matter done…

Flutter AnimationController examples

November 20, 2020 Goodman

This article walks you through 3 examples of using AnimationController in Flutter. Example 1: Simple scaling box This example shows you how to use AnimationController in the simplest way. Note: AnimationController linearly produces the numbers from…

How to make an image carousel in Flutter

November 20, 2020 Goodman

Many Flutter applications have carousels to display some featured images on home screens or detail screens. In general, a carousel allows you to infinitely loop through its items by swiping the screen. When you reach the…

Flutter: Show/Hide Password in TextField/TextFormField

November 20, 2020 Goodman

To hide an entered password in a TextField/TextFormField, just set its obscureText property to true: Screenshot: To show the entered password for the user to read it, set obscureText to false: Screenshot: A Complete Example We’ll…

Flutter Draggable example

November 20, 2020 Goodman

In general, the Draggable widget goes along with the DragTarget widget: Draggable: Creates a widget that can be dragged to a target. DragTarget: Receives data when a dragged widget is dropped. Below is a complete example…

Dart regex to validate US/CA phone numbers

November 19, 2020 Goodman

Validating phone numbers is a common task when making Flutter applications. Before sending an SMS with a verification code (that usually costs real money), we should implement some basic checks. In this article, we’ll use a…

How to add a Share button to your Flutter app

November 19, 2020 Goodman

This article shows you how to implement a share button to share content from your Flutter app via the platform’s share dialog by using a plugin called “share”. The share dialog may contain SMS, Messenger, Facebook,…

How to find the iOS Bundle ID of a Flutter project

November 19, 2020 Goodman

This short article shows you how to find the iOS bundle identifier of a Flutter project. 1. Open the ios folder of your Flutter project by using XCode. 2. Click on Runner in the left sidebar….

Flutter error: No Firebase App ‘[DEFAULT]’ has been created

November 19, 2020 Goodman

Problem When working with Flutter and Firebase, you may fall into the following error: Solution The solution is quite simple. Everything you need to do is opening the main.dart file and change from this: To this:…

Flutter: Correctly adding GoogleServices-Info.plist to iOS

November 19, 2020 Goodman

This article shows you how to correctly add the GoogleServices-Info.plist file to iOS so that you can run your Flutter app on an iOS simulator or an iPhone. 1. Open the ios folder of your project…

How to use button themes in Flutter (updated Dec 2020)

November 19, 2020 Goodman

In the old days, ButtonTheme used to be used but nowadays it is obsolete and has been replaced by TextButtonTheme, ElevatedButtonTheme, and OutlinedButtonTheme. This is a short and straight-to-the-point guide to implementing button themes in Flutter….

1 2 3 10