Overview
Floor Annotation is a foundational package for Flutter applications that provides type-safe, reactive, and lightweight SQLite database abstractions. It enables developers to define database entities and DAOs using annotations, ensuring compile-time safety and reducing boilerplate. While it serves as a core component of the Floor ecosystem, it should not be used directly—developers should instead import the main `floor` package. This package supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux, making it ideal for cross-platform data persistence needs.
Use cases
- Database entity definition
- Reactive data queries
- Cross-platform app data storage
- Type-safe SQL operations
- Offline-first application development
Key features
- Annotation-based database modeling
- Compile-time SQL validation
- Reactive query streams
- Multi-platform support
- Lightweight dependency
Suitable for
- Flutter apps requiring local database storage
- Developers seeking type safety in SQL operations
- Projects with offline data synchronization
- Apps targeting multiple operating systems
- Teams preferring code generation over manual SQL
Considerations
- Must be used with the floor package
- Requires code generation step
- Not suitable for direct use without floor integration
- Limited to SQLite backend
- Dependent on build_runner for generation