DART Basics Flashcards
For what are variables?
To temporarily store data
For what are functions?
to execute code ‘on demand’
For what are types?
to analyse your code before you run/test it
assign a value to a var
=
how to name variables
camelCase
what is expected from a function
return
what you can input to functions
arguments
blueprint of an object
class
instance field/properties
class level variables
access class properties/methods
myself.name
function that dart will execute 1st
Main()
instantiate a class
Class()
classes also act as
types
where are arguments only available
inside function body {}
to make constructor method
repeat class name like class method without return type
does the constructor method take arguments
can, doesn’t have to
use of constructor method
individually configured instances of class
specify class level properties
this.name etc
adding more constructor methods
class.anyNameYouWant
when to use final
for values set in constructor that never change
named arguments
place inside {}
to call function with named arguments
argument : value
named arguments are
optional
how many times can you extend a class
once
to deliberately change a method of a base class
@override
types of variables
real, final, constant
compile time constant
const value
run time constant
final value
and
&&
or
||