Flutter uses widgets for everything because it makes building apps simple and consistent. Widgets are like building blocks that create the app's look and behavior.
When you want to create a button, text, or image on the screen.
When you need to arrange items in rows, columns, or grids.
When you want to change how something looks or behaves, like adding color or padding.
When you want to build a complete screen or page in your app.
When you want to handle user interactions like taps or scrolls.
Column accepts a list of children widgets inside the children parameter.
Step 2: Verify syntax correctness
Commas separate list items; here commas are correctly placed after each Text widget.
Final Answer:
No error, code is correct -> Option A
Quick Check:
Column with children list syntax is correct [OK]
Hint: Children list in Column needs commas between widgets [OK]
Common Mistakes:
Forgetting commas between children
Thinking Column cannot have children
Believing Text must be inside Row
5. You want to create a screen with a blue background and centered white text saying 'Hello Flutter'. Which widget combination correctly achieves this?
hard
A. Container(color: Colors.blue, child: Text('Hello Flutter', color: Colors.white))
B. Scaffold(backgroundColor: Colors.blue, body: Center(child: Text('Hello Flutter', style: TextStyle(color: Colors.white))))
C. Center(backgroundColor: Colors.blue, child: Text('Hello Flutter', style: TextStyle(color: Colors.white)))
D. Text('Hello Flutter', style: TextStyle(color: Colors.white, backgroundColor: Colors.blue))
Solution
Step 1: Identify the widget for screen background
Scaffold provides a full screen structure and accepts backgroundColor.
Step 2: Center the text and style it
Center widget centers its child; Text widget styled with white color.
Step 3: Check options for correct syntax and behavior
Scaffold(backgroundColor: Colors.blue, body: Center(child: Text('Hello Flutter', style: TextStyle(color: Colors.white)))) uses Scaffold with backgroundColor and Center with styled Text correctly.