본문 바로가기

[flutter] beamer update에 따른 state.pathBlueprintSegments 변경

ironwhale 2022. 2. 27.

강의 버전과 현재버전이 달라 생기는 문제점 

코딩 파파 님의 당근 마켓 클론강의를 수강하다보면 아무래도 패키지의 업데이트에 따라 변경된 부분이 발생합니다. 

일단 강의와 같은 버전으로 공부하고 추후 코딩파파 님께서 업데이트를 해주신다고 하시기는 했는데

코딩파파님의 강의 들으면서 문제해결 방법도 어느정도 알려주셔서 이번 문제도 제가 한번 해결 해보려고 했습니다. 

 


업데이트 후 없어진 beamer(^0.14.1) state.pathBlueprintSegments 어디에??

강좌에서는 분명 'state.pathBlueprintSegments' 라고 했는데 저한테는 안뜨더 군요. 이곳 저것에 알아보니 1.0.0 버전 업데이트 후 이름이 변경 되었다고 나오네요

근데 BeamPage 부분의 state도 RouteInformationSerializable state으로 변경 되었더군요

 


"일단 이것저것 눌러보자 나온 답"

state.pathBlueprintSegments.contains() 

이것이 아래와 같이 변경 되었습니다. 

 

state.toRouteInformation().location!.contains("category_input")

List<BeamPage> buildPages(
      BuildContext context, RouteInformationSerializable state) {
    return [
      ...HomeLocation().buildPages(context, state),
      if (state.toRouteInformation().location!.contains("input"))
        BeamPage(key: ValueKey('input'), child: InputScreen()),
      if (state.toRouteInformation().location!.contains("category_input"))
        BeamPage(key: ValueKey('category_input'), child: CategoryInputScreen())
    ];
  }

 

 

 

댓글