Skip to content

Providers are not allowed to modify other providers during their initialization. #729

Answered by buraktabn
buraktabn asked this question in Q&A
Discussion options

You must be logged in to vote

This was a dumb question.

I just did that in AreaOfExpertiseState.items like this:

static final items = StateProvider.autoDispose<Map<AreaOfExpertise, AreaOfExpertiseItem>>((ref) {
  final credentials = ref.watch(CacheController.provider).credentials;

  return {
    AreaOfExpertise.COUNTRY: AreaOfExpertiseItem(
      title: 'Country',
      areaOfExpertise: AreaOfExpertise.COUNTRY,
      subtitle: Utils.joinSafe(credentials?.countries, ','),
    ),
    AreaOfExpertise.PROVINCE: AreaOfExpertiseItem(
      title: 'Province',
      areaOfExpertise: AreaOfExpertise.PROVINCE,
      subtitle: Utils.joinSafe(credentials?.provinces, ','),
    ),
    AreaOfExpertise.AREAS: AreaOfExpertiseItem(
  …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by buraktabn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant