【问题标题】:How can I connect my Flutter app to local sql server database using API?如何使用 API 将我的 Flutter 应用程序连接到本地 sql server 数据库?
【发布时间】:2020-03-20 09:54:39
【问题描述】:

我正在开发一个需要从 sql server 执行 CRUD 功能的颤振应用程序。我研究并发现我可以使用 REST API 或 web 服务。我该如何实现?

【问题讨论】:

  • How can I implement this 太宽泛了。实现API并基本使用。

标签: android sql web-services flutter restful-authentication


【解决方案1】:

第 1 步:选择可让您创建 REST API 的后端语言/框架。 Laravel 就是其中之一。如果您想要 Dart 中的所有内容,我听说 Aqueduct 是一个不错的选择。

编辑/注:渡槽日落新闻在这里:https://stablekernel.com/article/announcing-the-sunsetting-of-aqueduct-our-open-source-server-side-framework-in-googles-dart/

第 2 步:让后端执行需要对数据库执行的操作。确保您处理安全/身份验证。使用 Postman 之类的工具对其进行测试。手动能够像应用程序使用它一样使用它,例如,“发出这个请求会添加一个帖子”。

第 3 步:现在开发一个 Flutter 应用程序,该应用程序使用 Dart 包(如 dio、http 等)连接到此后端。更多信息请点击此处:https://flutter.dev/docs/cookbook#networking

【讨论】:

  • 感谢@Gazihan Alankus 的回复。我有 laravel 的经验,虽然我不知道如何将 laravel REST API 与颤振联系起来。
猜你喜欢
  • 1970-01-01
  • 2018-05-16
  • 1970-01-01
  • 1970-01-01
  • 2013-06-01
  • 1970-01-01
  • 2017-06-10
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多