of static method

Retrieves the nearest FeedbackRepository from the widget tree.

Returns null if no FeedbackRepoProvider is found in the widget tree.

This is the primary way to access feedback functionality from anywhere in your app once it's wrapped with FeedbackWrapper.

Example:

void _onUserSuccess() {
  FeedbackRepoProvider.of(context)?.addCounterAndCheck('success_action_5');
}

Implementation

static FeedbackRepository? of(BuildContext context) {
  return context
      .dependOnInheritedWidgetOfExactType<FeedbackRepoProvider>()
      ?.feedbackRepository;
}