Kinda Code
Home/Flutter/Page 23

Flutter

Flutter and Dart tutorials, tips & tricks
Flutter: Fetching user input from TextField

Flutter: Fetching user input from TextField

Updated: Feb 06, 2023
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......
Using Local Images in Flutter

Using Local Images in Flutter

Updated: Feb 06, 2023
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 name......
Flutter FractionallySizedBox example

Flutter FractionallySizedBox example

Updated: Feb 06, 2023
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: FractionallySizedBox({ Key? key, ......
Install Flutter and Dart plugins in Android Studio

Install Flutter and Dart plugins in Android Studio

Updated: Feb 06, 2023
This article shows you how to install Flutter and Dart plugins in Android Studio (you’ll see warnings when running flutter docker if these plugins haven’t been installed yet). 1. Open your Android Studio, and you will see......
How to draw Bar Charts with fl_chart in Flutter

How to draw Bar Charts with fl_chart in Flutter

Updated: Feb 06, 2023
This article shows you how to draw some simple bar charts in Flutter with fl_chart, one of the most popular chart plugins these days. Installation 1. Install the latest version of fl_chart by running the command below: flutter......
Flutter: GridView examples

Flutter: GridView examples

Updated: Feb 06, 2023
Below are a few examples of using GridView, a common widget that is used to display a scrollable grid of child widgets, in Flutter. Example 1: Static Content This example displays a grid view that contains a small number of static......
How to Use Custom Fonts in Flutter

How to Use Custom Fonts in Flutter

Updated: Feb 06, 2023
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, Anton, and Cabin. Adding......
How to embed Youtube video in Flutter

How to embed Youtube video in Flutter

Updated: Feb 06, 2023
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 the......
2 Ways to Get a Random Item from a List in Dart (and Flutter)

2 Ways to Get a Random Item from a List in Dart (and Flutter)

Updated: Feb 05, 2023
When developing apps with Flutter and Dart, there might be cases where you want to retrieve a random item from a given list (for example, an online shop wants to give a random gift to their customer; or a teacher wants to choose a......
How to Check if a Variable is Null in Flutter and Dart

How to Check if a Variable is Null in Flutter and Dart

Updated: Feb 05, 2023
This quick article shows you a couple of different ways to check whether a variable is Null or not in Flutter (and Dart as well). Using the equality operator (“==”) In Flutter (and Dart), you can check if a variable......
Where is the info.plist file in Flutter?

Where is the info.plist file in Flutter?

Updated: Feb 05, 2023
When developing a mobile app for iOS devices, you are very likely to need to open the info.plist file to add or edit something. In a Flutter project, the info.plist file locates at this path: <project......
Show a number to two decimal places in Dart (Flutter)

Show a number to two decimal places in Dart (Flutter)

Updated: Feb 05, 2023
To round a double number to two decimal places in Dart and Flutter, you can use the toStringAsFixed() method. Note: You can set an arbitrary number of decimal places, like this: toStringAsFixed(N). However, numbers are usually......