Skip to content
pubscout

floor

1.5.0, released 3 years ago by pinch.nl

A SQLite abstraction library for Flutter inspired by Room.

Quiet but busy
$ flutter pub add floor
Source repository

What it does

Floor provides automatic mapping between in-memory objects and SQLite database rows while offering full control via SQL. It uses code generation to create typesafe databases, DAOs, and entities, supporting both Futures and Streams for reactive queries.

AI-written summary of version 1.5.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want a Room-like ORM experience for SQLite in Flutter
  • You need typesafe database queries and reactive data streams

Skip it when

  • You do not know SQL or SQLite
  • You prefer a simple key-value store like SharedPreferences

Strengths

  • Typesafe and reactive with Stream support
  • Familiar Room-like architectural pattern
  • Full control over underlying SQL

Weaknesses

  • Requires understanding of SQL and SQLite
  • Relies on code generation via build_runner

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
Yes (build_runner)
Direct dependencies
9

Requires adding floor, floor_generator, and build_runner to pubspec.yaml, and running build_runner to generate code.

final database = await $FloorAppDatabase.databaseBuilder('app_database.db').build();
final personDao = database.personDao;
final person = Person(1, 'Frank');
await personDao.insertPerson(person);
final result = await personDao.findPersonById(1);

Alternatives

Packages that do the same job and could replace floor.

  • drift

    If you want a more feature-rich reactive SQLite library with fluent query building.

  • sqlite3

    If you want direct low-level bindings to SQLite.

Works with

Packages commonly used together with floor: ones it builds on, ones built on it, and its own family.