Search code snippets, questions, articles...

Call back function from one class to another

class Class1Name{
    Class2Name(functionName: functionName);

    void functionName(){
        //desired actions
    }
}

class Class2Name {
    final VoidCallback functionName;
    Class2Name({@required this.functionName});

    //call function
    functionName();
}

https://www.digitalocean.com/community/tutorials/flutter-widget-communication
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place.

Search Index Data (The code snippet can also be found with below search text)

VoidCallback
Call back function
from one class to another
Was this helpful?
0 Comments