Reputation: 464
I'm trying to use DeferredComponents for my flutter apps so that I can have some AOT compiled code as runtime downloadble module, described in DeferredComponents wiki here. I've looked for some examples and found the Flutter Gallery repository on how to implement it.
From those two source I found that we still have a base app, that will hold the main.dart file as an entrypoint to our app and load all of the deferred apps once it's called from .loadLibrary()
function. Hence, in this case, we will only have one entrypoint (main.dart).
I hypothesize that DeferredComponent can act as an independent library/package (since we can have our own MaterialApp) which I also assume that we can have our own integration layer (api client).
The problem is, I want my class to be injected meanwhile we can only initialize injection from main.dart,. Is this something that is possible to do within DeferredComponent? Is there any workaround to enable dependency injection in DeferredComponent?
Thanks in advance, pls correct me if there is any misconception.
Upvotes: 1
Views: 309