Google Flutter App Development 2 — Questions and Answers
Question 1: Which command creates a new Flutter project named 'myapp'?
- flutter new myapp
- flutter create myapp (Correct answer)
- flutter init myapp
- dart create myapp
Correct answer: flutter create myapp
flutter create <name> scaffolds a new Flutter project.
Question 2: What is the entry point of every Flutter application?
- The build() method
- The runApp() call inside main() (Correct answer)
- The MaterialApp widget
- The Scaffold widget
Correct answer: The runApp() call inside main()
Execution begins in main(), which calls runApp() to attach the root widget.
Question 3: Which widget provides Material Design visual structure with app bar, body, and floating action button slots?
- Container
- Scaffold (Correct answer)
- MaterialApp
- Column
Correct answer: Scaffold
Scaffold implements the basic Material Design layout structure.
Question 4: What does a hot reload do in Flutter?
- Restarts the app and clears state
- Injects updated source into the running Dart VM keeping state (Correct answer)
- Rebuilds the native binary
- Clears the device cache
Correct answer: Injects updated source into the running Dart VM keeping state
Hot reload injects changed code into the running VM while preserving app state.
Question 5: Which file declares a Flutter project's dependencies and assets?
- package.json
- pubspec.yaml (Correct answer)
- build.gradle
- AndroidManifest.xml
Correct answer: pubspec.yaml
pubspec.yaml lists dependencies, assets, and project metadata.
Question 6: What language is used to write Flutter apps?
- Kotlin
- Dart (Correct answer)
- JavaScript
- Swift
Correct answer: Dart
Flutter apps are written in the Dart programming language.
Question 7: Which widget arranges its children vertically?
- Row
- Column (Correct answer)
- Stack
- Wrap
Correct answer: Column
Column lays out children along the vertical axis.
Which command creates a new Flutter project named 'myapp'?