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 riverpod state that store List of String always reset its value?

I have built this riverpod state: import "package:riverpod_annotation/riverpod_annotation.dart"; part "form_state.g.dart"; @riverpod class FormState extends _$FormState { @override List<String?> build() { ref.listenSelf((previous, next) { log("previous: $previous, next: $next", name: "FORMSTATE 0"); }); return List.filled(10, null); } void change(int index, String value)…

VIEW QUESTION
Back To Top
Search