Flutter

Flutter Fundamentals

Widgets, StatelessWidget, StatefulWidget, widget tree, build method, hot reload

18 perguntas de entrevistaยท
Junior
1

What is a widget in Flutter?

Resposta

In Flutter, everything is a widget. A widget is an immutable description of part of the user interface. Widgets describe what their view should look like given their current configuration and state. Flutter uses these descriptions to build the element tree that manages the on-screen rendering.

2

What is the main difference between StatelessWidget and StatefulWidget?

Resposta

A StatelessWidget is immutable and cannot change after creation. It is used for UI elements that do not change dynamically. A StatefulWidget can maintain mutable state through an associated State object, allowing the UI to rebuild in response to state changes.

3

Which method must be implemented in every widget to define its user interface?

Resposta

The build() method is mandatory in all Flutter widgets. It receives a BuildContext as a parameter and returns a Widget that describes the user interface. This method is called whenever the framework needs to rebuild the widget, for example after a setState() call in a StatefulWidget.

4

What is the widget tree in Flutter?

5

What is the difference between hot reload and hot restart in Flutter?

+15 perguntas de entrevista

Domine Flutter para sua proxima entrevista

Acesse todas as perguntas, flashcards, testes tecnicos, exercicios de code review e simuladores de entrevista.

Comece gratis