Conditional statements help create branching interaction paths in your app. In this video, explore the concept of "if" statements.
who are unfamiliar with Dart, in this lesson, … I wanted to quickly cover Dart conditionals, … and more specifically, the if and else. … Now, an if statement basically just checks … to see if a condition is true … and if the condition is true, … then it's going to carry out the instructions … inside a set of curly braces. … it means if the track is clear, then go. … If we go through the statement, … then this is where the condition is … and this is what the instruction is. … So when the computer evaluates the statement … and in this case, the track is indeed clear, … then it will just go. … But if when we evaluate this, it's actually not true, … the track is not clear, in this case, … there's a giant rock there, … then it won't carry out the instructions … inside the curly braces. … Instead, it will skip all of this … and go on to the next line of code … that it needs to execute, … so in this case, the train goes nowhere. … In the last lesson, we saw that in addition … to just using a simple if to trigger some statement …
Released
8/30/2019This course was created by London App Brewery. We are pleased to host this content in our library.
Share this video
Embed this video
Video: Dart conditionals: If-else