bizz84 / bizz84/localization_riverpod_flutter

Question: Is it possible to use riverpod_generator for appLocalizationsProvider?

Open
#8 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
48
Forks
6
PR merge metrics
No merged PRs in 30d

Description

First of all thank you for such a nice thing as `appLocalizationsProvider`. It's really convenient to use it.
But it turns out that I can't use riverpod_generator for this provider to supress warning: "Generated providers should only depend on other generated providers" without adding ignore for this rule :)

```
@Riverpod(keepAlive: true)
AppLocalizations appLocalizations(AppLocalizationsRef ref) {
...
return ref.state // A value of type 'dynamic' can't be returned from the function 'appLocalizations' because it has a return type of 'AppLocalizations'
}
```

Even if I make something like that: `return ref.state as AppLocalizations`

generated code still uses dynamic :(

```
@ProviderFor(appLocalizations)
final appLocalizationsProvider = Provider.internal ...
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.