BNMA w/ Flutter, by Udacity Flashcards
intro to Flutter
child property
exists only in objects that expect one child; e.g. container
children prop
exists in objects that expect multiple children
runApp()
function to run app
main()
in main.dart
, entry point into app
MaterialApp
basic widget for app which comes with title, home, theme, text directionality, back-button press handling, …
scaffold
drawers, app bars, bottom navigation, tabs, and floating action buttons
AppBar
bar at top of app
Text
text widget
Dart top level functions means
functions can exist outside classes
ColorSwatch
a color that has a swatch of related colors
IconData
a description of an icon fulfilled by a font glyph
crossAxisAlignment
How the children should be placed along the cross axis.
edgeInsets
An immutable set of offsets in each of the four cardinal directions.
Used by: Padding, a widget that accepts EdgeInsets to describe its margins.
Icon
A graphical icon widget drawn with a glyph from a font described in an IconData such as material’s predefined IconDatas in Icons.
Icons are not interactive. For an interactive icon, consider material’s IconButton.
There must be an ambient Directionality widget when using Icon. Typically this is introduced automatically by the WidgetsApp or MaterialApp.
This widget assumes that the rendered icon is squared. Non-squared icons may render incorrectly.
_var
A leading underscore character ( _ ) indicates that a member is private to its library. This is not mere convention, but is built into the language itself.
InkWell
A rectangular area of a Material that responds to touch; like touchable opacity
all layout is done with …
widgets
Route is…
a widget which takes you to a page or screen
use route where?
e.g. MaterialApp( home: CategoryRoute \_\_\_ CategoryRoute( Scaffold
ListView, GridView
efficiently show a grid/list of items
navigator widget
manages routes; push and pop routes to move from screen to screen
Navigator, detail
A widget that manages a set of child widgets with a stack discipline.
Many apps have a navigator near the top of their widget hierarchy in order to display their logical history using an Overlay with the most recently visited pages visually on top of the older pages. Using this pattern lets the navigator visually transition from one page to another by moving the widgets around in the overlay. Similarly, the navigator can be used to show a dialog by positioning the dialog widget above the current page
Navigator.of(context)
it’s most common to use the navigator created by a WidgetsApp or a MaterialApp widget. You can refer to that navigator with Navigator.of
MaterialPageRoute
A modal route that replaces the entire screen with a platform-adaptive transition.
parts of widgets:
StatelessWidget & StatefulWidget, constructor & ?
stateless: constructor -> build (loop)
stateful: constructor -> createState (loop)
when variables inside the state are modified, widget does or does not automatically re-render?
does not
how to get re-render with state change?
call setState from widget implementor, changing the state object associated with StatefulWidget
State<>
State<> is a widget class extended to create state objects for a StatefulWidget. _StatefulWidgetClassState extends State
widgets extending State inherit overrides for:
<ul>
<li>build, which describes the part of the user interface represented by this widget</li>
<li>setState, to notify the framework that the internal state of this object has changed</li>
<li>
</ul>
</li></ul>
widgets extending StatefulWidget inherit overrides for:
<ul>
<li>createElement</li>
<li>createState</li>
</ul>
State class property .widget; accessed inside extended State class via widget
, is what?
A State object’s configuration is the corresponding StatefulWidget instance
stateless -> stateful, what happens to build()?
moves from stateless class to state class
Theme used for?
Applies a theme to descendant widgets.
A theme describes the colors and typographic choices of an application.
e.g.
determine platform, and render widgets appropriately