4 Ways to Create Full-Width Buttons in Flutter
This practical and straightforward article walks you through 4 different ways to create full-width buttons in Flutter. Using ElevatedButton + Container/SizedBox Wrap your ElevatedButton (or TextButton, OutlinedButton) widget inside a Container or a SizedBox whose width…
Dart: Get Host, Path, and Query Params from a URL
In Dart, you can extract useful information from a given URL string by following the steps below: 1. Construct a Uri object from your URL string: 2. Now, you can get what you want through various…
Using GetX to make GET/POST requests in Flutter
GetX is a massively functional and open-source Flutter library that is the most popular these days, with over 10,000 likes on pub.dev. Although GetX provides a wide range of features, each feature is contained in a…
Flutter: Adding a Border to an Elevated Button
In Flutter, you can add a border (and customize its thickness and color as well) to an elevated button by using the ElevatedButton.styleFrom() static method like this: In case you need to create a rounded border,…
Flutter: Adding a Border to an Icon Button (2 Approaches)
This quick article shows you a couple of different ways to create an icon button with a border in Flutter. Using IconButton and Container What you need to do is simply wrap an IconButton widget within…
Hero Widget in Flutter: Tutorial & Example
This article is about the Hero widget and hero animations in Flutter. We’ll have a glance at the essence of those things and then examine a complete example of using them in practice. The TL;DR In…
Flutter: Get the Position of a Tap (X & Y coordinates)
This short and straightforward article shows you how to get the location (X and Y coordinates) of a tap in Flutter. The TLDR What you need to do is to wrap your entire screen (or a…
Flutter: Showing a Context Menu on Long Press
When developing apps with Flutter, there might be cases where you want to show a context menu when your user long press on an element. The location of the context menu will be near the press…
Flutter: Turn an Image into a Base64 String and Vice Versa
In Flutter, you can encode a local or network image (or another kind of file) to a base64 string like this: You can decode a base64 string to an image file like this: In case you…
TabBar, TabBarView, and TabPageSelector in Flutter
This practical article is about the TabBar, TabBarView, and TabPageSelector widgets in Flutter. We’ll have a glance at the fundamentals of those things and then examine a concrete example that demonstrates how they work together in…
Flutter: How to Add a Border to a ListTile
In order to add a border to a ListTile widget in Flutter, you can assign its shape property to RoundedRectangleBorder, BeveledRectangleBorder, or StadiumBorder. You have control over the thickness, color, and radius of the border. Let’s…
Flutter: Creating a Fullscreen Modal with Search Form
This practical article walks you through a complete example of implementing a fullscreen search modal in Flutter. Without any further ado, let’s get started. The Example Preview The small app we’re going to construct has an…