UNIT 2: FLUTTER Flashcards
- compiled, statically typed, object oriented, procedural programming language
- very mainstream structure much like other OO languages, making it easy to pick up folks who have experience with Java, C++, C#
- add some features that developers in those other languages would not expect but are very cool nonetheless
Dart
can store any data type; data type can change anytime
dynamic
data type is inferred from the value on the right side “=”
var
variable once set, cannot be reassigned
final
value set at compile time, not run time
const
variables are initialized to null
- int x
- double y
- bool z
- string s
- dynamic d
the process of inserting variable values into placeholders in a string literal. To concatenate strings in Dart, we can utilize string interpolation. We use the ${} symbol to implement string interpolation in your code.
String interpolation $
multiline strings
create using “””
spread elements into the array
spread operator …
they can be passed down like data, returned from a function, passed into a function as a parameter or set to equal a variable
functions are first-class objects
function that returns a value in one line of code
Big arrow
=>
sendEmail(‘ceo@blue.company’,’Pop’);
to
sendEmail(subject:’Pop’, atAddress: ‘ceo@blue.company’);
named function parameters
Person p = Person();
ommit “new” and “this”
shorter way of dart classess which rceive paramaters
class constructor parameter firsthand
all members of dart are what in default
public
return to this class but before you do, do something with a return method
cascading operator
(..)
Person.withName
Named constrcutor example
foundational widgets are the building blocks of everything we create - 160 of them
flutter
- certain widgets may hold value that came from storage, internet, or user themselves
- display value to the user and get value from the user into the app
value widget
* CheckBox
* Icon
* IconButton
gives controls in the making scene of layout properly
layout widget
* Card
* Center
* Column
when your screen has multiple scenes, you’ll need a way to move them
navigation widget
* TabBar
* TabBarView
* MaterialApp
not all widgets fall in the neat category, these are the miscellaneous widgets
other widgets
* theme
* transform
* transition
Flutter’s excellent architechture was influenced from
React
shows the tiny copy of all the widgets in the screen
element tree