NEW
Font size
WorksheetsFlutter Intermediate
Total questions: 10
Worksheet time: 6mins
Navigator.push() requires which parameters?
BuildContext and MaterialPageRoute
BuildContext and InternalRoute
MaterialPageRoute and ElevatedButton
BuildContext and RouteID
What is the order of these functions ?
createState() -> initState() -> build() -> dispose()
build() -> createState() -> initState() -> dispose()
dispose() -> initState() ->
build()
-> createState()
createState() -> initState() -> build() -> dispose()
setState() function is used to ?
setState() updates the value of a varible to the UI.
setState() changes the state of a variable that then gets reflected in the App
setState() calls the build() function of the Class again so that the UI is updated
All of these
How do you apply color to a widget?
color : Colors.blue
color : Colors.blueColor
color : blue
color : blue.Colors
Which of these is the correct way to fetch API response?
var data = http.get(url);
var data = await getHttp(url)
var data = await http.get(url);
var data = get awaitHttp(url)
Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
Can we request for current position without specifying the 'desiredAccuracy' parameter ?
Yes, it is optional
No, it is required.
var response = await http.get(url);
var data = response.body;
var name = data['name'];
Is this correct ? Consider the response code is 200 (OK)
Yes, JSON data can be accessed by specifying the key.
No, JSON is a list. It has to be accessed using an index.
Yes, data has been automatically parsed for JSON.
No, the received response has to be decoded for JSON.
padding : const EdgeInsets.all( variablePadding ),
Is this code correct ?
Yes, padding always requires a const keyword
No, the padding value is variable, const keyword is illegal here.
Yes, padding values are always constant.
No, const keyword can never be used with padding.
How do you achieve this layout?
(Text is center both horizontally and vertically)
Both these codes will achieve the desired UI.
None
MediaQuery.of(context).size.width
What does this code do?
Returns the width of the App Bar.
Returns the current width of the running widget.
Returns the maximum achievable width of the screen.
Returns the current width of the device screen.
