Floor Annotation Community
Floor-compatible annotations shared by floor_community and floor_generator_community.
The public annotation names are intentionally kept compatible with Floor so applications can migrate without rewriting entities, DAOs, database declarations, migrations, or type-converter annotations. Most applications should import package:floor_community/floor.dart, which re-exports this package.
Example
import 'package:floor_community/floor.dart';
@Entity(tableName: 'users')
class User {
@PrimaryKey(autoGenerate: true)
final int? id;
final String name;
const User({this.id, required this.name});
}
@dao
abstract class UserDao {
@Query('SELECT * FROM users')
Future<List<User>> findAll();
}
Both the class-style annotations (@Entity, @PrimaryKey) and Floor's constant shorthand annotations (@entity, @primaryKey, @dao, @insert, @update, @delete, @transaction) remain available where Floor originally provided them.
See the root MIGRATION.md for migration guidance.
Libraries
- floor_annotation
- Compatibility entrypoint matching Floor's annotation library filename.
- floor_annotation_community