搜索插件、代码仓与 APP 分类

插件详情v5.3.2

objectbox_sync_flutter_libs

用于持久化 Dart 对象的快速 Flutter 数据库。此包包含 ObjectBox 的 Flutter 运行时库,包括 ObjectBox Sync。

AndroidiOSmacOSWindowsLinux
近 30 天下载
4450
喜欢数
12
Pub 分数
135

安装插件

flutter pub add objectbox_sync_flutter_libs

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

ObjectBox Sync Flutter 库为 Flutter 应用提供高性能、实时的数据库解决方案,可实现跨设备和平台的 Dart 对象无缝同步。基于 ObjectBox 核心构建,支持离线优先的数据管理,具备自动冲突解决功能,并可在网络上高效同步。适用于需要快速本地存储以及在多个客户端之间同步数据的应用程序,该包可直接集成到 Flutter 项目中,设置简单。它适用于 Android、iOS、macOS、Windows 和 Linux,适合需要可靠、低延迟数据持久化和同步的跨平台应用程序。

适合场景

  • 实时协作应用
  • 离线优先的移动应用
  • 跨设备数据同步
  • 高性能本地数据存储
  • 多平台数据一致性

主要特点

  • 快速本地对象持久化
  • 实时数据同步
  • 同步过程中的冲突解决
  • 对多个平台的支持
  • 最小化样板设置

适合对象

  • 开发跨平台应用的开发者
  • 需要实时数据同步的团队
  • 需要离线功能的应用程序
  • 优先考虑性能和可扩展性的项目
  • 移动应用中的分布式用户数据

使用建议

  • 需要后端基础设施来同步
  • 仅限具有定义模式的 Dart 对象
  • 同步操作的网络依赖
  • 同步冲突处理的学习曲线
  • 需要适当的模式版本控制

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

ObjectBox

Getting Started • Documentation • Example Apps • Issues • Blog

Build and test pub.dev package

Flutter database with vector support - easy to use & fast Dart object persistence, plus on-device vector search 💙

Very first on-device vector database for Flutter / Dart AI apps. Intuitive APIs, simply fast. Persist local Dart objects with ease & speed, efficiently manage vectors.

ObjectBox provides a store with boxes to put objects into:

// Annotate a Dart class to create a Box
@Entity()
class Person {
  @Id()
  int id;
  String firstName;
  String lastName;

  Person({this.id = 0, required this.firstName, required this.lastName});
}

final Store store = await openStore(directory: 'person-db');
final box = store.box<Person>();

var person = Person(firstName: 'Joe', lastName: 'Green');
final id = box.put(person); // Create

person = box.get(id)!;      // Read

person.lastName = 'Black';
box.put(person);            // Update

box.remove(person.id);      // Delete

final query = box           // Query
    .query(Person_.firstName.equals('Joe') & Person_.lastName.startsWith('B'))
    .build();
final List<Person> people = query.find();
query.close();

Ready? Continue with the ➡️ Getting Started guide.

Why use ObjectBox

ObjectBox Flutter database is an excellent choice for storing Dart objects in cross-platform applications and the only on-device database that offers you vector support for your on-device AI apps. Designed for high performance, the ObjectBox Flutter database is excellent for mobile and IoT devices. ObjectBox consumes minimal CPU, memory, and battery, ensuring that your software is not only efficient but also sustainable. By storing data locally on the device, ObjectBox allows you to cut cloud costs and create an app that does not require a connection. Get started with our intuitive native Dart API in minutes, without the hassle of SQL. Plus: We built a data synchronization solution that allows you to keep data in sync across devices and servers, both online and offline.

Features

🏁 Very first on-device vector database - for AI apps that work any place.

🏁 High performance - superfast response rates enabling real-time applications.
🪂 ACID compliant - Atomic, Consistent, Isolated, Durable.
💻 Multiplatform - Android, iOS, macOS, Linux, Windows, any POSIX-system.
🌱 Scalable - grows with your app, handling millions of objects with ease.
💚 Sustainable - frugal on CPU, Memory and battery / power use, reducing CO2 emissions.

🔗 Relations - object links / relationships are built-in.
💐 Queries - filter data as needed, even across relations.
🦮 Statically typed - compile time checks & optimizations.
📃 Schema migration - change your model with confidence.

Oh, and there is one more thing...

😮 Data Sync - keeps data in sync offline or online, between devices and servers.

Getting Started

Continue with our ➡️ Getting Started guide. It has resources and video tutorials on how to use ObjectBox in your Flutter or Dart app.

How does ObjectBox compare to other solutions?

  • ObjectBox is fast. Have a look at our benchmarks below, or test it for yourself
  • It's a full NoSQL SQLite alternative with intuitive Dart APIs you'll love 💙
  • It comes with an out-of-the-box Data Sync, making it an effective self-hosted Firebase alternative
Flutter Database Performance Benchmarks

We tested across the four main database operations, CRUD (create, read, update, delete). Each test was run multiple times and executed manually. Data preparation and evaluation were done outside the measured time.

Here are the benchmarks for ObjectBox vs sqflite vs Hive (last updated 2021-09-11) 👇

You can run these yourself using our objectbox-dart-performance Flutter benchmark app.

How do you 💙 ObjectBox?

We're looking forward to receiving your comments and requests:

Thank you! 🙏

For general news on ObjectBox, check our blog!

Contributing

Do you want to check out the ObjectBox code itself? E.g. see it in action, run tests, or even contribute code? Great! Clone/check out this repository and run this to generate code and get you started quickly:

./tool/init.sh

Also, make sure to have a look at the contribution guidelines - we are looking forward to your contribution.

Packages

This repository holds all ObjectBox Dart/Flutter packages as separate directories:

There's also a separate repository benchmarking objectbox (and other databases) in Flutter: objectbox-dart-performance.

See CONTRIBUTING.md for a more detailed overview.

Other languages/bindings

ObjectBox supports multiple platforms and languages:

  • Java SDK: runs on Android and JVM (desktop, servers)
  • Swift SDK: build fast mobile apps for iOS and macOS
  • Go SDK: great for data-driven tools and embedded server applications
  • C / C++ SDK: native speed with zero copy access to FlatBuffer objects

License

Copyright © 2019-2026 ObjectBox Ltd. <https://objectbox.io/>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Note that this license applies to the code in this repository only. See our website on details about all licenses for ObjectBox components.

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目

暂无相关数据。