Skip to content

Instantly share code, notes, and snippets.

@Vanethos
Last active April 12, 2019 07:33
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 Vanethos/fee1ad1ce24e3304728a44244c6cc2fc to your computer and use it in GitHub Desktop.
Save Vanethos/fee1ad1ce24e3304728a44244c6cc2fc to your computer and use it in GitHub Desktop.
class InjectorWidget extends InheritedWidget {
//...
void init() async {
// this can be an access to the SharedPreferences, for example
var token = await getToken();
var httpClient = HttpClient(token);
_endpointA = EndpointsA(httpClient);
_endpointB = EndpointsB(httpClient);
_homeBloc = HomeBloc(endpointA, endpointB);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment