Skip to content

Database sharing across multiple Flutter Packages #3054

Answered by simolus3
jvivasb20 asked this question in Q&A
Discussion options

You must be logged in to vote

If you need multiple parts of the database to be defined in different packages and then have multiple apps using different database components, I suggest using modular code generation. By default, drift only generates code next to database classes but you can make it generate code across a range of input files (e.g. next to table-defining sources and so on).

You'll have to make minor adjustments in your imports after enabling modular code generation since the generated code then lives in different files, but it should enable modular setups across packages.

Replies: 1 comment

Comment options

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