Flutter

Conditional (Ternary) Operator in Dart and Flutter

Updated: April 19, 2023 By: Guest Contributor

This article is a deep dive into conditional (ternary) operators in Dart and Flutter. The Basic The conditional (ternary) operator is just a Dart operator that takes three operands: a condition followed by a question mark…

Using GetX (Get) for Navigation and Routing in Flutter

Updated: October 3, 2022 By: A Goodman

Introduction Flutter already provides built-in navigator APIs that can help us navigate between screens (routes) and show dialogs, snack bars, and bottom sheets without installing a third-party library. They are good and easy to use. However,…

2 Ways to Create Multi-Line Strings in Dart

Updated: April 22, 2023 By: Pennywise

This concise and straightforward article shows you two different ways to create multi-line strings in Dart (and Flutter as well). Using Triple Quotes Both triple-single-quote (”’) and triple-double-quote (“””) work fine. Example: Output: Note that anything…

Flutter: Global Styles for AppBar using AppBarTheme

Updated: April 26, 2023 By: Pennywise

If your app has many screens with different app bars, using themes will bring many benefits such as: reducing the amount of code to write, and increasing the consistency of the appearance of the app. In…

Flutter: Dynamic Text Color Based on Background Brightness

Updated: April 26, 2023 By: A Goodman

This article shows you a couple of different ways to automatically change text color based on the brightness of background color. What Is The Point? Flutter provides a few methods that can help us get the…

How to Make a Confirm Dialog in Flutter

Updated: April 26, 2023 By: A Goodman

A confirm dialog is a dialog box that asks users to approve the requested operation. It usually appears with button pairs like Yes/No, OK/Cancel, Agree/Disagree. Confirm dialogs help prevent accidental actions such as deleting content, closing…

Using GetX (Get) for State Management in Flutter

Updated: October 4, 2022 By: A Goodman

This article shows you how to use GetX (also known as Get) to manage states in Flutter. We are going to build a simple app that displays a list of given products (you can fetch these…

Flutter: Save Icon to Database, File, Shared Preferences

Updated: April 26, 2023 By: Alexandros

In many cases, your application allows users to set and select some icons according to their wishes (for example, a task manager, a note app, or an event app). This short article shows you how to…

Flutter: Save and Retrieve Colors from Database or File

Updated: April 23, 2023 By: Napoleon

There are situations you may need to store color in a database, file, cloud, or shared preferences. There is a small challenge is that color is not a string or a number so we cannot directly…

Adding and Customizing a Scrollbar in Flutter

Updated: April 23, 2023 By: Napoleon

In Flutter, scrollable widgets (ListView, GridView, etc) have no scrollbar by default. A scrollbar lets a user know how long a view is. It indicates how far the user has scrolled from the top boundary and…

3 Ways to Add Separators between Items in a ListView

Updated: April 23, 2023 By: Pennywise

The following examples show you a couple of different ways to insert separators between items in a list view in Flutter. Example 1: Using ListView.separated In Flutter, you can use ListView.separated to easily create a list…

Sorting Lists in Dart and Flutter (5 Examples)

Updated: April 19, 2023 By: Pennywise

In this article, we’ll walk through a couple of examples of sorting lists in Dart (and Flutter as well), a common task that you may have to deal with in the vast majority of your projects….

1 18 19 20 21 22 41