I am working a FLUTTER project and need to write a method (or maybe a function). One of the parameters in the method needs to be an expression like:
PlayList videos = videoList[index] as PlayList
Is it possible? If so what type should I should use.
typedef ProcessCallback = PlayList Function();
void foo(ProcessCallback callback) {
/// result type is PlayList
var result = callback.call();
}
ProcessCallback callback = () => videoList[index] as PlayList;
foo(callback);