适用于 Flutter 的官方 Realm SDK。Realm 是一个移动数据库,是 SQLite 和键值存储的替代方案
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
add:添加用户到仓库 Signed-off-by: ywp791322 <yangweiping7@h-partners.com> | 3 个月前 | |
Cherry-pick fixes from community branch (#1873) Co-authored-by: Florian <laforest.florian@gmail.com> | 10 个月前 | |
update realm_dart to Dart 2.12.0 (from the official Dart SDK package, the Flutter 2.0 version of Dart 2.12.0 has issues) clean up cmake and remove hard coded paths introduce IsFlutterPlatform constant to switch loading realm_flutter only on Flutter platforms | 5 年前 | |
Github composite action for setting up flutter on runner (#1710) * Use workflow_dispatch * source ~/.profile to update paths after install of puro * Update $GITHUB_PATH * Checkout first * Add cache + simplify puro install * use --global, no melos setup, and some cleanup * .puro != ~/.puro * export $PUB_CACHE and $PURO_ROOT * Don't source ~/.profile. Set env variables explicitly * Tweak cache key * Support windows * Convert setup-runner from workflow to action * Blunt hack to get windows working * Skip stuff on partial (or exact) cache-hit * Switch from run_id to hashFiles * Use runPubGetOffline * Populate pub-cache explicitly on cache miss, as melos bootstrap no longer does * Update cSpell.words * Use for: compile for web * Remove inverted save cache condition (Debug code) * Update CHANGELOG * Ensure caches are cycled atleast once a week | 2 年前 | |
Update build instructions and switching Flutter/Dart versions (#1571) * Update contrib docs. * Allow comments in json example. * Update build command reference. * Incorporate feedback Co-authored-by: Ferdinando Papale <4850119+papafe@users.noreply.github.com> --------- Co-authored-by: Ferdinando Papale <4850119+papafe@users.noreply.github.com> | 2 年前 | |
docs: 文档移动至根目录 Signed-off-by: ywp123123 <yangweiping7@h-partners.com> | 1 个月前 | |
add editorconfig (#245) * "Steal" .editorconfig settings for *.cpp, *.h, etc. from realm-dotnet repo * Format all src/*.{h, cpp} | 4 年前 | |
Added metrics support (#134) * Added json annotated metrics class * Generate for example/**.dart as well * Added vscode extension recommendations * Use build_version package to embed packageVersion string * Upgrade (dev-)dependencies and order ascending * Build to .part file, not .dart. Will be combined by combining_builder * Added separate metrics project (for now, try to avoid later) * Improved metrics upload * Added cli options to metrics * Added metrics reporting on gradle build * Fixed hanging metrics process * Fixed wrong workingDir * Added linux, macos and windows as platforms * Added metrics hook in realm.pubspec (ios & macos) * Changed to read name from pubspec.yaml instead * Changed to honour CI & REALM_DISABLE_ANALYTICS env variables * Added metrics hook in CMakeList.txt (linux & windows) * Added build of example for linux and windows * Fixed sdk constraint (2.14.4 -> 2.12.0) * Added defensive code to avoid breaking build if app subproject doesn't exist * Changed to accomodate PR comment. exitCode = 64 has meaning on *nix only * Changed to accomodate PR comment. Be more frugal with vscode extension recommendation * Changed to report flutter as framework instead of dart, if requested. Defaults to flutter * Added defensive code to handle missing flutter exe * Added version to language * Cleanup pubspec files * Enable strict-mode + strict-raw-types and fix all linter warnings for metrics * Move metrics project into realm_dart * Minimal changes to lib/src/*.dart files to compile under strict analysis * Use new metrics subcommand during build * Fixed hanging metrics command without calling exit(0) * Fix pubspecs * reuqire cmake version 3.15+ * Split desktop support into separate PR * Handle %WINDIR% explicitly when calling Process.start * Normalize line-endings * Let realm_generator be a direct dependency for realm, so that it becomes a transitive dependency for all users. That way user only has to depend on realm/realm_dart * Add copyright * Moved comment for better context * Change description of generate command Co-authored-by: blagoev <lubo@blagoev.com> * Tweak metrics command description Co-authored-by: blagoev <lubo@blagoev.com> * Use different framework names * Tweak description on install command Co-authored-by: blagoev <lubo@blagoev.com> * Remove comment Co-authored-by: blagoev <lubo@blagoev.com> * Remove stale comment * Upload metrics runtime in debug-mode * Downgrade deps to Flutter 2.0.0 / Dart 2.12.0 * Be smarter about reporting flutter framework info * Fix isFlutterPlatform inconsistency * Log squashed errors * Use flutter SDK constraints as last fallback before giving up, and tighten comments * Don't throw on missing flutter.sdk property * Realm metrics command is very resilient against errors to avoid breaking customers builds. However, we would like to break our own builds if an error occurs in relation to the metrics subcommand. Hence we introduce REALM_CI env variables that will disable actual upload of metrics, but still gather them, and fail hard on error in the process * Set REALM_CI in github actions * Call correct version of dart in realm.podspec using $FLUTTER_ROOT and parse to metrics subscommand using --flutter-root argument Co-authored-by: blagoev <lubo@blagoev.com> | 4 年前 | |
gitignore release folder | 2 年前 | |
feat:realm鸿蒙化 Signed-off-by: zhou_yunfeng <zhouyunfeng14@h-partners.com> | 6 个月前 | |
release: release realm-20.1.1-ohos-1.0.0 Signed-off-by: ywp123123 <yangweiping7@h-partners.com> | 1 个月前 | |
Add vNext Changelog header (#1875) Co-authored-by: nirinchev <nirinchev@users.noreply.github.com> | 10 个月前 | |
chore: 仓库和文档链接更新为CPF-Flutter Signed-off-by: ywp123123 <yangweiping7@h-partners.com> | 2 个月前 | |
🔄 Synced file(s) with realm/ci-actions (#1089) * 🔄 Synced local 'LICENSE' with remote 'synced-files/LICENSE' * 🔄 Synced local '.github/workflows/Issue-Needs-Attention.yml' with remote 'synced-files/.github/workflows/Issue-Needs-Attention.yml' * 🔄 Created local '.github/workflows/no-response.yml' from remote 'synced-files/.github/workflows/no-response.yml' * 🔄 Synced local '.github/workflows/auto-assign.yml' with remote 'synced-files/.github/workflows/auto-assign.yml' * 🔄 Synced local '.github/auto_assign.yml' with remote 'synced-files/.github/auto_assign.yml' * 🔄 Synced local '.github/workflows/check-changelog.yml' with remote 'synced-files/.github/workflows/check-changelog.yml' * 🔄 Created local '.github/advanced-issue-labeler.yml' from remote 'synced-files/.github/advanced-issue-labeler.yml' * 🔄 Created local '.github/workflows/issue-labeler.yml' from remote 'synced-files/.github/workflows/issue-labeler.yml' * 🔄 Synced local '.github/ISSUE_TEMPLATE/feature.yml' with remote 'synced-files/.github/ISSUE_TEMPLATE/feature.yml' | 3 年前 | |
fix: 解决本地编译问题 Signed-off-by: 城meto <myxuan475@126.com> | 1 个月前 | |
release: release realm-20.1.1-ohos-1.0.0 Signed-off-by: ywp123123 <yangweiping7@h-partners.com> | 1 个月前 | |
release: release realm-20.1.1-ohos-1.0.0 Signed-off-by: ywp123123 <yangweiping7@h-partners.com> | 1 个月前 | |
Revert "DOCSP-53339: Add converted .md docs to source code repo /docs dir for…" (#1866) | 11 个月前 | |
RDART-930: Refactor handles (#1550) * Refactor handles subscription.dart * Refactor: use import over part for handle_base.dart * Fix regression: Check if close on handle deref * TMP: Skip some tests (something broke with RootedHandle) * Ups! * Wip * After rebase * wip * Fix after rebase * Revert "TMP: Skip some tests (something broke with RootedHandle)" This reverts commit 50812177a35ba3aff64860af791f6fab9e7b897d. * Use dart_test.yaml to configure tags. Make baas a tag instead of a prefix. Simplify * Fix nullPtr related bug * Doh! I'll go die in shame!! * Refactor RealmHandle * Refactor ConfigHandle * Refactor _RealmQueryHandler (now QueryHandle) * Refactor RealmObjectHandle (now ObjectHandle) * Refactor RealmResultHandle (now ResultsHandle) * More RealmHandle stuff * Don't need Tuple * Expose disableAutoRefreshForTesting * Refactor UserHandle * RealmHandle.findAll * Realm.find/.findExiting/.renameProperty * Drop superfluous this. * Refactor AppHandle * Refactor SchedulerHandle * Move config handles * Refactor SessionHandle * UserHandle.linkCredentials/.createApiKey/.fetchApiKey/.fetchAllApiKeys.deleteApiKey/.disableApiKey/.enableApiKey * Refactor RealmListHandle (now ListHandle) * Refactor RealmSetHandle (now SetHandle) * Refactor RealmAppCredentialsHandle (now CredentialsHandle) * WIP * WIP2 * Organize imports * ResultsHandle stuff * More UserHandle stuff * subscribeForSchemaNotification (something rubs me the wrong way about this) * Move MapHandle.query * More ObjectHandle stuff * Move callback functions into handle files * Move resolveX to XHandle.resolveIn * Make a bunch of function public in prep for getting rid of parts * Refactor XChangesHandle * Use CredentialsHandle not Credentils * Traffic in ResultsHandle not RealmResult + dart fix stuff * Split part files * Move XTokenHandles * toNative extension method replaces toRealmValue function * Replace last use of deprecated Pointer.elementAt(i) * More RealmHandle stuff * Replace invokeGetBool and invokeGetPointer * Run melos custom_format * Move callAppFunction stuff * Refactor equals * Move raiseIfNull to HandleBase ctor. Rename to be explicit about call to getLastError * Completely unrelated spelling corrections in CHANGELOG * Seperate AsyncOpenTaskHandle and NotificationHandle from realm_core.dart * moving guardSynchronousCallback and getApp out of realm_core.dart * Split native convertion functions into separate files * Last leg.. for now * PR feedback * Fix rebase * Tweat memEquals perf test * fixup! Last leg.. for now * Fix after rebase * more PR feedback | 2 年前 | |
readme添加3.35flutter版本 Signed-off-by: zhou_yunfeng <zhouyunfeng14@h-partners.com> | 5 个月前 | |
Switch to integration tests (#1461) * Allow tests to be run as integration tests * Adapt flutter driver tests to new structure * Drop flavor_helpers.dart Use copyFile function variable instead, and override runtime in driver tests * Drop lib symlinks in tests Use package imports over ../lib relative imports * Use a group per test file * Remove test symlink as well * Check both dart defined and shell defined env .. to support both flutter drive and dart test * Fix CI * Simplify dartdoc_options.yaml a bit * Switch to integration_test * bump compileSdkVersion to 33 for android integration tests * Disable realm_map_test on Android integration tests (TEST) * Run android flutter tests on ubuntu-latest - faster, cheaper, and more runners * Enable gradle caching * Only drop Decimal128 tests on Android (TEMPORARY) * Re-create platforms * Allow network again for macos * Publish Test Report from flutter integration test * Remember to set org to io.realm when creating platforms projects * Move copyFile * Fix line-length in app_test.dart * default differentiator to 'local' * Add full directories as assets | 2 年前 | |
Cherry-pick fixes from community branch (#1873) Co-authored-by: Florian <laforest.florian@gmail.com> | 10 个月前 | |
fix: 解决本地编译问题 Signed-off-by: 城meto <myxuan475@126.com> | 1 个月前 | |
Update melos to 5.2.0 (#1587) - Use new steps feature (https://github.com/invertase/melos/pull/664) - Drop analyze and format scripts, as these are now internal commands to melos - Renamed format script to custom_format - Renamed analyze:deps to lint:deps | 2 年前 | |
feat:realm鸿蒙化 Signed-off-by: 城meto <myxuan475@126.com> | 6 个月前 |
realm
本项目基于 realm 开发。
1. 安装与使用
1.1 安装方式
进入到工程目录并在 pubspec.yaml 中添加以下依赖:
pubspec.yaml
...
dependencies:
realm:
git:
url: https://gitcode.com/CPF-Flutter/fluttertpc_realm
path: packages/realm
# ref: Please select the TAG to the TAG Version Mapping
ref: realm-20.1.1-ohos-1.0.0
...
执行命令
flutter pub get
TAG 版本对应表
| Flutter 框架版本 | TAG | 分支 |
|---|---|---|
| 3.7 | - | - |
| 3.22 | - | - |
| 3.27 | realm-20.1.1-ohos-1.0.0 | main |
| 3.35 | realm-20.1.1-ohos-1.0.0 | main |
1.2 使用案例
使用案例详见 example
2. 约束与限制
2.1 兼容性
在以下版本中已测试通过
- Flutter: 3.27.5-ohos-1.0.1; SDK: 5.0.0(12); IDE: DevEco Studio: 5.1.0.828; ROM: 5.1.0.130 SP8;
- Flutter: 3.35.7-ohos-0.0.1; SDK: 6.0.1(21); IDE: DevEco Studio: 6.0.1.260; ROM: 6.0.0.120 SP6;
3. API
"ohos Support"列为 yes 表示 ohos 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
realm
| Name | Description | Type | Input | Output | ohos Support |
|---|---|---|---|---|---|
| write | 在写入事务中同步调用提供的回调。 | function | 无 | Future | yes |
| add | 添加 | function | RealmObject | Future | yes |
| all | 返回所有RealmObject数据 | function | RealmObject | Future | yes |
| all<>().query | 根据条件过滤数据 | function | RealmObject | Future | yes |
4. 遗留问题
无
5. 开源协议
本项目基于 The MIT License,请自由地享受和参与开源。