provider와 statenotifier의 활용

kbs·2023년 3월 9일
0

profilescreen

snapshot.data로 UsermodelBase를 받아옴.

userProfileProvider 화면에 갈 경우,

getProfile 함수 내에서

fianl userProfile = await authRepository.getProfile() 실행

authRepository.getProfile 내부에서는 auth-me에

api 쏘면서 받아온 json 값을 UserModel에 넣어줌

그 return 값을 받아서

다시 UserModel에 넣어줌.

0개의 댓글