wasabeef / flutter-architecture-blueprints

Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to developing Flutter apps.
MIT License
1.61k stars 261 forks source link

fix: DON'T CALL READ INSIDE THE BODY OF A PROVIDER #73

Closed gomazaba closed 3 years ago

gomazaba commented 3 years ago

What does this change?

riverpod 公式のドキュメントの以下の項によると https://riverpod.dev/docs/concepts/combining_providers#can-i-read-a-provider-without-listening-to-it

final myProvider = Provider((ref) {
  // Bad practice to call `read` here
  final value = ref.read(anotherProvider);
});

Provider 内で 別 Provider を読み込むのは Bad practice とのことなので修正しました。

wasabeef commented 3 years ago

@gomazaba Thanks!