Will StateProvider be available soon in riverpod_generator? #2239
-
Everything is in the title, just say yes and give a date 😂 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
There is no plan for including one. |
Beta Was this translation helpful? Give feedback.
-
Could you explain why? Technically not possible, or the StateProvider is intended to disappear? I was asking this because I have some lints |
Beta Was this translation helpful? Give feedback.
-
There is a package to generated the equivalent of the https://pub.dev/packages/riverpod_state_provider_annotation # main.dart
import 'package:riverpod_state_provider_annotation/riverpod_state_provider_annotation.dart';
part 'main.g.dart';
part 'main.rsp.dart';
@RiverpodStateProvider()
int myState() {
return 0;
}
ref.watch(myStateProvider);
ref.read(myStateProvider.notifier).state++;
ref.read(myStateProvider.notifier).update((state) => state + 1);
ProviderScope(
overrides: [
myStateProvider.overrideWithValue(10),
],
) It still has some limitations but for simple usages (usually the case for |
Beta Was this translation helpful? Give feedback.
There is no plan for including one.