Who developed Flutter?
- A. Facebook
- B. Google (correct)
- C. Microsoft
- D. Apple
Which programming language is used to write Flutter apps?
- A. Java
- B. Kotlin
- C. Dart (correct)
- D. Swift
In Flutter, almost everything is a:
- A. Widget (correct)
- B. Activity
- C. Fragment
- D. View
Which widget type should you use when the UI must change based on internal mutable state?
- A. StatelessWidget
- B. InheritedWidget
- C. StatefulWidget (correct)
- D. Container
Which method triggers a UI rebuild after state changes in a State class?
- A. refresh()
- B. update()
- C. rebuild()
- D. setState() (correct)
Which widget arranges its children in a vertical line?
- A. Column (correct)
- B. Row
- C. Stack
- D. Wrap
Which file lists a Flutter project's dependencies?
- A. package.json
- B. pubspec.yaml (correct)
- C. build.gradle
- D. pom.xml
Which widget overlaps its children on top of each other?
- A. Row
- B. Column
- C. Stack (correct)
- D. Wrap
What does Hot Reload do?
- A. Restarts the app and clears all state
- B. Injects updated code while preserving app state (correct)
- C. Builds a release APK
- D. Clears the device cache
Which widget builds list items lazily as they scroll into view?
- A. Column
- B. Row
- C. Stack
- D. ListView.builder (correct)
What is BuildContext?
- A. A handle to a widget's location in the widget tree (correct)
- B. A database connection
- C. A build configuration file
- D. A type of animation
What does a Future represent in Dart?
- A. A constant value
- B. A loop construct
- C. A value that will be available later (correct)
- D. A UI widget
What does Navigator.push() do?
- A. Removes all routes
- B. Adds a new route on top of the navigation stack (correct)
- C. Closes the app
- D. Reloads the current screen
Which widget provides basic Material Design layout such as appBar and body?
- A. Container
- B. Center
- C. Padding
- D. Scaffold (correct)
When is initState() called?
- A. On every rebuild
- B. When the widget is disposed
- C. Once, when the State object is inserted into the tree (correct)
- D. Only on hot restart
What is the difference between final and const in Dart?
- A. There is no difference
- B. const is a compile-time constant, final is assigned once at runtime (correct)
- C. final is compile-time, const is runtime
- D. const can be reassigned
What is an InheritedWidget used for?
- A. Efficiently passing data down the widget tree (correct)
- B. Making HTTP requests
- C. Creating animations
- D. Storing local files
Which three trees does Flutter use internally?
- A. Widget, State, View
- B. Model, View, Controller
- C. Widget, Element, RenderObject (correct)
- D. Component, Node, Layer
What is the purpose of Keys in Flutter?
- A. To encrypt widget data
- B. To preserve widget state and identity when widgets move in the tree (correct)
- C. To store API keys
- D. To speed up compilation
What are Isolates in Dart?
- A. Shared-memory threads
- B. Private class members
- C. Independent workers with their own memory that communicate by messages (correct)
- D. Database transactions
Which command creates a new Flutter project?
- A. flutter init my_app
- B. flutter create my_app (correct)
- C. dart new my_app
- D. flutter new my_app
Which command runs a Flutter app on a connected device?
- A. flutter run (correct)
- B. flutter start
- C. dart start
- D. flutter go
Which function is the entry point of a Flutter app?
- A. main() (correct)
- B. init()
- C. start()
- D. runApp() only
Which function attaches the root widget to the screen?
- A. startApp()
- B. attach()
- C. runApp() (correct)
- D. setRoot()
Which widget displays a line of text?
- A. Label
- B. TextView
- C. Text (correct)
- D. String
Which widget arranges children horizontally?
- A. Column
- B. Row (correct)
- C. Stack
- D. ListView
Which widget adds empty space around its child?
- A. Padding (correct)
- B. Gap only
- C. Space
- D. Margin
Which widget is a box that can have colour, size, padding and decoration?
- A. Container (correct)
- B. Panel
- C. Frame
- D. Box
Which widget shows an image from the internet?
- A. WebImage
- B. NetworkPicture
- C. Image.web
- D. Image.network (correct)
Which widget is a clickable Material button with a raised look?
- A. ClickButton
- B. RaisedText
- C. ElevatedButton (correct)
- D. PressButton
Which keyword declares a variable that cannot be reassigned in Dart?
- A. var
- B. dynamic
- C. let
- D. final (correct)
Which widget takes up the remaining space inside a Row or Column?
- A. Flexiblebox
- B. Spacer only with size
- C. Container
- D. Expanded (correct)
Which widget is used for the top bar in a Scaffold?
- A. AppBar (correct)
- B. TopBar
- C. Header
- D. NavBar
Which widget makes its child scroll if it is too tall?
- A. SingleChildScrollView (correct)
- B. ScrollBox
- C. OverflowView
- D. Scrollable only
Which Dart type stores text?
- A. char
- B. String (correct)
- C. str
- D. Text
What is the difference between StatelessWidget and StatefulWidget?
- A. They are identical
- B. A StatefulWidget has mutable State that can trigger rebuilds (correct)
- C. StatelessWidget can call setState
- D. StatefulWidget cannot have children
Which method must every widget class implement to describe its UI?
- A. build() (correct)
- B. render()
- C. paint()
- D. draw()
What does mainAxisAlignment control in a Column?
- A. Horizontal alignment
- B. Padding
- C. Vertical alignment of children (correct)
- D. Text style
What does crossAxisAlignment control in a Row?
- A. Horizontal alignment
- B. Scrolling
- C. The number of children
- D. Vertical alignment of children (correct)
Which widget reads user text input?
- A. InputBox
- B. TextInput
- C. TextField (correct)
- D. EditText
Which widget detects taps on any child widget?
- A. TouchListener
- B. TapView
- C. GestureDetector (correct)
- D. ClickArea
What does the const keyword before a widget constructor help with?
- A. Prevents user input
- B. Makes the widget invisible
- C. Reuses the widget instance and avoids unnecessary rebuilds (correct)
- D. Makes the widget stateful
Which Navigator method goes back to the previous screen?
- A. Navigator.exit(context)
- B. Navigator.back(context)
- C. Navigator.close(context)
- D. Navigator.pop(context) (correct)
Which widget builds UI from the result of a Future?
- A. LoaderWidget
- B. FutureBuilder (correct)
- C. PromiseBuilder
- D. AsyncWidget
Which widget rebuilds when a Stream emits new values?
- A. EventBuilder
- B. ListenerView
- C. StreamWidget
- D. StreamBuilder (correct)
What do the async and await keywords do in Dart?
- A. Let you write asynchronous code that waits for Futures (correct)
- B. Run code at compile time
- C. Create isolates
- D. Make code synchronous
What does the ?? operator do in Dart?
- A. Checks equality
- B. Casts a value
- C. Creates a list
- D. Returns the right side if the left side is null (correct)
Which file is the usual place to declare app assets like images?
- A. AndroidManifest.xml only
- B. pubspec.yaml (correct)
- C. main.dart
- D. assets.json
Which command downloads the packages listed in pubspec.yaml?
- A. flutter install
- B. flutter pub get (correct)
- C. dart download
- D. flutter packages build
What is the Provider package mainly used for?
- A. Networking only
- B. Database storage
- C. Animations
- D. State management and dependency injection (correct)
What does MediaQuery.of(context).size give you?
- A. The screen size (correct)
- B. The font size
- C. The widget's size
- D. The image size
Inside a Row, which widget lets its child use up to its share of free space without being forced to fill it?
- A. Flexible (correct)
- B. Spacer
- C. SizedBox
- D. Expanded
What does the Wrap widget do?
- A. Hides overflow
- B. Wraps text in quotes
- C. Moves children to a new line when they run out of space (correct)
- D. Adds a border
Which method is called when a State object is removed permanently?
- A. deactivate() only
- B. dispose() (correct)
- C. close()
- D. destroy()
Which Dart collection holds key-value pairs?
- A. Map (correct)
- B. Set
- C. Queue
- D. List
What is the difference between hot reload and hot restart?
- A. Hot restart resets app state; hot reload keeps it (correct)
- B. They are identical
- C. Hot reload resets state
- D. Hot restart only reloads CSS
What does a GlobalKey allow you to do?
- A. Speed up builds
- B. Make a widget global for all apps
- C. Encrypt data
- D. Access a widget's state or context from elsewhere (correct)
What does didChangeDependencies() respond to?
- A. Changes in inherited widgets the State depends on (correct)
- B. Disposal of the widget
- C. Every frame
- D. Network changes
What is the purpose of the late keyword in Dart?
- A. Running code asynchronously
- B. Declaring a non-nullable variable that will be initialized later (correct)
- C. Declaring a constant
- D. Delaying code execution
What does Dart's sound null safety guarantee?
- A. No variable can be null
- B. All variables are nullable
- C. Null checks are done at runtime only
- D. Non-nullable variables can never hold null at runtime (correct)
What does a RenderObject do in Flutter?
- A. Fetches data
- B. Handles navigation
- C. Handles layout and painting (correct)
- D. Stores app state
Which widget efficiently builds a scrollable grid lazily?
- A. Wrap
- B. GridView.builder (correct)
- C. GridView.count only
- D. Table
Which approach should you use for heavy CPU work so the UI stays smooth?
- A. Use setState more often
- B. Run it in a separate isolate, for example with compute() (correct)
- C. Use a StatelessWidget
- D. Increase the frame rate
Which Flutter tool helps you inspect the widget tree and performance?
- A. Chrome Lighthouse
- B. Xcode Instruments only
- C. Flutter DevTools (correct)
- D. Android Monitor only
What is the purpose of a Key when reordering list items with state?
- A. It speeds up scrolling only
- B. It lets Flutter match each item's State to the correct widget (correct)
- C. It encrypts list items
- D. It sorts the list
What does the mounted property of a State tell you?
- A. Whether the app is running
- B. Whether the widget is visible on screen
- C. Whether the State is still in the widget tree (correct)
- D. Whether data has loaded
What does AnimationController need to run animations in sync with the screen?
- A. A Future
- B. A GlobalKey
- C. A Stream
- D. A vsync (TickerProvider) (correct)