Concept of delegate in Flutter

Asked

Viewed 175 times

1

I saw that there is no support for delegate in flutter, is there any way to implement something like that? I believe that a callback work, I tried to formulate some examples but I’m not able to understand.

1 answer

2


I’m going to talk about Dart and not Flutter because Flutter isn’t supposed to have this, this is a language mechanism and the language is Dart, so you can use this in Flutter. It seems like people who are learning Flutter don’t even understand what they’re using.

Did you know that callback is the name of the technique that the delegate usa? I mean, you’re talking about the same thing. I guess just because Flutter or Dart doesn’t use the term delegate is struggling. It has syntax of lambda, so has delegate yes, even without using the name. See What is the difference between a lambda expression, a closure and a delegate?.

metodo(() => print('Hello, World!'))

I put in the Github for future reference.

Ready is using a delegate in Dart (I consider that this metodo() will do something and at some point will call a parameterized execution).

  • Thanks Maniero, as it is a lot of information that I am trying to absorb at the same time I end up getting in a bit of a way.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.