Flutter

Navigation & Routing

Navigator 1.0/2.0, routes, MaterialPageRoute, Router API, go_router, deep linking, named routes

22 면접 질문·
Mid-Level
1

Which method should be used to navigate to a new screen with Navigator 1.0?

답변

Navigator.push() adds a new route to the navigation stack, allowing navigation to a new screen while keeping the previous screen in the stack. This method takes context and a Route (usually MaterialPageRoute) as parameters. Push stacks the new route, while pop removes it from the stack.

2

What does Navigator.pop() return when sending data back to the previous screen?

답변

Navigator.pop() can take an optional argument that will be returned to the previous screen via the Future returned by Navigator.push(). This allows sending a result (confirmation, selection, modified data) back to the screen that initiated navigation. Use await with push() to retrieve this result.

3

What is the role of MaterialPageRoute in Flutter navigation?

답변

MaterialPageRoute is a route that uses Material Design transitions (slide from right on iOS, fade on Android). It takes a builder that returns the destination widget. It automatically handles transition animations and respects platform conventions for a native user experience.

4

How to define named routes in a Flutter application?

5

What is the difference between Navigator.pushReplacement() and Navigator.push()?

+19 면접 질문

다음 면접을 위해 Flutter을 마스터하세요

모든 질문, flashcards, 기술 테스트, 코드 리뷰 연습, 면접 시뮬레이터에 접근하세요.

무료로 시작하기