Flutter Prague #5

Flutter Prague #5

Professional Development

6 Qs

quiz-placeholder

Similar activities

Abstract Class #1

Abstract Class #1

Professional Development

10 Qs

java

java

Professional Development

10 Qs

Form - Input

Form - Input

Professional Development

10 Qs

dinesh

dinesh

University - Professional Development

10 Qs

Streams

Streams

Professional Development

10 Qs

JAVA MS3

JAVA MS3

Professional Development

10 Qs

PBO

PBO

Professional Development

10 Qs

IT ENGLISH: Research Project Topics - Docker vs Kubernetes

IT ENGLISH: Research Project Topics - Docker vs Kubernetes

Professional Development

10 Qs

Flutter Prague #5

Flutter Prague #5

Assessment

Quiz

Computers

Professional Development

Medium

Created by

Honza Bittner

Used 2+ times

FREE Resource

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

What does the following code do in Flutter?

Creates a container with a width of 100, a height of 200 and a blue color

Causes a compilation error

Creates an empty widget without any effect

Throws a runtime exception

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

What is the difference between final x = ...; and late final x = ...; in Dart?

final requires immediate initialization, while late final allows initialization only on first use if the value is not assigned immediately

late final cannot be initialized on declaration

late final must be initialized explicitly by a function

late final allows you to change the value once, while final does not

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What happens when you call setState() within StatelessWidget?

Causes a runtime or compilation error because StatelessWidget does not have a setState method

Revives the widget because all widgets can have a state

It does nothing because StatelessWidget has no state

Forces Flutter to rebuild the widget tree

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

Consider the following code:

The code fails to compile

The code runs successfully

The code compiles, but it throws a runtime exception

Answer explanation

Media Image

Feature: Statically checked declaration-site variance
https://github.com/dart-lang/language/issues/524

covariance: safe for reading (current Dart)

contravariance: safe for writing

invariance: safe for both reading and writing

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

Consider the following code, after calling foo() :

It prints "Caught an error: Exception: oopsie"

Throws a runtime exception

The code does not compile

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

Consider the following code, after calling foo() :

It prints "Caught an error: Exception: oopsie"

Throws a runtime exception

The code does not compile