简体   繁体   English

flutter(Dart)是否具有类似于js绑定的功能?

[英]Does flutter(Dart) have a function similar to js bind?

Does flutter(Dart) have a function similar to js bind? flutter(Dart)是否具有类似于js绑定的功能? I wanted to do something similar in flutter. 我想做些类似的事情。

like: 喜欢:

 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script> <script> function handlerName(e) { alert(e.data.msg); } $(document).ready(function(){ $("p").bind("click", {msg: "chicked!"}, handlerName) }); </script> </head> <body> <p>click me!</p> </body> </html> 

There is nothing like bind in Dart 在Dart中没有什么像bind

but this might do what you want as well: 但这可能也会满足您的需求:

onReady.listen((e) => handlerName(e, msg: 'clicked'))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM