Build: Control Flow Demo
This screen demonstrates basic control flow statements in Flutter: if, for, while, and switch. It shows a list of numbers and their classification using these statements.
Target UI
------------------------- | Control Flow Demo | |-----------------------| | Numbers: | | 1 2 3 4 5 | | | | Even or Odd: | | 1: Odd | | 2: Even | | 3: Odd | | 4: Even | | 5: Odd | | | | Count Down: | | 5 4 3 2 1 | | | | Switch Example: | | Number 3 is Three | -------------------------
Display a list of numbers from 1 to 5 using a for loop.
For each number, show if it is Even or Odd using an if statement.
Show a countdown from 5 to 1 using a while loop.
Use a switch statement to display a message for number 3.