AppBrewery - BMI Flashcards
theme
define a color palette
cookbook
https://flutter.dev/docs/cookbook for task examples
primary color
The background color for major parts of the app (toolbars, tab bars, etc)
accent color
The foreground color for widgets (knobs, text, overscroll edge effect, etc).
Color constructor
typical hexcode, ARGB, …
color for text in them
textTheme
how to change theme for local widget
wrap widget in Theme widget
ThemeData.dark().copyWith(…)
create a copy of this theme, but edit inner parameters
color of container is shorthand for setting
color of box decoration of container
DRY
Don’t Repeat Yourself
how to make a parameter required
add @required before parameter;
class ExampleClass {
bool isBool;
ExampleClass({@required this.isBool});
immutability
cannot be changed
a stless widget is mutable or immutable?
immutable
const v final
const figured out at compile time; final set only once
final could be set to final string currentTime = DateTime.now();
const could not
Dart class initializer order
- init list 2. constructor