Kinda Code
Home/Dart/Page 3

Dart

Flutter & Dart: ENUM Example

Flutter & Dart: ENUM Example

Updated: May 27, 2023
This article shows you how to use enumerations (also known as enums or enumerated types) in Dart and Flutter. Overview An enumeration in Dart is a set of symbolic names (members) bound to unique, constant values. Within an......
4 ways to convert Double to Int in Flutter & Dart

4 ways to convert Double to Int in Flutter & Dart

Updated: May 27, 2023
This succinct, practical article walks you through 4 common ways to convert a double to an integer in Flutter and Dart. Using toInt() The toInt() method will truncate a double to an integer and return a result whose type is int.......
Dart: Get Strings from ASCII Codes and Vice Versa

Dart: Get Strings from ASCII Codes and Vice Versa

Updated: Apr 27, 2023
ASCII stands for American Standard Code for Information Interchange, is a character encoding standard that uses a 7-bit binary code to represent 128 possible characters, including letters, digits, punctuation marks, and control codes.......
Dart: Convert Map to Query String and vice versa

Dart: Convert Map to Query String and vice versa

Updated: Apr 23, 2023
This article shows you how to turn a given map into a query string and parse a given query string into a map in Dart (and Flutter as well) without using any third-party packages. Convert a Map to a Query String We can use the......
Dart: Find List Elements that Satisfy Conditions

Dart: Find List Elements that Satisfy Conditions

Updated: Apr 23, 2023
When developing apps with Flutter and Dart, you’ll be working a lot with lists. One of the most common tasks when working with lists is finding elements that satisfy single or multiple conditions. This article walks you through a......
2 Ways to Create Multi-Line Strings in Dart

2 Ways to Create Multi-Line Strings in Dart

Updated: Apr 22, 2023
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......
Flutter & Dart: Get File Name and Extension from Path/URL

Flutter & Dart: Get File Name and Extension from Path/URL

Updated: Apr 22, 2023
This article shows you how to retrieve the name and extension of a file from a file path or a web URL in Dart (and Flutter as well). In order to get the job done, we need the dart:io library and the path package (this one is an......
Conditional (Ternary) Operator in Dart and Flutter

Conditional (Ternary) Operator in Dart and Flutter

Updated: Apr 19, 2023
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 (?),......
Sorting Lists in Dart and Flutter (5 Examples)

Sorting Lists in Dart and Flutter (5 Examples)

Updated: Apr 19, 2023
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. The examples are in order from easy to......
How to check your Flutter and Dart versions

How to check your Flutter and Dart versions

Updated: Mar 31, 2023
This short article is about checking Flutter SDK and Dart SDK versions that are installed on your computer. In addition, you’ll also learn how to upgrade your Flutter SDK, find out which Flutter channel is being used and how to......
Dart: Extract a substring from a given string (advanced)

Dart: Extract a substring from a given string (advanced)

Updated: Mar 31, 2023
This article is about extracting a substring from a given string in Dart (and Flutter as well). We’ll cover the fundamentals, write a simple program, then walks through a few advanced use cases. Without any further ado,......
Understanding Typedefs (Type Aliases) in Dart and Flutter

Understanding Typedefs (Type Aliases) in Dart and Flutter

Updated: Mar 31, 2023
Flutter and Dart have gotten better and more popular recently. Many new features and improvements have been added. In this article, we’ll explore typedefs in Dart (also known as type aliases) and go through a few examples of......