data_provider 代表什么? [BloC设计模式]

发布于 2025-01-10 07:34:57 字数 248 浏览 3 评论 0原文

我正在关注 BloC 的一些视频/课程。这样的结构引起了我的注意:

在此处输入图像描述

我应用了文件夹结构。我不明白的是 data_provider 里面应该包含什么,它应该是什么样子?我应该在里面放什么?

I am following some videos/courses for BloC. A structure like this took my attention:

enter image description here

And I applied the folder structure. What I couldn't figure out is what should be inside in data_provider how it should look? What am i supposed to put in it?

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

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

发布评论

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

评论(1

烟─花易冷 2025-01-17 07:34:58

Bloc 和 Cubits 用于 flutter 的状态管理。在这种情况下,data_providers 目录将包含从 API 或任何数据源获取可在整个应用程序中使用的数据的功能。

Bloc and Cubits are used in state management of your flutter.For this case the data_providers directory will contain the functionality of fetching the data to be availed throughout your app probably from an API or whatever the source of your data.

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