0
0
Fluttermobile~5 mins

Image widget (asset, network) in Flutter - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AImage.asset
BImage.network
CImage.file
DImage.memory
What must you do before using an image asset in Flutter?
ANothing special
BUpload it to a server
CDeclare it in <code>pubspec.yaml</code>
DConvert it to base64
Which property controls how an image fits inside its container?
Aalignment
Bfit
Cscale
Drepeat
What happens if a network image fails to load in Flutter?
AAn error widget can be shown if provided
BNothing is shown by default
CThe app crashes
DThe image asset is shown instead
Which widget would you use to show an image from a URL?
AImage.memory
BImage.asset
CImage.file
DImage.network
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.