widget binding vs scheduler binding in flutter

huangapple go评论64阅读模式
英文:

widget binding vs scheduler binding in flutter

问题

I am trying to understand the meaning of widget binding vs scheduler binding, but I do still confuse about them. As I read information, widget binding: "This is the glue that binds the framework to the Flutter engine," but I cannot fully understand what is "framework" and "Flutter engine" here. Can someone explain it in a simple way that is easy to understand?

英文:

I am trying to understand the meaning of widget binding vs scheduler binding, but I do still confuse about them. As I read a information, widget binding : This is the glue that binds the framework to the Flutter engine. but I can not fully understand what is framework and Flutter engine here. Can someone explain it in a soft way that easily to be understood

答案1

得分: 1

Widget Binding: 这是Flutter框架的一部分,它将框架与Flutter引擎连接或“绑定”在一起。它建立了小部件树与引擎之间的通信。当您在应用程序中创建、更新或删除小部件时,小部件绑定确保这些更改反映在引擎渲染的UI中。它充当了框架与引擎之间的桥梁,确保它们无缝协作。

Scheduler Binding: 调度器绑定负责管理Flutter应用程序中任务和动画的调度。它控制应用程序的不同部分何时以及如何更新和渲染。调度器绑定在小部件绑定和引擎之间协调,确保UI更新正确同步。它安排任务,如重建小部件、处理用户输入事件、运行动画等。本质上,它有助于维护应用程序的平稳和响应行为。

示例链接:https://medium.com/flutterworld/flutter-schedulerbinding-vs-widgetsbinding-149c71cb607f

英文:

Widget Binding: This is part of the Flutter framework that connects or "binds" the framework to the Flutter engine. It establishes communication between the widget tree and the engine. When you create, update, or remove widgets in your app, the widget binding ensures that these changes are reflected in the UI rendered by the engine. It acts as a bridge between the framework and the engine, making sure they work together seamlessly.

Scheduler Binding: The scheduler binding is responsible for managing the scheduling of tasks and animations in a Flutter app. It controls how and when different parts of the app are updated and rendered. The scheduler binding coordinates between the widget binding and the engine, ensuring that the UI updates are synchronized properly. It schedules tasks like rebuilding widgets, handling user input events, running animations, and more. Essentially, it helps maintain the smooth and responsive behavior of the app.

I put a URL for an example: https://medium.com/flutterworld/flutter-schedulerbinding-vs-widgetsbinding-149c71cb607f

huangapple
  • 本文由 发表于 2023年7月13日 10:46:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/76675566.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定