Flutter Basics Flashcards
Material app
root app that’s required by most other widgets
scaffold
screen layout widget that adds base styling and more
What do you do with widgets?
Combine multiple widgets to build UI
const is used
will not create a second saved value if that widget is used again - lets dart reuse values and avoid duplication in memory to improve performance
Don’t need to remember when to add cons
the code editor will show blue squiggle lines to tell you to use const
To get a phrase to display on the app like “Hello World you need types
String and Object
To get a number to display as a number you need types:
int, num, and Object
Colors lets you
access predefined colors ex. backgroundColor: Colors.deepPurple,
Color lets you
set RGB values for the color ex. backgroundColor: Color.fromARGB(255,47,5,120),
main function
will be executed automatically by dart when app is opened on a device
need 2 core widgets to get UI working:
MaterialApp and home
child: Center(
//says what will show
child: Text(‘Hello World!’)
),
says where to put the code in the scaffolding
color gradients is listed in an
array
how to get custom gradient locations
begin: Alignment.topLeft,
end: Alignment.bottomRight,
can also do Alignment(x,y) and add the coordinates
text style formatting
Text(‘Hello World!’, style: TextStyle(
color: Colors.white,
fontSize: 28.0,
) )//TextStyle //Text