Using drift with an existing database
For a full example of a cross-platform Flutter app using drift following best practices, see app example in drift's repository. For interested users wanting to take a look at how to use drift in a Flutter app with a modern architecture, this is perhaps the best example to use as a starting point.
Drift's repository also contains a number of smaller examples showcasing select drift features:
The encryption example contains a simple Flutter app using an encrypted drift database, powered by the
Another example shows how to use drift-generated code in other builders (here,
Additional examples from our awesome community are available as well:
- The clean architecture example app written by Rody Davis shows how to use drift in a more complex architecture.
- Abdelrahman Mostafa Elmarakby wrote an animated version of the todo app available here.
- Abdelrahman Mostafa Elmarakby wrote an hotel booking app with GetX version with diffrent relationships available here.
- The HackerNews reader app from the Boring Flutter Show also uses drift to keep a list of favorite articles.
If you too have an open-source application using drift, feel free to reach out and have it added to this list!
If you are interested in seeing more drift examples, or want to contribute more examples yourself, don't hesitate to open an issue either. Providing more up-to-date examples would be a much appreciated contribution!
Additional patterns are also shown and explained on this website:
An example that models a shopping cart system with drift.