wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Flutter Intermediate

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

Navigator.push() requires which parameters?

a)

BuildContext and MaterialPageRoute

b)

BuildContext and InternalRoute

c)

MaterialPageRoute and ElevatedButton

d)

BuildContext and RouteID

2.

What is the order of these functions ?

a)

createState() -> initState() -> build() -> dispose()

b)

build() -> createState() -> initState() -> dispose()

c)

dispose() -> initState() ->

build()

-> createState()

d)

createState() -> initState() -> build() -> dispose()

3.

setState() function is used to ?

a)

setState() updates the value of a varible to the UI.

b)

setState() changes the state of a variable that then gets reflected in the App

c)

setState() calls the build() function of the Class again so that the UI is updated

d)

All of these

4.

How do you apply color to a widget?

a)

color : Colors.blue

b)

color : Colors.blueColor

c)

color : blue

d)

color : blue.Colors

5.

Which of these is the correct way to fetch API response?

a)

var data = http.get(url);

b)

var data = await getHttp(url)

c)

var data = await http.get(url);

d)

var data = get awaitHttp(url)

6.

Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);

Can we request for current position without specifying the 'desiredAccuracy' parameter ?

a)

Yes, it is optional

b)

No, it is required.

7.

var response = await http.get(url);

var data = response.body;

var name = data['name'];

Is this correct ? Consider the response code is 200 (OK)

a)

Yes, JSON data can be accessed by specifying the key.

b)

No, JSON is a list. It has to be accessed using an index.

c)

Yes, data has been automatically parsed for JSON.

d)

No, the received response has to be decoded for JSON.

8.

padding : const EdgeInsets.all( variablePadding ),

Is this code correct ?

a)

Yes, padding always requires a const keyword

b)

No, the padding value is variable, const keyword is illegal here.

c)

Yes, padding values are always constant.

d)

No, const keyword can never be used with padding.

9.

How do you achieve this layout?

(Text is center both horizontally and vertically)

a)
b)
c)

Both these codes will achieve the desired UI.

d)

None

10.

MediaQuery.of(context).size.width

What does this code do?

a)

Returns the width of the App Bar.

b)

Returns the current width of the running widget.

c)

Returns the maximum achievable width of the screen.

d)

Returns the current width of the device screen.