강의

멘토링

커뮤니티

Inflearn Community Q&A

zladb's profile image
zladb

asked

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

Working with the PaginationListView Widget

StateNotifierProvider 관련

Written on

·

288

0

강의 3:53초에 StateNotifierProvider의 제네릭에 <PaginationProvider, CursorPaginationBase>를 넣으셨는데 왜 PaginationProvider를 넣으셨는지 이해가 안돼요.

 

레스토랑 프로바이더 부분에서는 첫번째 제네릭으로 RestaurantStateNotifier가 들어가는데, ListView 일반화하는 코드에서도 Provider가 아니라 Notifier가 들어가야 하지 않나요???

final restaurantProvider =
    StateNotifierProvider<RestaurantStateNotifier, CursorPaginationBase>(
  (ref) {
    final repository = ref.watch(restaurantRepositoryProvider);
    final notifier = RestaurantStateNotifier(repository: repository);
    return notifier;
  },
);

flutter하이브리드-앱

Answer 1

0

codefactory님의 프로필 이미지
codefactory
Instructor

안녕하세요!

PaginationProvider는 StateNotifier를 extend 하고 있으니 StateNotifier가 맞습니다.

질문에대한 대답이 맞을까요?

만약 아니라면 다시 답변 달아주세요!

감사합니다!

zladb's profile image
zladb

asked

Ask a question