skip to Main Content

Flutter – Riverpod annotation for State Provider

I am new to Riverpod. I am using Riverpod Annotation to generate providers. As for Future Provider, I did it like this. @riverpod Future<void> login(LoginRef ref) async { final login = sl<LoginUsecase>(); final saveAuth = sl<SaveAuthUsecase>(); final loginForm = ref.read(loginFormProvider);…

VIEW QUESTION

Flutter – Why does Riverod generator not generate an AsyncNotifier in this case?

I want to generate an AsyncNotifier that takes one argument on build: @riverpod class ListController extends _$ListController { late ServiceOne _serviceOne; late ServiceTwo _serviceTwo; @override Future<List<ItemModel>> build(ListModel List) { _serviceOne = ref.read(serviceOneServiceProvider); _serviceTwo = ref.read(serviceTwoServiceProvider); return _fetchListItems(list); } /// A…

VIEW QUESTION
Back To Top
Search