inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

GetX 기반 Flutter 앱 만들기

홈 화면 만들기

PageTransition 적용 후 뷰 적용 되지 않는 문제가 있습니다.

해결된 질문

196

Gavin

작성한 질문수 1

0

아래와 같이 작성후 navbar 버튼을 클릭해도 타이틀은 변경되지만, 화면 변경이 안됩니다.

 return Scaffold(
      appBar: AppBar(
        title: Obx(() => Text(controller.title.value)),
      ),
      body: SafeArea(
        child: PageTransitionSwitcher(
            transitionBuilder: (Widget child, Animation<double> anim,
                Animation<double> secondAnim) {
              return FadeThroughTransition(
                animation: secondAnim,
                secondaryAnimation: secondAnim,
                child: child,
              );
            },
            child:
                Obx(() => RouteInfo.navBarPages[controller.navBarIdx.value])),
      ),
      bottomNavigationBar: Obx(() => NavigationBar(
            selectedIndex: controller.navBarIdx.value,
            onDestinationSelected: controller.onChangeNavBar,
            destinations: [
              NavigationDestination(
                icon: const Icon(Icons.home_filled),
                label: 'navBar.home'.tr,
              ),
              NavigationDestination(
                icon: const Icon(Icons.list_alt),
                label: 'navBar.post'.tr,
              ),
              NavigationDestination(
                icon: const Icon(Icons.photo),
                label: 'navBar.photo'.tr,
              ),
            ],
          )),
    );

flutter getx

답변 1

0

Sirius B

안녕하세요 Gavin님,

시리우스 B입니다.

저의 강의를 수강해 주셔서 정말 감사합니다!


작성해주신 코드에 오타가 하나 있어서 안되는 것 같습니다.

FadeThroughTransition

animation: secondAnim 부분을

animation: anim 으로 고치면 정상적으로 화면 전환이 될 것으로 보입니다.


작성해주신 코드의 해당 부분이 secondaryAnimation 항목과 같아서 문제가 생긴 것으로 보여요.

한번 해보시고 그래도 안 되면, 다시 한번 문의 주시기 바랍니다.

감사합니다!

 

[반영된 코드]

return Scaffold(
      appBar: AppBar(
        title: Obx(() => Text(controller.title.value)),
      ),
      body: SafeArea(
        child: PageTransitionSwitcher(
            transitionBuilder: (Widget child, Animation<double> anim,
                Animation<double> secondAnim) {
              return FadeThroughTransition(
                animation: anim,
                secondaryAnimation: secondAnim,
                child: child,
              );
            },
            child:
                Obx(() => RouteInfo.navBarPages[controller.navBarIdx.value])),
      ),
      bottomNavigationBar: Obx(() => NavigationBar(
            selectedIndex: controller.navBarIdx.value,
            onDestinationSelected: controller.onChangeNavBar,
            destinations: [
              NavigationDestination(
                icon: const Icon(Icons.home_filled),
                label: 'navBar.home'.tr,
              ),
              NavigationDestination(
                icon: const Icon(Icons.list_alt),
                label: 'navBar.post'.tr,
              ),
              NavigationDestination(
                icon: const Icon(Icons.photo),
                label: 'navBar.photo'.tr,
              ),
            ],
          )),
    );

0

Gavin

감사합니다. 오타였엇네요.

Node 관련 질문입니다

0

21

3

구글 소셜 로그인 후 로그인 시 구글에러

0

25

2

실습중(개인 비용 관리 앱) 문의드려요

0

41

2

6강에 비디오가 이상해요

0

20

1

Isar 마지막 업데이트는 2년전입니다.

0

28

0

Chat GPT API 설정하기 프롬프트

0

45

2

FlutterSecureStorage 질문

0

27

0

구글 플레이 등록 시, Privact Policy URL 등록 팁

0

39

1

질문있습니다!

0

17

0

2-8강 Websocket server running on port가 안 뜹니다.

0

40

2

video_call 플러그인 설치후 에러 발생

0

42

1

회차마다 있는 실습

1

38

2

계정 관련 문의

0

47

2

구글 플레이스토어 배포시 테스트 요건

1

68

2

수강 기한 연장 요청드려도될까요..

1

48

2

화면이 안 나옵니다. 소리만 나와요

0

54

2

추가 강의 문의

0

48

1

vs code IDE

0

77

2

model, viewmodel

0

160

1

material theme

0

199

1

강의자료는 어디서 다운 받나요?

0

385

2

route의 pages

0

558

3

onChangeNavBar 질문

0

286

1

라우트 명은 어떻게 지정하나요?

0

363

1