You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create an injectable flutter tool customization mechanism #16204
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
tvolkert commentedon Apr 4, 2018
You want to use
AppContext:flutter/packages/flutter_tools/lib/src/base/context.dart
Line 47 in b8629ba
You'd create some abstraction for whatever behavior you want to be swappable, then inject a default implementation of that abstraction here:
flutter/packages/flutter_tools/lib/src/context_runner.dart
Line 45 in b8629ba
Then vendors (or different places in
flutter_tools) could callcontext.run(overrides: ...)to override the behavior provided by the abstraction.We do this already for things like
Artifacts(orFileSystemin tests).xster commentedon Apr 4, 2018
Where would the vendor injection code live? In a different google_flutter_tools repo?
tvolkert commentedon Apr 4, 2018
It's up to the vendor. Within Google, we have a shim
main()that calls intoflutter_tools::main()within an overridden context.tvolkert commentedon Dec 19, 2018
Closing as a dup of #25377
github-actions commentedon Aug 31, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.