© Sanjib Sinha 2020
S. SinhaQuick Start Guide to Dart Programminghttps://doi.org/10.1007/978-1-4842-5562-9_2

2. Flow Control and Looping

Sanjib Sinha1 
(1)
Howrah, West Bengal, India
 

Controlling the flow of your code is important. Programmers want to control the logic of their code for many reasons; one of the main reasons is that the user of the software should have many options open to them.

You may not know the conditions beforehand, in which way your programming logic should move, though. You can only guess, so as a developer, you should open as many avenues for the user as possible. There are several techniques you can adopt to control the flow of the code. For example, the if-else logic is popular.

if-else

Let’s look at a simple example of controlling ...

Get Quick Start Guide to Dart Programming: Create High-Performance Applications for the Web and Mobile now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.