UNIT 4 Flashcards
components that make up a flutter application
widgets
when part of user interface u are describing does not depend on anything other than configuration
stateless
data within the widget that can change during its lifetime
state
widget’s value needs to be updated by typing into textfield
stateful widget
every widget build method which receives a BuildContext and returns a single Flutter Widget
widget build function
display string to the screen
text widget
- flutter comes with built-in set of icons
Icon(
Icons.cake,
color: Colors.red,
size: 200,
)
icon widget
display image on flutter
image widget
put image in project file folder and edit in pubspec.yam
Image.asset(‘ ‘)
embedded images
image fetched from internet via HTTP
Network Image
Image.network(‘URL’)
flutter layout engine will shrink image in a container but not grow in it
BoxFit
image is stretched in both height and width exactly; distort image
fill
shrink or grow until space is filled but image is cropped
cover
make height fit exactly; add extrea width space
fitHeight
make width fit exactly; clip height or add extra space
fitWidth
shrink both height and width to fit; add space on both
contain
fit: BoxtFit.contain
textfield syntax
TextField(
OnChanged: (String val) => searchTerm = val