Skip to content

Instantly share code, notes, and snippets.

@daiki1003
Last active October 2, 2022 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daiki1003/fabe865c43aac3033ff5e742c6ca44aa to your computer and use it in GitHub Desktop.
Save daiki1003/fabe865c43aac3033ff5e742c6ca44aa to your computer and use it in GitHub Desktop.
final someRepositoryProvider = Provider(
(ref) => SomeRepository(ref.read),
);
class SomeRepository {
const SomeRepository(this._read);
final Ref _ref;
Future<void> fetch() async {
final response = _ref.read(dioProvider).get(...);
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment