인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

김상호's profile image
김상호

asked

[Code Factory] [Intermediate] Flutter Real Practice! State Management, Cache Management, Code Generation, GoRouter, Authentication Logic, etc. Essential Skills to Become an Intermediate!

Applying GoRouter

GoRoute List 위치 질문입니다.

Written on

·

411

0

List<GoRoute> 를 go_router.dart가 아닌 auth_provider.dart에 넣은 이유가 있을까요?

작동은 잘 되지만 코드가 헷갈릴 때가 있어 질문드립니다.

라우터 관련 코드들은 go_router에 넣으면 가독성이 더 편해질 것 같은데 auth_provider에 넣은 이유가 있을까요??

flutter하이브리드-앱

Answer 1

0

codefactory님의 프로필 이미지
codefactory
Instructor

안녕하세요!

routes를 불러오는 routerProvider에서 AuthProvider만 불러오면 파라미터 완성이 되도록 하기 위함이었습니다.

말씀하신대로 go_router.dart에 선언하는게 편할 것 같다면 거기에 선언하셔도 괜찮습니다.

감사합니다!

김상호's profile image
김상호

asked

Ask a question