已经在不支持 Web 应用程序的移动应用程序中使用 sqflite 数据库,如果是的话,我可以在相同的 Web 应用程序中使用不同的库吗?

发布于 2025-01-09 00:07:10 字数 171 浏览 3 评论 0原文

我正在使用 sqflite 库作为数据库,但它支持 IOS/Android 应用程序,我可以使用现有应用程序的数据库(Sqflite)和对于同一个应用程序中的 webApp ,如果我可以的话,那么如何以及哪个将是最好的。谢谢

i am using sqflite library for database but it is supporting to IOS/Android app can i use to database for App existing one(Sqflite) and for webApp different in the same app if I can then how and which will be the best.Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

好倦 2025-01-16 00:07:11

是的。您可以使用单独的网络包。现在,要检查您的应用程序是否在网络上运行:

import 'package:flutter/foundation.dart' show kIsWeb;

if (kIsWeb) {
  // running on the web!
} else {
  // NOT running on the web! You can check for additional platforms here.
}

如果您的用例只是存储小值,您可以使用 shared_preferences 网络和移动设备均支持。

您还可以尝试两者都支持的 hive

Yes. You can use a separate package for the web. Now, to check whether your app is running on web or not:

import 'package:flutter/foundation.dart' show kIsWeb;

if (kIsWeb) {
  // running on the web!
} else {
  // NOT running on the web! You can check for additional platforms here.
}

If your use-case is just to store small values, you can use shared_preferences which is supported for both web and mobile.

You can also try hive which is supported for both.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文