Recall & Review
beginner
What is the purpose of the
Image.asset widget in Flutter?It displays an image stored locally in the app's assets folder. You must declare the image path in
pubspec.yaml to use it.Click to reveal answer
beginner
How do you display an image from the internet in Flutter?
Use the
Image.network widget and provide the image URL as a string.Click to reveal answer
intermediate
Why should you add a placeholder or error widget when using
Image.network?Because network images may take time to load or fail. Placeholders improve user experience by showing a temporary image or message.
Click to reveal answer
intermediate
What is the role of the
fit property in the Image widget?It controls how the image fits inside its container, for example,
BoxFit.cover fills the container while keeping aspect ratio.Click to reveal answer
beginner
How do you declare an image asset in Flutter's
pubspec.yaml file?Under the
flutter: section, add assets: and list the image file path(s) relative to the project root.Click to reveal answer
Which widget is used to display a local image asset in Flutter?
✗ Incorrect
Image.asset is for local assets. Image.network is for internet images.
What must you do before using an image asset in Flutter?
✗ Incorrect
You must declare image assets in pubspec.yaml so Flutter includes them in the app bundle.
Which property controls how an image fits inside its container?
✗ Incorrect
The fit property defines how the image scales and fits inside its box.
What happens if a network image fails to load in Flutter?
✗ Incorrect
You can provide an error widget to show if the network image fails to load.
Which widget would you use to show an image from a URL?
✗ Incorrect
Image.network loads images from the internet using a URL.
Explain how to display a local image asset in a Flutter app from start to finish.
Think about where the image lives and how Flutter knows about it.
You got /3 concepts.
Describe how to handle loading and error states when showing a network image in Flutter.
Consider user experience when internet is slow or unavailable.
You got /3 concepts.