Override FutureProvider
with AsyncValue
#1978
-
Before class TestView extends HookConsumerWidget {
const TestView({
super.key,
});
@override
Widget build(BuildContext context, WidgetRef ref) {
final notifier = useState(const AsyncLoading<TestData>());
return Column(children: [
HookBuilder(builder: (context) => ProviderScope(
overrides: [
dataFutureProvider.overrideWithValue(notifier.value), // `dataFutureProvider` providers data to `View`.
],
child: View(),
)),
ViewController(notifier: notifier),
]);
}
}
I can simply control the loading state of |
Beta Was this translation helpful? Give feedback.
Answered by
rrousselGit
Dec 5, 2022
Replies: 1 comment 4 replies
-
This was temporarily removed and will be added back later |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
khwgit
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was temporarily removed and will be added back later