3
Learning Dart Basics
WHAT YOU WILL LEARN IN THIS CHAPTER
- Why you use Dart
- How to comment code
- How to use the top‐level
main()
function - How to reference variables such as numbers, strings, Booleans, lists, maps, and runes
- How common flow statements (such as
if
,for
,while
, and the ternary operator), loops, andswitch
andcase
work - How functions are used to group reusable logic
- How to use the
import
statement for external packages, libraries or classes - How to create classes
How to use
asynchronous programming to avoid blocking the user interface
Dart is the foundation of learning to develop Flutter projects. In this chapter, you'll start understanding Dart's basic structure. In future chapters, you'll create apps that implement these concepts. All the sample code is in the ch3_dart_basics
folder. (In the sample code, don't worry about how it's laid out; just take a look so you can see how Dart code is written. Tap the floating action button located on...