payload: {"action":"created","issue":{"url":"https://api.github.com/repos/rrousselGit/provider/issues/190","repository_url":"https://api.github.com/repos/rrousselGit/provider","labels_url":"https://api.github.com/repos/rrousselGit/provider/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/rrousselGit/provider/issues/190/comments","events_url":"https://api.github.com/repos/rrousselGit/provider/issues/190/events","html_url":"https://github.com/rrousselGit/provider/issues/190","id":478186468,"node_id":"MDU6SXNzdWU0NzgxODY0Njg=","number":190,"title":"Add documentation on using Provider inside initState()","user":{"login":"feinstein","id":8120472,"node_id":"MDQ6VXNlcjgxMjA0NzI=","avatar_url":"https://avatars1.githubusercontent.com/u/8120472?v=4","gravatar_id":"","url":"https://api.github.com/users/feinstein","html_url":"https://github.com/feinstein","followers_url":"https://api.github.com/users/feinstein/followers","following_url":"https://api.github.com/users/feinstein/following{/other_user}","gists_url":"https://api.github.com/users/feinstein/gists{/gist_id}","starred_url":"https://api.github.com/users/feinstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feinstein/subscriptions","organizations_url":"https://api.github.com/users/feinstein/orgs","repos_url":"https://api.github.com/users/feinstein/repos","events_url":"https://api.github.com/users/feinstein/events{/privacy}","received_events_url":"https://api.github.com/users/feinstein/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-08-07T23:48:16Z","updated_at":"2019-09-03T08:12:04Z","closed_at":null,"author_association":"NONE","body":"I was initializing a variable inside `initState()` and so I used `Provider` to inject a dependency, but then I got an Exception explaining that `inheritFromWidgetOfExactType(InheritedProvider<T>)` or `inheritFromElement()` can't be called before `initState()` completed.\r\n\r\nThis error exposes the inner workings of `Provider` and the docs here should explain that this shouldn't be done and a recommendation on how to proceed (or even better, throw an exception inside `Provider` with a message explaining how to fix this and why it's an error)."},"comment":{"url":"https://api.github.com/repos/rrousselGit/provider/issues/comments/527353966","html_url":"https://github.com/rrousselGit/provider/issues/190#issuecomment-527353966","issue_url":"https://api.github.com/repos/rrousselGit/provider/issues/190","id":527353966,"node_id":"MDEyOklzc3VlQ29tbWVudDUyNzM1Mzk2Ng==","user":{"login":"madqueendany","id":47292665,"node_id":"MDQ6VXNlcjQ3MjkyNjY1","avatar_url":"https://avatars0.githubusercontent.com/u/47292665?v=4","gravatar_id":"","url":"https://api.github.com/users/madqueendany","html_url":"https://github.com/madqueendany","followers_url":"https://api.github.com/users/madqueendany/followers","following_url":"https://api.github.com/users/madqueendany/following{/other_user}","gists_url":"https://api.github.com/users/madqueendany/gists{/gist_id}","starred_url":"https://api.github.com/users/madqueendany/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madqueendany/subscriptions","organizations_url":"https://api.github.com/users/madqueendany/orgs","repos_url":"https://api.github.com/users/madqueendany/repos","events_url":"https://api.github.com/users/madqueendany/events{/privacy}","received_events_url":"https://api.github.com/users/madqueendany/received_events","type":"User","site_admin":false},"created_at":"2019-09-03T08:12:04Z","updated_at":"2019-09-03T08:12:04Z","author_association":"NONE","body":"Yeah I encountered this behavior as well.\r\n\r\nI worked around it by passing the provider to a stateful widget and accessing it on the `initState` via \r\n\r\n```\r\n  dynamic myData = widget.myProvider.myData;\r\n```\r\n\r\nI'm curious to see your approach."}}
other: {"actor":{"display_login":"madqueendany"}}