Flutter

Flutter Fundamentals

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

18 面接問題·
Junior
1

What is a widget in Flutter?

回答

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?

回答

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?

回答

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 面接問題

次の面接に向けてFlutterをマスター

すべての問題、flashcards、技術テスト、コードレビュー演習、面接シミュレーターにアクセス。

無料で始める