我应该使用Bloc的哪个API呼叫?
我是新手的颤抖,我有一些有关集团的疑问,并且正在研究小型项目以发展技能。您能帮我了解集团和改进吗?
我在每个屏幕上都使用bloc(每个API调用 - 获取,帖子)
从后端开始,我只是让MachineId选择机器 - 在这里我使用了Bloc(仅用于MachineId,我使用了Bloc,是否可以,还是可以我致电http.get nonlone bloc。
有关后端的许多详细信息i二手bloc-我想,在这里使用bloc是很好的,因为我得到了很多细节。
对于一个数据,我使用了集合,对于许多数据,我现在使用了集合,因为我使用状态非常大,每个API调用的事件-30 API
I'm new to flutter, I have some questions about bloc and I'm working on small projects to develop skills. Could you help me to know about bloc and improve?
I used bloc on every screen (every API call - GET,POST)
From the backend, I'm only getting machineID to select machines - Here I used bloc (Just for machineID I used bloc, Is it okay or just can I call http.get without bloc.
For many details from the backend I used bloc - I thought, it is good to use bloc here because I'm getting many details.
For one data I used bloc and for many data I used bloc now my project folder is very big because I used state, event for every API call - 30 API
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这不是问题,您的项目文件夹很大,将出现在任何其他州管理中。您可以为每一件事使用BLOC,但是我建议Bloc仅用于句柄数据,当更新小UI喜欢:更新复选框,更新下拉列表,更改文本,更改颜色.....我们应该使用setState()
I think it is not problem, Your project folder is very big will appear in any other state management. You can use bloc for every thing, but I suggest that bloc just using for handle data, when update small UI like: update checkBox, update dropdown, change text, change color..... we should use setState()