Flutter Basics Flashcards

1
Q

Material app

A

root app that’s required by most other widgets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

scaffold

A

screen layout widget that adds base styling and more

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What do you do with widgets?

A

Combine multiple widgets to build UI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

const is used

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Don’t need to remember when to add cons

A

the code editor will show blue squiggle lines to tell you to use const

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

To get a phrase to display on the app like “Hello World you need types

A

String and Object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

To get a number to display as a number you need types:

A

int, num, and Object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Colors lets you

A

access predefined colors ex. backgroundColor: Colors.deepPurple,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Color lets you

A

set RGB values for the color ex. backgroundColor: Color.fromARGB(255,47,5,120),

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

main function

A

will be executed automatically by dart when app is opened on a device

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

need 2 core widgets to get UI working:

A

MaterialApp and home

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

child: Center(
//says what will show
child: Text(‘Hello World!’)
),

A

says where to put the code in the scaffolding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

color gradients is listed in an

A

array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

how to get custom gradient locations

A

begin: Alignment.topLeft,
end: Alignment.bottomRight,

can also do Alignment(x,y) and add the coordinates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

text style formatting

A

Text(‘Hello World!’, style: TextStyle(
color: Colors.white,
fontSize: 28.0,
) )//TextStyle //Text

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to name classes

A

Should use camel case
Should describe what the class is about

17
Q

class format

A

class GradientContainer extends StatelessWidget {
@override
Widget build(context) {
return “Hello World”,
}
}

18
Q

classes can be stored

A

on same file or different file. different file needs to be imported

19
Q

new file name should be formatted…

A

all lower case and words separated by underscore ex. gradient_container

20
Q

cntrl + space

A

gives suggestions on vscode

21
Q

variable name format

A

starts with lower case ex. startAlignment

22
Q

if variable value does not change

A

use final instead of var to initiate it

23
Q

lists in dart can always be

A

edited

24
Q

format for an image widget

A

child:Image.asset(‘assets/image/dice-2.png’, width: 200,),
(if image is imported in .yaml folder)

25
Q

Stateful widget

A

allow us to manage state (data that may change) inside of them

26
Q

initState():Executed by Flutter when the StatefulWidget’s State object is

A

initialized

27
Q

build():Executed by Flutter when the Widget

A

is built for thefirst timeANDaftersetState()was called

28
Q
A