Skip to content
pubscout

sqflite_common

2.5.17, released 10 days ago by tekartik.com

Dart wrapper on SQLite providing the common API for sqflite and desktop FFI implementations.

WASM-readyRock solid
$ flutter pub add sqflite_common
Source repository

What it does

It provides a platform-agnostic Dart wrapper and shared API for SQLite databases. It is primarily intended to allow developers to write logic shared across Flutter apps and desktop binaries.

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

Use it when

  • You are writing platform-agnostic logic shared between Flutter and desktop binaries using SQLite.
  • You are developing a package that wraps sqflite APIs for multiple platforms.

Skip it when

  • You are writing a standard Flutter mobile app (use sqflite instead).
  • You are writing a desktop-only app (use sqflite_common_ffi instead).

Strengths

  • Enables writing platform-agnostic business logic using sqlite_api.
  • Serves as the common foundation for sqflite and sqflite_common_ffi.

Weaknesses

  • Not intended for direct use in standard applications.
  • Requires proper platform-specific implementations to be imported alongside it.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
3

Add to pubspec.yaml and import sqlite_api.dart when writing shared cross-platform logic.

import 'package:sqflite_common/sqlite_api.dart';

Alternatives

Packages that do the same job and could replace sqflite_common.

  • drift

    If you prefer a reactive, type-safe SQL database library with code generation.

  • sqlite3

    If you want a direct Dart binding to SQLite without the sqflite wrapper API.

Works with

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